Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 29th, 2010  |  syntax: None  |  size: 1.47 KB  |  views: 141  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. lcd_grey_data:
  2.     lea.l   (-2*4, %sp), %sp
  3.     movem.l  %a2-%a3, (%sp)
  4.     movem.l (2*4+4, %sp), %a0-%a2  /* values, phases, length */
  5.     lea.l   LCD_BASE_ADDRESS+2, %a3 /* LCD data port address */
  6. .ph_loop:
  7.     clr.l   %d1
  8.     move.l  (%a1), %d0          /* fetch 4 pixel phases */
  9.     bclr.l  #31, %d0            /* Z = !(p0 & 0x80); p0 &= ~0x80; */
  10.     seq.b   %d1                 /* %d1 = ........................00000000 */
  11.     lsl.l   #1, %d1             /* %d1 = .......................00000000. */
  12.     bclr.l  #23, %d0            /* Z = !(p1 & 0x80); p1 &= ~0x80; */
  13.     seq.b   %d1                 /* %d1 = .......................011111111 */
  14.     lsl.l   #1, %d1             /* %d1 = ......................011111111. */
  15.     bclr.l  #15, %d0            /* Z = !(p2 & 0x80); p2 &= ~0x80; */
  16.     seq.b   %d1                 /* %d1 = ......................0122222222 */
  17.     lsl.l   #1, %d1             /* %d1 = .....................0122222222. */
  18.     bclr.l  #7, %d0             /* Z = !(p3 & 0x80); p3 &= ~0x80; */
  19.     seq.b   %d1                 /* %d1 = .....................01233333333 */
  20.     lsr.l   #7, %d1             /* %d1 = ............................0123 */
  21.     add.l   (%a0)+, %d0         /* add 4 pixel values to the phases */
  22.     move.l  %d0, (%a1)+         /* store new phases, advance pointer */
  23.  
  24.     move.w  %d1, (%a3)          /* transfer to lcd */
  25.  
  26.     cmp.l  %a2, %a1
  27.     bls    .ph_loop
  28.  
  29.     movem.l (%sp), %a2-%a3
  30.     lea.l   (2*4, %sp), %sp
  31.     rts