Skip to content

Commit

Permalink
initial checkin
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.code.sf.net/p/cbmbasic/code/trunk@1 9fe5884a-b7e8-463c-b443-16e426d99557
  • Loading branch information
mist64 committed Apr 8, 2009
0 parents commit aebaa7e
Show file tree
Hide file tree
Showing 13 changed files with 29,872 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
OBJS=cbmbasic.o runtime.o plugin.o
CFLAGS=-Wall -O3

all: cbmbasic

cbmbasic: $(OBJS)
$(CC) -o cbmbasic $(OBJS)

clean:
rm -f $(OBJS) cbmbasic

26 changes: 26 additions & 0 deletions Makefile.win32
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
APPVER = 5.0
TARGETOS = WINNT

!include <win32.mak>

!ifndef nounicode
cvarsdll = $(cvarsdll) -DUNICODE -D_UNICODE
!endif

OUTDIR=.\bin\win32
TARGET=$(OUTDIR)\cbmbasic.exe

build: "$(OUTDIR)" "$(TARGET)"
rebuild: clean build
clean:
-erase /f /q "$(OUTDIR)\*.*"
-rmdir "$(OUTDIR)"

.c{$(OUTDIR)}.obj:
$(cc) $(cdebug) $(cflags) $(cvarsdll) -D_CRT_SECURE_NO_DEPRECATE=1 -D_CRT_NONSTDC_NO_WARNINGS=1 /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" $<

"$(OUTDIR)":
mkdir "$(OUTDIR)"

"$(TARGET)": "$(OUTDIR)\cbmbasic.obj" "$(OUTDIR)\runtime.obj" "$(OUTDIR)\readdir.obj"
$(link) $(ldebug) $(conlflags) -out:"$(TARGET)" $** $(conlibsdll)
25 changes: 25 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cbmbasic - Commodore BASIC V2 as a scripting language
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a 100% compatible version of Commodore's version of Microsoft
BASIC 6502 as found on the Commodore 64. You can use it in interactive
mode or pass a BASIC file as a command line parameter.

This source does not emulate 6502 code; all code is completely native.
On a 1 GHz CPU you get about 1000x speed compared to a 1 MHz 6502.

It has been tested with
* Mac OS X 10.4/10.5 i386/x86_64/ppc (GCC 3.3/4.0)
* Debian Linux Etch (GCC 3.3/4.1)
* Windows NT (Visual Studio 2005/2008)
Other CPUs, operating systems and compilers should work, too.

Windows users should also install
http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en

Feel free to use this project for any purpose, give credit if you like,
and send back improvements to the authors, if you like, so that others can
benefit from it. See source for license details.

Michael Steil, James Abbatiello
http://cbmbasic.sourceforge.net/
28,373 changes: 28,373 additions & 0 deletions cbmbasic.c

Large diffs are not rendered by default.

215 changes: 215 additions & 0 deletions cbmbasic.vcproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="cbmbasic"
ProjectGUID="{DB3200B8-0372-48D5-B144-3B0DCFCFF44A}"
RootNamespace="cbmbasic"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)\obj-cbmbasic"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)\obj-cbmbasic"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\cbmbasic.c"
>
</File>
<File
RelativePath=".\readdir.c"
>
</File>
<File
RelativePath=".\runtime.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\readdir.h"
>
</File>
<File
RelativePath=".\stat.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
32 changes: 32 additions & 0 deletions glue.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
extern unsigned char RAM[65536];

extern unsigned char A, X, Y, S;
extern unsigned short PC;
extern unsigned char V, B, D, I, C, N, Z;

#define SETZ(a) Z=a;
#define SETSZ(a) Z = (a)? 0:1; N = ((signed char)(a))<0?1:0
#define SETNC(a) C = (a)&0x100? 0:1
#define SETV(a) /* not needed */
#define STACK16(i) (RAM[0x0100+i]|(RAM[0x0100+i+1]<<8))
#define PUSH(b) RAM[0x0100+S--] = (b)
#define PUSH_WORD(b) PUSH((b)>>8); PUSH((b)&0xFF)

void CHRGET(void);
void CHRGOT(void);

int main(int, char **);

#define VEC_ERROR 0x0300
#define VEC_MAIN 0x0302
#define VEC_CRNCH 0x0304
#define VEC_QPLOP 0x0306
#define VEC_GONE 0x0308
#define VEC_EVAL 0x030A
#define MAGIC_ERROR 0xFF00
#define MAGIC_MAIN 0xFF01
#define MAGIC_CRNCH 0xFF02
#define MAGIC_QPLOP 0xFF03
#define MAGIC_GONE 0xFF04
#define MAGIC_EVAL 0xFF05
#define MAGIC_CONTINUATION 0xFFFF
Loading

0 comments on commit aebaa7e

Please sign in to comment.