home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
_tr_poke.asm
< prev
next >
Wrap
Assembly Source File
|
1990-10-21
|
2KB
|
80 lines
; _TR_POKE.ASM
;
; by Ralph Davis
; modified by Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
PUBLIC _TR_POKE_PARMS
INCLUDE EXTENDA.MAC
EXTRN __TR_HTOI:FAR
DGROUP GROUP _DATA
;*****************************************************
_DATA SEGMENT WORD PUBLIC 'DATA'
;
; Saves input segment and offset
;
SEG_ADDR DW ?
OFF_ADDR DW ?
;
_DATA ENDS
;*****************************************************
;*****************************************************
_TR_POKE_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TR_POKE_TEXT,DS:_DATA
;-----------------------------------------------------
_TR_POKE_PARMS PROC FAR
;
; Called by POKE functions
;
PUSH DS
GET_PCOUNT ; call _parinfo(0) to
; make sure parameter was passed
CMP AX,3 ; do we have three parameters?
JL PO_GP_RET ; no, go to error routine
GET_CHAR 1 ; PCOUNT OK, so get parameters
PUSH DX ; now pass address to _TR_HTOI
PUSH AX
CALL __TR_HTOI ; returns integer in AX
ADD SP,4
PUSH DS ; Save caller's DS
MOV DX,_DATA
MOV DS,DX
MOV SEG_ADDR,AX ; first parameter is segment address
POP DS ; restore caller's DS
GET_PTYPE 2 ; call _parinfo() to see if offset
; is hex string or number
AND AX,CHARACTER ; is it hex string?
JNZ PO_GP_2 ; yes, use _parc()
GET_INT 2 ; no, get offset as int
JMP SHORT PO_GP_3
PO_GP_2:
GET_CHAR 2 ; Get parameter as char *
PUSH DX ; Pass it to _tr_htoi()
PUSH AX
CALL __TR_HTOI ; returns offset as integer in AX
ADD SP,4
PO_GP_3:
MOV DX,_DATA
MOV DS,DX
MOV OFF_ADDR,AX ; save it
PO_GP_RET:
MOV DX,SEG_ADDR
MOV AX,OFF_ADDR
POP DS
RET
_TR_POKE_PARMS ENDP
;------------------------------------------------
_TR_POKE_TEXT ENDS
;************************************************
END