home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG078.ARK
/
DUH.Z80
< prev
next >
Wrap
Text File
|
1984-04-29
|
3KB
|
129 lines
; Program name is DUH:
; as in DU for Heath
; as in duhhh (stupido)... because:
; It requires two (TWO !) copies
; of the DU com file and uses the
; proper one instead of relocating
; a much smaller file. (~5k vs. 10k)
; Try using this technique with your
; favorite 24-K interpreter. ( Could
; not do it even with a 48-k H-89. )
; but: This program uses only 8080 code
; so the user can trace it with DDT,
; even though it is running on a Z-80.
; and: The program does not conditionally
; execute any code based on examining
; RAM/ROM.
;
; Progammed by: Bill Norris
; Date: June 19,1981
; Assemble info: Cromemco assembler using dummy
; parameter in command line:
; e.g. "ASMB DUH HEX=3333"
; produces nifty little hex file.
; Usage: Using DEBUG or DDT, load both
; versions of DU into memory as
; follows:
;
; High version at 1400 hex,
; Low version at 200 hex,
; then read in DUH.HEX.
; Return to operating system
; Say "SAVE 37 DUH.COM" for CP/M or
; Say "SAVE DUH.COM 37" for CDOS.
;
; Transfer it somehow to Heath disk.
; DUH.COM should now execute properly with
; all versions of CP/M for Heath H-89 with
; 5 inch single sided single density disks.
;
cr equ 13
lf equ 10
;
org 100h ; Defeat dummy ORG parameter.
;
start:
; Start of code which may modify the relocater.
ld hl,5600h ; modify the
ld (hloopa),hl ; following
ld hl,4300h ; block move
ld (hloopb),hl ; routines if
ld (hloopf),hl ; loaded at
ld a,68h ; 4300 hex.
ld (hloopd),a ;
;
ld hl,4200h
ld (hlpb),hl
ld (hlpf),hl
ld hl,6800h
ld (hlpc),hl
ld (hlph),hl
ld hl,4205h
ld (hlpg),hl
ld hl,[hlpd-1]
ld (hlpe),hl
;
; Not done yet. Hloope instruction needs
; modification if above 4300 only. Would
; not be necessary if relative jump used.
;
lpa: ld hl,loopa
lpb: ld de,0
add hl,de
lpc: ld de,2600h ; (6800h)
ld b,[loopg-loopa]
lpd: ld a,(hl)
ld (de),a
inc hl
inc de
dec b
lpe: jp nz,lpd
;
; Now Hloope may be zapped.
ld hl,[2600h+4200h+loopc-loopa]
ld ([6800h+loope-loopa+1]),hl
;
lpf: ld hl,0
ld de,msg
add hl,de
ex de,hl
ld c,9
lpg: call 5
lph: jp 2600h ; (6800h)
msg: db cr,lf
db 'DUH Loader (omniscient object)',cr,lf
db '06/19/81 - brn',cr,lf,cr,lf,'$'
;
; This 'loop' block must be moved above
; the composite DU code blocks.
; ORG is 2600 hex. (6800 hex)
loopa: ld hl,200h ; 5600h - start of DU is
loopb: ld de,100h ; 4300h - moved to here.
loopc: ld a,(hl) ; start of block move
ld (de),a
inc hl
inc de
loopd: ld a,14h ; 68h - top of DU
cp h
loope: jp nz,[2600h+loopc-loopa] ; end of loop
loopf: jp 100h ; 4300h - execute DU
loopg: nop
;
mbase equ 4201h
hloopa equ mbase+loopa
hloopb equ mbase+loopb
hloopc equ mbase+loopc
hloopd equ mbase+loopd
hloope equ mbase+loope
hloopf equ mbase+loopf
hlpa equ mbase+lpa
hlpb equ mbase+lpb
hlpc equ mbase+lpc
hlpd equ mbase+lpd
hlpe equ mbase+lpe
hlpf equ mbase+lpf
hlpg equ mbase+lpg
hlph equ mbase+lph
;
end start