Advertisement
apl-mhd

assignment

Sep 17th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org 100h
  2.  
  3.  
  4. .stack 100h
  5. .DATA
  6. W dw 1,2,3,4,5,6,7,8  
  7.  
  8. .CODE
  9.                  
  10.                  
  11.                
  12.     mov cx,8
  13.     mov dx,0
  14.     mov si,0
  15.    
  16.     copy_:    
  17.     push W[SI]
  18.     add si,2  
  19.     LOOP copy_
  20.  
  21.   mov ax,0
  22.   mov cx,8
  23.   mov si,0
  24.    
  25.   reverse:
  26.   pop W[si]
  27.   add si,2
  28.   Loop reverse
  29.  
  30.  
  31.       mov si,0
  32.       mov cx,8
  33.       mov dx, 0  
  34.    
  35.    
  36.    CALCULATION_:
  37.       sub cx,1
  38.     cmp cx, 4
  39.     jge SUM
  40.    
  41.     jmp dead
  42.     hlt
  43.  
  44.    
  45.     ;JE MULTI_
  46.    ;MULTI_:  
  47.    ;LOOP CALCULATION_
  48.    
  49.    
  50.      
  51.     SUM:
  52.     add dx, w[si]
  53.     add si,2
  54.     jmp CALCULATION_
  55.     hlt
  56.          
  57.     dead:
  58.    
  59.     add ax, w[si]
  60.     add si,2
  61.    
  62.    
  63.    
  64.     cmp cx,0
  65.     jz e
  66.     jmp CALCULATION_
  67.    
  68.     e:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement