CSC208: FOUNDATION OF SEQUENTIAL PROGRAMMING

 CSC208: FOUNDATION OF SEQUENTIAL PROGRAMMING

(FUO, 2ND SEMESTER 2018/2019 SESSION)

INSTRUCTION: ANSWER QUESTION ONE AND ANY OTHER TWO.

 

1.      QUESTION ONE

a.      Draw a detailed diagram of an Intel 8086 processor. Describe the control and Arithmetic and logic units.

b.      Q1b

                                                              i.      List two functions of the Intel processor

                                                            ii.      What are registers?

                                                          iii.      Describe the following registers in the processor; Memory Data Register (MDR), Memory Buffer Register (MBR), Memory Address Register (MAR).

c.       Q1c

                                                              i.      State how the processor uses the address bus, the data bus, and the control bus to communicate with the system memory?

                                                            ii.      What are the specific features of the accumulator, index registers, program counter and program status word?

d.      Convert the following appropriately

                                                              i.      11100100110001112 to Hexa-decimal

                                                            ii.      2A5FB16 to Binary

                                                          iii.      7148 to Binary

                                                           iv.      11011101112 to Decimal

                                                             v.      14738 to Decimal

e.      Study the following  Assembly language program and answer the questions that follow

Segment          .testing

Global  main

main:

                        mov     bx, 0                ;

                        mov     ax, 0                ;

LX:                   add      ax[num1+bx]   ;

                        add      bx, 2                ;

                        cmp     bx, 20              ;

                        jne       LX                    ;

                        mov     [sum], ax         ;

                        mov     ax, 0x4c00       ;

                        int        0x21                ;

num1:              dw       14, 73, 19, 76, 71, 72, 70, 10, 55, 30, 50, 20, 15, 99, 48;

sum:                dw       0                      ;

                                                              i.      List the following identifiers in the program; data label, code label, system call, arithmetic instruction, branching instruction, data transfer and comments.

                                                            ii.      State the command line for assembling this code if you saved it using your first name as the source program name

                                                          iii.      What will be the output of the program after execution?

2.      QUESTION TWO

a.      What is NASM? Explain the effect of the following assembly language command line:      nasm MyFirstProgram.asm –o MyFirstProgram.com –1 MyFirstProgram.lst

b.      What is an addressing mode? Explain with examples the following Intel 8086 addressing modes

                                                              i.      Direct addressing

                                                            ii.      Base register indirect

                                                          iii.      Indexed register + offset

                                                           iv.      Base + Index + Offset

c.       List the flags defined in the 8086 FLAGS register. Describe the function of the zero flag, the carry flag, the sign flag and the overflow flag.

3.      QUESTION THREE

a.      Define the following terms

                                                              i.      Algorithm

                                                            ii.      Pseudocode

                                                          iii.      Compiler

                                                           iv.      Interpreter

                                                             v.      Assembler

b.      Describe the following assembly language directives; RESB, INCBIN, EQU, DB, DD, DW and TIMES.

c.       Provide the value of the zero flag, the carry flag, the sign flag and the overflow flag after each of the following instruction is executed if ax = FAFA and bx = CAFÉ?

                                                              i.      add ax, 1254

                                                            ii.      add ax, bx

                                                          iii.      add bx, C15B

4.      QUESTION FOUR

a.      List the seven addressing modes available in the 8088 architecture and briefly describe four of them

b.      Write short note on the two – pass assembly process for translating instructions to its machine code.

c.       What is an effective address? What will be the effective address generated by the following instructions if initially, the registers store the following BX = 0x0300, K1 = 0x3001, [K1] = 0x0000 and SI = 0x0300.

                                                              i.      mov AX, [BX + SI]

                                                            ii.      mov AX, [BX + K1]

                                                          iii.      mov AX, [K1 + BX]

                                                           iv.      mov AX, [BX + 15]

5.      QUESTION FIVE

a.      Define

                                                              i.      HLL

                                                            ii.      LLL

                                                          iii.      Little endian

                                                           iv.      Big endian

                                                             v.      Machine language

b.      Describe the following Assembly language instructions:

                                                              i.      ADDC A, R4

                                                            ii.      SUBB A, #58d

                                                          iii.      INC R8

                                                           iv.      MUL AB

                                                             v.      ANL A, #67h

c.       State the meaning and effect of the following branching instructions on the status FLAG;

                                                              i.      JNAE

                                                            ii.      JE

                                                          iii.      JG

                                                           iv.      JNP

                                                             v.      JNC.

Comments