News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Warning: I think I am less confused.

Started by Evan, December 05, 2013, 12:48:59 PM

Previous topic - Next topic

Evan


define:
        xor EAX+00001b
xor EAX EAX


   xor EAX EAX




   xor CS CS+000001b
XOR CS CS
   xor DS DS+000001b
XOR DS DS
   xor ES ES+000001b
XOR ES ES
   xor FS FS+000001b
XOR FS FS
   xor GS GS+000001b
XOR GS GS
   xor SS SS+000001b
XOR SS SS

end define:

Evan


dedndave

none of that makes any sense
explain what you are trying to do

Magnum

It looks likes he's trying to zero out everything ?
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Evan

xor hates me.

1.asm(47) : error A2008: syntax error : in instruction
1.asm(48) : error A2008: syntax error : in instruction
1.asm(51) : error A2008: syntax error : in instruction
1.asm(56) : error A2008: syntax error : in instruction
1.asm(57) : error A2008: syntax error : in instruction
1.asm(58) : error A2008: syntax error : in instruction
1.asm(59) : error A2008: syntax error : in instruction
1.asm(60) : error A2008: syntax error : in instruction
1.asm(61) : error A2008: syntax error : in instruction
1.asm(62) : error A2008: syntax error : in instruction
1.asm(63) : error A2008: syntax error : in instruction
1.asm(64) : error A2008: syntax error : in instruction
1.asm(65) : error A2008: syntax error : in instruction
1.asm(66) : error A2008: syntax error : in instruction
1.asm(67) : error A2008: syntax error : in instruction

start:                          ; The CODE entry point to the program

    print chr$("Hey, this actually doesn't works.",13,10)
    print chr$("_________________________",13,10)
    print chr$("____/\_____________/\____",13,10)
    print chr$("______o___________o______",13,10)
    print chr$("____________I____________",13,10)


;define:
        xor EAX+00001b
    xor EAX EAX
   xor CS CS+000001b
XOR CS CS
   xor DS DS+000001b
XOR DS DS
   xor ES ES+000001b
XOR ES ES
   xor FS FS+000001b
XOR FS FS
   xor GS GS+000001b
XOR GS GS
   xor SS SS+000001b
XOR SS SS

;end define:


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

exit

jj2007

Hi Evan,

You cannot redefine Masm keywords, such as the xor mnemonic. If you want to get an idea what is possible with macros and defines, check here (all that assembles with ML 6.15 ... 10.0 and JWasm).

dedndave

let's start with one register   :t
        xor     eax,eax

the first word, "xor" is the instruction
the second word, "eax" is the destination operand
the third word, "eax" is the source operand
the destination and source operands are seperated by a comma ","

in the case above, the contents of the source operand are XOR'ed onto the contents of the destination operand
because they are the same value, the result will be 0 (the nature of the XOR operation)

i don't think you can do that with the "segment" registers
only a few instructions work with those registers (MOV, PUSH, POP - maybe a couple others)

another example of XOR....
        xor     eax,1

in this case, the value "1" is the source operand
EAX is altered by inverting bit 0

dedndave

"define" is probably not a good choice of names for the entry point
use "start" or "main"

start:

;code here

        end     start


notice that the label has a colon ":"
the reference to the label does not

dedndave

build as a console app.....
        INCLUDE    \Masm32\Include\Masm32rt.inc

;###############################################################################################

        .DATA

dwTest  dd 0F0F0F0Fh

;***********************************************************************************************

        .DATA?

;###############################################################################################

        .CODE

;***********************************************************************************************

_main   PROC

        print   uhex$(dwTest),13,10

        xor     dwTest,5A5A5A5Ah

        print   uhex$(dwTest),13,10

        mov     eax,dwTest
        xor     eax,eax

        print   uhex$(eax),13,10

        print   chr$(13,10)
        inkey
        INVOKE  ExitProcess,0

_main   ENDP

;###############################################################################################

        END     _main