TASM help

Hi there! I'm a bit new to all this, so please be patient with me. I have the following codes and I like to learn what it does...

MyMacro MACRO arg1, arg2, arg3, arg4, arg5
back=arg3 or arg4
if back
mov cl, [esi+&arg2+&arg5]
...
ENDM

Q1: am I correct to assume back is the result "var" (for assembly)
when you OR the bits of arg3 and arg4 together?

Q2: &arg2 and &arg5 are assembly way of referencing the actual value
pass in to the macro and the whole thing is added up with esi and the
content of that address is then moved to CL?

Comments

  • : Hi there! I'm a bit new to all this, so please be patient with me. I have the following codes and I like to learn what it does...
    :
    : MyMacro MACRO arg1, arg2, arg3, arg4, arg5
    : back=arg3 or arg4
    : if back
    : mov cl, [esi+&arg2+&arg5]
    : ...
    : ENDM
    :
    : Q1: am I correct to assume back is the result "var" (for assembly)
    : when you OR the bits of arg3 and arg4 together?

    [blue]Correct.
    [/blue]

    :
    : Q2: &arg2 and &arg5 are assembly way of referencing the actual value
    : pass in to the macro and the whole thing is added up with esi and the
    : content of that address is then moved to CL?
    :
    [blue]Correct also. Example of macro call:

    MyMacro 1,2,3,4,5

    that will be (after replacement):

    back=3 or 4
    if back
    mov cl, [esi+2+5]

    after some preprocessing it will turn into this:

    back=7
    if back
    mov cl, [esi+7]

    [/blue]


  • Thank you for your reply!!

    I'm a bit confused with the last little bit.

    : back=7
    : if back
    : mov cl, [esi+7]

    if back <-- doesn't this looks for a 1 or a 0 for var 'back'? But the line above has back=7?

    Can you also suggest a good tutorial book or online site that would help me understand this type of syntax more? I am having difficulties trying to get tutorials on my own. Also, is there a 32-bit version of Emu8086 out there?

    =======
    : : Hi there! I'm a bit new to all this, so please be patient with me. I have the following codes and I like to learn what it does...
    : :
    : : MyMacro MACRO arg1, arg2, arg3, arg4, arg5
    : : back=arg3 or arg4
    : : if back
    : : mov cl, [esi+&arg2+&arg5]
    : : ...
    : : ENDM
    : :
    : : Q1: am I correct to assume back is the result "var" (for assembly)
    : : when you OR the bits of arg3 and arg4 together?
    :
    : [blue]Correct.
    : [/blue]
    :
    : :
    : : Q2: &arg2 and &arg5 are assembly way of referencing the actual value
    : : pass in to the macro and the whole thing is added up with esi and the
    : : content of that address is then moved to CL?
    : :
    : [blue]Correct also. Example of macro call:
    :
    : MyMacro 1,2,3,4,5
    :
    : that will be (after replacement):
    :
    : back=3 or 4
    : if back
    : mov cl, [esi+2+5]
    :
    : after some preprocessing it will turn into this:
    :
    : back=7
    : if back
    : mov cl, [esi+7]
    :
    : [/blue]
    :
    :
    :
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories