Author Topic: For NSpire: C or ASM?  (Read 7524 times)

0 Members and 1 Guest are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
For NSpire: C or ASM?
« 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?

_player1537

  • Guest
Re: For NSpire: C or ASM?
« Reply #1 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

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: For NSpire: C or ASM?
« Reply #2 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

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: For NSpire: C or ASM?
« Reply #3 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).

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: For NSpire: C or ASM?
« Reply #4 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.
« Last Edit: May 09, 2010, 11:50:27 pm by DJ Omnimaga »

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: For NSpire: C or ASM?
« Reply #5 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.
Hobbing in calculator projects.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: For NSpire: C or ASM?
« Reply #6 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

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: For NSpire: C or ASM?
« Reply #7 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) :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: For NSpire: C or ASM?
« Reply #8 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)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: For NSpire: C or ASM?
« Reply #9 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.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: For NSpire: C or ASM?
« Reply #10 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
« Last Edit: May 10, 2010, 09:11:50 pm by willrandship »

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: For NSpire: C or ASM?
« Reply #11 on: May 10, 2010, 11:45:49 pm »
Some comprehensive header files would be nice. What kinds of functions would you have?

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: For NSpire: C or ASM?
« Reply #12 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.

Offline Stephan

  • LV2 Member (Next: 40)
  • **
  • Posts: 23
  • Rating: +4/-4
    • View Profile
Re: For NSpire: C or ASM?
« Reply #13 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.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: For NSpire: C or ASM?
« Reply #14 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