I am trying to figure out how to get the number of items in the stack by subtracting the sp register with bp. What am I doing wrong? I get totally wrong result
MOV bp, 0x7E00
MOV sp, bp
PUSH 'A'
PUSH 'B'
PUSH 'C'
POP bx
MOV al, bl
CALL _printchar
POP bx
MOV al, bl
CALL _printchar
MOV bx, sp
SUB bx, bp
ADD bx, 48 ;To get ascii number
MOV al, bl
CALL _printchar
This is the output:
CB.