Created
August 18, 2016 08:35
-
-
Save djg/993d413decd7860259466fed386cee21 to your computer and use it in GitHub Desktop.
Learning how to pinmap...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __asm | |
| { | |
| mov eax,srctex | |
| mov edx,dest | |
| pushad | |
| mov esi,offset pin | |
| mov edi,edx | |
| mov pintexptr,eax | |
| mov ch,HEIGHT | |
| pinyloop: | |
| mov cl,WIDTH | |
| pinxloop: | |
| //assume esi:ptr pin | |
| push esi | |
| push ecx | |
| mov eax,[esi+12/*sizeof pin*/+0/*u*/] | |
| sub eax,[esi+0/*u*/] | |
| mov edx,[esi+(12/*sizeof pin*/)*(WIDTH+2)+0/*u*/] | |
| sub edx,[esi+(12/*sizeof pin*/)*(WIDTH+1)+0/*u*/] | |
| sub edx,eax | |
| sar eax,3 | |
| sar edx,6+adjust | |
| mov ebp,eax | |
| sar eax,31 | |
| mov cl,al | |
| mov ival1,edx | |
| sar edx,31 | |
| mov ival2,dl | |
| mov eax,[esi+(12/*sizeof pin*/)*(WIDTH+1)+0/*u*/] | |
| sub eax,[esi+0/*u*/] | |
| sar eax,3+adjust | |
| mov yval1,eax | |
| sar eax,31 | |
| mov yval2,al | |
| mov eax,[esi+12/*sizeof pin*/+4/*u*/] | |
| sub eax,[esi+4/*u*/] | |
| mov edx,[esi+(12/*sizeof pin*/)*(WIDTH+2)+4/*u*/] | |
| sub edx,[esi+(12/*sizeof pin*/)*(WIDTH+1)+4/*u*/] | |
| sub edx,eax | |
| sar eax,3 | |
| sar edx,6+adjust | |
| add cl,ah | |
| shl eax,24 | |
| add ebp,eax | |
| adc cl,0 | |
| add ival2,dh | |
| shl edx,24 | |
| add ival1,edx | |
| adc ival2,0 | |
| mov eax,[esi+(12/*sizeof pin*/)*(WIDTH+1)+4/*u*/] | |
| sub eax,[esi+4/*u*/] | |
| sar eax,3+adjust | |
| add yval2,ah | |
| shl eax,24 | |
| add yval1,eax | |
| adc yval2,0 | |
| mov ebx,pintexptr | |
| mov dl,byte ptr ([esi+4/*u*/]) | |
| shl edx,24 | |
| add edx,800000h | |
| mov eax,[esi+0/*u*/] | |
| and eax,65535 | |
| add edx,eax | |
| mov bl,byte ptr ([esi+4/*u*/])+1 | |
| ;bl:edx :edx contains u and lo v, bl contains hi v | |
| ;ebp:cl contains u/v incs | |
| ;ch counter | |
| ;ival1,ival2 are delta deltas | |
| mov ch,8 shl adjust | |
| again: | |
| push edx | |
| push ebx | |
| ;comment ! | |
| mov bh,dh ; u | |
| add edx,ebp ; v | |
| mov al,[ebx] ; u | |
| mov bh,dh ; v | |
| adc bl,cl ; u | |
| add edx,ebp ; v | |
| mov ah,[ebx] ; u | |
| mov bh,dh ; v | |
| adc bl,cl ; u | |
| rol eax,16 ; v | |
| add edx,ebp ; u | |
| mov al,[ebx] ; v | |
| adc bl,cl ; u | |
| mov bh,dh ; v | |
| add edx,ebp ; u | |
| mov ah,[ebx] ; v | |
| adc bl,cl ; u | |
| __asm | |
| { | |
| mov eax,srctex | |
| mov edx,dest | |
| pushad | |
| mov esi,offset pin | |
| mov edi,edx | |
| mov pintexptr,eax | |
| mov ch,HEIGHT | |
| pinyloop: | |
| mov cl,WIDTH | |
| pinxloop: | |
| //assume esi:ptr pin | |
| push esi | |
| push ecx | |
| mov eax,[esi+12/*sizeof pin*/+0/*u*/] | |
| sub eax,[esi+0/*u*/] | |
| mov edx,[esi+(12/*sizeof pin*/)*(WIDTH+2)+0/*u*/] | |
| sub edx,[esi+(12/*sizeof pin*/)*(WIDTH+1)+0/*u*/] | |
| sub edx,eax | |
| sar eax,3 | |
| sar edx,6+adjust | |
| mov ebp,eax | |
| sar eax,31 | |
| mov cl,al | |
| mov ival1,edx | |
| sar edx,31 | |
| mov ival2,dl | |
| mov eax,[esi+(12/*sizeof pin*/)*(WIDTH+1)+0/*u*/] | |
| sub eax,[esi+0/*u*/] | |
| sar eax,3+adjust | |
| mov yval1,eax | |
| sar eax,31 | |
| mov yval2,al | |
| mov eax,[esi+12/*sizeof pin*/+4/*u*/] | |
| sub eax,[esi+4/*u*/] | |
| mov edx,[esi+(12/*sizeof pin*/)*(WIDTH+2)+4/*u*/] | |
| sub edx,[esi+(12/*sizeof pin*/)*(WIDTH+1)+4/*u*/] | |
| sub edx,eax | |
| sar eax,3 | |
| sar edx,6+adjust | |
| add cl,ah | |
| shl eax,24 | |
| add ebp,eax | |
| adc cl,0 | |
| add ival2,dh | |
| shl edx,24 | |
| add ival1,edx | |
| adc ival2,0 | |
| mov eax,[esi+(12/*sizeof pin*/)*(WIDTH+1)+4/*u*/] | |
| sub eax,[esi+4/*u*/] | |
| sar eax,3+adjust | |
| add yval2,ah | |
| shl eax,24 | |
| add yval1,eax | |
| adc yval2,0 | |
| mov ebx,pintexptr | |
| mov dl,byte ptr ([esi+4/*u*/]) | |
| shl edx,24 | |
| add edx,800000h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment