home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
simtel
/
sigm
/
vols200
/
vol276
/
zcpr3cmd.lbr
/
POKE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1986-06-11
|
1KB
|
75 lines
;section 5I
;command: POKE
;Written by Richard Conn, modified by Bob Logan
;
;function: Place Values into Memory
;
;forms:
; poke startadr val1 val2 ... (hex values)
; poke startadr "message (converts message into appropriate hex)
POKE EQU $
.phase Z3CMD
PO_E:
LD HL,TBUFF+1 ;pt to first char
CALL SKSP ;skip to non-blank
JP Z,ERROR ;arg error
CALL PHEX ;convert to number
CALL PRINTC
DB ' Pok','e'+80H
CALL PADRAT ;print at message
; loop for storing hex values sequentially via poke
POKE1:
PUSH DE ;save address
CALL SKSP ;skip to non-blank
JR Z,BACK ;done
CP '"' ;quoted text?
JR Z,POKE2
CALL PHEX ;get number
LD A,E ;get low
POP DE ;get address
LD (DE),A ;store number
INC DE ;pt to next
JR POKE1
BACK:
POP DE
RET
; store ascii chars
POKE2:
POP DE ;get next address
INC HL ;pt to next char
POKE3:
LD A,(HL) ;get next char
OR A ;done?
RET Z
LD (DE),A ;put char
INC HL ;pt to next
INC DE
JR POKE3
; print address message
; print address in de
PADRAT:
CALL PRINT3
DB ' ','@'+80H
LD A,D ;print high
CALL PASHC
LD A,E ;print low
JP PAHC
;get hex number from command line
PHEX:
CALL HNUM11
EX DE,HL
RET
PO_L EQU $-PO_E
.dephase