0% found this document useful (0 votes)
537 views25 pages

Masm Programs

The document describes assembly language programs for finding largest/smallest numbers in an array, copying and comparing strings, sorting arrays, searching arrays, and validating passwords. It provides code samples and output for programs to perform these tasks using 8086 assembler MASM.

Uploaded by

Jansi
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)
537 views25 pages

Masm Programs

The document describes assembly language programs for finding largest/smallest numbers in an array, copying and comparing strings, sorting arrays, searching arrays, and validating passwords. It provides code samples and output for programs to perform these tasks using 8086 assembler MASM.

Uploaded by

Jansi
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/ 25

9.

Largest of n numbers

AIM:
To write an assembly language program to find largest number in an array using 8086
assembler MASM.

APPARATUS REQUIRED:
1. PC installed with MASM software.
ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count of an input array in register CL.
3. Compare the first two values in the array.Swap the values if the result produces no carry
else need not.Decrement the count value in register CL.
4. Repeat step 3 for the consecutive array values until the count becomes zero in register CL.
5. The largest number will be stored in memory locations addressed by register DI.
PROGRAM:
ASSUME CS: CODE
CODE SEGMENT
ORG 1000H
MOV SI, 2000H
MOV CL, [SI]
DEC CL
INC SI
MOV AX, [SI]
AG: CMP AX, [SI+2]
JNC NEXT
MOV AX, [SI+2]
NEXT: ADD SI, 02H
DEC CL
JNZ AG
MOV DI, 3000H
MOV [DI], AX
HLT
MOV AH, 4CH
INT 21H
CODE ENDS
END

OUTPUT:
-E 2000
2000 00.04 00.00 00.06 00.00 00.03 00.00
00.04 00.00 00.08
-G=1000
Program terminated normally
-E 3000
3000 00.00 00.08
RESULT:
Thus the program for finding largest and smallest of n numbers using MASM was
executed and verified successfully.

10. Smallest of n numbers

AIM:
To write an assembly language program to find smallest number in an array using 8086
assembler MASM.

APPARATUS REQUIRED:
1. PC installed with MASM software.

ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count of an input array in register CL.
3. Compare the first two values in the array. Swap the values if the result produces carry else
need not. Decrement the count value in register CL.
4. Repeat step 3 for the consecutive array values until the count becomes zero in register CL.
5. The smallest number will be stored in memory locations addressed by register DI.

PROGRAM:
ASSUME CS: CODE
CODE SEGMENT
ORG 1000H
MOV SI, 2000H
MOV CL, [SI]
DEC CL
INC SI
MOV AX, [SI]
AG: CMP AX, [SI+2]
JC NEXT
MOV AX, [SI+2]
NEXT: ADD SI, 02H
DEC CL
JNZ AG
MOV DI, 3000H
MOV [DI], AX
HLT
MOV AH, 4CH
INT 21H
CODE ENDS
END
OUTPUT:
-E 2000
2000 00.04 00.00 00.06 00.00 00.03 00.00
00.04 00.00 00.08
-G=1000
Program terminated normally
-E 3000
3000 00.00 00.03

RESULT:
Thus the program for finding largest and smallest of n numbers using MASM was
executed and verified successfully.
11. Copy a String

AIM:
To write an assembly language program to copy a string byte from one block of memory
locations to another using 8086 assembler MASM.

APPARATUS REQUIRED:
1. PC installed with MASM software.

ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count value in register CX for the number of strings to be copied.
3. Initialize registers SI and DI with source and destination data address respectively.
4. Store the strings one by one from source to destination address and simultaneously
decrement the count value after each string byte is copied.
5. When the count value is non-zero, repeat step 4 else terminate the program.
PROGRAM:
ASSUME CS: CODE
CODE SEGMENT
ORG 1000H
MOV CX, 0005H
MOV SI, 2000H
MOV DI, 3000H
CLD
REP MOVSB
MOV AH,4CH
INT 21H
CODE ENDS
END

OUTPUT:
-E 2000
2000 00.04 00.0A 00.06 00.23 00.18
-G=1000
Program terminated normally
-E 3000
3000 00.04 00.0A 00.06 00.23 00.18

