Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed Jan 23, 2025
1 parent ff04b07 commit 58a09f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
endif()
endif()

add_executable(lauf_prototype EXCLUDE_FROM_ALL main.cpp)
add_executable(lauf_prototype EXCLUDE_FROM_ALL example.cpp)
target_link_libraries(lauf_prototype PRIVATE foonathan::lauf)

5 changes: 2 additions & 3 deletions main.cpp → example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ lauf_asm_module* example_module()
block %recurse(1 => 1) {
pick 0; sint 1; $lauf.int.ssub_wrap; call @fib;
roll 1; sint 2; $lauf.int.ssub_wrap; call @fib;
uint 0; uint 1; $lauf.int.usub_panic; pop 0;
$lauf.int.sadd_wrap;
return;
}
Expand Down Expand Up @@ -126,8 +125,8 @@ lauf_asm_program create_program(lauf_asm_module* mod)

auto b = lauf_asm_create_builder(lauf_asm_default_build_options);
lauf_asm_build_chunk(b, mod, chunk, {0, 1});
lauf_asm_inst_uint(b, 3);
lauf_asm_inst_call(b, lauf_asm_find_function_by_name(mod, "fib"));
lauf_asm_inst_uint(b, 10);
lauf_asm_inst_call(b, lauf_asm_find_function_by_name(mod, "print_n_fibs"));
lauf_asm_inst_return(b);
lauf_asm_build_finish(b);
lauf_asm_destroy_builder(b);
Expand Down

0 comments on commit 58a09f4

Please sign in to comment.