Yet another bootloader
Re:Yet another bootloader
First of all I must say that I'm a little impressed that you pushed the adress and then used a RetF to go there... :-) I myself have used a similar way but I haven't seen it implemented anywhere...
Second I suggest that you change BIOS_Print to the following:
BIOS_Print:
Push Ax ; Saving the registers that are changed can be useful
Push Bx
Mov Bx, 0x0007 ; These are only needed once
Mov Ah, 0x0E
BIOS_Printing:
Lodsb
Or Al, Al
Jz BIOS_Print_Done
Int 0x10
Jmp Short BIOS_Printing
BIOS_Print_Done:
Push Bx
Push Ax
RetN
I can have done some errors in the code since I'm a bit tired...
The rest seems fine to me... I haven't tested it though... and if I should be completely honest I have always used Cmp Ah,0 instead of Or Al,Al... Your way save one byte... Nice... :-)
Second I suggest that you change BIOS_Print to the following:
BIOS_Print:
Push Ax ; Saving the registers that are changed can be useful
Push Bx
Mov Bx, 0x0007 ; These are only needed once
Mov Ah, 0x0E
BIOS_Printing:
Lodsb
Or Al, Al
Jz BIOS_Print_Done
Int 0x10
Jmp Short BIOS_Printing
BIOS_Print_Done:
Push Bx
Push Ax
RetN
I can have done some errors in the code since I'm a bit tired...
The rest seems fine to me... I haven't tested it though... and if I should be completely honest I have always used Cmp Ah,0 instead of Or Al,Al... Your way save one byte... Nice... :-)
Re:Yet another bootloader
Consulting "HelpPC" again I'm seeing that the above isn't true if the register is Ax and if the value compared with is lower than or equal to 8 bits... (If I'm interpreting the information right...) But anyway else it would be truePeter_Vigren wrote: Cmp Ah,0 instead of Or Al,Al... Your way save one byte... Nice...
I really should go to sleep now before I write something very odd...