Skip to content
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

Open
andre-d opened this issue Apr 9, 2012 · 8 comments
Open

Regarding ASM "dat" #33

andre-d opened this issue Apr 9, 2012 · 8 comments
Labels

Comments

@andre-d
Copy link

andre-d commented Apr 9, 2012

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

@Jarvix
Copy link
Contributor

Jarvix commented Apr 9, 2012

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.

@andre-d
Copy link
Author

andre-d commented Apr 9, 2012

DAT should be banned?

@Jarvix
Copy link
Contributor

Jarvix commented Apr 9, 2012

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.

@strangeglyph
Copy link
Member

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.

@0xabad1dea
Copy link
Member

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)

@Jarvix
Copy link
Contributor

Jarvix commented Apr 12, 2012

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. :)

@0xabad1dea
Copy link
Member

I do think we should have "assembler syntax suggestions" rather than "assembler syntax standards"

@enkore
Copy link
Contributor

enkore commented Apr 12, 2012

Forget what I wrote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants