Half-Byte Tiny Basic–info and download

101_3346_thumbHalf-Byte Tiny Basic is now complete. It supports 80×48 graphic resolution, 20 by 8 lines of text using a 4 x 6 bit character set. Audio generation via 16384 tones from a single channel. Graphical support in the form of Line, Box, Set, Reset, Circle and Shift statements and the Get function. 16 bit integer math is supported. Direct hardware access via the DWrite, AWrite statements and ARead and DRead functions. Serial port access via the SPrint and Echo statements as well as the IN function. You have access to all of the I/O pins of the 328p controller chip, the heart of the Arduino UNO and the Half-Byte Console.  The Wii Nunchuck and Classic Controller are supported via the PAD function.  LImited string handling can be accomplished (but there is no native string support.)

WP_20140701_018-2_thumbFunctions include ABS, CHR, RND and INKEY.

Half-Byte Tiny Basic harkens back to the early days of home computing when memory was low and very expensive. Video capability was primitive (as it is, admittedly, here) and mass storage was non-existent. You only have one thousand bytes memory available for your Basic program. Half-Byte Tiny Basic is based on a version of 68000 Tiny Basic written by Mike Field. This version is optimized and specifically developed for on board development using a PS/2 keyboard and the TVOut Arduino library. And it is ideal for teaching the basics of computer programming. It is easy to learn and easy to use.WP_20140701_007_thumb

Since the Half-Byte Console is a very simple device, many shortcuts (as in the early days) had to be taken. For instance, memory is at a premium and that is why the resolution is low and the font is cramped. There is no fancy integrated development environment, heck, there isn’t a real editor: you make a mistake on a line, you type it in again. The LIST WP_20140701_027-2_thumbcommand is very primitive: LIST will type out the whole program, LIST <line number> begins typing out the program starting at <line number> while LIST <line number>- will type out JUST that line.  You can only SAVE one program as there is currently no mass storage (but, I am working on a better solution, stay tuned!)

Half-Byte Tiny Basic is not perfect, but is works well and is a great tool for teaching. Best of all, you can download it for free.  A short document explaining the commands,statements and functions is included. You get the source code and the documentation all for free.  A nicer book/manual will soon be available for a small cost. The book written so that someone with no experience can pick it up, read and follow it to gain a basic understanding of how to write a program and get it to work. This book will also be part of the Programmer’s kit for the Half-Byte Console.

SAMPLE CODE

Here are a few pieces of sample code:

Kaliedoscope 3

100 CLS
110 X=RND(79)
120 Y=RND(47)
130 P=RND(79)
140 Q=RND(47)
150 SET X,Y
160 SET 79-X,Y
170 SET 79-X,47-Y
180 SET X,47-Y
190 RESET P,Q
200 RESET 79-P,Q
210 RESET 79-P,47-Q
220 RESET P,47-Q
230 Z=RND(100)
240 R=RND(20)
250 IF Z>92 CIRCLE 40,24,R,1
260 IF Z>92 FOR I=1 TO R
270 IF Z>92 CIRCLE 40,24,I,0
280 IF Z>92 NEXT I
290 GOTO 110

Half-Byte Demo

100 CLS
110 FOR K=0 TO 4
120 CURSOR K,3
130 PRINT ” Half-”
140 CURSOR 14-K,3
150 PRINT “Byte ”
152 DELAY 1000
160 NEXT K
170 FOR R=1 TO 20
180 CIRCLE 38,21,R,1
184 DELAY 50
186 CIRCLE 38,21,R-1,0
190 NEXT R
195 CIRCLE 38,21,R-1,0
197 DELAY 1000
199 X=7
200 A=67:GOSUB 900
210 A=79:GOSUB 900
220 A=78:GOSUB 900
230 A=83:GOSUB 900
240 A=79:GOSUB 900
250 A=76:GOSUB 900
260 A=69:GOSUB 900
400 GOTO 100
900 FOR Y=0 TO 6
910 CURSOR X,Y
920 PRINT CHR(A);
930 DELAY 250
940 CURSOR X,Y
950 PRINT ” “;
960 NEXT Y
970 CURSOR X,7
980 PRINT CHR(A);
985 X=X+1
990 RETURN

You can download a PDF of the Half-Byte Tiny Basic Guide here.

You can download a ZIP file with the Half-Byte Tiny Basic source, Guide and some example code from here.

You need to download the 4x6g font file as it was not included in the package.  Get it here. Unzip it to your Arduino\Library\TVOUTFONT directory. Allow it to overwrite the files.

You can download the Half-Byte serial terminal for Arduino here.

The serial terminal runs on another Half-Byte Console or Arduino that has the Video and Audio output modifications and runs TVOut. Connect the two devices using TX,RX and GND pins. This allows you to use the serial terminal as an output device, providing a second screen to your console. The terminal provides 128×96 graphics and 22×16 lines of text. The terminal software interprets special code for clear screen, set pixel, reset pixel and box.

PLEASE NOTE:

Half-Byte Tiny Basic Copyright (c) 2014 George Gray

Arduino Tiny Basic Copyright © 2011 Mike Field

TVOut Library Copyright© 2010 Myles Metzer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be  included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s