Reboot of XBLite project

122 views
Skip to first unread message

David Szafranski

unread,
Nov 9, 2024, 9:25:49 PM11/9/24
to xblite
Hi All,

After a long hiatus, I will have some time to update and further develop XBLite. Looking ahead,  I would like to focus my efforts on transitioning to a 64-bit version of XBLite. 

Let me know what you think, and also please report if you have any issues that I should address regarding any aspect of the compiler or libraries. 

thanks
David

David Silverwood

unread,
Nov 10, 2024, 9:08:38 AM11/10/24
to xbl...@googlegroups.com

That would be great!!


--
You received this message because you are subscribed to the Google Groups "xblite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xblite+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xblite/501cb2fd-5153-43dc-9845-27c4ef9ff083n%40googlegroups.com.

gentsky

unread,
Nov 10, 2024, 3:11:54 PM11/10/24
to xblite
Hi David,

Good to see you back!

A 64 bit version of Xblite would be great but would be a monumental piece of work. The parameter passing convention, register usage, stack organisation and so on, are all very different so I think every part of Xblite would need a start from scratch rewrite. Do we have enough active users to take this on?

I have not been involved much these last few years but recently restarted work on some string processing functions using SSE instructions which I hope to finish in the New Year.

Cheers,

Alan

Guy LONNE

unread,
Nov 11, 2024, 8:06:42 AM11/11/24
to xbl...@googlegroups.com
Hi David and Alan, so good to hear from you two!

Thank you for your continuing work: For two decades, the XBLite project
has been my playground to express my computer creativity and social
skills within a very friendly community, which was a welcome outlet for
my day-time job.


1.Concerning a reboot of XBLite project, this is what comes to my mind:
Whom will benefit for a 64 bit code generation?

My opinion: Re a 64 bit code generation, so far, not necessary: I see
Win 32 api as a "virtual machine" in Windows 10 and 11, and as a Wine
"virtual machine" in Linux Debian/Mint;

hence my 2-cent conclusion: XBLite is still useful and there to stay.

2.Re a bug report, I corrected a bug in XstFileExists() that you could
merge in your xsx.dll; in addition, the patch seems to solve xsx.dll's
error reporting to the programmer.

3.Re your GoAsm flavor of XBLite, I thought that it was a good way to
keep XBLite alive and useful.

4.I modified XSED to add the possibility to copy the edited file path to
the keyboard: a small but useful addiction (sorry ADDITION).


Best regards, Guy

David Szafranski

unread,
Nov 12, 2024, 2:13:39 AM11/12/24
to xblite
Hi Guy,

Great to hear back from you.

I just got back from visiting Paris in late October. We had not been back to France since 2018, so very happy to be back.

All of my early work on XBLite started when I was living in Paris. 

So I am now pretty much retired so I will have time to try to remember how this XBLite thing works. 

Please send me your updates/improvements to XstFileExists() and mods to xsed.

ciao for now,
David  

Guy LONNE

unread,
Nov 12, 2024, 5:05:07 PM11/12/24
to xbl...@googlegroups.com
Hi D.
I'll pack up these two patches gladly.
Bye! Guy

--
You received this message because you are subscribed to the Google Groups "xblite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xblite+un...@googlegroups.com.

bushpilot

unread,
Nov 13, 2024, 1:17:43 AM11/13/24
to xblite
Hmm, I hope you are not thinking you are going to leave me out!

Life changes, yes there are many. I am no longer in Africa, and now live near Spokane, WA. In the interim years, I have forgotten nearly everything I knew about xblite and assembly language. I have used neither for at least a decade.

