I'm learning assembly and wondering what happend when you pop an empty stack or increasing SP (Stack Pointer) when it's already FFFE for example:
seg1 segment
org 100h
pop ax
mov ah,4ch
int 21h
seg1 ends
When I run the program through the debugger I saw that SP wil point to SP = 0000 after pop command is executed. Why the SP point to 0000? Is it because the max SP in the memory is FFFF and it just loop to the first point? (I know that SP will only increase or decrease by 2 because push and pop is always 2 byte) And will the program pop anythign at SP = 0000 when the command is executed?
I'm using a86 macro assembler, Oracle VM VirtualBox. Thank you.