home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_10 / DEVELOP.LZH / DSP / DSPDEBUG / MSGEX / SIGNAL.S < prev    next >
Text File  |  1992-07-19  |  2KB  |  73 lines

  1.  OPT l2
  2. ;  #[ C Definitions:
  3.  
  4.  XDEF Display
  5.  XDEF DisplayBuffer
  6.  
  7. ;  #] C Definitions:
  8.  TEXT
  9. ;  #[ Display Function:
  10. ;
  11. ; IN:
  12. ; D0 = DSP Word (Lowest 24 Bits)
  13. Display:
  14.  movem.l d3-d5,-(sp)        ; Save Used Registers
  15.  addq.b #1,DisplayOffset        ; Plot at Last Line (Scroll) ???
  16.  bpl.s .NoScroll        ; No -> .NoScroll
  17. .Scroll:            ; Scroll Buffer By One Pixel Left
  18.  lea DisplayBuffer,a0        ; Get Buffer Address
  19.  moveq #$7f,d5        ; Loop on 128 Lines
  20. .ScrollLoop:
  21.  movem.l (a0)+,d1-d4        ; Get One Line
  22.  add.l d4,d4            ; Scroll Left 
  23.  addx.l d3,d3
  24.  addx.l d2,d2
  25.  addx.l d1,d1
  26.  movem.l d1-d4,-$10(a0)        ; Put Scrolled Line
  27.  dbf d5,.ScrollLoop        ; Loop
  28.  subq.b #1,DisplayOffset        ; DisplayOffset is 127, not 128
  29. .NoScroll:
  30.  moveq #0,d1
  31.  swap d0            ; Get DSP High Byte
  32.  ext.w d0            ; Extend Word
  33.  asr.w #1,d0            ; Convert (-128->+127) to (-64->+63)
  34. ; addx.w d1,d0
  35.  neg d0
  36.  negx d0
  37.  lsl.w #4,d0            ; Convert To Y Offset
  38.  moveq #0,d1
  39.  move.b DisplayOffset,d1
  40.  lea DisplayBuffer+$400,a0        ; Get Buffer Middle Pointer
  41.  move.w d1,d2
  42.  and.w #7,d1
  43.  eor.w d1,d2
  44.  lsr.w #3,d2            ; Calculate X Offset
  45.  add.w d2,d0            ; Add To X Offset
  46.  not.w d1
  47.  and.w #7,d1            ; Get bit Number
  48.  bset d1,0(a0,d0.w)        ; And Set It
  49. .DrawBar:
  50.  lea DisplayBuffer+$400,a0        ; Display Middle Bar
  51.  moveq #-1,d0
  52.  move.l d0,(a0)+
  53.  move.l d0,(a0)+
  54.  move.l d0,(a0)+
  55.  move.l d0,(a0)
  56.  movem.l (sp)+,d3-d5        ; Restore Registers
  57.  rts            ; And Return To Caller
  58.  
  59. ;  #] Display Function:
  60.  BSS
  61. ;  #[ BSS Section:
  62.  
  63. DisplayBuffer:
  64.  ds.b $800            ; (128*128)/8
  65.  
  66. DisplayOffset:
  67.  ds.b 1
  68.  
  69.  EVEN
  70.  
  71. ;  #] BSS Section:
  72.  END
  73.