This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Runer112
Pages: 1 ... 41 42 [43] 44 45 ... 153
631
« on: April 11, 2013, 11:47:07 am »
I think Z80 Bits is where everybody learned how bitwise math routines worked. It has code for multiplication, division, and square root routines of varying bit-width inputs, and pretty good explanations of the algorithms behind them. Unfortunately none of the routines go up to bit widths quite as high as you're looking for, probably because at that point you start running out of registers. I figure you can get 32-bit/16-bit by just using one of the existing routines and throwing in the use of ix to fit all the necessary bits. As for the restoring square root algorithm... that algorithm is a little mind-boggling. But I figure you'd need 16 bits to store the result instead of 8, the comparison step would have to compare 24 bits instead of 16, and you'd need to find a way to feed in 24 bits of the input (I think 8 bits always start in the "accumulator"). By the looks of it, you might be short one register, even if you use ix. Perhaps make sure interrupts are turned off and use shadow registers? But as Hayleia said, since I'm pretty sure this is for the TI-Planet contest, I don't think anybody should really write your routines for you. But hopefully I've given you some good guidance to being able to take a stab at it yourself.
632
« on: April 11, 2013, 02:32:58 am »
Just some random input from me in response to chickendude: if your program doesn't need to do anything while waiting for a key press, _GetKey is actually pretty great. And if you want to avoid the ON issue, you can thankfully get around it pretty easily. Just change the call to _GetKeyRetOff (you won't find it in TI's include file, I recommend using BrandonW's much more complete file) which returns kOff instead of actually turning the calculator off.
633
« on: April 10, 2013, 11:02:50 pm »
Seems pretty well-ordered to me.
634
« on: April 10, 2013, 08:15:03 pm »
Are you sure you're actually using the new ROM? It seems that actually running the setup wizard doesn't necessarily make the new ROM the default ROM.
635
« on: April 09, 2013, 08:11:11 pm »
How can he know what to patch when he doesn't have the source code as reference any more to determine what parts of the binary represent what original source code/data?
636
« on: April 09, 2013, 08:07:05 pm »
Hex editing is really only feasible for really small changes, like changing an internal setting or a small snippet of code to adjust an existing behavior to be slightly different. You can't really expect someone to be able to completely add a feature with fully-functional GUI and everything via a hex edit, unfortuantely
637
« on: April 08, 2013, 07:47:00 pm »
If you want to pause for a very small, precise amount of time, I would suggest something like the following:
For(N) End
This block of code just executes an empty loop N times, and it will do so at about 13 cycles per iteration.
Does the push bc \ pop bc get auto-optimized or something?
Indeed it does. Axe isn't great at optimizing, but it isn't terrible either.
638
« on: April 08, 2013, 12:45:44 pm »
For some reason, it seems that at some point in wabbitemu's version history, it developed the habit of forcibly injecting the alternative/third-party boot code called bootfree into ROM files you used. The issue with bootfree is that flash unlocks designed for the real boot code do not work with it. I would suggest making sure you have the lastest version of wabbitemu, going to the Help menu, and re-running the setup wizard to re-copy the ROM from your calculator. If you remember where you saved the appvar(s) from your original dump, you can just skip through the actual ROM copying until you get to the appvar selection point and re-use the old files.
639
« on: April 07, 2013, 01:27:47 pm »
If you're interested in on-calc assembly coding, probably the best tool for that is Mimas.
640
« on: April 07, 2013, 12:24:04 pm »
How long does Pause 1 actually last?
This is one of the reasons I took it upon myself to start documenting the size and speed of Axe commands. If you open up Commands.html, select one of the "Show size and speed for" buttons, and find Pause, you will see that it takes approximately 3349*n cycles. The calculator normally runs at 6MHz, so you can figure out the time if you like. However, that formula is not quite accurate, especially for small values of n. If (on a desktop browser) you hover your mouse over the speed information, you'll get a messy formula that exactly describes the number of cycles Pause takes. In the case of Pause 1, it's actually very hard to determine. Pause basically runs a loop inside of a loop, with the outer loop running the number of times you specify. But Paues was really designed for larger values where a small difference of one or two thousand cycles wouldn't matter, so for the sake of size optimization, on the first outer loop iteration, the inner loop iterates a number of times according to whatever value happened to be sitting in one of the CPU registers at the time. This first outer loop iteration, which in the case of Pause 1 is the only outer loop iteration, can run anywhere from 8 to 3349 cycles; all the following outer loop iterations will run at exactly 3349 cycles. You'd need to look at the disassembly of the code leading up to the Pause command and determine what value will be held in the b register (and sometimes it cannot even be determined) to know how long the first iteration will take, but that's probably overkill for now. If you want to pause for a very small, precise amount of time, I would suggest something like the following: For(N) End
This block of code just executes an empty loop N times, and it will do so at about 13 cycles per iteration.
641
« on: April 07, 2013, 03:51:37 am »
There won't exactly be a queue. Only one timer request can be "waiting", but as soon as the interrupt finishes, the timer request will be acknowledged and the interrupt will recur. So you won't get a stack build-up and overflow of waiting calls, but you will get an infinite loop of your interrupt running over and over.
And yes, executing interrupts at exact frequencies is a pain in Axe. But unfortunately there isn't much the language can do about it, because it's restricted to the limited number of speed settings the timer hardware provides. There are no exact multiples of 60Hz so you can't get it exactly, and the fastest speed is about 1000Hz so it's hard to get it almost exactly as well.
642
« on: April 07, 2013, 03:32:40 am »
Oh silly me, I see the problem. The issue is that your interrupt takes longer to execute than the amount of time between interrupt timer requests, so as soon as one interrupt call finishes, another is made. To fix this, you probably want to add some code to your interrupt that results in the body of the interrupt, in this case the DispGraphr, only being executed on some interrupt calls. One simple way to do this is with a counter that only executes the actual body of the interrupt every fixed number of interrupt calls. Here's a common way to do it:
.. 1→I .The counter fnInt(A,0) .I increased the interrupt speed for more counter precision .. Lbl A DS<(I,4) .Only execute the body every 4 interrupt calls; play with this amount DispGraphʳ End Return .Axe automatically adds a final return if you don't, but it's still good practice to include it
643
« on: April 07, 2013, 03:10:26 am »
Perhaps the Repeat loop ends immediately because it's getting reached while you're still holding down the button that launched the program? Try changing the key value so it won't detect the ENTER/2nd key.
EDIT: Also, if you're using Axe 1.2.1, it's recommended that you use the safer LnRegr rather than LnReg to turn off custom interrupts.
644
« on: April 06, 2013, 05:44:01 pm »
No reason whatsoever. Good catch.
645
« on: April 06, 2013, 02:48:54 pm »
The question is, will your program reach answers that large before your batteries die?
Pages: 1 ... 41 42 [43] 44 45 ... 153
|