One thing I would like to look at again is the code generated for functions. You may remember that many years ago when I did the rewrite of the compiler to output goasm code (version 2.0.0), I did some function prolog and epilog code optimizations. I have wondered for many years whether I got that quite right, or if there is possicly a memory leak there. (Today, I probably wouldn't understand the code I wrote if I looked at it ...)

Anyway, hoping to join you here, some time in the near future.

Greg aka bushpilot

David Szafranski

unread,
Nov 13, 2024, 6:50:43 PM11/13/24
to xblite
Wow, hi Greg! 
Glad to see you are still kicking around! And in Spokane...I'm not too far away in Portland OR. I have the same memory issues concerning how all of this XBLite stuff was put together. It is going to take some time to get up to speed again. Ok, looking forwards to hearing more from you soon.

all for now,
David

Guy LONNE

unread,
Nov 21, 2024, 5:59:20 PM11/21/24
to xbl...@googlegroups.com
Hi D.!

Please find attached my version of xsx.x.

The attached xsx.x is your own version of
C:\xblite\compiler_sources\xblite_242_src\Xsx\xsx.x, in which I merged
all my modifications.

If you use a file comparator (I use WinMerge), you will easily exhibit
all my changes.

MODIFICATIONS
=============

1.Corrected a bug that returned a locked existing file as "does not exist".

Fix: Return a locked file as existing.

Old Version
=============================================================
FUNCTION XstFileExists (file$)

    IFZ file$ THEN RETURN ($$TRUE)
    ofile = XxxOpen (file$, $$RD)
    IF ofile = -1 THEN RETURN ($$TRUE)
    XxxClose (ofile)

END FUNCTION
=============================================================

New Version
=============================================================
FUNCTION XstFileExists (file$)

    XLONG fileNumber                    ' file number
    XLONG errno                                ' last-error code
    XLONG lastError, newError    ' to set current run-time ERROR
    XLONG bFileExists                    ' $$TRUE if file exists
'
' v0.023-old---
'    IFZ file$ THEN RETURN ($$TRUE)
' v0.023-old===
' v0.023-new+++
    IFZ file$ THEN
        ' Invalid Argument
        newError = ($$ErrorObjectArgument << 8) OR
$$ErrorNatureInvalidArgument
        lastError = ERROR (newError)        ' set current run-time error
        RETURN (-1)                                            ' failure
    ENDIF
' v0.023-new===
'
    bFileExists = $$FALSE
    SetLastError (0)        ' reset the last-error code
    fileNumber = XxxOpen (file$, $$RD)
'
' v0.023-old---
'    IF fileNumber = -1 THEN RETURN ($$TRUE)
' v0.023-old===
' v0.023-new+++
    IF fileNumber > 0 THEN
        bFileExists = $$TRUE        ' file exists
        XxxClose (fileNumber)        ' close opened file
        fileNumber = 0                    ' GL-optional
    ELSE
        ' Error: Can't open the file
        errno = GetLastError ()
        XstSystemErrorToError (errno, @newError)
        lastError = ERROR(newError)        ' set current run-time ERROR
        '
        SELECT CASE errno
            CASE $$ERROR_FILE_NOT_FOUND, $$ERROR_PATH_NOT_FOUND
                ' file not found
            CASE ELSE
                bFileExists = $$TRUE        ' file exists
        END SELECT
    ENDIF
' v0.023-new===
'
    RETURN (bFileExists)

END FUNCTION
=============================================================

2.' In XstLog added XstGetLocalDateAndTime to get also the local
time-stamp, fixed bug in second calculation (Guy Lonne)
' style = 2  (GL-new: add LOCAL time/date stamp)

I remembered what you replied me when I reported the bug and its fix:
"Log records are traditionally time-stamped with Greenwich mean time".

You were right, so I submit to your judgement of keeping GMT time stamp
as before and adding this new style = 2 as an added bonus for Xbliters
like myself (who know already how to handle this issue).

Old Version
=============================================================

' #######################
' #####  XstLog ()  #####
' #######################
'
' style = 0  (default, add time/date stamp)
' style = 1  (no time/date stamp)

FUNCTION  XstLog (message$, style, fileName$)
    STATIC  enter
'
    IFZ fileName$ THEN fileName$ = "x.log"

    IFZ style THEN
        ' GL-18sep07-XstGetDateAndTime (@year, @month, @day, 0, @hour,
@min, @sec, @nanos)
        XstGetLocalDateAndTime (@year, @month, @day, 0, @hour, @min,
@sec, @nanos)
        '
'        stamp$ = RIGHT$("000" + STRING$(year),4) + RIGHT$("0" +
STRING$(month),2) + RIGHT$("0" + STRING$(day),2) + ":" + RIGHT$("0" +
STRING$(hour),2) + RIGHT$("0" + STRING$(min),2) + RJUST$("0" +
STRING$(sec),2) + "." + RIGHT$("000" + STRING$(nanos\1000000),3) + ": "
        stamp$ = RIGHT$("000" + STRING$(year),4) + "-" + RIGHT$("0" +
STRING$(month),2) + "-" + RIGHT$("0" + STRING$(day),2) + "  " +
RIGHT$("0" + STRING$(hour),2) + ":" + RIGHT$("0" + STRING$(min),2) + ":"
+ RIGHT$("0" + STRING$(sec),2) + "  "
        message$ = stamp$ + message$
    END IF
