-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regarding ASM "dat" #33
Comments
to put 1 character in the lower byte and 1 in the higher, you will need to set the lower, then shift the higher 8 bits to the left and then OR them. For speed you just use 1 word for 1 character. I am not answering the last question, as DAT should be banned. |
DAT should be banned? |
Yes, the fake opcode. I dont like that syntax to add data. Keep opcodes opcodes and dont make a non-opcode (but more a preprocessor directive) look like it is an opcode. That is just bad. |
The answer to the last question again depends on both the assembler (how does the assembler parse non-printable characters in string literals), the program (how does the programmer determine the end of the string), and standards concerning the string format, which still have not been passed yet, I think. |
My recommendation, influenced by other assemblers: .ascii unpacked (two-byte) ASCII pstrings Example: .ascii "It was the best of times\n" -> yields standard pstring .word list of arbitrary words, no length prefix, ASCII ranges allowed Example: .word 0x10c, 0x1337, 0x2, "this will expand to unpacked ASCII" .byte as above, with packed bytes, if there is an odd number, implicit zero added to the last slot. ASCII ranges may be used. Example: .byte "It was the worst of times", 0xa, 0x0-> yields a packed ASCII string with no length prefix; may have an additional 0x0 byte Note they are directives, not pseudo-opcodes (I don't care if directives are marked with a dot or whatever else) |
That looks good to me. But then we will again have the discussion whether the community will receive a document on syntax gracefully... I will put this in my syntax gist. :) |
I do think we should have "assembler syntax suggestions" rather than "assembler syntax standards" |
Forget what I wrote |
Could we clear up a few things about ASM dat?
Question:
8bits or 16bits per character in strings? Ie.
dat "Hello"
Answer:
The hello world example with color which notch produced relies on 16bits per character with the upper 8bits being 0. The example above would produce 80bits, not 48.
Question:
If I want 8bits per character (packed for odd numbers of characters) to what should I do?
Answer:
Needs to be determined
Question:
Should there be any sequences within the strings, Ie. \0 to produce a 0x0
Answer:
Needs to be determined
The text was updated successfully, but these errors were encountered: