Re:Ode to the M1
by SubjectToChange on Sunday August 13, 2023 @02:41AM
(#37107269)
write a hello world application in gtk or qt and see how much assembly you get.
[ Parent
| on HN ]
Re:Ode to the M1
by GhostWhisperer on Sunday August 13, 2023 @03:15AM
(#37107446)
let's move the goal posts to doing it in brainfuck since we're at it
Re:Ode to the M1
by SubjectToChange on Sunday August 13, 2023 @04:20AM
(#37107787)
What goalpost did I supposedly move?
x86_64 assembly, gtk3, 21 lines / 19 instructions
build with e.g. gcc hw.s `pkg-config --libs gtk+-3.0`
.globl main;main:
push %rbx
xor %esi, %esi
xor %edi, %edi
call gtk_init@PLT
lea .HW(%rip), %r8
xor %edx, %edx
xor %esi, %esi
mov $2, %ecx
xor %edi, %edi
xor %eax, %eax
call gtk_message_dialog_new@PLT
mov %rax, %rbx
mov %rax, %rdi
call gtk_dialog_run@PLT
mov %rbx, %rdi
call gtk_widget_destroy@PLT
xor %eax, %eax
pop %rbx
ret
.HW:.string "Hello World!"
Re:Ode to the M1
by SubjectToChange on Sunday August 13, 2023 @04:47AM
(#37107934)
Are you sure you couldn’t wrap that up in another library and just do everything in a single call?
you jest, but in fact you could.