3 ms·
Nice article! Back in the day I wrote 10s of thousands of lines of Z80 assembler - it was my first actual paid job after university. You got to know each regi
by nickcw 6y ago
Nice article!
Back in the day I wrote 10s of thousands of lines of Z80 assembler - it was my first actual paid job after university.
You got to know each register - they have their own character - need a loop - well you need B and DJNZ, need programmable IO, well you need C then, etc
I still have a soft spot for the Z80!
Reading that article I learnt some great techniques! The code I was writing always used the alternate register bank for interrupt handling so you could have really fast save and restore registers.
I never thought of using them to pass parameters and doing fast arithmetic - very neat!
; ADD ROUTINE 32+32BIT=32BIT
; H'L'HL = H'L'HL + D'E'DE
; CHANGES FLAGS
;
ADD32:
ADD HL,DE ; 16-BIT ADD OF HL AND DE
EXX
ADC HL,DE ; 16-BIT ADD OF HL AND DE WITH CARRY
EXX
RET