RESULT:
Thus the assembly language program for copying a string byte using MASM was
executed and verified successfully.

12. Compare two strings


AIM:
To write an assembly language program to compare two string bytes are equal or not using
8086 assembler MASM.
APPARATUS REQUIRED:
1. PC installed with MASM software.
ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count value in register CX for the number of string bytes to be compared.
3. Initialize registers SI and DI with source and destination data address respectively.
4. Initialize register BX with base address to store the compared results.
5. Compare the string bytes. If equal store “FF” else “00” in memory addressed by register BX.
PROGRAM:
ASSUME CS: CODE, DS: CODE
CODE SEGMENT
ORG 1000H
MOV CX, 0002H
MOV SI, 2000H
MOV DI, 3000H
MOV BX, 3500H
MOV AL, [SI]
CLD
REP SCASB
JNZ LOOP
MOV AH, FFH
MOV [BX], AH
JMP LAST
LOOP: MOV AH, 00H
MOV [BX], AH
LAST: MOV AH, 4CH
INT 21H
CODE ENDS
END
OUTPUT:
-E 2000
2000 00.03 00.04
-G=1000
Program terminated normally
-E 3000
3000 00.03 00.04
-E 3500
3500 00.FF

RESULT:
Thus the assembly language program for comparing two string bytes using MASM
was executed and verified successfully.

13. Sorting in ascending order


AIM:
To write an assembly language program to sort n numbers in ascending and descending
order using 8086 assembler MASM.
APPARATUS REQUIRED:
1. PC installed with MASM software.
(I) SORTING IN ASCENDING ORDER
ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count of an input array in register CL.
3. Compare the first two values in the array. Swap the values if the result produces no carry
else need not. Decrement the count value in register CL.
4. Repeat step 3 for the consecutive array values until the count becomes zero in register CL.
5. The sorted order will be stored in memory locations addressed by register SI.
PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
ORG 1000H
MOV SI,2000H
MOV CL,[SI]
DEC CL
L3:MOV DL,CL
MOV SI,2001H
L2:MOV AX,[SI]
CMP AX,[SI+2]
JC L1
XCHG[SI+2],AX
XCHG[SI],AX
L1:ADD SI,02H
DEC DL
JNZ L2
DEC CL
JNZ L3
HLT
MOV AH,4CH
INT 21H
CODE ENDS
END
OUTPUT:
-E 2000
2000 00.04 00.00 00.06 00.00 00.03 00.00
00.04 00.00 00.08
-G=1000
Program terminated normally
-E 2001
2001 00.00 00.03 00.00 00.04 00.00 00.06
00.00 00.08

14.Sorting in descending order


AIM:
To write an assembly language program to sort n numbers in and descending order using
8086 assembler MASM.
APPARATUS REQUIRED:
1. PC installed with MASM software.

ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count of an input array in register CL.
3. Compare the first two values in the array. Swap the values if the result produces carry else
need not. Decrement the count value in register CL.
4. Repeat step 3 for the consecutive array values until the count becomes zero in register CL.
5. The sorted order will be stored in memory locations addressed by register SI.

PROGRAM:
ASSUME CS:CODE
CODE SEGMENT
ORG 1000H
MOV SI,2000H
MOV CL,[SI]
DEC CL
L3:MOV DL,CL
MOV SI,2001H
L2:MOV AX,[SI]
CMP AX,[SI+2]
JNC L1
XCHG[SI+2],AX
XCHG[SI],AX
L1:ADD SI,02H
DEC DL
JNZ L2
DEC CL
JNZ L3
HLT
MOV AH,4CH
INT 21H
CODE ENDS
END

OUTPUT:
-E 2000
2000 00.04 00.00 00.06 00.00 00.03 00.00
00.04 00.00 00.08
-G=1000
Program terminated normally
-E 2001
2001 00.00 00.08 00.00 00.06 00.00 00.04
00.00 00.03

