+ Reply to Thread
Page 10 of 13 FirstFirst ... 89101112 ... LastLast
Results 91 to 100 of 126

Thread: The "Foxy" CPU.

  1. #91
    Wire Noob Anven11's Avatar
    Join Date
    Aug 2009
    Posts
    1

    Default Re: The "Foxy" CPU.

    awesome tutorial!
    but is there any way i can use sin, cos and tan?
    that would be really helpful

  2. #92
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: The "Foxy" CPU.

    The functions for sin, cos and tan, are:

    Code:
    FSIN X,Y   | X = SIN Y
    FCOS X,Y   | X = COS Y
    FTAN X,Y   | X = TAN Y

    Take a look here:
    http://www.wiremod.com/forum/cpu-tut...mentation.html
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  3. #93
    Wire Amateur T_larson911's Avatar
    Join Date
    Oct 2009
    Location
    Wisconsin
    Posts
    52

    Default Re: The "Foxy" CPU.

    hey Fox, i got a problem with the CPU, how come everytime i try to make a program, it dont work. I used the debugger tool and noticed that it showed error for output and error = 5.1-something. its makin me mad cuz i wanna learn how to use CPU.
    can you please help?
    (.:T_larson911:.)

  4. #94
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default Re: The "Foxy" CPU.

    Quote Originally Posted by T_larson911 View Post
    hey Fox, i got a problem with the CPU, how come everytime i try to make a program, it dont work. I used the debugger tool and noticed that it showed error for output and error = 5.1-something. its makin me mad cuz i wanna learn how to use CPU.
    can you please help?
    Could you please show the code, some parts may be outdated.
    Error 5.12 is a internal error or know as a syntax error.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  5. #95
    Wire Amateur Spooky's Avatar
    Join Date
    Oct 2009
    Location
    Sweden
    Posts
    34

    Default Re: The "Foxy" CPU.

    I don't understand how to wire a console screen too the cpu chip because the cpu has like one output which is error. Is there a another chip that i must use to get access to the cpu outputs?

  6. #96
    Wire Sofaking ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    594

    Default Re: The "Foxy" CPU.

    Quote Originally Posted by Spooky View Post
    I don't understand how to wire a console screen too the cpu chip because the cpu has like one output which is error. Is there a another chip that i must use to get access to the cpu outputs?
    Well, if you are just using console screen, wire Membus from the CPU to the console screen, and it should work... Nothing else to wire.
    But if you want to use address bus for the console screen, set it up like so....
    Memory1:
    Offset: 0
    Size: 2048

    And you would wire membus to the address bus instead, and wire memory1 to the console screen.
    "I like pie"-Jat Goodwin

    <Azrael-> ryland: LOL is such a noobish thing to say.
    <ryland> LOL
    <Fox682> LOLLOL
    <Fox682> LOL
    <ryland> LOL

  7. #97
    Wire Noob Vinkel's Avatar
    Join Date
    Jun 2010
    Posts
    9

    Default Re: The "Foxy" CPU.

    Please help me... Why won't this work!
    For some reason the calculations gets stuck at "Start" even though eax is not equal to 0.
    Port0-out = Screen
    Port1-in = Keypad
    Port2-in = The defined arithemetic

    Code:
    Start:
    in eax,1
    out 0,eax
    cmp eax,0
      je Start
    jmp Math
    
    Math:
    in ebx,2
    cmp ebx,1
      je Add
    cmp ebx,2
      je Sub
    cmp ebx,3
      je Mul
    cmp ebx,4
      je Div
    jmp Math
    
    Add:
    in ebx,1
    cmp ebx,0
      je Add
    add eax,ebx
    jmp End
    
    Sub:
    in ebx,1
    cmp ebx,0
      je Sub
    sub eax,ebx
    jmp End
    
    Mul:
    in ebx,1
    cmp ebx,0
      je Mul
    mul eax,ebx
    jmp End
    
    Div:
    in ebx,1
    cmp ebx,0
      je Div
    div eax,ebx
    jmp End
    
    End:
    out 0,eax

  8. #98
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,657
    Blog Entries
    1

    Default Re: The "Foxy" CPU.

    Quote Originally Posted by Vinkel View Post
    Please help me... Why won't this work!
    For some reason the calculations gets stuck at "Start" even though eax is not equal to 0.
    Port0-out = Screen
    Port1-in = Keypad
    Port2-in = The defined arithemetic

    Code:
    Start:
    in eax,1
    out 0,eax
    cmp eax,0
      je Start
    jmp Math
    
    Math:
    in ebx,2
    cmp ebx,1
      je Add
    cmp ebx,2
      je Sub
    cmp ebx,3
      je Mul
    cmp ebx,4
      je Div
    jmp Math
    
    Add:
    in ebx,1
    cmp ebx,0
      je Add
    add eax,ebx
    jmp End
    
    Sub:
    in ebx,1
    cmp ebx,0
      je Sub
    sub eax,ebx
    jmp End
    
    Mul:
    in ebx,1
    cmp ebx,0
      je Mul
    mul eax,ebx
    jmp End
    
    Div:
    in ebx,1
    cmp ebx,0
      je Div
    div eax,ebx
    jmp End
    
    End:
    out 0,eax

    Try jumping to the Start label first.

    Code:
    cmp eax,0
     je Start
    
    Start:
    in eax,1
    out 0,eax
    jmp Math

  9. #99
    Wirererer Evac's Avatar
    Join Date
    Apr 2010
    Posts
    147

    Default Re: The "Foxy" CPU.

    Quote Originally Posted by Vinkel View Post
    Please help me... Why won't this work!
    For some reason the calculations gets stuck at "Start" even though eax is not equal to 0.
    Port0-out = Screen
    Port1-in = Keypad
    Port2-in = The defined arithemetic

    Code:
    Start:
    in eax,1
    out 0,eax
    cmp eax,0
      je Start
    jmp Math
    
    Math:
    in ebx,2
    cmp ebx,1
      je Add
    cmp ebx,2
      je Sub
    cmp ebx,3
      je Mul
    cmp ebx,4
      je Div
    jmp Math
    
    Add:
    in ebx,1
    cmp ebx,0
      je Add
    add eax,ebx
    jmp End
    
    Sub:
    in ebx,1
    cmp ebx,0
      je Sub
    sub eax,ebx
    jmp End
    
    Mul:
    in ebx,1
    cmp ebx,0
      je Mul
    mul eax,ebx
    jmp End
    
    Div:
    in ebx,1
    cmp ebx,0
      je Div
    div eax,ebx
    jmp End
    
    End:
    out 0,eax
    If what you mean by "stuck" is that the calculations stop working after the first cycle, it is because you've not made an infinite loop.
    I also recommend that you cease using the
    Code:
    in x,y
    ----------------------
    out x,y
    And start using this instead:
    Code:
    mov portx,y
    ----------------------
    mov x,porty
    But that's maybe just me?

    Oh, and by the way (Untested):
    Code:
    _main:
    	mov eax,port1
    	cmp eax,1
    	jne _main
    		je calc
    	jmp _main
    	
    calc:
    	mov eax,port2
    	cmp eax,1
    	je add
    	cmp eax,2
    	je sub
    	jmp _main
    	
    add:
    	mov eax,port3
    	add eax,port4
    	mov port0,eax
    	jmp _main
    	
    sub:
    	mov eax,port3
    	sub eax,port4
    	mov port0,eax
    	jmp _main
    Untested, and I doubt that's even what you're looking for.
    Port 1 - Go
    Port 2 - Arithmetic Operation (Add/Sub, add more on your own)
    Port 3 - Par1
    Port 4 - Par2

  10. #100
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,657
    Blog Entries
    1

    Default Re: The "Foxy" CPU.

    Quote Originally Posted by Evac View Post
    If what you mean by "stuck" is that the calculations stop working after the first cycle, it is because you've not made an infinite loop.
    He doesn't need to have an infinite loop, it only needs to calculate it once.
    The keypad he has that goes into port 1 should trigger it instead.

+ Reply to Thread
Page 10 of 13 FirstFirst ... 89101112 ... LastLast

Similar Threads

  1. The "Foxy" CPU - Part 2
    By -=Fox=- in forum CPU Tutorials
    Replies: 40
    Last Post: 06-27-2010, 04:00 PM
  2. Want to understand "interval" and "timer" in Expression 2
    By anthraxyhe in forum Installation and Malfunctions Support
    Replies: 25
    Last Post: 12-08-2009, 09:36 AM
  3. Replies: 0
    Last Post: 02-14-2009, 06:13 AM
  4. Xtensity's "Spaceman Turret V6" Tutorial, "Head Shots FTW"
    By Xtensity in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 24
    Last Post: 09-20-2008, 08:46 AM
  5. Need the pack that has the "Generator" and "Razor" models...
    By Mr. Brightside in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 06-06-2007, 11:16 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