#Using one-character strings as operands in the assembly editor

12 messages · Page 1 of 1 (latest)

elder barn
#

Currently, you can write strings inside the assembly editor as separate tokens, but a desirable feature would be to extract numerical values from strings inside operands. A one-character string would turn into a byte, a two-character string would turn into a 16-bit word, etc. This way, we can do something like
out console|"H"
for example, to use character codes as operands.
Doing this currently results in weird behavior that seems to invalidate all further code in the assembly editor.

timber galleon
#

for some reason i dont think this shouldnt work

#

why doesnt it?

elder barn
timber galleon
#

weird

elder barn
#

I double checked and it works fine if you replace the H with an integer literal

timber galleon
#

that is funny

elder barn
#

Once again, a line consisting entirely of a string gets assembled byte-by-byte just fine

#

But you can't inline strings

plain sand
#

Can you use a character literal using ' instead?

plain sand
#

Hm, no. single character literals do work with ', but they still can't use operators

#

" not working is IMO fine, although it should generate an error a good error message: " represents a multi byte sequence, not a single value.