0% found this document useful (0 votes)
79 views6 pages

Microprocessor and Assembly Language

Question 1 - Calculates 5 * 4 * 3 * 2 * 1 by multiplying a number by a decreasing factor and storing the result in AL. Question 2 - Prompts the user to enter a base and power. It calculates the base to the power entered by repeatedly multiplying the base by itself based on the power count. The result is displayed.

Uploaded by

mashan jan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views6 pages

Microprocessor and Assembly Language

Question 1 - Calculates 5 * 4 * 3 * 2 * 1 by multiplying a number by a decreasing factor and storing the result in AL. Question 2 - Prompts the user to enter a base and power. It calculates the base to the power entered by repeatedly multiplying the base by itself based on the power count. The result is displayed.

Uploaded by

mashan jan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Microprocessor and Assembly Language

Lab Assignment 2

Question#1
org 100h
.DATA
ANS DB ?
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV AL,5
MOV CL,4
MOV BL,AL
SUB BL,1
L:
MUL BL
SUB BL,1
LOOP L
MOV ANS,AL
END MAIN

Ret
Question#2
.MODEL SMALL
.DATA
        BASE    DB      ?
        POW     DB      ?
        NL1     DB      0AH,0DH,\'ENTER BASE:\',\'$\'
        NL2     DB      0AH,0DH,\'ENTER POWER:\',\'$\'
.CODE

MAIN    PROC

        MOV AX,@DATA
        MOV DS,AX

ENTER_BASE:

        LEA DX,NL1
        MOV AH,09H
        INT 21H

        MOV AH,01H
        INT 21H
        SUB AL,30H
        MOV BL,AL

        MOV BASE,AL

ENTER_POWER:

        LEA DX,NL2
        MOV AH,09H
        INT 21H

        MOV AH,01H
        INT 21H
        SUB AL,30H

        MOV CL,AL
        DEC CL
        MOV AX,00
        MOV AL,BASE
LBL1:
        MUL BL
        LOOP LBL1

        MOV CL,10
        DIV CL
        ADD AX,3030H
        MOV DX,AX

        MOV AH,02H
        INT 21H
        MOV DL,DH
        INT 21H

        MOV AH,4CH
        INT 21H

MAIN    ENDP
        END     MAIN

You might also like