Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; multi-segment executable file template.
- data segment
- ; add your data here!
- msg db "Inserire il cognome e premi spazio per terminare!",10,13,"$" ;messaggi vari
- accapo db 10,13,"$"
- cognome db 15 dup(?) ;dichiarazione vettore
- pkey db "press any key...$"
- msg1 db "hai inserito il cognome $"
- 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
- lea dx,msg ;metodo x stampare un messaggio
- mov ah,9
- int 21h
- mov si,0
- inserimento:mov ah, 1 ;richiede inserimento di un numero
- int 21h
- cmp al,' ' ;se e' uguale salta a stampa
- je fine_inserimento
- mov cognome[si],al
- inc si ;incrementa il contatore
- jmp inserimento
- fine_inserimento:
- lea dx,msg1
- mov ah,9
- int 21h
- xor bx,bx
- xor dx,dx
- stampa:
- cmp si,0
- je fine
- mov dl,cognome[bx],
- mov ah,2 ;procedura per la stampa del vettore
- int 21h
- dec si
- inc bx
- jmp stampa
- fine:
- 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.
Add Comment
Please, Sign In to add comment