title Module from library BASE_1 : DECRRN name ('DECRRN') maclib baselib.lib ; Decrement random record number - 24 bit value ; Copyright (C) Werner Cirsovius ; Hohe Weide 44 ; D-20253 Hamburg ; Tel.: +49-40-4223247 ; Version 1.0 September 1991 ; ENTRY Accu and reg pair HL hold value ; Accu holds high byte ; EXIT Accu and reg pair HL hold value decremented by one entry decrrn decrrn: push bc ld b,a or l ; Ignore zero or h ld a,b pop bc ret z bit 7,h ; Mark sign of middle byte dec hl ; Decrement low and middle ret nz ; .. end on ole bit set bit 7,h ; Test carry ret z ; .. nope dec a ; Bump ret end