[b][red]This message was edited by Navic at 2002-8-27 10:30:55[/red][/b][hr]
This is the code of my boot loader and I'm wondering why it won't boot my program when I use 50h-90h in place of the XXh. That value is the segment where the program should be loaded to and then run, but it doesn't work with the values above. It does work with 3E8h. YYh is the value for the stack, which only worked with 7D0h, not the 50h-90h values I've tried. Does anyone know why it doesn't work with those numbers? (btw, I used NASM to compile the code)
Thanks, Navic
cli
mov ax,YY
mov ss,ax
mov sp,1000h
sti
mov [bootdrv], dl
call prog
mov ax,XX
mov es,ax
mov ds,ax
push ax
mov ax,0
push ax
retf
bootdrv db 0
prog:
push ds
mov ax,0
mov dl,[bootdrv]
int 13h
pop ds
jc prog
read:
mov ax,XX
mov es,ax
mov bx,0
mov ah,2
mov al,5
mov cx,2
mov dx,0
int 13h
jc read
retn
times 512-($-$$)-2 db 0
dw 0AA55h
NavicLand
http://www.angelfire.com/geek/navicland/index.html
HeavenWare Solutions
http://www.angelfire.com/biz7/joltware/heavenware/index.html
This is the code of my boot loader and I'm wondering why it won't boot my program when I use 50h-90h in place of the XXh. That value is the segment where the program should be loaded to and then run, but it doesn't work with the values above. It does work with 3E8h. YYh is the value for the stack, which only worked with 7D0h, not the 50h-90h values I've tried. Does anyone know why it doesn't work with those numbers? (btw, I used NASM to compile the code)
Thanks, Navic
cli
mov ax,YY
mov ss,ax
mov sp,1000h
sti
mov [bootdrv], dl
call prog
mov ax,XX
mov es,ax
mov ds,ax
push ax
mov ax,0
push ax
retf
bootdrv db 0
prog:
push ds
mov ax,0
mov dl,[bootdrv]
int 13h
pop ds
jc prog
read:
mov ax,XX
mov es,ax
mov bx,0
mov ah,2
mov al,5
mov cx,2
mov dx,0
int 13h
jc read
retn
times 512-($-$$)-2 db 0
dw 0AA55h
NavicLand
http://www.angelfire.com/geek/navicland/index.html
HeavenWare Solutions
http://www.angelfire.com/biz7/joltware/heavenware/index.html