;*****************************************************
;---------------------- STACK FIX --------------------
;*****************************************************
STACK_FIX PROC NEAR
MOV BX, [SI+2] ; Move the content of si+2 into bx
MOV LOC, SP; save the location of stack pointer
MOV SP, 500H; move to a clean memory location
ADD SP, CX ; CX initially = 0 This counts up so i dont overwrite what I have pushed on the stack
PUSH BX ; stack goes down 2
INC CX; I increment cx twice so on the next run bx will be pushed to memory location 500, then it will run again going to 502,504,506 ect
INC CX
MOV SP,LOC; mov the stack pointer back the original memory location
RET
STACK_FIX ENDP
*********************************************************
Am I not allowed to do this? I've been working on this for 8 hours straight.
I then later call a procedure that pops the info off the stack starting at 500h. It doesn't return the values that were in bx that i pushed on the stack.
thanks
;---------------------- STACK FIX --------------------
;*****************************************************
STACK_FIX PROC NEAR
MOV BX, [SI+2] ; Move the content of si+2 into bx
MOV LOC, SP; save the location of stack pointer
MOV SP, 500H; move to a clean memory location
ADD SP, CX ; CX initially = 0 This counts up so i dont overwrite what I have pushed on the stack
PUSH BX ; stack goes down 2
INC CX; I increment cx twice so on the next run bx will be pushed to memory location 500, then it will run again going to 502,504,506 ect
INC CX
MOV SP,LOC; mov the stack pointer back the original memory location
RET
STACK_FIX ENDP
*********************************************************
Am I not allowed to do this? I've been working on this for 8 hours straight.
I then later call a procedure that pops the info off the stack starting at 500h. It doesn't return the values that were in bx that i pushed on the stack.
thanks