Author Topic: Some questions: Toggle button, Buffers, Appvars  (Read 7427 times)

0 Members and 2 Guests are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #15 on: November 04, 2011, 09:31:09 am »
Wait, does for(number) loop (number) times? O.o
I haven't read the 1.0.5 documentation yet :/
I'm not a nerd but I pretend:

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #16 on: November 04, 2011, 09:32:46 am »
the for( loops in 1.0.5 are just like in BASIC- except for the incrament
is that what you mean?

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #17 on: November 04, 2011, 09:34:42 am »
no. Quigibo posted for(383):[ code ]:End
I'm not a nerd but I pretend:

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #18 on: November 04, 2011, 10:01:46 am »
Yeah, for(number) loops (number) times. But (number) has to be a constant.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #19 on: November 04, 2011, 10:02:25 am »
Yeah, you mean you cant use for(A):...:end
I'm not a nerd but I pretend:

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #20 on: November 04, 2011, 11:19:41 am »
Yeah, you mean you cant use for(A):...:end
I'm not sure, but I think you cannot do that.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Some questions: Toggle button, Buffers, Appvars
« Reply #21 on: November 04, 2011, 03:52:07 pm »
By the way, I had to make a correction to the buffer xoring routine earlier.  The value returned after storing a 2 byte number to an address is the address plus one.  So only one a +1 is required to get to the next byte.

I cannot make the repeater loop (one argument for loop) work with a variable.  The reason is that the registers that are used as counters in the loop change depending on the the number of times to loop for maximum optimization.  If you don't know the value ahead of time, the parser can't know which method to use, and you end up forcing a more unoptimized one to account for this.  Also, you wouldn't be able to bring in a value into the loop, like in my example, unless I add some extra code to it.  Lastly, the format of the loop counter's register is NOT the same as the number of loops that need to be made.  I would have to include code to convert the value into the right format.  This is done at compile time for constants so conversions aren't needed at runtime.  Add all of these extra bytes together, and you get code that is just as big as a regular for loop.

I could add it anyway because it would still be slightly faster than a typical for loop, but you certainly lose any size optimization.
« Last Edit: November 04, 2011, 04:04:30 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!