2

I am writing a program in which the requirements are as follows:

Has a string variable called Name that is set to your full name, including spaces.
Clears the AL register only, NOT the rest of the EAX register.
Loops through each character in the Name variable.
Combines each character using the XOR command.
Stores the final XOR result in the AL register.
Includes a DumpRegs command at the end of the program.

I've been trying to get this correct and have been trying to use examples in the book, however, I just keep getting errors. Here is what I have:

INCLUDE Irvine32.inc


.data

name BYTE "Joe Smith" , 0   ; 
temp BYTE SIZEOF name DUP(0)

.code
main PROC
    mov al,0
    mov esi,0
    mov ecx,SIZEOF name

Combine:
    xor al,name[esi]
    inc esi
    loop Combine

    Call DumpRegs

    exit            ; exit to operating system
main ENDP
END main

And I am getting the errors: enter image description here

rkhb
  • 14,159
  • 7
  • 32
  • 60
Moxy
  • 171
  • 1
  • 3
  • 12

1 Answers1

6

name is a reserved symbol - change it to something else, e.g. name_buff.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • 1
    Thank you - not sure why the teacher wanted us to name the variable that when it's reserved. – Moxy May 12 '15 at 22:39
  • 2
    Maybe the assignment was originally for a different assembler, or maybe the teacher just doesn't know as much they should about the subject. Everyone's fallible though (apart from me, of course). ;-) – Paul R May 12 '15 at 22:44