diff --git a/crsn/src/asm/parse/arg_parser.rs b/crsn/src/asm/parse/arg_parser.rs index a5d911c..8f4e3dc 100644 --- a/crsn/src/asm/parse/arg_parser.rs +++ b/crsn/src/asm/parse/arg_parser.rs @@ -5,7 +5,6 @@ use crate::asm::error::CrsnError; use crate::asm::parse::parse_data::{parse_rd, parse_wr}; use crate::asm::parse::ParserContext; use crate::asm::parse::sexp_expect::expect_string_atom; -use crate::asm::patches::NextOrErr; /// Utility for argument parsing pub struct TokenParser<'a> { diff --git a/crsn/src/builtin/parse.rs b/crsn/src/builtin/parse.rs index ec5a57f..c8bb9d3 100644 --- a/crsn/src/builtin/parse.rs +++ b/crsn/src/builtin/parse.rs @@ -290,7 +290,6 @@ mod test { use sexp::SourcePosition; - use crate::asm::instr::Flatten; use crate::asm::parse::{parse_instructions, ParserContext}; use crate::asm::parse::sexp_expect::expect_list; use crate::builtin::BuiltinOps; diff --git a/examples/screen_bounce.csn b/examples/screen_bounce.csn index a1c24a0..c367f33 100644 --- a/examples/screen_bounce.csn +++ b/examples/screen_bounce.csn @@ -4,21 +4,20 @@ (sc-opt 1 1) ; auto blit (sc-opt 2 25) ; frame rate - (ld r0 5) ; x - (ld r1 0) ; y + (sym x r0) (sym y r1) (sym dx r2) (sym dy r3) (sym color r5) - (ld r2 1) ; dx - (ld r3 1) ; dy - - (ld r5 0x3300ff) + (ld x 5) (ld y 0) + (ld dx 1) (ld dy 1) + (ld color 0x3300ff) (:loop) - (add r5 0x000001) - (sc-px r0 r1 r5) - (add r0 r2) - (add r1 r3) - (cmp r0 799 (eq? (ld r2 -1)) (ne? (cmp r0 0 (eq? (ld r2 1))))) - (cmp r1 599 (eq? (ld r3 -1)) (ne? (cmp r1 0 (eq? (ld r3 1))))) + (add color 0x000001) + (sc-px x y color) + + (add x dx (z? (ld dx 1))) + (cmp x 799 (eq? (ld dx -1))) + + (add y dy (z? (ld dy 1))) + (cmp y 599 (eq? (ld dy -1))) (j :loop) - (fault "unreachable") )