This commit is contained in:
2026-05-18 08:41:37 -06:00
parent 4ef6788029
commit afc68e2a55
32 changed files with 270 additions and 38 deletions

BIN
example/ascii-string-literal Executable file

Binary file not shown.

View File

@@ -0,0 +1,4 @@
;;; -*- mode:scheme -*-
(let ((x0 (prim:write "wawa"))) x0)

View File

@@ -0,0 +1,23 @@
.data
.balign 8
.1:
.ascii "wawa"
/* end data */
.text
.globl main
main:
pushq %rbp
movq %rsp, %rbp
movl $4, %esi
leaq .1(%rip), %rdi
callq scm_from_utf8_string
movq %rax, %rdi
callq scm_write
leave
ret
.type main, @function
.size main, .-main
/* end function main */
.section .note.GNU-stack,"",@progbits

View File

@@ -0,0 +1 @@
(prim:write "wawa")

View File

@@ -0,0 +1,10 @@
data $.1 =
{b "wawa"}
export
function w $main () {
@start
%.2 =l call $scm_from_utf8_string (l $.1, l 4)
%x0 =l call $scm_write (l %.2)
ret %x0
}

BIN
example/string-literal Executable file

Binary file not shown.

View File

@@ -0,0 +1,4 @@
;;; -*- mode:scheme -*-
(let ((x0 (prim:write "안녕하세요"))) x0)

23
example/string-literal.s Normal file
View File

@@ -0,0 +1,23 @@
.data
.balign 8
.1:
.ascii "\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224"
/* end data */
.text
.globl main
main:
pushq %rbp
movq %rsp, %rbp
movl $15, %esi
leaq .1(%rip), %rdi
callq scm_from_utf8_string
movq %rax, %rdi
callq scm_write
leave
ret
.type main, @function
.size main, .-main
/* end function main */
.section .note.GNU-stack,"",@progbits

View File

@@ -0,0 +1 @@
(prim:write "안녕하세요")

View File

@@ -0,0 +1,10 @@
data $.1 =
{b "\354\225\210\353\205\225\355\225\230\354\204\270\354\232\224"}
export
function w $main () {
@start
%.2 =l call $scm_from_utf8_string (l $.1, l 15)
%x0 =l call $scm_write (l %.2)
ret %x0
}