flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > MINI-BASIC in MASM converted to FASM?

Author
Thread Post new topic Reply to topic
dunric76



Joined: 06 Mar 2009
Posts: 3
MINI-BASIC in MASM converted to FASM?
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: 245
Location: US
[]


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: 1210
Location: Greece
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 Reply with quote
dunric76



Joined: 06 Mar 2009
Posts: 3
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: 1904
Re: MINI-BASIC in MASM converted to FASM?

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
Re: MINI-BASIC in MASM converted to FASM?

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 Visit poster's website Reply with quote
dunric76



Joined: 06 Mar 2009
Posts: 3
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: 15241
Location: 1I/╩╗Oumuamua
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: 7109
Location: Slovakia

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

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 Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1210
Location: Greece
Re: MINI-BASIC in MASM converted to FASM?

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.

Mini-Basic v1.0
Fasm v1.69.14
System: Windows XP 32-Bit

Image


Description:
Download
Filename: MBI.zip
Filesize: 45.3 KB
Downloaded: 214 Time(s)



Last edited by Picnic on 29 Aug 2014, 21:41; edited 4 times in total
Post 01 May 2010, 12:20
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 753
Location: Massachusetts, USA
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     eax0
    jz      Error
    ret
Error:
.data
MsgBoxCaption            DB "API Error",0
MsgBoxText               DB "Error "
MsgBoxText1              DB "    "0
.code
    invoke  MessageBox0ADDR MsgBoxTextADDR MsgBoxCaption0
    invoke  ExitProcess0

Post 01 May 2010, 22:14
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1210
Location: Greece

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 Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15241
Location: 1I/╩╗Oumuamua
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: 1210
Location: Greece
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 Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15241
Location: 1I/╩╗Oumuamua

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
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.