The 'A - M' notation in the manual is correct, the contents of the memory (M) is subtracted from the accumulater (A) to set the flags. The result of the subtraction itself is not stored.
The memory value M depends on the addressing mode you use. For example in an immediate compare (CMP #$20) the memory value is the immediate data ($20). If some other form of addressing was used (CMP $70, CMP $1234, CMP ($70),Y, etc.) then CPU resolves the address to locate the memory value.
After the compare the flags tell you the relative sizes of the two values.
If A and M are the same (e.g. use BEQ to test for A == B ) then the subtraction will set the zero flag, otherwise it will be clear (e.g. use BNE to test for A != B).
If A and M are considered as unsigned values then if the carry flag is clear A was smaller then M (e.g. use BCC to test for A < M). It will be set if A was not smaller (e.g. use BCS to test for A >= M).