寫Assembly用到Marco就試過N次,之前都係用到點就學到邊,無了解過佢嘅邊界,而家差唔多去到要為自己嘅assembler研發marco,所以要先睇下HLA嘅Marco大約可以做到啲乜。沙田圖書館係有唔少好書。
書中講左句: 啲人係用Assembler嘅Marco有幾勁黎判斷個assembler有幾勁,無錯,啲人確實係甘諗。以下就係關於assembler功能上嘅總結:
- Compile Time Operators. (E.g. : +-*/, <<, >> =, <>)
- Operator Precedence and Associativity (E.g. : !, -, div, mod)
- Compile Time Functions
- Type conversion
- Numeric functions
- Character-Classification functions (E.g. : isAlpha, isDigit, isSpace)
- String functions
- Symbol information (E.g. : @size, @define @typeName, @elements, @elementSize)
- Misc compile time functions (E.g. : @odd, @lineNumber, @text)
- Compile-Time type conversions of text objects (類似php嘅多重嵌套變數, $$a)
- Conditional compilation (Compile-Time decisions) (E.g. : #if)
- Repetitive compilation (E.g. : #for)
- Marcos (自己定義新Marco)