Hi Assemblers,
I was wondering, in high-level languages we initialize local
variable sometimes like this (java):
now I know in Assembly we have the local directive, but how do we
initialize the variable??
doing this seems a bit long winded and pointless really because then we have to count the amount of chars for initialising the next var:
is there a quicker way? or is the a nice clean way to initialize local vars?
Appreciate any feedback || suggestions || corrections.
Kunal.
I was wondering, in high-level languages we initialize local
variable sometimes like this (java):
Code:
public static func(int param1, int param2)
{
String errMsg = "An error occurred";
// other code
}
initialize the variable??
Code:
/* doesnt work */
func proc, param1:word, param2:word
LOCAL errMsg:byte "An error occured",0
/* doesnt work */
func proc, param1:word, param2:word
LOCAL errMsg byte "An error occured",0
/* using both combos above, doesnt work */
func proc, param1:word, param2:word
LOCAL errMsg:byte <"An error occured",0>
Code:
func proc, param1:word, param2:word
mov byte ptr [ebp-4], "An error occured"
Appreciate any feedback || suggestions || corrections.
Kunal.