type: function (subr) location: built-in source file: xlsys.c Common LISP compatible: no supported on: all machines
(poke <address> <expr> ) <address> - an integer expression <expr> - an integer expression
The POKE function writes the <expr> at the internal memory value at the specified <address>. The returned value is <expr>. Be very careful with this function.
(setq var 0) ; set up VAR with 0 (address-of var) ; returns 123224 (address-of 'var) ; returns 161922 (peek (address-of var)) ; returns 83951616 (peek (1+ (address-of var))) ; returns 16777216 (peek (+ 2 (address-of var))) ; returns 0 <-- value of VAR (setq var 14) ; change the value to 14 (peek (+ 2 (address-of var))) ; returns 14 (poke (+ 2 (address-of var)) 1023) ; POKE the value to 1023 (print var) ; prints 1023
CAUTION: Be careful when modifying the internal state of XLISP. If you have modified it, it would be a good idea to exit XLISP and re-enter before doing any work you really want to retain.
ADDITIONAL CAUTION: It is possible to PEEK and POKE not just XLISP's memory but other parts of your computer's memory. Be very careful when doing this. Also, in some computers, just looking at a memory location can cause things to happen - I/O locations fall in this category.