Hello you MASMers out there.

I would like to know how to put labels in .data sections or how to be able to reference a variable with more than one name.


Something like this:




.data

_switch:
case00 dd _do_case_00
case01 dd _do_case_01
case02 dd _do_case_02


.code
.
.
.
_do_case_00:
.
.
.
_do_case_01:
.
.
.
_do_case_02:
.
.
.
end




What I would like to do is to be able to reference offset of variable "case00" both as "case00" and "_switch"



.code
.
.
.
mov eax, offset _switch; instead of mov eax, offset case00
.
.
.
end
Posted on 2003-12-17 04:19:07 by Waka
ptr1 dd offset foo
Posted on 2003-12-17 04:26:56 by evlncrn8
Sorry, evlncrn8

I edited the post as I found the solution myself. You responded to the unedited post before I was able to edit it !
Posted on 2003-12-17 04:32:44 by Waka
What about


_switch equ <case00>
Posted on 2003-12-17 04:48:30 by roticv
Waka,

You do not say what the problem is. That would be a great help. However, I can see that you should use _switch LABEL DWORD for the label in the data section. Ratch
Posted on 2003-12-17 04:50:52 by Ratch
Thanks, Ratch

That was EXACTLY what I needed !
Posted on 2003-12-18 11:44:04 by Waka