I am sorta new to the cpu and was whanted to know how to convert the math
like
$ ? |
I am sorta new to the cpu and was whanted to know how to convert the math
like
$ ? |
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.
? is "if", so you'd do some sort of comparison.
| is "or" so you'd combine comparisons.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;
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;
what i don't get is all the registering.Like eax,ebx,and ecx-why cant it be like expression gates?
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
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.
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).
Bookmarks