SEGMENT TEXT
SEGMENT CODE
%ifndef $main
%define $main

..start:
mov  ax, DATA
mov  ds, ax
mov  ax,stack
mov  ss,ax
mov  sp,stacktop
call main
mov  ax, 0x4C00
int  0x21
name:    db  'Draak, the 16-bit multi-language compiler, by Jon Gentle', 10, 13
         db  'Copyright 2000 by Jon Gentle under the UnNamed Licence', 10,13
%endif
/.
  #
  # This is the Draak Fake-C compiler defination file.  Currently, it's not
  # what C is, because of the following:
  # - Lack of program control functions.  Implemented so far: if
  #   To be implemented: while, else, for
  # - Variables are not prefixed with _'s
  # - The stack is done Pascal style, well, halfway, because i didn't know
  #   all of C style calling.
  #
!
!
!// (%)
!
!/* (%)
 #& */
!
!#define (%s) (%)
 !d %1 %2
 +%%define %1 %2
!
!#define (%)
 +%%define %1
!
!#ifndef (%)
 +%%ifndef %1
!
!#endif
 +%%endif
!
!#include <(%)>
 !i %1
!
!#include (%)
 !s %1
 !i %1
!
!asm (%)
 !s %1
 +%1
!
!if (%){(%)
 !e %1
 +cmp ax, 0x0000
 &uj
 &gj
 +jz %3
 !E %2
# &oj
!
!&&
 +and ax, bx
!
!==
 +sub ax, bx
!
!(%s)++
 +mov %0, [%1]
 +add word[%1], 1
!
!(%s)+(%s)
 &in %1
 &+add %0, [%2]
 &l
 &+mov %0, [%1]
 &+add %0, [%2]
 &e
!      
!(%s)=(%)
 &gt %1
 +mov %3[%1], %2
!
!(%s):
 +%1:
!
!(%s) (%s)((%)) {
 +GLOBAL %2
 +%2:
 !a %2 %1
 !v %3 "t n,"
 +push bp
 +mov bp, sp
!
!{
 &uj
!
!}
 &ij
 &+mov sp, bp
 &+pop bp
 &+ret .retSpc
 &l
 &oj
 &e
!
!(%s)((%))
 !" %2
 !c1 %2 "n,"
 +call %1
!  
@(%s) (%s)=(%s)
 +%2: dw %3
 !a %2 %1
@
@(%s) (%s)
 +%2: dw  0
 !a %2 %1
@
/.
