+ Reply to Thread
Results 1 to 6 of 6

Thread: Making a exprssion math into cpu math

  1. #1
    Wire Amateur Ronin is on a distinguished road Ronin's Avatar
    Join Date
    May 2008
    Posts
    79

    Default Making a exprssion math into cpu math

    I am sorta new to the cpu and was whanted to know how to convert the math
    like
    $ ? |

  2. #2
    Inactive Xyundar is on a distinguished road Xyundar's Avatar
    Join Date
    Apr 2008
    Location
    The Netherlands
    Posts
    11

    Default Re: Making a exprssion math into cpu math

    For that you need to know how to calculate those values,
    for example $ is DeltaY/DeltaX (example code)
    So if you know what the '"?" and the "|" mean (I do not know it so on these functions I cannot help you) you can make those functions for yourself in Cpu.

  3. #3
    Wire Sofaking Fatal_Exception is on a distinguished road Fatal_Exception's Avatar
    Join Date
    Oct 2007
    Location
    New Zealand
    Posts
    414

    Default Re: Making a exprssion math into cpu math

    ? is "if", so you'd do some sort of comparison.

    Code:
    // SomeVar = (SomeOtherVar == 1 ? 4 : 5)
    // eax = SomeVar
    // ebx = SomeOtherVar
    cmp ebx,1;
    jne SetToFive;
    mov eax,4;
    jmp SomeWhereElse;
    SetToFive:
    mov eax,5;
    jmp SomeWhereElse;
    
    | is "or" so you'd combine comparisons.
    Code:
    // SomeVar == 1 | SomeOtherVar == 1 -> TheThirdVar = 1;
    // eax = SomeVar
    // ebx = SomeOtherVar
    // ecx = TheThirdVar
    cmp eax,1;
    je SetThirdVarToOne; // IF eax == 1
    cmp ebx,1;
    je SetThirdVarToOne; // OR ebx == 1
    jmp SomeWhereElse;   // otherwise
    SetThirdVarToOne:
    mov ecx,1;
    jmp SomeWhereElse;
    

  4. #4
    Lurker Magnight is on a distinguished road Magnight's Avatar
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    30

    Default Re: Making a exprssion math into cpu math

    what i don't get is all the registering.Like eax,ebx,and ecx-why cant it be like expression gates?

  5. #5
    Wirererer dnifan is on a distinguished road dnifan's Avatar
    Join Date
    Mar 2007
    Location
    Amersfoort, the Netherlands
    Posts
    334

    Default Re: Making a exprssion math into cpu math

    Just because it isn't.

    P.S. The CPU is for smart people, if you don't get the hint, you're not part of them


    ^ 51mbps Fiber ftw [03:32] <ITSBOT> lua serializing function to be
    intergrated into xbox live
    [03:34] <ITSBOT> no girlfriend for a pineapple under the Channels

  6. #6
    Lurker Narc is on a distinguished road Narc's Avatar
    Join Date
    Sep 2007
    Posts
    49

    Default Re: Making a exprssion math into cpu math

    Quote Originally Posted by dnifan View Post
    Just because it isn't.

    P.S. The CPU is for smart people, if you don't get the hint, you're not part of them
    Don't be nasty. The CPU is for anyone who wants to use it. Some people might need more time to learn it, because they don't have experience with assembly (or even programming), but that's all.

    Quote Originally Posted by Magnight View Post
    what i don't get is all the registering.Like eax,ebx,and ecx-why cant it be like expression gates?
    The Wire CPU is an assembly-language simulator, not a scripting language simulator. As such, what you see is the foundation of programming.

    It's very much how all computers were programmed a couple of decades ago, and it's probably how a bunch of embedded systems are still programmed today (though apparently the embedded world has moved to C, due to the increase in CPU speeds across the board).

    Assembly language is just a single step above bare machine code, and is (to some people (including myself)) fascinating. The Wire CPU is, in many ways, very similar to the actual CPU inside the computer you're reading this on right now (it's also different in many ways, most importantly execution speed, but that's a detail).

+ Reply to Thread

Similar Threads

  1. help with the math of a spring
    By sexiewasd in forum Technical Support
    Replies: 1
    Last Post: 03-09-2008, 03:02 AM
  2. some math help
    By nanotech fur in forum Technical Support
    Replies: 1
    Last Post: 10-07-2007, 05:45 AM
  3. Math help
    By Crimson in forum Technical Support
    Replies: 10
    Last Post: 09-22-2007, 09:10 AM
  4. Math Help and How-Tos
    By bprater in forum Technical Support
    Replies: 1
    Last Post: 05-21-2007, 04:07 PM
  5. Vector Math
    By Paradukes in forum Technical Support
    Replies: 1
    Last Post: 04-07-2007, 12:47 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