Search found 12 matches

by Goplat
Sat 17 Nov, 2007 9:34 pm
Forum: Programming Help
Topic: [C] Type punning acceptable on float?
Replies: 20
Views: 20874

If that's a standalone function, and the float is being passed on the stack rather than in a floating point register (under standard x86 calling conventions, everything is passed on the stack), then yes, the trick will be faster than a normal comparison. However, it's not realistic to have an "...
by Goplat
Thu 20 Sep, 2007 1:30 pm
Forum: Programming Help
Topic: [C] Programming Challenge
Replies: 6
Views: 4669

thegamefreak0134: DEBUG has the odd fact that numbers are always hexadecimal. In most assemblers you have to indicate that explicitly (in GCC, you use $0x10 instead of $10). That might not be your only problem though. What's your compilation target? You can't use interrupts directly from either Wind...
by Goplat
Thu 13 Sep, 2007 1:46 pm
Forum: Programming Help
Topic: [TI-BASIC] Help with Optimization
Replies: 22
Views: 11784

The If 0 is only slow if you trigger the bug where the temporary equvar doesn't get deleted. Even then, it is not a reason to go to If:Then, because you can easily work around the bug, and it will be faster. This took 7.7s on my calculator :For(I,1,1000) :If 0 : :End This took 8.0s :For(I,1,1000 :If...
by Goplat
Wed 12 Sep, 2007 1:29 am
Forum: Programming Help
Topic: [TI-BASIC] Help with Optimization
Replies: 22
Views: 11784

Actually, plain If is normally faster even for false conditions. The exception is when it's the only thing in a For loop, like this: :For(I,1,100 :If 0 : :End This causes a slowdown because temporaries don't get deleted. You can work around the bug by adding something to the loop, or by adding a clo...
by Goplat
Mon 10 Sep, 2007 1:52 pm
Forum: Programming Help
Topic: [TI-BASIC] Help with Optimization
Replies: 22
Views: 11784

BUT... have you checked 0*0 instead of (0)(0? Maybe there is a significant difference? Plus and doesn't need braces wich should make it faster & smaller than multiplying. Of course 0*0 would be faster than (0)(0, but that's irrelevant. To multiply conditionals you would need the parenthesis bec...
by Goplat
Wed 05 Sep, 2007 2:14 am
Forum: Programming Help
Topic: [TI-BASIC] Help with Optimization
Replies: 22
Views: 11784

I did an experiment in PindurTI to prove that "and" is faster. These numbers are from OS 1.12. Input T states elapsed between ends of lines (breakpoint set at $18:67B1) :(0)(0 15078 :(0 and 0 13700 :(0)(1 15126 :(0 and 1 13748 :(1)(0 15380 :(1 and 0 14002 :(1)(1 16721 :(1 and 1 13897 There...
by Goplat
Tue 21 Aug, 2007 8:34 pm
Forum: Programming Help
Topic: [TI-OS] A bug?
Replies: 8
Views: 9380

9D95: di
9D96: ld bc,$E9C5 ; push bc \ jp (hl)
9D99: ld hl,$9D97
9D9C: jp (hl)
This will overwrite itself, but the 2-byte loop stays the same and keeps going.
by Goplat
Sun 12 Aug, 2007 4:42 pm
Forum: Programming Help
Topic: [TI-BASIC] Let's see your optimizing skills...
Replies: 7
Views: 6179

Code: Select all

seq(A,A,1,A->L5
rand(A->L6
SortA(L6,L5
by Goplat
Thu 02 Aug, 2007 9:40 pm
Forum: General TI Discussion
Topic: Reading from the LCD - emulators get it wrong
Replies: 5
Views: 7730

Reading from the LCD - emulators get it wrong

It's well known that when reading LCD data from port $11, you have to do an extra "dummy read" first before you can start getting the actual data you want. Emulators just return 0 for this dummy read (or 17 on wabbitemu). But on my calc I've found I can get it to return any value I want. I...
by Goplat
Wed 18 Jul, 2007 9:22 pm
Forum: Programming Help
Topic: [TI-APP, BCALLS] chkfindsym and others return improper data
Replies: 16
Views: 12955

Re: [TI-APP, BCALLS] chkfindsym and others return improper d

Currently, to allocate space for my smc routines I create an appvar with the same size as the smc routines, and I copy the previous contents of $9D95 to there and overwrite it with the routines. Bad idea - the OS could easily place your AppVar itself in a place where it overlaps with where you want...
by Goplat
Mon 16 Jul, 2007 3:39 pm
Forum: Programming Help
Topic: [MSIL] calls
Replies: 5
Views: 5958

The high byte specifies which metadata table the token refers to, and the low 3 bytes give the index of the table row.
by Goplat
Mon 16 Jul, 2007 3:20 pm
Forum: Programming Help
Topic: [TI ASM] Useful routines.
Replies: 50
Views: 58449

strcpy is supposed to copy the terminating null too. And strncpy doesn't just copy the given number of bytes from src to dest, that's memcpy. If strncpy encounters the end of the source string, it fills the rest of the destination with zeros. These should act more like their C counterparts: _strcpy:...