"Symbol not defined : @STACK " error in ASM code for 8086. Compiled using DOSBOX ,MASM

48 Views Asked by At

This is a code to add all numbers between 50 and 150 and display the result in decimal form.I have created the stack segment .STACK 32 to store the remainders to convert the hex result to decimal format. The address of data segment is passed to DS. I also need to pass address of stack segment to SS but the error occurs.enter image description here

 TITLE ADD 10 NUMBERS FROM 50 TO 150
.MODEL SMALL
.STACK 32
.DATA
    ARR  DW 60,70,86,79,70,140,130,120,100,150
    STRING  DB "THE SUM OF NUMBERS IS: $"
    SUM DW ?
.CODE
    MAIN PROC FAR
           MOV  AX,@DATA
           MOV  DS,AX

           MOV  AX,@STACK
           MOV  SS,AX

           LEA  SI,ARR
           MOV  AX,0
           MOV  CX,10
    REPEAT:
           ADD  AX,[SI]
           INC  SI
           INC SI
           LOOP REPEAT

           MOV DX,0
           MOV CX,0
           MOV BX,10

    REPEAT2:
           CMP AX,0
           JZ NEXT
           DIV BX
           PUSH DX
           SUB DX,DX
           INC CX
           JMP REPEAT2

    NEXT:
            CMP CX,0
            JZ EXIT
            POP DX
            ADD DX,30H
            DEC CX
            MOV AH,02H
            INT 21H
            JMP NEXT

    EXIT:
           MOV  AX,4C00H
           INT  21H


MAIN ENDP
    END MAIN

It works for @data but not for @stack why?

0

There are 0 best solutions below