• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 591793 times)

0 Members and 3 Guests are viewing this topic.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #480 on: June 28, 2011, 04:50:42 pm »
Memory locations, meaning pointers?
Something like {P}++ ?
« Last Edit: June 28, 2011, 04:51:36 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe Q&A
« Reply #481 on: June 30, 2011, 11:29:14 am »
Yes, and especially stuff like {P*2+4390+E+C}++; because whenever you have the form {EXP}+1->{EXP}, the expression has to be evaluated twice, while with the ++ and -- it only needs to be evaluated once.

Offline Anima

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 133
  • Rating: +4/-0
    • View Profile
Re: Axe Q&A
« Reply #482 on: July 01, 2011, 12:21:17 pm »
Is it possible to delete programs with Axe?


Sorry for my bad English. I'm German.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #483 on: July 01, 2011, 12:25:16 pm »
Yes:

Code: [Select]
DelVar "prgmNAME"

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #484 on: July 06, 2011, 04:08:49 pm »
Is there a bitwise expression to turn off bits?  I'm pretty sure it's and, but I tried Disp (7 and (5))►Dec and it outputted 4 instead of 2 ???
Vy'o'us pleorsdti thl'e gjaemue

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #485 on: July 06, 2011, 04:16:27 pm »
Think about it in binary: 7 is %00000111 and 5 is %00000101. ANDing them together would give you %00000101, which should be 5.

What AND does is leave on all the bits that are on in both operands and turn off all the others. If you want to turn off a specific bit, you should AND it with a number with just that bit turned off -- for example, to turn off the first bit (second rightmost), you'd use AND %11111101.
« Last Edit: July 06, 2011, 04:16:51 pm by Deep Thought »




Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #486 on: July 06, 2011, 04:23:31 pm »
Ok, so you have to do it in a roundabout way...
* Darl181 wonders if there should be a decent description of what they do in the docs or command list :P
Vy'o'us pleorsdti thl'e gjaemue

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Q&A
« Reply #487 on: July 06, 2011, 04:25:14 pm »

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: Axe Q&A
« Reply #488 on: July 07, 2011, 01:14:27 pm »
To turn off a bit pattern P in a number N, you just or the number with P and then And it with P compliment.  So for an 8 bit value in Axe:

N or P and not(P)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Q&A
« Reply #489 on: July 07, 2011, 10:40:46 pm »
Actually, N and not(P) is all you need.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #490 on: July 11, 2011, 05:52:22 pm »
About how axe rounds down...
Does it always "round down" per se, or does it round closer to zero?
As in, would -10//3 equal -3 or -4 ?
Vy'o'us pleorsdti thl'e gjaemue

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Axe Q&A
« Reply #491 on: July 11, 2011, 05:57:58 pm »
with the number in decimal form, it just cuts off the digits to the right of the decimal point.  So closer to zero, I guess.

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Axe Q&A
« Reply #492 on: July 11, 2011, 06:20:16 pm »
Axe doesn't round, it truncates.
In-progress: Graviter (...)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #493 on: July 11, 2011, 08:31:07 pm »
In Axe, calculations that would generate decimals, such as division, will always be truncated. When dealing with positive numbers, this means results are rounded down. However, with negative numbers, the story changes slightly depending upon how the math is performed.

With something like ⁻10//3, the signed division routine converts any negative inputs to positives and then corrects the sign later. So it actually calculates the result of 10/3 which gives 3 due to truncation, but then negating the final answer to correct for the signs results in the answer actually having been rounded to zero from -3.333...

However, with optimized divisions like ⁻7//2, the inputs are not first converted to positive numbers and then operated on, resulting in the truncation actually rounding down to ⁻4.


In summary:
  • Normal division: rounds to zero (down)
  • Signed division: rounds to zero (not always down)
  • Signed disivion by optimized constants: rounds down
« Last Edit: July 11, 2011, 08:34:37 pm by Runer112 »

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Axe Q&A
« Reply #494 on: July 11, 2011, 08:53:05 pm »
Ok...and the only place that lists the optimized constants is the auto-opts thing that comes with axe?
Vy'o'us pleorsdti thl'e gjaemue