10.3.2


:

,

1 - , ( 32 );

2 - (32 - );

3 - ( CL ).

SHLD . 10.2

. 10.2

, 2 , .

.

1024 . 8.

8 3 , . .

p486

ideal

model flat

y=x>>3; ost = x[0]&7

extrn ExitProcess:proc

dataseg

x dd 32 dup (0ffffffffh)

y dd 32 dup (?);

ost dd ? ;

codeseg

begin:

; y=x

mov ecx, 32

for1:

mov eax, [x+ecx*4-4]

mov [y+ecx*4-4], eax

loop for1

;for (i=0; i<31; i++)

mov ecx, 31

mov eax, 0

; shrd (y[i], y[i+1], 3);

for2:

mov ebx, [y+eax*4+4]

shrd [y+eax*4], ebx, 3

;i++

inc eax

loop for2

;shr (y[i], 3);

shr [y+eax*4], 3

; ost = x[0] & 7

mov eax, [x]

and eax, 7

mov [ost], eax

call ExitProcess

end begin