summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Smith2010-06-26 14:28:14 -0700
committerDuncan Smith2010-06-26 14:28:14 -0700
commit2a7bd0bf373f264c3e8878fba93e4df7aa5f4af7 (patch)
tree1c514179340f225a194624b841b309328015dcd9
parentdfdc2a5b9050e6fabd6ff0320ae2b8b92dbf42b1 (diff)
Completed CP macro-instruction
-rw-r--r--alu.asm12
1 files changed, 10 insertions, 2 deletions
diff --git a/alu.asm b/alu.asm
index 3dfa096..cc81491 100644
--- a/alu.asm
+++ b/alu.asm
@@ -54,8 +54,8 @@ alu_sub:
;; sets flags
;; XXX use lea and then d(an) if you have a spare register.
- ;; preserve operands for flagging
+ ;; preserve operands for flagging
move.b d0,(f_tmp_src_b-flag_storage)(a3)
move.b d1,(f_tmp_dst_b-flag_storage)(a3)
move.b #1,(f_tmp_byte-flag_storage)(a3)
@@ -78,5 +78,13 @@ alu_or:
rts
alu_cp:
- ;; XXX do this
+ ;; Same as SUB but the macro that calls this doesn't save the
+ ;; result.
+ move.b d0,(f_tmp_src_b-flag_storage)(a3)
+ move.b d1,(f_tmp_dst_b-flag_storage)(a3)
+ move.b #1,(f_tmp_byte-flag_storage)(a3)
+ andi.b #%00000010,(flag_valid-flag_storage)(a3)
+ move.b #%00000010,(flag_byte-flag_storage)(a3)
+ sub d0,d1
+ move sr,(f_host_sr-flag_storage)(a3)
rts