Comp229-Midterm-sol-F2002

Comp229-Midterm-sol-F2002 - Concordia University Department...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Question 1. Assemblers [18 marks] a) The initialized variables (e.g. BYTE, WORD) are always declared before the uninitialized variables (e.g. RESB, RESW) in the source program. Moreover, the initialized and uninitialized variables are always grouped together. Would that make any difference in the object program if we had declared those variables in any order and without grouping? [4] If the initialized and uninitialized variables could be declared in any order, we would have to start a new text record whenever a new group of initialized variables is started. It is so because there could be no breaks within a given text record to allow space reservation for the uninitialized variables. b) A disassembler is a system software that converts an object (or executable) program into a source program. At disassembling time, only the opcode table is available and thus it becomes almost impossible to reconstruct the original labels because of the missing symbol table. [10] (i) Explain how we could do to include a label field and to replace the numeric operand references by appropriate labels in the disassembled program. If these operations require more than one pass, specify what happens during each pass. [7] Pass one. - Scan the address field of each machine instruction. - Determine the memory operand references. - Enter the memory operand references into the symbol table and associate a label (say LABEL1, LABEL2, etc) to the numeric operand. Also, specify whether the new label is a memory reservation or an instruction address (e.g. operand is referred to by a jump instruction). Concordia University
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Comp229-Midterm-sol-F2002 - Concordia University Department...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online