1 / 42

Translating Assembly Language to Machine Language

Translating Assembly Language to Machine Language. An example program. Notes: Parts of lines appearing after "*" are comments Labels in left hand column are names associated with the corresponding value. Instructions and addresses. Notes:

Télécharger la présentation

Translating Assembly Language to Machine Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Translating Assembly Language to Machine Language

  2. An example program Notes: Parts of lines appearing after "*" are comments Labels in left hand column are names associated with the corresponding value

  3. Instructions and addresses Notes: Each instruction will occupy one location in Woody's main memory Comments are ignored in the translation process, so they have been removed here

  4. Pass 1: Create a symbol table

  5. Pass 1: Create a symbol table

  6. Pass 1: Create a symbol table

  7. Pass 1: Create a symbol table

  8. Pass 2: "Assemble" the machine code 1 Machine Code

  9. Pass 2: "Assemble" the machine code 2 Machine Code

  10. Pass 2: "Assemble" the machine code 3 Machine Code

  11. Pass 2: "Assemble" the machine code 4 Machine Code

  12. Pass 2: "Assemble" the machine code 5 Machine Code

  13. Pass 2: "Assemble" the machine code 6 Machine Code

  14. Pass 2: "Assemble" the machine code 7 Machine Code

  15. Pass 2: "Assemble" the machine code 8 Machine Code

  16. Pass 2: "Assemble" the machine code 9 Machine Code

  17. Pass 2: "Assemble" the machine code 10 Machine Code

  18. Pass 2: "Assemble" the machine code 11 Machine Code

  19. Pass 2: "Assemble" the machine code 12 Machine Code

  20. Pass 2: "Assemble" the machine code 13 Machine Code

  21. Pass 2: "Assemble" the machine code 14 Machine Code

  22. Pass 2: "Assemble" the machine code 15 Machine Code

  23. Pass 2: "Assemble" the machine code 16 Machine Code

  24. Pass 2: "Assemble" the machine code 17 Machine Code

  25. Pass 2: "Assemble" the machine code 18 Machine Code

  26. Pass 2: "Assemble" the machine code 19 Machine Code

  27. Pass 2: "Assemble" the machine code 20 Machine Code

  28. Pass 2: "Assemble" the machine code 21 Machine Code

  29. Pass 2: "Assemble" the machine code 22 Machine Code

  30. Pass 2: "Assemble" the machine code 23 Machine Code

  31. Pass 2: "Assemble" the machine code 24 Machine Code

  32. Pass 2: "Assemble" the machine code 25 Machine Code

  33. Pass 2: "Assemble" the machine code 26 Machine Code

  34. Pass 2: "Assemble" the machine code 27 Machine Code

  35. Pass 2: "Assemble" the machine code 28 Machine Code

  36. Pass 2: "Assemble" the machine code 29 Machine Code Literal integer values are translated into binary using the signed magnitude representation

  37. Pass 2: "Assemble" the machine code 30 Machine Code 510 = 000001012 in 8 bit signed magnitude representation

  38. Pass 2: "Assemble" the machine code 31 Machine Code 510 = 000001012 in 8 bit signed magnitude representation

  39. Pass 2: "Assemble" the machine code 32 Machine Code

  40. Pass 2: "Assemble" the machine code 33 Machine Code

  41. Pass 2: "Assemble" the machine code Machine Code This sequence of values, stored in a file, forms the executable for this program.

  42. Observations • This is a very mechanical process. The program that does this job is called an assembler. • Each different computer architecture (Intel Pentium, PowerPC, IBM Cell, etc.) has its own assembly language. • The instructions in assembly language correspond one-to-one with instructions in the target architecture's machine language. • An executable for a program consists of a file containing the machine language instructions for the program.

More Related