%ifndef main
%define main
SEGMENT TEXT
SEGMENT CODE

..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 Public Licence', 10,13
%endif

/.
!
!
!#define (%) (%)
 !d %1 %2
 _%%define %1 %2
!
!#define (%)
 +%%define %1
!
!#ifndef (%)
 +%%ifndef %1
!
!#endif
 +%%endif
!
!#include "(%1).fc"
 #%%include "%1.asm"
 !i %1.fc
!
!#include (%1)
 %%include (%1)
!
!if (word%1) then (pointer%2)
 +cmp word[%1], 0x0000
 +je  %2
!
!(word%1)++
 +mov ax, word[%1]
 +add ax, 1
 +mov [%1], ax
!
!(%) = (%)
 +mov %1t[%1], %2
!
!(%1):
 +_%1:
!
!int (%1) ((%2)) {
 @%1~int
 +_%1:
 !a %1 word
 !v %2 "t=n,"
 +push bp
 +mov bp, sp
!
!}
 +mov sp, bp
 +pop bp
 +ret
!
!(%1) ((%2))
 !c1 %2 "n,"
 +call _%1
!
#Dead stuff, just to take space
!"(%1)"
 +mov dx, %1
!
!asm (%1)
 !s %1
 +%1
!
@string (%1) (%2)
 +%1:  db %2, "$"
 !a _%1 _dword
@
#End Dead stuff
#@int (%1) ((%2v)) {
# +%1:
#@
@word (%1%word)
 +%1:  dw 0
 !a _%1 word
@
@word (word%1)=(word%2)
 +%1:  dw  %2
 !a _%1 word
@
@byte (byte%1)=(byte%2)
 +%1:  db  %2
 !a _%1 byte
@
/.
