Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

how do I translate pseudocode into machine language like...LOAD STORE MOVE ADD...? for example... if(W=1) then (Z=2) else (if (W=2) then (Y=7) else(if(W=3) then (x=7)

OpenStudy (redprince):

you need to know a programming language like C/C++, C#, Java, VB, Python etc to turn your pseudo code into machine language!

OpenStudy (anonymous):

As RedPrince said, you need to understand the language you are translating into. However, from the example you give, it sounds like you're talking about assembly language, aka machine code. Machine code is tied inextricably to the machine it runs on, hence the name - so you'll also need to know a bit about how that type of CPU works. In general, though, you usually need to retrieve data from memory using commands like "LDA AX, &1" or whatever it's called on your particular system; perform whatever operation you need (eg "CMP AX, 1" to compare W with 1); then store the result (eg STA) or branch to the appropriate part of your code (eg "JNE 4" to jump 4 bytes forward if they're not equal). Unfortunately without knowing exactly what form of machine code you're talking about it's not really possible to give precise details.

OpenStudy (anonymous):

First off, two tidbits: Psuedocode is not a real programming language. Assembly is not the same as machine code. You'd need to have a strictly defined language with a functional syntax as described by some grammar, along with developed semantics to understand what the code is doing. Essentially, you'd need to use an actual programming language. The translation from a high-level programming language into low-level assembly (which is assembled into binary machine code) is known as compilation. While you could do compilation by hand, virtually everyone uses automatic compilers. You're probably familiar with these. As an overview, you'd first need to use a real programming language and then compile it somehow to produce the assembly you're looking for.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!