1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-18 07:29:36 +00:00

correctly sign extend for 16bit->float conversion

This commit is contained in:
mrdudz 2022-09-17 16:53:28 +02:00
parent 13dd4e296f
commit 1f4f408572

View File

@ -1,17 +1,32 @@
.importzp sreg, tmp1
.import _int32_to_float32
;------------------------------------------------------------------------------
; conversions: to float
; 16bit signed -> float
.export axfloat
axfloat:
; FIXME
; sign extend to 32bit
ldy #$ff
cpx #$80
bcs @sk
ldy #$00
@sk:
sty sreg
sty sreg+1
jmp _int32_to_float32
; 16bit unsigned -> float
.export axufloat
axufloat:
; FIXME
ldy #0
sty sreg
sty sreg+1
jmp _int32_to_float32
; 32bit signed -> float