Thread: Z80 Compiler (for Ti)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654

    Z80 Compiler (for Ti)

    I know there was some thread about it way back, but I don't know how much information could be salved from it.
    Just looking to see if there's a nice C/C++ compiler for Z80. There should be, right?
    So does anyone know anything? It's unfuriating to type BASIC on the calc itself, not to mention that it actually crawls.

    Any tips would be appreciated.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm pretty sure IAR has a Z80 compiler. However, C++ for 8/16-bit processors tend to be beyond what you can expect to find - consider that you only have a maximum of 64KB of addressable memory at any given time, so code and data can't realistically be that big.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I almost expected C++ wouldn't work, but will do fine in this case, then. I'll check it out and see if I can find a compiler. Thanks.
    (Although, I can't seem to find any download for the Z80 IDE/compiler on the site...)
    Last edited by Elysia; 03-18-2008 at 10:57 AM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  6. #6
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by Elysia View Post
    Then if someone can suggest anything better except for Dev-C++/GCC or whatever it was, then I'll happily listen.
    Did you look into tigcc?
    Quote Originally Posted by Dave_Sinkula View Post
    Quote Originally Posted by Elysia View Post
    I can't even figure out what the resulting linked file is and what the Ti actually accepts.
    It looked like you were trying to build an Intel hex file that you were calling it an .exe.
    sdcc.exe --out-fmt-ihx -mz80 --profile --verbose --debug --out-fmt-ihx -mz80 --profile --verbose --stack-auto --debug -ID:\Program\SDCC\include -c main.c -o obj\Debug\main.rel
    sdcc: Calling preprocessor...
    sdcc: Generating code...
    sdcc: Calling assembler...
    sdcc.exe -LD:\Program\SDCC\lib -o bin\Debug\Test.exe --out-fmt-ihx -mz80 --profile --verbose --debug --out-fmt-ihx -mz80 --profile --verbose --stack-auto --debug obj\Debug\main.rel
    obj\Debug\main.o: cannot open.
    sdcc: Calling linker...
    sdcc: Calling linker...
    Process terminated with status 1 (0 minutes, 0 seconds)
    0 errors, 0 warnings
    I though this was saying to compile the .c into a .rel, and then link the .rel into an ".exe", and having no errors or warnings.

    I would normally expect some .a type of file output from the linker which is then later translated into a .hex file for use with programming into the calculator. But then I'm not familiar with your system.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Dave_Sinkula View Post
    Did you look into tigcc?
    Nope, but I will. It looks interesting. Thanks.

    It looked like you were trying to build an Intel hex file that you were calling it an .exe.
    I though this was saying to compile the .c into a .rel, and then link the .rel into an ".exe", and having no errors or warnings.

    I would normally expect some .a type of file output from the linker which is then later translated into a .hex file for use with programming into the calculator. But then I'm not familiar with your system.
    Well, as I mentioned, since there's no documentation on the thing, I'm stabbing in the dark. Checking or unchecking the thing has no effect. The problem is that Code::Blocks doesn't supply the full path to the compiler.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by matsp View Post
    I found that, too, but there doesn't seem to be any download link.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    I found that, too, but there doesn't seem to be any download link.
    I'd contact them and ask if you can have a demo license for that.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yep, seems to be the only way.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Registered User
    Join Date
    Feb 2008
    Posts
    26
    Quote Originally Posted by Elysia View Post
    I know there was some thread about it way back, but I don't know how much information could be salved from it.
    Just looking to see if there's a nice C/C++ compiler for Z80. There should be, right?
    So does anyone know anything? It's unfuriating to type BASIC on the calc itself, not to mention that it actually crawls.

    Any tips would be appreciated.
    There's an open source compiler for the Zilog Z80. It's called Small Device C Compiler. I haven't done anything with it, but it seemed like a good compiler.

    It's retargetable
    provides full set of data types
    allows for inline assembly

    don't no what your into, but IAR compilers are usually expensive! Or the evals are limited

    Small Device C Compiler Link:
    http://sdcc.sourceforge.net/

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Awesome! Debugger, as well. Good tip! Excellent! Thanks!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #13
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    I was the author of the old thread on this subject, never really did get it working. Although i was using the same compiler as jake123 suggested. Elysia, please let me know if you get it working
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I don't know how to set up Code::Blocks to compile properly with it. It seems to complain in the linker.

    Compiling: main.c
    sdcc: Calling preprocessor...
    sdcc: Generating code...
    sdcc: Calling assembler...
    Linking console executable: bin\Debug\Test.exe
    obj\Debug\main.o: cannot open.
    sdcc: Calling linker...
    sdcc: Calling linker...
    Process terminated with status 1 (0 minutes, 0 seconds)
    0 errors, 0 warnings
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Perhaps building on the command line will show you what's going on [yes, that's very old-fashioned, but sometimes the old-and-tried methods work better].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  3. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  4. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  5. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM