diff options
| author | Astrid Smith | 2010-06-26 13:44:07 -0700 |
|---|---|---|
| committer | Astrid Smith | 2010-06-26 13:44:07 -0700 |
| commit | d6709af5a8ec03fc4e6a8689456c2b12c674a92a (patch) | |
| tree | 0bdfa0c17a9e6ae40bf0923a0f2035741d37e295 | |
| parent | 32edb89e70c40cb23f8aae397ad7ef13193265ff (diff) | |
Parted out ADD macro-instruction
| -rw-r--r-- | alu.asm | 14 | ||||
| -rw-r--r-- | opcodes.asm | 10 |
2 files changed, 18 insertions, 6 deletions
@@ -1,6 +1,20 @@ ;; Parting out the big math/logic routines from the ;; instruction dispatch table. +alu_add: + ;; ADD instruction + ;; ADD d1,d0 + ;; d1 + d0 -> d1 + move.b d0,f_tmp_src_b ; preserve operands for flag work + move.b d1,f_tmp_dst_b + move.b #1,(f_tmp_byte-flag_storage)(a3) + add d0,d1 + move sr,(f_host_sr-flag_storage)(a3) + move.w #0202,(flag_byte-flag_storage)(a3) + rts + +alu_adc: + alu_sbc: ;; SBC instruction ;; SBC d1,d0 diff --git a/opcodes.asm b/opcodes.asm index fca259c..9154ec4 100644 --- a/opcodes.asm +++ b/opcodes.asm @@ -1222,12 +1222,10 @@ emu_op_7f: ;; XXX check this ;; XXX make it shorter ... D: F_ADD_B MACRO ; 14 bytes? - move.b \1,f_tmp_src_b ; preserve operands for flag work - move.b \2,f_tmp_dst_b - move.b #1,(f_tmp_byte-flag_storage)(a3) - add \1,\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_add + move.b d1,\2 ENDM START |
