Author Topic: Bug Reports  (Read 402011 times)

0 Members and 2 Guests are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Bug Reports
« Reply #450 on: June 25, 2010, 01:26:06 am »
So i am having a slight problem with the error stroller.  Specifically a piece of code like this

Code: [Select]
Pt-Off(2,2,1+1+1+1+Pic3
I added the 1+1 to make Pic3 go off to the next line.  When Pic3 is undefined, and the error is scrolled to, it does not place Pic3 on the correct line, and the text gets kinda mangled. I am using the 0.3.0Application Beta if that means anything.

o.O Did anybody see this?  I tested it with the most recent version and it still gets all messed up

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: Bug Reports
« Reply #451 on: June 25, 2010, 04:41:56 am »
I am aware of the error, and I already fixed it.  It had to do with displaying the error on the top of the screen instead of the bottom.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #452 on: July 01, 2010, 01:27:57 pm »
I'm not sure if this is a bug or if this like this for a reason, but the following program:
Code: [Select]
.TEST
!If -1→A+1
Disp "HI"
Pause 5000
End
Compiles to 58 bytes, while the following program:
Code: [Select]
.TEST
If -1→A=-1
Disp "HI"
Pause 5000
End
Compiles to 70 bytes? The only logical conclusion from this is that the =-1 comparison consumes 13 bytes, although it's documented as only consuming 9.

And why don't comparisons like this work in the first manner anyways if it's smaller?

EDIT: Hold on, just realized I was using Axe 0.3.0, let me check that this happens in 0.3.1.

EDIT 2: Yes, this occurs with Axe 0.3.1 as well.
« Last Edit: July 01, 2010, 01:33:03 pm by Runer112 »

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: Bug Reports
« Reply #453 on: July 01, 2010, 03:21:09 pm »
You're right, the negative numbers do not appear to be auto-optimizing.  I'm fixing this now.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #454 on: July 01, 2010, 04:08:33 pm »
And why is it that equalities like that aren't optimized into statements like the first example? It's always smaller and, unless I'm missing something, it works the same way.

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: Bug Reports
« Reply #455 on: July 01, 2010, 04:12:16 pm »
Because then you wouldn't be able to use it with logical operators.  Good luck trying to do A=5 xor (B=3)
« Last Edit: July 01, 2010, 04:12:54 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #456 on: July 01, 2010, 04:17:19 pm »
Because then you wouldn't be able to use it with logical operators.  Good luck trying to do A=5 xor (B=3)

This wouldn't work?
Code: [Select]
If A-5 xor (B-3)

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: Bug Reports
« Reply #457 on: July 01, 2010, 04:23:46 pm »
Nope.  Say A=6 and B=5 The answer should be 0 since neither condition is true.  But you end up with 1 xor 2 = 3 which is non-zero.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Bug Reports
« Reply #458 on: July 01, 2010, 04:24:34 pm »
runer, quigibo's example can be optimized to A-5 xor (B-3), but what about the following:
A=6 and (B=2)
A=2 or (B=3)

these don't work. i think you can only substitute equivalence with subtracting when it's a single statement, or you use xor.


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: Bug Reports
« Reply #459 on: July 01, 2010, 04:35:08 pm »
nemo, the only reason those don't work is becasue you're not using De Morgan's law, which is part of the reason I can't automatically optimize it.  The subtraction actually optimizes the not equal sign not the equal sign btw.

If A=6 and (B=2)

can become:

!If A-6 or (B-2)

However, that " or " has to be the 16-bit binary " or " (the plot style token) and so it reduces the effective optimization a little bit.  But it's still an optimization I'm sure.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #460 on: July 01, 2010, 04:35:51 pm »
I'm confused, why does 1 xor 2 = 3

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: Bug Reports
« Reply #461 on: July 01, 2010, 04:38:27 pm »
In binary,

%00000001 = 1
%00000010 = 2
apply xor to each bit
%00000011 = 3
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #462 on: July 01, 2010, 04:40:30 pm »
Oh, xor is bitwise? Not like a TI-OS xor?

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Bug Reports
« Reply #463 on: July 01, 2010, 04:42:33 pm »
look at the commands list. there's both a xor like in TI OS, and a bitwise xor ( it's a plot style token ).
bitwise:
1 xor 2 = 3
TI OS:
1 xor 2 = 0


Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Bug Reports
« Reply #464 on: July 01, 2010, 04:47:38 pm »
nemo, I believe both in Axe are bitwise. The plot-style ones are just 16-bit whereas the normal ones are 8-bit.
« Last Edit: July 01, 2010, 04:47:56 pm by Runer112 »