Updated docs to reflect modern POKE and POKEW syntax
This commit is contained in:
parent
3d94dde5ea
commit
8293982246
3 changed files with 21 additions and 21 deletions
18
commands.md
18
commands.md
|
|
@ -614,15 +614,15 @@ For operating with offsets the address parameter must be an absolute WORD variab
|
||||||
|
|
||||||
**Syntax:**
|
**Syntax:**
|
||||||
```
|
```
|
||||||
POKE <address>[<offset>] WITH <value>
|
POKE <address>[<offset>], <value>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
```
|
```
|
||||||
POKE $D020 WITH 0
|
POKE $D020, 0
|
||||||
POKE screenPtr[index] WITH char
|
POKE screenPtr[index], char
|
||||||
POKE buffer[5] WITH data
|
POKE buffer[5], data
|
||||||
POKE pointer WITH value
|
POKE pointer, value
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
@ -636,14 +636,14 @@ For operating with offsets the address parameter must be an absolute WORD variab
|
||||||
|
|
||||||
**Syntax:**
|
**Syntax:**
|
||||||
```
|
```
|
||||||
POKEW <address>[<offset>] WITH <value>
|
POKEW <address>[<offset>], <value>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
```
|
```
|
||||||
POKEW $0314 WITH handler
|
POKEW $0314, handler
|
||||||
POKEW dataPtr[0] WITH value
|
POKEW dataPtr[0], value
|
||||||
POKEW buffer[10] WITH address
|
POKEW buffer[10], address
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
22
language.md
22
language.md
|
|
@ -370,9 +370,9 @@ value = PEEK buffer[10] // Read buffer+10
|
||||||
Write a byte to memory:
|
Write a byte to memory:
|
||||||
|
|
||||||
```c65
|
```c65
|
||||||
POKE $D020 WITH 0 // Write to absolute address
|
POKE $D020, 0 // Write to absolute address
|
||||||
POKE screenPtr[index] WITH char // Write with offset
|
POKE screenPtr[index], char // Write with offset
|
||||||
POKE pointer WITH value // Write to pointer
|
POKE pointer, value // Write to pointer
|
||||||
```
|
```
|
||||||
|
|
||||||
### PEEKW - Reading 16-bit Words
|
### PEEKW - Reading 16-bit Words
|
||||||
|
|
@ -392,8 +392,8 @@ value = PEEKW buffer[10] // Read word at buffer+10
|
||||||
Write a 16-bit value to memory:
|
Write a 16-bit value to memory:
|
||||||
|
|
||||||
```c65
|
```c65
|
||||||
POKEW $0314 WITH irqHandler // Set IRQ vector
|
POKEW $0314, irqHandler // Set IRQ vector
|
||||||
POKEW dataPtr[0] WITH address // Write word with offset
|
POKEW dataPtr[0], address // Write word with offset
|
||||||
```
|
```
|
||||||
|
|
||||||
### POINTER - Setting Pointers
|
### POINTER - Setting Pointers
|
||||||
|
|
@ -830,7 +830,7 @@ FEND
|
||||||
FUNC updateScreen
|
FUNC updateScreen
|
||||||
BYTE color
|
BYTE color
|
||||||
color = frameCount & $0F
|
color = frameCount & $0F
|
||||||
POKE screenPtr[0] WITH color
|
POKE screenPtr[0], color
|
||||||
frameCount++
|
frameCount++
|
||||||
FEND
|
FEND
|
||||||
|
|
||||||
|
|
@ -857,7 +857,7 @@ FUNC clearScreen
|
||||||
|
|
||||||
WORD remaining = 1000
|
WORD remaining = 1000
|
||||||
WHILE remaining > 0
|
WHILE remaining > 0
|
||||||
POKE screenPtr[0] WITH 32 // Space character
|
POKE screenPtr[0], 32 // Space character
|
||||||
screenPtr++
|
screenPtr++
|
||||||
remaining--
|
remaining--
|
||||||
WEND
|
WEND
|
||||||
|
|
@ -935,7 +935,7 @@ FUNC installIRQ
|
||||||
ENDASM
|
ENDASM
|
||||||
|
|
||||||
oldIRQ = PEEKW IRQ_VECTOR
|
oldIRQ = PEEKW IRQ_VECTOR
|
||||||
POKEW IRQ_VECTOR WITH myIRQ
|
POKEW IRQ_VECTOR, myIRQ
|
||||||
|
|
||||||
ASM
|
ASM
|
||||||
cli // Enable interrupts
|
cli // Enable interrupts
|
||||||
|
|
@ -1024,7 +1024,7 @@ ENDIF
|
||||||
|
|
||||||
```c65
|
```c65
|
||||||
// Bad
|
// Bad
|
||||||
POKE $D020 WITH 5
|
POKE $D020, 5
|
||||||
|
|
||||||
// Good
|
// Good
|
||||||
BYTE CONST COLOR_GREEN = 5
|
BYTE CONST COLOR_GREEN = 5
|
||||||
|
|
@ -1131,9 +1131,9 @@ FEND
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
value = PEEK $D020
|
value = PEEK $D020
|
||||||
POKE $D020 WITH 5
|
POKE $D020, 5
|
||||||
address = PEEKW $FFFC
|
address = PEEKW $FFFC
|
||||||
POKEW $0314 WITH handler
|
POKEW $0314, handler
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
+ - * / // Arithmetic
|
+ - * / // Arithmetic
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,7 @@ INC $D000+20
|
||||||
```
|
```
|
||||||
FOR i = 0 TO MAX_VALUE-1
|
FOR i = 0 TO MAX_VALUE-1
|
||||||
IF x > THRESHOLD+10
|
IF x > THRESHOLD+10
|
||||||
POKE $D020+offset WITH value
|
POKE $D020+offset, value
|
||||||
result = PEEK $0400+index
|
result = PEEK $0400+index
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue