۲۲-اردیبهشت-۱۳۹۱, ۰۲:۰۳:۱۰
کد:
; multi-segment executable file template.
data segment
; add your data here!
A DW 2345
K DB ?
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
MOV AX,A
MOV CX,4
L1:
MOV BL,10
DIV BL
ADD AH,48
MOV BH, AH
MOV K,AL
MOV AH,02H
LEA DL,BH
INT 21H
MOV AL,K
MOV AH,0
LOOP L1
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.