h6. [[Squash]] h6(. » [[Squash SWI Calls|SWI Calls]] h6((. » Squash_Compress h2. Squash_Compress h5. (SWI &42700) h5. Use Case 1 - bit 3 of R0 is set |_<^{width:4em}. Entry | | |<^. R0 |<^. [[Squash_Compress Flags and Status|Compress Flags]] | |/2<^. R1 |<^. Input size of file to be compressed | |<^. -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_Compress Flags and Status|Compress 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_Compress Flags and Status|Compress 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 compression. 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. Then call repeatedly with R0 bit 3 clear until all the data is processed (as reported via the status bits returned in R0). 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_Compress Flags and Status]]