#: 17866 S12/OS9/68000 (OSK)
05-Apr-93 03:52:25
Sb: C help
Fm: Bob Taylor 73270,3124
To: all
I need help with the following integer with the top 4 bits used as flags and
the bottom 12 bits a signed integer. I haven't been able to correctly sign
extend. Could an expert help?
Thanks,
Bob
--------------------------------cut here-------------------------------
typedef unsigned int CTYPE;
#define MODE_BIT 0x8000
#define VM_BIT 0x4000
#define HM_BIT 0x2000
#define MOTION(amt) ( ((CTYPE)(amt) & 0xfff) | (MODE_BIT) | HM_BIT) ) ???
#define MVAL(c) ( (int) ((c) & 0xfff ) ) ?????????
|