summaryrefslogtreecommitdiff
path: root/alu.asm
diff options
context:
space:
mode:
authorAstrid Smith2010-06-26 13:47:25 -0700
committerAstrid Smith2010-06-26 13:47:25 -0700
commit4eba8e12093c69e280d0c0809358d6f54a4ab9cf (patch)
tree77e2f7b348ee6170997eaabcbf64a0e4c05d1f03 /alu.asm
parentd6709af5a8ec03fc4e6a8689456c2b12c674a92a (diff)
Parted out ADC macro-instruction
Diffstat (limited to 'alu.asm')
-rw-r--r--alu.asm13
1 files changed, 13 insertions, 0 deletions
diff --git a/alu.asm b/alu.asm
index 8fa4271..5f22b44 100644
--- a/alu.asm
+++ b/alu.asm
@@ -14,6 +14,19 @@ alu_add:
rts
alu_adc:
+ ;; ADC instruction
+ ;; ADC d1,d0
+ ;; d1 + d0 + carry -> d1
+ 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)
+ add.b d2,d1
+ move sr,(f_host_ccr-flag_storage)(a3)
+ move.w #$0202,(flag_byte-flag_storage)(a3)
+ rts
alu_sbc:
;; SBC instruction