Skip to content

Commit

Permalink
Fix gradient.asm example
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Sep 3, 2024
1 parent d3c3293 commit 947b3a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
24 changes: 15 additions & 9 deletions vm/examples/gradient.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
PIXEL_BUFFER:
.zero 1_920_000;

EVENT:
.zero 256;

WINDOW_TITLE:
.stringz "UVM Gradient Example";

Expand Down Expand Up @@ -118,14 +121,17 @@ push 0;
push PIXEL_BUFFER;
syscall window_draw_frame;



#syscall window_wait_event;





# Return to the event loop
# Wait until the user closes the window
WAIT_FOR_EVENT:
push EVENT;
syscall window_wait_event;
push EVENT;
load_u16;
# Check for EVENT_QUIT
push_u32 0;
eq_u64;
jz WAIT_FOR_EVENT;

# End program
push 0;
ret;
3 changes: 3 additions & 0 deletions vm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ impl Assembler
}
}

// TODO:
// Populate the available constants

Self {
const_map: HashMap::new(),
syscall_map: syscall_map,
Expand Down

0 comments on commit 947b3a9

Please sign in to comment.