RESULT:
Thus the assembly language program for sorting n numbers in ascending and
descending order using MASM was executed and verified successfully .
15. Searching a String
AIM:
To write an assembly language program to search an element in an array using 8086
assembler MASM.
APPARATUS REQUIRED:
1. PC installed with MASM software.
ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Load the count value in register CX for the number of string bytes to be searched.
3. Initialize registers SI and DI with source and destination data address respectively.
4. Initialize register BX with base address to store the search results.
5. Search for the string bytes. If found store “FF” else “00” in memory addressed by register
BX.
PROGRAM:
ASSUME CS: CODE, DS: CODE
CODE SEGMENT
ORG 1000H
MOV CX, 0002H
MOV SI, 2000H
MOV DI, 3000H
MOV BX, 3500H
MOV AL, [SI]
CLD
REP SCASB
JNZ LOOP
MOV AH, FFH
MOV [BX], AH
JMP LAST
LOOP: MOV AH, 00H
MOV [BX], AX
LAST: MOV AH, 4CH
INT 21H
CODE ENDS
END
OUTPUT:
-E 2000
2000 00.0A 00.06
-G=1000
Program terminated normally
-E 3000
3000 00.0A 00.06
-E 3500
3500 FF.

RESULT:
Thus the assembly language program for searching an element using MASM was
executed and verified successfully.

16. System password validation

AIM:
To write an assembly language program in order to validate password of a system using
8086 assembler MASM.

APPARATUS REQUIRED:
1. PC installed with MASM software.

ALGORITHM:
1. Initialize the starting address using ORG directive.
2. Initialize data segment for appropriate strings to be displayed.
3. Initialize code segment to read the input string in “*” notation for validation.
4. Compare the string entered for password and saved password in data segment. If equal,
display as “PASSWORD IS CORRECT” else “INCORRECT PASSWORD”
5. Store the result in memory location.

PROGRAM:
DATA SEGMENT
PASSWORD DB 'MASM1234'
LEN EQU ($-PASSWORD)
MSG1 DB 10,13,'ENTER YOUR PASSWORD: $'
MSG2 DB 10,13,'WELCOME TO ELECTRONICS WORLD!!$'
MSG3 DB 10,13,'INCORRECT PASSWORD!$'
NEW DB 10,13,'$'
INST DB 10 DUP(0)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,09H
INT 21H
MOV SI,00
UP1:
MOV AH,08H
INT 21H
CMP AL,0DH
JE DOWN
MOV [INST+SI],AL
MOV DL,'*'
MOV AH,02H
INT 21H
INC SI
JMP UP1
DOWN:
MOV BX,00
MOV CX,LEN
CHECK:
MOV AL,[INST+BX]
MOV DL,[PASSWORD+BX]
CMP AL,DL
JNE FAIL
INC BX
LOOP CHECK
LEA DX,MSG2
MOV AH,09H
INT 21H
JMP FINISH
FAIL:
LEA DX,MSG3
MOV AH,009H
INT 21H
FINISH:
INT 3
CODE ENDS
END START
END

OUTPUT:
ENTER THE PASSWORD

MASM1234

PASSWORD IS CORRECT
RESULT:
Thus the program for validating system passwordusing MASM was executed and
verified successfully.

17. Display System Time

AIM:
To write an assembly language program to display system time using 8086 assembler
MASM.

APPARATUS REQUIRED:
1. PC installed with MASM software.

ALGORITHM:
1. Initialize the register AH with BIOS function to get system date and time.
2. Store the contents of CX (Year), DX (Month/Date), AL (weekday) in memory using any index
or pointer registers.
3. Store thecontents of CX and DX for time in memory locations.
PROGRAM:
.MODEL SMALL
.STACK 100H

.DATA
PROMPT DB 'Current System Time is : $'
TIME DB '00:00:00$' ; time format hr:min:sec

.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX

LEA BX, TIME ; BX=offset address of string TIME

CALL GET_TIME ; call the procedure GET_TIME

LEA DX, PROMPT ; DX=offset address of string PROMPT


MOV AH, 09H ; print the string PROMPT
INT 21H

LEA DX, TIME ; DX=offset address of string TIME


MOV AH, 09H ; print the string TIME
INT 21H

