Lisp v1.3 new example

git-svn-id: svn://kolibrios.org@7566 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2018-12-07 11:40:32 +00:00
parent 5cafe795a0
commit 5831d02aa5
2 changed files with 7 additions and 13 deletions

View File

@ -165,7 +165,7 @@ void main()
{ {
dword brainFuckCode = 0; dword brainFuckCode = 0;
word maxLoop = 1000; word maxLoop = 1000;
dword txt = "(print (input \"test:\"))"; dword txt = "(set name (input \"Enter you name: \"))(print \"You name \" (get name))";
buffer = malloc(bufferSize); buffer = malloc(bufferSize);
memory = malloc(memoryBrainfuck); memory = malloc(memoryBrainfuck);
@ -178,16 +178,7 @@ void main()
IF(io.read(I_Param)) IF(io.read(I_Param))
{ {
code = EAX; code = EAX;
loop() evalLisp();
{
WHILE(DSBYTE[code] == ' ') code++;
IF(DSBYTE[code]!='(') BREAK;
ELSE code++;
evalLisp();
code--;
IF(DSBYTE[code]!=')') BREAK;
ELSE code++;
}
} }
} }
else else
@ -199,7 +190,7 @@ void main()
con_printf stdcall ("\r\n\r\nEnter code: "); con_printf stdcall ("\r\n\r\nEnter code: ");
con_gets stdcall(buffer, bufferSize); con_gets stdcall(buffer, bufferSize);
code = EAX; code = EAX;
//code = txt; code = txt;
con_printf stdcall ("Output: "); con_printf stdcall ("Output: ");
evalLisp(); evalLisp();
maxLoop--; maxLoop--;

View File

@ -65,9 +65,11 @@
:dword std_print(dword count, args) :dword std_print(dword count, args)
{ {
dword ret = 0; dword ret = 0;
consoleInit();
WHILE(count) WHILE(count)
{ {
con_printf stdcall (DSDWORD[args]); IF(!DSDWORD[args]) con_printf stdcall ("nil");
ELSE con_printf stdcall (DSDWORD[args]);
args+=4; args+=4;
count--; count--;
} }
@ -77,6 +79,7 @@
:dword std_input(dword count, args) :dword std_input(dword count, args)
{ {
dword buf = 0; dword buf = 0;
consoleInit();
buf = malloc(100); buf = malloc(100);
WHILE(count) WHILE(count)
{ {