News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Recent posts

#1
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by jj2007 - Today at 09:06:29 AM
Attached a translated file - a very early version, just to give you an idea... lots of manual fixes needed. I won't have much time to work on it.

Source and exe of the translator in the second attachment. Drag any *.bas file over the exe to translate it to MyTest.asm
#2
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by FORTRANS - Today at 06:26:14 AM
Quote from: jj2007 on Today at 05:36:14 AMHi Steve,

Can you post an example (not a Hello World, something bigger)?

   Here is one of the games.  Typed in, partly debugged, and starts to
run.  It may have more errors though.  I also put in some INPUT statements
to avoid the scrolling from allowing one to read things.  Not yet worked
out for all text.

QuoteMasmBasic is closer to GfaBasic, but it might not be difficult to write a translator. It seems BASICA is roughly the same as GW-BASIC, right?

   If I remember, GW-BASIC was newer and could compile to an executable.
BASICA is only an interpreter.  They were compatible for all the programs
I tried at the time.  Equals long ago though.

Regards,

Steve
#3
CoderStudio / Listing shared printers
Last post by Vortex - Today at 06:15:53 AM
Hello,

This command line tool enumerates the printers shared by a remote system. You can copy the import library winspool.lib offered with the zip archive to the folder \Link32\lib

Usage : ListPrinters \\server
ListPrinters.c :

#include <windows.h>

#include <winspool.h>

#include <stdio.h>

int main(int argc, char * argv[]) {

    DWORD cbBuf = 0;
    DWORD pcReturned;
    PRINTER_INFO_2 * prinfo;
    BOOL r;
    int rv = 0;
    DWORD i;

    char * err = "The EnumPrinters API could not retrieve printer information.\n";

    if (argc != 2) {
        printf("ListPrinters V1.0 by Vortex\n\nUsage : ListPrinters \\\\server\n");
        return 1;
    }

    EnumPrinters(PRINTER_ENUM_SHARED | PRINTER_ENUM_NAME, argv[1], 2, NULL, 0, & cbBuf, & pcReturned);

    if (!cbBuf) {
        printf("%s", err);
        return 2;
    }

    prinfo = (PRINTER_INFO_2 * )VirtualAlloc(0, cbBuf, MEM_COMMIT, PAGE_READWRITE);

    if (!prinfo) {
        printf("Memory allocation failed.\n");
        return 3;
    }

    r = EnumPrinters(PRINTER_ENUM_SHARED | PRINTER_ENUM_NAME, argv[1], 2, (LPBYTE) prinfo, cbBuf, & cbBuf, & pcReturned);

    if (!r) {
        printf("%s", err);
        rv = 2;

    } else {

        for (i = 0; i < pcReturned; ++i) {
            printf("%s\n", prinfo[i].pShareName);
        }
    }

    VirtualFree(prinfo, 0, MEM_RELEASE);
    return rv;

}

Building the project :

\pcc32\pcc32 /I\pcc32\include /c ListPrinters.c
\link32\link32 /SUBSYSTEM:CONSOLE /LIBPATH:\link32\lib /NEV ListPrinters.obj kernel32.lib user32.lib msvcrt.lib winspool.lib
#4
The Campus / Re: sprintf_s in masm ?
Last post by alCoPaUL - Today at 06:13:42 AM
StrLen() must be sanitized by checking if it's FFFFFFFEh to get the Maxed Capacity.

But the Primacy of the 999426 DUP(0) buffer is upheld so StrLen(data), by practice, is wayyy smaller than the function's Maxed Capacity.

And since I posted the 64-bit version, now it's clear why the size of the buffer in 64-bit sprintf_s can be ommited coz the maxed capacity of StrLen(data), to suffice the length of the inputted data to sprintf_s, Ideally, is effing FFFFFFFFFFFFFFFEh bytes.
#5
MasmBasic & the RichMasm IDE / Re: Silly question
Last post by jj2007 - Today at 05:36:14 AM
Hi Steve,

