OSDev.org
https://forum.osdev.org/

Yet another bootloader
https://forum.osdev.org/viewtopic.php?f=1&t=6799
Page 1 of 1

Author:  Curufir [ Thu Jun 13, 2002 5:05 pm ]
Post subject:  Yet another bootloader

[attachment deleted by admin]

Author:  Peter_Vigren [ Thu Jun 13, 2002 5:52 pm ]
Post subject:  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... :-)

Author:  Peter_Vigren [ Thu Jun 13, 2002 6:13 pm ]
Post subject:  Re:Yet another bootloader

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/