Minecraft MS-Basic
Download
Recommended (Stable): Basic v1.0.120616
Latest: http://bigfootinformatika.hu/65el02/
Latest Updates
- Convert basic programs to text files, or convert text files to basic program format. Windows binaries of the tokenizer and detokenizer added to the resources section.
- New Basic 1.0 version released, several bugs fixed. Visit http://bigfootinformatika.hu/65el02/ for details.
- MCFSTool GUI version added. See “Using the File System Section” or “Resources” for Download
- Experimental BASIC V2.0.120603 released
- BASIC v1.0.12062 released, added pixel graphics and pixeldemo program. TICKS renamed to DELAY
- Latest snapshot basic_120531 released
- Snapshot 120528: ”HELP” command added to show a list of available commands
- Disable Ctrl-C with POKE 2,255 (Enable with POKE 2,0) Tweaks on floating point calculations.
Contents
- Introduction
- Installing BASIC in Minecraft Redpower Control
- Getting Started
- Commands
- Operators
- Operator Evaluation Rules
- Statements
- Functions
- Strings & String Functions
- I/O Special Functions
- IO Expanders
- Using the File System
- Programming Examples
- Useful Tricks
- Known Bugs
2. Installing BASIC in Minecraft Redpower Control
- Insert and boot the blue Forth Disk
-
When Mine OS has loaded insert a blank floppy into the drive, - Type SAVE” BASIC” into the terminal, then type DISKID to print out the disk ID of the blank floppy. Take note of the disk ID.
- Minimize the game window and locate the “redpower” folder of your current world save. Macintosh Users: ~/Library/Application Support/minecraft/saves/savename/redpower/ Windows Users: %appdata%/minecraft/saves/savename/redpower/
- Find a file ending with .img which has the DISK ID that you took note of in step 3.
- Download the latest BASIC img from http://bigfootinformatika.hu/65el02/ and rename the file so that it matches the generated img in the redpower folder
- Drag the file into the redpower folder and overwrite the file. If prompted to overwrite the file answer “Yes”.
- Log back into the game and start with a fresh computer, make sure to add at least 1 module of 8k RAM or BASIC won’t run.
- Boot the BASIC yellow floppy disk, if everything went well you should see the start up message after a few seconds.
Congratulations you’ve successfully installed BASIC.
Replacing the default boot loader image for faster booting of BASIC (Optional)
- Download “rpcboot.bin” from http://bigfootinformatika.hu/65el02/
- Navigate to your Minecraft mod folder and locate the Redpower Control Mod Zip File Macintosh Users: ~/Library/Application Support/minecraft/mods/. Windows: %appdata%/minecraft/mods/

- Extract the files in the Zip

- Take the rpcboot.bin file that was downloaded from the site and place it in RedpowerControl-2.0pr5b2/elooram/control/
- If prompted to overwrite an already existing file answer yes
- Select the extracted files and re-compress it into a zip file with the original name, then place it into your mod folder

