retroforth/vm/nga-c-no-libc/openbsd.s
crc 0d1b43a7a9 nga-c: non-libc on openbsd no longer needs nasm
FossilOrigin-Name: cf9d25aca548dfd5ec8b17ca4eb845ce414e19169358b6d6deeaa4b65e2eb50b
2021-06-19 05:47:10 +00:00

42 lines
561 B
ArmAsm

.section ".note.openbsd.ident", "a"
.p2align 2
.long 0x8
.long 0x4
.long 0x1
.ascii "OpenBSD\0"
.long 0x0
.p2align 2
.section .text
.global putchar
.global getchar
.global _start
.extern main
.p2align 8
_start:
jmp main
putchar:
mov %rdi,%rax
mov %eax,buf
mov $0x4,%rax
mov $0x1,%rdi
mov $buf,%rsi
mov $0x1,%rdx
syscall
retq
getchar:
mov $0x3,%rax
mov $0x0,%rdi
mov $buf,%rsi
mov $0x1,%rdx
syscall
mov $0x0,%rax
mov buf,%eax
retq
.section .data
buf:
.long 0