mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +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 {{
|
||||
sta c64.SCRATCH_ZPB1
|
||||
sty c64.SCRATCH_ZPREG
|
||||
sei ; disable interrupts because of bcd math
|
||||
sed ; switch to decimal mode
|
||||
lda #0 ; ensure the result is clear
|
||||
sta word2bcd_bcdbuff+0
|
||||
@ -149,6 +150,7 @@ asmsub uword2bcd (uword value @ AY) -> clobbers(A,X) -> () {
|
||||
dex ; and repeat for next bit
|
||||
bne -
|
||||
cld ; back to binary
|
||||
cli ; enable interrupts again
|
||||
rts
|
||||
}}
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ pop_float_to_indexed_var .proc
|
||||
|
||||
copy_float .proc
|
||||
; -- 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
|
||||
sty SCRATCH_ZPWORD2+1
|
||||
ldy #0
|
||||
|
Loading…
Reference in New Issue
Block a user