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:
parent
13dd4e296f
commit
1f4f408572
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user