home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 163_01 / peekc.c < prev    next >
Text File  |  1988-01-31  |  512b  |  16 lines

  1. /*
  2. ** get a byte from a specified segment and offset
  3. */
  4.  
  5. peekc(seg, offset) int seg; char *offset; {
  6.   #asm
  7.        MOV BX,[BP]+6   ;get segment
  8.        MOV ES,BX
  9.        MOV BX,[BP]+4   ;get offset
  10.        MOV AL,ES:[BX]  ;get the byte into the return code reg
  11.        CBW             ;sign extend
  12.        MOV BX,DS
  13.        MOV ES,BX       ;restore ES
  14.   #endasm
  15.   }
  16.