POKE16

POKE16 A,V

WRITES THE 16-BIT VALUE V (FROM 0 TO 65535) AT ADDRESSES A AND A+1

  • Type: Command
  • Parameters: 2
  • Group: Reference

ACTION

The command POKE16 A,V writes the 16-bit value V (from 0 to 65535) at memory addresses A and A+1.

In NORMAL mode, the high byte of V is written at address A and the low byte of V is written at adress A+1.

In REVERSE mode, the low byte of V is written at address A and the high byte of V is written at adress A+1.

By default, the mode is NORMAL. The mode can be changed by the commands POKE_REVERSE and POKE_NORMAL.

Remark : The memory is looked by POKE16 as a series of bytes, each byte having its own address.

SYNTAX: POKE16 A,V

  • A = address
  • V = integer or real from 0 to 65535

USE

  • The command POKE16 is used to write a 16-bit value at addresses A and A+1.

ERROR

  • If A or V is not a correct expression.
  • If V is less than 0 or greater than 65535.

EXAMPLE

dim v%,address

address=adr(v%)

poke16 address,2*power(256,1)+power(256,0)

print peek(address)

print peek(address+1)

print "the print is:"

print 2

print 1

print "-----"

print peek16(address)

print "printed value is: "+str$(2*power(256,1)+power(256,0))

SEE ALSO

POKE

POKE32

POKE_NORMAL

POKE_REVERSE

PEEK()

PEEK16()

PEEK32()

PEEK_NORMAL

PEEK_REVERSE