0% found this document useful (0 votes)
84 views

CCS 3252 Assembly Language Programming

This document contains five questions regarding assembly language programming for an exam on Assembly Language Programming. The questions cover various topics related to assembly language programming including: [1] basic assembly program structure, processor memory organization, instruction definitions, fetch-decode-execute cycle, register and memory storage; [2] local and global variables, addressing modes, effect of instruction sequences, memory segments; [3] incorrect assembly constructs, coding an arithmetic expression, processor registers; [4] components of Von Neumann machines, POP and PUSH instructions, shift and rotate instructions, stack concept; [5] stack manipulation using PUSH and POP, removing data from stack without popping, power of address register indirect addressing mode. The document provides detailed questions and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views

CCS 3252 Assembly Language Programming

This document contains five questions regarding assembly language programming for an exam on Assembly Language Programming. The questions cover various topics related to assembly language programming including: [1] basic assembly program structure, processor memory organization, instruction definitions, fetch-decode-execute cycle, register and memory storage; [2] local and global variables, addressing modes, effect of instruction sequences, memory segments; [3] incorrect assembly constructs, coding an arithmetic expression, processor registers; [4] components of Von Neumann machines, POP and PUSH instructions, shift and rotate instructions, stack concept; [5] stack manipulation using PUSH and POP, removing data from stack without popping, power of address register indirect addressing mode. The document provides detailed questions and
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MERU UNIVERSITY OF SCIENCE AND TECHNOLOGY

P.O. Box 972-60200 – Meru-Kenya.


Tel: +254(0) 799 529 958, +254(0) 799 529 959, + 254 (0) 712 524 293,
Website: [email protected] Email: [email protected]

University Examinations 2017/2018

SECOND YEAR SECOND SEMESTER EXAMINATION FOR THE DEGREE OF


BACHELOR OF COMPUTER TECHNOLOGY, BACHELOR OF COMPUTER SCIENCE,
BACHELOR OF COMPUTER SECURITY AND FORENSICS

CCS 3252: ASSEMBLY LANGUAGE PROGRAMMING

DATE: SEPTEMBER 2018 TIME: 2 HOURS

INSTRUCTIONS: Answer question one and any other two questions

QUESTION ONE (30 MARKS)

a) Explain the basic structure of an assembly program (4 marks)

b) The 80x86 family has different processor members. What in the context of the memory
subsystem is the difference between the family members and which ways do the
memory organization differ (4 marks)

c) Define the actions of each of the following instructions in high level assembly
programming language. Also state in plain English the action for each (6 marks)

i. add (3232,i32);

ii. sub (i16, ax):

iii. mov (0,was);

d) discuss the fetch-decode-execute cycle in the execution of instructions by a Pentium


processor (4 marks)

e) make use of sketches to show how processor stores data in Register and in Memory

(3 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 1
f) What is the difference between mov(≠125, ebx), mov (125, ebx) and mov (&j, ebx)’?
(6 marks)

g) Identify the three parts of an assembly language instruction in the following


statements: (3 marks)

add (ax,cx);

mov(hx,ax)

QUESTION TWO (20MARKS)


a) Explain the meaning of local and global variables (4 marks)
b) With the aid of diagrams, give examples of valid 80x86 assembly language
instructions that use: (6 marks)
i. Displacement only addressing mode
ii. Indexed addressing mode
iii. Scale indexed addressing mode
c) By means of an expression or otherwise, explain the effect of the following sequence
of 80x86 assembly language instructions that use: (4 marks)
i. mov(x,ebx),
ii. mov(y,ax),
iii. sub(ax,ax),
iv. mov(ex,W);
d) Discuss the memory segments in an assembly language program (6 marks)
QUESTION THREE (20 MARKS)
a) Explain why the following assembly language constructs are incorrect (4 marks)
i. mov (d3,c4);
ii. mov (d3),d2);
iii. mov ([d3],d2);
iv. sub(i8,eax);
v. add (ax,i32);
vi. mov[[ax],al];
b) Suppose you are given the following arithmetic expression (6 marks)
X = ( a + b)) * ( y − z ) / 5

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 2
Provide the code sequence for the 80x86 architecture that will compute the results of
the expression. Assume all variables are UN$32 values and you are computing
unsigned results (6 marks)
c) Discuss the following processor registers (8 marks)
i. Data registers
ii. Pointer registers
iii. General registers
iv. Segment registers
QUESTION FOUR (20 MARKS)
a) Write three components that make up Von Neuman machines (3 marks)
b) Describe how a CPU like the 80x86 families of CPU’s implements the basic POP and
PUSH instructions. Your answer must include one or more diagrams (8 marks)
c) The 80x86 families of CPU’s provides a series of shift and rotate instructions. Show
the changes to the registers after each instruction is executed, each part is a separate
problem
The initial contents of the register are; reg7=1010 1011 1100 0100
i. Left shin 3
ii. Logic right shift 4;
iii. Arithmetic right shift1,
iv. Right rotate5;
v. Right rotate5, (5 marks)
d) What is a stack in the context of the 80x86 families of CPU’s (4 marks)

QUESTION FIVE (20 MARKS)


a) Each of the following instructions is executed consecutively. Draw a series of
diagrams to illustrate the effect of the stack after each instruction has been executed.
The initial contents of the register are:
reg2=1357
reg7=abc4
reg8=4567
i. Push reg2
ii. Push reg7

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 3
iii. Push regs
iv. Push reg2
v. Push reg8
vi. Push regs
vii. Pop reg3
viii. Pop reg5 (8 marks)

b) Write High level assembly language instructions for the 80x86 families CPU’s for
removing data from the stack without popping it (6 marks)
c) “Address register indirect addressing is one of the most powerful and used addressing
modes implemented by a computer”. Explain why this statement is true in the context
of the 80 x 86 families. You should explain what this address mode does and give
examples of its application (6 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 4

You might also like