Previous Topic Next topic Print topic


Poke

Use

Changes the contents of a specified area of user memory in a specified format.

Command Syntax

POKE [/TEXT | /DATA]
     [/LONG | /SHORT | /BYTE] 
     address, data-value

where:

address
Is an address value specifying the memory location to examine. The address value has the same format as the data-value described below. The data segment is the default.
data-value
The format of the given data value (or address) may be either hexadecimal or decimal depending on how it is written. A hexadecimal number must begin with a 0x or 0X or contain at least one of the hexadecimal digits "a" through "f" (case in-sensitive). A decimal number may contain only any of the decimal digits "0" through "9”.

Description

The /BYTE, /SHORT, and /LONG options, used with integer values, specify the size of memory to be altered (1, 2, or 4 bytes, respectively). /LONG is the default.

Example

The following POKE command stores the hexadecimal value 99 at address 0x7FFFE480.

Initial evaluation environment is PGM:(inactive)
CodeWatch> p12
    1:  pgm: proc options(main);
    2:
    3:      dcl string char (32) varying;
    4:
    5:      string = 'Hello World.';
    6:
    7:      put skip list (string);
    8:
    9:      put skip list (string);
   10:  end;
   11:  BOTTOM
CodeWatch> b 7
CodeWatch> c
Break at PGM\7
CodeWatch> e addr(string)
FFBFF94E (hex)  {pointer}
CodeWatch> peek /data /byte /7 0xFFBFF94E
<data> 0xffbff94e: 0x00   <nul>
<data> 0xffbff94f: 0x0c   CTRL-L
<data> 0xffbff950: 0x48   H
<data> 0xffbff951: 0x65   e
<data> 0xffbff952: 0x6c   l
<data> 0xffbff953: 0x6c   l
<data> 0xffbff954: 0x6f   o
CodeWatch> peek /next
<data> 0xffbff955: 0x20   <space>
<data> 0xffbff956: 0x57   W
<data> 0xffbff957: 0x6f   o
<data> 0xffbff958: 0x72   r
<data> 0xffbff959: 0x6c   l
<data> 0xffbff95a: 0x64   d
<data> 0xffbff95b: 0x2e   .
CodeWatch> s

Hello World. Step at PGM\9     <Note: prints ‘Hello World.’ 12 chars>
CodeWatch> po
    9:      put skip list (string);
CodeWatch> poke /data /short 0xFFBFF94E,5
<data> 0xffbff94e: 0x000c ---> 0x0005
CodeWatch> s

Hello Step at PGM\10           <Note: prints ‘Hello’ 5 chars>
CodeWatch> q
CodeWatch Quit...Bye!
Previous Topic Next topic Print topic