MOV AH, 4CH ; return control to DOS


INT 21H
MAIN ENDP

;**************************************************************************;
;**************************************************************************;
;------------------------- Procedure Definitions ------------------------;
;**************************************************************************;
;**************************************************************************;

;**************************************************************************;
;------------------------------ GET_TIME --------------------------------;
;**************************************************************************;

GET_TIME PROC
; this procedure will get the current system time
; input : BX=offset address of the string TIME
; output : BX=current time

PUSH AX ; PUSH AX onto the STACK


PUSH CX ; PUSH CX onto the STACK

MOV AH, 2CH ; get the current system time


INT 21H

MOV AL, CH ; set AL=CH , CH=hours


CALL CONVERT ; call the procedure CONVERT
MOV [BX], AX ; set [BX]=hr , [BX] is pointing to hr
; in the string TIME

MOV AL, CL ; set AL=CL , CL=minutes


CALL CONVERT ; call the procedure CONVERT
MOV [BX+3], AX ; set [BX+3]=min , [BX] is pointing to min
; in the string TIME

MOV AL, DH ; set AL=DH , DH=seconds


CALL CONVERT ; call the procedure CONVERT
MOV [BX+6], AX ; set [BX+6]=min , [BX] is pointing to sec
; in the string TIME

POP CX ; POP a value from STACK into CX


POP AX ; POP a value from STACK into AX

RET ; return control to the calling procedure


GET_TIME ENDP ; end of procedure GET_TIME

;**************************************************************************;
;------------------------------- CONVERT --------------------------------;
;**************************************************************************;

CONVERT PROC
; this procedure will convert the given binary code into ASCII code
; input : AL=binary code
; output : AX=ASCII code

PUSH DX ; PUSH DX onto the STACK

MOV AH, 0 ; set AH=0


MOV DL, 10 ; set DL=10
DIV DL ; set AX=AX/DL
OR AX, 3030H ; convert the binary code in AX into ASCII

POP DX ; POP a value from STACK into DX

RET ; return control to the calling procedure


CONVERT ENDP ; end of procedure CONVERT
;**************************************************************************;
;--------------------------------------------------------------------------;
;**************************************************************************;

END MAIN

RESULT:
Thus the assembly language program to display system date and time using MASM was
executed and verified successfully.
18.Addition of 16-bit numbers
AIM:
To write an assembly language program to add two 16-bit numbers using 8086 and store
the result in memory.

ALGORITHM:
Initialize the address register.
Get the two numbers to be added from memory and store it in a register pair.
Add the contents of the register pair.
Store the sum and carry in memory locations.

PROGRAM:
data segment
a dw 0202h
b dw 0408h
c dw ?
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov ax,a
mov bx,b
add ax,bx
mov c,ax
int 3
code ends
end start
Output

C:\TASM>masm an16add.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [an16add.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:

50402 + 450254 Bytes symbol space free


0 Warning Errors
0 Severe Errors
C:\TASM>link an16add.obj
Microsoft (R) Overlay Linker Version 3.60
Copyright (C) Microsoft Corp 1983-1987. All rights reserved.
Run File [AN16ADD.EXE]:
List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment

C:\TASM>debug an16add.exe
-g

AX=060A BX=0408 CX=0022 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000


DS=0B97 ES=0B87 SS=0B97 CS=0B98 IP=0011 NV UP EI PL NZ NA PE NC
0B98:0011 CC INT 3
-d 0B97:0000
0B97:0000 02 02 08 04 0A 06 00 00-00 00 00 00 00 00 00 00 ................
0B97:0010 B8 97 0B 8E D8 A1 00 00-8B 1E 02 00 03 C3 A3 04 ................
0B97:0020 00 CC 86 72 FF 77 15 8A-86 70 FF 2A E4 50 B8 FD ...r.w...p.*.P..
0B97:0030 05 50 FF 36 24 21 E8 77-63 83 C4 06 FF 36 24 21 .P.6$!.wc....6$!
0B97:0040 B8 0A 00 50 E8 47 5E 83-C4 04 5E 8B E5 5D C3 90 ...P.G^...^..]..
0B97:0050 55 8B EC 81 EC 84 00 C4-5E 04 26 80 7F 0A 00 74 U.......^.&....t
0B97:0060 3E 8B 46 08 8B 56 0A 89-46 FC 89 56 FE C4 5E FC >.F..V..F..V..^.
0B97:0070 26 8A 47 0C 2A E4 40 50-8B C3 05 0C 00 52 50 E8 &.G.*[email protected].
-q

