Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model tiny                    
  2. .stack 256                      
  3.                                
  4. .DATA                          
  5.         ifEqual DB 'txt $', 10, 13
  6.         spelniony DB  ' Warunek zostal spelniony $', 10, 13
  7.         koniec DB 'Koniec programu$', 10, 13
  8. .CODE                                      
  9.                                            
  10. main PROC                                  
  11.         MOV ax, @data                      
  12.         MOV ds, ax                        
  13.                                            
  14.         MOV AX, 3 ;CZYSZCZENIE EKRANU AR  
  15.         INT 10h                            
  16.                                            
  17.         MOV AH, 7 ;WCZYTAJ DANEJ Z KLAWIATURY w rejestrze AL
  18.         INT 21h                            
  19.                                            
  20.         MOV AH,2 ;WWYSWIETLA ZAPISANA LICZBE AL
  21.         MOV DL,AL                          
  22.         INT 21h                            
  23.                                            
  24.                                            
  25.         sub AL, 48                        
  26.                                            
  27.         MOV CL,al                          
  28.         Petla:                            
  29.                                            
  30.                 cmp CL,3                  
  31.                 je tosamo              
  32.                 mov dl, 'x'                
  33.                 int 21h                    
  34.                                            
  35.         DEC CL                            
  36.         cmp CL,0                          
  37.         je zakonczenie                        
  38.         JNZ Petla                          
  39.                                            
  40.                                            
  41.         mov ah,7                          
  42.         int 21h                            
  43.                                            
  44.         mov AL, 0H                        
  45.         mov AH,4Ch                        
  46.         int 21h                            
  47.                                            
  48.         tosamo:                        
  49.         lea dx, spelniony                      
  50.         mov ah,09h                        
  51.         int 21h                            
  52.                                            
  53.         mov ah,7                          
  54.         int 21h                            
  55.         mov ax, 4C00h                      
  56.         int 21h                            
  57.                                            
  58.         zakonczenie:    
  59.         lea dx,koniec
  60.         mov ah,09h
  61.         int 21h  
  62.                  
  63.         mov ah,7
  64.         int 21h  
  65.                  
  66.         mov ax, 4C00h
  67.         int 21h            
  68.                              
  69. main ENDP                    
  70. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement