1,17 → 1,5 |
|
|
dword std_print(dword count, args) |
{ |
consoleInit(); |
count = 1; |
WHILE(count) |
{ |
con_printf stdcall (DSDWORD[args]); |
args+=4; |
count--; |
} |
} |
|
/* Lisp functions */ |
:dword std_set(dword count, args) |
{ |
dword name = 0; |
29,6 → 17,7 |
|
:dword std_get(dword count, args) |
{ |
IF(!count) RETURN 0; |
RETURN variables.get(DSDWORD[args]); |
} |
|
35,11 → 24,13 |
:dword std_str(dword count, args) |
{ |
dword tmp = 0; |
IF(!count) RETURN ""; |
tmp = malloc(15); |
itoa_(tmp,DSDWORD[args]); |
RETURN tmp; |
} |
|
/* Math functions */ |
:dword std_add(dword count, args) |
{ |
dword ret = 0; |
70,13 → 61,41 |
RETURN ret; |
} |
|
/* Console functions */ |
:dword std_print(dword count, args) |
{ |
dword ret = 0; |
WHILE(count) |
{ |
con_printf stdcall (DSDWORD[args]); |
args+=4; |
count--; |
} |
RETURN ret; |
} |
|
:dword std_input(dword count, args) |
{ |
dword buf = 0; |
buf = malloc(100); |
WHILE(count) |
{ |
con_printf stdcall (DSDWORD[args]); |
args+=4; |
count--; |
} |
con_gets stdcall(buf, 100); |
RETURN EAX; |
} |
|
void Init() |
{ |
functions.init(100); |
|
/* Console functions */ |
functions.set("print", #std_print); |
functions.set("input", #std_input); |
|
|
/* String functions */ |
functions.set("str", #std_str); |
|
96,21 → 115,8 |
|
dword StdCall(dword count, name, args) |
{ |
dword tmp = 0; |
|
functions.get(name); |
IF(EAX) RETURN EAX(count, args); |
IF(!strcmp(name, "print")) |
{ |
consoleInit(); |
count = 1; |
WHILE(count) |
{ |
con_printf stdcall (DSDWORD[args]); |
args += 4; |
count--; |
} |
} |
RETURN 0; |
} |
|