Advertisement
Guest User

Untitled

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