Contents |
Effect
Writes a value to two bytes of the memory (RAM or VRAM).
CALL POKEW means CALL DOUBLE POKE. It's equivalent to CALL POKE ([@]<Address>, <Value - INT(Value/256)*256>):CALL POKE ([@]<Address + 1>,<INT(Value/256)>).
Syntax
CALL POKEW ([@]<Address>,<Value>)
Parameters
@ needs to be put before <address> to specify VRAM instead of RAM. Without this parameter, the value will be written to main RAM if the address is lower than 8000h.
<Address> is the address of destination. To avoid error messages, decimal numbers need to be used for addresses higher than FFFFh (65535).
If <Address> is negative the binary complement is used. This means CALL POKEW(-1)=CALL POKEW(65536-1).
If you specify a RAM address higher than 65534, specifications of the mapped RAM are used.
65535 + (number of available segments) × 16384 is the upper limit. If you specify a value exceeding this value, you get an "Out of memory" error.
<Value> is a decimal number between 0 and 65535. The least significant byte of the value is poked to the specified address, and the most significant byte is poked to the next (higher) address.
Machine code stores values between 0 and 65535 in this way; many system variables have this format and are most easily altered with CALL POKEW.
Examples
CALL POKEW (&HC000,35478)
CALL POKE (@&H2000,18456)
10 _POKEW(60000,42321) 20 _PEEKW(60000):PRINT 30 _PEEKW(60000,A):PRINT A 40 PRINT PEEK(60000),PEEK(60001) 50 PRINT HEX$(42321) 60 PRINT (42321-65536) RUN
&HA551 -23215 81 165 A551 -23215
Related to
CALL BLOCK, CALL PEEK, CALL PEEKS, CALL PEEKW, CALL POKE, CALL POKES