Author Topic: BxbAsm  (Read 178751 times)

SteveA

  • Guest
Re: BxbAsm
« Reply #345 on: June 15, 2012, 08:01:44 AM »
Hey James,
ncurses has functions that do everything on the console that you would expect, like windows/dos does.
As an example, functions that duplicate: beep, locate, color, cls, inkey, and many many more.

There appears to be nothing that windows/dos does that ncurses isn't capable of duplicating.
There are things that ncurses can do that windows/dos doesn't, or, does them in a much simpler way.


edit:
...still not really liking Win-7.
Boy it's really annoying, especially how it opens folders.

I generally open each folder in it's own window.
That way I can view more than one folder's contents at one time.

I can find no way to get them to anchor to one side of the screen or the other.
They just open (tile) anywhere they want to, all over the screen and in any size they want.
I waste more time moving and resizing folders before I can use them.

Fortunately, I'm only using it for launching VirtualBox and Linux.

Like I told my wife: "MS has only ever gotten a few things right; DOS, Win-3.x, Win-98 and Win-XP".
« Last Edit: June 15, 2012, 09:41:36 AM by SteveA »

SteveA

  • Guest
Re: BxbAsm
« Reply #346 on: June 19, 2012, 08:01:22 PM »
Hey James,
I'm having difficulty getting anything to compile and link, using gcc, as your samples files illustrate.
I have tried using the ".sh" files as an example, but, linking by using gcc just gives me errors.
The error messages are:
"undefined reference to '_Do_initialize@0'
"undefined reference to '_stdout'

I must not be providing the correct information regarding libbxblib.a.
I'm unable to copy it to /usr/lib, and it looks like it's not finding it in my local .lib folder either.

I do have this in my command line:
.... -L/home/steve/jwasm206/lib -lbxblib

Any suggestions on how to make that work ?

My basic script is really simple:
   Print "hello world"
   END

bxbasm is working, jwasm is (or seems to be) working, just can't produce an executable.

Steve

jcfuller

  • Guest
Re: BxbAsm
« Reply #347 on: June 20, 2012, 04:04:26 AM »
Steve,
  I think this is the script I am using?
James


Code: [Select]
#!/bin/bash
INCLUDE=/home/james/jwasm/include
export INCLUDE
../Bxbasm $1
jwasm -elf -zcw -Fo $1.o $1.asm
# jwasm -elf -Fo $1.o $1.asm
gcc -s -nostartfiles -o $1 $1.o \
    -L/home/james/BxbAsm5_10/LibSource \
    -L/home/james/jwasm/fpulib \
    -lbxblib -lm -lfpu
#gcc -s -nostartfiles -o $1 $1.o ClearScreen.o


SteveA

  • Guest
Re: BxbAsm
« Reply #348 on: June 20, 2012, 04:05:56 PM »
James,
I'm having quite a bit of difficulty getting the simplest program to properly link when I use libbxblib.a.

