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

Thread: Complex stuff made easy

  1. #1
    That furred thing
    Black Phoenix will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    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 10:09 AM.

  2. #2
    Inactive Gat3rZ is on a distinguished road 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
    Inactive draeath is on a distinguished road draeath's Avatar
    Join Date
    Jan 2008
    Posts
    23

    Default

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

  4. #4
    Wire Noob TacticalPants is on a distinguished road 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 will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    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 will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    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 will become famous soon enough Hitman271's Avatar
    Join Date
    Feb 2008
    Location
    Why? You looking for somebody?
    Posts
    537

    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.
    Give me rep if I helped you

    CAPS LOCK IS CRUISE CONTROL FOR AWESOME

    How The Clocks at Valve Work

    Gpu Problem? Refer to This!

    CLICK HERE TO MAKE A HELP THREAD

    GENERATION 7: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
    Social experiment.

  8. #8
    Wire Noob Jcd1230 is on a distinguished road Jcd1230's Avatar
    Join Date
    Aug 2008
    Location
    In a house.
    Posts
    17

    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 will become famous soon enough Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    482

    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 will become famous soon enough Black Phoenix will become famous soon enough Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    2,742

    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
1 2 LastLast

Similar Threads

  1. Replies: 80
    Last Post: 01-16-2010, 09:25 AM
  2. Simple things made complex
    By itsbth in forum Contraptions & Saves
    Replies: 3
    Last Post: 01-21-2009, 12:21 AM
  3. Replies: 13
    Last Post: 11-29-2008, 04: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, 09:10 PM
  5. The most complex way to make a sphere...
    By Dimencia in forum CPU Tutorials & Programs
    Replies: 7
    Last Post: 04-07-2007, 07: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