Advertisement
NB52053

Ass lab#4 star print

Jul 7th, 2018
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STAR PRINT 5
  2.  
  3. org 100h
  4. .stack 100h
  5. .data
  6.  
  7. str db "*$"
  8. star db 0
  9. starcount db 5
  10.  
  11.  
  12.  
  13. .code
  14. main proc
  15.  
  16.  
  17.     mov dx, @data
  18.     mov ds, dx
  19.                
  20.     mov star,0 ; star=0      ; initialize with 0
  21.    
  22.     condstar:
  23.        
  24.         mov bl, starcount     ; move to register for compare so, (bl = 5) now.
  25.         cmp star, bl          ; star < starcount  | compare 0 < 5  
  26.         jl itestar            ; jump less
  27.         jmp exitstar
  28.        
  29.    
  30.    
  31.      itestar:
  32.      
  33.         lea dx, str
  34.         mov ah, 9
  35.         int 21h
  36.        
  37.         inc star     ;star ++
  38.         jmp condstar
  39.                            
  40.      
  41.      
  42.      exitstar:  
  43.  
  44.  
  45. endp main
  46. end main
  47.  
  48. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement