JAVA

, . , N. 1. JG STARTADD, [] > 0. , , . SUM.

( ECX) n 1, 4, n , NUM2, NUMn+4 .. 4 , NUM1 NUMn.

LOOP STARTADD :

DEC

JG STARTADD

.. , STARTADD, .

LEA EBX,NUM1 ; NUM1

SUB EBX,4 ; 4

MOV ECX,N ; ࠠ

MOV EAX,0 ;

STARTADD: ADD EAX,(EBX+ECX*4) ;

; EAX

LOOP STARTADD ; 1 ECX

; ECX >0, STARTADD

MOV SUM,EAX ; SUM

SUM DEF ? ;

N DEF n

NUM1 def ?

NUM2 def ?

NUM3 def ?

NUMn def ?

. 5.8. IA-32, ;

, . . , LIST(0), LIST(1), ..., LIST(n-l), ,

FOR I FROM 0 UPTO (n-1)

FOR I FROM (n-1) DOWNTO 0

IA-32 IA-32. .

IA-32 . 5.9. 1 12 . 1 . , 1 , 2 . , . , , 1 . (. . 5.1). 2 .

, , . , 1 4 .

, , , .

.

, , . , , .


. 5.9. IA-32

INC DEC, , 1 . ,

INC EDI

DEC ECX

EDI ECX 3- .

. ,

MOV ,820

5 . , , 32 , . 4- 820. 8 ,

MOV DL,5

2 .

, , , . , . , , . . , , . 6.6.

, . ,

ADD EAX,EDX

2 . , .

, , .

MOV ECX,N

. 5.4 6 : , , , N.

ADD EAX,[EBX+EDI*4]

2- , . 4. , , .

MOV DWORD PTR[EBP+ESI*4+DISP],10

DWORD PTR , 10 32 . . , Motorola 68000 MOVEB 1- , MOVEL 4-. 32- DISP, 11 : , . . 5.1 , 8 32 . .

, .

MOV EAX,LOCATION

LOCATION,

MOV LOCATION,EAX

LOCATION , , . , .

IA-32 , . , IA-32, , .


<<