home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / COMDH.AZM / COMDH.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  640 b   |  30 lines

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ;         Compare HL to DE.
  4. ; Return zero if equal, carry if DE > HL
  5. ;
  6. ;            Written         R.C.H.     16/8/83
  7. ;            Last Update    R.C.H.       04/04/84
  8. ;----------------------------------------------------------------
  9. ;
  10.     name    'comdh'
  11. ;
  12.     public    comdh
  13.     maclib    z80
  14. ;
  15. comdh:
  16.     push    b
  17.     mov    b,a            ; save accumulator
  18.     mov    a,h
  19.     cmp    d            ; generate a carry if D > H
  20.     jrc    dbigh            ; d > h
  21.     mov    a,l
  22.     cmp    e            ; A carry may be made here too
  23. dbigh:
  24.     mov    a,b            ; restore old accumulator
  25.     pop    b            ; restore
  26.     ret
  27. ;
  28.     end
  29.  
  30.