Skip to content

Instantly share code, notes, and snippets.

@benwaffle
Created December 30, 2014 05:27
Show Gist options
  • Save benwaffle/d2007e74bb433760ad77 to your computer and use it in GitHub Desktop.
Save benwaffle/d2007e74bb433760ad77 to your computer and use it in GitHub Desktop.
complex program
section .data
msg db "hello world", 0x0
section .text
extern gtk_init
extern gtk_widget_show_all
extern gtk_window_new
extern gtk_window_resize
extern gtk_container_add
extern gtk_label_new
extern gtk_main
global main
main:
mov rdi, 0
mov rsi, 0
call gtk_init
mov rdi, 0
call gtk_window_new
mov [rsp], rax ; push the GtkWindow*
mov rdi, [rsp]
mov rsi, 300
mov rdx, 100
call gtk_window_resize
mov rdi, msg
call gtk_label_new
mov rdi, [rsp] ; the GtkWindow*
mov rsi, rax ; the GtkLabel*
call gtk_container_add
pop rdi ; the GtkWindow*
call gtk_widget_show_all
call gtk_main
jmp exit
exit:
mov rax, 60
mov rdi, 0
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment