diff options
| author | Duncan Smith | 2010-09-10 20:59:18 -0700 |
|---|---|---|
| committer | Duncan Smith | 2010-09-10 20:59:18 -0700 |
| commit | d84960ffd0b2b6f729c39557da668fafd00e7330 (patch) | |
| tree | e2178df1bcf9cfd16f418d04837faa50e3fa32f2 | |
| parent | 6a965ad0fa083a07af59577c690e25c9173b912d (diff) | |
Underef routine now should work correctly
| -rw-r--r-- | main.asm | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -103,10 +103,10 @@ deref: EVEN deref_table: -mem_page_0: dc.l 0 ; bank 0 -mem_page_1: dc.l 0 ; bank 1 -mem_page_2: dc.l 0 ; bank 2 -mem_page_3: dc.l 0 ; bank 3 +mem_page_0: dc.l 0 ; bank 0 / 0x0000 +mem_page_1: dc.l 0 ; bank 1 / 0x4000 +mem_page_2: dc.l 0 ; bank 2 / 0x8000 +mem_page_3: dc.l 0 ; bank 3 / 0xc000 xdef mem_page_0 xdef mem_page_1 @@ -133,29 +133,36 @@ pages: dc.l 0 ; XXX AFAICS, a1 is currently a scratch address register, so you can load deref_table in it, and then save some space: ; But you may wish to use it for other purposes in the future, so you needn't integrate that immediately. underef: + move.l d2,-(a7) lea deref_table(pc),a1 move.l a0,d0 + clr.w d2 sub.l (a1)+,d0 bmi.s underef_not0 cmpi.l #$4000,d0 bmi.s underef_thatsit underef_not0: move.l a0,d0 + move.w #$4000,d2 sub.l (a1)+,d0 bmi.s underef_not1 cmpi.l #$4000,d0 bmi.s underef_thatsit underef_not1: move.l a0,d0 + move.w #$8000,d2 sub.l (a1)+,d0 bmi.s underef_not2 cmpi.l #$4000,d0 bmi.s underef_thatsit underef_not2: + move.w #$c000,d2 suba.l (a1)+,a0 ;; if that fails too, well shit man! moveq #0,d0 underef_thatsit: + add.w d2,d0 + move.l (a7)+,d2 rts |
