Example of storing data in a small amount of space Suppose our data contains data about bowling scores: columns contents 1-8 ID number (8 digits) 9-10 spaces 11 League (1, 2, 3 or 4) 12-13 spaces 14-16 Score 1 (0--300) 17-18 spaces 19-21 Score 2 (0--300) 22-23 spaces 24-26 Score 3 (0--300) 27-28 spaces 29 Seniority (0, 1, 2 or 3+ years) 30-31 spaces 32 Active Status (Y or N) We want to store all of this data in a table. We will store the ID as 4 bytes binary. We will store League as 2 bits. We will store Seniority as 2 bits (subtracting 1). We will store each score as 9 bits. We will store Active Status as 1 bit (0 = N, 1 = Y). This comes to a total of 8 bytes. We will have a DSECT for the table entries: ENTRY DSECT ID DS XL4 BYTE1 DS X BYTE2 DS X BYTE3 DS X BYTE4 DS X BYTE1 will contain League (2 bits) and the first 6 bits of Score 1. BYTE2 will contain the last 3 bits of Score 1 and the first 5 bits of Score 2. BYTE3 will contain the last 4 bits of Score 2 and the first 4 bits of Score 3. BYTE4 will contain the last 5 bits of Score 3, Seniority (2 bits) and Status (1 bit). We will need: TABLE DS 20CL8 TEMP DS D To handle ID, we need: PACK TEMP(8),BUFFER(8) CVB 4,TEMP STCM 4,B'1111',ID For each of the other pieces of information, we need to use PACK and CVB to have the values in various registers. We will have: Register 4 contains League in its last 2 bits (and is otherwise zero). Register 5 contains Score 1 in its last 9 bits (and is otherwise zero). Register 6 contains Score 2 in its last 9 bits (and is otherwise zero). Register 7 contains Score 3 in its last 9 bits (and is otherwise zero). Register 8 contains Seniority in its last 2 bits (and is otherwise zero). Register 9 contains Status in its last bit (and is otherwise zero). We can now do shift operations to move each value to where it belongs (out of 32 bits in all): SLL 4,30 SLL 5,21 SLL 6,12 SLL 7,3 SLL 8,2 and now we can combine all these: AR 4,5 AR 4,6 AR 4,7 AR 4,8 AR 4 9 and we can put the 4-byte value where it belongs: STCM 4,B'1111',BYTE1 Suppose on a later occasion we want to get hold of each piece of information. We can use: ICM 4,B'1111',BYTE1 and then use shifts to isolate whatever we want in the rightmost bytes of the registers. For instance: SLL 4,2 SRL 4,23 and now the rightmost 9 bits of register 4 contain Score 1 (and the rest of it is zero).