' ASM Hybrid — ASM code with PB variable interactions
#COMPILE EXE
#DIM ALL

TYPE Point2D
    x AS LONG
    y AS LONG
END TYPE

FUNCTION PBMAIN() AS LONG
    LOCAL i AS LONG
    LOCAL q AS QUAD
    LOCAL pt AS Point2D

    i = 7
    pt.x = 3
    pt.y = 4

    #ASM CLOBBER RBX
        mov rax, %i
        add rax, 10
        mov %i, eax

        mov rax, {pt.x}
        add rax, {pt.y}
        mov dword ptr [%pt.x], eax

        popcnt rbx, rax
        mov %q, rbx
    #ENDASM

    PRINT "i + 10 = "; i
    PRINT "pt.x + pt.y = "; pt.x
    PRINT "popcnt result = "; q

    FUNCTION = 0
END FUNCTION
