From 63ac7e42bd2aefab3ae00c0f5a81dffdf3c102db Mon Sep 17 00:00:00 2001 From: Astrid Smith Date: Tue, 7 Sep 2010 19:12:01 -0700 Subject: IO port framework now works A68k is defaulting all my address moves to word size, rather than long. I don't know whether I've expunged all this nonsense yet, but I'm trying. This version executes an infinite loop which writes 'A' to port 00h. I've patched in a write-to-console function on port 00h, so this can be used as a sort of debug monitor. --- ports.asm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'ports.asm') diff --git a/ports.asm b/ports.asm index 5834ae5..c7b43e4 100644 --- a/ports.asm +++ b/ports.asm @@ -4,7 +4,10 @@ ;; Port is in d0, byte is in d1 ;; Destroys a0 port_in: - movea lut_ports_in(pc,d0),a0 + andi.w #$ff,d0 + add.w d0,d0 + add.w d0,d0 + movea.l lut_ports_in(pc,d0),a0 jmp (a0) rts @@ -267,7 +270,10 @@ lut_ports_in: dc.l port_in_ff port_out: - movea lut_ports_out(pc,d0.w),a0 + andi.w #$ff,d0 + add.w d0,d0 + add.w d0,d0 + movea.l lut_ports_out(pc,d0.w),a0 jmp (a0) rts @@ -531,6 +537,16 @@ lut_ports_out: port_in_00: port_out_00: + ;; Temporary test harness. Writing to this port writes a + ;; character to the screen. + SAVEREG + andi.w #$ff,d1 + move.w d1,-(sp) + jsr char_draw + addq #2,sp + RESTREG + rts + port_in_01: port_out_01: port_in_02: -- cgit v1.2.3