Chisx
Chisx

Reputation: 1986

Declare local storage for more than 4 bytes x86 assembly MASM

There does not seem to be a way to declare 1 variable that can get more than 4 bytes allocated to the stack in x86 Assembly MASM, I locate my store like this

;METHOD 1
method1 PROC stdcall uses eax ebx, val1:dword
     LOCAL tempString, dTemp

I've tryed allocating bytes like this:

;METHOD 1
method1 PROC stdcall uses eax ebx, val1:dword
     LOCAL tempString byte 12 dup(?)
     LOCAL dTemp

but it causes error message A2008: syntax error : byte How can I allocate storage for one variable that's got more than 4 bytes allocated to the stack?

Like.. I don't understand why I cant simply allocate a string of bytes?

Upvotes: 5

Views: 1306

Answers (1)

Chisx
Chisx

Reputation: 1986

You can simply allocate multiple bytes using this syntax:

strTemp[12]:byte

The above statement would allocate 12 bytes to the stack identified by the identifier strtemp.

Upvotes: 3

Related Questions