Fat12 loader.

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

Fat12 loader.

Post by Curufir »

[attachment deleted by admin]
Curufir

Re:Fat12 loader.

Post 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.
beyondsociety

Re:Fat12 loader.

Post 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.
Curufir

Re:Fat12 loader.

Post by Curufir »

[attachment deleted by admin]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Fat12 loader.

Post 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 ...
Curufir

Re:Fat12 loader.

Post 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 :)
Post Reply