mirror of
https://github.com/irmen/prog8.git
synced 2024-11-23 07:32:10 +00:00
should disable irq when doing bcd math
This commit is contained in:
parent
575bc7aa9a
commit
18723590c5
@ -128,6 +128,7 @@ asmsub uword2bcd (uword value @ AY) -> clobbers(A,X) -> () {
|
|||||||
%asm {{
|
%asm {{
|
||||||
sta c64.SCRATCH_ZPB1
|
sta c64.SCRATCH_ZPB1
|
||||||
sty c64.SCRATCH_ZPREG
|
sty c64.SCRATCH_ZPREG
|
||||||
|
sei ; disable interrupts because of bcd math
|
||||||
sed ; switch to decimal mode
|
sed ; switch to decimal mode
|
||||||
lda #0 ; ensure the result is clear
|
lda #0 ; ensure the result is clear
|
||||||
sta word2bcd_bcdbuff+0
|
sta word2bcd_bcdbuff+0
|
||||||
@ -149,6 +150,7 @@ asmsub uword2bcd (uword value @ AY) -> clobbers(A,X) -> () {
|
|||||||
dex ; and repeat for next bit
|
dex ; and repeat for next bit
|
||||||
bne -
|
bne -
|
||||||
cld ; back to binary
|
cld ; back to binary
|
||||||
|
cli ; enable interrupts again
|
||||||
rts
|
rts
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ pop_float_to_indexed_var .proc
|
|||||||
|
|
||||||
copy_float .proc
|
copy_float .proc
|
||||||
; -- copies the 5 bytes of the mflt value pointed to by SCRATCH_ZPWORD1,
|
; -- copies the 5 bytes of the mflt value pointed to by SCRATCH_ZPWORD1,
|
||||||
; into the 5 bytes pointed to by A/Y. Clobbers Y.
|
; into the 5 bytes pointed to by A/Y. Clobbers A,Y.
|
||||||
sta SCRATCH_ZPWORD2
|
sta SCRATCH_ZPWORD2
|
||||||
sty SCRATCH_ZPWORD2+1
|
sty SCRATCH_ZPWORD2+1
|
||||||
ldy #0
|
ldy #0
|
||||||
|
Loading…
Reference in New Issue
Block a user