mirror of
https://github.com/irmen/prog8.git
synced 2025-11-24 22:17:33 +00:00
fix a const long value hex asm mistake, fix conv.str_l(0) empty output
This commit is contained in:
@@ -870,13 +870,13 @@ class AsmGen6502Internal (
|
||||
when(target.kind) {
|
||||
TargetStorageKind.VARIABLE -> {
|
||||
out("""
|
||||
lda #${hex.substring(6,8)}
|
||||
lda #$${hex.substring(6,8)}
|
||||
sta ${target.asmVarname}
|
||||
lda #${hex.substring(4, 6)}
|
||||
lda #$${hex.substring(4, 6)}
|
||||
sta ${target.asmVarname}+1
|
||||
lda #${hex.substring(2, 4)}
|
||||
lda #$${hex.substring(2, 4)}
|
||||
sta ${target.asmVarname}+2
|
||||
lda #${hex.take(2)}
|
||||
lda #$${hex.take(2)}
|
||||
sta ${target.asmVarname}+3""")
|
||||
}
|
||||
TargetStorageKind.ARRAY -> TODO("assign long to array ${target.position}")
|
||||
|
||||
@@ -269,6 +269,10 @@ sub str_l (long value) -> str {
|
||||
bne +
|
||||
inx
|
||||
bne -
|
||||
+ cpx #10 ; just all 0? keep one
|
||||
bne +
|
||||
dex
|
||||
|
||||
+ ; x points at the rightmost leading 0
|
||||
lda negative
|
||||
beq +
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
fix crash for txt.print_l(conv.str_l(0))
|
||||
|
||||
|
||||
STRUCTS and TYPED POINTERS
|
||||
--------------------------
|
||||
|
||||
@@ -3,12 +3,17 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
long lv1, lv2, lv3
|
||||
|
||||
lv1 = 999999
|
||||
lv2 = 555555
|
||||
lv3 = 222222
|
||||
lv1 = lv2-(lv3*2)
|
||||
txt.print_l(lv1)
|
||||
txt.print_l(0)
|
||||
txt.nl()
|
||||
txt.print(conv.str_l(0))
|
||||
; long lv1, lv2, lv3
|
||||
;
|
||||
; lv1 = 999999
|
||||
; lv2 = 555555
|
||||
; lv3 = 222222
|
||||
; lv1 = lv2-(lv3 | $2222)
|
||||
; txt.print_l(lv1)
|
||||
; txt.spc()
|
||||
; txt.print_ulhex(lv1, true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user