Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- include 'emu8086.inc'
- data segment
- ; add your data here!
- array db 100 dup(?)
- dim db ?
- n db ?
- min db ?
- a_capo db 13,10,'$'
- 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
- call pthis
- db "inserisci dimensione array ",0
- call scan_num
- lea dx,a_capo
- mov ah,9
- int 21h
- call pthis
- db "inserisci elementi array ",0
- lea dx,a_capo
- mov ah,9
- int 21h
- call inserisci
- lea dx,a_capo
- mov ah,9
- int 21h
- call pthis
- db "gli elementi dell'array sono: ",0
- lea dx,a_capo
- mov ah,9
- int 21h
- call visualizza
- lea dx,a_capo
- mov ah,9
- int 21h
- call pthis
- db "calcolo minimo o massimo",0
- lea dx,a_capo
- mov ah,9
- int 21h
- call pthis
- db "immettere m per minimo oppure M per massimo ",0
- call inserisci2
- lea dx,a_capo
- mov ah,9
- int 21h
- ; wait for any key....
- mov ah, 1
- int 21h
- mov ax, 4c00h ; exit to operating system.
- int 21h
- ends
- inserisci proc
- mov bl,0
- mov ah,1
- int 21h
- mov array[bl],al
- inc bl
- cmp bl,dim
- jne ins
- ret
- inserisci endp
- visualizza proc
- xor si,si
- xor cx,cx
- visual:
- mov cl,array[si]
- mov ah,2
- mov dl,cl
- int 21h
- inc si
- cmp si,
- jne visual
- fine:
- ret
- visualizza endp
- inserisci2 proc
- mov ah,1
- int 21h
- mov n,'0'
- ret
- inserisci2 endp
- define_pthis
- define_scan_num
- end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment