flat assembler
Message board for the users of flat assembler.

Index > Main > MINI-BASIC in MASM converted to FASM?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
dunric76



Joined: 06 Mar 2009
Posts: 3
dunric76 06 Mar 2009, 01:31
MINI-BASIC is a Window Console Basic interpreter using Windows API to manage display, keyboard and files. MBI.ZIP includes executable MINI-BASIC, complete SOURCE listing in MASM assembler, MINI-BASIC user's guide and PITMAN, a special Basic game for MINI-BASIC.

Although Mini-Basic works fine, it may be considered as a toy to play with for newbies and experienced Assembly programmers, a piece of code available for modifications, enhancements, experiences and programming pleasure. Some problems are not totally solved (console window resizing for example).

Please, report bugs, enhancements, new commands, optimizations you add in MINI-BASIC.

New versions will be added to this page to keep MINI-BASIC alive.

MINI-BASIC was written with MASM32 tools available for free at http://www.masm32.com

There is also a Yahoo Group devoted exclusively to MINI-BASIC. That can be found below:

http://tech.groups.yahoo.com/group/minibasic/

Let me know if you're able to convert it from MASM to FASM.

Paul
Post 06 Mar 2009, 01:31
View user's profile Send private message Send e-mail Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 244
Location: US
Yardman 06 Mar 2009, 04:38
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 03:26; edited 1 time in total
Post 06 Mar 2009, 04:38
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 06 Mar 2009, 11:01
Hi dunric76,

If you talking about this Mini-Basic i like the project and i've experimented a lot with it in MASM, i still do occasionally, trying to fully understand the code.
I've contact the author a couple of times in the past (are u him?)
It uses only 486 instructions and console api calls, but it's a bit outdated and there are some API issues which need to be fixed.
Yes, a FASM version would be nice.

Yardman's link is a powerful Basic interpreter, but 15000 code lines are beyond my potentials Very Happy
Post 06 Mar 2009, 11:01
View user's profile Send private message Visit poster's website Reply with quote
dunric76



Joined: 06 Mar 2009
Posts: 3
dunric76 06 Mar 2009, 15:13
A FASM version, I believe, would have fewer errors. MINI-BASIC has some issues with sometimes crashing with strange Windows API errors. And sometimes the text formatting is a bit off, especially with printing integers to the screen.

I think it would be a nice project to convert it over to FASM, and make some changes so it doesn't crash.

Paul
Post 06 Mar 2009, 15:13
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 07 Mar 2009, 02:38
dunric76 wrote:
MINI-BASIC was written with MASM32 tools available for free at http://www.m.a.s.m.32.com


RTFL ! You can maybe get MASM32 legally without explicitly paying for it, however, you must already have a paid OS from Macrosoft, and you may develop for paid "OS"'s from Macrosoft only (so restrict your users as well).
Post 07 Mar 2009, 02:38
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 07 Mar 2009, 03:41
DOS386 wrote:

RTFL ! You can maybe get MASM32 legally without explicitly paying for it, however, you must already have a paid OS from Macrosoft, and you may develop for paid "OS"'s from Macrosoft only (so restrict your users as well).


Yes ... but ... where's the problem? MBasic is a Win32 program, it runs on Windows. As far as Masm32 is concerned, there is absolutely no problem.

What might be an issue is that the MBasic source is copyrighted. That means, you cannot just convert the source to Fasm and make this new source publicly available.

Quote:
A FASM version, I believe, would have fewer errors.

How is this to be achieved? Some black magic?
Post 07 Mar 2009, 03:41
View user's profile Send private message Reply with quote
dunric76



Joined: 06 Mar 2009
Posts: 3
dunric76 09 Mar 2009, 16:54
Well, FASM seems more stable than MASM. I believe it would output better assembly. I've used FASM before while compiling HLA (High Level Assembly" language programs. It works well and uses POLINK.

Paul
Post 09 Mar 2009, 16:54
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 09 Mar 2009, 17:29
Is this true? I know MASM has some failings but I never knew it spat out bad binary code. Which instructions does it get wrong?
Post 09 Mar 2009, 17:29
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 09 Mar 2009, 23:36
Quote:
Which instructions does it get wrong?

