Peek

Use

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

Command Syntax

PEEK [/TEXT  | /DATA]
     [/HEX   | /DECIMAL  | /OCTAL]
     [/LONG  | /SHORT    | /BYTE]
     [/count] address

where:

count
Is a numeric constant
address
Is a numeric constant. (For format information, see the following Description section.)

Description

The PEEK command displays the contents of a designated amount of user program memory in a designated format starting at a given address.

If the Text option is specified, the user text segment of the program is read.

If the Data option is specified, the user data segment of the program is read. The Data option is the default.

The base of the displayed memory may be specified as being hexadecimal or decimal, depending on the options /HEX or /DECIMAL, respectively. /HEX is the default.

The size of each displayed memory unit may be specified as being 4 bytes (32 bits), 2 bytes (16 bits), or 1 byte (8 bits) by specifying the options /LONG, /SHORT, or /BYTE, respectively. When the option /BYTE is specified, the ASCII representation of the byte is also displayed. /LONG is the default.

The number of memory units to be displayed may be specified by using the /count option. This consists of a slash "/" followed by a decimal number. A count of one is the default.

The format of the given 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".

Example

The following PEEK command displays five lines (4-bytes) in hexadecimal format beginning at address 0x23d8.

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!