POKE hiword, loword, val
POKE keyword, offset, val
Will set a byte within the PIC32 virtual memory space.
The address is specified by ‘hiword’ which is the top 16 bits of the address while ‘loword’ is the bottom 16 bits.
Alternatively ‘keyword’ can be used and ‘offset’ is the ±offset from the address of the keyword. The keyword can be VIDEO ( CGMMSTICK video buffer) or RVIDEO, GVIDEO, BVIDEO (red, blue and green video buffers on the CGCOLORMAX), PROGMEM (program memory) or VARTBL (the variable table). The input keystroke buffer is KBUF, the position of the head of the keystroke queue is KHEAD and the tail is KTAIL (the buffer is 256 bytes long).
This command is for expert users only. The PIC32 maps all control registers, flash (program) memory and volatile (RAM) memory into a single address space so there is no need for INP or OUT commands.
The PIC32MX5XX/6XX/7XX Family Data Sheet lists the details of this address space.
Note that MMBasic stores most data (including video) as 32 bit integers and the PIC32 uses little endian format.
WARNING: No validation of the parameters is made and if you use this facility to access an invalid memory address you will get an “internal error” which causes the processor to reset and clear all memory.
Leave a Reply