Updated docs to reflect modern POKE and POKEW syntax

This commit is contained in:
Mattias Hansson 2026-07-12 18:29:17 +02:00
parent 3d94dde5ea
commit 8293982246
3 changed files with 21 additions and 21 deletions

View file

@ -614,15 +614,15 @@ For operating with offsets the address parameter must be an absolute WORD variab
**Syntax:**
```
POKE <address>[<offset>] WITH <value>
POKE <address>[<offset>], <value>
```
**Examples:**
```
POKE $D020 WITH 0
POKE screenPtr[index] WITH char
POKE buffer[5] WITH data
POKE pointer WITH value
POKE $D020, 0
POKE screenPtr[index], char
POKE buffer[5], data
POKE pointer, value
```
---
@ -636,14 +636,14 @@ For operating with offsets the address parameter must be an absolute WORD variab
**Syntax:**
```
POKEW <address>[<offset>] WITH <value>
POKEW <address>[<offset>], <value>
```
**Examples:**
```
POKEW $0314 WITH handler
POKEW dataPtr[0] WITH value
POKEW buffer[10] WITH address
POKEW $0314, handler
POKEW dataPtr[0], value
POKEW buffer[10], address
```
---

View file

@ -370,9 +370,9 @@ value = PEEK buffer[10] // Read buffer+10
Write a byte to memory:
```c65
POKE $D020 WITH 0 // Write to absolute address
POKE screenPtr[index] WITH char // Write with offset
POKE pointer WITH value // Write to pointer
POKE $D020, 0 // Write to absolute address
POKE screenPtr[index], char // Write with offset
POKE pointer, value // Write to pointer
```
### 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:
```c65
POKEW $0314 WITH irqHandler // Set IRQ vector
POKEW dataPtr[0] WITH address // Write word with offset
POKEW $0314, irqHandler // Set IRQ vector
POKEW dataPtr[0], address // Write word with offset
```
### POINTER - Setting Pointers
@ -830,7 +830,7 @@ FEND
FUNC updateScreen
BYTE color
color = frameCount & $0F
POKE screenPtr[0] WITH color
POKE screenPtr[0], color
frameCount++
FEND
@ -857,7 +857,7 @@ FUNC clearScreen
WORD remaining = 1000
WHILE remaining > 0
POKE screenPtr[0] WITH 32 // Space character
POKE screenPtr[0], 32 // Space character
screenPtr++
remaining--
WEND
@ -935,7 +935,7 @@ FUNC installIRQ
ENDASM
oldIRQ = PEEKW IRQ_VECTOR
POKEW IRQ_VECTOR WITH myIRQ
POKEW IRQ_VECTOR, myIRQ
ASM
cli // Enable interrupts
@ -1024,7 +1024,7 @@ ENDIF
```c65
// Bad
POKE $D020 WITH 5
POKE $D020, 5
// Good
BYTE CONST COLOR_GREEN = 5
@ -1131,9 +1131,9 @@ FEND
// Memory
value = PEEK $D020
POKE $D020 WITH 5
POKE $D020, 5
address = PEEKW $FFFC
POKEW $0314 WITH handler
POKEW $0314, handler
// Operators
+ - * / // Arithmetic

View file

@ -682,7 +682,7 @@ INC $D000+20
```
FOR i = 0 TO MAX_VALUE-1
IF x > THRESHOLD+10
POKE $D020+offset WITH value
POKE $D020+offset, value
result = PEEK $0400+index
```