Brainfuck for MSX

by snout on 26-11-2002, 21:20
Topic: Development

Nyyrikki wrote a brainfuck compiler for MSX which compiles brainfuck sources for CP/M compatilbe systems with optional optimizations for MSX. Brainfuck is - believe it or not - a programming language, and a very special one. Brainfuck was developed in 1993 by Urban Müller from Switzerland. Originally it was created for Amiga systems, but the simplicity of Brainfuck allows it to be ported to many systems. On the web, many Brainfuck resources can be found, this is a good place to start. Some of the highlights of this language:

  • It consists of eight commands
  • Despite of the low number of commands, it is a Turing-complete language. Which means it is in fact a real programming language. ;)
  • Urban Müller managed to squeeze the entire compiler for Amiga in less than 200 bytes.

The Brainfuck compiler for MSX can be found in the software section at Nyyrikki's website and includes several brainfuck sources, including a DeCSS source. So now you van decrypt DVD's on your MSX! ;)

Comments (2)

By ricbit

Champion (438)

ricbit's picture

27-11-2002, 03:57

Actually there was two versions of brainfuck for msx already available. Acidx ( made a brainfuck interpreter for UZIX, and I ( made a brainfuck compiler in msx basic. The entire source of my compiler is just 3 lines, so I'll post the complete source here :)

1 DIMM(100):Q=49152!:P=Q:INPUTA$:DEFSTRC:OPENA$+';.BF';FORINPUTAS1:DATA33,0,160,17,1,160,1,0,16,117,237,176,38,160:FORI=0TO13:READK:POKEQ,K:Q=Q+1:NEXT:Q=Q-1:FORI=1TO3:I=1:N=N+1:Q=Q+1:IFN=LOF(1)THENPOKEQ,201:BSAVEA$+';.BIN';,P,Q,P:ENDELSEB=ASC(INPUT$(1,1))
3 IFB=91THENM(X)=Q:X=X+1:POKEQ,126:POKEQ+1,183:POKEQ+2,202:Q=Q+4:NEXTELSEIFB=93THENX=X-1:A=INT(M(X)/256):POKEQ,195:POKEQ+1,M(X)-A*256:POKEQ+2,A:Q=Q+3:A=INT(Q/256):POKEM(X)+4,A:POKEM(X)+3,Q-A*256:Q=Q-1:NEXTELSEQ=Q-1:NEXT

By Latok

msx guru (3908)

Latok's picture

27-11-2002, 08:42

Wauw!! I want such Basic too Tongue Tongue