Page 1 of 1

displaying the result of int 12h

Posted: Sun Sep 17, 2006 5:30 pm
by ahelg
I've been messing around in assembly. I noticed that the command INT 12h gets the ammount of RAM and stores it in kbs. Now I've been trying to write a program which gets the amount of RAM and displays it but I can't seem to find a way of doing that. Could someone explain to me how I would display the results of 12h?

P.S. I'm using FASM but I also have NASM installed if that is prefered.

Re:displaying the result of int 12h

Posted: Sun Sep 17, 2006 7:07 pm
by DynatOS
ahelg wrote: I've been messing around in assembly. I noticed that the command INT 12h gets the ammount of RAM and stores it in kbs. Now I've been trying to write a program which gets the amount of RAM and displays it but I can't seem to find a way of doing that. Could someone explain to me how I would display the results of 12h?

P.S. I'm using FASM but I also have NASM installed if that is prefered.
using???

(hint: your answer is suppose to be along the lines of "BIOS/DOS/Win16/BIN/etc...")

You must realize that even though you suggest INT 12h, not everyone here can assume that you wish to use DOS even if you do. You could just as easily be using BIOS INTs only.

Re:displaying the result of int 12h

Posted: Mon Sep 18, 2006 2:25 am
by ahelg
Ah yes, I do apologize. Yet again evidence that I'm a newbie at this.

Can I use the BIOS from within Windows XP? If so then BIOS. Otherwise Windows16. My aim is to eventually know enough asm to mess around with os programming and so I expect that at such a time I won't be able to do DOS asm programming, but only BIOS, so I might as well use the BIOS as much as possible.

P.S. God I feel like such a newb doing this ;D.

Re:displaying the result of int 12h

Posted: Mon Sep 18, 2006 4:20 am
by Kemp
In XP you won't be able to access the BIOS (even if it let you, the BIOS doesn't like running in protected mode with segment registers all over the place). Dunno if you can access DOS int calls from in XP, afaik they dropped DOS from the internals of XP completely, though I don't know how complete the emulation is within a command shell. I'd guess you're accessing their attempt to be compatible with DOS apps.

Re:displaying the result of int 12h

Posted: Mon Sep 18, 2006 10:05 am
by DynatOS
If you wish to use WindowsXP and 16-bit Code, I would suggest downloading DOSBox. It is a DOS Emulator and will give you much better results than attempting to use the command shell.

Just remember that DOSBox is not a perfect subsitute for using real DOS/BIOS code (i.e. MS-DOS), but it should help you out greatly.