0% found this document useful (0 votes)
24 views

Assembly Language Lab 03: MD - Sazzad Hossain Shohan ROLL:753

This document contains 3 assembly language code examples with brief descriptions: 1. A code that prints the numeric value 4 followed by 2 using variables. 2. A code that subtracts two input numbers. 3. A code that compares two numbers and prints either "GREATER" or "SMALLER".
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Assembly Language Lab 03: MD - Sazzad Hossain Shohan ROLL:753

This document contains 3 assembly language code examples with brief descriptions: 1. A code that prints the numeric value 4 followed by 2 using variables. 2. A code that subtracts two input numbers. 3. A code that compares two numbers and prints either "GREATER" or "SMALLER".
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

ASSEMBLY LANGUAGE LAB 03

MD.SAZZAD HOSSAIN SHOHAN


ROLL:753

SUBMITTED TO: SHAHRIAR SETU


 Assembly code that can print a numeric value using variable

CODE OUTPUT

.MODEL SMALL
.STACK 100H INT 21H
.DATA
MOV AH,2
MSG1 DB '4$' MOV DL, 0DH
MSG2 DB '2$' INT 21H
MOV DL,0AH
.CODE INT 21H
MAIN PROC
LEA DX,MSG2
MOV AX,@DATA MOV AH,9
MOV DS,AX INT 21H
LEA DX,MSG1 END MAIN
MOV AH,9
  Assembly code that can subtract two input number

CODE OUTPUT

.MODEL SMALL
.STACK 100H MOV AH,2
.CODE MOV DL,0AH
INT 21H
MAIN PROC MOV DL,0DH
INT 21H
MOV AH,1
INT 21H MOV AH,2
MOV BL,AL ADD BL,48
INT 21h MOV DL,BL
MOV CL,AL INT 21H
SUB BL,CL
END MAIN
  Assembly code that can compare two numbers

CODE OUTPUT

.MODEL SMALL MOV AH,1


.STACK 100H INT 21H
.DATA MOV BL,AL
MSG1 DB 'ENTER AN INPUT: SUB BL,48
$' CMP BL,5
MSG2 DB ' GREATER$' JL L1
MSG3 DB ' SMALLER$' LEA DX,MSG2
.CODE MOV AH,9
MAIN PROC INT 21H
MOV AX,@DATA JMP EXIT
MOV DS,AX L1:
LEA DX,MSG1 LEA DX,MSG3
MOV AH,9 MOV AH,9
INT 21H INT 21H

You might also like