


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Computer Architecture and Organization to solve in emu8086
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



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