Add partial support for 8-bit loads
We're big-endian. when we have this in memory: 00 01 02 03 And we need the first byte, we load the first 16-bit word: 0x0001 The first byte is then in the upper part of the word, and requires a right shift by 8. So any load into an 8-bit typed container needs to shift stuff. So far, stores from/to the stack are exempted, they always load/store full 16-bit words. And a few othe rminor things. Like string null terminators. And escaped characters in character literals. Can you believe it's spelled 'literal', with a single t? Me neither.
This commit is contained in:
@@ -145,7 +145,7 @@ struct_field: type IDENTIFIER sized_array* ";"
|
||||
IDENTIFIER: /[_a-zA-Z]\w*/
|
||||
COMMENT: /\/\/.*/
|
||||
HEX_LITTERAL: /0x[a-fA-F0-9]+/
|
||||
CHARACTER: /'[^']'/
|
||||
CHARACTER: /'([^']|\\n|\\r|\\0|\\t)'/
|
||||
|
||||
|
||||
%import common.WS
|
||||
|
Reference in New Issue
Block a user