From: Chris <cbo...@mi...> - 2002-08-30 00:11:25
|
It's been years and years since I really looked at assembler, but I found an oddity. I try to build my program and I get the following error: BuildWAtkTab.s: Assembler messages: BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' I do a htcobol -S and look at the result and this is what I see: .Linite_main: leal main, %eax pushl %eax leal .Lend_pgm_main, %eax pushl %eax pushl $3 movl $ww_base0+4 #sec:0, %eax pushl %eax movl $w_base0+4, %eax pushl %eax movl $s_base0+4, %eax pushl %eax call cob_open addl $16, %esp pushl $3 movl $ww_base0+38 #sec:0, %eax pushl %eax movl $w_base0+20, %eax pushl %eax movl $s_base0+38, %eax pushl %eax call cob_open The as command seems to work fine once I remove the #sec:0 entries, but gcc fails: gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm BuildWAtkTab.o: In function `main': BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': fileio.o(.text+0x563): undefined reference to `__db185_open' fileio.o(.text+0x5d6): undefined reference to `__db185_open' /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': fileio.o(.text+0x385f): undefined reference to `__db185_open' collect2: ld returned 1 exit status What's wrong? |
From: Hudson R. <hud...@so...> - 2002-08-30 01:41:10
|
Hi Chris, > The as command seems to work fine once I remove the #sec:0 entries, but > gcc fails: > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm > BuildWAtkTab.o: In function `main': > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': > fileio.o(.text+0x563): undefined reference to `__db185_open' > fileio.o(.text+0x5d6): undefined reference to `__db185_open' > /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': > fileio.o(.text+0x385f): undefined reference to `__db185_open' > collect2: ld returned 1 exit status > > What's wrong? add the libraries -ldb, -ldl and -lhtcobol2 in link step. ex: gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lhtcobol2 -lm -ldb -ldl Hope this helps. Hudson |
From: Rildo P. <ri...@pr...> - 2002-08-30 01:44:06
|
Hi Chris, On 29 Aug 2002, Chris Borgn=E6s wrote: > It's been years and years since I really looked at assembler, but I > found an oddity. I try to build my program and I get the following > error: > BuildWAtkTab.s: Assembler messages: > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' > > I do a htcobol -S and look at the result and this is what I see: > > .Linite_main: > leal=09main, %eax > =09pushl=09%eax > =09leal=09.Lend_pgm_main, %eax > =09pushl=09%eax > =09pushl=09$3 > =09movl=09$ww_base0+4 #sec:0, %eax > =09pushl=09%eax > =09movl=09$w_base0+4, %eax > =09pushl=09%eax > =09movl=09$s_base0+4, %eax > =09pushl=09%eax > =09call=09cob_open > =09addl=09$16, %esp > =09pushl=09$3 > =09movl=09$ww_base0+38 #sec:0, %eax > =09pushl=09%eax > =09movl=09$w_base0+20, %eax > =09pushl=09%eax > =09movl=09$s_base0+38, %eax > =09pushl=09%eax > =09call=09cob_open > > The as command seems to work fine once I remove the #sec:0 entries, but > gcc fails: > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm > BuildWAtkTab.o: In function `main': > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': > fileio.o(.text+0x563): undefined reference to `__db185_open' > fileio.o(.text+0x5d6): undefined reference to `__db185_open' > /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': > fileio.o(.text+0x385f): undefined reference to `__db185_open' > collect2: ld returned 1 exit status > > What's wrong? > Well, from the errors shown by gcc, it seems you missed to include -ldb to link with libdb. It is needed if your program uses any kind of file access, even if no indexes are in use. best regards, Rildo ------------------------------------------------------------------ Rildo Pragana FPGA/uControllers * Linux * tcl/tk R.Joaquim Nabuco,92/302 Derby http://www.pragana.net Recife, PE - Brazil 52011-000 +55-81-3223-5694 |
From: Chris <cbo...@mi...> - 2002-08-30 02:23:11
|
OK, that solved part of the problem. Thanks, I didn't know the proper gcc options to use. I still get this error though: as -o BuildWAtkTab.o BuildWAtkTab.s BuildWAtkTab.s: Assembler messages: BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' Paradoxically, when I remove those #sec:0 references to eliminate the above error, the gcc step still chokes: gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lhtcobol2 -lm -ldb -ldl BuildWAtkTab.o: In function `main': BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' collect2: ld returned 1 exit status On Thu, 2002-08-29 at 17:46, Rildo Pragana wrote: Hi Chris, =20 On 29 Aug 2002, Chris Borgn=E6s wrote: =20 > It's been years and years since I really looked at assembler, but I > found an oddity. I try to build my program and I get the following > error: > BuildWAtkTab.s: Assembler messages: > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' > > I do a htcobol -S and look at the result and this is what I see: > > .Linite_main: > leal main, %eax > pushl %eax > leal .Lend_pgm_main, %eax > pushl %eax > pushl $3 > movl $ww_base0+4 #sec:0, %eax > pushl %eax > movl $w_base0+4, %eax > pushl %eax > movl $s_base0+4, %eax > pushl %eax > call cob_open > addl $16, %esp > pushl $3 > movl $ww_base0+38 #sec:0, %eax > pushl %eax > movl $w_base0+20, %eax > pushl %eax > movl $s_base0+38, %eax > pushl %eax > call cob_open > > The as command seems to work fine once I remove the #sec:0 entries, b= ut > gcc fails: > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm > BuildWAtkTab.o: In function `main': > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': > fileio.o(.text+0x563): undefined reference to `__db185_open' > fileio.o(.text+0x5d6): undefined reference to `__db185_open' > /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': > fileio.o(.text+0x385f): undefined reference to `__db185_open' > collect2: ld returned 1 exit status > > What's wrong? > =20 Well, from the errors shown by gcc, it seems you missed to include -ldb to link with libdb. It is needed if your program uses any kind of file access, even if no indexes are in use. =20 best regards, Rildo ------------------------------------------------------------------ Rildo Pragana FPGA/uControllers * Linux * tcl/tk R.Joaquim Nabuco,92/302 Derby http://www.pragana.net Recife, PE - Brazil 52011-000 +55-81-3223-5694 =20 =20 =20 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Tin...@li... https://lists.sourceforge.net/lists/listinfo/tiny-cobol-users =20 |
From: <bg...@fr...> - 2002-08-30 08:31:08
|
En réponse à Chris Borgnæs <cbo...@mi...>: > OK, that solved part of the problem. Thanks, I didn't know the proper > gcc options to use. I still get this error though: > as -o BuildWAtkTab.o BuildWAtkTab.s > BuildWAtkTab.s: Assembler messages: > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' > > Paradoxically, when I remove those #sec:0 references to eliminate the > above error, the gcc step still chokes: > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lhtcobol2 -lm -ldb -ldl > BuildWAtkTab.o: In function `main': > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > collect2: ld returned 1 exit status > From what I can see and what I remember having coded, those sections 0 should not appear UNLESS there is something the compiler can't handle (some sort of panic!). What is you code looking like? In particular how are the files defined? If you post a minimum sample which shows the problem, I'll look at it. > On Thu, 2002-08-29 at 17:46, Rildo Pragana wrote: > > Hi Chris, > > On 29 Aug 2002, Chris Borgnæs wrote: > > > It's been years and years since I really looked at assembler, but > I > > found an oddity. I try to build my program and I get the > following > > error: > > BuildWAtkTab.s: Assembler messages: > > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' > > > > I do a htcobol -S and look at the result and this is what I see: > > > > .Linite_main: > > leal main, %eax > > pushl %eax > > leal .Lend_pgm_main, %eax > > pushl %eax > > pushl $3 > > movl $ww_base0+4 #sec:0, %eax > > pushl %eax > > movl $w_base0+4, %eax > > pushl %eax > > movl $s_base0+4, %eax > > pushl %eax > > call cob_open > > addl $16, %esp > > pushl $3 > > movl $ww_base0+38 #sec:0, %eax > > pushl %eax > > movl $w_base0+20, %eax > > pushl %eax > > movl $s_base0+38, %eax > > pushl %eax > > call cob_open > > > > The as command seems to work fine once I remove the #sec:0 > entries, but > > gcc fails: > > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm > > BuildWAtkTab.o: In function `main': > > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > > /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': > > fileio.o(.text+0x563): undefined reference to `__db185_open' > > fileio.o(.text+0x5d6): undefined reference to `__db185_open' > > /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': > > fileio.o(.text+0x385f): undefined reference to `__db185_open' > > collect2: ld returned 1 exit status > > > > What's wrong? > > > > Well, from the errors shown by gcc, it seems you missed to include > -ldb to link with libdb. It is needed if your program uses any > kind > of file access, even if no indexes are in use. > > best regards, > Rildo > > ------------------------------------------------------------------ > Rildo Pragana FPGA/uControllers * Linux * > tcl/tk > R.Joaquim Nabuco,92/302 Derby http://www.pragana.net > Recife, PE - Brazil 52011-000 +55-81-3223-5694 > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tiny-cobol-users > > > Bernard |
From: Chris <cbo...@mi...> - 2002-08-30 14:43:55
|
Here is an excerpt. If this is inadequate I can provide the entire thing, but it's essentially multiple iterations of the same logic for both files. IDENTIFICATION DIVISION. PROGRAM-ID. BuildWAtkTab. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT WAtkTabFile ASSIGN TO WAtkTabFile ORGANIZATION INDEXED ACCESS RANDOM RECORD KEY WAtkTabKey. SELECT WeaponTypeFile ASSIGN TO WeaponTypeFile ORGANIZATION INDEXED ACCESS RANDOM RECORD KEY WSName. DATA DIVISION. FILE SECTION. FD WAtkTabFile. 01 WAtkTab. 05 WAtkTabKey. 10 WCd PIC XX. 10 WAtkTabAT PIC 99 COMP. 05 CritMinRoll OCCURS 5 TIMES PIC 999 COMP. 05 Div PIC 99 COMP. 05 CritTyp PIC XXX. FD WeaponTypeFile. 01 WeaponType. 05 WSName PIC XX. 05 WName PIC X(15). 05 WUse PIC XXX. 05 WtMin PIC 9V9 COMP. 05 WtMax PIC 99V9 COMP. 05 LnMin PIC 9V99 COMP. 05 LnMax PIC 99V9 COMP. 05 Fum PIC 9 COMP. 05 RngInfo OCCURS 5 TIMES. 10 Range PIC 999 COMP. 10 RangeMod PIC S99 COMP. PROCEDURE DIVISION. OPEN OUTPUT WAtkTabFile WeaponTypeFile. INITIALIZE WeaponType. MOVE 'Long Bow' TO WName. MOVE 'MS' TO WUse. MOVE 'lb' TO WSName. MOVE 2.0 TO WtMin. MOVE 3.0 TO WtMax. MOVE 5.00 TO LnMin. MOVE 7.0 TO LnMax. MOVE 5 TO Fum. MOVE 10 TO Range(1). MOVE +20 TO RangeMod(1). MOVE 100 TO Range(2). MOVE 200 TO Range(3). MOVE -30 TO RangeMod(3). MOVE 300 TO Range(4). MOVE -40 TO RangeMod(4). MOVE 400 TO Range(5). MOVE -50 TO RangeMod(5). WRITE WeaponType INVALID KEY DISPLAY 'Failed to Write to WeaponTypeFile' CLOSE WAtkTabFile WeaponTypeFile STOP RUN. MOVE 1 TO WAtkTabAT. MOVE 'lb' TO WCd. MOVE 88 TO CritMinRoll(1). MOVE 93 TO CritMinRoll(2). MOVE 98 TO CritMinRoll(3). MOVE 104 TO CritMinRoll(4). MOVE 124 TO CritMinRoll(5). MOVE 3 TO Div. MOVE 'P ' TO CritTyp. WRITE WAtkTab INVALID KEY DISPLAY 'Failed to Write to WAtkTabFile' CLOSE WAtkTabFile WeaponTypeFile STOP RUN. CLOSE WAtkTabFile WeaponTypeFile. STOP RUN. On Fri, 2002-08-30 at 03:31, bg...@fr... wrote: En r=E9ponse =E0 Chris Borgn=E6s <cbo...@mi...>: =20 > OK, that solved part of the problem. Thanks, I didn't know the prope= r > gcc options to use. I still get this error though: > as -o BuildWAtkTab.o BuildWAtkTab.s > BuildWAtkTab.s: Assembler messages: > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' >=20 > Paradoxically, when I remove those #sec:0 references to eliminate the > above error, the gcc step still chokes: > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lhtcobol2 -lm -ldb -ldl > BuildWAtkTab.o: In function `main': > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > collect2: ld returned 1 exit status >=20 =20 >From what I can see and what I remember having coded, those sections 0 should not appear UNLESS there is something the compiler can't handle (some sort of panic!). =20 What is you code looking like? In particular how are the files defined? If you post a minimum sample which shows the problem, I'll look at it. =20 > On Thu, 2002-08-29 at 17:46, Rildo Pragana wrote: >=20 > Hi Chris, > =20 > On 29 Aug 2002, Chris Borgn=E6s wrote: > =20 > > It's been years and years since I really looked at assembler, b= ut > I > > found an oddity. I try to build my program and I get the > following > > error: > > BuildWAtkTab.s: Assembler messages: > > BuildWAtkTab.s:35: Error: suffix or operands invalid for `mov' > > BuildWAtkTab.s:44: Error: suffix or operands invalid for `mov' > > > > I do a htcobol -S and look at the result and this is what I see= : > > > > .Linite_main: > > leal main, %eax > > pushl %eax > > leal .Lend_pgm_main, %eax > > pushl %eax > > pushl $3 > > movl $ww_base0+4 #sec:0, %eax > > pushl %eax > > movl $w_base0+4, %eax > > pushl %eax > > movl $s_base0+4, %eax > > pushl %eax > > call cob_open > > addl $16, %esp > > pushl $3 > > movl $ww_base0+38 #sec:0, %eax > > pushl %eax > > movl $w_base0+20, %eax > > pushl %eax > > movl $s_base0+38, %eax > > pushl %eax > > call cob_open > > > > The as command seems to work fine once I remove the #sec:0 > entries, but > > gcc fails: > > gcc -o BuildWAtkTab BuildWAtkTab.o -lhtcobol -lm > > BuildWAtkTab.o: In function `main': > > BuildWAtkTab.o(.text+0x4c): undefined reference to `ww_base0' > > BuildWAtkTab.o(.text+0x68): undefined reference to `ww_base0' > > /usr/local/lib/libhtcobol.a(fileio.o): In function `cob_open': > > fileio.o(.text+0x563): undefined reference to `__db185_open' > > fileio.o(.text+0x5d6): undefined reference to `__db185_open' > > /usr/local/lib/libhtcobol.a(fileio.o): In function `sort_open': > > fileio.o(.text+0x385f): undefined reference to `__db185_open' > > collect2: ld returned 1 exit status > > > > What's wrong? > > > =20 > Well, from the errors shown by gcc, it seems you missed to includ= e > -ldb to link with libdb. It is needed if your program uses any > kind > of file access, even if no indexes are in use. > =20 > best regards, > Rildo > =20 > ------------------------------------------------------------------ > Rildo Pragana FPGA/uControllers * Linux * > tcl/tk > R.Joaquim Nabuco,92/302 Derby http://www.pragana.net > Recife, PE - Brazil 52011-000 +55-81-3223-5694 > =20 > =20 > =20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Tin...@li... >=20 > https://lists.sourceforge.net/lists/listinfo/tiny-cobol-users >=20 > =20 >=20 =20 =20 Bernard =20 |
From: eurlix <eu...@li...> - 2002-08-30 16:17:00
|
Hi Chris, Le 30 Aug 2002 09:42:23 -0500 Chris Borgn=E6s <cbo...@mi...> a =E9crit: ... > FILE-CONTROL. > SELECT WAtkTabFile ASSIGN TO WAtkTabFile I think that this works better if you write : SELECT WAtkTabFile ASSIGN TO "WAtkTabFile" or SELECT WAtkTabFile ASSIGN TO WAtkTabLabel and add in Working-storage section 77 watktabLABEL pic x(??) value "what_you_want" Regards, --=20 Alain Lucari Eurlix 1, rue Reine Elisabeth von Witellsbach (Reine des Belges) 13001 Marseille FRANCE |
From: Rildo P. <ri...@pr...> - 2002-08-30 17:27:04
|
Hi Chris, On 30 Aug 2002, Chris Borgn=E6s wrote: > Here is an excerpt. If this is inadequate I can provide the entire > thing, but it's essentially multiple iterations of the same logic for > both files. > > IDENTIFICATION DIVISION. > PROGRAM-ID. BuildWAtkTab. > ENVIRONMENT DIVISION. > INPUT-OUTPUT SECTION. > FILE-CONTROL. > SELECT WAtkTabFile ASSIGN TO WAtkTabFile > ORGANIZATION INDEXED > ACCESS RANDOM > RECORD KEY WAtkTabKey. Because the way our compiler works, if you want to assign the filename to a literal name, you must enclose it in double-quotes, like: SELECT WAtkTabFile ASSIGN TO "WAtkTabFile" In other situation, you may want to have the file name into another variable, like this: SELECT WAtkTabFile ASSIGN TO WAtkTabFile =2E.. =0977 WAtkTabFile=09PIC X(80) VALUE "my_file_name". Both are acceptable, but the compiler only assumes you give a explicit filename if you enclose it inside double-quotes ("..."). What happened, is that your variable (WAtkTabFile) was not defined later, so it had no storage class. Sorry if our compiler didn't show a better error detection. best regards, Rildo ------------------------------------------------------------------ Rildo Pragana FPGA/uControllers * Linux * tcl/tk R.Joaquim Nabuco,92/302 Derby http://www.pragana.net Recife, PE - Brazil 52011-000 +55-81-3223-5694 |