fix string emit

This commit is contained in:
zongor 2026-04-23 00:09:00 -07:00
parent fbfb24d1e5
commit 46336105aa
3 changed files with 12 additions and 4 deletions

View File

@ -438,9 +438,9 @@ uxn_emit_str(const char *str, i32 length)
/* set a pointer to the string literal and then jump over it */
printf(";{ #0002 ADD2 } !{ ");
for(i32 i = 1; i < length - 1; i++) printf("#%02x ", str[i]);
for(i32 i = 1; i < length - 1; i++) printf("%02x ", str[i]);
printf("#00 } ");
printf("00 } ");
}
void

View File

@ -146,3 +146,11 @@
&return
POP2r JMP2r
@str/<print> ( str* -- )
LDAk DUP ?{ POP POP2 JMP2r }
#18 DEO
INC2 !/<print>
@mem_length_ #0000
@mem_

View File

@ -1,5 +1,5 @@
|100
!{ @msg $2 } ;{ #0002 ADD2 } !{ #20 #64 #61 #6d #61 #67 #65 #20 #69 #6e #66 #6c #69 #63 #74 #65 #64 #21 #5c #6e #00 } ;msg STA2
!{ @msg $2 } ;{ #0002 ADD2 } !{ 20 64 61 6d 61 67 65 20 69 6e 66 6c 69 63 74 65 64 21 5c 6e 00 } ;msg STA2
!{ @AT $2 } #000e ;AT STA2
!{ @accuracy $2 } #0096 ;accuracy STA2
!{ @dmg $2 } ;AT LDA2 ;accuracy LDA2 MUL2 #0014 DIV2 #0003 SUB2 ;dmg STA2
@ -70,4 +70,4 @@ str/<print>
INC2 !/<print>
@mem_length_ #0000
@mem_
@mem_