mirror of
https://github.com/cc65/cc65.git
synced 2024-06-29 10:29:30 +00:00
correctly sign extend for 16bit->float conversion
This commit is contained in:
parent
13dd4e296f
commit
1f4f408572
|
@ -1,17 +1,32 @@
|
||||||
|
|
||||||
|
.importzp sreg, tmp1
|
||||||
|
|
||||||
.import _int32_to_float32
|
.import _int32_to_float32
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; conversions: to float
|
||||||
|
|
||||||
; 16bit signed -> float
|
; 16bit signed -> float
|
||||||
.export axfloat
|
.export axfloat
|
||||||
axfloat:
|
axfloat:
|
||||||
; FIXME
|
; FIXME
|
||||||
|
; sign extend to 32bit
|
||||||
|
ldy #$ff
|
||||||
|
cpx #$80
|
||||||
|
bcs @sk
|
||||||
|
ldy #$00
|
||||||
|
@sk:
|
||||||
|
sty sreg
|
||||||
|
sty sreg+1
|
||||||
jmp _int32_to_float32
|
jmp _int32_to_float32
|
||||||
|
|
||||||
; 16bit unsigned -> float
|
; 16bit unsigned -> float
|
||||||
.export axufloat
|
.export axufloat
|
||||||
axufloat:
|
axufloat:
|
||||||
; FIXME
|
; FIXME
|
||||||
|
ldy #0
|
||||||
|
sty sreg
|
||||||
|
sty sreg+1
|
||||||
jmp _int32_to_float32
|
jmp _int32_to_float32
|
||||||
|
|
||||||
; 32bit signed -> float
|
; 32bit signed -> float
|
||||||
|
|
Loading…
Reference in New Issue
Block a user