diff options
| author | Duncan Smith | 2010-06-21 14:51:44 -0700 |
|---|---|---|
| committer | Duncan Smith | 2010-06-21 14:51:44 -0700 |
| commit | f2fc7ea378ce3b5e6d4a4ebc0abe0d103c25ba46 (patch) | |
| tree | cc0fae75aa0b2dfd38ee85615421a03d2152a35d | |
| parent | c2d7f209a872d7fe0571c924b4386f45717f8408 (diff) | |
Parted out F_SBC_B to alu_sbc.
| -rw-r--r-- | alu.asm | 19 | ||||
| -rw-r--r-- | opcodes.asm | 15 |
2 files changed, 22 insertions, 12 deletions
@@ -1,4 +1,21 @@ ;; Parting out the big math/logic routines from the ;; instruction dispatch table. - +alu_sbc: + ;; SBC instruction + ;; SBC d1,d0 + ;; d1 - (d0+C) -> d1 + ;; sets flags + + push.l d2 + bsr flags_normalize + move.b flag_byte(pc),d2 + andi.b #1,d2 + add.b d0,d2 + move.b d2,(f_tmp_src_b-flag_storage)(a3) + move.b d1,(f_tmp_dst_b-flag_storage)(a3) + sub.b d2,d1 + move sr,(f_host_sr-flag_storage)(a3) + move.w #$0202,(flag_byte-flag_storage)(a3) + pop.l d2 + rts diff --git a/opcodes.asm b/opcodes.asm index 9b550ea..35a7f4f 100644 --- a/opcodes.asm +++ b/opcodes.asm @@ -1439,17 +1439,10 @@ emu_op_97: ;; Do a SBC \2,\1 F_SBC_B MACRO - ;; XXX TOO BIG - bsr flags_normalize - move.b flag_byte(pc),d0 - andi.b #1,d0 - add.b \1,d0 - move.b d0,(f_tmp_src_b-flag_storage)(a3) - move.b \2,(f_tmp_dst_b-flag_storage)(a3) - sub.b d0,\2 - move sr,(f_host_sr-flag_storage)(a3) - move.w #$0202,(flag_byte-flag_storage)(a3) - + move.b \2,d1 + move.b \1,d0 + bsr alu_sbc + move.b d1,\2 ENDM START |
