Hi
Here is the code I have so far. I've shortened it a
bunch but I don't think I can get it much shorter.
I desided not to use any special Z80 instructions
because I want this to work with the H8's as well
( these are 8080 box's but can run HDOS ). It is
down to about 42 ( decimal ) bytes. If anyone can
remove some more that would be great. I'm using
the over writing of the jump address at the end
of the code to stop loading and begin using the
main down loader. This saved quite a bit of code
but it means that I need to load the main loader
backwards. This is a pain but not that big of a
deal, compared to typing in a lot of bytes. For this
code, if someone thinks of some other method that
does something like self modifying code, I'm
game to that. This is a boot strap and the key is
being small. There are no other rules.
I thought it would be a good idea to also have the
ability in the main loader to save the main loader to
disk as a bootable image. This would make it easier
because one wouldn't need to keep typing in the first
bootstrap loader every time one got more images to load,
like a week later.
Dwight
BOOTSTRP.ASM
; 42 BYTE BOOTSTRAP LOADER WITH INIT FOR 8250
; INTENDED FOR THE H89 BUT MAY ASLO WORK ON H8.
ORG 2300H
LDR: XRA A
OUT LCNTL ; LINE CONTROL
OUT IER ; NO INTERRUPTS
OUT MCNTL ; INIT MODEM CONTROL
DCR A ; SHOULD BE 'MVI A, 80H' BUT 0FFH OK?
OUT LCNTL
MVI A, 0CH ; 9600 BAUD
OUT DVL
XRA A
OUT DVH
MVI A, 07H ; 8 BIT 2 STOPS
OUT LCNTL
IN LSTAT
IN RX ; CLEAR ANY JUNK
LXI H, 2400H ; DEPENDS ON SIZE (TO BE DETERMINED)
LDR1: IN LSTAT
ANI 01
JZ LDR1 ; WAIT FOR CHAR
IN RX
MOV M,A
DCX H
JMP LDR ; ADDRESS TO BE OVER WRITTEN BY CODE LOADED