title Module from library HILIB_1 : DEL1MS name ('DEL1MS') maclib baselib.lib ; Language : PASCAL ; Delay 1 Millisecond ; Copyright (C) Werner Cirsovius ; Hohe Weide 44 ; D-20253 Hamburg ; Tel.: +49-40-4223247 ; Version 1.0, December 1987 ; ENTRY None ; EXIT None entry del1ms ; Delay constant for a 4MHz clock ; Calculated by: ; Inner loop : 6+4+4+10=24 states ; Outer loop : 10+10 =20 states ; State time : 1/CLOCK [in usec] ; Results in : (24*DELFAC+20)/CLOCK=1000usec ; or (6*DELFAC+5) /CLOCK= 250usec del1ms: ld hl,(clock*250-5)/6 @deli: dec hl ; Count down ld a,l or h jp nz,@deli ret end