Article Index

Because this example is part of a rebuild, the include files don't match with the proposed nasm include file directory. Adjust as needed.

;name: version.asm
;
;description: shows the gtk and glib version numbers

bits 64

%include "version.inc"

global _start

section .bss

section .rodata

    version:	db  "GTK+ version      : %d.%d.%d",10
                db  "Glib version      : %d.%d.%d",10
                db  "     binary age   : %d",10
                db  "     interface age: %d",10,0
    
section .data

section .text

_start:

    call    gtk_init
    mov	    r10d,dword[glib_interface_age]
    push    r10
    mov	    r10d,dword[glib_binary_age]
    push    r10
    ;get major,minor and micro version of Glib
    mov     r10d,dword[glib_micro_version]
    push    r10
    mov     r9d,dword[glib_minor_version]
    mov	    r8d,dword[glib_major_version]
    ;get major,minor and micro version of Gtk2
    mov     ecx,dword[gtk_micro_version]
    mov     edx,dword[gtk_minor_version]
    mov	    esi,dword[gtk_major_version]
    mov	    rdi,version
    xor	    rax,rax
    call    g_print
    xor	    rdi,rdi
    call    exit