• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 581239 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 #1380 on: February 17, 2012, 11:22:49 am »
For menus, I think you would be better off using getKey or even getKeyr to detect keypresses. With these commands, keys except the arrow keys (and DEL I believe, but that's not really important) would only register once per physical keypress, and the arrow keys will repeat like how they do in OS contexts.

Although if you want to go with the getKey() method, I would go along the guideline that Pause 1800 approximately equals one second at 6MHz and Pause 4500 approximately equals one second at 15MHz. Alternatively, after handling a keypress, wait for all keys to be released before waiting for the next keypress:

Code: [Select]
While 1
.WAIT FOR KEYS TO BE RELEASED
End!If getKey(0)
While 1
.WAIT FOR A KEYPRESS
EndIf getKey(0)
« Last Edit: February 17, 2012, 11:27:47 am by Runer112 »

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1381 on: February 18, 2012, 11:19:28 am »
Questions about interrupts:
Are the interrupt calls depending on the length of the interrupt function? So if the time of execution of an interrupt is longer than the time beetween the interrupts, will then the current interrupt abort, will the program skip the next interupt or will it be executed right after it is finished?

Secondly, why stops the counter in this program on a real calculator (the program still runs until you press clear), but on the emulator in counts forever?
Code: [Select]
FnOn
Fix 5
0->C
fnInt(IN,0)
ClrDraw
Repeat getkey(15)
  Text(0,0,C>Dec
  DispGraph
End
LnReg
Fix 4
Return

Lbl IN
  C++
Return
« Last Edit: February 18, 2012, 11:20:49 am by MGOS »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Axe Q&A
« Reply #1382 on: February 18, 2012, 11:23:50 am »
Question:
Is there a way to "jump" to other program from the other program?
Sig wipe!

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: Axe Q&A
« Reply #1383 on: February 18, 2012, 12:22:09 pm »

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1384 on: February 20, 2012, 01:12:34 pm »
Is there a there an arbitary exponentiation operator in axe, or just with 2 as base?

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe Q&A
« Reply #1385 on: February 20, 2012, 01:13:12 pm »
no, just do 2*2*2*2 (as many times as ya want)
I'm not a nerd but I pretend:

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1386 on: February 20, 2012, 01:14:23 pm »
Ok, then I have to do things differently, 'cause the base is 3/4 and the power/exponent is a variable.
« Last Edit: February 20, 2012, 01:14:54 pm by MGOS »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe Q&A
« Reply #1387 on: February 20, 2012, 01:16:40 pm »
Hm.
Code: [Select]
[base]->A->C
[exponent]->B
for(theta,0,B)
A*C->C
end
that'll do it but watch out with numbers over 65535.
I'm not a nerd but I pretend:

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1388 on: February 20, 2012, 01:23:56 pm »
Yeah, that's the way I thought about too.

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 #1389 on: February 22, 2012, 11:46:22 am »
Can I GetCalc() to the same file twice and not have any weird stuff happen?  Also if I know for a fact that the var exists can I just do GetCalc(Str0,Y1) to correct where it points after unarchiving and re-archiving it?

Edit: nvm, answered my own q's, both yes
I guess sc messed something up again, I typed it in myself and it worked perfectly unlike before :/
« Last Edit: February 22, 2012, 12:04:44 pm by Darl181 »
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 #1390 on: February 27, 2012, 10:38:54 pm »
Are the interrupt calls depending on the length of the interrupt function? So if the time of execution of an interrupt is longer than the time beetween the interrupts, will then the current interrupt abort, will the program skip the next interupt or will it be executed right after it is finished?
Nope, and that's why interrupts can't take too long, or else it'll keep firing interrupt after interrupt and never return to the program.




Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1391 on: February 28, 2012, 01:56:03 am »
Nope, and that's why interrupts can't take too long, or else it'll keep firing interrupt after interrupt and never return to the program.
Ok... I tried this and I could abort the program with long interrupts... maybe it was just luck  ::)

Still, has somebody a solution for my other question?

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 #1392 on: February 28, 2012, 02:48:20 am »
@MGOS
Well first of all, if I assume n is positive, (3/4)^n is going to be less than 1.  So I believe it is a fair assumption that you want a fixed point output.  Given this, we can start be rewriting it as (0.75^n).  Raising a number to a power is just multiplying it over and over so you can simply perform the nieve method of starting with 1.0->A and for n times do A**0.75->A.  You can also take the more optimized approach of successive squaring which only takes log(n) multiplications.  If n is negative, its the same algorithm, but you use (4/3) or (1.333) as the base.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1393 on: February 28, 2012, 10:30:41 am »
@Quigibo:
I found another solution with a 240 byte LUT, which is a lot faster and other calculation can be integrated as well without taking any more memory.

Btw, I didn't think about that question, I thought about the program example with the interrupts were the counter suddenly stops...

Offline TI-Over9000

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +8/-1
    • View Profile
Re: Axe Q&A
« Reply #1394 on: March 02, 2012, 12:28:22 pm »
Q: how did Axe get its name?  My friend programs in axe and it looks really cool and I want to learn.  I have been learning for a while but my friend is not very good at it.