#COMPILE EXE
#DIM ALL

TYPE Point2D
    x AS LONG
    y AS LONG
END TYPE

FUNCTION PBMAIN() AS LONG
    LOCAL a AS LONG
    LOCAL b AS LONG
    LOCAL s AS STRING
    LOCAL pt AS Point2D

    a = 42
    b = 100
    s = "hello"
    pt.x = 10
    pt.y = 20

    #ASM
        mov rax, %a
        mov rbx, {b}
        mov rcx, [a]
        lea rdx, VARPTR(a)
        lea rax, STRPTR(s)
        mov ecx, LEN(s)
        mov ecx, SIZEOF(a)
        mov ecx, %pt.x
        mov edx, {pt.y}
        mov eax, [pt.x]
    #ENDASM

    PRINT "V32 ASM variable access test PASSED"
    FUNCTION = 0
END FUNCTION
