summaryrefslogtreecommitdiff
path: root/flags.asm
diff options
context:
space:
mode:
authorDuncan Smith2010-06-10 20:34:56 -0700
committerDuncan Smith2010-06-10 20:34:56 -0700
commit2435cb41d9768e0da9696f5e82ef61557ad31222 (patch)
treea8d1c660f564a1b071fd09cbc4a7f98a6c80cd66 /flags.asm
parenta3bf06f9b36fe9d4739b1d269a39eb37954ce783 (diff)
Parted out flag norm routines to subroutines, as they're hueg
Diffstat (limited to 'flags.asm')
-rw-r--r--flags.asm19
1 files changed, 17 insertions, 2 deletions
diff --git a/flags.asm b/flags.asm
index 181cfd8..8df7c5d 100644
--- a/flags.asm
+++ b/flags.asm
@@ -92,7 +92,7 @@ F_ADD_SAVE MACRO
;; Normalize and return carry bit (is loaded into Z bit)
;; Destroys d1
-F_NORM_C MACRO
+f_norm_c:
move.b flag_valid,d1
andi.b #%00000001,d1
bne FNC_ok ; Bit is valid
@@ -103,7 +103,22 @@ F_NORM_C MACRO
FNC_ok:
move.b flag_byte,d1
andi.b #%00000001,d1
- ENDM
+ rts
+
+ ;; Normalize and return zero bit (loaded into Z bit)
+ ;; Destroys d1
+f_norm_z:
+ move.b flag_valid,d1
+ andi.b #%01000000,d1
+ bne FNZ_ok ; Bit is valid
+ move.b f_host_ccr,d1
+ andi.b #%01000000,d1
+ or.b d1,flag_byte
+ ori.b #%01000000,flag_valid
+FNZ_ok:
+ move.b flag_byte,d1
+ andi.b #%01000000,d1
+ rts
;; Routine to turn 68k flags into z80 flags.