Pelles C forum

Assembly language => Assembly discussions => Topic started by: Vortex on March 10, 2026, 08:11:29 PM

Title: raylib sample
Post by: Vortex on March 10, 2026, 08:11:29 PM
Hello,

Inspired by the thread :

https://forum.pellesc.de/index.php?topic=11730.0

Extra files required to build and run the executable :

raylibdll.lib
raylib.dll

include     raylibDemo.inc

.data

msg1        db 'raylib hello',0
msg2        db 'Hello, raylib!',0

.code

start:

    invoke  InitWindow,800,450,ADDR msg1
    invoke  SetTargetFPS,60
@@:
    invoke  WindowShouldClose
    test    eax,eax
    jnz     @f

    invoke  BeginDrawing
    invoke  ClearBackground,RAYWHITE
    invoke  DrawText,ADDR msg2,190,200,40,BLACK
    invoke  EndDrawing
    jmp     @b
@@:
    invoke  CloseWindow

    invoke  ExitProcess,0

END start
Title: Re: raylib sample
Post by: Vortex on March 10, 2026, 08:41:03 PM
Here is the 64-bit version :

include    raylibDemo.inc

.data

msg1        db 'raylib hello',0
msg2        db 'Hello, raylib!',0

.code

start:

    sub    rsp,8+4*8
    call    main
    invoke  ExitProcess,0

main PROC PARMAREA=5*SIZEOF QWORD

    invoke  InitWindow,800,450,ADDR msg1
    invoke  SetTargetFPS,60
@@:
    invoke  WindowShouldClose
    test    rax,rax
    jnz    @f

    invoke  BeginDrawing
    invoke  ClearBackground,RAYWHITE
    invoke  DrawText,ADDR msg2,190,200,40,BLACK
    invoke  EndDrawing
    jmp    @b
@@:
    invoke  CloseWindow
    ret

main ENDP

END start