flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > a problem with "common" directive |
Author |
|
zjlcc 26 Dec 2004, 07:27
Code: include '%fasminc%\win32ax.inc' .code start: macro m_message [param1] { ; common ; mov eax,param1 forward mov eax,param1 } m_message 11111h,22222h,33333h invoke ExitProcess,0 .end start Code: 00401000 >/$ B8 11110100 MOV EAX,11111 00401005 |. B8 22220200 MOV EAX,22222 0040100A |. B8 33330300 MOV EAX,33333 0040100F |. 6A 00 PUSH 0 ; /ExitCode = 0 00401011 \. FF15 35204000 CALL [402035] ; \ExitProcess |
|||
26 Dec 2004, 07:27 |
|
vbVeryBeginner 26 Dec 2004, 13:13
well zjlcc, did u try to understand the problem?
Code: macro m_message [param1] { ; common ; mov eax,param1 ; forward ;<- don't need to write this too coz it is default directive mov eax,param1 } |
|||
26 Dec 2004, 13:13 |
|
vid 26 Dec 2004, 14:55
vb: when you use group argument in common section, then it is replaced by all arguments:
Code: macro def [a] { common db a } def 1,2,3,4 gets assembled to Code: db 1,2,3,4 check my preprocessor tutorial |
|||
26 Dec 2004, 14:55 |
|
vbVeryBeginner 26 Dec 2004, 20:03
hi vid, i don't know if i get u correctly,
Code: macro m_message [param1] { common mov eax,param1 } m_message 0x11,0x22,0x33 does this mean, this can't be assembled is because of the "comma (,)" coz when processed it would be translated into mov eax,0x11,0x22,0x33? so, unless we have a macro that let mov support the "comma (,)" for more parameters. Code: macro mov2 op1,op2,op3,op4 { mov op1,op2 mov op1,op3 mov op1,op4 } macro m_message [param1] { common mov2 eax,param1 reverse mov eax,param1 } m_message 0xFFFFF,0xFEEEE,0xFDDDD 004020AF |. B8 FFFF0F00 MOV EAX,0FFFFF ;mov2 004020B4 |. B8 EEEE0F00 MOV EAX,0FEEEE ;mov2 004020B9 |. B8 DDDD0F00 MOV EAX,0FDDDD ;mov2 004020BE |. B8 DDDD0F00 MOV EAX,0FDDDD ;reverse 004020C3 |. B8 EEEE0F00 MOV EAX,0FEEEE ;reverse 004020C8 |. B8 FFFF0F00 MOV EAX,0FFFFF ;reverse |
|||
26 Dec 2004, 20:03 |
|
vid 26 Dec 2004, 22:25
Quote: does this mean, this can't be assembled is because of the "comma (,)" coz when processed it would be translated into yes (if i understood your english right). Really try reading that tutorial, there can be many things you won't find out by yourself so soon. |
|||
26 Dec 2004, 22:25 |
|
vbVeryBeginner 27 Dec 2004, 04:57
yup, i guess u understood my english :[o],
well, i am reading the fasm manual too Quote:
sounds like they masked those secrets with simple words :p anyway, thanks for confirming my understanding |
|||
27 Dec 2004, 04:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.