home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1079410192000.psc / Brighten.asm < prev    next >
Encoding:
Assembly Source File  |  2000-10-19  |  801 b   |  51 lines

  1. ;Brighten.asm   For A386
  2. ;Brighten Increment B G & R continuously until any =255
  3. ;NB BMP must be 24-bit. 
  4. USE32
  5. long1 equ[ebp+8]    ;->pic
  6. long2 equ[ebp+12]    ;bmheight
  7. long3 equ[ebp+16]    ;bmwidth
  8. long4 equ[ebp+20]    ;spare
  9.     
  10.     push ebp        ;Arrange for ebp to point to stack params
  11.     mov ebp,esp
  12.     push edi,esi,ebx
  13.  
  14. ;Get picture box parameters
  15.     mov esi,long1        ;ptr to pic1
  16.     mov eax,long2        ;bmheight
  17.     mov edx,long3        ;bmwidth
  18.     mul edx            ;total BGR sets
  19.     mov ecx,eax
  20.  
  21. start:
  22.     mov al,[esi]
  23.     cmp al,255
  24.     je L1
  25.     inc al
  26.     mov [esi],al
  27. L1:    inc esi
  28.  
  29.     mov al,[esi]
  30.     cmp al,255
  31.     je L2
  32.     inc al
  33.     mov [esi],al
  34. L2:    inc esi
  35.  
  36.     mov al,[esi]
  37.     cmp al,255
  38.     je L3
  39.     inc al
  40.     mov [esi],al
  41. L3:    inc esi
  42.  
  43.     dec ecx
  44.     jnz start    
  45. GETOUT:
  46.     pop ebx,esi,edi
  47.     mov esp,ebp
  48.     pop ebp
  49.     ret 16
  50. ;jmp GETOUT
  51.