not really "instruction", but at least it gets "invoke" wrong in some cases (word param in 32bit code, i think)

Quote:
A FASM version, I believe, would have fewer errors.

Errors in FASM are often fixed within hour. In other cases, you never wait more than few days.
Post 09 Mar 2009, 23:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 10 Mar 2009, 06:07
vid wrote:
Quote:
Which instructions does it get wrong?

not really "instruction", but at least it gets "invoke" wrong in some cases (word param in 32bit code, i think)


The old "invoke" bug has reportedly been fixed in Masm v9.0. I didn't test myself, though.
Post 10 Mar 2009, 06:07
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 01 May 2010, 12:20
dunric76 wrote:
Let me know if you're able to convert it from MASM to FASM.


Fasm users can now experiment with MINI-BASIC.
Note: No effort has been made to update the code or fix some IDE bugs.

Download

Image


Last edited by Picnic on 21 Mar 2020, 10:04; edited 8 times in total
Post 01 May 2010, 12:20
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 01 May 2010, 22:14
Took a quick peek, no time now, but...

WTF?
Code:
STD_INPUT_HANDLE  EQU -10 ;Standard console input handle
STD_OUTPUT_HANDLE EQU -11 ;Standard console output handle    


WTF?
Code:
TestApiError:
    mov     DWORD PTR [MsgBoxText1], "API "
    cmp     eax, 0
    jz      Error
    ret
Error:
.data
MsgBoxCaption            DB "API Error",0
MsgBoxText               DB "Error "
MsgBoxText1              DB "    ", 0
.code
    invoke  MessageBox, 0, ADDR MsgBoxText, ADDR MsgBoxCaption, 0
    invoke  ExitProcess, 0    
Post 01 May 2010, 22:14
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 02 May 2010, 10:10
bitshifter wrote:
Took a quick peek, no time now, but...

WTF?
[code]STD_INPUT_HANDLE EQU -10 ;Standard console input handle
STD_OUTPUT_HANDLE EQU -11 ;Standard console output handle


Well, these lines can be remarked or removed since handles already defined.
Post 02 May 2010, 10:10
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 02 May 2010, 10:33
Picnic: The second WTF from bitshifter is because if fasm generates an .exe directly (without a linker) then you get the label "Error:" at then end of one section, then a new section with the API strings, then another new section with some more code. fasm doesn't combine sections, that is what linkers do. fasm just lays out the sections exactly as you present them.

So what will happen is that if the code ever gets to the "Error:" label you will get the code running wild executing unexpected code.


Last edited by revolution on 02 May 2010, 11:47; edited 1 time in total
Post 02 May 2010, 10:33
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 02 May 2010, 11:38
I understand, so it's advisable to keep all MINI-BASIC data in one section.
Post 02 May 2010, 11:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 02 May 2010, 11:40
Picnic wrote:
I understand, so it's advisable to keep all MINI-BASIC data in one section.
I think that would be advisable.

[edit] Actually more to the point is to combine all the code sections together.
Post 02 May 2010, 11:40
View user's profile Send private message Visit poster's website Reply with quote
Robocod



Joined: 05 Mar 2018
Posts: 15
Robocod 21 Dec 2018, 05:19
How do you get a MBI file to load? It seems to be giving me some trouble by saying file not found. Though I made a separate folder for it.
Post 21 Dec 2018, 05:19
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 21 Dec 2018, 05:36
Need more information.

Which file is not found? Please show the error that fasm reports.
Post 21 Dec 2018, 05:36
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13069
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 21 Dec 2018, 06:04
cool,
i wanna try this later, thanks
Post 21 Dec 2018, 06:04
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 21 Dec 2018, 06:18
Robocod wrote:
How do you get a MBI file to load? It seems to be giving me some trouble by saying file not found. Though I made a separate folder for it.


Hi,
Recompile the source and try again. I did that just now and the PITMAN demo loaded ok. then type run.
Post 21 Dec 2018, 06:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.