flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
adefeo 22 Aug 2005, 00:07
Interrupt 0x12 gets the system's memory size and stores it in AX. It is limited to detecting a max of 640KB (or is it 1024KB?), though.
|
|||
![]() |
|
MaaSTaaR 22 Aug 2005, 00:10
ok is this BOIS Interrupt , and is this Interrupt have other functions ?
|
|||
![]() |
|
THEWizardGenius 22 Aug 2005, 00:11
That's 12 hexadecimal - if you have no idea what hexadecimal is, check out this tutorial: http://www.dark-logic.com/pgm/binary.html
In FASM, a hex (short for hexadecimal) number is distinguished from decimal numbers (your normal numbers, from 0 to 9) by being preceded by "0x" or "$", or followed by a "h". Thus, "0x12", "$12", and "12h" are all 12 hexadecimal, which is 18 decimal, 22 octal, or 10010 binary (and can therefore be typed as "18", "22o", or "10010b"). If you program in assembly, you should understand binary and hexadecimal at least, and possibly octal (though it's an old number system no longer used very often). BTW, Interrupt 12 hexadecimal is the BIOS call (used in DOS) to find out how much memory is on your system. It never says more than 640k though, as it's not possible to access any memory above that under DOS. INT 12h returns the size of memory in kilobytes in AX, and the code there copies AX into _rsize. |
|||
![]() |
|
THEWizardGenius 22 Aug 2005, 00:26
No, getting the memory size is the only function.
|
|||
![]() |
|
MaaSTaaR 22 Aug 2005, 00:34
Hello
![]() thank you very much THEWizardGenius for this greate informations . ok i will read this tutorial later ![]() Quote:
do you mean i can write last code like this Code: int ramsize(void) { int _rsize; asm int 12h; asm mov [_rsize], ax; return _rsize; } or this Code: int ramsize(void) { int _rsize; asm int $12; asm mov [_rsize], ax; return _rsize; } Quote:
of course i understood binary and hex i read this http://www.groovyweb.uklinux.net/index.php?page_name=assembly%20language%20how%20to but i don't know about octal i will googling ![]() and i have question please , can i found list of these Interrupt (BOIS Interrupt) thank you very much ![]() |
|||
![]() |
|
THEWizardGenius 22 Aug 2005, 00:48
Yes, you can write the code like either of those, in FASM. However, your code appears to be in C, and in C, you can ONLY have the first example (with "0x"), "$" and "h" won't work.
Here's a good reference of the interrupts and what they do: http://www.xaff.org/GI/biosref.html For example, writing to the screen. This says Quote:
So we make sure ah is 0Eh, al is the ASCII code of the character (or in FASM, the character itself in single quotes, such as: 'A'), and call INT 10h (BL only matters in graphics mode). In plain FASM (not C): Code: mov ah, 0Eh mov al, 'H' int 10h mov al, 'i' int 10h mal al, '!' int 10h int 20h ;This exits the program, otherwise your computer will crash. and of course, the output should be Quote:
|
|||
![]() |
|
MaaSTaaR 22 Aug 2005, 01:00
THEWizardGenius wrote: Yes, you can write the code like either of those, in FASM. However, your code appears to be in C, and in C, you can ONLY have the first example (with "0x"), "$" and "h" won't work. thank you very much man , in fact it's very useful informations ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.