I have examined all the files you provided and just can't figure out what the issue is.
Here is the error message I get when I use "ld" alone:
Quote
steve@steve-VirtualBox:~/Jwasm206/bxbasm$ ld -o test2 test2.o -L/home/steve/Jwasm206/lib -lbxblib
test2.o: In function `_start':
test2.asm:(.text+0x8): undefined reference to `exit'
test2.o: In function `_Main@0':
test2.asm:(.text+0x11): undefined reference to `_Do_initialize@0'
test2.asm:(.text+0x1b): undefined reference to `_StdOut@4'
test2.asm:(.text+0x25): undefined reference to `_StdOut@4'
/home/steve/Jwasm206/lib/libbxblib.a(getch.o): In function `initTermios':
getch.c:(.text+0x16): undefined reference to `tcgetattr'
getch.c:(.text+0xf4): undefined reference to `tcsetattr'
/home/steve/Jwasm206/lib/libbxblib.a(getch.o): In function `resetTermios':
getch.c:(.text+0x118): undefined reference to `tcsetattr'
/home/steve/Jwasm206/lib/libbxblib.a(getch.o): In function `getch_':
getch.c:(.text+0x130): undefined reference to `getchar'
steve@steve-VirtualBox:~/Jwasm206/bxbasm$

here is the command line:
Quote
ld -o test2 test2.0 -L/home/steve/Jwasm206/lib -lbxblib

Despite all the errors, I actually get more information from "ld" that if I just use "gcc".

When I use gcc, as illustrated in your above post, all I get is:
Quote
steve@steve-VirtualBox:~/Jwasm206/bxbasm$ gcc -s -nostartfiles -o test2 test2.o -L/home/steve/Jwasm206/bxbasm/lib/ -llibbxblib.a
/usr/bin/ld: cannot find -llibbxblib.a
collect2: ld returned 1 exit status
steve@steve-VirtualBox:~/Jwasm206/bxbasm$

It seems to matter not how I spell the lib name: -llibbxblib.a, -lbxblib, -lbxblib.a, ...etc.
The error is always the same.

Here is my path layout:
/home/steve/Jwasm206/bin
/home/steve/Jwasm206/bxbasm
/home/steve/Jwasm206/include
/home/steve/Jwasm206/lib

I work from within
/home/steve/Jwasm206/bxbasm/

there resides: test2.bas and test2.o.

My basic script is:
    PRINT "hello world"
    END

It translates and assembles fine.
I just can't figure what the problem with linking is, with gcc or ld.

Do you have any ideas ?

Steve

jcfuller

  • Guest
Re: BxbAsm
« Reply #349 on: June 20, 2012, 05:06:11 PM »
Steve,
  ld/gcc auto adds the "lib" and the ".a"
 gcc -s -nostartfiles -o test2 test2.o -L/home/steve/Jwasm206/bxbasm/lib/ -lbxblib

James

SteveA

  • Guest
Re: BxbAsm
« Reply #350 on: June 20, 2012, 05:26:17 PM »
Steve,
  ld/gcc auto adds the "lib" and the ".a"
 gcc -s -nostartfiles -o test2 test2.o -L/home/steve/Jwasm206/bxbasm/lib/ -lbxblib

James



Yes, that's what i read.
But, this is what I get:

steve@steve-VirtualBox:~/Jwasm206/bxbasm$ gcc -s -nostartfiles -o test2 test2.o -L/home/steve/Jwasm206/bxbasm/lib -lbxblib
/usr/bin/ld: cannot find -lbxblib
collect2: ld returned 1 exit status
steve@steve-VirtualBox:~/Jwasm206/bxbasm$

(??)

Steve

SteveA

  • Guest
Re: BxbAsm
« Reply #351 on: June 21, 2012, 03:44:30 PM »
Hey James,

Yeh, I'm about ready to throw in the towel on Jwasm and linux.
I can't seem to get anything JWASM related to build an executable.
That is, where it concerns using a static library.

Question:
that last set of library files and "includes", that you uploaded, do they actually work ?
I mean, if used, do they actually build a working program from start to finish: translate-assemble-compile-link ?
Because that is what I've been using and all I get are errors.
I can never get the linker to produce an executable.

I don't know enough about linux to even begin to guess what could possibly be wrong.
If I get that far, the best I can hope for is a series of "undefined reference" messages.

Steve

jcfuller

  • Guest
Re: BxbAsm
« Reply #352 on: June 22, 2012, 04:52:07 AM »
Steve,
  It appears my old noggin is failing me again.
I don't think I ever got the 5-24 version working???
Attached is my directory for the 5-10 version.
I just tried test1 in the examples directory with build.sh (make sure you change your jwasm paths) and it translated,compiled,link and ran.

One thing to note for jwasm on linux you can't use
Code: [Select]
system_time tm<> ;current date & time
Has to be:
Code: [Select]
system_time tm<?,?,?,?,?,?,?,?,?,?,?> ;current date & time

James

SteveA

  • Guest
Re: BxbAsm
« Reply #353 on: June 22, 2012, 07:51:40 AM »
Attached is my directory for the 5-10 version.
I just tried test1 in the examples directory with build.sh (make sure you change your jwasm paths) and it translated,compiled,link and ran.

Okay, I'll give this a try.

Quote
One thing to note for jwasm on linux you can't use
Code: [Select]
system_time tm<> ;current date & time

Yeh, I just commented that part out, for the time being.
Until I get something working, I just want to keep things real simple.

I like the work you did on constructing the (.INC) files.
I just don't know how people are using Jwasm on linux without .INC files.
Plus the fact that Jwlink (for linux) doesn't seem to work on Linux, either.

Thanks, Steve
« Last Edit: June 22, 2012, 08:23:07 AM by SteveA »

SteveA

  • Guest
Re: BxbAsm
« Reply #354 on: June 22, 2012, 01:09:48 PM »
Oh,
I wanted to mention, when I compiled your code, before I commented out the system_time thing, it generated a compiler error.

I've got bxbasm producing a clean .bas to .asm translation, ...
jwasm it producing an .o file with out errors, ...
but, when I go to link, I consistantly get: "undefined reference" errors.
Here is the build command:
Code: [Select]
#!/bin/bash
INCLUDE=/home/steve/Jwasm206/include
export INCLUDE

../bin/Bxbasm $1
../bin/jwasm -elf -Fo $1.o $1.asm
gcc -s -nostartfiles -o $1 $1.o -L/home/steve/Jwasm206/bxbasm \
                                -L/home/steve/Jwasm206/include \
                                -lbxblib


Here is the output:
Quote
steve@steve-VirtualBox:~/Jwasm206/bxbasm$ sh build2.sh test2
Copyright: Blunt_Axe_Basic, BxbAsm, Bxbasic (c) sarbayo, 2004-2012
Alpha Release: 1.06.3, Bxbasm Compiler

** stripped down version for Linux

Destination file: test2.asm
Lines compiled: 1
Done.


JWasm v2.06e, Jul 22 2011, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

test2.asm: 80 lines, 2 passes, 1 ms, 0 warnings, 0 errors
test2.o: In function `Main':
test2.asm:(.text+0x11): undefined reference to `_Do_initialize'
collect2: ld returned 1 exit status
steve@steve-VirtualBox:~/Jwasm206/bxbasm$


I don't get it.
Nothing has changed or improved.

jcfuller

  • Guest
Re: BxbAsm
« Reply #355 on: June 22, 2012, 01:21:04 PM »
Steve,
  It's a c decoration thingy.
  Try:
Code: [Select]
jwasm -elf -zcw -Fo $1.o $1.asm

James

SteveA

  • Guest
Re: BxbAsm
« Reply #356 on: June 22, 2012, 03:34:20 PM »
James,

Solved.
I had to play around with the build commands a bit.
Took me forever to find a google search result that had a similar "undefined reference" issue.
There are quite a lot.
I'm guessing that "undefined reference" is a common problem with linux programming.
You have to get it just right.

Steve

SteveA

  • Guest
Re: BxbAsm
« Reply #357 on: June 27, 2012, 03:21:08 PM »
Hey James,
Okay, I've got two versions of Bxbasm C sources setup.
One is the current state, with all the functions in libbxblib.a.
The other is an older version, just prior to stripping all the functions out of file: funct.c.
I want to make sure the recent errors are not a product of the conversion process.

I'll be testing the samples and see what I can find.
Maybe I can finally figure out what is going on.

Steve

SteveA

  • Guest
Re: BxbAsm
« Reply #358 on: June 28, 2012, 02:39:03 PM »
James,
do you have a linux version of math.inc file for jwasm ?
The zip file you uploaded has a MATH.INC file, but, it appears to be windows file, as jwasm (linux ver.) does not like it.

On Linux, where are the header files that gcc uses ?
Are they the files in: /usr/include/ ?
Also, the CRT library files ?

I was looking for something specifically that might identify them as the CRT.

Thanks,
Steve


edit:
I was also wondering if you know what other .inc files other assemblers use on linux ?
« Last Edit: June 28, 2012, 02:41:06 PM by SteveA »

jcfuller

  • Guest
Re: BxbAsm
« Reply #359 on: June 29, 2012, 04:54:40 AM »
Steve,
Re: MATH.INC
  I believe I just grabbed the ones needed to compile from MATH.INC and put them in math.inc (files are case sensitive) on linux.

Yes I think you will find all gcc headers in usr/include.

Most distros have a file find app that can help you locate files.

I have done nothing with assembler on linux other than jwasm. You might try a google search on nasm or fasm.

James