----------------------------------------------------------------------------------------------
1) Write a program
to sort series of 10 numbers in ascending order.
----------------------------------------------------------------------------------------------
ASSUME CS: CODE, DS: DATA
DATA
SEGMENT
STR1 DB 0A0H, 32H, 90H, 80H, 70H, 60H, 50H,
40H, 30H, 20H
DATA ENDS
CODE
SEGMENT
START
: MOV AX,DATA
MOV DS, AX
MOV CX, 0009H
Skip
: MOV DX,0009H
LEA SI, STR1
UP
: MOV AL, [SI]
INC SI
CMP AL, [SI]
JC Back
XCHG AL, [SI]
DEC SI
MOV [SI], AL
INC SI
Back
: DEC DX
JNZ UP
LOOP Skip
INT 03
CODE
ENDS
END
START
----------------------------------------------------------------------------------------------
2) Write a program to sort series of 10 numbers in descending order.
----------------------------------------------------------------------------------------------
ASSUME CS: CODE, DS: DATA
DATA
SEGMENT
STR1 DB 0A0H, 32H, 90H, 80H, 70H, 60H, 50H,
40H, 30H, 20H
DATA ENDS
CODE
SEGMENT
START
: MOV AX,DATA
MOV DS, AX
MOV CX, 0009H
Skip
: MOV DX,0009H
LEA SI, STR1
UP
: MOV AL, [SI]
INC SI
CMP AL, [SI]
JNC Back
XCHG AL, [SI]
DEC SI
MOV [SI], AL
INC SI
Back
: DEC DX
JNZ UP
LOOP Skip
INT 03
CODE
ENDS
END
START
----------------------------------------------------------------------------------------------
3) MULTIPLICATION OF TWO 32-BIT NOS.
----------------------------------------------------------------------------------------------
ASSUME CS:CODE,DS:DATA
DATA SEGMENT
MULD DW 1234H, 1234H
MULR DW 4321H, 4321H
RES DW 04H DUP(?)
DATA ENDS
CODE SEGMENT
START: MOV
AX,DATA
MOV DS,AX
MOV AX, MULD
MUL MULR
MOV RES,AX
MOV RES+2,DX
MOV AX, MULD+2
MUL MULR
ADD RES+2,AX
ADC RES+4, DX
MOV AX, MULD
MUL MULR+2
ADD RES+2,AX
ADC RES+4,DX
JNC SKIP
INC RES+6
SKIP:
MOV AX,MULD+2
MUL MULR+2
ADD RES+4,AX
ADC RES+6,DX
INT 03H
CODE ENDS
END START
----------------------------------------------------------------------------------------------
4) Write
a program to find highest number in a series of ten numbers.
----------------------------------------------------------------------------------------------
Assume CS: Code, DS: Data
Data
segment
A DB
00H,01H,02H,03H,04H,05H,06H,07H,08H,09H
B DB ?
Data ENDS
Code
segment
START: MOV AX, Data
MOV
DS, AX
MOV
BX, 0000H
MOV
CL, 0AH
LEA
SI, A
MOV
BL, [SI]
skip: INC SI
CMP BL, [SI]
JNC down
MOV
BL, [SI]
down: DEC CL
JNZ skip
MOV B, BL
INT 3
Code
ENDS
END START
----------------------------------------------------------------------------------
5) To determine whether
string is palindrome or not
---------------------------------------------------------------------------------
DATA SEGMENT
MSG1 DB 0AH,0DH,'ENTER THE STRING:$'
MSG2 DB 0AH,0DH,'THE STRING IS
PALINDROME:$'
MSG3 DB 0AH,0DH,'THE STRING IS NOT
PALINDROME:$'
INST DB 20 DUP (0)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV
AX,DATA
MOV
DS,AX
MOV
AH,09H
LEA
DX,MSG1
INT
21H
MOV
BX,0000H
UP: MOV
AH,01H
INT
21H
CMP
AL,0DH
JZ
DOWN
MOV
[INST+BX],AL
INC
BX
JMP
UP
DOWN: MOV
DI,0000H
DEC
BX
CHECK: MOV
AL,[INST+BX]
CMP
AL,[INST+DI]
JNE
FAIL
INC
DI
DEC
BX
JNZ
CHECK
JMP
FINISH
FAIL: MOV
AH,09H
LEA
DX,MSG3
INT
21H
JMP
TER
FINISH: MOV AH,09H
LEA
DX,MSG2
INT
21H
TER: MOV
AH,4CH
INT
21H
CODE ENDS
END START
---------------------------------------------------------------------------------
Thanks to Rahul Setpal..
---------------------------------------------------------------------------------
6) Reverse of String
---------------------------------------------------------------------------------
MODEL
SMALL
.DATA
MSG1 DB
0AH,0DH,'ENTER THE STRING $'
MSG2 DB
0AH,0DH,'THE REVERSE IS $'
A DW
0000H
.CODE
START: MOV AX,@DATA
MOV DS,AX
LEA SI,A
MOV AH,09H
LEA DX,MSG1
INT 21H
MOV CX,0000H
UP: MOV AH,01H
INT 21H
MOV [SI],AL
INC SI
INC CX
CMP AL,'$'
JNZ UP
MOV AH,09H
LEA DX,MSG2
INT 21H
DEC SI
UP1: MOV DL,[SI]
MOV AH,02H
INT 21H
DEC SI
DEC CX
JNZ UP1
INT 03H
.EXIT
END
START
-------------------------------------------------
7) Signed Multiplication
-------------------------------------------------
assume CS:code, DS:data
data segment
A DW 0010h
B DW 0009h
R1 DW 0000h
R2 DW 0000h
data ends
code segment
START: MOV AX,data
MOV DS,AX
MOV DX,0000h
MOV AX,A
MOV BX,B
NEG BX
IMUL BX
MOV R2,AX
MOV R1,DX
INT 3
code ends
end START
-----------------------------------------------
8) Signed Division
-----------------------------------------------
assume CS:code,
DS:data
data segment
A DW 0010h
B DW 0009h
R1 DW 0000h
R2 DW 0000h
data ends
code segment
START: MOV AX,data
MOV DS,AX
MOV DX,0000h
MOV AX,A
MOV BX,B
NEG BX
IDIV BX
MOV R2,AX
MOV R1,DX
INT 3
code ends
end START
-------------------------------------------------------------------------------------------------------
9) TO TAKE A STRING FROM USER ,FIND ITS LENGTH AND
REVERSE THE STRING
------------------------------------------------------------------------------------------------------
ASSUME DS:DATA,CS:CODE
DATA SEGMENT
CR
EQU 13D ; EQU defines constant, CR
and LF are constants
LF
EQU 10D ; CARRIAGE RETURN and LINE
FEED initialize with
LEN
DB CR,LF,'THE LENGTH OF STRING IS->$'
; ASCII value
REV
DB CR,LF,'REVERSE OF YOUR STRING->$'
INPUT
DB 'ENTER A STRING->$'
DATA ENDS
CODE SEGMENT
START: MOV AX,DATA ; Initialize DATA SEGMENT
MOV
DS,AX
MOV
CX,0000H
MOV
DX,OFFSET INPUT ; Print the INPUT message
MOV
AH,09H
INT
21H
LEA
DI,INPUT+01H
BACK: MOV AH,01H ; Take the STRING from user and STORE it
MOV
[DI],AL
INC
DI
INT
21H
INC
CX
CMP
AL,13D
JNZ
BACK
MOV
AH,09H ; Print the LEN message
LEA
DX,LEN
INT
21H
DEC
CL ; Print the LENGTH of
string less than or equal to
MOV
BX,CX ; 09H
CMP
CL,0AH
JGE
SKIP
MOV
BX,CX
ADD
BL,30H
MOV
AH,02H
MOV
DL,BL
INT
21H
JMP SKIP1
SKIP: MOV BL,CL ; CONVERT
the COUNT in BCD format
MOV
AL,00H
BACK0: ADD AL,01H
DAA
DEC
BL
JNZ
BACK0
MOV
BL,AL ; Print the Length of string greater
than 09H
ROL
AL,01H
ROL
AL,01H
ROL
AL,01H
ROL
AL,01H
AND
AL,0FH
ADD
AL,30H
MOV
AH,02H
MOV
DL,AL
INT
21H
AND
BL,0FH
ADD
BL,30H
MOV
AH,02H
MOV
DL,BL
INT
21H
SKIP1: MOV AH,09H ; Print
the REV message
MOV
DX,OFFSET REV
INT
21H
MOV
DI,OFFSET INPUT+01H ; Print the REVERSE STRING
MOV
BX,CX
MOV
AH,02H
BACK1: MOV DL,[BX+DI]
INT
21H
DEC
BX
JNZ
BACK1
MOV
AH,01H ; HOLD
the O/P SCREEN
INT
21H
INT
03H
CODE ENDS
END START
---------------------------------------------------------------------------------
Thanks to Rahul Setpal..
---------------------------------------------------------------------------------
1
Basic Assembler Directives(Pseudo Codes)
Used in Programming
1) ASSUME
Assume CS: CODE, DS: DATA
It
is used to inform the complier that
CS (CODE SEGMENT) contains the CODE
and
DS (DATA SEGMENT) contains DATA
*****The
above Directive can also be written as:
(***Not
Recommended as STD. Coding***)
Assume CS: DATA, DS: CODE
Here
CODE is written in DATA
SEGMENT and DATA in CODE SEGMENT
---------------------------------------------------------------------------------
SOFTWARE INTERRUPTS
1) INT 03H
INT 03H (3) Breakpoint
INT
3 is the breakpoint interrupt.
Debuggers
use this interrupt to establish breakpoints in a program that is being
debugged.
This
is normally done by substituting an INT 3 instruction, which is one byte
long, for a byte
in
the actual program. The original byte from the program is restored by the
debugger after
it
receives control through INT
3
.
Macros and Procedure
1) MACRO
Definition of the macro
A
macro is a group of repetitive instructions in a program which are coded only
once
and
can be used as many times as necessary.
The
main difference between a macro and a procedure is that in the macro the
passage
of
parameters is possible and in the procedure it is not, this is only applicable
for the
TASM
- there are other programming languages which do allow it. At the moment the
macro
is executed each parameter is substituted by the name or value specified at the
time
of the call.
---------------------------------------------------------------------------------
PROGRAMS
---------------------------------------------------------------------------------
1) Write an ALP to add two 16 bits numbers,
the operands and the result
must be defined in the data segment.
PROGRAM:
ASSUME
CS: CODE, DS: DATA
DATA
SEGMENT
A
DW 9384H
B
DW 1845H
SUM
DW ?
CARRY
DB 00H
DATA
ENDS
CODE
SEGMENT
START:
MOV AX, DATA
MOV
DS, AX
MOV
AX, A
ADD
AX, B
JNC
SKIP
INC
CARRY
SKIP:
MOV SUM, AX
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
2) Write an ALP to add two 16 bit BCD
numbers.
PROGRAM:
ASSUME
CS: CODE, DS: DATA
DATA
SEGMENT
A
DW 9384H
B
DW 1845H
SUM
DW ?
CARRY
DB 00H
DATA
ENDS
CODE
SEGMENT
START:MOV
AX, DATA
MOV
DS, AX
MOV
AX, A
MOV
BX, B
ADD
AL, BL
DAA
MOV
CL, AL
MOV
AL, AH
ADC
AL, BH
DAA
MOV
CH, AL
JNC
SKIP
INC
CARRY
SKIP:
MOV SUM, CX
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
3) Write an ALP to sort the nos. in
ascending order.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 0FFH,70H,90H,60H,0FEH,20H,10H,13H,25H,00H
DATA
ENDS
CODE
SEGMENT
START
: MOV AX,DATA
MOV
DS,AX
MOV
CX,0009H
BACK:
MOV DX,0009H
LEA
SI,A
BACK1:
MOV AL,[SI]
INC
SI
CMP
AL,[SI]
JC
SKIP
XCHG
AL,[SI]
DEC
SI
MOV
[SI],AL
INC
SI
SKIP:
DEC DX
JNZ
BACK1
LOOP
BACK
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
4)
Write an ALP to sort
the nos. in descending order.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 0FFH,70H,90H,60H,0FEH,20H,10H,13H,25H,00H
DATA
ENDS
CODE
SEGMENT
START
: MOV AX,DATA
MOV
DS,AX
MOV
CX,0009H
BACK:
MOV DX,0009H
LEA
SI,A
BACK1:
MOV AL,[SI]
INC
SI
CMP
AL,[SI]
JNC
SKIP
XCHG
AL,[SI]
DEC
SI
MOV
[SI],AL
INC
SI
SKIP:
DEC DX
JNZ
BACK1
LOOP
BACK
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
5)
Write an ALP to find
the largest of 10 nos.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 10H,50H,40H,20H,80H,00H,00FFH,30H,60H,00FEH
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
LEA
SI,A
MOV
BH,00H
MOV
CX,000AH
BACK:
CMP BH,[SI]
JNC
SKIP
MOV
BH,[SI]
SKIP:
INC SI
LOOP
BACK
MOV
[SI],BH
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
6) Write an ALP to find the smallest of 10
nos.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 10H,50H,40H,20H,80H,01H,00FFH,30H,60H,00FEH
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
LEA
SI,A
MOV
BH,[SI]
MOV
CX,0009H
BACK:
INC SI
CMP
BH,[SI]
JC
SKIP
MOV
BH,[SI]
SKIP:
LOOP BACK
INC
SI
MOV
[SI],BH
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
7) Write an ALP to find the number of even
and odd numbers in a series of
10 numbers.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 10H,15H,25H,16H,17H,19H,23H,77H,47H,34H
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
LEA
SI,A
MOV
BX,0000H
MOV
CX,000AH
BACK:
MOV AL,[SI]
ROR
AL,1
JC
ODD
INC
BL
JMP
NEXT
ODD:
INC BH
NEXT:
INC SI
LOOP
BACK
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
8) Write an ALP to find positive, negative and zeros in a
series of 10 numbers.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 50H,41H,30H,00H,80H,90H,00FFH,00H,00H,70H
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
MOV
BX,0000H
LEA
SI,A
MOV
CX,000AH
BACK:
MOV AL,[SI]
CMP
AL,00H
JZ
ZERO
ROL
AL,1
JC
NEGAT
INC
DL
JMP
SKIP
ZERO:
INC BX
JMP
SKIP
NEGAT:
INC DH
SKIP:
INC SI
LOOP
BACK
INT
03H
CODE
ENDS
END
START
---------------------------------------------------------------------------------
9) Write an ALP to take a string from user,
find its length and reverse the
string.
PROGRAM:
ASSUME
DS:DATA,CS:CODE
DATA
SEGMENT
CR
EQU 13D ; EQU defines constant, CR and LF are constants
LF
EQU 10D ; CARRIAGE RETURN and LINE FEED initialize with
;
ASCII VALUES
ER
DB CR,LF,'NO STRING ENTERED PRESS ANY KEY TO EXIT........$'
LEN
DB CR,LF,'THE LENGTH OF STRING IS->$'
REV
DB CR,LF,'REVERSE OF YOUR STRING->$'
INPUT
DB 'ENTER A STRING->$'
TEMP
DB 00FFH DUP (?)
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA ; Initialize DATA SEGMENT
MOV
DS,AX
MOV
AL,03H ; CLEAR the DOS SCREEN
MOV
AH,0
INT
10H
MOV
CX,0000H ; CLEAR the COUNT reg.
MOV
DX,OFFSET INPUT ; Print the INPUT message
MOV
AH,09H
INT
21H
LEA
DI,TEMP ; CHECKING whether STRING is
MOV
AH,01H ; PROVIDED
MOV
[DI],AL
INC
CX
INC
DI
INT
21H
CMP
AL,13D
JE
EXIT
BACK:
MOV AH,01H ; KEEP ON taking CHARACTERS
MOV
[DI],AL ; until press ENTER
INT
21H
INC
DI
INC
CX
CMP
AL,13D
JNZ
BACK
18
MOV
AH,09H ; Print the LEN message
LEA
DX,LEN
INT
21H
DEC
CL
CMP
CL,64H ; CHECK for STRING LENGTH greater
;
than 100D (64H)
PUSHF
; CLEAR the OVERFLOW flag
POP
BX
AND
BH,00F7H
PUSH
BX
POPF
JGE
PRINT1
MOV
BX,CX
CMP
CL,0AH ; CHECK for STRING LENGTH greater
JGE
SKIP ; than 10D (0AH)
MOV
BX,CX
ADD
BL,30H
MOV
AH,02H ; PRINT the LENGTH for SINGLE
MOV
DL,BL ; DIGIT (FROM 1-9)
INT
21H
JMP
SKIP1
PRINT1:MOV
AH,02H ; PRINT 1 as MSB when length is greater
;
than 99D
MOV
DL,31H
INT
21H
SKIP:
MOV BL,CL ; CONVERT the COUNT in BCD format
;
for 2-DIGIT
MOV
AL,00H ; COUNT
BACK0:
ADD AL,01H
DAA
DEC
BL
JNZ
BACK0
MOV
BL,AL
ROL
AL,01H ; MASK the LOWER NIBBLE & PRINT
ROL
AL,01H
ROL
AL,01H
ROL
AL,01H
AND
AL,0FH
ADD
AL,30H
MOV
AH,02H
MOV
DL,AL
INT
21H
AND
BL,0FH ; MASK the UPPER NIBBLE & PRINT
ADD
BL,30H
MOV
AH,02H
MOV
DL,BL
INT
21H
SKIP1:
MOV AH,09H ; Print the REV message
MOV
DX,OFFSET REV
INT
21H
MOV
DI,OFFSET TEMP ; Print the REVERSE STRING
MOV
BX,CX
MOV
AH,02H
BACK1:
MOV DL,[BX+DI]
INT
21H
DEC
BX
JNZ
BACK1
JMP
LAST
EXIT:
MOV AH,09H ; PRINT the ERROR message
;
when no string is given
LEA
DX,ER
INT
21H
LAST:
MOV AH,01H ; HOLD the O/P SCREEN
INT
21H
INT
03H
CODE
ENDS
END
START
(This
Program can give a maximum count of C7H i.e199D)
---------------------------------------------------------------------------------
10) Write an ALP to take a string from user
and find its length.
PROGRAM:
ASSUME
CS:CODE , DS:DATA
DATA
SEGMENT
CR
EQU 0DH
LF
EQU 0AH
LEN
DB 04 DUP(0)
MSG1
DB CR,LF,'ENTER THE STRING=','$'
MSG2
DB CR,LF,'THE LENGTH OF STRING=','$'
DATA
ENDS
DISP
MACRO MSG
MOV
AH,09H
MOV
DX,OFFSET MSG
INT
21H
ENDM
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
DISP
MSG1
MOV
CX,00H
READ:
MOV AH,01H
INT
21H
CMP
AL,CR
JZ
AHEAD
INC
CX
JMP
READ
AHEAD:
DISP MSG2
MOV
AX,CX
CALL
HEX2ASC
MOV
BX,AX
MOV
DL,BH
MOV
AH,02H
INT
21H
MOV
DL,BL
MOV
AH,02H
INT
21H
MOV
AH,4CH
INT
21H
HEX2ASC
PROC NEAR
MOV
BL,01H
MUL
BL
AAM
OR
AX,3030H
RET
HEX2ASC
ENDP
CODE
ENDS
END
START
(This
Program can give a Maximum count of 63H i.e. 99D)
---------------------------------------------------------------------------------
11) Write an ALP to check whether the string
is Palindrome or Not.
(Programmer defined Input)
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
A
DB 'M','A','D','A','M'
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
MOV
CH,00H
LEA
SI,A
LEA
DI,A+04H
MOV
CL,02H
BACK:
MOV AH,[SI]
MOV
BH,[DI]
CMP
AH,BH
JNZ
SKIP
INC
SI
DEC
DI
DEC
CL
JNZ
BACK
INC
CH
SKIP:
INT 03H
CODE
ENDS
END
START
(After
execution CH=01H indicates string is palindrome, CH=00H indicates not a
palindrome.
Comparison is done Length of string divided by 02H )
---------------------------------------------------------------------------------
12) Write an ALP to check whether the string
is Palindrome or Not.
(User defined Input)
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
ER
DB 13D,10D,'"INVALID INPUT"......PLS TRY AGAIN!!!! $'
A
DB 13D,10D, 'THE ENTERED STRING IS PALINDROME$'
B
DB 13D,10D,'THE ENTERED STRING IS NOT A PALINDROME$'
INPUT
DB 'ENTER A STRING->$'
TEMP
DB 00FFH DUP (?)
DATA
ENDS
DSPLY
MACRO MSG ; MACRO function for DISPLAY
MOV
AH,09H
LEA
DX,MSG
INT
21H
ENDM
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
MOV
AL,03H ; CLEAR the DOS Screen
MOV
AH,0
INT
10H
STRT:
MOV CX,0000H
DSPLY
INPUT ; PRINT INPUT msg
LEA
SI,TEMP
MOV
AH,01H
MOV
[SI],AL
INT
21H
INC
CX
INC
SI
CMP
AL,13D ; CHECK whether STRING PROVIDED
JNE
BACK
DSPLY
ER ; PRINT ERROR msg on SCREEN
MOV
AH,02H ; LINE FEED and CARRIAGE RETURN
MOV
DL,13D
INT
21H
MOV
AH,02H
MOV
DL,10D
INT
21H
JMP
STRT
BACK:
MOV AH,01H ; TAKE INPUT from user and STORE
MOV
[SI],AL
INT
21H
INC
SI
INC
CX
CMP
AL,13D
JNZ
BACK
DEC
CX
MOV
BX,CX
CALL
COUNT ; CALL sub-routine to CALCULATE
NO. of
LEA
SI,TEMP ; COMPARISION
INC
SI
LEA
DI,TEMP
ADD
DI,BX
BACK1:
MOV AH,[SI]
MOV
DH,[DI]
CMP
AH,DH
JNZ
SKIP
INC
SI
DEC
DI
DEC
CL
JZ
BACK1
DSPLY
A
JMP
EXIT
SKIP:
DSPLY B
EXIT:
MOV AH,01H
INT
21H
INT
03H
COUNT
PROC NEAR ; CALCULATE NO. OF
COMPARISION
MOV
AX,CX
MOV
CL,02H
DIV
CL
MOV
CL,AL
RET
COUNT
ENDP
CODE
ENDS
END
START
******************
If
enter is given as first character it will show an error------------
“INVALID INPUT”…..PLS TRY AGAIN
And
in next line will again ask for Input
**********************
---------------------------------------------------------------------------------
13) Write an ALP for MULTIPLICATION OF TWO
32-BIT NOS.
PROGRAM:
ASSUME
CS:CODE,DS:DATA
DATA
SEGMENT
MULD
DW 1234H, 1234H
MULR
DW 4321H, 4321H
RES
DW 04H DUP(?)
DATA
ENDS
CODE
SEGMENT
START:
MOV AX,DATA
MOV
DS,AX
MOV
AX, MULD
MUL
MULR
MOV
RES,AX
MOV
RES+2,DX
MOV
AX, MULD+2
MUL
MULR
ADD
RES+2,AX
ADC
RES+4, DX
MOV
AX, MULD
MUL
MULR+2
ADD
RES+2,AX
ADC
RES+4,DX
JNC
SKIP
INC
RES+6
SKIP:
MOV AX,MULD+2
MUL
MULR+2
ADD
RES+4,AX
ADC
RES+6,DX
INT
03H
CODE
ENDS
END START
--------------------------------------------------------------------------------------------
No comments:
Post a Comment