xxx macro "SAMPLE"
for
; step character to character S, next A, next M....
endm
hi
here is a simple example
i hope i can help you
greets
[attachment deleted by admin]
not.
I thing FORC
FORC char,string
endm
And next problem:
if char="a"
elseif char="b"
endif
how to work this in macro?
xxx macro p1
forc char,p1
if char="S" ; <---- not work
endif
endm
endm
xxx "SAMPLE"
mean you this
I do not understand that which you to say want thereby :wink
you can become more concrete
String macro args:VARARG
mov edx,args
@@:
xor eax,eax
mov al,byte ptr [edx]
or al,al
jz @F
push edx
.if eax=="S"
.elseif eax=="A"
.elseif eax=="M"
.elseif eax=="P"
.elseif eax=="L"
.elseif eax=="E"
.endif
pop edx
inc edx
jmp @B
@@:
endm
korte,
I’m not sure what you are trying to do, so I’m guessing that you want to process the characters of the string at compile time.
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
forcex MACRO quotedstring
 FORC char, <quotedstring>
  IFIDN <char>, <">
   echo "
  ELSEIFIDN <char>, <S>
   echo S
  ELSEIFIDN <char>, <A>
   echo A
  ELSEIFIDN <char>, <M>
   echo M
  ELSE
   echo ?
  ENDIF
 ENDM
ENDM
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  .data
  .code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  forcex "SAMPLE"
  inkey "Press any key to exit..."
  exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
Assembling: C:\masm32\My\_TRY\kortexxx.asm
"
S
A
M
?
?
?
"
YES!
thanks MichaelW