Author Topic: BxbAsm  (Read 178875 times)

SteveA

  • Guest
Re: BxbAsm
« Reply #225 on: May 04, 2012, 02:39:09 PM »
James,
here is a list of commands and functions that I know I commented-out:

Commands:
   LOCATE
   BEEP
   CLS
   COLOR
   SLEEP

Functions:
   TIME$
   DATE$
   TIMER

plus, associated references in various places.
Can you provide me with any code that you are using that allows them to work on linux ?
If so, I'd like to update the files on my end.
That way, I don't keep sending you obsolite code.

From yesterdays discussion, did you get file I/O working.
As far as I know, file I/O is only using CRT.

jcfuller

  • Guest
Re: BxbAsm
« Reply #226 on: May 04, 2012, 03:24:40 PM »
Steve,
  First thing tomorrow.
 What I would like first is the new Prolog code from AInput.c for the new crt Time/Date.

James

SteveA

  • Guest
Re: BxbAsm
« Reply #227 on: May 04, 2012, 04:09:40 PM »
ainput.c attached.

jcfuller

  • Guest
Re: BxbAsm
« Reply #228 on: May 05, 2012, 04:14:01 AM »
Steve,
  This may take a bit as I want to set up a working environment on both windows and linux.
FWIW jwasm uses the INCLUDE environment variable so you don't have to use complete paths in your source.

James
 

jcfuller

  • Guest
Re: BxbAsm
« Reply #229 on: May 05, 2012, 11:25:43 AM »
Steve,
  I'm trying to get a windows build working before I migrate it to linux.
I may have missed something in the time/date update because I am getting many warnings on the same line of code:
Code: [Select]
C:\BxbAsm\examples>jwasm /coff test1.asm
JWasm v2.07pre, Nov  2 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.

test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm(29) : Warning A4184: Instructions and initialized data not supported i
n BSS segments
test1.asm: 86 lines, 2 passes, 187 ms, 10 warnings, 0 errors

C:\BxbAsm\examples>polink /SUBSYSTEM:CONSOLE test1.obj /OUT:test1.exe
C:\BxbAsm\examples>


line 29 is the last line showing here.
If I comment it out compiles and runs fine. Well it runs fine with it but I dislike warnings :)

Code: [Select]
; =========================================================================
;  UNINITIALIZED DATA
; =========================================================================
 .data?
system_time tm  <> ;current date & time

James

SteveA

  • Guest
Re: BxbAsm
« Reply #230 on: May 05, 2012, 05:25:22 PM »
Code: [Select]
; =========================================================================
;  UNINITIALIZED DATA
; =========================================================================
 .data?
system_time tm  <> ;current date & time

Funny, because that is where the CRT time/date data structure "tm" is declared.
It assembles and links completely without error on my system, not even a warning.

Previously, it said:
   system_time    SYSTEMTIME  <>         ;current date & time

which is the win32 date/time struct declaration.
Both versions assemble without warning.

edit:
I only notice one difference between your commandline and mine:

      C:\BxbAsm\examples>jwasm /coff test1.asm
C:\JWasm\JWasm206\bin\JWasm /c /coff "%1.asm"

I use mine via a batch file, that's why the:  "%1.asm".
« Last Edit: May 05, 2012, 05:33:40 PM by SteveA »

jcfuller

  • Guest
Re: BxbAsm
« Reply #231 on: May 06, 2012, 03:13:55 AM »
Steve,
  Try it with JWasm v2.07pre if you can? I don't have 2.06 installed

James

Edit: I tried it with 2.06 with the same results.
 
« Last Edit: May 06, 2012, 05:07:18 AM by jcfuller »

SteveA

  • Guest
Re: BxbAsm
« Reply #232 on: May 06, 2012, 08:24:35 PM »
Okay,
what I'm going to do is, (in the morning), upoad the linux version, that is fully working.
I will include everything and it will be fully functioning, (minus anything that is win32 specific).

What I would like you to do, when you have the time, is to give it a try, without any modifications on Windows.
Then, after you have verified that it assembles and links correctly, you can make whatever changes you wish.

I don't know why it's working on my system and not yours.
I do use full paths, as opposed to environment variables. I do that for a reason and not convenience.

jcfuller

  • Guest
Re: BxbAsm
« Reply #233 on: May 07, 2012, 02:38:35 AM »
Steve,
  Can you do a version with cls,locate,and color working using a separate library for those three items?
I have linux code for them.

James

Edit: actually you should be able to have all the Win32 functions you want in this configuration as long as they are noted in bxb.inc.
I can added dummy functions in a linux libaray if there is no way to implement.

« Last Edit: May 07, 2012, 02:48:14 AM by jcfuller »

SteveA

  • Guest
Re: BxbAsm
« Reply #234 on: May 07, 2012, 11:41:00 AM »
Can you do a version with cls,locate,and color working using a separate library for those three items?
I have linux code for them.

Okay,
Here's what I've got:
  bxb-linux.zip: contains the EXE plus the LIB and INC files.

  disabled-procs.zip: contains dummy functions.
  asm-procs.zip: contains all the working asm procs
  bxblib-c-sources: contains some lib functions that are in C.
  bxbasm-linux-sources.zip: contains all C source for bxbasm.

Quote
Edit: actually you should be able to have all the Win32 functions you want in this configuration as long as they are noted in bxb.inc.
I can added dummy functions in a linux libaray if there is no way to implement.

So that you can test everything, the executable is fully functioning.
Rather than cripple the EXE, I've placed dummy procs in bxblib.lib.
That way, everything should assemble and link correctly.
Just those functions in question will not be fully functional. But, they will assemble.

