ASM Diaries 4: Don’t Optimise Error Paths
This piece should really be called ‘optimise the path which is not the error path’ but that’s a very unsexy title. The point here is that your code’s error path is (usually) executed a single time before returning to the user for input. That says that it’s not time-sensitive and you don’t need to optimise …. Read More
ASM Diaries 3: Eliminate Jumps by Pre-loading
Writing the code to validate ranges in type definitions in Quiche-Z80 I needed to test for some values. I could easily handle the cases where both values where unsigned or both values where signed but the case where one was signed and the other unsigned allowed a nice little optimisation. Due to the typing rules …. Read More
ASM Diaries 2: A Hack for Case Insensitive Identifiers
This article will make a lot more sense with an ASCII table to look at. I don’t have quick access to a copyright free one, but you view one at https://www.asciitable.com Case insensitive comparisons in assembler are hard work. The design of the ASCII codes splits letters into two blocks. That requires your code to …. Read More
ASM Diaries 1: Type Identifier Equals Data Length
A few years ago I reverse engineered Amstrad CPC BASIC. I’m currently writing a compiler for my Pascal-like language (called Quiche). This is an occasional series of articles where I note observations about assembly programming and, in particular, Z80 assembly language. This is a trick I learnt while reverse engineering the Amstrad BASIC interpreter. The …. Read More