mirror of
https://github.com/adamdunkels/ubasic.git
synced 2026-11-21 20:19:45 +00:00
New instructions PEEK and POKE to call outside routines.
To use PEEK and POKE initialize uBASIC from your program with ubasic_init_peek_poke(program, &peek, &poke) where "peek" is a function peek(VARIABLE_TYPE addr) that returns VARIABLE_TYPE and "poke" is a procedure void poke(VARIABLE_TYPE addr, VARIABLE_TYPE value). Use "PEEK addr, var" to set the value of the variable var to the result of calling peek(addr). Use "POKE addr, value" to call poke(addr, value); The argument name "addr" is arbitrary; it doesn't mean you should necessarily use it to pass your routines a memory address.
This commit is contained in:
parent
f9ea3c6e6b
commit
93bb242eb0
6 changed files with 85 additions and 2 deletions
2
Makefile
2
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
use-ubasic: use-ubasic.o ubasic.o tokenizer.o
|
||||
tests: tests.o ubasic.o tokenizer.o
|
||||
use-ubasic: use-ubasic.o ubasic.o tokenizer.o
|
||||
clean:
|
||||
rm *.o tests use-ubasic
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue