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

Thread: Complex stuff made easy

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

    Default

    Mini-tutorial: adding CPU ports - 8 ports
    Doing this is pretty simple. First, you spawn the Data Port STOOL from Wire - Advanced category:


    You might notice it has 8 ports... but how do we connect it?



    Look up IOBus input. This one links our CPU to our ports.


    Thing to know: CPU can address up to 1024 different I/O ports (1337 CPU h4xx0rs will find a way to use even more than 1024 though). But right now we have only 8, let's connect em. Click on IOBus input, go to dataport, and click on it. A selection of ports pops up - which one to choose? Answer: any of them. This does not matter, you can select any port you like. For now, select output Port0.

    Good job, you've set the ports up! They are ready for use now.

    Mini-tutorial: adding more than 8 ports - for example 32 ports
    As you might already know, there is special wire gate/chip called Address Bus. Address Bus is used to join several address spaces together. Address space means memory (usually virtual memory, RAM inside some SENT) where each value can be found by using some address, for example there is address space of ports (where each port is a value, and they can be addressed using port index, address), or CPU address space (where each byte of CPU memory can be addressed using some address). Think of address space as "interface", where each your request to each memory cell in it will be re-routed elsewhere, where you want it to be routed.

    Address bus joins several address spaces together into one address space. What is the practical use? Because of the fact that each data port has own address space (which is 8 bytes in size by the way, exactly matches number of ports) we can join several data ports together, and our address bus will act as one big data port with 4 data ports (well, maximum of 4 per address bus, but you can connect address busses in the same way as you do with data ports, making up to 1024 ports available).

    Now, lets see example with 32 ports.
    First, configure your address bus like this:

    What this means? For those who don't understand, these are configurations for our 4 address spaces. Offset means offset of this address space in our big address space. Size means uh.. new size. You can set it smaller, or bigger (in second case "missing" variables will return 0). These can overlap with special rules (when byte is read, its read from the address space with least number, if written it writes to all address spaces).

    Now, spawn 4 data ports. Connect 4 memory inputs of address bus to data ports (they are called Memory1, Memory2, and so on). Remember what memory input each data port is linked to.

    Now, connect address bus to IOBus of CPU.

    Hurray, now you can access 32 ports. When you access first 8 ports they are redirected to data port connected to memory1, when you access next 8 ports (ports #8 to #15) they redirect to memory2, and so on.

    Code snippet: using CPU ports
    CPU ports is the way to interact with "outside" world. Each port can be used just like any other wire input/output. Thing to know: input ports ARE NOT output ports. These are completly different objects, and, in fact, you have 16 different ports in a single data port object.

    Using ports is simple. In ZASM you can either use ports just as you were using registers, or access them via special command.
    Example:
    Code:
    mov port0,1234; //Output 1234 to port0
    mov eax,port1; //Input a value into register EAX from port1. NOTICE: if make port0, it WILL NOT read the previous value. It will read value that is connected to output of data port
    OR same code, but with asm operations:
    Code:
    out 0,1234;
    in eax,1;
    Which way to favor? First one is more human readable, while last one allows changing output port via register, and some more stuff.
    Last edited by Black Phoenix; 07-01-2008 at 11:09 AM.

  2. #2
    Wire Noob Gat3rZ's Avatar
    Join Date
    Apr 2007
    Posts
    12

    Default

    Thanks Black Phoenix, now i can realy understand how the adress bus work (beacause im french and i have not realy understand the first doc).

  3. #3
    Wire Noob draeath's Avatar
    Join Date
    Jan 2008
    Posts
    24

    Default

    Images are showing as errors... I can't see what you are doing

  4. #4
    Wire Noob TacticalPants's Avatar
    Join Date
    Feb 2008
    Posts
    10

    Default Re: Complex stuff made easy

    LoL the reference links have been changed I guess by the new forum, they link to random threads

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

    Default Re: Complex stuff made easy

    This thread will be soon updated, any particular reference requests you want? Explanation on anything...
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

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

    Default Re: Complex stuff made easy

    Updated pictures
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  7. #7
    Wire Sofaking Hitman271's Avatar
    Join Date
    Feb 2008
    Location
    Why? You looking for somebody?
    Posts
    731

    Default Re: Complex stuff made easy

    I couldn't help but notice that display/chip gpu in the first picture. lol
    Quote Originally Posted by Anticept View Post
    This is not some place where you can toss your dick around and expect people to suck it.
    Community Gpu Thread. Post Yours!

    Bouncy Ball

  8. #8
    Wire Noob Jcd1230's Avatar
    Join Date
    Aug 2008
    Location
    In a house.
    Posts
    19

    Default Re: Complex stuff made easy

    Wow this helped alot! Im trying to learn ZASM so i can use Cpus and Gpus but i was wondering if i would ever need more than 8 i/o values.. now i wont have to worry! XD
    Except about LEARNING zasm.....

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

    Default Re: Complex stuff made easy

    This answers some of my questions, however, i was wondering, do you outport to the 32nd port by doing

    mov port32, 1234;

    or do you do it by adding 32 to the cpu's memory and editing that value?

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

    Default Re: Complex stuff made easy

    You can use <b>port0</b> ... <b>port1023</b>
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. The Free Fall Extension (Wire Socket Radio and other Stuff i made)
    By Free Fall in forum Wiremod Addons & Coding
    Replies: 83
    Last Post: 02-06-2011, 11:31 PM
  2. Simple things made complex
    By itsbth in forum Finished contraptions
    Replies: 3
    Last Post: 01-21-2009, 01:21 AM
  3. Replies: 13
    Last Post: 11-29-2008, 05:38 PM
  4. Help! I need someone to help me with a complex math problem
    By Meatloaftwo in forum Wiremod General Chat
    Replies: 2
    Last Post: 12-01-2007, 10:10 PM
  5. The most complex way to make a sphere...
    By Dimencia in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 04-07-2007, 08:30 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