[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 PEEKWORD()
 Reads a 16-bit word from memory
------------------------------------------------------------------------------
 Syntax

     PEEKWORD(<nSegment|cHexSegment>,<nOffset|cHexOffset>)
         --> nWord

 Arguments

     <nSegment|cHex>  Designates the segment address from which a word is
     read.  This value can be a decimal integer or a hexadecimal string.

     <nOffset|cHexOffset>  Designates the offset address within the
     segment specified by <nSegment|cHexSegment>.  This value can be a
     decimal integer or hexadecimal string.  The maximum is ("FFFE").

 Returns

     PEEKWORD() returns the word that is read in or a value of -1, if an
     error occurs.

 Description

     In contrast to PEEKBYTE(), this function reads 16 bits from memory.  In
     this way, WORDS (16-bit integers) are read directly out of two memory
     regions within conventional memory.  Therefore, you must specify a value
     for the segment address and offset.

 Note

     .  PEEKWORD() assumes that a 16-bit value is presented in the low-
        byte/high-byte sequence.

 Examples

     .  Peek a word using a hexadecimal parameters:

        ? PEEKWORD("F000", "8000")      // The WORD at address F8000h

     .  Store a value in memory and then retrieve it:

        POKEBYTE("9000", "F000", 1)     // 1 stored-9F000h (low byte)
        POKEBYTE("9000", "F001", 2)     // 2 stored-9F001h (high byte)
        ? PEEKWORD("9000", "F000")      // Word at 9F000h  513


See Also: PEEKBYTE() POKEBYTE() POKEWORD() NUMHIGH() NUMLOW()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson