Entry | |
---|---|
R0 | Decompress Flags |
R1 | Input size of file to be decompressed |
-1 >= do not return maximum output size |
Exit | |
---|---|
R0 | Required workspace size |
R1 | Maximum output size (if requested), or -1 if not asked or unable to determine |
Entry | |
---|---|
R0 | 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 |
Exit | |
---|---|
R0 | 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 |
The purpose of this call is to provide lossless decompression.
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.