The main question about the declaration of the stack segment

Hey, I'm just starting to learn assembly and that’s what I don’t understand ...

In the stack segment declaration, we use something like

     TOS LABEL WORD

I know that TOS belongs to the top of the stack, but does not understand what follows it and what it uses. Help will be appreciated.

+3
source share
1 answer

What you are doing here is defining a label (stack pointer (SP)) that contains the address of the top of the stack. The label will always contain the address where the last value was clicked.

  • When you invoke the PUSH operation, the contents of the register or memory location is copied onto the stack and the SP decreases.

  • POP, SP (TOS), , , SP .

, , .

, PUSH, , , . , , , - 100, 100. 99. 99 TOS.

2 LABEL , - . , TOS "", WORD - .

, :

label1 LABEL WORD
.
.;code
.

( ), :

label1:
.
.
.

, . , : http://www.emu8086.com/assembler_tutorial/compatibility.html

+3

All Articles