From c668eeb33d544bb1c17b249218fbb219ac6eea31 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 2 Jan 2024 16:24:32 -0700 Subject: [PATCH] closing atoms is bugged --- stdlib/helpers.lm | 4 ++-- stdlib/prelude.lm | 7 ------- tests/cons.lm | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/stdlib/helpers.lm b/stdlib/helpers.lm index 07cee1518..42ebc719d 100644 --- a/stdlib/helpers.lm +++ b/stdlib/helpers.lm @@ -101,13 +101,13 @@ ::yield-cons := λhead tail. ( head # this is head ::close-this - \t mov %r8, %r9 \n # %r9 is head + \t mov %r8, %rax \n # %rax is head tail # this is tail ::close-this # %r8 is tail \t mov $0, %r12 \n # this.atom is NULL - \t mov %r9, %r13 \n # this.head is head + \t mov %rax, %r13 \n # this.head is head \t mov %r8, %r14 \n # this.tail is tail \t mov $0, %r15 \n # this.flags is 0 ); diff --git a/stdlib/prelude.lm b/stdlib/prelude.lm index 9128c00fc..fefb08cd7 100644 --- a/stdlib/prelude.lm +++ b/stdlib/prelude.lm @@ -37,16 +37,10 @@ \t cmp $0, %r14 \n \t je __print_this_nil \n - ::show-cons - ::push-this - ::pop-this - ::show-cons - # print head ::push-this \t mov %r13, %r8 \n ::open-this - ::show-cons \t call __print_this \n ::pop-this @@ -54,7 +48,6 @@ ::push-this \t mov %r14, %r8 \n ::open-this - ::show-cons \t call __print_this \n ::pop-this diff --git a/tests/cons.lm b/tests/cons.lm index 49e49f380..9cd3004c4 100644 --- a/tests/cons.lm +++ b/tests/cons.lm @@ -1,5 +1,5 @@ main := ( - print-s (() ()) + print-s (() 123) # print-s (123 () 456) );