.


:




:

































 

 

 

 


. :




6

. ˲

: .

 

, , - . 86 , , loop (), . , 64 .

, , assembler , .

.

 

LOOP ( )

loop (. ) (), 0, - 128... + 127 . , loop . , 65536 ( = 0). 䳺 .

LOOP  

( cx) Assembler:

. model tiny ; , , ᒺ.
. code ; , .
org 100h ; -
begin: ;
mov cx,10 ; (-) CX ( 10 0)
Label1: ; (Label - ).
mov ah,9 ; DOS " (9)" .
mov dx, offset String ; DX String
int 21h ; DOS " "
loop Label1 ; loop CX , , Label1 ( 6)
ret ; DOS " "
string db 'privet $' ; c,
end begin ;

 

(5) CX ( 10 0). (6) (Label - ). ( (7) - (9)) . (10) loop CX , , Label1 ( (6)). , . (11), CX .

 

JMP ( )

jmp . . .

jmp :

1. ( - 128... + 127 );

2. ( );

3. ( );

4. ;

5. .

 

jmp, . , , , (short - ; near ptr - ; far ptr - ; word ptr - ; dword ptr - ).

JMP  

 

. model tiny ; ', , '.
. code ; , .
org 100h ; -
begin: ;
label1: ;
mov ah,9 ; DOS " (9)" .
mov dx,offset String ; DX String
int 21h ; DOS " "
jmp Label1 ; Label1
add cx,12 ; cx 12
dec cx ; cx 1
ret ; DOS " "
string db "PRIVET",13,10,'$' ; c,
end begin ;

 

(6) - (10) ( PRIVET ) (10) - (11).

 

DEC JNZ ( )

, Loop. DEC JNZ CX 1 , CX .

DEC, , 0 1. JNZ .

JMP LOOP JNZ JNZ (Label 1), . - 128 +127 .


 

. model tiny ; ', , '.
. code ; , .
org 100h ; -
begin: ;
mov cx,10 ; (-) CX ( 10 0)
Label1: ; (Label - ).
mov ah,9 ; DOS " (9)" .
mov dx,offset String ; DX String
int 21h ; DOS " "
dec cx ; DEC CX , , Label1
jnz Label1 ; Label1
ret ; DOS " "
string db 'priver ',13,10, '$' ; c,
end begin ;

 

, ASCII- (16 16 ).

. model tiny ; ', , '.
. code ; , .
org 100h ; -
begin: ;
mov cx,256 ; (256 )
mov dl,0 ; - 00
mov ah,2 ; DOS " "
cloop: int 21h ; DOS
inc dl ; DL 1
test dl,0Fh ; DL 16
jnz continue_loop; ; ,
push dx ; :
mov dl,0Dh ; CR
int 21h ; DOS
mov dl,0Ah ; LF
int 21h ; DOS
pop dx ;
continue_loop: ;
loop cloop ;
ret ; -
end begin ;

 

LOOP , 256 ( ). DL , 1 INC DL. DL 1 16, CR LF, . TEST DL, 0Fh - AND DL 0Fh , DL , .

 

3.1 .

3.2 .

3.3 .

3.4 .

3.5 , .

3.6. .

3.7. .

 

4.1 , .

4.2 .

4.3 .

4.4 , "!!!! Hello!!!!" (3 ).

4.5 ( . 1) , , , , D .

4.6 *. Com *. Exe ( );

³ :

1) loop (. ) (), 0, - 128... + 127 . , loop . , 65536 ( = 0). 䳺 .

2) .

3) 64 .

4) jmp . . .

5) jmp :

1. ( - 128... + 127 );

2. ( );

3. ( );

4. ;

5. .

jmp, . , , , (short - ; near ptr - ; far ptr - ; word ptr - ; dword ptr - ).

6) , Loop. DEC JNZ CX 1 , CX .

DEC, , 0 1.

JNZ .

JMP LOOP JNZ JNZ (Label 1), . - 128 +127 .

26:

 

1

2

3

4

5

6

7

8





:


: 2016-07-29; !; : 568 |


:

:

,
==> ...

1957 - | 1718 -


© 2015-2024 lektsii.org - -

: 0.028 .