This is just an example to show what I am attempting to do.
It's just a small portion of a larger project I have nearly completed,
but am now trying to tie the existing procedures together.
I want to pass the value of the variable proc1_var from procedure1
onto the stack into procedure2 to assign its value to
proc2_var. Since I don't have enough room in a register to
hold the value of a double word my limited knowledge of assembly
language programming is holding me up on this problem.
;Example Code
;*****************************************************************
procedure 1
.data
proc1_var dd 4.5
.code
push proc1_var ;Should this be OFFSET proc1_var?
call procedure2
;*******************************************************************
procedure2
.data
proc2_var dd ?
.code
pusha
pushf
mov bp, sp
;Attempt 1
;mov bx, [bp+20]
;mov proc2_var, bx
;Operand variables do not match is the message on above attempt
;Attempt 2
;mov bx, [bp+20]
;mov proc2_var, [bx]
;Illegal memory reference on above attempt(expected)
;Attempt 3
;mov bx, [bp+20]
;mov dx, [bp+22]
;mov proc2_var, [bx+dx]
;Again illegal memory reference(also expected)
I think at this point I am just trying blindly to guess as I
really am just confused on the matter. Any guidance or help
is greatly appreciated. Thanks in advance.