Computer Architecture and Organization emu8086, Lab Reports of Computer Architecture and Organization

Computer Architecture and Organization to solve in emu8086

Typology: Lab Reports

2021/2022

Available from 12/10/2022

Madrid.5
Madrid.5 🇧🇭

5

(1)

7 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING
ECCE -303 COMPUTER ARCHITECTURE AND ORGANIZATION
First Semester 2022-2023
ILOs: B1, B2, B3, C1, D1
Mohammed Jasim Ahmed Fadhul
202010488
LAB 6: Interrupt DOS – Calculate the factorial
Objectives:
To write a complete assembly program using interrupt 21h.
Exercise 1:
Write an assembly program that allows the user to enter 1 number between 1 and 4 from the
keyboard and display the factorial of these numbers. (use int 21h=01 and int 21h=02)
include "emu8086.inc"
org 100h
print "Enter a number"
printn
mov ah,01
int 21h
sub al,30h
cmp al,1
je L2
mov bl,al
Label1: sub bl,1
mul bl
cmp bl,1
jne Label1
mov bl,10
div bl
mov cl, al
mov ch,ah
mov dl,33 ;!sign
mov ah,02
int 21h
pf3
pf4

Partial preview of the text

Download Computer Architecture and Organization emu8086 and more Lab Reports Computer Architecture and Organization in PDF only on Docsity!

COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER ENGINEERING ECCE -303 COMPUTER ARCHITECTURE AND ORGANIZATION First Semester 2022- ILOs: B1, B2, B3, C1, D Mohammed Jasim Ahmed Fadhul 202010488 LAB 6: Interrupt DOS – Calculate the factorial Objectives: To write a complete assembly program using interrupt 21h. Exercise 1: Write an assembly program that allows the user to enter 1 number between 1 and 4 from the keyboard and display the factorial of these numbers. (use int 21h=01 and int 21h=02) include "emu8086.inc" org 100h print "Enter a number" printn mov ah, int 21h sub al,30h cmp al, je L mov bl,al Label1: sub bl, mul bl cmp bl, jne Label mov bl, div bl mov cl, al mov ch,ah mov dl,33 ;!sign mov ah, int 21h

mov dl,61 ; =sign mov ah, int 21h mov dl,'1' mov ah, int 21h ret L2: mov dl, mov ah, int 21h mov dl, mov ah, int 21h ret

mov dl,"L" mov ah, int 21h ret