; PROGRAM FRAGMENT to demonstrate packing and unpacking
;  grab a word from memory and isolate two bits of it --
;  Using a mask and then put the info back together
;   by packing them
;  Example:  Suppose a word was arranged as follows:
;
;       yyyyyycciiiiiiii
;         a    c       I
;         g    l       D
;         e    a    
;              s
;              s
;
;   What we want to do is to increase class by one (up to its 
;    max of 3 -- 11b) without touching the rest
;
	mov	bx, info			;grab the input word
	mov	si, bx			; copy it so it can be restored later
	and	bx, 0000001100000000B ;  get rid of all bits but the two
;                                  we want -- MASK them out!
	mov	cl, 8				;move bits into position to use them 
;						   numerically (two class bits)
	shr	bx, cl			;  class is now the rightmost two bits
;
;  section to use the class info
	inc	bx
	cmp  bx, 3
	jbe	ok
	mov	bx, 3
;
;   class has now been updated it is STILL in the rightmost three bits
;        also note that class looks like this: 00000000000000cc
	shl  bx, cl			; put class back into the correct
;						 position 000000cc00000000
	and	si, 1111110011111111b ;  get rid of class, leaving rest --
;					          si = yyyyyy00iiiiiiii
	or   si, bx			; PACK the result which is now:
;                                        yyyyyycciiiiiiii
	mov	info, si			;put info back - it's updated!