Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

mp9036 Group Title

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)

  • 2 years ago
  • 2 years ago

  • This Question is Open
  1. RedPrince Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

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

    • 2 years ago
  2. dmarshall Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 2 years ago
  3. oldrin.bataku Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.