mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 02:36:41 +00:00
More info on string literals
parent
b50ab7a9ad
commit
07bba2229a
@ -95,16 +95,19 @@ mynumber: DW 0x0000
|
||||
|
||||
### String literals
|
||||
|
||||
You can use the `DW` to store strings, for example:
|
||||
|
||||
```asm
|
||||
my_str: DW "Hello"
|
||||
|
||||
; This is assembled to:
|
||||
; 00 48 00 65 00 6C 00 6C 00 6F
|
||||
|
||||
.text
|
||||
MOV A, [my_str] ; Value of A is now 'H'
|
||||
```
|
||||
|
||||
|
||||
### Character literals
|
||||
// NOT IMPLEMENTED
|
||||
Java escape sequences are handled (`\u0000`, `\"`. `\0` `\t` etc) and strings are encoded to 16-bit big endian.
|
||||
|
||||
|
||||
You can combine any type of literal values in a single line, for example:
|
||||
|
Loading…
x
Reference in New Issue
Block a user