You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 a db declaration.
The count would be stored as a byte so lengths greater than 255 are not allowed. Empty strings should be allowed though.
Examples
dp "Hello" ; Equivalent to: db 5,"Hello"
dp "Foo","Bar" ; Equivalent to: db 6,"Foo","Bar"
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: