thanks alot gunner, got any pointer to a good x64 assembly calling conventions?
posting code for further reference:
global main
extern gtk_window_new, gtk_window_set_default_size
extern gtk_widget_grab_focus, gtk_widget_show_all, gtk_widget_destroy
extern gtk_container_add
extern gtk_main, gtk_main_quit, gtk_init
extern g_signal_connect_data
extern webkit_web_view_new, webkit_web_view_load_uri
GTK_WINDOW_TOPLEVEL equ 0
NULL equ 0
section .rodata
uri db "http://www.google.com", 0
kill db "destroy", 0
die db "close", 0
section .data
main_window dq 0
web_view dq 0
section .text
main
; use this to pass argc and argv to gtk_init
;~ sub rsp, 8 * 3
;~ mov [rsp + 8], rdi ; argc
;~ mov [rsp], rsi ; argv
;~ mov rsi, rsp
;~ lea rdi, [rsp + 8]
;~ call gtk_init
;~
sub rsp, 8 ; align stack
;~ Initialize GTK+
mov rsi, 0
mov rdi, 0
call gtk_init
mov rdi, 0 ;GTK_WINDOW_TOPLEVEL
call gtk_window_new
mov [main_window], rax
mov rdx, 600
mov rsi, 800
mov rdi, rax
call gtk_window_set_default_size
;~ Create a browser instance
call webkit_web_view_new
mov [web_view], rax
;~ Put the browser area into the main window
mov rsi, [web_view]
mov rdi, [main_window]
call gtk_container_add
;~ Set up callbacks so that if either the main window or the browser instance is
;~ closed, the program will exit
mov r9, 0
mov r8, 0
mov rcx, NULL
mov rdx, gtk_main_quit
mov rsi, kill
mov rdi, r15
call g_signal_connect_data
mov r9, 0
mov r8, 0
mov rcx, r15
mov rdx, closeWebViewCb
mov rsi, die
mov rdi, r14
call g_signal_connect_data
;~ Load a web page into the browser instance
mov rsi, uri
mov rdi, [web_view]
call webkit_web_view_load_uri
;~ Make sure that when the browser area becomes visible, it will get mouse
;~ and keyboard events
mov rdi, [web_view]
call gtk_widget_grab_focus
;~ Make sure the main window and all its contents are visible
mov rdi, [main_window]
call gtk_widget_show_all
;~ Run the main GTK+ event loop
call gtk_main
mov rdi, 0
call exit
closeWebViewCb:
sub rsp, 8
mov rdi, rsi
call gtk_widget_destroy
add rsp, 8
ret
[ret]
special greetings to the first replier