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 022030 (hexidecimal)?............ (B)=006000 (PC)=003000 (X)=000090 3030003600............ 3600103000............ 639000C303............ C303003030............

3 3 Q1 (10%) Machine instructionValue loaded into register A HexBinaryTarget address opnixbpedisp/address 0220300000001000100000 0011 00003030103000............ (B)=006000 (PC)=003000 (X)=000090 3030003600............ 3600103000............

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 FIRSTLDXZERO041025 1003MOVECH LDCHSTR1,X50900F 1006STCHSTR2,X54901A 1009TIXELEVEN2C1028 100CJLTMOVECH381003 100FSTR1BYTEC’TEST STRING’544553… 101ASTR2RESB11 1025ZEROWORD0000000 1028ELEVENWORD1100000B 102BENDFIRST

9 9 Q3 (10%) Machine instruction CodeBinaryHex opxdisp/address LDCH STR1,X 010100001001 0000 0000 111150900F STCH STR2,X 010101001001 0000 0001 101054901A

10 10 Q3 (10%) HSTRCPY00100000002B T0010000F04102550900F54901A2C1028381 003 T00100F0B5445535420535453494E47 T0010250600000000000B E001000 ^ ^ ^ ^^^^ ^^^ ^^^ ^^^^ ^

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#11 75000B 1003LDX#0050000 1006MOVECH LDCHSTR1,X53A008 1009STCHSTR2,X57A010 100CTIXRTB850 100EJLTMOVECH3B2FF5 1011STR1BYTEC'TEST STRING'544553… 101CSTR2RESB11 1027ENDFIRST

13 13 Q4 (10%) Machine instruction CodeBinaryHex opnixbpedisp/address LDCH STR1,X 0101 001110100000 0000 100053A008 STCH STR2,X 0101 011110100000 0001 000057A010 JLT MOVECH 0011 101100101111 1111 01013B2FF5

14 14 Q4 (10%) HSTRCP2001000000027 T0010001175000B05000053A00857A010B8503B2FF5 T0010110B544553542053545249 E001000 ^ ^ ^ ^^^^ ^^^ ^^^ ^ ^

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

16 16 Q5 (10%) LocSource statementObject code 1000 SUMSTART#1000 1000 FIRSTLDA#0 010000 1003LDX#1050001 1006LOOPADDR#X,A9010 1008TIX#112D000B 100BJLT#LOOP3B2FF8 100EEND#FIRST

17 17 Q5 (10%) Machine instruction HexBinaryCode opnixbpedisp/address 3B2FF80011 101100101111 1111 1000 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? 1+2+3+……+9+10=55 A=37, X=B Iteration Register 1234567891011 A013610152127364555 X1234567891011

19 19 Q7 (10%) Simulate (by hand) the execution of the object code below. Let the breakpoint be 001011. What is the value of register A when (PC) = 001011? HGAUSS 001000000017 T0010000C01000169200B1B4003232008 T00100C0B6F40009C40000002000064 E001000

20 20 Q7 (10%) LocSource statementObject code 1000 GAUSSSTART#1000 1000 FIRSTLDA#1 010001 1003LDB#TWO69200B BASE#TWO 1006ADD#K1001B4003 1009MUL#K100232008 100CLDS#TWO6F4000 100FDIVR#S,A9C40 1011TWOWORD#2#2000002 1014K100WORD#100000064 1017END#FIRST

21 21 Q7 (10%) Machine instruction HexBinaryCode opnixbpedisp/address 69200B0110 100100100000 0000 1011 LDB #TWO 1B40030001 101101000000 0000 0011 ADD #K100 2320080010 001100100000 0000 1000 MUL #K100 6F40000110 111101000000 0000 0000 LDS #TWO

22 22 Q7 (10%) [(1+100)*100]/2=5050 A=13BA Loc Register 1000100310061009100C100F1011 AF1110110100 5050 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 email: [SP HW1v2] ######## Email to me: s94321517@ncnu.edu.tws94321517@ncnu.edu.tw


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

Similar presentations


Ads by Google