- If everything went well the new boot code should start up and load ms basic immediately.
3. Getting Started
Minecraft MS-Basic is a “standard” BASIC with additional string handling capability and I/O commands, as well as the following features.
Minecraft MS-Basic allows multiple statements per line via “:”. Next without a variable can be used for when FOR-NEXT statements are not nested. END statements are not necessary. Question marks can be used instead of “PRINT”. “LET” is optional. No spaces are required in BASIC. These features allow highly efficient memory usage when necessary.
Variables can be two characters long. Longer variables can be used but only the first two characters will be utilized. The first charter must be alphabetic, the second can be alphabetic or numeric. Long variables can not contain words used by BASIC such as NEW,SIN, and so on. Since spaces are not necessary BASIC would interpret a variable such as “ANEW” as a variable A and the command “NEW” and would erase the program.
Variable Examples:
Legal: A, A1, AZ, BEQ, APPLE, TUESDAY
Illegal: 1A, #B, TOO, RGOTO, NEW 1, FREQUENCY
*Note that variables like AZ1 and AZ2 would be treated the same since BASIC looks only at the first two characters
4. Commands
| Name | Examples | Comments |
|---|---|---|
| LIST | LIST LIST 100 | Lists program Lists program from line 100. Control C stops program listing at end of current line. |
| RUN | RUN RUN 200 | Starts program execution at first line. All vars are reset. Run program from line 200 with variables reset |
| NEW | NEW | Deletes current program |
| CONT | CONT | Continues program after Control C or STOP if the program has not been modified. For instance a STOP followed by manually printing out variables and then a CONT is a useful procedure in program debugging. |
| SAVE | SAVE "PROG" | Saves your basic program from memory to disk. |
| LOAD | LOAD "PROG" | Loads your basic program from disk to memory |
| DIR | DIR | Shows the disk directory |
| CLRSCR | CLRSCR | Clears the screen |
| DISKFORMAT | DISKFORMAT "MYDISK" | Creates MCFS(Minecraft file system) on a blank (or occupied :) disk with name MYDISK |
| SAVEBASIC | SAVEBASIC"BASIC" | Saves the basic interpreter to the disk |
| SETBOOT | SETBOOT "BOOTME" | Sets the boot flag for the file |
| HELP | HELP | lists available commands and functions |
| DELETE | DELETE "MYPROGS" | Deletes the file (and also remove the boot flag if it's presented on the file) |
5. Operators
AND, OR, NOT can also be used in Bit manipulation mode for performing Boolean operations of 16 bit 2s complement numbers (-32768 to +32767)
Examples:
63 AND 16 Result: 16
-1 AND 8 Result: 8
4 OR 2 6 Result: 6
10 OR 10 Result:10
NOT 0 Result: -1
NOT 1 Result: -2
6. Operator Evaluation Rules
Math statements evaluated from left to right with * and / evaluated before + and -. Parentheses explicitly determine order of evaluation.
Precedence for evaluation:
- By parentheses
- Negation
- * /
- + -
- =, <>, <, >, <=, >=
- NOT
- AND
- OR
7. Statements
In the following examples
V or W is a numeric variable, X is a numeric expression, X$ is a string expression, I or J is a truncated integer
DATA
Example:
10 DATA 1,3,7
Data for READ statements must be in order to be read. Strings may be read in DATA statements
DEF
Example:
10 DEF FNA (V)=V*B
User defined function of one argument
DIM
Example:
110 DIM A (12)
Allocates space for Matrices and sets all matrix variables to zero. Non dimensioned variables default to 10
END
Example:
999 END
Terminates program (optional)
FOR, NEXT
Example:
10 FOR X=.1 TO 10 STEP .1
20 ____________
30 NEXT X
STEP is needed only if X is not incremented by 1. NEXT X is needed only if FOR NEXT loops are nested if not NEXT alone can be used. Variables and functions can be used in FOR statements.
GOTO
Example:
50 GOTO 100
Jumps to line 100
GOSUB, RETURN
Example:
100 GO SUB 500
500 . . . .
600 RETURN
Goes to subroutine, RETURN goes back to next line number after the GOSUB
IF . . . THEN
Example:
10 IF X = 5 THEN 5
10 IF X = 5 THEN PRINT X
10 IF X = 5 THEN PRINT X:Y=Z
If the statement is true, then the following will be executed including multiple statements of that line.
IF . . . GOTO
Example:
10 IF X=5 GOTO 5
Same as if THEN with line number
ON . . . GOTO
Example:
100 ON I GOTO 10, 20, 30
Computed GOTO
If I=1 then 10
If I=2 then 20
If I=3 then 30
Example:
10 PRINT X
20 PRINT “Test”
Prints value of expression. Standard BASIC syntax with , ; ” formats
READ
Example:
490 READ V, W
Reads data consecutively from DATA statements in program
REM
Example:
10 REM Type some comments here
This is a comment for non executed comments
RESTORE
Example:
500 RESTORE
Restores Intial values of all DATA statements
STOP
Example:
100 STOP
Stops program execution re-ports a BREAK. Program can be restarted via CONT
SETXY valx, valy
Example:
10 SETXY 20, 20
Sets the cursor to the specified coordinates.
DELAY val
Example:
10 DELAY 60
Makes the CPU wait 3 seconds (20 ticks per second) before executing the next instruction.
SETPIXEL valx, valy
Example:
SETPIXEL 10,10
puts a pixel at location 10,10 on the screen
CLRPIXEL valx,valy
Example:
CLRPIXEL 10,10
clears the pixel at location 10,10 on the screen
8. Functions
ABS (X)
For X=>0 ABS(X)=X
For X<0 ABS(X)=-X
Returns the absolute value of X
INT (X)
PRINT INT(5.55)
5
Evaluates X for the largest integer
RND (X)
Generates a random number between 0 and 1
SGN (X)
PRINT SGN(-50)
-1
Returns 1 if X >0
Returns 0 if X = 0
Returns -1 if exp <0
SIN (X)
Sine of X in radians
COS (X)
Consine of X in radians
TAN (X)
Tangent of X in radians
ATN (X)
Arctangent of expression in radians
SQR (X)
Square root of X
TAB (I)
Used in print statements to TAB to specified position
USR (I)
Calls the users machine language subroutine with argument I, See section 13 for details.
EXP (X)
E to the power of X where E=2.71828
FRE (X)
Gives number of bytes left in workspace (X is dummy)
LOG (X)
Gives the natural log of X
POS (I)
Returns carriage position of terminal (I is dummy)
SPC (I)
Prints I amount of spaces , can only be used in print statements
9. Strings & String Functions
Strings can be from 0 to 255 characters long. All Strings variables end in $. e.g. A$, B9$, HELLO$.
Strings can be dimensioned equated, printed, read from Data statements, etc
To print a string without starting a new line use “;” after of a string
e.g. PRINT “HELLO” ;
STRING FUNCTIONS
ASC (X$)
Returns the ASCII value of first character in string
CHR$ (I)
Returns 1-char string whose char has ASCII code of I
LEFT$ (X$, I)
Gives left most I characters of string X$
RIGHT$(X$,I)
Gives right most I character of string X$
MID $ (X$, I, J)
Returns chars from the middle of the string starting at the position specified (I) to the end of the string or for length characters (J)
LEN (X$)
Returns the length of the string
STR$(X)
Converts a numeric expression to a string
VAL (X$)
Converts the string representation of a number to its numeric value
10. I/O Special Functions
The following features of Minecraft BASIC are useful primarily for I/O control. The user should be extremely careful with some of these statements and functions since they manipulate the memory of the computer directly. An improper operation with PEEK, POKE, or SYS can cause a system crash, wiping out BASIC and the users program, thus requiring a complete reload of the computer
PEEK (I)
Returns the decimal value of the specified memory of I/O location. (Decimal)
Example:
X=PEEK (64256)
will load variable X with the values in address 64256 ( 0xFB00)
POKE I, J
Loads memory location I (decimal) with J (decimal). I must be between 0 and 65536 and J must be between 0 and 255.
Example:
10 POKE 64256, 255 will load address 0xFB00 with FF(hex)
INPUT VAR$
Read data from the terminal and store result in VAR$
GET VAL$
Waits for a character and the result stored in VAL$, works in program mode only
Example: 1 GET A$:IF A$<>”" THEN PRINT ASC(A$)
SYS(I)
This will execute machine code at 0×400 (1024 in decimal). Make sure the code ends with an RTS to be able to jump back into basic.
E.g. SYS(1024)
MMUSET I, J
Works like LDA #$J , MMU #$I assembly instructions (yy is 16 bit wide)
E.g. MMUSET0,1 : REM Sets the active redbus device id to 1
MMUGET(I)
Works like MMU #$xx assembly instruction
E.g. MMUGET(129) : REM Reads the redbus window
Minecraft BASIC fully supports IO expanders. By using the values in the chart below with the IO expander functions the corresponding colored redstone wire will light up.
IO Expander Output Color Values
| Color | Value |
|---|---|
| White | 1 |
| Orange | 2 |
| Magenta | 4 |
| Light Blue | 8 |
| Yellow | 16 |
| Lime | 32 |
| Pink | 64 |
| Gray | 128 |
| Light Gray | 256 |
| Cyan | 512 |
| Purple | 1024 |
| Blue | 2048 |
| Brown | 4096 |
| Green | 8192 |
| Red | 16384 |
| Black | 32768 |
IO Expander Functions
IOGET(ID)
Reads the actual value from IO expander read buffer.
EXAMPLE:
10 PRINT IOGET(3):
20 REM PRINT THE VALUE OF IO EXPANDER #3 READ BUFFER
IOPEEK(ID)
Reads the actual value from IO expander output latch.
EXAMPLE:
10 PRINT IOPEEK(4)
20 REM PRINT THE VALUE OF IO EXPANDER #4 OUTPUT LATCH
IOSET ID,VAL
Sets the IO expander output latch to VAL. SETS THE IO EXPANDER OUTPUT LATCH TO VAL
EXAMPLE:
10 IOSET 3,16
20 REM LIGHTS UP THE YELLOW WIRE CONNECTED TO DEVICE #3
Minecraft Basic includes a mini disk file system that allows you to load save, and backup programs to multiple disks.
Formatting the Disk
Before being able to load/save programs to disk you need to format it. After loading BASIC load a different floppy into the drive and type DISKFORMAT “NAME” to format it. Everything on the disk will be erased. After the formatting is complete the disk will be ready to use.
Saving/Loading Programs
To save a program, insert a MCFS formatted disk into the drive and type SAVE “NAMEOFPROGRAM”. To load programs type LOAD “NAMEOFPROGRAM”. Use the DIR command to see the exisiting files on the current disk in drive. To delete a program file type DELETE “NAMEOFPROGRAM”.
Making a Bootable Basic Disk
To make a extra disk that boots into Basic, format a spare floppy, then type SAVEBASIC “BASIC”. The boot flag also needs to be set for the disk to boot into BASIC. Type SETBOOT “BASIC” to set the boot flag.
Using MCFSTool to Manage/Share/Backup Programs
MCFSTool is a command line tool used to operate img files formatted with Minecraft BASIC. With this tool you can extract Basic programs written within minecraft to share with others, or move them between multiple img files. Precompiled Windows and Mac binaries can be downloaded at the resources section. Use the readme.txt on how to use it, or ask for help at the forums.
GUI Frontend for MCFSTool now avaliable: Download (XP,Win7)
Door Password Program:
|
1 2 3 4 5 6 7 8 9 10 11 |
10 PASS$="" 20 CLRSCR 30 IOSET 3, 0 : REM CLEAR OUTPUT LATCH 40 PRINT "ENTER THE PASSWORD:" : INPUT PASS$ 50 IF PASS$ ="PASSWORD" THEN PRINT "ACCESS GRANTED" : GOTO 100 60 PRINT "ACCESS DENIED…" 70 TICKS 100 80 GOTO 20 100 IOSET 3,1 : REM TURN ON THE WHITE WIRE TO OPEN THE DOOR 120 PRINT "DOOR CLOSING IN 5 SECONDS. . ." 130 GOTO 70 |
Bresenham’s Circle (Very fast circle drawing algorithm)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
5 CLRSCR 10 X=20 : Y= 20 : R = 17 : REM SET X, Y POS, AND RADIUS 40 LET F=(R+R)+3 50 LET CX=R 60 LET DX=0 70 IF CX>=DX GOTO 90 80 GOTO 500 90 SETXY X+DX,Y+CX : PRINT CHR$(160) 100 SETXY X+DX,Y-CX : PRINT CHR$(160) 110 SETXY X-DX,Y+CX : PRINT CHR$(160) 120 SETXY X-DX, Y-CX : PRINT CHR$(160) 130 SETXY X+CX, Y+DX : PRINT CHR$(160) 140 SETXY X+CX, Y-DX : PRINT CHR$(160) 150 SETXY X-CX, Y+DX : PRINT CHR$(160) 160 SETXY X-CX, Y-DX : PRINT CHR$(160) 170 IF F>=0 GOTO 185 180 GOTO 200 185 CX=CX-1 190 F=F-(CX+CX+CX+CX) 200 DX=DX+1 210 F=F+(DX+DX+DX+DX)+2 220 GOTO 70 500 END |
Slot Machine
|
1 2 3 4 5 6 7 8 9 10 11 |
10 CLRSCR 30 X=INT(RND(1)*7+1) 40 Y=INT(RND(1)*7+1) 50 Z=INT(RND(1)*7+1) 60 SETXY 10,10 : PRINT X 70 SETXY 15,10 : PRINT Y 80 SETXY 20,10 : PRINT Z 200 IF X=Y AND Y=Z THEN PRINT "JACKPOT!" : END 210 IF X=Y OR Y=Z OR Z=X THEN PRINT "ALMOST!" 220 PRINT "PRESS SPACE" : GET A$ 230 IF A$ = CHR$(32) GOTO 10 |
14. Useful Tricks
GETTING A RANDOM NUMBER :
PRINT INT(RND(1)*(25-1)+1)
NUMBER = RND(1) * (UPPER LIMIT – LOWER LIMIT) + LOWER LIMIT
Executing Custom Machine Code:
You can either preload machine code into the basic.img file with a hex editor and add 0×500 to get the start address, or poke it in manually within basic. There are two ways you can execute machine code from within basic:
1. SYS(Addr)
E.g. SYS(1024)
This will execute machine code at 0×400 (1024 in decimal). Make sure the code ends with an RTS to be able to jump back into basic.
2. USR
USR is still supported, but we recommend you use SYS instead. To use USR find out where your subroutine is in memory, then the start addresses of the user subroutine is poked into addresses 0xD (low bit, decimal 13) and 0xE (high bit, decimal 14). The subroutine must end with an RTS and stack should be the same level on exit when the routine was entered.
example:
The subroutine I created starts at 0x24C0. The address is poked in little endian format.
0xCO = 192, 0×24 = 36
10 POKE 13, 192
20 POKE 14, 36
25 REM Execute the subroutine
30 X=USR(X)
Peek & Poke
PEEK(ADDRESS) : get value at memory address
e.g. PRINT PEEK(900)
POKE Address, value : insert value into memory address
e.g. POKE 900, 48
Disable Ctrl – C with POKE 2,255
10 POKE 2,255 : REM Unbreakable infinite loop
20 PRINT “INFINITE LOOP”
30 GOTO 20
Disable CTRL-C with POKE2,255. Re-enable it with POKE2,0
For God sake, what you are doing man? You revived my childhood.
I get “?Syntax error in 10″ when i do
10 DEF FN X(K) = K+2
what am i doing wrong?
No idea because it’s working for me: *******bigfootinformatika.hu/65el02/images/deffn.png
Thank you, now it’s working i must have been typing something wrong. now i’m trying something like
10 DEF FN X()
20 PRINT “HELLO WORLD”
30 END DEF
40 FN X()
I get “?Syntax error in 10″ i’m doing something wrong?
Yes, you doing it wrong.
Here’s a detailed description for the DEF command (and for the rest of the basic commands too with examples) *******c64-wiki.com/index.php/DEF
You can not define functions in BASIC. If you want you can use subroutines (“functions” in BASIC) with GOSUB and RETURN like this:
10 FOR I=0 TO 19
20 GOSUB 100 : REM SUBROUTINE AT LINE 100
30 NEXT
40 END : REM NECESSARY OR IT RUNS AGAIN ON LINE 100 AND RETURN WITHOUT GOSUB ERROR APPEARS
100 PRINT “HELLO WORLD”
110 RETURN
And here’s an example of this: *******c64-wiki.com/index.php/GOSUB
Hope that it was helpful for you, however i am not sure what do you want to do.
[BF]
DEF only supports single line arguments in this version of BASIC, I just tried it out using OSI BASIC and it gave me the same error.
The ticks function often crashes the redpower PC. Kinda annoying
Hopefully it’s solved, download the new snapshot from my site and test it please. *******bigfootinformatika.hu/65el02/basic_120529b_mcfs.img
[BF]
Seems to be working a bit better now. Thanks!
Although, one of the things I still seem to have an issue is with the IOSET doesn’t work in a FOR loop if I also use TICKS.. Quite strange?
It doesn’t cause an error, it just doesn’t actually set the value on the IO Extender
Can you show an example? Screenshot of your program or something? It’s hard to say anything without that.
*******i46.tinypic.com/eve3nm.png
It’s essentially just writing out the string to an IO Extender, which is being read on the other computer. When I use the TICKS command to slow it down a little, it doesn’t write out any data.
That’s because you set it to 0 immeidately. Put ticks between IOSET 3,A and IOSET 3,0 not after
I tested it in emulator and Minecraft too and it’s working well for me.
I still think there is a bug, if you take the TICKS out it will pulse very quickly. and that’s with the TICKS command after the IOSETs, before the NEXT
One TICKS between, ont TICKS after. It works for me, check this: *******bigfootinformatika.hu/65el02/images/sender_receiver_mc.avi
Ah i see. My problem was that I was that the characters were being picked up twice. I guess calling IOGET twice slows it down enough on the other computer.
Thanks for your help!
You should implement better handshaking between the 2 computers. Use one of the lines as a RTS (ready to send) and another as a CTS (Clear to Send) from the 2nd computer. The 1st computer waits in a loop until it sees the CTS signal. It then sets the data on the bus, then sets the RTS line and waits for the CTS to go low. It then clears the RTS line and waits for the CTS line again. The 2nd computer Sets CTS high then loops waiting to see RTS high. It then reads the data from the bus and then sets CTS low and waits for RTS to go low, then sets CTS high….I think…I’ve just written that quickly in a tiny text box and can’t check what I’ve written, but it should be enough to point to what is needed. Read up on RS232 handshaking protocols which use something like this in one of the many ways of handshaking it supports.
And i made a mistake, so if you downloaded it before download it again please. (Just one people downloaded it, i hope that you know who you are
)
100 GET A$
110 IF A$ = “Q” THEN END
120 GOTO 100
Results in Syntax-Error in 110
but
90 B$ = “Q”
100 GET A$
110 IF A$ = B$ THEN END
120 GOTO 100
runs without Error
added it to the known bugs list, thanks
(It works ok in the stable version: snapshot basic_120527 so use that for now)
Thanks for the report, it’s fixed now in today’s snapshot. Please test and report back. *******bigfootinformatika.hu/65el02/basic_120530_mcfs.img
THX works fine with the new snapshot
That’s good… I’m sure you don’t used any for-next in your code.
Here’s a new one, hopefully the latest for today *sigh*: *******bigfootinformatika.hu/65el02/basic_120530b_mcfs.img
There is an error with the section above here. should change PEEK reference to Poke.
Disable Ctrl – C with PEEK 2,255
10 POKE 2,255 : REM Unbreakable infinite loop
20 PRINT “INFINITE LOOP”
30 GOTO 20
Also a question for Bigfoot, is it possible for you to make it so we can stretch the Emulator?, at 1920×1080 desktop resolution I have a hard time reading from that tiny box.
thanks , fixed that part of the manual
The source is available for the emulator, feel free to modify the code to fit your needs.
i installed everything correctly but when i start the PC with 1 8K stuff. when i boot it it says 0 Bytes free. and at every command it says ?SYNTAX ERROR
and when booting it is not saying 120530b but 120530. so as you might have guessed its very frustrating
BTW: i tried it with 7 8K stuffs
Hey, check if you are using the latest version of Redpower2 (5b2), that might be the problem. (It won’t work on 5b1)
Looks like you have the same problem as the guy in the forum. Here’s an answer from someone else for his problem: “Hey, check if you are using the latest version of Redpower2 (5b2), that might be the problem. (It won’t work on 5b1)”
And i didn’t saw that it’s already replied…
I’ve tried to make bootable disk, but when I set boot flag for my basic program, it stuck when loading in continuous loop Loading MCFS Boot code/Ok. Of course I’ve saved BASIC interpreter by saying SAVEBASIC “BASIC”
You can not autostart BASIC programs yet because it needs the BASIC interpreter too… I know, it’s a bit confusing at the moment, i have discussed this problem already with a few people. SETBOOT is much more a MCFS related command than BASIC one. Currently the only “useable” option to use SETBOOT is to set the BASIC file as booting one after a freshly formatted disk with saved interpreter. The boot code doesn’t know that the file which is loaded is working one or not… Standalone BASIC programs (without interpreter) can not run alone.
I think i will solve this problem with “autostarting” basic programs from the interpreter. Probably searching for a predefined (e.g. “AUTOSTART”) file on the disk then load and execute it after the interpreter loaded and started.
MCFSTOOLGUI seems to have trouble with directories which have a space in them, it throws an error when trying to open an image file in one.
err.fopen [C:\my]
the directory they are located in is C:\My Stuff\6502Emu
I would just like to say a massive thanks for this,no nocking Eloraams effort on the mod,but some of the forth commands just dont seem to work in a consistent manner,even the the forget command seems unable to find a newly defined word so how the programs ment to run it i dont know,but this,its like a step back to my old spectrum days,thanks.
Only thing i would like to see is a way to write my code in a different editor like not pad and still be able to load it.,but i can wait for that.Thanks
Hi,
super tutorial and there is 1 little Problem…
MCFSTool don’t work’s right. Error:”err: non mcfs disk”
My Question: where is the problem? ;(
mfg
MCFSTool doesn’t have the final boot code yet (neither the format command), so i uploaded an empty mcfs image for download. (I made it with the diskformat command)
Could someone help me with reading individual bits from IOGET()? My best guess is that I if I want the state of bit #X, I need to take MOD(2^X, IOGET(3)) >= 2^X, but the MOD function doesn’t work properly (or it just doesn’t exist. I don’t remember which) and it looks like the exponent function doesn’t work properly. For example, 2^10 is 980.687 when it should be 1024.
I’ve already managed to make my own exponent and modulo subscripts, but my code is becoming spaghetti by the second. Any chance that you might hard-code a MOD function and/or fix exponents?
I fixed the multiplication bug in the v1.0.120616 release.
The MOD function doesn’t exists, you can use IOGET(3) AND 2^X = 2^X instead, however it will not work correctly on bit 15 (overflow error because of the signed short).
Slower but always working solution is this: INT(IOGET(3)/INT(2^X)) AND 1 = 1
In the newly developed version this will be not a problem anymore because the 32-bit integer variables and library.
keeps giving me unknown token when typing SAVE”BASIC
HEEEELLLLP
if you are typing SAVE”BASIC then thats why it isnt working.
you need to type SAVE” BASIC with the space between the ” and the BASIC
oh and you need the closing ” so it should read SAVE” BASIC”
now i figured it out but now the download links will not wort why
Added a mirror
Unfortunately my server was crashed that afternoon, that’s why you was not able to download the image.
you can change your disk drive (default = 2) by using
POKE 7,ID
where ID is the id of the new drive
i havn’t figured yet how to write stuff on floppys yet, so it’s basicly an aditional space for programms so far
wouldn’t it be better if the latest comments were on TOP of the page?
I seem to have run into an interesting problem. None of my INPUT VAR$ statements are working. All my variables end up with the value of 0. Am I doing something wrong, or is there a bug?
Nevermind, I was not remembering my BASIC correctly. There is a difference in V and V$ for variables.
Ok so I’m trying out the Door password Example, but at line 70 it throws a Syntax Error. Apparently Ticks is not working for me.
It’s called delay now, so TICKS 20 is now DELAY 20.
Check the version of BASIC that you are using. Starting with the update released on 20120602 the TICKS command was replaced. See
*******bigfootinformatika.hu/65el02/
how to you edit you program after it’s been written?
just re-enter the line you want to change as if you were writing it in originally. It’ll overwrite the existing line of code.
very similar to the commodore 64
MCFSTool don’t works : the GUI dosn’t react to the “write” button, and the .exe just crashes immediatly.
I’m on Windows 7 64 bits, tried all compatibility mods and admin mod.
BASIC is correctly installed on minecraft, and .imgs are compatible…
Help please !
Does this work on SMP? I couldn’t find any redpower folder that contains the images on my server…
look in your world folder, for world/redpower/
Ok thanks, actually I already found out the answer. I was looking in the wrong server folder x.x But anyway thank you.
How did you find the world-folder? Do I have to talk to the admin to get it?
Yes.
Wow. Brings back those C64 days.
Now I just need to find something that can run C, lua, or some other slightly more structured programming language on redpower computers. I do like computercraft (despite lua, and despite poor documentation), but I find that it is seriously laggy.
That’s right. I just need (lol) DOS and maybe C and Lua.
I would love that for a networking protocall I am working on. I just don’t want to write it all in forth.
how would i get it to read a input then convert that char by char to ascii
i know im going to be useing for ,next and asc
Are you planning to add AutoStart features?
Yeah, it would be great
I really hope that you make a AutoStart program, that launches when the terminal finishes booting
German keyboards (qwertz) can’t get @’s cause the emu doesn’t react to AltGr + Q which is our @ combination.
Echt? das muss ich ausprobieren
keine ahnung ob das geht oder nicht lol
bei mir gehts
MS-BASIC is amazing thank you soooo much for this
When I try and start it it says 0 bytes free even though I put an 8k ram module on the back and whenever I put in a command I just get “?SYNTAX ERROR”.
I would note that I have the latest version of redpower.
Wait nm.
Hi,
short question, is there a away to prevent a programm form ending after an empty INPUT like 10 INPUT A$ (press enter without any string writen)
20 ….
THX!
Did you try a loop?
I tried conneting 2 CPUs, 2 Consoles, 1 IO and one disk drive to one buc but couldn’t make the cpus talk to their appropriate console. To be precise: Both were always talking to the same standard-ID console. Same setup works well with standard OS. Seems like you are not reading the target id for the console, but rather use a default value.
Keep up the good work! o7
buc = bus
This is Awesome thanks dude
I run a small server using Tekkit. Is there a way to take the rpcboot.bin and replace the default “Forth” with the MS-BASIC on my Tekkit server? I have found the redpower archive in server side tekkit folder. If I were to delete the existing rpcboot.bin file (from withing the .zip) and replace with the MS-BASIC version, will it simply boot up as MS-BASIC instead of Forth?
I think so.
I got it working. I opened the redpower archive, deletec the .bin file, delted the redroth.bin. Then I renamed the Basic.IMG to redforth.img, and copied the new .BIN and the renamed BASIC.IMG file into the archive. Reinstalled the archive into the MOD directory and up and running on my Tekkit server using MS-Basic v2.0.120603.
ok i think i found a serious bug. you are able to set lines above 255 within mc and youre able to save them to a floppy and even run those without problems. but if you try to detokenize those it suddenly stops around ~250. interesting to note is that the extracted tokenfile still contains all information (as far as i can tell those cryptic tokens and my strings)
!!!! This is Epic. Reminds me of my days programming the Commdore 64 as a kid. Suddenly, everying in minecraft has gotten easier to control
I’m starting to use basic now, I may be talking nonsense, but I can give a suggestion, create a function to convert numbers to binary and binary to numbers, sometimes just want to know if a thread is active in a value of type 8193, Example IOGET (ID, COLOR).
From thre Just Basic forum:
Function JBDecBin(dec)
While 1
bin$ = str$(dec MOD 2) + bin$
dec = dec / 2
If dec = 0.5 then
JBDecBin = val(bin$)
Exit While
End If
dec = int(dec)
Wend
End Function
Hi, First of all Thanks for making RPC/8 to use so easy and then i would like to ask how can i get is there any key down(and which) or in another ways how i can read keyboard buffer which i saw was implemented. Thanks
Does anyone know how to save and load data to a disk and how to read data from the disk? In my case, i want to create a matrix by the user (width, height, matrix(width*height) and save it to a disk. The computer of a frame base build robot should read this matrix from the disk. Is this possible with Basic 1.0?
Is it possible to get BASIC on a computer without access to the server’s files? I’m in SMP and don’t have access.
It seems the io expander isnt working for me, neither on Forth nor with basic.
I can use to commands and everything else but commands like ioget,ioset just wont work.
Someone with a similar problem?
Make sure the cables are connected to the correct side of the module. That was my original problem. Other than that the IOGET , works jsut fine.
Love what you did… FORTH is kind of unreadable for me but basic is what I started programming with, on my 48k spectrum
.
Not a complain, but just in case you are fishing for ideas:
Would be nice to have some sort of include so routines used by multiple programs could be “simply” included and called using GOSUB.
The include would merge a program into another one.
Anyway, very grateful for what you did here.
I posted this on the resources page, but I thought it would pertain to this too:
Yeah, I love being able to work with BASIC instead of FORTH, but the problem is that when I try to use MCFS (GUI or Command Line) or the Tokenizer, it fails, giving me a “fopen error,” whatever that is. If it helps, I’m running Windows 7 Home Premium x64 v. 6.1 (Build 7601: Service Pack 1), and I tried both the GUI and Command line versions of MCFS, and the command line tokenizer. But really, really big ups to Eloraam for this emulated computer and slightly less big but still very big ups to BiGFoot for the BASIC OS. Perhaps we should call it Mine-BASIC?
Whenever i put in a simple command like SAVE it says unknown token: SAVE
why does it do this? it does it with all commands like that.
thanks
How do i access the rednet protocal with Basic? I would like to set up a password server with basic so i can manage all my door passwords in one location. Is this possible?
PEEK and POKE. No other way, sorry. Read up on redbus on the Redpower Control page on the Redpower wiki (just google “Redpower Control”, ought to be the first result).
What’s up, after reading this awesome article i am as well cheerful to share my knowledge here with colleagues.
Also visit my page social bookmarking sites
Is there any way to upload MS-BASIC / Tetris to a server without direct access to it?
It seems using boolean operations (that is, 63 AND 16 = 16) on variables is broken.
Proof:
PRINT 63 AND 16
16
READY.
X=63
READY.
PRINT X AND 16
63
?SYNTAX ERROR
READY.
—
Apparently, it doesn’t know what to do with the AND after the variable.
Maybe I found a little Bug…
When waiting for an Input string
50 CLRSCR
51 PRINT “Enter Password: “;
52 INPUT IN$
53 IF IN$ = “PASSWORD” THEN GOTO 100
55 GOTO 50
It WILL correctly work and compare Password in IF Statements, but on just hitting enter it seems to quit program und just shows “READY”.
This should’t happen right?
HI! got it installed it appears to boot on the RPC in game displays:”
“Minecraft MS-BASIC V1.0.120616″
“0 Bytes Free”
after that all it will do in say
“?SYNTAX ERROR” <<<< havent seen this in 35 years! hahaha
"READY"
the in-game boot disk works but not the MS basic
thanks
Did you add at least one memory extension to your pc?
0 bytes Free looks like you didn’t
I have the comp setup with 32 it this time It.
nope, got 32K (4 blocks). will this work with mc v1.2.5?
WOW! I got a computer with 32k! woot!
Correction I meant to say yes, I have 32k installed.
Hello!
First off, great job in the basic language for the redpower computers! Totally awesome!
What i do lack is an editing tool ingame…. its so tideous to write every line all over again when i make a mistake…
Is there any way to change terminal or disk address with Basic? In Forth, it was
TERMADDR and DISKADDR
I had a program designed in Forth that switched between two different monitors for a password entry. If this feature isn’t in Basic, could it be added by any chance?
for whatever reason I cant get my programs to Run