I made a couple of small changes to the C0DE helper in CloudT:

First, I disabled "spellcheck" so when you type assembly instructions it
won't underline them

Second for the "Raw" format where it emits code bytes directly, if the byte
is unprintable (less than ASCII 32), instead of missing characters it will
instead emit

"+CHR$(val)+"

where val is the decimal equivalent of the byte being emitted.

Which is probably what you want if you're choosing to emit unprintable
bytes to be part of a string.

The only thing to understand is that the content of

A$="BLAH"

is referenced directly as an immutable literal in the string symbol/object.
It takes a number of bytes of the string plus constant overhead.

A$="BLAH"+CHR$(2)

takes twice as much space, since it has to keep the immutable part "BLAH"
immutable since it is part of your program code. But then it allocates
string space to copy the immutable part to, then append the character.

Also, strings that are part of the string region and not literals in your
program can get moved by the garbage collector. It would be bad if you
stored ML code in a string, calculate its address and then jump to it, but
the code was moved by the garbage collector. If you think garbage
collection is a factor you need to take VARPTR of the string again and
recompute the entry point.

-- John.

Reply via email to