Guest User

Untitled

a guest
Jun 10th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. include 'emu8086.inc'
  2. data segment
  3.  
  4. user db 5 dup(0)
  5. pass db 8 dup(0)
  6. cuser db "ciao",0
  7. cpass db "ciao123",0
  8.  
  9. ends
  10.  
  11. stack segment
  12.  
  13. dw 128 dup(?)
  14.  
  15. ends
  16.  
  17.  
  18. code segment
  19.  
  20. start:
  21.  
  22. mov ax,data
  23. mov ds,ax
  24. mov es,ax
  25.  
  26. call inserimento
  27. call controllo
  28.  
  29. exit:
  30. mov ax,4c00h
  31. int 21h
  32. ends
  33.  
  34. DEFINE_PTHIS
  35.  
  36. inserimento proc
  37.  
  38. mov bx,0
  39. mov cx,0
  40.  
  41. call pthis
  42. db 13,10,"Inserisci l'username: ",0
  43.  
  44. mov cx,5
  45.  
  46. insert:
  47.  
  48. cmp bx,cx
  49. je fine
  50.  
  51. mov ah,1
  52. int 21h
  53.  
  54. mov user[bx],al
  55. inc bx
  56. jmp insert
  57.  
  58. fine:
  59. call pthis
  60. db 13,10,"Inserisci la password: ",0
  61.  
  62. mov cx,8
  63. mov bx,0
  64.  
  65. insert2:
  66.  
  67. cmp bx,cx
  68. je fine2
  69.  
  70. mov ah,7
  71. int 21h
  72.  
  73. mov pass[bx],al
  74. inc bx
  75.  
  76. mov ah,2
  77. mov dl,'*'
  78. int 21h
  79.  
  80. jmp insert2
  81.  
  82. fine2:
  83. ret
  84. inserimento endp
  85.  
  86. controllo proc
  87.  
  88. mov bx,0
  89. mov ax,0
  90. mov cx,0
  91.  
  92. ciclo_user:
  93.  
  94. cmp bx,5
  95. je ciclo_f
  96.  
  97. mov al,user[bx]
  98. mov cl,cuser[bx]
  99. inc bx
  100. cmp al,cl
  101. je ciclo_user
  102.  
  103. call messaggio2
  104. jmp exit
  105.  
  106. ciclo_f:
  107.  
  108. mov bx,0
  109. mov ax,0
  110. mov cx,0
  111.  
  112. ciclo_pass:
  113.  
  114. cmp bx,8
  115. je msg2
  116.  
  117. mov al,pass[bx]
  118. mov cl,cpass[bx]
  119. inc bx
  120. cmp al,cl
  121. je ciclo_pass
  122.  
  123. call messaggio2
  124. jmp exit
  125.  
  126. msg2:
  127. call messaggio1
  128.  
  129. ret
  130. controllo endp
  131.  
  132. messaggio1 proc
  133.  
  134. call pthis
  135. db 13,10,'Benvenuto Pirla!',0
  136.  
  137. ret
  138. messaggio1 endp
  139.  
  140. messaggio2 proc
  141.  
  142. call pthis
  143. db 13,10,'Username o password errati!',0
  144.  
  145. ret
  146. messaggio2 endp
  147.  
  148. end start
Add Comment
Please, Sign In to add comment