retroforth/vm/nga-c-no-libc/bsd-amd64.s
crc 37c4486d4f nga-c (non-libc): openbsd & freebsd on amd64 use same assembly portion now
FossilOrigin-Name: 5e9cb1051c37c681364157959dbe69f6c1bbc7e2e84cb21071242d7deb75fff0
2021-06-19 14:41:06 +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