Guest User

Untitled

a guest
Jun 28th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     ORG $1000
  2. START:              ; first instruction of program
  3.     move.w  a,-(sp)     ;push a
  4.     move.w  b,-(sp)     ;push b
  5.     move.l  #x,-(sp)    ;push x
  6.     jsr QUAD
  7. QUAD
  8.     move.w  10(sp),D2   ;pop a
  9.     move.w  8(sp),D3    ;pop b
  10.    
  11.     move.w  D2,D4       ;START 3*a
  12.     add.w   D2,D4
  13.     add.w   D2,D4       ;END 3*a
  14.     move.w  D4,D1
  15.    
  16.     cmp.w   #0,D3
  17.     BLT END     ;if 0>b END
  18.     move.w  #0,D5       ;START 2*b
  19.     add.w   D3,D5
  20.     add.w   D3,D5       ;END 2*b
  21.     move.w  D5,D3
  22.    
  23. END
  24.     move.b  #9,D0
  25.     trap    #15
  26. * Variables and Strings
  27.     org $2000
  28. a   dc.w    2
  29. b   dc.w    36
  30. x   ds.w    1
  31.     END START       ; last line of source
Add Comment
Please, Sign In to add comment