Open Cthutu opened 2 months ago
possible implementation idea:
add internal invincible labels (like macro 0>
but not listed) to mark start/end of the emitted block so the length byte can be calculated in final pass (even for non-device mode).
note to myself: review which other issues are similar to this, there were multiple attempts for "length of something" directives, usually running into similar implementation problems, doing the internal labels in some general way could maybe solve more of them.
Feature overview
I am trying to add strings in my assembly where the first byte is the count of characters in the strings (i.e. Pascal strings). This is really common and often more useful than null-terminated strings.
I propose a new keyword
dp
that declares a pascal strings. It would concatenate all entries on the line, count the number of bytes they take and emit that count first. Thereafter, it acts like adb
declaration.The count would be stored as a byte so lengths greater than 255 are not allowed. Empty strings should be allowed though.
Examples