Jump to content

Local labels for a macro

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Monreal

Monreal

    Newbie

  • Members
  • PipPip
  • 21 posts
Hi, anybody knows if I can define a local label for a macro, how do i do that?

#2
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,252 posts
  • Location:C:\Countries\US
I don't know about TASM, but with MASM32, there's this 'local' syntax.

local label_name 

;; Then you use label_name here. 

For an example, this is my integer() macro:
integer macro a 

	LOCAL b 

	;; Defines an integer in memory with the value a and returns its memory address. 

	.data 

	ifnb <a> 

		b dd a 

	else 

		b dd 0 

	endif 

	.code 

	exitm <offset b> 

endm 

Once again, this is MASM32 code; I don't know how to use that in TASM.

#3
Gunner

Gunner

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
This should help:
Macros and Conditional Assembly

#4
Monreal

Monreal

    Newbie

  • Members
  • PipPip
  • 21 posts
Thanks guys, it really helped a lot




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users