NCNU System Programming Mid-Term

Date: October 28th, 2005
Time: 09:10-12:00

  1. (10%) Consider the memory contents shown in the following figure.  What would be loaded to register A with the instruction 022030 (hexidecimal)?
    Figure 1.1(a)
  2. (40%) Briefly answer the following questions 
    1. Why does Beck's "System Software" textbook design a hypothetical computer SIC to present the concepts in his book?
    2. What are the maximum memory size of SIC and SIC/XE, respsectively?
    3. How many addressing modes do SIC and SIC/XE support, respectively?
    4. How many instructions are there in the SIC/XE instruction set?
    5. How does SIC determine whether the result of a TD instruction is successful?
    6. What are the two general purpose registers in SIC/XE?
    7. What is the size of F register?
    8. Why does the assembler need to handle the source files in two passes?
  3. (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.)
    STRCPY START 
    1000
    FIRST
    LDX ZERO
    MOVECH  
    LDCH STR1,X

    STCH STR2,X

    TIX ELEVEN

    JLT
    MOVECH
    STR1
    BYTE
    C'TEST STRING'
    STR2
    RESB
    11
    ZERO
    WORD
    0
    ELEVEN
    WORD
    11

    END
    FIRST
  4. (10%) Translate (by hand) the following assembly program to SIC/XE object code.
    STRCP2 START  
    1000
    FIRST
    LDT #11

    LDX
    #0
    MOVECH  
    LDCH
    STR1,X

    STCH
    STR2,X

    TIXR
    T

    JLT
    MOVECH
    STR1
    BYTE
    C'TEST STRING'
    STR2
    RESB
    11

    END
    FIRST

  5. (10%) Disassemble (convert object code back into assembly language) the following SIC/XE program.
        HSUM   00100000000E
    T0010000E01000005000190102D000B3B2FF8
    E001000
  6. (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?
  7. (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