From 96eb653b3114d2682cf6645ae3279b34f424d680 Mon Sep 17 00:00:00 2001 From: Astrid Smith Date: Fri, 18 Jun 2010 17:14:39 -0700 Subject: Added parity-calculation routine --- flags.asm | 16 +++++++++++++--- 1 file 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 -- cgit v1.2.3