Carica file su '14-03-22'
This commit is contained in:
parent
8f53522ec4
commit
f6199f7672
|
@ -0,0 +1,56 @@
|
|||
; multi-segment executable file template.
|
||||
|
||||
data segment
|
||||
; add your data here!
|
||||
pkey db "press any key...$"
|
||||
num1 db 02h
|
||||
num2 db 14h
|
||||
ris db 00h
|
||||
count db 05h
|
||||
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, 00h
|
||||
mov bx, 00h
|
||||
mov cx, 00h
|
||||
|
||||
mov al, num1
|
||||
mov bl, num2
|
||||
mov cl, count
|
||||
|
||||
cmp al, 0Ah
|
||||
jg fine
|
||||
|
||||
inizio-ciclo:
|
||||
sub bl, al
|
||||
dec cl
|
||||
cmp cl, 00h
|
||||
je fine
|
||||
jmp inizio-ciclo
|
||||
|
||||
fine:
|
||||
mov ris, bl
|
||||
|
||||
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.
|
Loading…
Reference in New Issue