Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include 'emu8086.inc'
- data segment
- user db 5 dup(0)
- pass db 8 dup(0)
- cuser db "ciao",0
- cpass db "ciao123",0
- ends
- stack segment
- dw 128 dup(?)
- ends
- code segment
- start:
- mov ax,data
- mov ds,ax
- mov es,ax
- call inserimento
- call controllo
- exit:
- mov ax,4c00h
- int 21h
- ends
- DEFINE_PTHIS
- inserimento proc
- mov bx,0
- mov cx,0
- call pthis
- db 13,10,"Inserisci l'username: ",0
- mov cx,5
- insert:
- cmp bx,cx
- je fine
- mov ah,1
- int 21h
- mov user[bx],al
- inc bx
- jmp insert
- fine:
- call pthis
- db 13,10,"Inserisci la password: ",0
- mov cx,8
- mov bx,0
- insert2:
- cmp bx,cx
- je fine2
- mov ah,7
- int 21h
- mov pass[bx],al
- inc bx
- mov ah,2
- mov dl,'*'
- int 21h
- jmp insert2
- fine2:
- ret
- inserimento endp
- controllo proc
- mov bx,0
- mov ax,0
- mov cx,0
- ciclo_user:
- cmp bx,5
- je ciclo_f
- mov al,user[bx]
- mov cl,cuser[bx]
- inc bx
- cmp al,cl
- je ciclo_user
- call messaggio2
- jmp exit
- ciclo_f:
- mov bx,0
- mov ax,0
- mov cx,0
- ciclo_pass:
- cmp bx,8
- je msg2
- mov al,pass[bx]
- mov cl,cpass[bx]
- inc bx
- cmp al,cl
- je ciclo_pass
- call messaggio2
- jmp exit
- msg2:
- call messaggio1
- ret
- controllo endp
- messaggio1 proc
- call pthis
- db 13,10,'Benvenuto Pirla!',0
- ret
- messaggio1 endp
- messaggio2 proc
- call pthis
- db 13,10,'Username o password errati!',0
- ret
- messaggio2 endp
- end start
Add Comment
Please, Sign In to add comment