Assembly Program on 64-bit OpenBSD Compiles Without Errors but Shows No Output

I don't get any errors whatsoever , but why don't I get any output when running this program on 64-bit OpenBSD system. I've compiled the code using:
as -o test.o test.s; ld -Bstatic test.o
as -o test.o test.s; ld -Bstatic test.o
The program executes without errors, but no text is printed to the console. I'm wondering if there might be an issue with the way I'm handling the message. Any insights would be greatly appreciated.
attachment 0
Solution:
It seems like your assembly program isn't printing text because it might be missing the correct system calls. On Unix-like systems (like OpenBSD), printing to the console usually involves using the write system call. Here's a simple, complete assembly program that prints "Hello, World!" to the console you can use this as a guide 👇 ```assembly .section .data message: .asciz "Hello, World!\n"...
Jump to solution
2 Replies
Solution
Enthernet Code
Enthernet Code•4mo ago
It seems like your assembly program isn't printing text because it might be missing the correct system calls. On Unix-like systems (like OpenBSD), printing to the console usually involves using the write system call. Here's a simple, complete assembly program that prints "Hello, World!" to the console you can use this as a guide 👇
.section .data
message: .asciz "Hello, World!\n"

.section .text
.global _start

_start:
mov $1, %rax
mov $1, %rdi
mov $message, %rsi
mov $13, %rdx
syscall

mov $60, %rax
xor %rdi, %rdi
syscall
.section .data
message: .asciz "Hello, World!\n"

.section .text
.global _start

_start:
mov $1, %rax
mov $1, %rdi
mov $message, %rsi
mov $13, %rdx
syscall

mov $60, %rax
xor %rdi, %rdi
syscall
Marvee Amasi
Marvee Amasi•4mo ago
Thanks man
Want results from more Discord servers?
Add your server