📄 awfview.pas
字号:
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
mov ax,bx
xchg ah,al
std
stosw
loop @1
pop ds
end;
procedure BitBltRot90(Dest, Src : Pointer; Bit, BytesPerRow, Len : Cardinal); assembler;
asm
push ds
mov cx,Bit {CX is bit offset}
inc cx
les di,Src {ES:DI->Src}
lds si,Dest {DS:SI->Dest}
mov bx,Len {BX = loop counter}
shr bx,1
@1: push bx {save loop counter}
mov bx,16 {loop 16 times}
mov ax,es:[di] {data in AX}
add di,2
jc @7
@2: xchg ah,al
@3: xor dl,dl {clear DL}
shl ax,1 {get the next bit out of AX}
rcr dl,cl {rotate the next bit into position in DL for ORing}
or [si],dl {or the new data into the destination}
add si,BytesPerRow {find the next line}
jc @5 {do we need to switch segments? jump if so}
@4: dec bx {decrement loop counter}
jnz @3 {loop if more bits}
pop bx {restore main loop counter}
dec bx {decrement counter}
jnz @1 {any data left? jump if so}
jmp @9 {jump to end of routine}
@5: push bp {check to see if this is the last iteration of loop}
mov bp,sp
cmp word ptr [bp+2],1
jne @6
pop bp
jmp @4
@6: pop bp
push si {save offset}
mov si,ds {add SelectorInc (8) to DS}
add si,8
mov ds,si
pop si {restore offset}
jmp @4 {continue where we left off}
@7: push bp {check to see if this is the last iteration of loop}
mov bp,sp
cmp word ptr [bp+2],1
jne @8
pop bp
jmp @2
@8: pop bp
push di
mov di,es
add di,8
mov es,di
pop di
jmp @2
@9: pop ds
end;
procedure BitBltRot270(Dest, Src : Pointer; Bit, BytesPerRow, Len : Cardinal); assembler;
asm
push ds
mov cx,Bit {CX is bit offset}
inc cx
les di,Src {ES:DI->Src}
lds si,Dest {DS:SI->Dest}
mov bx,Len {BX = loop counter}
shr bx,1
@1: push bx {save loop counter}
mov bx,16 {loop 16 times}
mov ax,es:[di] {data in AX}
add di,2
jc @7
@2: xchg ah,al
@3: xor dl,dl {clear DL}
shl ax,1 {get the next bit out of AX}
rcr dl,cl {rotate the bit into position in DL for ORing}
or [si],dl {or the data into the destination}
sub si,BytesPerRow
jc @5
@4: dec bx {decrement loop counter}
jnz @3 {loop if more bits}
pop bx {restore main loop counter}
dec bx {decrement counter}
jnz @1 {any data left? jump if so}
jmp @9 {jump to end of routine}
@5: push bp {check to see if this is the last iteration of loop}
mov bp,sp
cmp word ptr [bp+2],1
jne @6
pop bp
jmp @4
@6: pop bp
push si {save offset}
mov si,ds {subtract SelectorInc (8) from DS}
sub si,8
mov ds,si
pop si {restore offset}
jmp @4 {continue where we left off}
@7: push bp {check to see if this is the last iteration of loop}
mov bp,sp
cmp word ptr [bp+2],1
jne @8
pop bp
jmp @2
@8: pop bp
push di
mov di,es
add di,8
mov es,di
pop di
jmp @2
@9: pop ds
end;
{$ELSE}
procedure ReverseBits(Dest, Src : Pointer; L : Cardinal); register; assembler;
asm
push esi
push edi
push ebx
mov esi,edx {ESI->Src}
mov edi,eax {ESI->Dest}
add edi,ecx {point EDI to end of destination}
dec edi
dec edi
shr ecx,1 {count words, not bytes}
@1: mov ax,[esi]
inc esi
inc esi
mov edx,eax
mov ah,al
mov al,dh
@2:
{put reverse of AL in AH}
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
shr ax,1
rcl bx,1
mov eax,ebx
mov edx,eax
mov ah,al
mov al,dh
mov [edi],ax
dec edi
dec edi
dec ecx
jnz @1
pop ebx
pop edi
pop esi
end;
procedure BitBltRot90(Dest, Src : Pointer; Bit, BytesPerRow, Len : Cardinal); assembler; register;
asm
push ebx
push esi
push edi
inc ecx {increment bit offset}
mov esi,eax {ESI->Dest}
mov edi,edx {EDI->Src}
mov ebx,Len {EBX = loop counter}
shr ebx,1
@1: mov ax,[edi] {data in AX}
inc edi
inc edi
push ebx {do this in lieu of xchg, because this is faster}
mov bx,ax
mov ah,al
mov al,bh
pop ebx
xor dl,dl {clear DL}
shl ax,1 {get the next bit out of AX}
rcr dl,cl {rotate the next bit into position in DL for ORing}
or [esi],dl {or the new data into the destination}
add esi,BytesPerRow {find the next line}
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
add esi,BytesPerRow
dec ebx {decrement counter}
jnz @1 {any data left? jump if so}
pop edi
pop esi
pop ebx
end;
procedure BitBltRot270(Dest, Src : Pointer; Bit, BytesPerRow, Len : Cardinal); assembler; register;
asm
push ebx
push esi
push edi
inc ecx {increment bit offset}
mov esi,eax {ESI->Dest}
mov edi,edx {EDI->Src}
mov ebx,Len {EBX = loop counter}
shr ebx,1
@1: mov ax,[edi] {data in AX}
inc edi
inc edi
push ebx {do this in lieu of xchg, because this is faster}
mov bx,ax
mov ah,al
mov al,bh
pop ebx
xor dl,dl {clear DL}
shl ax,1 {get the next bit out of AX}
rcr dl,cl {rotate the next bit into position in DL for ORing}
or [esi],dl {or the new data into the destination}
sub esi,BytesPerRow {find the next line}
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
sub esi,BytesPerRow
xor dl,dl
shl ax,1
rcr dl,cl
or [esi],dl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -