Microsoft (R) Macro Assembler Version 6.11 01/30/98 17:26:47
Simple Adder Page 1 - 1
Title Simple Adder
page 60,132
;************************************************
; A program to add two numbers stored in memory *
;************************************************
0000 stk segment stack
0000 0010 [ dw 16 dup (?) ;memory for stack
0000
]
0020 stk ends
0000 data segment
0000 04 num1 db 4 ;define variables
0001 07 num2 db 7
0002 00 result db ? ;reserve memory for result
0003 data ends
0000 code segment
assume cs:code,ds:data
0000 main proc far
0000 1E push ds ;DOS bookkeeping
0001 2B sub ax,ax
0003 50 push ax
0004 B8 ---- R mov ax,data
0007 8E D8 mov ds,ax
;Program really starts here!!!
0009 A0 0000 R mov al,num1 ;get first number
000C 02 06 0001 R add al,num2 ;add second number
0010 A2 0002 R mov result,al ;store result
0013 CB ret ;return to DOS
0014 main endp
0014 code ends
end main
Simple Adder Symbols 2 - 1
Segments and Groups:
N a m e Size Length Align Combine Class
code . . . . . . . . . . . . . . 16 Bit 0014 Para Private
data . . . . . . . . . . . . . . 16 Bit 0003 Para Private
stk . . . . . . . . . . . . . . 16 Bit 0020 Para Stack
Simple Adder Symbols 3 - 1
Procedures, parameters and locals:
N a m e Type Value Attr
main . . . . . . . . . . . . . . P Far 0000 code Length= 0014 Public
Simple Adder Symbols 4 - 1
Symbols:
N a m e Type Value Attr
num1 . . . . . . . . . . . . . . Byte 0000 data
num2 . . . . . . . . . . . . . . Byte 0001 data
result . . . . . . . . . . . . . Byte 0002 data
0 Warnings
0 Errors