From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bf6e3c3e400b2ef2,start X-Google-Attributes: gid103376,public From: pvanbell@cloud9.net (Paul Van Bellinghen) Subject: Logical operators with bitmasks Date: 1997/01/26 Message-ID: <32ebd9db.14078958@NEWS.CLOUD9.NET>#1/1 X-Deja-AN: 212407402 organization: Cloud 9 Internet, White Plains, NY, USA newsgroups: comp.lang.ada Date: 1997-01-26T00:00:00+00:00 List-Id: I have an unusual Ada story to relate which still has me second guessing myself. As I wrote in an earlier posting, I am new to the Ada language (~6 mo.). I was on a job interview the other day and was asked by another software engineer what I had done in Ada. I explained that I had configured Rational's VADScross (Ada 83) kernel and TDM to run on our target processor (IDT R4700) and EEPROM. The kernel TDM, and user programs are all slotted to be loaded into EEPROM. I explained that the EEPROM was a flash module which required erasing the entire 64x64K sector before any memory locations within the sector can be modified. Thus before the TDM can modify user memory or perform break pointing, the entire sector where the memory locations reside must be buffered, erased, and written back to with the modified memory changed in the buffer. When I told him that I used a sector mask to determine the sector boundary of the EEPROM location(s) to be modified, he asked me how I performed the masking. I told him that I used the "and" function. He said that I couldn't have since the logical operators in Ada are only used to operate on boolean types. However, I knew that I had debugged that portion of the TDM on my desktop PC using GNAT. I believe what happened was that GNAT is an Ada 95 compiler which allows the logical operators to operate on modular types as a bit wise operation. Thus, for: C := A and B; where Type Internal_address is mod 2**32 C,A : Internal_Address; B : constant := 16#FF80_0000#; applies the mask B to the variable A. However, while I have not debugged the TDM yet on the target processor, it did use a.make of VADScross to compile without errors. I can't explain why. Paul Van Bellinghen Software Engineer home: 914 737-6998 bus: 914 968-2500