displaying the result of int 12h

Programming, for all ages and all languages.
Post Reply
ahelg

displaying the result of int 12h

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

Re:displaying the result of int 12h

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

Re:displaying the result of int 12h

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

Re:displaying the result of int 12h

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

Re:displaying the result of int 12h

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