Can you post an example (not a Hello World, something bigger)?

MasmBasic is closer to GfaBasic, but it might not be difficult to write a translator. It seems BASICA is roughly the same as GW-BASIC, right?
#6
MasmBasic & the RichMasm IDE / Silly question
Last post by FORTRANS - Today at 04:44:42 AM
Hi Jochen,

   I was looking at a book by Creative Computing "More BASIC Computer
Games", David H. Ahl, 1979.  And was thinking of typing in some of
them for old times sake.  The BASIC used for these programs is the
Microsoft BASICA.  The version I have is from the MS_DOS 6.22
installation diskettes.  Now for a dumb question about MASMBASIC.
How compatible are these two BASICs?  Or, how easy would it be to use
MASMBASIC to run a BASICA program?  My most used computer here doesn't
run MASMBASIC or I would look at it here.

Notes:

   1. I can run BASICA, but this is to share with someone with Windows
10, which cannot run DOS programs natively.  And I don't know if I can
do a software installation on his system,

   2. I am, at best, a slow typist.  So if this happens at all, it will
probably be a limited excursion.  Mostly to reacquaint myself with using
BASIC.

   3. Along with #2, these games look a bit contrived.  So probably not
much of a loss if I give up early on in this enterprise.

   Alternate version of the question; what is the best free BASIC to
run BASICA programs in a Windows 10 console?

Regards,

Steve
#7
The Laboratory / Re: DBScan, Homogeneity and Co...
Last post by guga - May 17, 2024, 04:59:54 PM
New version in C (to be compiled with Pelles) with a bit of optimization and precalculating the euclidean distances.

I´ll try optimize it even further before porting it to Assembly.

#8
The Campus / Re: sprintf_s in masm ?
Last post by alCoPaUL - May 17, 2024, 04:37:40 PM
Quote from: jj2007 on May 17, 2024, 03:09:59 PMDll hell in the 21st Century, isn't it lovely?
C:\Windows\System32\msvcrt.dll
C:\Windows\System32\msvcr100_clr0400.dll
C:\Windows\System32\msvcr120_clr0400.dll
C:\Windows\System32\msvcrt20.dll
C:\Windows\System32\msvcrt40.dll
C:\Windows\System32\msvcr71.dll
C:\Windows\System32\msvcr80.dll
C:\Windows\System32\msvcr100.dll

There is a simple solution:
- find out what's the latest msvcr*.dll
- use LoadLibrary and GetProcAddress

m$ tactics - either for the $$ or from old school m$ guises who don't want all the os versions to be swiped by malware so they grouped the default development software for the os via different redistributable runtime files..

anyway, attached is similar code that i previously posted with 3 C Standard lib functions but it's written in another assembler. you can easily format this to masm32 assembly src file using the previous code that i shared as template..

splitted the zip (file size restrictions) so just rename faxx.jpg to faxx.z01...
#9
The Campus / Re: sprintf_s in masm ?
Last post by jj2007 - May 17, 2024, 03:09:59 PM
Dll hell in the 21st Century, isn't it lovely?
C:\Windows\System32\msvcrt.dll
C:\Windows\System32\msvcr100_clr0400.dll
C:\Windows\System32\msvcr120_clr0400.dll
C:\Windows\System32\msvcrt20.dll
C:\Windows\System32\msvcrt40.dll
C:\Windows\System32\msvcr71.dll
C:\Windows\System32\msvcr80.dll
C:\Windows\System32\msvcr100.dll

There is a simple solution:
- find out what's the latest msvcr*.dll
- use LoadLibrary and GetProcAddress
#10
The Campus / Re: sprintf_s in masm ?
Last post by alCoPaUL - May 17, 2024, 12:30:20 PM
Quote from: sudoku on May 17, 2024, 12:19:08 PMTried to run your executable


the library (.lib) is from visual studio 2010, needs the appropriate redistributable runtimes..