;03 3 in - "UART" status: bit 0 = rx, bit 1 = tx
;04 4 in - "UART" data register, no wait
;
+;------------------------ Virtual I2C interface --------------------------
+;05 5 out - Control Port: 1 = Start read operation
+; 2 = Start write operation
+;05 5 in - Status of last Transfer: 0 = ok, else fail
+;06 6 in/out - Number of bytes to transfer, including Slave address
+;07,08 7,8 in/out - Read/Write address low/high
+;
+;------------------------ Disk I/O ---------------------------------------
;0D,0E 13,14 in/out - Set address of Bios Controll Block
;0F 15 in/out - Disk select
;10,11 16,17 in/out - Track select
;16 22 in - Result of last read/write operation.
; 0x00 = ok, 0xff = error (--> Bad Sector)
;
+;
+;
+;------------------------ Wall Clock and Timers --------------------------
;40 64-71 in/out - Timer/Clock control.
-;46
+;41-46
+;
+;47-4D clock - BCD format: ss, mm, hh, DD, MM, YYl, YYh
+;
+;------------------------ Ports ------------------------------------------
+;80-87 in/out - Port-Expander PCF8574 (max. 8 Chips)
+;88-8F in/out - Port-Expander PCF8574A (not implemented yet!)
; ---------------------------------------------- Start of Code Segment
.dw uartin
.dw uartout
- .db 13,9 ; Port 13-21, (lenth 9)
+ .db 13,9 ; Port 13-21, (length 9)
.dw dsk_param_get
.dw dsk_param_set
.db 22,1
.dw dskDoIt
.db TIMERPORT,7
+ .dw utimeget
+ .dw utimeput
+
+ .db CLOCKPORT,7 ;Clock format (bcd): ss, mm, hh, DD, MM, YYl, YYh
.dw clockget
.dw clockput
+
+ .db DEBUGPORT,1
+ .dw dbg_stat
+ .dw dbg_ctrl
+
+#if I2C
+ .db I2CCTRL,1
+ .dw vi2c_stat_get
+ .dw vi2c_ctrl
+
+ .db I2CBLEN,3 ;
+ .dw vi2c_param_get
+ .dw vi2c_param_set
+
+ .db PORT,8
+ .dw pcf8574_in
+ .dw pcf8574_out
+#endif
+
.db 0,0 ; Stop mark
;---------------------------------------------------------------------
clt
vprw_start:
+ push yh
+ push yl
.if PORT_DEBUG > 1
tst temp2
brne dvp_1 ;don't debug console status
adiw z,4
rjmp vprw_loop
vprw_found:
- brtc PC+2
- adiw z,2
+ brtc PC+2 ;read or write?
+ adiw z,2 ;skip read function pointer
lpm _tmp0,z+
lpm _tmp1,z+
movw z,_tmp0
icall
rcall printhex
printstring " "
+ pop yl
+ pop yh
ret
dvp_2:
rcall printhex
printstring " "
- ijmp ; relative port # in temp3
+ ; relative port # in temp3
+ icall
+ pop yl
+ pop yh
+ ret
.else
- ijmp
+ icall
+ pop yl
+ pop yh
+ ret
.endif
vprw_exit:
vport_in_dummy:
ldi temp,0xff
vport_out_dummy:
+ pop yl
+ pop yh
ret
clr temp
lds temp2,rxcount
cpse temp2,_0
- rjmp uartgetc
+ ljmp uartgetc
ret
uartout:
lds temp2,txcount
cpi temp2,TXBUFSIZE
breq uartout_1
- rjmp uartputc
+ ljmp uartputc
uartout_1:
ret
dbgOut:
printnewline
printstring "Debug: "
- rcall printhex
+ lcall printhex
+ ret
+
+
+dbg_stat:
+ ldi temp,0
ret
+dbg_ctrl:
+ bmov intstat,i_trace, temp,0
+ ret
+
+
;---------------------------------------------------------------------
; vim:set ts=8 noet nowrap