Commit 4bfb088d authored by Laszlo Domoszlai's avatar Laszlo Domoszlai
Browse files

better naming + increase fib argument

parent 2cb21c80
......@@ -7,44 +7,44 @@
#define arg(idx) stack_a[stack_top_a - idx]
void __add(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __add(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __INT__;
target->_int = readI(arg(2)) + readI(arg(1));
}
void __sub(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __sub(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __INT__;
target->_int = readI(arg(2)) - readI(arg(1));
}
void __gt(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __gt(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __BOOL__;
target->_bool = readI(arg(2)) > readI(arg(1));
}
void __lt(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __lt(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __BOOL__;
target->_bool = readI(arg(2)) < readI(arg(1));
}
void __eqI(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __eqI(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __BOOL__;
target->_bool = readI(arg(2)) == readI(arg(1));
}
void __eqB(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __eqB(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __BOOL__;
target->_bool = readB(arg(2)) == readB(arg(1));
}
void __not(int frame_ptr) {
Thunk* target = get_dst(frame_ptr);
void __not(int dst_idx) {
Thunk* target = get_dst(dst_idx);
target->desc = (Desc*) __BOOL__;
target->_bool = !readB(arg(1));
}
......
[1346269]
\ No newline at end of file
[14930352]
\ No newline at end of file
main = example.Start
example.Start = example.fib 30
example.Start = example.fib 35
example.fib !n_0 = if (lt n_0 2) 1 (add (example.fib (sub n_0 1)) (example.fib (sub n_0 2)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment