Created
December 30, 2014 05:27
-
-
Save benwaffle/d2007e74bb433760ad77 to your computer and use it in GitHub Desktop.
complex program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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