+ Reply to Thread
Page 15 of 15 FirstFirst ... 5131415
Results 141 to 145 of 145

Thread: !!!OLD!!! ZCPU Documentation

  1. #141
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default Re: Documentation

    Quote Originally Posted by sukasa View Post
    That's going to be a bitch to maintain when you're working on code and you're using any of the jump relative commands, but all right, if that's how that opcode is supposed to be handled by the compiler...
    You're not supposed to use them that often, they are more like service opcodes rather than ones you use everyday.
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  2. #142
    Wire Amateur sukasa's Avatar
    Join Date
    Nov 2007
    Posts
    54

    Default Re: Documentation

    Ah. Well, I look at them and see a great way to make location-independant code without having to mess with using CS or LS or any sort of 'you are here' register. If everything's relative, then it makes maintaining code just that much easier.

  3. #143
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default Re: Documentation

    Quote Originally Posted by sukasa View Post
    Ah. Well, I look at them and see a great way to make location-independant code without having to mess with using CS or LS or any sort of 'you are here' register. If everything's relative, then it makes maintaining code just that much easier.
    You should mess with CS/LS registers, they are "you are here" registers. That's why they exist.

    This code will properly run independantly on it's location:
    Code:
    myloop:
      inc CS:#nice_variable; //offset relative to current code execution base
    jmp myloop; //offset relative to current code execution base
    
    alloc nice_variable;
    To call this code from address 123456 in RAM you do this:
    Code:
    callf 0,123456;
    To return from that code you do:
    Code:
    retf
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  4. #144
    Lifetime Supporter Nikita's Avatar
    Join Date
    May 2009
    Posts
    769

    Default Re: ZCPU Documentation

    Correct me if I'm wrong, it appears that CPU has no support for integers? So if I wanted to divide 7 by 2 and get 3, I'd have to make hidden rounding? And if I wanted an 8-bit char, overflowing would have to be faked too? This is for my compiler, I want to have all kinds of variables there...

    I see there is a binary precision and processor precision variables, but what do they do?

  5. #145
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default Re: ZCPU Documentation

    Quote Originally Posted by Nikita View Post
    Correct me if I'm wrong, it appears that CPU has no support for integers? So if I wanted to divide 7 by 2 and get 3, I'd have to make hidden rounding? And if I wanted an 8-bit char, overflowing would have to be faked too? This is for my compiler, I want to have all kinds of variables there...

    I see there is a binary precision and processor precision variables, but what do they do?
    They are supposed to emulate integer-only arithmetics, but they don't do that yet. They should be doing that in next update though, but that's not yet here
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

+ Reply to Thread
Page 15 of 15 FirstFirst ... 5131415

LinkBacks (?)

  1. 02-26-2010, 01:41 AM
  2. 01-27-2010, 06:21 PM
  3. 01-27-2010, 03:18 PM

Similar Threads

  1. !!!OLD!!! Documentation of hi-speed devices
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 98
    Last Post: 02-10-2011, 07:41 PM
  2. !!!OLD!!! ZGPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 38
    Last Post: 11-29-2010, 04:54 PM
  3. Expression Gate Documentation
    By Syranide in forum Finished contraptions
    Replies: 398
    Last Post: 01-21-2010, 10:27 PM
  4. Moongate Documentation
    By BlackNecro in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 04-22-2009, 01:32 AM

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