mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-28 11:43:09 +03:00
Brainfuck interpreter added args and file hello.bf
git-svn-id: svn://kolibrios.org@7555 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
20f2ba4ab4
commit
6f6803f8ed
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Brainfuck Author Pavel Iakovlev
|
||||
* Console example in C--
|
||||
*/
|
||||
|
||||
#define MEMSIZE 4096*10
|
||||
|
||||
#include "../lib/io.h"
|
||||
#include "../lib/obj/console.h"
|
||||
|
||||
#define bufferSize 10000;
|
||||
@ -83,6 +84,7 @@ void evalBrainFuckCode(dword code)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
dword brainFuckCode = 0;
|
||||
@ -94,9 +96,14 @@ void main()
|
||||
load_dll(libConsole, #con_init, 0);
|
||||
con_init stdcall (-1, -1, -1, -1, "BrainF*ck interpreter");
|
||||
//con_set_flags stdcall (0x1F);
|
||||
con_printf stdcall ("BrainF*ck interpreter v1.0\r\n");
|
||||
loop()
|
||||
|
||||
IF(DSBYTE[I_Param])
|
||||
{
|
||||
if(io.read(I_Param)) evalBrainFuckCode(EAX);
|
||||
}
|
||||
ELSE loop()
|
||||
{
|
||||
con_printf stdcall ("BrainF*ck interpreter v1.0\r\n");
|
||||
con_printf stdcall ("\r\nEnter BrainF*ck code:\r\n");
|
||||
//con_write_string stdcall ("\r\n", 2);
|
||||
con_gets stdcall(buffer, bufferSize);
|
||||
|
1
programs/cmm/BrainFuck/hello.bf
Normal file
1
programs/cmm/BrainFuck/hello.bf
Normal file
@ -0,0 +1 @@
|
||||
++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>++.>+.+++++++..+++.<<++.>+++++++++++++++.>.+++.------.--------.<<+.<.
|
Loading…
Reference in New Issue
Block a user