C:\TASM>

RESULT:
Thus the assembly language program for 16-bit addition using masm was executed
and verified successfully.

19.Subtraction of 16-bit numbers


AIM:
To write an assembly language program to subtract two 16-bit numbers using 8086 and
store the result in memory.

ALGORITHM:
Initialize the address register.
Get the subtrahend and minuend numbers from memory with carry and store it in a register
pair.
Subtract the contents of the register pair.
Store the difference and borrow in memory locations.
PROGRAM:
data segment
a dw 9A88h
b dw 8765h
c dw ?
data ends

code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov ax,a
mov bx,b
sub ax,bx
mov c,ax
int 3
code ends
end start
Output

C:\TASM>masm an16sub.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [an16sub.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:

50402 + 450254 Bytes symbol space free

0 Warning Errors
0 Severe Errors

C:\TASM>link an16sub.obj

Microsoft (R) Overlay Linker Version 3.60


Copyright (C) Microsoft Corp 1983-1987. All rights reserved.

Run File [AN16SUB.EXE]:


List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment

C:\TASM>debug an16sub.exe
-g

AX=1323 BX=8765 CX=0022 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000


DS=0B97 ES=0B87 SS=0B97 CS=0B98 IP=0011 NV UP EI PL NZ NA PO NC
0B98:0011 CC INT 3
-d 0B97:0000
0B97:0000 88 9A 65 87 23 13 00 00-00 00 00 00 00 00 00 00 ..e.#...........
0B97:0010 B8 97 0B 8E D8 A1 00 00-8B 1E 02 00 2B C3 A3 04 ............+...
0B97:0020 00 CC 86 72 FF 77 15 8A-86 70 FF 2A E4 50 B8 FD ...r.w...p.*.P..
0B97:0030 05 50 FF 36 24 21 E8 77-63 83 C4 06 FF 36 24 21 .P.6$!.wc....6$!
0B97:0040 B8 0A 00 50 E8 47 5E 83-C4 04 5E 8B E5 5D C3 90 ...P.G^...^..]..
0B97:0050 55 8B EC 81 EC 84 00 C4-5E 04 26 80 7F 0A 00 74 U.......^.&....t
0B97:0060 3E 8B 46 08 8B 56 0A 89-46 FC 89 56 FE C4 5E FC >.F..V..F..V..^.
0B97:0070 26 8A 47 0C 2A E4 40 50-8B C3 05 0C 00 52 50 E8 &.G.*[email protected].
-q

C:\TASM>

RESULT:
Thus the assembly language program for 16-bit subtraction using masm was
executed and verified successfully.
20.Multiplication of 16-bit numbers
AIM:
To write an assembly language program to multiply two 16-bit numbers using masm.

ALGORITHM:
Initialize the address register.
Load the contents of AX and BX register from SI index register.
Multiply the values of AX and BX.
Store the result in memory location using DI register.

PROGRAM:
data segment
a dw 1234h
b dw 5678h
c dd ?
data ends

code segment
assume ds:data, cs:code
start:
mov ax,data
mov ds,ax
mov ax,a
mov bx,b
mul bx
mov word ptr c,ax
mov word ptr c+2,dx
int 3
code ends
end start
Output
C:\TASM>masm an16mul.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.

Object filename [an16mul.OBJ]:


Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:

50326 + 450330 Bytes symbol space free

0 Warning Errors
0 Severe Errors

C:\TASM>link an16mul.obj

Microsoft (R) Overlay Linker Version 3.60


Copyright (C) Microsoft Corp 1983-1987. All rights reserved.

Run File [AN16MUL.EXE]:


