I prefer Sphinx C-- for os development. Because its very lowlevel, you can directly add ASM with Intel-Syntax ( i hate AT&T syntax ). There are 2 ways to do that.
Code: Select all
asm {
mov ah,0x0E
mov al,1
mov bx,0x0007
int 0x10
}
Or
Code: Select all
void main() {
$mov ah,0x0E
$mov al,1
$mov bx,0x0007
$int 0x10
}
or
void main() {
AH = 0x0E;
AL = 1;
BX = 0x0007
$int 0x10
}
You can easyily create interrupts in 16 / V86 mode.
Code: Select all
interrupt _int_0x20 {
}
SETINTVECT( ..... )
Its just easy to create binary files !
Use C-- yourfile.c to create a .COM file or C-- /B32 yourfile.c
to create a 32bit binary file.
Theres ES/DS/FS/GS BYTE/WORD/INT/LONG/DWORD/FLOAT for memory access.
Code: Select all
ES = 0;
ESBYTE[0x7C00] = 0x05;
ESWORD[0x5500] = 0x10FF;
ESINT....
ESDWORD...
You can check the flags with:
Code: Select all
CARRYFLAG
NOTCARRYFLAG
OVERFLOW
NOTOVERFLOW
ZEROFLAG
NOTZEROFLAG
MINUSFLAG
PLUSFLAG
if(CARRYFLAG) { ..... }
You can use fastcall, inline, pascal, stdcall .. . for functions.
Code: Select all
fastcall void Test(AX)
int x = 5;
{
int y = 0;
$POP y
}
the int x = 5; means that you declare this var on the stack.
Ah i could write a long story about Sphinx C--, its the best you read the doc. I like C-- very much !
Heres the link
http://c--sphinx.narod.ru/indexe.htm
Bye.