h6. [[Squash]] h6(. » [[Squash SWI Calls|SWI Calls]] h6((. » Squash_Decompress h2. Squash_Decompress h5. (SWI &42701) h5. Use Case 1 - bit 3 of R0 is set |_<^{width:4em}. Entry | | |<^. R0 |<^. [[Squash_Decompress Flags and Status|Decompress Flags]] | |/2<^. R1 |<^. Input size of file to be decompressed | |<^. -1 >= do not return maximum output size | |_<^{width:4em}. Exit | | |<^. R0 |<^. Required workspace size | |<^. R1 |<^. Maximum output size (if requested), or -1 if not asked or unable to determine | h5. Use Case 2 - bit 3 of R0 is clear |_<^{width:4em}. Entry | | |<^. R0 |<^. [[Squash_Decompress Flags and Status|Decompress Flags]] | |<^. R1 |<^. Workspace pointer | |<^. R2 |<^. Input pointer | |<^. R3 |<^. Number of bytes of input available | |<^. R4 |<^. Output pointer | |<^. R5 |<^. Number of bytes of output space available | |_<^{width:4em}. Exit | | |<^. R0 |<^. [[Squash_Decompress Flags and Status|Decompress Status]] | |<^. R1 |<^. Preserved | |<^. R2 |<^. Pointer to first unused input byte | |<^. R3 |<^. Input bytes unused | |<^. R4 |<^. Pointer to first unused output byte | |<^. R5 |<^. Unused output space remaining | h4. Use The purpose of this call is to provide lossless decompression. h4. Notes Call this SWI initially with R0 = 8 and R1 = input file size, using the sizes it reports to allocate workspace and output buffers as appropriate. Note that the current algorithm always returns R1 = -1, so you must get this size by some other means. Then call repeatedly with R0 bit 3 clear until all the data is processed (as reported via the status bits returned in R0). If the input is exhausted (R3 < 12, R0 bit 1 set) the unused input must be resupplied. If all the input data can be presented at once (R0 bits 0,1 clear) and the output buffer is large enough, a faster algorithm is used. h4. See also * [[Squash_Decompress Flags and Status]]