Code: Select all
BIOSSEG EQU 07C0H
BOOTSEG EQU 0AE0H
LOADSEG EQU 0050H
; ...
;
; Copy boot-sector to higher memory.
;
BEGLDR:
MOV AX, BOOTSEG
MOV ES, AX
CLI ; clear maskable interrupts
MOV SS, AX
MOV SP, 1024
STI ; restore interrupts
PUSH WORD BIOSSEG
POP DS
MOV CX, 512
XOR SI, SI ; DS:SI should be 07C0:0
XOR DI, DI ; ES:DI should be 0AE0:0
CLD
REP MOVSB
; DS:SI = 07C0:0 ... 07C0:1FF
; ES:DI = 0AE0:0 ... 0AE0:1FF
SAVSRS:
PUSH ES ; We no longer need ES, so
POP DS ; DS now becomes 0AE0.
RSTCPU:
PUSH BOOTSEG
PUSH WORD FNDFLE
RETF
;
; DISKERROR: Display and error message, and
; and await a system reset.
;
DSKERR:
LEA SI, [ERRMSG]
PRNSTR:
LODSB
OR AL, 0
JZ SHORT DSKHLT
MOV AH, 14
MOV BL, 0
JMP SHORT PRNSTR
DSKHLT:
XOR AX, AX ; ! 'Restart' the PC-BIOS. !
INT 22 ; 16H
INT 25 ; 19H
;
; FINDFILE: Search for the files 'IO.SYS'
; and 'RMDOS.SYS'.
;
; Read the Root Directory into memory:
;
FNDFLE:
MOV AH, 14
MOV AL, '2'
INT 16
JMP SHORT $
...
The only thing that I can think off, after trying zero segments and with quite a number of attempts of retrying different ways, is that the pushing and popping with the segment registers is not correct, and that I should probably use the move instruction. That, or I am forgetting some other registers or something.
Anyway, just thought I'd ask. Thanks for any help