Hello I'm attempting to learn to use assembly routines through Qbasic, I found the following example from a tutorial which I followed. It's a simple program that will add four to a number placed on the stack by Qbasic. But I cannot understand why He used 'mov bp,sp' what does that mean? What does 'mov the stack pointer to base pointer' actually say? I figured to access something on the stack you'd use just the stack pointer, and why doesn't he use SS in this working example?
what exactly does SP point to then? Can anyone explain the stack and the methods of accessing things on it, thanks I really appreciate any help.
------------------------------------------------------------
.model medium, basic
.stack 200h
.386
.code
public AddFour
; Our stack:
; Number 6
; QB Seg 4
; QB Off 2
; BP 0
AddFour proc
push bp
mov bp, sp
mov ax, [bp+6]
add ax, 4
pop bp
ret 2
AddFour endp
end
-----------------------------------------------------------
what exactly does SP point to then? Can anyone explain the stack and the methods of accessing things on it, thanks I really appreciate any help.
------------------------------------------------------------
.model medium, basic
.stack 200h
.386
.code
public AddFour
; Our stack:
; Number 6
; QB Seg 4
; QB Off 2
; BP 0
AddFour proc
push bp
mov bp, sp
mov ax, [bp+6]
add ax, 4
pop bp
ret 2
AddFour endp
end
-----------------------------------------------------------