PG1995
Active Member
Hi
I have just tried to write my first assembly program for 8051 and sadly it's all errors! It seems one can't copy value from one Rx register to some other Rx register. Is this correct? The book I use didn't mention this. I wonder why.
When I learned basic C++ I was able to enclose multi-line comment within /* comment */. Is there something like this in the assembly too?
Please help me with the queries above. Thank you.
Errors
I have just tried to write my first assembly program for 8051 and sadly it's all errors! It seems one can't copy value from one Rx register to some other Rx register. Is this correct? The book I use didn't mention this. I wonder why.
When I learned basic C++ I was able to enclose multi-line comment within /* comment */. Is there something like this in the assembly too?
Please help me with the queries above. Thank you.
Code:
;move some hex value, e.g. 89H to register A of CPU. Then from register A
;move it to all registers of RAM, i.e. R0 - R7.
ORG 0H ;start at memory location 0H
Mov A, #89H
Mov R0, A
Mov R1, R0
Mov R2, R1
Mov R3, R2
Mov R4, R3
Mov R5, R4
Mov R6, R5
Mov R7, R6
END ;program ends here
Errors
Code:
Compiling file: program1.asm
Initializing pre-processor ...
Syntax error at 9 in program1.asm: Invalid set of operands: mov R1,R0
Syntax error at 10 in program1.asm: Invalid set of operands: mov R2,R1
Syntax error at 11 in program1.asm: Invalid set of operands: mov R3,R2
Syntax error at 12 in program1.asm: Invalid set of operands: mov R4,R3
Syntax error at 13 in program1.asm: Invalid set of operands: mov R5,R4
Syntax error at 14 in program1.asm: Invalid set of operands: mov R6,R5
Syntax error at 15 in program1.asm: Invalid set of operands: mov R7,R6
Pre-processing FAILED !
Creating code listing file ... -> "program1.lst"
7 errors, 0 warnings