News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

FOR macro

Started by Vortex, May 24, 2023, 08:17:44 PM

Previous topic - Next topic

Vortex

Here is a simple FOR macro for Poasm to handle more effectively the loops :

ForCounter = 0

FOR_ MACRO var,init,_end

    mov     var,init

    ForCounter=ForCounter+1

@CatStr(<Cnd>,ForCounter)= _end

@CatStr(<ForLoop>,ForCounter) :

ENDM

NEXT MACRO var

    inc     var

    cmp     var,@CatStr(<Cnd>,ForCounter)

    jbe     @CatStr(<ForLoop>,ForCounter)

ENDM
Code it... That's all...