diff options
| author | Astrid Smith | 2010-06-18 16:50:53 -0700 |
|---|---|---|
| committer | Astrid Smith | 2010-06-18 16:50:53 -0700 |
| commit | 2bf3a98e76b633b1274360a21ce7c49ae9719b2b (patch) | |
| tree | 015350c9be19cbf58ab24e2e8031679abda0d50e | |
| parent | 166e7b68e370c1d94a7dcadf95d9fc2485fa6d54 (diff) | |
Fixed that, dc.w is NOT the same as ds.w.
| -rw-r--r-- | flags.asm | 26 | ||||
| -rw-r--r-- | main.asm | 57 |
2 files changed, 32 insertions, 51 deletions
@@ -112,31 +112,31 @@ flag_storage: ;; Numbers in comments are offsets from flag_storage, so use ;; offset(a3) to address. ;; 1 if tmp_???b is valid, 0 if tmp_???w is valid -f_tmp_byte: ds.b 0 ; 0 +f_tmp_byte: dc.b 0 ;; 2 if P is 0, 3 if P is 1, 4 if P is Parity, 5 if P is oVerflow -f_tmp_p_type: ds.b 0 ; 1 +f_tmp_p_type: dc.b 0 ;; byte operands -f_tmp_src_b: ds.b 0 ; 2 -f_tmp_dst_b: ds.b 0 ; 3 -f_tmp_result_b: ds.b 0 ; 4 +f_tmp_src_b: dc.b 0 +f_tmp_dst_b: dc.b 0 +f_tmp_result_b: dc.b 0 EVEN -f_tmp_src_w: ds.w 0 ; 6 -f_tmp_dst_w: ds.w 0 ; 8 -f_tmp_result_w: ds.w 0 ; 10 +f_tmp_src_w: dc.w 0 +f_tmp_dst_w: dc.w 0 +f_tmp_result_w: dc.w 0 -flag_n: ds.w 0 ; 12 +flag_n: dc.w 0 ;; 000XNZVC EVEN ; Compositing a word from two bytes ... -f_host_sr: ds.b 0 ; 14 -f_host_ccr: ds.b 0 ; 15 +f_host_sr: dc.b 0 +f_host_ccr: dc.b 0 EVEN ;; DO NOT REARRANGE THESE. -flag_byte: ds.b 0 ; 16 Byte of all flags -flag_valid: ds.b 0 ; 17 Validity mask -- 1 if valid. +flag_byte: dc.b 0 ; Byte of all flags +flag_valid: dc.b 0 ; Validity mask -- 1 if valid. ;; LUT for the CCR -> F mapping lut_ccr: @@ -1355,13 +1355,10 @@ emu_op_7f: F_ADD_B MACRO ; 14 bytes? move.b \1,f_tmp_src_b ; preserve operands for flag work move.b \2,f_tmp_dst_b -; move.b #1,(f_tmp_byte-flag_storage)(a3) - move.b #1,0(a3) + move.b #1,(f_tmp_byte-flag_storage)(a3) add \1,\2 -; move sr,(f_host_sr-flag_storage)(a3) - move sr,14(a3) -; move.w #0202,(flag_byte-flag_storage)(a3) - move.w #0202,16(a3) + move sr,(f_host_sr-flag_storage)(a3) + move.w #0202,(flag_byte-flag_storage)(a3) ENDM START @@ -1429,15 +1426,11 @@ F_ADC_B MACRO ; S34 move.b flag_byte(pc),d0 andi.b #1,d0 add.b \1,d0 -; move.b d0,(f_tmp_src_b-flag_storage)(a3) - move.b d0,2(a3) -; move.b \2,(f_tmp_dst_b-flag_storage)(a3) - move.b \2,3(a3) + move.b d0,(f_tmp_src_b-flag_storage)(a3) + move.b \2,(f_tmp_dst_b-flag_storage)(a3) add.b d0,\2 -; move sr,(f_host_ccr-flag_storage)(a3) - move sr,15(a3) -; move.w #$0202,(flag_byte-flag_storage)(a3) - move.w #$0202,16(a3) + move sr,(f_host_ccr-flag_storage)(a3) + move.w #$0202,(flag_byte-flag_storage)(a3) ENDM START @@ -1508,19 +1501,13 @@ emu_op_8f: F_SUB_B MACRO ; 22 bytes? ;; XXX use lea and then d(an) if you have a spare register. ;; preserve operands for flagging -; move.b \1,(f_tmp_src_b-flag_storage)(a3) - move.b \1,2(a3) -; move.b \2,(f_tmp_dst_b-flag_storage)(a3) - move.b \2,3(a3) -; move.b #1,(f_tmp_byte-flag_storage)(a3) - move.b #1,0(a3) -; andi.b #%00000010,(flag_valid-flag_storage)(a3) - andi.b #%00000010,17(a3) -; move.b #%00000010,(flag_byte-flag_storage)(a3) - move.b #%00000010,16(a3) + move.b \1,(f_tmp_src_b-flag_storage)(a3) + move.b \2,(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 \1,\2 -; move sr,(f_host_sr-flag_storage)(a3) - move sr,14(a0) + move sr,(f_host_sr-flag_storage)(a3) ENDM START @@ -1588,15 +1575,11 @@ F_SBC_B MACRO move.b flag_byte(pc),d0 andi.b #1,d0 add.b \1,d0 -; move.b d0,(f_tmp_src_b-flag_storage)(a3) - move.b d0,2(a3) -; move.b \2,(f_tmp_dst_b-flag_storage)(a3) - move.b \2,3(a3) + move.b d0,(f_tmp_src_b-flag_storage)(a3) + move.b \2,(f_tmp_dst_b-flag_storage)(a3) sub.b d0,\2 -; move sr,(f_host_sr-flag_storage)(a3) - move sr,14(a3) -; move.w #$0202,(flag_byte-flag_storage)(a3) - move.w #$0202,16(a3) + move sr,(f_host_sr-flag_storage)(a3) + move.w #$0202,(flag_byte-flag_storage)(a3) ENDM @@ -2313,10 +2296,8 @@ emu_op_f1: ;; POP AF ;; SPEED this can be made faster ... POPW d3 -; move.w d3,(flag_byte-flag_storage)(a3) - move.w d3,16(a3) -; move.b #$ff,(flag_valid-flag_storage)(a3) - move.b #$ff,17(a3) + move.w d3,(flag_byte-flag_storage)(a3) + move.b #$ff,(flag_valid-flag_storage)(a3) DONE START |
