Assembler Loop

Share your advanced PureBasic knowledge/code with the community.
martin66119
User
User
Posts: 46
Joined: Sat Jan 08, 2005 7:46 pm

Assembler Loop

Post by martin66119 »

Code updated For 5.20+

I try to write a loop in assembler. (e.g. PB example

Code: Select all

For i =10 to 100 
nect i
Is there someone that give me an example that work in PureBasic 3.92 DemoVersion.
Thanks a lot for your help
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Code updated For 5.20+

pretty simple. Enable inline asm ;)

Code: Select all

i=10  ;Defines what initial value to run from

myloop:
;************
;CODE HERE!
;************
INC i        ;Increase i by 1
CMP i,100    ;Compare and set a flag
JNE l_myloop ;Jump If Not Equal (looks if what the flag value is)

;This is after the loop.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1252
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Code updated For 5.20+


and here is if you do not want to enable inline assembly...

Code: Select all

i=10 

myloop:
!INC [v_i]  
!CMP [v_i],100 
!JNE l_myloop
Image Image
Post Reply