字符常量

当您要将代码用于特定字符时,将使用字符常量。

要指定 ASCII 字符常量,请在常量前添加前缀'(单引号)。 字符常量可以出现在允许算术常量的任何位置,但一次只能指定一个字符常量。 例如'A表示字符 A 的 ASCII 代码。

当您希望将特定字符的代码用作常量时,字符常量很方便,例如:

cal 3,'X(0)
# Loads GPR 3 with the ASCII code for
# the character X (that is, 0x58).
# After the cal instruction executes, GPR 3 will
# contain binary
# 0x0000 0000 0000 0000 0000 0000 0101 1000.