Subject:
|
Some (hopefully) useful information-
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 29 May 1997 05:03:50 GMT
|
Original-From:
|
root <root@snotnose.wizard.[NoSpam]org>
|
Viewed:
|
1669 times
|
| |
| |
Hi there-
As I recently posted, I was having trouble figuring out how to assemble both
*.icb files and the pcode itself. Well, thanks to a nice respondant (Max
Davies- Thanks Max :) I finally got it all figured out. I made up a Unix
style Makefile for *.icb files and a compile script for the pcode. I am
including them in this post in the hopes that someone else may be spared
some confusion. These files are for the Unix tools, IC, as11, etc. Also,
don't forget to run 'dos2unix' (or cr_strip, etc) on all appropriate source
& include files if you go back and forth to DOS a lot! :)
A general question- probably directed best to Randy Sargent if he's listening-
Is there any chance that you guys will be coming out with any IC enhancements
for Linux? It sure would be nice to be able to use constants and structures
in my code. It is the only reason I haven't purchased a copy of the IC3.0 in
case you're accumulating any sort of count on potential Linux customers :)
Finally I'm going to include the original batch file that Max sent to me as
it may help someone who works in DOS. It did seem to work ok when I tried it.
Ok, here are the files:
-------- start 'Makefile' --------
#
# Generic Interactive-C *.ICB Assembly Makefile
# for use with Unix versions of IC & other HB tools
# Brat Wizard - 06/28/97
#
### 'as11' assumes Randy Sargent's hacked up version. 'cpp' assumes the
### preprocessor that comes with gcc. 'CPPINC' points to wherever you have
### your IC include files (add additional -I.. opts for more include dirs).
### To use simply type 'make foobar' where foobar is a 68HC11 .asm file.
### The .asm is not needed and should not be included. Output is 'foobar.icb'.
# General
CAT = /bin/cat
# 68HC11 Assembler
AS11 = as11
ASARGS =
## Use next line instead of prev. to get a listing file
#ASARGS = - L
# Preprocessor
CPP = cpp
CPPARGS = -E -traditional
CPPINC = -I/usr/local/lib/ic
CPPLIB =
# Preprocessor Run 1
CPPOPT1 = -DZERO_PAGE_START=$10 -DMAIN_START=$8020
# Preprocessor Run 2
CPPOPT2 = -DZERO_PAGE_START=$13 -DMAIN_START=$872B
#--- You shouldn't have to edit anything below this line. ---
%: %.asm
$(CPP) $(CPPARGS) $(CPPOPT1) $(CPPINC) $(CPPLIB) $@.asm -o $@1.cpp
$(CPP) $(CPPARGS) $(CPPOPT2) $(CPPINC) $(CPPLIB) $@.asm -o $@2.cpp
$(AS11) $@1.cpp $(ASARGS)
$(AS11) $@2.cpp - cre > $@.cre
$(CAT) $@1.s19 $@2.s19 $@.cre > $@.icb
rm $@1.s19 $@2.s19 $@.cre
# rm $@1.s19 $@2.s19
-------- End 'Makefile' --------
-------- Start 'Compile' --------
#! /bin/sh
## Steps to compile PCODE - Brat Wizard - 06/28/97
### Script assumes 'cpp' is the preprocessor that comes with gcc. Others will
### probably work but options may be different. Assumes operation from within
### the ${PCODE}/pcode directory. Assumes 'as11' is version hacked up by Randy
### Sargent. Output is 'pcode.s19'.
## Use this for "normal" handyboard 16x2 LCD
#cpp -E -traditional -DHANDYBOARD -DLCD_ROWS=2 -DLCD_COLS=16 -I../motorola/fft -I../motorola/floating_point -I../libs pcode.asm -o pcode.cpp
## Use this for handyboard with 40x2 LCD
cpp -E -traditional -DHANDYBOARD -DLCD_ROWS=2 -DLCD_COLS=40 -I../motorola/fft -I../motorola/floating_point -I../libs pcode.asm -o pcode.cpp
as11 pcode.cpp
if [ $? -ne 0 ] ; then
echo "Assembly Error -- Script Aborted!"
exit 1
fi
-------- End 'Compile' --------
-------- Start 'TryThis' --------
In the little Assembler system that I use (which can be found at
http://WWW.CAM.ORG/~mdavies/HB/asm.htm), MAIN_START is defined in the
commands in the .BAT file that run the preprocessor:
echo off
REM Two different as11 runs...
REM zero page increases by 3
REM main high byte increases by 7
REM main low byte increases by 11
REM copy to 'C' filename for GCC
copy %1.asm xxxjunk.c
gcc -E -traditional -DZERO_PAGE_START=$10 -DMAIN_START=$8020 -o
ascpp1.asm xxxjunk.c
gcc -E -traditional -DZERO_PAGE_START=$13 -DMAIN_START=$872B -o
ascpp2.asm xxxjunk.c
REM use this one for a listing
REM as11 ascpp1.asm - l s >listing.txt
REM use this one for no listing
as11 ascpp1.asm
as11 ascpp2.asm - cre > ascpp.cre
REM concantenate these files together
copy ascpp1.s19+ascpp2.s19+ascpp.cre %1.icb
REM get rid of temp files
del ascpp1.asm
del ascpp1.s19
del ascpp2.asm
del ascpp2.s19
del ascpp.cre
del xxxjunk.c
REM strip carriage returns from the new icb file
strip_cr %1.icb
----------- End 'TryThis' ---------
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|