home *** CD-ROM | disk | FTP | other *** search
- ; Library: ZSLIB
- ; Version: 3.6
- ; Module: INCRLW
- ; Version: 1.0
- ; Author: Gene Pizzetta
- ; Date: March 8, 1992
- ;
- ; INCRLW -- increments 4-byte (32-bit) binary number.
- ;
- ; Entry: HL = address of 32-bit binary number (4-bytes, low-byte first)
- ; Exit: Zero flag reset (NZ) if okay
- ; Zero flag set (Z) if overflow
- ; Uses: Flags
- ;
- PUBLIC INCRLW
- ;
- INCRLW: push hl ; save registers
- push bc
- ld b,4 ; 4 bytes
- LoopLW: inc (hl) ; increment byte
- jr nz,ExitLW ; (quit if it hasn't reach zero)
- inc hl ; point to next byte
- djnz LoopLW ; ..and do it again
- ExitLW: pop bc ; restore registers
- pop hl
- ret
- ;
- end