Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- msg1 db "Digita 10 numeri:$"
- msg2 db 13,10,"I numeri ordinati:$"
- vet db 10 dup (?)
- ;veto db 10 dup (?)
- ;n db ?
- ends
- stack segment
- dw 100h dup(0)
- ends
- code segment
- start:
- ; set segment registers:
- mov ax, data
- mov ds, ax
- mov es, ax
- xor ax,ax
- xor cx,cx
- mov cx,10
- xor si,si
- lea dx,msg1
- mov ah,9
- int 21h
- inserimento:mov ah,1
- int 21h
- mov vet[si],al
- inc si
- loop inserimento
- xor di,di
- xor si,si
- mov cx,9
- lea dx,msg2
- mov ah,9
- int 21h
- ordinamento:mov si,di
- inc si
- for1: cmp si,10
- jnb finefor1
- mov ah,vet[si]
- for2: cmp ah,vet[di]
- jnb finefor2
- mov dh,vet[si]
- mov dl,vet[di]
- mov vet[si],dl
- mov vet[di],dh
- finefor2: nop
- inc si
- jmp for1
- finefor1: nop
- inc di
- loop ordinamento
- xor si,si
- mov cx,10
- stampa: mov ah,2
- mov dl,vet[si]
- int 21h
- inc si
- loop stampa
- jmp esci
- esci: mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment