Skip to content

Commit

Permalink
Add 'string interpolation' docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sagacity committed Jun 18, 2021
1 parent c3a94e3 commit 9017d69
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/src/guide/assembler.md
Original file line number Diff line number Diff line change
@@ -141,6 +141,22 @@ lda defined(ADDRESS) // a will now contain '1'
lda !defined(ADDRESS) // a will now contain '0'
```

## String handling
It is possible to use strings in expressions and in variable definitions, e.g.:

```asm6502
.const MY_HELLO = "hello"
.const MY_WORLD = " world"
.const GREETING = MY_HELLO + MY_WORLD
```

It is also possible to do string interpolation using curly braces, e.g.:

```asm6502
.const MY_HELLO = "hello"
.const GREETING = "{MY_HELLO} world" // <-- results in "hello world"
```

## Data definition
You may include data inline like so:

0 comments on commit 9017d69

Please sign in to comment.