PhotoShaman

ASM.Лаба7

Apr 1st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multi-segment executable file template.
  2.  
  3. data segment
  4.     ; add your data here!        
  5.     helloWorld db "Hello World$"  
  6.     pkey db "Press any key to continue...$"
  7.     hello db "Hello$"
  8.     enterSymbol db "Enter cymbol: $"
  9.     xPos db 5 ,75, 75, 5  
  10.     yPos db 2, 2, 22, 22
  11. ends
  12.  
  13. stack segment
  14.     dw   128  dup(0)
  15. ends
  16.  
  17. code segment
  18. start:
  19. ; set segment registers:
  20.     mov ax, data
  21.     mov ds, ax
  22.     mov es, ax
  23.            
  24.     ;----------------Hello World      
  25.     mov dh, 12
  26.     mov dl, 34        
  27.     mov ah, 02h
  28.     int 10h
  29.        
  30.     lea dx, helloWorld
  31.     mov ah, 9
  32.     int 21h                
  33.     ;----------------4 1 2 4 (for 1 to 4)
  34.     mov bx,0    
  35.     mov cx,4  
  36.     mov ah,02h  
  37.     ckl4124:        
  38.     mov dl, xPos[bx]
  39.     mov dh, yPos[bx]        
  40.     int 10h
  41.    
  42.     inc bl
  43.     mov dl, bl
  44.     add dl, 48
  45.     int 21h        
  46.     loop ckl4124    
  47.     ;----------------Press any key text    
  48.     mov dh, 22
  49.     mov dl, 26        
  50.     mov ah, 02h
  51.     int 10h  
  52.    
  53.     lea dx, pkey
  54.     mov ah, 09h
  55.     int 21h
  56.     ;----------------Wait for any key....    
  57.     mov ah, 1
  58.     int 21h
  59.     ;----------------Screan clear  
  60.     mov al, 02h
  61.     mov ah, 00h
  62.     int 10h
  63.     ;----------------Hello vertical
  64.     mov si, 0    
  65.     mov cx, 5  
  66.     mov ah, 02h  
  67.     ckl:
  68.     mov dh, 15
  69.     sub dh, cl
  70.     mov dl, 40        
  71.     int 10h  
  72.    
  73.     mov dl, hello[si]  
  74.     int 21h
  75.     int 10h    
  76.     inc si    
  77.     loop ckl
  78.     ;----------------Wait for any key....    
  79.     mov ah, 1
  80.     int 21h
  81.     ;----------------Screan clear  
  82.     mov al, 02h
  83.     mov ah, 00h
  84.     int 10h
  85.     ;---------------Enter Symbol
  86.     lea dx, enterSymbol
  87.     mov ah, 09h
  88.     int 21h
  89.    
  90.     mov ah, 1
  91.     int 21h
  92.      
  93.     mov dh, 12
  94.     mov dl, 40
  95.     mov ah, 02h        
  96.     int 10h
  97.    
  98.     mov ah, 9
  99.     mov cx, 1
  100.     mov bl, 02h
  101.     int 10h
  102.     ;----------------Wait for any key....    
  103.     mov ah, 1
  104.     int 21h
  105.    
  106.     mov ax, 4c00h ; exit to operating system.
  107.     int 21h    
  108. ends
  109.  
  110. end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment