]> rethought.computer Git - sorel-lang.git/commitdiff
fix alignment keep/f8f747f7f7a13255d19c3c715225619e8dfc21e8
authorBryan English <bryan@rethought.computer>
Fri, 6 Feb 2026 04:32:19 +0000 (23:32 -0500)
committerBryan English <bryan@rethought.computer>
Tue, 10 Feb 2026 04:08:54 +0000 (04:08 +0000)
rel-lang/sorelc/src/riscv_asm_codegen.rs
rel-lang/tests/assert.sorel
rel-lang/tests/test.sh
rel-lang/tests/test1.sorel

index 144e8c4d0d296140acaf3d33c412df1c3b345dbf..5caeffd642c350284f73f51066c3c5f606c4b7f5 100644 (file)
@@ -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");
index 8cfe073f55b9ef2c31cd094d9aa9506fc9134850..9d84758dc3f503d7c92b44d7eacc4e07a9c98ef3 100644 (file)
@@ -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
index 2838100d1c6a72ef09051edfca909a4144922004..e6f7b220a9508dabd4a6d8a67986e766bd93ea19 100644 (file)
@@ -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
index 6f5571ee05934dfb087536b59dce96984600ada7..8ba74253a0b6da646547326322281fb1fe2d7319 100644 (file)
@@ -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
+