List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment

C:\TASM>debug an16mul.exe
-g

AX=0060 BX=5678 CX=0026 DX=0626 SP=0000 BP=0000 SI=0000 DI=0000


DS=0B97 ES=0B87 SS=0B97 CS=0B98 IP=0015 OV UP EI PL NZ NA PO CY
0B98:0015 CC INT 3
-d 0B97:0000
0B97:0000 34 12 78 56 60 00 26 06-00 00 00 00 00 00 00 00 4.xV`.&.........
0B97:0010 B8 97 0B 8E D8 A1 00 00-8B 1E 02 00 F7 E3 A3 04 ................
0B97:0020 00 89 16 06 00 CC 15 8A-86 70 FF 2A E4 50 B8 FD .........p.*.P..
0B97:0030 05 50 FF 36 24 21 E8 77-63 83 C4 06 FF 36 24 21 .P.6$!.wc....6$!
0B97:0040 B8 0A 00 50 E8 47 5E 83-C4 04 5E 8B E5 5D C3 90 ...P.G^...^..]..
0B97:0050 55 8B EC 81 EC 84 00 C4-5E 04 26 80 7F 0A 00 74 U.......^.&....t
0B97:0060 3E 8B 46 08 8B 56 0A 89-46 FC 89 56 FE C4 5E FC >.F..V..F..V..^.
0B97:0070 26 8A 47 0C 2A E4 40 50-8B C3 05 0C 00 52 50 E8 &.G.*[email protected].
-q

RESULT:
Thus the assembly language program for 16-bit multiplication using masm was
executed and verified successfully.
21.Division of 16-bit numbers
AIM:
To write an assembly language program to divide two 16-bit numbers using 8086 and store
the result in memory.

ALGORITHM:
Initialize the address register.
Load the contents of AX and CX register from SI index register.
Divide the values of AX and CX.
Store the result in memory location.

PROGRAM:
data segment
a dw 4444h
b dw 0002h
c dw ?
data ends

code segment
assume ds:data, cs:code
start:
mov ax,data
mov ds,ax
mov ax,a
mov bx,b
div bx
mov c,ax
int 3
code ends
end start
Output

C:\TASM>masm an16div.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.

Object filename [an16div.OBJ]:


Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:

50402 + 450254 Bytes symbol space free

0 Warning Errors
0 Severe Errors

C:\TASM>link an16div.obj

Microsoft (R) Overlay Linker Version 3.60


Copyright (C) Microsoft Corp 1983-1987. All rights reserved.

Run File [AN16DIV.EXE]:


List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment

C:\TASM>debug an16div.exe
-g

AX=2222 BX=0002 CX=0022 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000


DS=0B97 ES=0B87 SS=0B97 CS=0B98 IP=0011 NV UP EI PL NZ NA PO NC
0B98:0011 CC INT 3
-d 0B97:0000
0B97:0000 44 44 02 00 22 22 00 00-00 00 00 00 00 00 00 00 DD..""..........
0B97:0010 B8 97 0B 8E D8 A1 00 00-8B 1E 02 00 F7 F3 A3 04 ................
0B97:0020 00 CC 86 72 FF 77 15 8A-86 70 FF 2A E4 50 B8 FD ...r.w...p.*.P..
0B97:0030 05 50 FF 36 24 21 E8 77-63 83 C4 06 FF 36 24 21 .P.6$!.wc....6$!
0B97:0040 B8 0A 00 50 E8 47 5E 83-C4 04 5E 8B E5 5D C3 90 ...P.G^...^..]..
0B97:0050 55 8B EC 81 EC 84 00 C4-5E 04 26 80 7F 0A 00 74 U.......^.&....t
0B97:0060 3E 8B 46 08 8B 56 0A 89-46 FC 89 56 FE C4 5E FC >.F..V..F..V..^.
0B97:0070 26 8A 47 0C 2A E4 40 50-8B C3 05 0C 00 52 50 E8 &.G.*[email protected].
-q

C:\TASM>
RESULT:
Thus the assembly language program for 16-bit division using masm was executed
and verified successfully.

You might also like