ajksdf wrote
1. Does 'AM=M-1' having the same effect with 'A=M-1 A=A-1';
If you think about it, they can't have the same effect. The first one writes something to some location in RAM while the proposed alternative does not.
Try both pieces of code with some made up data.
A = 837
RAM[837] = 4903
executing
AM=M-1
results in
A = 4902
RAM[837] = 4902
on the other hand, executing
A=M-1
A = 4901
RAM[837] = 4902
and following that with
A=A-1
yields
A = 4900
RAM[837] = 4902
You need to be willing to kill a few trees and work your code by hand to see if it does what you want it to. While this is especially true when you are first learning this stuff, it remains true, just not as strongly, no matter how long you do this stuff. Working at the assembly language level is so far below how humans think that it takes effort to force ourselves to do it and we are prone to mistakes if we try to do it in our heads. We get a lot better at it with practice, but there will still be times that we simply need to force ourselves to play computer and do it step by step.