wawavoun wrote:
In the listing I think there is no space after <'>.
The early Motorola assemblers used the convention of a prefix designating the type of a value.
Most well known is '$' to indicate a hexadecimal number.
Less well known is an apostrophe to indicate an ASCII character.
Unfortunately, they did not choose to implement the clearer convention of surrounding the character between two apostrophes, but that the character following is the literal value. This decision has unnecessarily made the specification of a space character into a fringe case.
To make matters worse, some assemblers refused to accept
Code:
ldaa #'A'
While the text editors at the time did not automatically delete training spaces on a line, reliance on the presence an "invisible" character is inviting disaster. If that trailing space is deleted, the literal value is a carriage return or line feed character depending on the conventions of the operating system for a text file.
Some people coded defensibly by
Code:
ldaa #$20
I used the following technique in my code:
Code:
ldaa #' space
The comment made the intent clear and protected the space character from accidental deletion.