PhotoShaman

Array input/output

Mar 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data segment para public 'data'
  2.     countItems  equ 9
  3.     array db 9 dup(?)
  4.     enter_mas   db  'vvedi massiv,$'
  5.     output_mas  db  '  massiv,  $'
  6. data ends
  7.  
  8. stacks segment stack
  9.     db  32  dup (?)
  10. stacks ends
  11.  
  12. code segment para public 'code'
  13.     main    proc
  14.         assume cs:code, ds:data, ss:stacks
  15.        
  16.         mov ax,data
  17.         mov ds,ax
  18.  
  19.         mov ah,9
  20.         mov dx,offset enter_mas
  21.         int 21h
  22.        
  23.         xor ax,ax  
  24.        
  25.         mov cx,10
  26.         mov si,0
  27.        
  28.         jmp enter_text
  29.        
  30.     enter_text:
  31.         mov ah,1h
  32.         int 21h
  33.        
  34.         sub al,30h
  35.         mov array[si],al
  36.         inc si
  37.        
  38.         cmp si,countItems
  39.         jle enter_text
  40.  
  41.         mov cx,10
  42.         mov si,0
  43.         mov ah,09h
  44.         lea dx,output_mas
  45.         int 21h
  46.  
  47.         mov si,0
  48.         mov cx,10
  49.    
  50.     output_array:
  51.         mov ah,02h
  52.         mov dl,array[si]
  53.         add dl,30h
  54.         int 21h
  55.         inc si
  56.         loop output_array
  57.    
  58.         mov ax,4c00h
  59.         int 21h
  60.     main endp
  61. code ends
  62. end main
Advertisement
Add Comment
Please, Sign In to add comment