Page 1 of 1

Fat12 loader.

Posted: Mon Aug 26, 2002 4:36 pm
by Curufir
[attachment deleted by admin]

Re:Fat12 loader.

Posted: Mon Aug 26, 2002 5:03 pm
by Curufir
Ok, followup I guess.

Carried on fiddling around with it, and the BIOS_Print routine works fine...but ONLY if I have org (The segment) at the top of the code.

So I guess this is a real newbie asm question now. How do I access the data if I have org 0? Already tried setting DS, ES, FS, GS to the segment I know it is in. Now I'm getting kinda confused.

Re:Fat12 loader.

Posted: Mon Aug 26, 2002 5:32 pm
by beyondsociety
if you are going to use [org 0] it has to be set up like this:

mov ax,7c00h
mov ds,ax

If you plan to use [org 7c00h] it has to bet set up like this:

xor ax,ax
mov ds,ax

or you could do it like this also:

mov ax,cs
mov ds,ax

You should check out crazybuddhas baby steps #2 : bios print function on page 9 of this forum.

Re:Fat12 loader.

Posted: Mon Aug 26, 2002 5:59 pm
by Curufir
[attachment deleted by admin]

Re:Fat12 loader.

Posted: Tue Aug 27, 2002 1:13 am
by Pype.Clicker
beyondsociety wrote: if you are going to use [org 0] it has to be set up like this:

mov ax,7c00h
mov ds,ax
Aouch! don't do this !! 0000:7c00 == 07c0:0000
if you're in org 0, mov ax,07c0h is the right move ...

Re:Fat12 loader.

Posted: Tue Aug 27, 2002 12:05 pm
by Curufir
Loader was still wrong.
Need to change the line

AND AX, 0x0001

to

AND CX, 0x0001

Should be obvious where, and definitely makes it work now. Just in case anyone had actually tried to use it (*laughs at the idea*) and couldn't figure out why wierd things were happening. I would post the whole thing again, but I think I've taken up enough space with dumb code nobody needs :)