summaryrefslogtreecommitdiff
path: root/flags.asm
diff options
context:
space:
mode:
authorAstrid Smith2010-06-18 17:14:39 -0700
committerAstrid Smith2010-06-18 17:14:39 -0700
commit96eb653b3114d2682cf6645ae3279b34f424d680 (patch)
tree63f90f417e6772c16b057e2c787279ca42684b24 /flags.asm
parent2bf3a98e76b633b1274360a21ce7c49ae9719b2b (diff)
Added parity-calculation routine
Diffstat (limited to 'flags.asm')
-rw-r--r--flags.asm16
1 files changed, 13 insertions, 3 deletions
diff --git a/flags.asm b/flags.asm
index a8f3b61..f316865 100644
--- a/flags.asm
+++ b/flags.asm
@@ -85,6 +85,18 @@ FNPV_ok:
andi.b #%00000100,d1
rts
+ ;; Calculate the P/V bit as Parity, for the byte in
+ ;; d1. Destroys d0,d1.
+f_calc_parity:
+ andi.w #$ff,d1
+ move.b lut_parity(pc,d1),d1
+ move.w flag_byte(pc),d0
+ and.b #%11110111,d0
+ or.w #%0000100000000000,d0
+ or.b d1,d0
+ move.w d0,flag_byte-flag_storage(a3)
+ rts
+
;; Normalize and return Sign bit (loaded into Z bit).
;; Destroys d1
f_norm_sign:
@@ -126,10 +138,8 @@ f_tmp_src_w: dc.w 0
f_tmp_dst_w: dc.w 0
f_tmp_result_w: dc.w 0
-flag_n: dc.w 0
-
;; 000XNZVC
- EVEN ; Compositing a word from two bytes ...
+ EVEN ; Compositing a word from two bytes
f_host_sr: dc.b 0
f_host_ccr: dc.b 0