[Simh] Handling Flags in SIMH

J. David Bryan jdbryan at acm.org
Sun Jul 31 23:09:46 EDT 2011


Bill,


On Sunday, July 31, 2011 at 18:29, Bill Beech (NJ7P) wrote:

> Ok.  Code posted to http://bisbee.bb.hpaz.net/eprom.c

Thanks.  Your device flags (e.g., UNIT_2708) must be shifted by DEV_V_UF as 
well, and the same for the unit flags and UNIT_V_UF.  For example:

  #define UNIT_V_MSIZE    (DEV_V_UF)            /* ROM Size */
  #define UNIT_MSIZE      (0x3 << UNIT_V_MSIZE)
+ #define UNIT_2708       (0 << UNIT_V_MSIZE)   /* 2708 mode */
+ #define UNIT_2716       (1 << UNIT_V_MSIZE)   /* 2716 mode */
+ #define UNIT_2732       (2 << UNIT_V_MSIZE)   /* 2732 mode */
+ #define UNIT_2764       (3 << UNIT_V_MSIZE)   /* 2764 mode */

The problem is that when you specify your modifier as:

  { UNIT_MSIZE, UNIT_2716, "i2716", "2716", &EPROM_config },

...and you "SET unit i2716", SIMH is ANDing the flags with the complement 
of UNIT_MSIZE and ORing with UNIT_2716.  As it is written, you're clearing 
bits 16 and 17 of the flags word but then setting bit 0 (instead of bit 
16).

It also appears that your mask for UNIT_BADDR isn't large enough to 
encompass all of the values (should be 0x1F instead of 0x0F).

                                      -- Dave




More information about the Simh mailing list