Article View: gnu.utils.bug
Article #1599gas ns32k md_parse_option
From: taylor
Date: Thu, 11 May 1989 08:43
Date: Thu, 11 May 1989 08:43
112 lines
2937 bytes
2937 bytes
Here's some changes for ns32k.c (primarily md_parse_option) that allow
you to specify on the command line whether you want to assemble for a
NS32032 or a NS32532.
With these changes, defining NS32032 or NS32532 at compile time only
affects which of the two processors it assembles for by default -- i.e.
when you don't specify either one on the command line.
That is, you'd say:
a32k -m32032 file.s # to assemble for a 32032
a32k -m32532 file.s # to assemble for a 32532
a32k file.s # to assemble for whichever the default is.
NOTE: I edited the following diff slightly to get rid of differences
that were simply formatting differences (which I made because some
things like case statements didn't always line up under one another in
the original). If I screwed up the diff, let me know and I'll mail the
full diff.
Anyway, here's the (edited) rcsdiff output.
RCS file: RCS/ns32k.c,v
retrieving revision 1.3
diff -b -c1 -r1.3 ns32k.c
*** /tmp/,RCSt1a24254 Thu May 11 04:01:05 1989
--- ns32k.c Thu May 11 03:52:03 1989
***************
*** 232,235 ****
! #ifdef NS32532
! struct option cpureg[]= /* lpr spr */
{
--- 232,234 ----
! struct option cpureg_532[]= /* lpr spr */
{
***************
*** 250,252 ****
};
! struct option mmureg[]= /* lmr smr */
{
--- 249,251 ----
};
! struct option mmureg_532[]= /* lmr smr */
{
***************
*** 261,266 ****
};
- #endif
! #ifdef NS32032
! struct option cpureg[]= /* lpr spr */
{
--- 260,263 ----
};
! struct option cpureg_032[]= /* lpr spr */
{
***************
*** 275,277 ****
};
! struct option mmureg[]= /* lmr smr */
{
--- 272,274 ----
};
! struct option mmureg_032[]= /* lmr smr */
{
***************
*** 289,290 ****
--- 286,293 ----
};
+ #if defined(NS32532)
+ struct option *cpureg = cpureg_532;
+ struct option *mmureg = mmureg_532;
+ #else
+ struct option *cpureg = cpureg_032;
+ struct option *mmureg = mmureg_032;
#endif
***************
*** 1636,1637 ****
--- 1647,1669 ----
{
+ switch (**argP) {
+ case 'm':
+ (*argP)++;
+
+ if (!strcmp(*argP, "32032")) {
+ cpureg = cpureg_032;
+ mmureg = mmureg_032;
+ } else if (!strcmp(*argP, "32532")) {
+ cpureg = cpureg_532;
+ mmureg = mmureg_532;
+ } else
+ as_warn("Unknown -m option ignored");
+
+ while (**argP)
+ (*argP)++;
+
+ break;
+
+ default:
+ return 0;
+ }
return 1;
That's it.
David
--
David Taylor
taylor@think.com, ...!think!taylor
Technical Details
Message-ID:
<8905110843.AA24332@odin.think.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!THINK.COM!taylorShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!THINK.COM!taylor From: taylor@THINK.COM Newsgroups: gnu.utils.bug Subject: gas ns32k md_parse_option Message-ID: <8905110843.AA24332@odin.think.com> Date: 11 May 89 08:43:23 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 112