• Axe Q&A 5 5
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #495 on: July 11, 2011, 08:55:55 pm »
That, and my independent documentation of Axe's commands. These are the optimized signed divisions that will round down instead of to zero:

  • //2
  • //64
  • //128
  • //256
  • //512
  • //16384
  • //32768

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 #496 on: July 12, 2011, 06:04:24 pm »
Ok, I guess I'll just use if statements or something :P

Another one..
Would this work...?
xor Be7→Be7
...e being the bit thing.
Or does and/or/xor always need two inputs, one bit or not?
Also, what exactly does not() do?
« Last Edit: July 12, 2011, 06:10:09 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

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 #497 on: July 12, 2011, 06:07:28 pm »
You're trying to flip the bottom bit? Do B xor 1->B. and/or/xor do take 2 inputs. not() takes a value as input and inverts each bit.
"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 #498 on: July 12, 2011, 06:09:28 pm »
Ok, cool.
I noticed you didn't put in parenthesis...when are they not needed?  When it's just a single number?
Vy'o'us pleorsdti thl'e gjaemue

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 #499 on: July 12, 2011, 06:10:17 pm »
Operations are always done from left to right unless you use parentheses to specify a different order.
"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 #500 on: July 12, 2011, 06:14:48 pm »
Quote from: commands list http://omniurl.tk/5812
Returns the bitwise operation of the lower 8 bits of the expressions. You often need parenthesis on the second argument when used.

So...why is this?  All it does is switch the nums around (ie from 1 or (A) to A or 1 )?
Vy'o'us pleorsdti thl'e gjaemue

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 #501 on: July 12, 2011, 06:16:16 pm »
Ah, that just means if the second argument is an expression. For example, A=0 or (B=1)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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 #502 on: July 12, 2011, 06:36:10 pm »
Yeah, the point is that something like A=0 and B=0 gets evaluated as ((A=0) and B)=0. Just think strictly left to right.




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 #503 on: July 14, 2011, 08:54:13 pm »
Ok..

Is there a way to directly manipulate a single byte bit?
I've been checking it first then using xor if it's not the desired value, but is there a better way to do it?
« Last Edit: July 14, 2011, 09:01:53 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

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 #504 on: July 14, 2011, 08:58:38 pm »
What do you mean, manipulate a single byte? Manipulate in what way?
"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 #505 on: July 14, 2011, 09:02:15 pm »
byte bit

Like, you can do 1→A.  Is there a way to do something like that to one bit?
I've tried 1→#e# but that messes up the whole 8 bits..
« Last Edit: July 14, 2011, 09:02:55 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

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 #506 on: July 14, 2011, 09:20:07 pm »
To work with bits, you need a bitmask. The bitmask corresponding to each of the 8 bits in a byte are 128, 64, 32, 16, 8, 4, 2, 1 (i.e. powers of 2). To store 1 to a bit of A, do A or bitmask->A. To store 0 to a bit of A, do A and not(bitmask)->A. To invert a bit of A, do A xor bitmask->A. You can even store to multiple bits at once by adding the appropriate masks together.

Edit:
It might also be easier to visualize the masks if you type them in directly as binary. For example, to set the 6th bit of A (counting from the left as the e command does), do A or π00000010->A. To reset the 3rd bit, do A and π11101111->A. To invert the 0th bit, do A xor π10000000->A
« Last Edit: July 14, 2011, 09:24:35 pm by calc84maniac »
"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 #507 on: July 14, 2011, 10:27:56 pm »
Yes, I figured out the binary and 2^n things I was just wondering what the commands would be to set the bit to a desired value.

So on, or; off and not(); invert, xor.  Thanks ;D
« Last Edit: July 14, 2011, 10:28:03 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Axe Q&A
« Reply #508 on: July 14, 2011, 10:53:47 pm »
You can use the new Pxl(,,)command
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

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 #509 on: July 14, 2011, 11:15:35 pm »
Two things.
1: This isn't related to graphic stuff, but I can see where you're getting at using it with data.  I'd just prefer it to be more optimized.
2: I'm using 0.5.3 till the contest is over.

Good idea tho..
« Last Edit: July 14, 2011, 11:16:23 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue