420 likes | 446 Views
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:
E N D
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: Each instruction will occupy one location in Woody's main memory Comments are ignored in the translation process, so they have been removed here
Pass 2: "Assemble" the machine code 1 Machine Code
Pass 2: "Assemble" the machine code 2 Machine Code
Pass 2: "Assemble" the machine code 3 Machine Code
Pass 2: "Assemble" the machine code 4 Machine Code
Pass 2: "Assemble" the machine code 5 Machine Code
Pass 2: "Assemble" the machine code 6 Machine Code
Pass 2: "Assemble" the machine code 7 Machine Code
Pass 2: "Assemble" the machine code 8 Machine Code
Pass 2: "Assemble" the machine code 9 Machine Code
Pass 2: "Assemble" the machine code 10 Machine Code
Pass 2: "Assemble" the machine code 11 Machine Code
Pass 2: "Assemble" the machine code 12 Machine Code
Pass 2: "Assemble" the machine code 13 Machine Code
Pass 2: "Assemble" the machine code 14 Machine Code
Pass 2: "Assemble" the machine code 15 Machine Code
Pass 2: "Assemble" the machine code 16 Machine Code
Pass 2: "Assemble" the machine code 17 Machine Code
Pass 2: "Assemble" the machine code 18 Machine Code
Pass 2: "Assemble" the machine code 19 Machine Code
Pass 2: "Assemble" the machine code 20 Machine Code
Pass 2: "Assemble" the machine code 21 Machine Code
Pass 2: "Assemble" the machine code 22 Machine Code
Pass 2: "Assemble" the machine code 23 Machine Code
Pass 2: "Assemble" the machine code 24 Machine Code
Pass 2: "Assemble" the machine code 25 Machine Code
Pass 2: "Assemble" the machine code 26 Machine Code
Pass 2: "Assemble" the machine code 27 Machine Code
Pass 2: "Assemble" the machine code 28 Machine Code
Pass 2: "Assemble" the machine code 29 Machine Code Literal integer values are translated into binary using the signed magnitude representation
Pass 2: "Assemble" the machine code 30 Machine Code 510 = 000001012 in 8 bit signed magnitude representation
Pass 2: "Assemble" the machine code 31 Machine Code 510 = 000001012 in 8 bit signed magnitude representation
Pass 2: "Assemble" the machine code 32 Machine Code
Pass 2: "Assemble" the machine code 33 Machine Code
Pass 2: "Assemble" the machine code Machine Code This sequence of values, stored in a file, forms the executable for this program.
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.