OpenCores
URL https://opencores.org/ocsvn/vtach/vtach/trunk

Subversion Repositories vtach

[/] [vtach/] [trunk/] [asm/] [axasm] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wd5gnr
#!/bin/bash
2
#/**********************************************************************
3
#axasm Copyright 2006, 2007, 2008, 2009
4
#by Al Williams (alw@al-williams.com).
5
#
6
#
7
#This file is part of axasm.
8
#
9
#axasm is free software: you can redistribute it and/or modify it
10
#under the terms of the GNU General Public Licenses as published
11
#by the Free Software Foundation, either version 3 of the License, or
12
#(at your option) any later version.
13
#
14
#axasm is distributed in the hope that it will be useful, but
15
#WITHOUT ANY WARRANTY: without even the implied warranty of
16
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
#GNU General Public License for more details.
18
#
19
#You should have received a copy of the GNU General Public License
20
#along with axasm (see LICENSE.TXT).
21
#If not, see http://www.gnu.org/licenses/.
22
#
23
#If a non-GPL license is desired, contact the author.
24
#
25
#This is the assembler driver script
26
#
27
#***********************************************************************/
28
 
29
PROC=soloasm
30
LIB=`dirname $0`
31
 
32
 
33
 
34
function usage {
35
  cat >&2 <
36
  Usage: axasm [-p processor] [ -H | -i | -b | -v | -x ] [-D define] [-o file] inputfile
37
         processor = processor.inc file to use (default=soloasm)
38
         -D = Set C-style preprocessor define (multiple allowed)
39
         -H = Raw hex output
40
         -i = Intel hex output
41
         -v = Verilog output
42
         -x = Xilinx COE format
43
         -b = Binary raw (32-bit only)
44
         -o = Set output file (stdout default)
45
 
46
  axasm and soloasm by Al Williams al.williams@awce.com
47
EOF
48
exit 1
49
}
50
 
51
 
52
 
53
POSTOP=""   # output arguments sent to compiled program
54
DEFOP=""    # -D options to compiler
55
while getopts  "vHhbixp:D:o:" flag
56
do
57
  case $flag in
58
  p )  PROC=$OPTARG ;;
59
  v )  POSTOP="$POSTOP -v" ;;
60
  H )  POSTOP="$POSTOP -h" ;;
61
  i )  POSTOP="$POSTOP -i" ;;
62
  x )  POSTOP="$POSTOP -x" ;;
63
  b )  POSTOP="$POSTOP -b" ;;
64
  D )  DEFOP="$DEFOP -D $OPTARG"  ;;
65
  o )  POSTOP="$POSTOP -o $OPTARG" ;;
66
  h )  usage ;;
67
  ? )  usage ;;
68
  esac
69
done
70
shift `expr $OPTIND - 1`
71
 
72
# test for $# >= 1
73
if [ $# -lt 1 ]
74
then usage
75
fi
76
 
77
LFILE=`mktemp`
78
CFILE=`mktemp`
79
XFILE=`mktemp`
80
rm -f $CFILE
81
awk -f $LIB/soloinc.awk $1 | awk -f $LIB/solopre.awk -v PROC=$PROC -v LFILE=$LFILE  >$CFILE
82
if gcc -I$LIB -x c -std=c99 $DEFOP -o $XFILE $LIB/soloasm.c $CFILE
83
then
84
 $XFILE $POSTOP
85
fi
86
#echo $CFILE  # debug

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.