Você está na página 1de 3

1.

(05%)

Please describe the differences between PC Relative addressing and Base Relative addressing from bit pattern and displacement range. PC Relative instr!ction format (b"0# p"1)# PC register is !sed and $%0&'("disp("%0&) Base Relative instr!ction format (b"1# p"0)# Base register is !sed and 0("disp("&0*5 (05%) Please describe the differences between +mmediate addressing# +ndirect addressing# and ,imple addressing. +ndirect instr!ction format (n"1# i"0) -m# and twice memor. references at least ((/0)) +mmediate instr!ction format (n"0# i"1) 1C# and no memor. reference /0 ,imple instr!ction format (n"1# i"1) m and one memor. reference (/0) b.

a.

%.

(10%)

2hat is the program relocation3 Please describe it in detail and draw a diagram to e4plain. (10%) b. 5ow to cond!ct the information needed for program relocation in ,+C678 assembler3 No matter where the program is loaded and run, if the available memory size is larger than the length of object program. But the some object codes are needed to be modified with Modification records to identify.

a.

Use Modification records in object program for extended format instructions or absolute addressing !"#UB $%$&'(, e.g., M)*****+)*,!'-./ 9. (%0%) Please describe the main f!nctions (Pass 1 and Pass %) of ,+C assembler.

.ass 0 define symbol( 1ssign addresses to all statements generate 2-'(. 'hec3 the correctness of 4nstruction chec3 with -. table(. #ave the values address( assigned to all labels into #/MB-2 table for .ass 5. .erform some processing of assembler directives. .ass 5 1ssemble instructions op code from -. table, address from #/MB-2 table(. 6enerate data values defined by B/7&, 8-$%. .erform processing of assembler directives not done during .ass 0. 8rite the -. 9ig. 5.:( and the assembly listing 9ig. 5.5(. &. (%0%) 0. 2hat are the same and difference (if has) between the following 0# B# and C se:!ences of statements3 Value EQU 10 ... LDA #Value LDA #10 Value EQU 10 ... LDA Value

B. C.

#ame; Both 1 and B use immediate addressing for loading value 0* into register 1 %ifference; 1 has readability, if we want to change the value of <alue, we just change <alue &%U with a new value. ' is totally different with 1 and B. ' uses direct addressing for loading the content of memory address *****1 into register 1. 5. (&0%) ADD LDA LDX STA The 0000 0000 0003 0006 000A 000D Please generate the ;<C and ob=ect code for each statement in the following ,+C678 so!rce program. 18H JLT 38H 00H LDB 68H 04H RSUB 4CH 0CH TIX 2CH ASCII ! A "# 41H SU$ %IRST L''( START LDX LDA )LDB BASE ADD ADD 0 #0 #100 #TABLE2 TABLE2 TABLE1,X TABLE2,X

0&0000 010064 6*101+*0 1BA013 1BC000

0010 0013 0016 001A 001D 0020 1+*0 2348

C'-T TABLE1 TABLE2 T'TAL

TIX JLT )STA RSUB B.TE RES1 RES1 RES1 E-D

C'-T L''( T'TAL C/0''/ 2000 1000 2BB83 1000 %IRST

2%200A 3B2%ED 0%102348 4%0000 &A4%4%

Você também pode gostar