04-bootsector-stack
mov ah, 0x0e
mov bp, 0x8000
mov sp, bp
push 'A'
mov al, [0x8000]
int 0x10 ; can't
mov al, [0x7ffe]
int 0x10 ; print A
push 'B'
mov al, [0x8000]
int 0x10 ; can't
mov al, [0x7ffe]
int 0x10 ; print A
mov al, [0x7ffd]
int 0x10 ; can't
mov al, [0x7ffc]
int 0x10 ; print B
jmp $
times 510-($-$$) db 0
dw 0xaa55
I can get A A B,so i think we can access element in stack by using pointer.
- why dont you use
pop al? - what is your question?
- why dont you use
pop al?- what is your question?
in boot_sect_stack.asm file, say
; however, don't try to access [0x8000] now, because it won't work
; you can only access the stack top so, at this point, only 0x7ffe (look above)
mov al, [0x8000]
int 0x10
so i try to use point to access the element of the stack. From my example, it is indeed possible to use pointers to obtain non-top elements.
thanks for the reply!
I don't understand why mov al, [0x7ffe] wouldn't work in the first place, so it makes sense that you can print A A B
I don't understand why
mov al, [0x7ffe]wouldn't work in the first place, so it makes sense that you can printA A Bmov al, [0x7ffe]can work sorry, print isA A B
ok so what is your question again?