Professional Documents
Culture Documents
Tutorial 7
Tutorial 7
Tutorial 7
27.02.2024
28.02.2024
29.02.2024
04.03.2024
Problem 1
TEN EQU 10
NINE EQU 9
MOV AL,TEN
MOV BL,NINE
RET
Q2. Find out the Content of the following registers on executing the ALP: AX, BX, DS/ES
(a) (b)
.MODEL SMALL .MODEL SMALL
.DATA .DATA
VAR DB 23h,45H,00H,98H
VAR DB 23h,45H,00H,98H
.code
.code
LEA BX, VAR
LEA BX, VAR
LDS AX, VAR LES CX, VAR
RET
RET
(a)
(b)
Q3. Write an assembly language program to convert 8-bit binary data to BCD utilizing the given flowchart.
TEN: CMP AL,0AH ;Compare whether data is less than 10 (or 0AH).
JC UNIT ;If data is less than 10 then jump to UNIT.
SUB AL,0AH ;If data greater than 10 then, subtract ten.
INC DH ;Increment tens register.
JMP TEN ;Repeat subtraction of ten.
Q4. Find
the content of stack and SP after the execution of following instruction. Assume CS = 700H, SS = 700H, SP =
FFFEH, SI = DI = 0000H and IF = 1. Consider the entire stack to be filled with 0000 before the execution of the code.
MOV AX,0ABCDH
MOV BX,1234H
MOV CX,5678H
MOV DX,9ABCH
CLC
STD
PUSHA
This instruction pushes all the general-purpose registers onto the stack in the following order: AX, CX, DX, BX, SP, BP, DI, and SI. The value of
SP pushed is the value before the instruction is executed. It helps save state before an operation that could potentially change these registers.
10
11
1) Reverse the given string and store the reversed string in the
memory.
2) Check if the given string and the reversed string are equal.
12