RBASIC on Linux: Difference between revisions

From Bitchin100 DocGarden
Jump to navigationJump to search
(New page: Here is a GNU makefile for a simple RBASIC project. Instructions are embedded in the makefile for tailoring to your own installation and project. Note that for .EXE's to launch under WINE...)
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Here is a GNU makefile for a simple RBASIC project. Instructions are embedded in the makefile for tailoring to your own installation and project.
[[RBASIC]] was designed for DOS/Windows, but it seems to run fine under WINE on Linux.


Note that for .EXE's to launch under WINE on Debian, I had to make them executable. You can leave them non-executable if you prefix commands with 'wine'.
Note that for .EXE's to launch under WINE on Debian, I had to make them executable. You can leave them non-executable if you prefix commands with 'wine'.


  mv RBASICXP.exe RBASIC.EXE
  mv RBASICXP.exe RBASICXP.EXE
  chmod +x RBASICXP.EXE
  chmod +x RBASICXP.EXE
  chmod +x A100.EXE
  chmod +x A100.EXE
Here is a GNU makefile for a simple [[RBASIC]] project. Instructions are embedded in the makefile for tailoring to your own installation and project.


<pre>
<pre>
Line 18: Line 20:
#    WINTOOLSPATH must be a path WINE will grok.
#    WINTOOLSPATH must be a path WINE will grok.
#    TOOLSPATH must be a path BASH will grok.
#    TOOLSPATH must be a path BASH will grok.
# 3. make clean
# 3. Customize RBASICOPT, ASMOPT with any desired switches
# 4. make
# 4. Set PROGRAM to the name of your BASIC ASCII source
# 5. Burn the resulting .BX with REXMGR or load it as an OptROM with
#    file, omitting extension. I.e., for XYZ.100, PROGRAM=XYZ
# 5. make clean
# 6. make
# 7. Burn the resulting .BX with REXMGR or load it as an OptROM with
#    VirtualT.
#    VirtualT.


Line 27: Line 32:


RBASIC=$(TOOLSPATH)/RBASICXP.EXE
RBASIC=$(TOOLSPATH)/RBASICXP.EXE
RBASICOPT=/O0 /C
ASM=$(TOOLSPATH)/A100.EXE
ASM=$(TOOLSPATH)/A100.EXE
ASMOPT=/I$(WINTOOLSPATH)\\
ASMOPT=/I$(WINTOOLSPATH)\\
Line 34: Line 40:
ALL: $(PROGRAM).BX $(PROGRAM).BIN
ALL: $(PROGRAM).BX $(PROGRAM).BIN


%.asm : %.100
.PRECIOUS : $(PROGRAM).ASM $(PROGRAM).HEX
$(RBASIC) $<


%.asm : %.200
%.ASM : %.100
$(RBASIC) /2 $<
$(RBASIC) $(RBASICOPT) $< $@


%.HEX : %.asm
%.HEX : %.ASM
$(ASM) $(ASMOPT) $<
$(ASM) $(ASMOPT) $<


%.BX : %.HEX
%.BX : %.HEX
srec_cat -Output $@ -Binary $< -Intel
@srec_cat -Output TRUNC_$@ -Binary $< -Intel 2> /dev/null
@dd if=/dev/zero bs=1024 count=32 of=$@ 2> /dev/null
@dd if=TRUNC_$@ of=$@ conv=notrunc 2> /dev/null
@rm -f TRUNC_$@ 2> /dev/null
@echo "Converted Intel hex $< -> $@"


%.BIN : %.BX
%.BIN : %.BX
Line 53: Line 63:
-rm -f $(PROGRAM).PRN
-rm -f $(PROGRAM).PRN
-rm -f $(PROGRAM).SYM
-rm -f $(PROGRAM).SYM
-rm -f $(PROGRAM).asm
-rm -f $(PROGRAM).ASM
-rm -f $(PROGRAM).BX
-rm -f $(PROGRAM).BX
-rm -f $(PROGRAM).BIN
-rm -f $(PROGRAM).BIN
</pre>
</pre>
[[Category:Model T Developer Reference]]

Latest revision as of 21:59, 16 October 2009

RBASIC was designed for DOS/Windows, but it seems to run fine under WINE on Linux.

Note that for .EXE's to launch under WINE on Debian, I had to make them executable. You can leave them non-executable if you prefix commands with 'wine'.

mv RBASICXP.exe RBASICXP.EXE
chmod +x RBASICXP.EXE
chmod +x A100.EXE

Here is a GNU makefile for a simple RBASIC project. Instructions are embedded in the makefile for tailoring to your own installation and project.

# Skeleton Makefile for RBASIC projects on Linux.
#
# Copyright (C) 2009 DevWrights
# Author: John R. Hogerhuis (jhoger@pobox.com)
#
# 0. Install Wine, srecord, and GNU Make, and unzip RBASIC somewhere
# 1. Copy this into your project directory with your *.100 source file
# 2. Edit WINTOOLSPATH, TOOLSPATH to point to RBASIC
#    WINTOOLSPATH must be a path WINE will grok.
#    TOOLSPATH must be a path BASH will grok.
# 3. Customize RBASICOPT, ASMOPT with any desired switches
# 4. Set PROGRAM to the name of your BASIC ASCII source
#    file, omitting extension. I.e., for XYZ.100, PROGRAM=XYZ
# 5. make clean
# 6. make
# 7. Burn the resulting .BX with REXMGR or load it as an OptROM with
#    VirtualT.

WINTOOLSPATH=Z:\\home\\john\\tools\\RBASIC
TOOLSPATH=~/tools/RBASIC

RBASIC=$(TOOLSPATH)/RBASICXP.EXE
RBASICOPT=/O0 /C
ASM=$(TOOLSPATH)/A100.EXE
ASMOPT=/I$(WINTOOLSPATH)\\

PROGRAM=SYSDAT

ALL: $(PROGRAM).BX $(PROGRAM).BIN

.PRECIOUS : $(PROGRAM).ASM $(PROGRAM).HEX

%.ASM : %.100
	$(RBASIC) $(RBASICOPT) $< $@

%.HEX : %.ASM
	$(ASM) $(ASMOPT) $<

%.BX : %.HEX
	@srec_cat -Output TRUNC_$@ -Binary $< -Intel 2> /dev/null
	@dd if=/dev/zero bs=1024 count=32 of=$@ 2> /dev/null
	@dd if=TRUNC_$@ of=$@ conv=notrunc 2> /dev/null
	@rm -f TRUNC_$@ 2> /dev/null
	@echo "Converted Intel hex $< -> $@"
	

%.BIN : %.BX
	cp $< $@

clean:
	-rm -f $(PROGRAM).HEX
	-rm -f $(PROGRAM).PRN
	-rm -f $(PROGRAM).SYM
	-rm -f $(PROGRAM).ASM
	-rm -f $(PROGRAM).BX
	-rm -f $(PROGRAM).BIN