summaryrefslogtreecommitdiff
path: root/alu.asm
diff options
context:
space:
mode:
authorAstrid Smith2010-06-21 14:51:44 -0700
committerAstrid Smith2010-06-21 14:51:44 -0700
commit5728b3249ba24a47b836053584f2b9e9eeab1453 (patch)
tree25e98dbca2ec0eeac6e64e9431c7c458545e3c66 /alu.asm
parent4a12b7289ca0a3182d94d84bb78380fa841885a6 (diff)
Parted out F_SBC_B to alu_sbc.
Diffstat (limited to 'alu.asm')
-rw-r--r--alu.asm19
1 files changed, 18 insertions, 1 deletions
diff --git a/alu.asm b/alu.asm
index cce4011..18f5260 100644
--- a/alu.asm
+++ b/alu.asm
@@ -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