TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: all
from: Bob Taylor 73270,3124
date: 1993-04-05 03:52:25
subject: C help

#: 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 ) )   ?????????

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.