diff --git a/emit/uxn/emit.c b/emit/uxn/emit.c index 13b5459..96e3b9b 100644 --- a/emit/uxn/emit.c +++ b/emit/uxn/emit.c @@ -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 diff --git a/emit/uxn/lib/undar.tal b/emit/uxn/lib/undar.tal index 07d6db5..5c3cd04 100644 --- a/emit/uxn/lib/undar.tal +++ b/emit/uxn/lib/undar.tal @@ -146,3 +146,11 @@ &return POP2r JMP2r + +@str/ ( str* -- ) + LDAk DUP ?{ POP POP2 JMP2r } + #18 DEO + INC2 !/ + +@mem_length_ #0000 +@mem_ \ No newline at end of file diff --git a/test/str.tal b/test/str.tal index 68dd86e..76b0a13 100644 --- a/test/str.tal +++ b/test/str.tal @@ -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/ INC2 !/ @mem_length_ #0000 -@mem_ \ No newline at end of file +@mem_