home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
peekint.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-21
|
2KB
|
58 lines
; PEEKINT.ASM
;
; by Ralph Davis
; modified by Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
PUBLIC PEEKINT
EXTRN _TR_PEEK_PARMS:FAR
INCLUDE EXTENDA.MAC
;*****************************************************
PEEKINT_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:PEEKINT_TEXT
;-----------------------------------------------------
;
; PEEKINT(segment, offset)
;
; segment = SPACE(4) && hexadecimal string
; offset = number < 65536 or hexadecimal string
;
; Returns: word at segment:offset as an integer
; -1 if less than two parameters passed
;
;--------------
PEEKINT PROC FAR
PUSH BP
MOV BP,SP
PUSH DS
PUSH ES
PUSH BX
PUSH SI
CALL _TR_PEEK_PARMS
JL PEEKINT_ERR ; Sign flag set means less than 2 parms
MOV DS,SI
MOV SI,AX ; DS:SI now points to requested word
MOV AX,[SI] ; pick it up
JMP SHORT PEEKINT_EXIT ; and we're done
PEEKINT_ERR:
MOV AX,-1 ; return -1 for error condition
PEEKINT_EXIT:
POP SI
POP BX
POP ES
POP DS
POP BP
RET_INT AX ; return integer to caller
RET
PEEKINT ENDP
;------------------------------------------------
PEEKINT_TEXT ENDS
;************************************************
END