From: Bryan English Date: Fri, 6 Feb 2026 04:32:19 +0000 (-0500) Subject: fix alignment X-Git-Url: https://rethought.computer/gitweb//gitweb//git?a=commitdiff_plain;h=f8f747f7f7a13255d19c3c715225619e8dfc21e8;p=sorel-lang.git fix alignment --- diff --git a/rel-lang/sorelc/src/riscv_asm_codegen.rs b/rel-lang/sorelc/src/riscv_asm_codegen.rs index 144e8c4..5caeffd 100644 --- a/rel-lang/sorelc/src/riscv_asm_codegen.rs +++ b/rel-lang/sorelc/src/riscv_asm_codegen.rs @@ -109,6 +109,7 @@ impl<'a> CodeGen<'a> { // Static strings self.label(".section .rodata\n"); + self.label(".align 3\n"); for ir in &self.module.data { match ir { IR::StringDef(string_label, some_string) => { @@ -123,6 +124,7 @@ impl<'a> CodeGen<'a> { // Data stack self.label(".data\n"); + self.label(".align 3\n"); self.label("data_stack:"); self.line(format!(".space {}", self.data_stack_size)); self.label(".globl data_stack_end\ndata_stack_end:\n"); diff --git a/rel-lang/tests/assert.sorel b/rel-lang/tests/assert.sorel index 8cfe073..9d84758 100644 --- a/rel-lang/tests/assert.sorel +++ b/rel-lang/tests/assert.sorel @@ -1,13 +1,12 @@ \ vim: filetype=forth import "std:process" -import "std:out" export assert : assert ( x -- ) if - "pass\n" puts drop + drop else 1 exit endif diff --git a/rel-lang/tests/test.sh b/rel-lang/tests/test.sh index 2838100..e6f7b22 100644 --- a/rel-lang/tests/test.sh +++ b/rel-lang/tests/test.sh @@ -4,6 +4,6 @@ AS="${CMD_PREFIX}as" LD="${CMD_PREFIX}ld" ../target/debug/sorelc test1.sorel -$AS -o test1.o test1.asm +$AS -g -o test1.o test1.asm $LD -o test1.out test1.o ./test1.out diff --git a/rel-lang/tests/test1.sorel b/rel-lang/tests/test1.sorel index 6f5571e..8ba7425 100644 --- a/rel-lang/tests/test1.sorel +++ b/rel-lang/tests/test1.sorel @@ -1,7 +1,7 @@ \ vim: filetype=forth -import "std:out" import "./assert.sorel" +import "std:out" "Hello, World! \n" puts drop @@ -14,4 +14,5 @@ import "std:mem" 64 alloc free -\ 0 assert +0 assert +