Share your advanced PureBasic knowledge/code with the community.
martin66119
User
Posts: 46 Joined: Sat Jan 08, 2005 7:46 pm
Post
by martin66119 » Sat Jan 08, 2005 7:50 pm
Code updated For 5.20+
I try to write a loop in assembler. (e.g. PB example
Is there someone that give me an example that work in PureBasic 3.92 DemoVersion.
Thanks a lot for your help
thefool
Always Here
Posts: 5881 Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark
Post
by thefool » Sat Jan 08, 2005 8:16 pm
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.
Paul
PureBasic Expert
Posts: 1252 Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:
Post
by Paul » Sat Jan 08, 2005 9:00 pm
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