forked from KolibriOS/kolibrios
Lisp v1.3 new example
git-svn-id: svn://kolibrios.org@7566 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
5cafe795a0
commit
5831d02aa5
@ -165,7 +165,7 @@ void main()
|
||||
{
|
||||
dword brainFuckCode = 0;
|
||||
word maxLoop = 1000;
|
||||
dword txt = "(print (input \"test:\"))";
|
||||
dword txt = "(set name (input \"Enter you name: \"))(print \"You name \" (get name))";
|
||||
|
||||
buffer = malloc(bufferSize);
|
||||
memory = malloc(memoryBrainfuck);
|
||||
@ -178,16 +178,7 @@ void main()
|
||||
IF(io.read(I_Param))
|
||||
{
|
||||
code = EAX;
|
||||
loop()
|
||||
{
|
||||
WHILE(DSBYTE[code] == ' ') code++;
|
||||
IF(DSBYTE[code]!='(') BREAK;
|
||||
ELSE code++;
|
||||
evalLisp();
|
||||
code--;
|
||||
IF(DSBYTE[code]!=')') BREAK;
|
||||
ELSE code++;
|
||||
}
|
||||
evalLisp();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -199,7 +190,7 @@ void main()
|
||||
con_printf stdcall ("\r\n\r\nEnter code: ");
|
||||
con_gets stdcall(buffer, bufferSize);
|
||||
code = EAX;
|
||||
//code = txt;
|
||||
code = txt;
|
||||
con_printf stdcall ("Output: ");
|
||||
evalLisp();
|
||||
maxLoop--;
|
||||
|
@ -65,9 +65,11 @@
|
||||
:dword std_print(dword count, args)
|
||||
{
|
||||
dword ret = 0;
|
||||
consoleInit();
|
||||
WHILE(count)
|
||||
{
|
||||
con_printf stdcall (DSDWORD[args]);
|
||||
IF(!DSDWORD[args]) con_printf stdcall ("nil");
|
||||
ELSE con_printf stdcall (DSDWORD[args]);
|
||||
args+=4;
|
||||
count--;
|
||||
}
|
||||
@ -77,6 +79,7 @@
|
||||
:dword std_input(dword count, args)
|
||||
{
|
||||
dword buf = 0;
|
||||
consoleInit();
|
||||
buf = malloc(100);
|
||||
WHILE(count)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user