17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

POKE Statement<br />

Purpose:<br />

To write (poke) a byte of data into a memory location.<br />

Syntax:<br />

POKE a,b<br />

Comments:<br />

a and b are integer expressions.<br />

The integer expression a is the offset address of the memory location to be poked. The DEF SEG<br />

statement last executed determines the address. GW-BASIC does not check any offsets that are<br />

specified.<br />

The integer expression b is the data to be poked.<br />

b must be within the range of 0 to 255. a must be within the range of 0 to 65535.<br />

The complementary function to POKE is PEEK. The argument to PEEK is an address from which a<br />

byte is to be read.<br />

POKE and PEEK are useful for efficient data storage, loading assembly language subroutines, and<br />

for passing arguments and results to and from assembly language subroutines.<br />

Examples:<br />

20 POKE &H5A00, &HFF<br />

Places the decimal value 255 (&HFF) into the hex offset location (23040 decimal) See PEEK<br />

function example.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/POKE.html28/03/2004 21.29.22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!