You are on page 1of 3

Example 9.

Write an assembly language program to multiply two 16-bit unsigned numbers to provide a 32-
bit result. Assume that the two numbers are stored in CX and DX. Assume default CODE
SEGMENT set by Debug.

List File:

Microsoft (R) Macro Assembler Version 6.11 11/03/04 16:18:45


ex95.asm Page 1 - 1

0000 CODE_SEG SEGMENT


ASSUME CS:CODE_SEG
0000 8B C2 MOV AX,DX ;Move first data
0002 F7 E1 MUL CX ;[DX][AX]<--[AX]*[CX]
0004 F4 HLT
0005 CODE_SEG ENDS
END
Microsoft (R) Macro Assembler Version 6.11 11/03/04 16:18:45
ex95.asm Symbols 2 - 1

Segments and Groups:

N a m e Size Length Align Combine Class

CODE_SEG . . . . . . . . . . . . 16 Bit 0005 Para Private

0 Warnings
0 Errors
Screen Shots:

Unload program.
View registers.
Change contents of register DX from 0000 to 0005.
View registers to verify change and load new values.
Trace program to verify change and load new values.
Trace program to verify 0005*0005 = 0019H, as shown in AX register.

You might also like