44 lines
687 B
NASM
44 lines
687 B
NASM
; multi-segment executable file template.
|
|
|
|
data segment
|
|
num1 db 3h
|
|
num2 db 2h
|
|
ris db 0000h
|
|
pkey db "press any key...$"
|
|
ends
|
|
|
|
stack segment
|
|
dw 128 dup(0)
|
|
ends
|
|
|
|
code segment
|
|
start:
|
|
; set segment registers:
|
|
mov ax, data
|
|
mov ds, ax
|
|
mov es, ax
|
|
|
|
; add your code here
|
|
mov ax, 0000h
|
|
mov bx, 0000h
|
|
mov al, num1
|
|
mov bl, num2
|
|
|
|
add al, bl
|
|
|
|
mov ris, al
|
|
|
|
lea dx, pkey
|
|
mov ah, 9
|
|
int 21h ; output string at ds:dx
|
|
|
|
; wait for any key....
|
|
mov ah, 1
|
|
int 21h
|
|
|
|
mov ax, 4c00h ; exit to operating system.
|
|
int 21h
|
|
ends
|
|
|
|
end start ; set entry point and stop the assembler.
|