From 2a7bd0bf373f264c3e8878fba93e4df7aa5f4af7 Mon Sep 17 00:00:00 2001 From: Duncan Smith Date: Sat, 26 Jun 2010 14:28:14 -0700 Subject: Completed CP macro-instruction --- alu.asm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'alu.asm') 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 -- cgit v1.2.3