Mercurial > hg > index.cgi
annotate extra/as @ 434:052c5f335a92
Fix bug in like terms collection in expression simplification
Like term collection would lose the actual "variable" part of the term if
the second term collected happened to have no coefficient. This would cause
the expression to take the value of the calculated coefficient which is
obviously wrong.
Thanks to hider <stego@satx.rr.com> for reporting the bug and providing a
proper test case.
Observation: this bug has been present since the first pre-release of
lwtools 3.0 when the algebraic expression system was introduced. Apparently
people tend not to create expressions that trigger the like terms handler.
The specific conditions require the symbol to be undefined and the second
operand to the addition has to have no coefficient so it's likely a fairly
rare scenario. Still, it is somewhat surprising that nobody tripped on it
before now.
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 23 Jan 2017 22:58:36 -0700 |
parents | 3aad0ff3c3be |
children |
rev | line source |
---|---|
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
1 #!/bin/sh |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
2 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
3 # Copyright 2009 by William Astle <lost@l-w.ca> |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
4 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
5 #This file is part of LWASM. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
6 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
7 #LWASM is free software: you can redistribute it and/or modify it under the |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
8 #terms of the GNU General Public License as published by the Free Software |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
9 #Foundation, either version 3 of the License, or (at your option) any later |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
10 #version. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
11 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
12 #This program is distributed in the hope that it will be useful, but WITHOUT |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
13 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
14 #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
15 #more details. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
16 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
17 #You should have received a copy of the GNU General Public License along with |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
18 #this program. If not, see <http://www.gnu.org/licenses/>. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
19 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
20 # this was based somewhat on the "as" script from gcc6809 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
21 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
22 #echo "LWASM-as $0 $*" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
23 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
24 show_version () { |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
25 cat <<END |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
26 LWASM (GNU assembler frontend) 2.3 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
27 This program is free software; you may redistribute it under the terms of |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
28 the GNU General Public License. This program has absolutely no warranty. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
29 END |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
30 } |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
31 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
32 fatal_error () { |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
33 echo $* 1>&2 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
34 exit 1 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
35 } |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
36 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
37 # Assume nothing. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
38 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
39 input_file= |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
40 output_file= |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
41 list_file= |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
42 options= |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
43 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
44 # Parse the command-line options. See the GNU 'as' man page for |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
45 # an explanation of all these options. Our goal is to translate |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
46 # them into lwasm form. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
47 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
48 while [ "$1" != "" ]; do |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
49 arg=$1; shift |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
50 case $arg in |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
51 -m6809) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
52 true |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
53 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
54 -gn) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
55 # Generate NoICE debug symbols |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
56 # ignored - no output formats support debugging symbols |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
57 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
58 -gs) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
59 # Generate SDCC debug symbols |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
60 # ignored - no output formats supprt debugging symbols |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
61 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
62 # --globalize-symbols) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
63 # # Make all symbols global |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
64 # # lwasm does not support globalizing everything by default |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
65 # ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
66 -m*) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
67 fatal_error "invalid CPU option '$arg'" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
68 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
69 --) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
70 fatal_error "standard input not supported" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
71 ;; |
424
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
72 -a*) |
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
73 list_file=${arg#${arg%=*}} |
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
74 list_file=${list_file#=} |
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
75 options="$options -l$list_file" |
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
76 ;; |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
77 -I*) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
78 #include_file=${arg#-I} |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
79 #echo "warning: include path '$include_file' ignored" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
80 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
81 -MD) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
82 fatal_error "assembler option '$arg' not supported" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
83 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
84 -o) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
85 output_file=$1; shift |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
86 ;; |
421
c41d72a58ef6
Add --defsym support to 'as' wrapper
Tormod Volden <debian.tormod@gmail.com>
parents:
403
diff
changeset
|
87 --defsym) |
c41d72a58ef6
Add --defsym support to 'as' wrapper
Tormod Volden <debian.tormod@gmail.com>
parents:
403
diff
changeset
|
88 options="${options} -D$1"; shift |
c41d72a58ef6
Add --defsym support to 'as' wrapper
Tormod Volden <debian.tormod@gmail.com>
parents:
403
diff
changeset
|
89 ;; |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
90 -v|-version) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
91 show_version |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
92 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
93 --version) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
94 show_version |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
95 exit 0 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
96 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
97 -D|-f|-K|--traditional-format|-w|-x|-Z|-W|--no-warn) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
98 # These options are accepted but ignored by GNU as. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
99 true |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
100 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
101 -Qy) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
102 # "identify in output" - ignore |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
103 true |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
104 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
105 -*) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
106 echo "as (m6809): unrecognized option $arg" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
107 exit 1 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
108 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
109 *) |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
110 input_file=$arg |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
111 ;; |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
112 esac |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
113 done |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
114 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
115 # Complain if no input files given. We don't support redirecting |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
116 # from standard input. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
117 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
118 if [ "x$input_file" = "x" ]; then |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
119 fatal_error "no input file specified" |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
120 fi |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
121 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
122 # Invoke the real (lwasm) assembler. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
123 # The -o option specifies the output file name |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
124 # --obj creates object files |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
125 # --pragma=undefextern causes undefined symbols to be assumed external |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
126 # --pragma=cescapes allows C escape syntax in strings |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
127 #echo lwasm -o "$output_file" $options --obj --pragma=undefextern --pragma=cescapes $input_file |
403
f5a88f147fae
Update "as" wrapper for gcc6809 to use new source format
William Astle <lost@l-w.ca>
parents:
72
diff
changeset
|
128 # pragma=newsource allows preprocessed asm files with macro expansion to assemble properly even |
f5a88f147fae
Update "as" wrapper for gcc6809 to use new source format
William Astle <lost@l-w.ca>
parents:
72
diff
changeset
|
129 # when the preprocessor interproses extra spaces |
f5a88f147fae
Update "as" wrapper for gcc6809 to use new source format
William Astle <lost@l-w.ca>
parents:
72
diff
changeset
|
130 lwasm -o "$output_file" $options --obj --pragma=undefextern --pragma=cescapes --pragma=importundefexport --pragma=newsource $input_file |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
131 rc=$? |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
132 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
133 # OK, see if the assembler succeeded or not. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
134 # If it failed, the source is copied to /tmp/as6809_error.s |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
135 # so that it can be inspected. GCC will normally delete any |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
136 # temporary .s files that it generates. This makes debugging |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
137 # the compiler easier. |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
138 # |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
139 # lwasm does not create an output file if it errors out but it also doesn't |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
140 # remove an existing file if it fails so we remove it anyway... |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
141 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
142 if [ "$rc" != "0" ]; then |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
143 cp -p $input_file /tmp/as6809_error.s |
424
3aad0ff3c3be
Add support for assembler listings in the as wrapper script.
David Flamand <dflamand@gmail.com>
parents:
421
diff
changeset
|
144 rm -f $output_file $list_file |
72
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
145 exit $rc |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
146 fi |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
147 |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
148 # we don't need anything fancy here since lwasm supports specifying output |
84eb35251849
Added extra scripts that can be used to run gcc6809 with lwtools as its binutils
lost@l-w.ca
parents:
diff
changeset
|
149 # file names.... |