+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Still okay to code in raw ZCPU code?

  1. #1
    Wire Amateur BrokenGlass's Avatar
    Join Date
    Jun 2008
    Posts
    33

    Default Still okay to code in raw ZCPU code?

    I've seen alot of these C-Compilers that compile the code to ASM and stuff and i was wondering if it was okay to NOT use them and still could get the same results?

  2. #2
    Wire Amateur starvinmarvin's Avatar
    Join Date
    Mar 2007
    Location
    NRW, Germany
    Posts
    82

    Default Re: Still okay to code in raw ZCPU code?

    Quote Originally Posted by BrokenGlass View Post
    I've seen alot of these C-Compilers that compile the code to ASM and stuff and i was wondering if it was okay to NOT use them and still could get the same results?
    Ofcourse! You often get a lot better results with hand-written asm code - as long you know what you're doing. But try to write a little game > Pong for zcpu; I bet you want to use a high level language then, except you're not as lazy as me.
    Last edited by starvinmarvin; 12-04-2008 at 10:07 AM.

  3. #3
    GMech Developer InfectiousFight's Avatar
    Join Date
    Jun 2007
    Location
    Houston, TX
    Posts
    537

    Default Re: Still okay to code in raw ZCPU code?

    Of course. I'm actually working on an entire Operating System using Assembly. I'm gonna start posting some shows of it once I get more work done. It's especially useful since I don't actually KNOW any C. As well, hand-written Assembly typically runs faster than compiled Assembly because humans are more instruction-efficient with their code than machines are.
    Last edited by InfectiousFight; 12-04-2008 at 12:04 PM.

  4. #4
    Wirererer Xandaros's Avatar
    Join Date
    Apr 2007
    Location
    Bremerhaven, Germany
    Posts
    364

    Default Re: Still okay to code in raw ZCPU code?

    That might be true for the zCPU.
    But the Compiles for a real CPU are this good, you have to be very good to surpass them, but it's still possible.

    But as we are talking about the zCPU:
    The hand-written asm code might be really the best choose. I didn't even touch a compiler, I did everything myself and I'm going to continue that.

    Of course, ASM is a little more difficult...

    But if you are serious: ASM is the easiest language you can find. There are just a few commands to remember. But the language is this easy, it turns hard...

    Xan
    I love very poor avatars

    Quote Originally Posted by Dav1d View Post
    It's too big to copy all in one.

  5. #5
    Wire Amateur BrokenGlass's Avatar
    Join Date
    Jun 2008
    Posts
    33

    Default Re: Still okay to code in raw ZCPU code?

    Kind of offtopic but, my CPU programs never tend to work unless i have IOBUS wired to a data port or somthing, but if i have multiple outputs on different ports only 1 will work. AM i doing something wrong?

  6. #6
    Wire Noob Wirarmawd's Avatar
    Join Date
    Aug 2008
    Posts
    8

    Default Re: Still okay to code in raw ZCPU code?

    Quote Originally Posted by BrokenGlass View Post
    Kind of offtopic but, my CPU programs never tend to work unless i have IOBUS wired to a data port or somthing, but if i have multiple outputs on different ports only 1 will work. AM i doing something wrong?
    Did you wire IObus to Port 0 on the data port ?
    Black phoenix is a sexeh beast, Duh...

  7. #7
    Wire Sofaking Azrael's Avatar
    Join Date
    Aug 2007
    Posts
    1,946

    Default Re: Still okay to code in raw ZCPU code?

    Quote Originally Posted by Xandaros View Post
    That might be true for the zCPU.
    But the Compiles for a real CPU are this good, you have to be very good to surpass them, but it's still possible.
    No you don't. It's harder not to be better than them. This is, in part, due to the fact that the C-style calling convention (ie. arguments on stack) is a lot less efficient than asm-style (ie. arguments in registers).

  8. #8
    Wire Noob Xenocidalfate's Avatar
    Join Date
    Apr 2008
    Posts
    8

    Default Re: Still okay to code in raw ZCPU code?

    Quote Originally Posted by AzraelUK View Post
    No you don't. It's harder not to be better than them. This is, in part, due to the fact that the C-style calling convention (ie. arguments on stack) is a lot less efficient than asm-style (ie. arguments in registers).
    Are you sure?

    Most programmers I know (on gamedev.net and the like) have said that computer-compiled ASM has gotten to the point where there's really no need to write in ASM any more, even when optimizing your program for speed.

    'course they might only be referring to inline ASM calls within a higher-level language, such as C, 'cause you'd think pure ASM would be faster, neh?

  9. #9
    Wire Sofaking Fizyk's Avatar
    Join Date
    Jun 2008
    Location
    Łomianki, Poland
    Posts
    740
    Blog Entries
    1

    Default Re: Still okay to code in raw ZCPU code?

    There is no need to write in ASM any more, but for different reasons. Of course it would be possible to write everything in ASM, but with present complexity of the applications it would be just suicide. Assembler is the best if you want direct access to hardware, memory etc., but if you aren't writing an OS, you won't need that now. It was sometimes necessary for example in DOS, it was constructed like this, but current OSs don't like when programmers try to bypass their functions. Sometimes it is even impossible due to the application being in a virtual address space.
    I might have mixed something up, but generally it's all about different architecture of current and past OSs and programming currently being much, much easier in higher-level languages.

    My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
    My tutorials: applyTorque - Quaternions - PID controllers
    Some other things I made: FT Chip - RK4 Solar System

  10. #10
    Wire Sofaking Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    636

    Default Re: Still okay to code in raw ZCPU code?

    knowing asm is still incredibly useful for debugging, cracking and game hacking.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Need help with this code...
    By Eirath245 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 13
    Last Post: 11-03-2008, 11:40 AM
  2. How to Lua Code?
    By Ssnipersteve in forum Wiremod Addons & Coding
    Replies: 1
    Last Post: 03-19-2008, 02:00 AM
  3. Help with this code
    By penguini in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 1
    Last Post: 06-14-2007, 02:56 PM
  4. Help with code
    By Wesnc in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 5
    Last Post: 06-11-2007, 06:42 PM
  5. my first cpu code needs sum help
    By undead82004 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 6
    Last Post: 06-07-2007, 06:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots