Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: willrandship on May 09, 2010, 10:14:01 pm

Title: For NSpire: C or ASM?
Post by: willrandship on May 09, 2010, 10:14:01 pm
I figured before I start learning either full-swing, I'd find out which one I should learn.

Advantages of C:
Lots of documentation
Lots of IDEs
Well-known
I like the syntax more/know it better

Advantages of ASM:
More Cross-Calc capability
More Calc people know it

Are there any other differences I'm missing?
Title: Re: For NSpire: C or ASM?
Post by: _player1537 on May 09, 2010, 10:16:54 pm
hmm...

iirc asm is very non-cross calc compatible, made only for that specific processor.
However, C can be retranslated for other processors and isn't really cross-calc compatible, but computers use it too.
asm has a steep (imo) learning curve, C: no idea never used it fully.

I would go with C personally
Title: Re: For NSpire: C or ASM?
Post by: Hot_Dog on May 09, 2010, 10:48:45 pm
I'd say C, unless you're making a game that requires as much power from the calculator as you can possibly muster
Title: Re: For NSpire: C or ASM?
Post by: bwang on May 09, 2010, 11:18:08 pm
Go with C. Nspire C is not that tricky, and is very nearly standard C (just missing some standard library functions).
Title: Re: For NSpire: C or ASM?
Post by: DJ Omnimaga on May 09, 2010, 11:43:01 pm
I would say C for most stuff, and for extreme 3D stuff or other stuff à la Calc84maniac, ASM (unless C is so optimized that it runs as fast as ASM).

Also from one calc to another, ASM code is slightly different. On a regular 83, you use ROM Calls instead of BCalls, for example, and memory addresses are different. The TI-86 also got a memory mapped LCD, meaning accessing the LCD is different than on lower number models. I believe on 68K calcs, older 89s got a mem mapped screen, but not newer ones.

Sometimes it's not just the processor that makes a difference, but the rest of the hardware, too.
Title: Re: For NSpire: C or ASM?
Post by: Galandros on May 10, 2010, 09:34:11 am
Advantages of ASM:
More Cross-Calc capability
More Calc people know it
Assembly depends on the type of processor. So it is not very cross-calc.
I don't think that many people know ARM assembly as C. C is a general language for computers and even hand held devices.
The advantages are full control on the hardware and ultimate speed. C and ASM size difference in the Nspire is neglected.

For Nspire, like DJ said, it is going to be C for general stuff and ASM for the stuff we think is impossible, before calcmaniac84 does something.
Title: Re: For NSpire: C or ASM?
Post by: willrandship on May 10, 2010, 11:54:17 am
Thanks for all the Input!

That is one factor I didn't consider: Nspire ASM is ARM, not Z80.
Has anyone done benchmarks for C vs ASM on the Nspire? I'm just curious about the difference. Both will blow the nspire's basic out of the water though :P
Title: Re: For NSpire: C or ASM?
Post by: Lionel Debroux on May 10, 2010, 11:59:52 am
Yeah, go with C, except perhaps for time-critical bits (which are a minority in a program) :)
Title: Re: For NSpire: C or ASM?
Post by: calc84maniac on May 10, 2010, 12:45:03 pm
ARM has a much more C-friendly instruction set than z80. It translates very well. Not much difference except with speed-critical things (like the emulators I've been writing, which need to emulate several million instructions per second)
Title: Re: For NSpire: C or ASM?
Post by: DJ Omnimaga on May 10, 2010, 01:00:40 pm
(like the emulators I've been writing, which need to emulate several million instructions per second)
WHAT??? OVER 9000??? THAT'S IMPOSSIBLE

but seriously good to hear C is translated well. I kinda wish for z80 calcs it was the same case, because many people wish there was a good C compiler for z80 calcs, something that produces code that is as fast and as small (if not smaller) as Axe Parser, for example.
Title: Re: For NSpire: C or ASM?
Post by: willrandship on May 10, 2010, 09:10:48 pm
Yeah, I wasn't planning on anything too time sensitive for starting out. I have a thought going through my head, though, about writing #include files. I would call it Sweat: the other 99%. It would probably impliment everything in a few big chunks, and I was thinking if it got popular enough I could ask bwang about putting in his raycaster. (Imagine: C programming with practically native 3D support! It'd almost be like having a 3D hardware GPU!)

For those who don't recognize the reference: Edison said, "Success is 1% Inspiration (Nspire) and 99% Perspiration! (Sweat)"
 ;D
Title: Re: For NSpire: C or ASM?
Post by: bwang on May 10, 2010, 11:45:49 pm
Some comprehensive header files would be nice. What kinds of functions would you have?
Title: Re: For NSpire: C or ASM?
Post by: willrandship on May 11, 2010, 06:51:26 pm
I was thinking stuff like getKey, sprite functions, maybe your raycaster eventually. Anything that People suggest would make programming easier, really. USB drivers, really long and overused blocks of code, various hardware implementations. suggest it and it would probably get thrown in there.

One thing that I would definitely want, though. It can't break compatibility with old programs every time it updates, unless it's a big fix. Like, a DispSprite command couldn't swap the X and Y. That would drive me (and many others) nuts! just think, you've been working on a program for two years, and the headers get updated. You think "ah, why not update?" Then, your program doesn't build, or is extremely buggy. For extreme variations it would probably be better to give it a new header.
Title: Re: For NSpire: C or ASM?
Post by: Stephan on May 12, 2010, 11:03:20 am
ASM can be trouble on proccessors that cannot handle it, C might be better plus any Computer OS can run it too with any neccessary software. So yeah, I would go with C, but that is my opinion.
Title: Re: For NSpire: C or ASM?
Post by: willrandship on May 12, 2010, 11:21:46 am
Yep, C it is! I like C's format (Functions, etc.) better anyways. I write my basic programs in function-style anyway