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

0 Members and 2 Guests are viewing this topic.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Axe Q&A
« Reply #1635 on: May 06, 2013, 10:16:11 pm »
N00B QUESTION ALERT:
read with cation as this may cause serious to fatal n00bism.

What is axe???? I'd like to learn...

(p.s. How do you get spoilers in replies?)
:w00t:
It's a compiled language for the 83+/84+ series. What this means is that Axe code gets compiled into machine code using an app. The advantage of using Axe over assembly is the lower learning curve.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: Axe Q&A
« Reply #1636 on: May 07, 2013, 05:03:48 pm »
Spoiler For Spoiler:
To do a spoiler in a post, use the "Sp" button in the post module, or type:

[ s p o i l e r ]  (INSERT TEXT HERE)  [ / s p o i l e r ]
« Last Edit: May 07, 2013, 05:06:40 pm by codebender »
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline TheBassetHound

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +7/-3
  • GLaDOS is a potato
    • View Profile
Re: Axe Q&A
« Reply #1637 on: May 07, 2013, 09:18:02 pm »
Spoiler For Spoiler:
Aha, some HTML! (Still need to learn... XD)
Thanks! :thumbsup:
TheBassetHound


Aperture Science Handheld Portal Device
 /––––\    (¯\       /¯—/¯¯–______––
/   /\/˜¯¯¯\  \____/     \
   /          \___________\
 –(           |____________\
   \   /¯¯--•¦=––––––––––––\
    \/           ¯\==========\
\     ¯¯——__–¯\—————––\
 \––––___–¯–¦__                   \ √=_
                   \____——¯¯¯¯¯¯¯¯

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe Q&A
« Reply #1638 on: May 08, 2013, 03:46:22 am »
That's not HTML but BBcode. Allowing users to input HTML is a security breach.

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 #1639 on: May 18, 2013, 01:11:20 pm »
I've seen countless optimizations with this, but never completely understood it myself..

How exactly is hl handled throughout loops? Does For(I,#,#) change it every iteration? Or do all loops leave hl untouched when execution goes back to the start?
Vy'o'us pleorsdti thl'e gjaemue

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1640 on: May 18, 2013, 06:38:42 pm »
The line after For(VAR,START,END) will hold the value of END-VAR for the current iteration. You can use this to optimize if you'd like, just keep in mind that this could potentially change in the future.

I can't say I've seen optimizations involving the use of this value... I have, however, made many optimizations using For(CONST), as this doesn't even affect HL. But be wary that For(VAR/EXPR) will load VAR/EXPR into HL at the start of the first iteration, but not after that.
« Last Edit: May 18, 2013, 06:42:37 pm by Runer112 »

Offline Ft.lou

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 6
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1641 on: June 21, 2013, 07:42:56 am »
Can someone explain the conditional comment for me?
Can i use a variable in the conditional comment?
THX

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #1642 on: June 21, 2013, 07:55:49 am »
You can't use a variable in a conditionnal comment. It is described in the readme that the argument must be a constant (or a test involving only constants, which is a constant in some way).

It can be useful for example (other examples can be found but I give this one) if you want to make two versions of your program: one for regular 83+ and one for the 15 MHz calcs. Then just do your code like that:

.PROGRAM
XXX→°Model

<put some code here>

...If °Model=83
<put here the code for the regular 83+>
...Else
<put here the code for 15MHz models>
...End

<put some code here>

Then, to compile the 83+ version, replace XXX with 83 and compile, and to compile the 15MHz version, replace XXX with 84 and compile. If °Model=83, only the code for the regular 83+ will be parsed, and the contrary if you put 84.
And since the compiler tests °Model when compiling and not when launching the program, you can't use a variable there.
« Last Edit: June 21, 2013, 07:56:41 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Ft.lou

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 6
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1643 on: June 21, 2013, 08:21:47 am »
Thanks for help! I understand now.. :)

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Appvars
« Reply #1644 on: August 26, 2013, 12:53:03 am »
Alright, I need some help with appvars.  I don't actually have my calc right now, but this is about what my code looks like.
Code: [Select]
getcalc("appvMAP,10")->A
For(X,0,9)
0->{A+X}
End
1->{A}
For(X,0,9)
Output(0,0,{X+A}>Dec)
End

Obviously not complete or optimized, I'm just trying to get used to appvars.  My issue is that I've stored 0s and 1s to the appvar, yet it outputs values from between 0 and 255.  Any ideas why its doing this?  I assume I'm either writing to it incorrectly or reading incorrectly, but I can't figure it out.
« Last Edit: August 26, 2013, 12:54:09 am by BlackCode »
-I post from my iPod, so please forgive any funky formatting.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1645 on: August 26, 2013, 01:04:49 am »
Hmm... being able to see the real code could be helpful. I believe there are some copying errors in that code, like the size argument of GetCalc() being inside the quotation marks and the value outputs all overwriting each other. :P But even with these errors fixed, I don't see anything critically wrong that would be causing what you got.
« Last Edit: August 26, 2013, 01:58:58 pm by Runer112 »

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1646 on: August 26, 2013, 01:16:31 am »
Hmm... being able to see the real code could be helpful. I believe there are some copying errors in that code, like the size argument of GetCalc() being inside the quotation marks and the value outputs all overwriting each other. :P

If by outputs overwriting eachother you mean they all go to 0,0, than yea they do.  I just stuck a pause 500 in there so I could see each number.  As for the quotation marks, I just realized I didn't have them like that, not sure why I thought I did...
« Last Edit: August 26, 2013, 01:19:07 am by BlackCode »
-I post from my iPod, so please forgive any funky formatting.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #1647 on: August 26, 2013, 03:52:18 am »
Also, that doesn't solve any problem, but you may want to check the Fill command out instead of using a For loop to set a bunch of bytes at 0.
Now your code seems to work on Wabbit (once I put the quotes at the right place), I don't see any problem, it displays a 1 then zeroes.
Also be sure that the appv is the appv token, and not a "a" followed by a "p", ...
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Axe Q&A
« Reply #1648 on: August 26, 2013, 06:13:32 pm »
Also, that doesn't solve any problem, but you may want to check the Fill command out instead of using a For loop to set a bunch of bytes at 0.
Now your code seems to work on Wabbit (once I put the quotes at the right place), I don't see any problem, it displays a 1 then zeroes.
Also be sure that the appv is the appv token, and not a "a" followed by a "p", ...

*Facedesk*. Realized in math today that I had been reading the code as I thought I wrote it, not as I actually did, silly typos fixed, and it works well now.  Thanks for attempting to help though :P

On an unrelated note, is there a better way to handle input from getkey than a bunch if if/elseif? 
« Last Edit: August 26, 2013, 06:23:40 pm by BlackCode »
-I post from my iPod, so please forgive any funky formatting.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Axe Q&A
« Reply #1649 on: August 28, 2013, 12:54:17 pm »
Yes with a For loop.