AnonymousEng

[Sine2] Week7 - Assembly Program

Mar 31st, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 64
  3. .data                              
  4.     org 20h
  5.     sine db 0,66,127,180,221,246,255
  6.     org 40h
  7.     cose db 255,246,221,180,127,66,0
  8.     org 60h
  9.     total dw 16 dp(0)
  10. .code
  11. mov ax,@data
  12. mov dx,ax
  13. mov bx,offset sine
  14. mov si,offset cose
  15.  
  16. mov cx,7
  17. begin:
  18.     mov al,[bx]
  19.     mul al
  20.     push ax
  21.     mov al,[bx+20h]
  22.     mul al
  23.     pop dx
  24.     add dx,ax
  25.    
  26.     mov [si],dx
  27.     inc bx
  28.     add si,2
  29.    
  30.     dec cx
  31.     jnz begin
  32. nop
  33.  
  34. mov ah,4ch
  35. mov al,00h
  36. int 21h
  37. end
  38.    
  39. ret
Advertisement
Add Comment
Please, Sign In to add comment