TestAIFFChunk
Synopsis
result = TestAIFFChunk(data)
D0 A0C Prototype
There is no direct C prototype exported for this function. It is called internally from assembly.
Description
Validates whether the data at the current position represents a valid IFF chunk. The function checks that the 4-byte chunk identifier at the given address falls within the valid ASCII range (between “AAAA” and “ZZZZ”). This is a quick sanity check to ensure that the pointer is positioned at a legitimate chunk boundary.
Inputs
- data (A0) — Pointer to the current position in the IFF data, expected to point to a chunk header.
Result
- result (D0) — If non-zero, the data at the position is a valid IFF chunk. If zero, the data is not a valid chunk (the zero flag in the condition codes is set).
See Also
Implementation
The original 68020 assembly implementation:
; Rel.1.1 - Jul 29 1991 --- TestAIFFChunk()
_LVOTestAIFFChunk
move.l a1,-(sp)
move.l (a0),d0
lea "AAAA",a1
cmp.l a1,d0
bmi.s CheckAChunk_Error
lea "ZZZZ",a1
cmp.l a1,d0
bhi.s CheckAChunk_Error
move.l (sp)+,a1
rts
CheckAChunk_Error
moveq #0,d0
move.l (sp)+,a1
rts