flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Hobby Basic, a toy language interpreter written in fasm

Goto page 1, 2, 3, 4  Next
Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
Image

Hobby Basic is a toy interpreter for the Windows console.
It has a BASIC-like syntax.
Handles ANSI encoding graphics with ease.
Supports UTF-8 characters, keyboard and mouse.
Creates stand-alone executable.
Its implemented in fasm.

Download


A Hobby Basic program.
Code:

    rem  TV.BAS
    rem  Hobby Basic Interpreter

    a$ = 'N  O   S  I  G  N  A  L'

    dim c[8] = 15,14,11,10,13,12,9,0

    title a$

    screen 80,25,300
    cursor 0,0
    color 0,7
    cls

    for x = 0 to 7
        color c[x],0
        paint x*10,0,10,25,0x20,1
    next x

    erase 17
    erase 18
    erase 19

    pen 15
    at 25,18,a$

    locate 0,24
    inkey

    cls : end
    

Image



How to run the examples.

Open the command-line CMD.EXE in the HB folder.
To run the TV.BAS example, type:
Code:
hb EXAMPLES/TV.BAS    


Image



Notes for Windows 10 users.

In later versions of Windows you will need to temporary disable real-time protection for Microsoft Defender.
Antivirus programs do not like small executable files and often consider them (incorrectly) suspicious.

If Hobby Basic is not displaying or operating correctly in the default Windows 10 console,
enable the legacy option to have the maximum compatibility.

Image


Last edited by Picnic on 15 May 2021, 20:24; edited 239 times in total
Post 05 May 2013, 21:16
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1423
Location: Toronto, Canada
AsmGuru62
Great stuff!
Things like that motivate beginners to start programming.
Post 05 May 2013, 22:15
View user's profile Send private message Send e-mail Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6050
Location: Poland
MHajduk
I suppose that the author's sentiment to QuickBasic was the main inspiration for this project. Nice thing. Smile
Post 05 May 2013, 22:28
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
Nice. This prompts me to make a CLI graphics library. Looks pretty neat.
Post 07 May 2013, 04:31
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
I am glad you like it guys, i had some concern whether it can be served as an example or a tutorial, due to the lack of the source code.


Hobby Basic supports (partially) wide characters via utf-8 encoding.


Image


Last edited by Picnic on 15 May 2021, 09:27; edited 19 times in total
Post 07 May 2013, 10:10
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 826
Location: Jakarta, Indonesia
TmX
This is very nice.
Reminiscent of DOS apps.

Mouse handling would be a nice addition, I think Wink
Post 07 May 2013, 15:45
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 20:54; edited 1 time in total
Post 07 May 2013, 20:58
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
Picnic wrote:
I am glad you like it, i had some concern whether it can be served as helpful example despite the lack of comments in source.


If it can be understood then no worries.

Besides not all examples are aimed at beginners.
Post 07 May 2013, 23:30
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
TmX wrote:
Mouse handling would be a nice addition, I think Wink


Hobby Basic Version 0.0.2

I have uploaded a new version with minor improvements and bug fixes.
Mouse support is now available.


Random colored characters.


Image


Last edited by Picnic on 15 May 2021, 09:28; edited 41 times in total
Post 18 Aug 2013, 22:52
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
I have uploaded a new version with minor improvements and bug fixes.

Hobby Basic Version 0.0.3


Reading mouse input in the console.


Image


Last edited by Picnic on 15 May 2021, 09:29; edited 33 times in total
Post 15 Dec 2013, 01:37
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
I get this when I run MOUSE

Image
Post 15 Dec 2013, 05:58
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
Thanks for the feedback typedef. Can you please tell me your Windows version and if you tried the rest of the samples?
Post 15 Dec 2013, 10:10
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
Windows 7 64 bit. Actually all the programs except the binary and the the color ones. And why it says print I don't know
Post 15 Dec 2013, 14:27
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
I will look into the problem as soon as i can. I starting to feel a bit outdated with my windows xp 32-bit.


Last edited by Picnic on 15 Dec 2013, 17:35; edited 1 time in total
Post 15 Dec 2013, 17:28
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
I see. It's a version difference thing.
Post 15 Dec 2013, 17:34
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
I think i found what was causing the trouble. Give it a try if you like typedef.
Post 18 Dec 2013, 21:33
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
They work now Very Happy. Care to share what was causing it to say that?
Post 18 Dec 2013, 22:53
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
Nice to hear!
Sure, it seems that an improper call to SetConsoleOutputCP function crush the program. By the way, i installed Windows 7.
Post 19 Dec 2013, 21:09
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2908
Location: 0x77760000
typedef
Picnic wrote:
Nice to hear!
Sure, it seems that an improper call to SetConsoleOutputCP function crush the program. By the way, i installed Windows 7.


Hmm. Nice, what Win7 version?
Post 20 Dec 2013, 01:13
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1294
Location: Paradise Falls
Picnic
I have uploaded a new version with minor improvements and bug fixes.

Hobby Basic Version 0.0.4


A Tetris game in console. This is the first Hobby Basic game ever.


Image


Last edited by Picnic on 15 May 2021, 09:32; edited 28 times in total
Post 20 Dec 2013, 20:37
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3, 4  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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.