int86();

hello,
i want to write a c programm for determining the memory size of my computer using using ROM BIOS function "int86()" and i m kind of lost.I read the prototype and a few implementations but could not really find my way around the entire register thing. please help. Thanks in advance.
The registers are used for function arguments, because an interrupt is an old way of transferring to a system function.

See here for an example:
http://www.rfoinc.com/docs/qnx/watcom/clibref/src/int86.html

The BIOS video functions are at interrupt number 16 (that's "10" in hexadecimal), so invoking interrupt 0x10 causes the PC hardware to start executing the master BIOS video control function. Read documentation here: http://en.wikipedia.org/wiki/INT_10

The subfunction to execute is, by convention, indicated by the AH register value (the high byte of the AX register).

The Scroll Active Page Up subfunction (AH == 6) is useful for clearing the screen.
Input Parameters
  AL = The number of scan lines to scroll. Note that if zero lines are requested, the entire window will be blanked.
  BH = The attribute to be used on the new blank lines entering the window from the bottom.
  CH = The upper left character row number of the window (zero based).
  CL = The upper left character column number of the window (zero based).
  DH = The lower right character row number of the window (zero based).
  DL = The lower right character olumn number of the window (zero based).

So the fellow who wrote the clear screen function (following the first link I gave you) placed 6 in AH (scroll active page up subfunction), 0 in AL (clear window), 7 in BH (background color black, foreground color light gray), 0 in CH and CL (upper-left corner of display), 24 in DH and 80 in DL (he assumes a 80 by 25 character display -- a standard CGA/EGA/VGA mode).


You need to have complete documentation for the DOS interrupt services you intend to use (0x21 IIRC).

Hope this helps.
Thanks . That was useful information.

Kind Regards,

Parminder
Topic archived. No new replies allowed.