flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Variables

Author
Thread Post new topic Reply to topic
Manos



Joined: 24 Aug 2003
Posts: 35
Location: Greece
Manos 23 May 2004, 14:01
Is it possible to define local variables
inside of procedure like MASM ?

Manos.
Post 23 May 2004, 14:01
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 23 May 2004, 15:32
yes

For example
Code:
  proc MessageWindow,hwnddlg, msg, wparam, lparam
  .lvfi LV_FINDINFO
  .hList rd 1
  .h1011 rd 1
  .h1012 rd 1
  .h1013 rd 1
  .h1014 rd 1
  .h1015 rd 1
  .h1016 rd 1
        enter        
....
endp
    
Post 23 May 2004, 15:32
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Manos



Joined: 24 Aug 2003
Posts: 35
Location: Greece
Manos 23 May 2004, 16:55
OK roticv.

Thanks you.

Regards,
Manos.
Post 23 May 2004, 16:55
View user's profile Send private message Visit poster's website Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 01 Jun 2004, 12:06
Hello!

I use this kind of local labels in my procedures. This way similar procedures can use same local labels.


;***********************
;procedure Myprocedure
;***********************

Myprocedure:

jmp .start ;skip local labels

;---------------------
;local label definitions
.x
.y
.color
.screen_width

;-----------------------

.start: ;actual code starts


;here's the code itself
;.......

ret ;end of procedure

regards
Mac2004
Post 01 Jun 2004, 12:06
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 01 Jun 2004, 13:05
But you have local variables inside code and thus you need to have writeable code section.
Local variables are normally located on stack.
Post 01 Jun 2004, 13:05
View user's profile Send private message Yahoo Messenger Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 03 Jun 2004, 06:08
I just wrote a small skeleton procedure to illustrate my approach. Of course there are several other ways of using local variables. This is my way and makes coding more standard at the stage of writing.

Anybody else using other method??

regards,
Mac2004
Post 03 Jun 2004, 06:08
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.