; @inreg A0 null-terminated string to write writeDebugString: MOVEM.L A1/D1-D3,-(SP) MOVE.L A0,A1 MOVEQ #0,D3 .keepCheckingForNull TST.B (A1)+ BNE .keepCheckingForNull MOVE.L A1,D3 SUB.L A0,D3 MOVE.L LogFileFH,D1 MOVE.L A0,D2 MOVE.L _DOSBase,A6 CALLLIB _LVOWrite MOVEM.L (SP)+,A1/D1-D3 RTS partToDebug: MOVE.L #LogFileName,D1 MOVE.L #MODE_NEWFILE,D2 MOVE.L _DOSBase,A6 CALLLIB _LVOOpen MOVE.L D0,LogFileFH MOVE.L #KeyboardDown,A0 BSR writeDebugString MOVE.L LogFileFH,D1 MOVE.L _DOSBase,A6 CALLLIB _LVOClose