Assembler

На gravmos.ru гравировка на шильдиках. | независимая инвентаризация склада. | Картриджи для фильтров атолл подробно. |





- ,
.
(PUSH) (POP).

. ,
.
LIFO (last in, first out -
). A,
B, , B.
(POP) A.
,
.
 
. - -
, .
" - " (first in,
first out: FIFO). , ,
. - .
 

, . -
,
, , -
.

.
POP PUSH
.
 
. 2.19 . (a)
A, B, C. -
,
C. (b) : D.
PUSH SP ( Stack Pointer -
), D.
, .
 
. 2.19(c) POP.
D . POP
.
(c) POP AX,
D AX ( ,
). POP .
, C. ,
LIFO.
D .
 
, D ,
.
, .
D.
 
. 2.19(d) , D
E. E D
. ,
,
.
Ĵ Ĵ Ĵ Ĵ
D < SP D E < SP
Ĵ Ĵ Ĵ Ĵ
C < SP C C < SP C
Ĵ Ĵ Ĵ Ĵ
B B B B
Ĵ Ĵ Ĵ Ĵ
A A A A
Ĵ Ĵ Ĵ Ĵ
(a) (b) (c) (d)
 
. 2.19
 

8088.
. PUSH , POP
.
. ,
.
, . 2.19,
.
 
,
. ?
 
CALL PUSH
- . RET
, POP,
. 8088
,
. ? . 2.20
.
 
. 2.20 ,
. (a)
.
MAIN, SUBROUTINE_A.
. (b)
103 . SUBROUTINE_A
SUBROUNINE_B.
108 SUBROUNINE_A. SUBROUNINE_B
, 108,
(d).
, .
, 108 SUBROUNINE_A
SUBROUNINE_B. SUBROUNINE_A .
103
. 103 MAIN
SUBROUNINE_A.
 
. 2.20
. ,
. ,
Microsoft (R) Macro Assembler Version 5.00 11/10/88 23:18:17
. 2.20 Page 1-1
 
 
PAGE ,132
TITLE . 2.20
0000 CODE SEGMENT
 
ASSUME CS:CODE
0100 ORG 100H
 
0100 E8 0104 R MAIN: CALL SUBROUTINE_A
0103 40 INC AX
 
;----- . . .
 
 
0104 SUBROUTINE_A PROC NEAR
0104 43 INC BX
0105 E8 0109 R CALL SUBROUTINE_B
0108 C3 RET
0109 SUBROUTINE_A ENDP
 
0109 SUBROUTINE_B PROC NEAR
0109 41 INC CX
010A C3 RET
010B SUBROUTINE_B ENDP
 
010B CODE ENDS
END
 
 
Ĵ Ĵ Ĵ Ĵ
108 SP 108
Ĵ Ĵ Ĵ Ĵ
103 SP 103 103 SP
Ĵ Ĵ Ĵ Ĵ
xxx SP xxx xxx xxx
Ĵ Ĵ Ĵ Ĵ
 
(a) (b) (c) (d)
 
. 2.20 
 
(
) - .
,
. LIFO
.
 
. 2.20
- PROC. PROC
.
, ,
. NEAR

.
PROC, CALL JMP.