radare2/libr/egg/t/simple.r
pancake 0a14411bc1 * Added README documentation for libr/egg programming language
* Add -O flag to ragg2 as an alias for -o a.out or -o <file> (without extension)
* Add rabin2 -M (get main) for Java Class files
* Add emit_trace (code tracer) for r_egg. useful to debug
  - ragg2 -a trace hello.r
  - Add emit->jmp() function pointer and emit->retvar
  - many fixes in function calls and definitions
  - Added support for 'break;' 'break();' and 'goto();'
  - Added .ret variable as an alias for eax, rax or r0
2011-09-19 02:39:33 +02:00

34 lines
417 B
R

#!/usr/bin/ragg2 -X
main();
// OSX syscall definitions
write@syscall(4);
exit@syscall(1);
@syscall() {
: mov eax, `.arg`
: push eax
: int 0x80
}
// code
main@global(128, 128) {
.var0 = 0;
.var1 = 4;
.var2 = 8;
// prolematic sizes: 1 2 5 6 9
write (1, "hello.\n", 7);
write (1, "hello world\n", 12);
.ret = 3;
exit(0);
// line comment
if (.var0 == 0) {
goto(PENE);
break();
break;
}
:PENE:
}