Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Programming Mid-Term Date: October 28th, 2005 Time: 09:10-12:00.

Similar presentations


Presentation on theme: "System Programming Mid-Term Date: October 28th, 2005 Time: 09:10-12:00."— Presentation transcript:

1 System Programming Mid-Term Date: October 28th, 2005 Time: 09:10-12:00

2 2 Q1 (10%) Consider the memory contents shown in the following figure. What would be loaded to register A with the instruction (hexidecimal)? (B)= (PC)= (X)= C C

3 3 Q1 (10%) Machine instructionValue loaded into register A HexBinaryTarget address opnixbpedisp/address (B)= (PC)= (X)=

4 4 Q2 (40%) Why does Beck's "System Software" textbook design a hypothetical computer SIC to present the concepts in his book? illustrate the most commonly encountered hardware features and concepts, while avoiding most of the idiosyncrasies (p.4) easy to learn What are the maximum memory size of SIC and SIC/XE, respectively? 2 15 /2 20 (p.5/p.7)

5 5 Q2 (40%) How many addressing modes do SIC and SIC/XE support, respectively? 2/18 (p.6/p.499) How many instructions are there in the SIC/XE instruction set? 59 (p.496~498) How does SIC determine whether the result of a TD instruction is successful? CC (condition code) = LT means the device is ready (p.7)

6 6 Q2 (40%) What are the two general purpose registers in SIC/XE? S,T (p.7) What is the size of F register? 48bits (p.7) Why does the assembler need to handle the source files in two passes? Pass1 assign addresses to all symbol Pass2 generate object code in order to solve the problem of forward reference

7 7 Q3 (10%) Translate (by hand) the following assembly program to SIC object code. (The output format will look like Figure 2.3, which contains H record, T record, and E record.) LocSource statementObject code STRCPYSTART 1000 FIRSTLDXZERO MOVECH LDCHSTR1,X STCHSTR2,X TIXELEVEN JLTMOVECH STR1BYTEC’TEST STRING’ STR2RESB11 ZEROWORD0 ELEVENWORD11 ENDFIRST

8 8 Q3 (10%) Translate (by hand) the following assembly program to SIC object code. (The output format will look like Figure 2.3, which contains H record, T record, and E record.) LocSource statementObject code 1000STRCPYSTART 1000 FIRSTLDXZERO MOVECH LDCHSTR1,X50900F 1006STCHSTR2,X54901A 1009TIXELEVEN2C CJLTMOVECH FSTR1BYTEC’TEST STRING’544553… 101ASTR2RESB ZEROWORD ELEVENWORD B 102BENDFIRST

9 9 Q3 (10%) Machine instruction CodeBinaryHex opxdisp/address LDCH STR1,X F STCH STR2,X A

10 10 Q3 (10%) HSTRCPY B T F F54901A2C T00100F0B E47 T B E ^ ^ ^ ^^^^ ^^^ ^^^ ^^^^ ^

11 11 Q4 (10%) Translate (by hand) the following assembly program to SIC/XE object code. LocSource statementObject code STRCP2START 1000 FIRSTLDT#11 LDX#0 MOVECH LDCHSTR1,X STCHSTR2,X TIXRT JLTMOVECH STR1BYTEC'TEST STRING' STR2RESB11 ENDFIRST

12 12 Q4 (10%) Translate (by hand) the following assembly program to SIC/XE object code. LocSource statementObject code 1000 STRCP2START 1000 FIRSTLDT# B 1003LDX# MOVECH LDCHSTR1,X53A STCHSTR2,X57A CTIXRTB EJLTMOVECH3B2FF5 1011STR1BYTEC'TEST STRING'544553… 101CSTR2RESB ENDFIRST

13 13 Q4 (10%) Machine instruction CodeBinaryHex opnixbpedisp/address LDCH STR1,X A008 STCH STR2,X A010 JLT MOVECH B2FF5

14 14 Q4 (10%) HSTRCP T B A00857A010B8503B2FF5 T B E ^ ^ ^ ^^^^ ^^^ ^^^ ^ ^

15 15 Q5 (10%) Disassemble (convert object code back into assembly language) the following SIC program. HSUM E T E D000B3B2FF8 E001000

16 16 Q5 (10%) LocSource statementObject code 1000 SUMSTART# FIRSTLDA# LDX# LOOPADDR#X,A TIX#112D000B 100BJLT#LOOP3B2FF8 100EEND#FIRST

17 17 Q5 (10%) Machine instruction HexBinaryCode opnixbpedisp/address 3B2FF JLT LOOP

18 18 Q6 (10%) Simulate (by hand) the execution of the above program and let the breakpoint be 00100E. What would be the value of register A and register X when (PC) = 00100E? ……+9+10=55 A=37, X=B Iteration Register A X

19 19 Q7 (10%) Simulate (by hand) the execution of the object code below. Let the breakpoint be What is the value of register A when (PC) = ? HGAUSS T C B1B T00100C0B6F40009C E001000

20 20 Q7 (10%) LocSource statementObject code 1000 GAUSSSTART# FIRSTLDA# LDB#TWO69200B BASE#TWO 1006ADD#K1001B MUL#K CLDS#TWO6F FDIVR#S,A9C TWOWORD#2# K100WORD# END#FIRST

21 21 Q7 (10%) Machine instruction HexBinaryCode opnixbpedisp/address 69200B LDB #TWO 1B ADD #K MUL #K100 6F LDS #TWO

22 22 Q7 (10%) [(1+100)*100]/2=5050 A=13BA Loc Register C100F1011 AF BFF22222 SFFFFF22

23 23 Homework The code can work well  greater than 7 If I need to correct it  less then 5 Second chance  23:59 on Nov. 4 th (tonight) Subject of [SP HW1v2] ######## to me:


Download ppt "System Programming Mid-Term Date: October 28th, 2005 Time: 09:10-12:00."

Similar presentations


Ads by Google