Author Topic: Loop Misunderstanding  (Read 2070 times)

0 Members and 3 Guests are viewing this topic.

Peter

  • Guest
Loop Misunderstanding
« on: May 07, 2014, 10:33:46 AM »
Deleted
« Last Edit: May 05, 2015, 11:20:23 AM by Peter »

Charles Pegge

  • Guest
Re: Loop Misunderstanding
« Reply #1 on: May 07, 2014, 12:46:03 PM »
Hi Peter,

I found a bug which prevented loop working with labels beginning a..e !

Try this one:

http://oxygenbasic.org/o2zips/Oxygen.zip

Charles Pegge

  • Guest
Re: Loop Misunderstanding
« Reply #2 on: May 08, 2014, 01:25:23 AM »
Peter,

The poor chap does not sleep well, he can't lie on his back anyway, and his talons get tangled in the duvet!

Microcode instructions, like loop, are somewhat deprecated. They take longer to execute than the individual instructions.

Intel has produced one of their mighty tome on the subject of optimisation:

http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf

loops in this format will actually use less instructions than your loop construct, and are not restricted to short loops:

y=20
c=0
do
  dec y
  jl exit

  inc c
end do
print c


the basic loop translates to:

(
._do
  dec [ebp - :)]
  jl exit
  ...
  jmp long _do
._exit_do
)
 



« Last Edit: May 08, 2014, 01:43:54 AM by Charles Pegge »