'
    IFZ enter THEN
        enter = $$TRUE
        ofile = OPEN (fileName$, $$WRNEW)
    ELSE
        ofile = OPEN (fileName$, $$WR)
    END IF
'
    IF (ofile >= 3) THEN
        length = LOF (ofile)
        SEEK (ofile, length)
        PRINT [ofile], message$
        CLOSE (ofile)
    END IF
END FUNCTION
=============================================================

New Version
=============================================================

' #######################
' #####  XstLog ()  #####
' #######################
'
' style = 0  (default, add time/date stamp)
' style = 1  (no time/date stamp)
' style = 2  (GL-new: add LOCAL time/date stamp)

FUNCTION  XstLog (message$, style, fileName$)
    STATIC  enter
'
    IFZ fileName$ THEN fileName$ = "x.log"

    SELECT CASE style
        CASE 0
            ' Get the current date and time in GMT (Greenwich mean time)
            ' for logging time-stamp.
            XstGetDateAndTime (@year, @month, @day, 0, @hour, @min,
@sec, @nanos)
'
' GL-new+++
        CASE 2
            ' GL-Get the local date and time.
            XstGetLocalDateAndTime (@year, @month, @day, 0, @hour,
@min, @sec, @nanos)
' GL-new===
'
        CASE ELSE
            year = 0
            '
    END SELECT

    IF year THEN
'        stamp$ = RIGHT$("000" + STRING$(year),4) + RIGHT$("0" +
STRING$(month),2) + RIGHT$("0" + STRING$(day),2) + ":" + RIGHT$("0" +
STRING$(hour),2) + RIGHT$("0" + STRING$(min),2) + RJUST$("0" +
STRING$(sec),2) + "." + RIGHT$("000" + STRING$(nanos\1000000),3) + ": "
        stamp$ = RIGHT$("000" + STRING$(year),4) + "-" + RIGHT$("0" +
STRING$(month),2) + "-" + RIGHT$("0" + STRING$(day),2) + "  " +
RIGHT$("0" + STRING$(hour),2) + ":" + RIGHT$("0" + STRING$(min),2) + ":"
+ RIGHT$("0" + STRING$(sec),2) + "  "
        message$ = stamp$ + message$
    END IF
'
    IFZ enter THEN
        ' GL-first time thru
        enter = $$TRUE
        mode = $$WRNEW
    ELSE
        mode = $$WR
    END IF

    SetLastError(0)        ' clear the last Windows lastErr code
    ofile = OPEN (fileName$, mode)
    IF (ofile < 1) THEN
        ' Error: Can't open the file
        errno = GetLastError ()
        XstSystemErrorToError (errno, @newError)
        lastError = ERROR(newError)        ' set current run-time error
        RETURN (-1)                                        ' failure
    ENDIF

    ' Append the log message.
    fileSize = LOF (ofile)
    SEEK (ofile, fileSize)
    PRINT [ofile], message$
    CLOSE (ofile)
' v0.023-new===
'
END FUNCTION
=============================================================


3.Added:

' - XstGetFileBOM              (file$, @fileBOM$, @code_char) - decode
the Byte Order Mark of a text file
' - XstGetStringTypeBOM (code_char, @strBOM$) - return the Byte Order
Mark of a given STRING type
' - XstResetFileBOM          (file$, code_char) - reset the Byte Order
Mark of a file
' (See GetFileBOM.x: demo program for these new functions)
'
' - XstTrimPath$                 (file$) - trim a directory path or a
file path

Attached is a demo program for these new functions: GetFileBOM.x along
with some test files.

That's all, folks!

Bye!

Guy

xsx.x
GetFileBOM.x
test_files.zip

Guy LONNE

unread,
Nov 22, 2024, 5:13:32 PM11/22/24
to xbl...@googlegroups.com
Hi D.

I have to apologize for a rushed delivery of xsx.x: I did not pick up my
latest version!

Attached is the correct version; please note in the new source:
PROGRAM    "xsx"
VERSION    "0.023"        ' 22 November 2024

Bye! Guy
xsx.x
Reply all
Reply to author
Forward
0 new messages