Section 8 Quiz 04

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CSE 331L / EEE 332L: Microprocessor Interfacing & Embedded System

Section: 8, Spring 2021


Quiz - 04
Marks: 10
Time: 30 mins

Name: Mubasshir Ahmed

ID: 1631556042

Q1: Suppose the stack segment is declared as follows:


.stack 100h
What should be the hex content of SP when the program begins? (1)

Ans 1: SP = 0.100

Q2: Write assembly code for the following decision structure: (5)
IF DX > 0
THEN
PUT -1 in AX
ELSE
PUT 1 in AX

Ans 2:

Q3: Suppose AX contains 34 and BX contains -9.


(a) What opcode you should use to calculate AX * BX? (1)
(b) Where will the result be stored? (1)

Ans 3:
(a) Opcode- DX:BX = BX x Source
(b) Destination- Destination- CL

Q4: Identify the error/s and then write the correct instructions. (2)

INPUT:
MOV AL, 20H
PUSH AL
INC CL
JMP INPUT

Ans 4:
MOV AL ,20H
PUSH AL
JMP INPUT
INC CL

You might also like