Programming Languages

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
jamethiel

Programming Languages

Post by jamethiel »

Is everyone else here using ASM and C/C++ for their OS, or is anyone using an 'alternative' programming language?
Khumba

RE:Programming Languages

Post by Khumba »

I made my own, it's half-way between asm and C. I'm thinking about releasing it, if enough people want it. It's real-mode only, but you can use 32-bit registers.

Here's a Hello World program for DOS:

#EXT .com #ORG 100h

(Print Hello World! to the screen)
# si = hellomsg;
call print;

(Print numbers 0-9)
ax = 10;
{ ax --; push ax;
  ah = 0eh; bh || bh; int 10h;
  pop ax;
}nz

(Exit to DOS)
ah = 0x21; al || al; int 21h;

hellomsg: "Hello world!\n\z";

print:
   lodsb;
   al | al; ifnz{ ah = 0eh; bh || bh; int 10h; jmp print; }
   ret;

#DOVARREFS;
eox

RE:Programming Languages

Post by eox »

watcom c++ and a little bit of asm for startup things (entrypoint), interrupt handlers and cpu initialization
Post Reply