Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update GN_Crc API

...

Code Block
titleRST 20H, DEFW $7C09
--------- Iterate CRC-32 over local memory buffer -----------
IN:
    A = CRC_MEMA (0)
    HL = pointer to buffer (local memory), 
    BC = buffer size
    DE = 0, Initialize CRC-32 with FFFFFFFFh
    DE > 0, (local) pointer to initial 4-byte CRC-32

OUT, if call successful:
     Fc = 0
     DEBC = CRC-32 result (DE = high-word, BC = low-word)
OUT, if call failed:
     Fc = 1
     A = RC_BAD ($04) - bad argument

Registers changed after return:
     ......HL/IXIY same
     AFBCDE../.... different
-------------------------------------------------------------

-------- Iterate CRC-32 on open RAM file until EOF ----------
IN:
    A = CRC_FILE (1)
    HL = 0, no buffer
    HL > 0, pointer to file buffer (local memory),
    BC = buffer size (if HL > 0), or BC = max bytes to read (HL = 0)
    DE = 0, Initialize CRC-32 with FFFFFFFFh
    DE > 0, (local) pointer to initial 4-byte CRC-32
    IX = file handle of open file (usingwith GN_Opf) 

OUT, if call successful:
    Fc = 0,
    DEBC = CRC-32
    File pointer has reached EOF
OUT, if call failed:
    Fc = 1,
	A = RC_BAD ($04) - bad argument
    A = RC_xxx (file & handle related errors)
    RC_Eof is always set when complete CRC scan is done

Registers changed after return:
    ......HL/IXIY same
    AFBCDE../.... different
-------------------------------------------------------------

------- Iterate CRC-32 on File Entry in a File Card ---------
IN:
    A = CRC_EPFL (2)
    BHL = pointer to file entry
    DE = 0, Initialize CRC-32 with FFFFFFFFh
    DE > 0, (local) pointer to initial 4-byte CRC-32

OUT, if call successful:
    Fc = 0,
    DEBC = CRC-32
OUT, if call failed:
    Fc = 1,
	A = RC_BAD ($04) - bad argument
    A = RC_xxx (file card related errors)

 Registers changed after return:
    ......HL/IXIY same
    AFBCDE../.... different
-------------------------------------------------------------

...