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