pham@cod.NOSC.MIL (Peter N. Pham) (10/11/90)
Can anyone look at the Ada code below and tell me why the Meridian AdaVantage Compiler generates these errors : ( Text generated by Meridian AdaVantage Compiler when I compile the code below) Meridian AdaVantage(tm) Compiler [v4.0 Jun 13, 1990] Target 80x86 Subprogram body conversion_test added to library. 43 lines compiled. No errors detected. Meridian 80x86 Code Generator [v4.0 Jun 15, 1990] Target 80x86 object Generating code for conversi "testconv.ada", line 40: <<error>> ** bad case in gencode: 39 ** "testconv.ada", line 40: <<error>> ** bad case in gencode: 39 ** "testconv.ada", line 42: <<error>> bad mode in object.memory_byte ( Code starts here ) with UNCHECKED_CONVERSION; procedure CONVERSION_TEST is type BYTE is range 0..255; for BYTE'size use 8; type WORD is range 0..16#FFFF#; for WORD'size use 16; type BYTE_ARR2 is array (0..1) of BYTE; type AA is record BYTE1:BYTE; BYTE2:BYTE; BYTE3:BYTE; BYTE4:BYTE; end record; pragma PACK(AA); WORD1 : WORD; A : AA; function CONVERT_BYTES is new UNCHECKED_CONVERSION(WORD,BYTE_ARR2); procedure CONVERT ( WORD0 : in WORD; BYTE0 : out BYTE; BYTE1 : out BYTE) is BYTES : BYTE_ARR2; begin BYTES := CONVERT_BYTES(WORD0); BYTE0 := BYTES(0); BYTE1 := BYTES(1); end CONVERT; begin CONVERT(WORD1, A.BYTE2, A.BYTE3); end CONVERSION_TEST;