home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
22rsx
/
22rsx-20.ark
/
22INSTB.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-10-13
|
2KB
|
139 lines
;
;Program name: 22INSTB.ASM
;Author : James Whorton
;Date written: 10/13/84
;
;This is the link file that comes after the RSX module to be
;installed. This file will be linked automatically by LASM when
;assembling 22INSTA.ASM. Note: The RSX module must have a
;
; link '22INSTB'
;
;as the last line of the code to work properly. See .DOC for details.
;
endobj: equ $ ;this marks the end of the code.
;
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
;===============================================================
;
pend: equ $ ;this marks the end of the module
;to be moved.
;
;inline print routine
;
ilprt: equ $
push psw
push h
push d
push b
;
ilplp: mov e,m
mvi c,cout
push h
ilplp1: call bdos
pop h
inx h
mov a,m
ora a
jnz ilplp
pop b
pop d
pop h
pop psw
ret
;
;this routine outputs the address in <hl> in hex format
;
outhl: push h ;save pointer
mov a,h ;get MSB
call hex1 ;print MSB
pop h ;get pointer
push h
mov a,l ;get LSB
call hex1
call makhex
pop h
ret
;
;this routine outputs the bytes referenced by <hl>
;
outmem: push h ;save pointer
inx h ;bump one
mov a,m ;get byte
call hex1
pop h
push h
mov a,m
call hex1
call makhex
pop h
ret
hex1: mov b,a ;save number
rar
rar
rar
rar
call hex2 ;print half of it
mov a,b ;get number back
hex2: ani 0Fh ;get LSN to send out
adi 090h ;convert to ASCII
daa
aci 040h
daa
push b
mvi c,cout
mov e,a
call bdos
pop b
ret
;
;put an H on hex address and start new line
;
makhex: mvi e,'h'
mvi c,cout
call bdos
ret
;
;this routine moves <hl> to <de> for length <b>
;
move: mov a,m
stax d
inx d
inx h
dcr b
jnz move
ret ;done
;
;this routine compares bytes at <hl> and <de> for <b> bytes.
;
compar: ldax d
cmp m
rnz
inx h
inx d
dcr b
jnz compar
ret
;
;this routine subtracts <de> from <hl> and leaves the results in <hl>
;
sbc: mov a,l
sub e
mov l,a
mov a,h
sbb d
mov h,a
ret
;
end
from <hl> and leaves the results in <hl>
;
sbc: mov a,l
sub e
mov l,a
mov a,h
sbb d
mov h,a