Yet another bootloader

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Curufir

Yet another bootloader

Post by Curufir »

[attachment deleted by admin]
Peter_Vigren

Re:Yet another bootloader

Post by Peter_Vigren »

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... :-)
Peter_Vigren

Re:Yet another bootloader

Post by Peter_Vigren »

Peter_Vigren wrote: Cmp Ah,0 instead of Or Al,Al... Your way save one byte... Nice... :-)
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 true :-)

I really should go to sleep now before I write something very odd... :-)
Post Reply