Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
My code is:
ASM
org 0
    mov a,r0
    mov r0,a
    mov r1,a
    mov r2,a
end


"a" - accumulator
"r0 - r2" - internal memory registers

I'm using asm51 compiler, and load .hex file in fd51.exe


Is it possible to put 3-rd,4-th and 5-th rows into one, something like "mov (r0,r1,r2),a"?
Posted
Updated 4-Nov-14 8:59am
v2
Comments
Kornfeld Eliyahu Peter 4-Nov-14 16:08pm    
Let imagine that you can...What do you expect that kind of command will do? Set all of r0, r1 and r2 to a?
Sergey Alexandrovich Kryukov 4-Nov-14 17:23pm    
Let me tell you: there are many controllers in the worlds, not just one; same goes about the languages and architectures (instruction sets). How can we know what you are talking about?
—SA

1 solution

Yes you can just use :
ASM
org 0
    mov a,r0
    mov r2,a
end

Since the instructions in between are redundant, and have no effect.

You should be aware that most of programming is like mathematics and there are only two sides to an equation/operation, and if you don't do something useful in between you can factor the middle operations out.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900