CSCI 1120 Lecture Notes - Lecture 39: Opcode, Memory Address, Portable Executable

121 views1 pages
Verified Note

Document Summary

Turn all labels into opcodes, mnemonics into memory locations. We can do this in one pass because assembly language does not need to keep track of memory addresses due to labels. The first pass is to build a symbol table: scan the code, identify the labels, identify the location in the program where the label is located, assign memory address to the labels. All memory addresses should be a multiple of 4, assuming a 32-bit environment (in a 64-bit environment, multiples of 8) each line would be encoded into 4 bytes. Scan code from top to bottom, write down memory address of labels. After the first scan, with our list of memory addresses, we need to find a way to convert out mnemonic into an actual opcode (for use in the decode phase of the execution cycle) Use the binary opcode, assumed to be 4 bits, to go back to the beginning of the code and design a portable executable.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents