Jump to content
IGNORED

C or assembly


vanman

Recommended Posts

There is a C compiler and libraries for the Lynx here:

 

http://www.geocities.com/SiliconValley/Byte/4242/lynx/

 

This might be a good way to get started with Lynx programming. The one problem with using C to develop for the 6502 is that no matter how good the compiler is it's hard to compile C into very tight efficient machine code.

 

Dan

Link to comment
Share on other sites

  • 2 months later...

everybody asks this. and its simple to awnser:

 

if you want full speed and the maximum out of the lynx. take assembler

 

if you want to program easier go for C.

 

please note that assembler is a pain in the ass. only do it if you really want to do it :)

 

 

best regards,

 

Vyeyendra Ramnares

Link to comment
Share on other sites

  • 4 weeks later...

please note that assembler is a pain in the ass. only do it if you really want to do it :)  

 

Hmm, i think it depends on your personal experience/attitude. A crack-asm programmer might have problems with C as much as a crack C programmer might have problems with asm. The 6502 is really easy to learn, while C has a more complex structure. On the other hand, you really do not want to code a modern OS with asm, because asm is about dividing complex routines into very small steps, which is also a cause why asm programs are harder to debug.

Link to comment
Share on other sites

I haven't done any Lynx programming, but I've done lots of C and ASM (6502 and others).

 

A big benefit of ASM programming is it gives the programmer almost absolute control. There is no translation layer (compiler) making decisions on your behalf.

 

C is also built around function calls and typically uses stack-based local variables. Both are not that efficient for the 6502 (JSR/RTS=12 cycles). And unless the Lynx C compiler has been optimized for the Lynx/6502 there may be other inefficiencies (starting with the size of int).

Link to comment
Share on other sites

You can always start in C and then hand-optimize in assembler, or just do the critical sections in assembler.

 

Part of the problem with the C code isn't the speed, but it's the size. If you're really pushing the Lynx you will need to optimize for speed, but even if you're not pushing, you'll start running out of room in the address space really, really quick in C.

 

C would be perfect to do something like "Same", or maybe a simple RPG where you could keep individual screens in the ROM space. But in my (currently stalled for lack of time) Breakout project, I'm hitting the space barrier, and my game isn't at all complicated.

 

Eric

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...