diff options
| author | Duncan Smith | 2010-09-07 19:12:01 -0700 |
|---|---|---|
| committer | Duncan Smith | 2010-09-07 19:12:01 -0700 |
| commit | dbe094eeae873ff5788b99d8a9c763df963d3a30 (patch) | |
| tree | adc7d83bc7634d4dc8aeab8f7955ed8fd452c7ec /ports.asm | |
| parent | c4f950804cbf98ffb2ec6eef4928e1795132df83 (diff) | |
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.
Diffstat (limited to 'ports.asm')
| -rw-r--r-- | ports.asm | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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: |
