Advertisement
NB52053

Ass lab#4.2

Jul 7th, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. Star(Modified)
  2.  
  3.  
  4. org 100h
  5. .stack 100h
  6. .data
  7.  
  8. str db "*$"
  9. star db 0
  10. starcount db 5
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. .code
  18. main proc
  19.  
  20.  
  21.     mov dx, @data
  22.     mov ds, dx
  23.                
  24.     mov star,0 ; star=0      ; initialize with 0
  25.    
  26.    
  27.    
  28.     condline:
  29.    
  30.        
  31.    
  32.    
  33.    
  34.    
  35.    
  36.     iterline:
  37.    
  38.         ;starcount = linecount - line
  39.        
  40.         mov al, linecount
  41.         sub al, line
  42.         mov starcount, al
  43.    
  44.    
  45.    
  46.    
  47.    
  48.    
  49.    
  50.    
  51.    
  52.    
  53.    
  54.     condstar:
  55.        
  56.         mov bl, starcount     ; move to register for compare so, (bl = 5) now.
  57.         cmp star, bl          ; star < starcount  | compare 0 < 5  
  58.         jl itestar            ; jump less
  59.         jmp exitstar
  60.        
  61.    
  62.    
  63.      itestar:
  64.      
  65.         lea dx, str
  66.         mov ah, 9
  67.         int 21h
  68.        
  69.         inc star     ;star ++
  70.         jmp condstar
  71.                            
  72.      
  73.      
  74.      exitstar:
  75.         lex dx, nl
  76.         mov ah,9
  77.         int 21h
  78.        
  79.       inc line
  80.       jmp condline
  81.        
  82.      
  83.      exitline:  
  84.  
  85.  
  86. endp main
  87. end main
  88.  
  89. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement