Professional Documents
Culture Documents
Objective:
Task to be performed:
A. Execute the program in Emu8086 (using the required syntax)
ORG 100H
MOV AX,4000H
MOV DS,AX
MOV AL,[8000H]
CMP AL,00H
JE LABEL1
CMP AL,01H
JE LABEL1
CMP AL,08H
JA LABEL2
MOV BX,0000H
MOV BL,AL
DEC BL
LABEL:MUL
BX
DEC BL
JNZ LABEL
MOV[8001H],AX
JMP END
LABEL1:MOV [8001H],01H
JMP END
LABEL2:MOV [8001H],00H
END:RET
DL X DS 1 110
DL Y DS 1 111
DL Z DS 1 112
DL RESULT DS 1 113
AD END 114
number in the format below. Also construct a symbol table for the same.
DL A DS 1 120
AD END 125
Symbol Table:
A 120 Y Y 1
ONE 121 Y Y 1
ZERO 122 Y Y 0
EIGHT 123 Y Y 8
RESULT 124 Y Y 1
AGAIN 113 Y Y 1
LAST 118 Y Y 1
CMP instruction:
For comparison, it subtracts the source operand from the
destination operand but does not store the result anywhere. The
flags are affected depending upon the result of the subtraction. If
both of the operands are equal, zero flag is set. If the source
operand is greater than the destination operand, carry flag is set or
else, carry flag is reset.
The DEC Instruction
The DEC instruction is used for decrementing an operand by one. It
works on a single operand that can be either in a register or in
memory.
Syntax:
The DEC instruction has the following syntax −
DEC destination
The operand destination could be an 8-bit, 16-bit or 32-bit operand.
Eg: DEC BX DEC CH
Algorithm:
Step1 : Initialization of data segment
Step2 : Store input in a register
Step3 : If input is 0 then store 1 as result
Step4 : If input is 1 then store 1 as result
Program Code:
Output Screenshot:
Outcome of the Thus, we were able to write down machine code of the respective
Experiment: Assembly language, classify the type of statements and were also
successful in implementing the same in emu8086.
References: Assembly program to find factorial of number given by user |
Computer Science Simplified - A Website for IGNOU MCA &
BCA Students for Solved Assignments, Notes, C Programming,
Algorithms - CSSimplified.com
https://www.tutorialspoint.com/assembly_programming/index.htm
https://www.geeksforgeeks.org/introduction-of-assembler/