PEEK16()

PEEK16(A)

RETURNS THE CONTENT (16-BIT VALUE FROM 0 TO 65535) OF ADDRESSES A AND A+1

  • Type: Function
  • Parameter: 1
  • Group: Reference

ACTION

The function PEEK16(A) returns a 16-bit value the content of which is found at addresses A and A+1.

In NORMAL mode, the content of address A is the high byte and the content of address A+1 is the low byte of the returned value.

In REVERSE, the content of address A is the low byte and the content of address A+1 is the high byte of the returned value.

By default, the mode is NORMAL. The mode can be changed by the commands PEEK_REVERSE and PEEK_NORMAL.

PEEK16 returns a value from 0 to 65535.

SYNTAX: Resultt=PEEK16(A)

  • A = address

USE

  • The function PEEK16() is used to know the content of memory addresses A (high byte) and A+1 (low byte).

ERROR

  • If A is not a correct expression.

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

POKE16

POKE32

POKE_NORMAL

POKE_REVERSE

PEEK()

PEEK32()

PEEK_NORMAL

PEEK_REVERSE