ivant wrote
Even though it looks like expressions, these are actually names. A=M, A=M+1, M=M-1 are valid assembly command, while A=M+0, M=M-2, A = M (spaces are not allowed) are not. The book/course material specifies the valid ones.
A = M is an allowed instruction since white space is ignored. Similarly A D = M - 1 is acceptable.
Also, the author's emulator will accept both D+M and M+D as the same mnemonic, although that is not strictly compliant with their own language definition.
Somewhat oddly, their emulator strictly enforces the order of the destination registers, meaning what while AM = D+1 is acceptable, MA = D+1 is not. This is particularly unfortunate because the order defined for the assembly language, AMD, is not the same as the order of the bits in the instruction word, ADM.