Steve
« Last Edit: May 09, 2012, 09:07:29 AM by SteveA »

jcfuller

  • Guest
Re: BxbAsm
« Reply #235 on: May 07, 2012, 12:33:14 PM »
Steve,
  I'm still getting the BSS segments warning and I think it may be the the result of different include files. Mine is a bit of a mix.
Might be a good idea to upload yours.

James

jcfuller

  • Guest
Re: BxbAsm
« Reply #236 on: May 07, 2012, 01:41:22 PM »
Steve,
  I really did not want disabled procs just a list of those that were specifically Win32.
As it is anything I wanted to test on Windows is now just a dummy.

I'm also confused with the bxblib-c-source.zip and the disabled-procs.zip. They appear to be the same procs one in c and  the other in asm?

James

SteveA

  • Guest
Re: BxbAsm
« Reply #237 on: May 07, 2012, 04:33:01 PM »
I really did not want disabled procs just a list of those that were specifically Win32.
As it is anything I wanted to test on Windows is now just a dummy.

Actually, that's not the case.
    get_sys_data: is just fine,
    get_sys_time: is just fine,
      ClearScreen: is an empty function,
              locate: is an empty function,
       Do_initialize: has only one line commented-out,
      setcolortext: has only one line commented-out,
 get_HiRez_Timer: only has two lines commented-out,
            wherexy: the entire function is commented out.

Here is the code for ClearScreen:
Code: [Select]
/* BXBLIB.C */
/*
/*  *************BxbAsm Compiler*************
/*  Copyright: sarbayo (c) 2004-2012
/* ========================================================================= */


#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>


#include "bxblib.h"





void _stdcall ClearScreen()
{
    COORD coordScreen = { 0, 0 };    // home for the cursor
    DWORD cCharsWritten;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    DWORD dwConSize;

    HANDLE hConsole;


    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

    // Get the number of character cells in the current buffer.

    if(!GetConsoleScreenBufferInfo(hConsole, &csbi))
    {
        printf("abort at: 1\n");
        return;
    }

    dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

    // Fill the entire screen with blanks.

    if(!FillConsoleOutputCharacter(hConsole, (TCHAR) ' ', dwConSize, coordScreen, &cCharsWritten))
    {
        printf("abort at: 2\n");
        return;
    }

    // Get the current text attribute.

    if(!GetConsoleScreenBufferInfo(hConsole, &csbi))
    {
        printf("abort at: 3\n");
        return;
    }

    // Set the buffer's attributes accordingly.

    if(!FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten))
    {
        printf("abort at: 4\n");
        return;
    }

    // Put the cursor at its home coordinates.

    SetConsoleCursorPosition(hConsole, coordScreen);

}
/*------ end ClearScreen ------*/


this code is provided in file: bxblib-c-sources.zip

Here is the code for locate:
Code: [Select]

/* BXBLIB.C */
/*
/*  *************BxbAsm Compiler*************
/*  Copyright: sarbayo (c) 2004-2012
/* ========================================================================= */


#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>


#include "bxblib.h"





void _stdcall locate(int cx, int cy)
{
    COORD coordScreen;
    HANDLE hConsole;


    coordScreen.X = cx;
    coordScreen.Y = cy;
                             /* Get this console handle */
    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

                             /* Put the cursor at its coordinates */
    SetConsoleCursorPosition(hConsole, coordScreen);

}
/* ------ end locate ------ */


this code is provided in file: bxblib-c-sources.zip

Quote
I'm also confused with the bxblib-c-source.zip and the disabled-procs.zip. They appear to be the same procs one in c and  the other in asm?

Some files were never converted to ".asm", that's why the C source code was provided.
It was not meant to confuse, just to be thorough.

« Last Edit: May 07, 2012, 05:12:49 PM by SteveA »

jcfuller

  • Guest
Re: BxbAsm
« Reply #238 on: May 08, 2012, 03:46:55 AM »
Steve,
  Using the new library and includes test6 compiles and runs fine but I get a linker warning when using polink my prefered linker.
James

Code: [Select]
C:\bxb-linux>polink /SUBSYSTEM:CONSOLE "test6.obj" kernel32.lib msvcrt.lib user3 2.lib fpu.lib bxblib.lib /OUT:"test6.exe"
POLINK: warning: Unrecognized option 'library:<tcconio.lib>'; ignored.
POLINK: warning: Unrecognized option 'library:<tcconio.lib>'; ignored.

SteveA

  • Guest
Re: BxbAsm
« Reply #239 on: May 08, 2012, 07:34:28 AM »
 Using the new library and includes test6 compiles and runs fine but I get a linker warning when using polink my prefered linker.
Code: [Select]
C:\bxb-linux>polink /SUBSYSTEM:CONSOLE "test6.obj" kernel32.lib msvcrt.lib user3 2.lib fpu.lib bxblib.lib /OUT:"test6.exe"
POLINK: warning: Unrecognized option 'library:<tcconio.lib>'; ignored.
POLINK: warning: Unrecognized option 'library:<tcconio.lib>'; ignored.

Hmm,
I don't know where the reference to tcconio.lib is coming from.
I don't see that in the source code.


edit:
oh oh...
I see the problem.
let me fix something.

Okay, it appears that in my haste, yesterday, I copied the wrong sources, (from the wrong folder).
Here are the correct sources.
Sorry about that.

Steve


« Last Edit: May 08, 2012, 07:52:14 AM by SteveA »