Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!tuegate.tue.nl!svin02!wsinti02!rcpieter From: rcpieter@wsinti02.info.win.tue.nl (Tiggr) Newsgroups: comp.sys.acorn Subject: (Free) Assemblers (was: Re: is it possible to port GNU-GCC-Compiler to Archimedes running RISC-OS ?) Message-ID: <1779@svin02.info.win.tue.nl> Date: 22 Feb 91 13:20:06 GMT References: <1991Feb20.085225.11667@cl.cam.ac.uk> <5309@acorn.co.uk> Sender: news@svin02.info.win.tue.nl Reply-To: rcpieter@info.win.tue.nl Distribution: comp Lines: 42 Owen writes: [gcc]> is free. And in my humble opinion, a free C compiler >for the Archimedes would be a good thing. True, but there is no free assembler yet. The Acorn assembler is extremely expensive, and the Wingpass is, well, not widely used/known (are there any other assemblers for RISC OS?). On the topic of GAS: you don't want to know about it. GAS is horrible, in that the mnenomics it has to recognise are enumerated in some array. In case you can't imagine what this means for the ARM: the number of type-1 instruction opcodes = 16 (instructions) * 17 (conditionals) * 2 (with or without `s') + 4 (instructions with extra `p') * 17 (conditionals) equals a staggering 612. A portable assembler suiting the arm much better would get restricted regexps from the machine description. For instance the pattern for the tst instruction could be: "tst\(eq|ne|al|nv|hi|lo|ls|hs|cc|cs|vc|vs|mi|pl|lt|gt|\)\(s|p|\) \1, \2" with the \1 and \2 referring to two strings in some other array indicating what kind of operand is allowed there (much like GNU CC md's constraints, but more general). Then the `emit_tst' function (being mentioned in yet another array :-)) would among other things get an array of int indicating for each of the choose-from constructions (the `\(..|..|..|...\)' thingies) which option was encountered (things could even be extended to allow the `\1' thingy to act like a function and return different values for different options chosen from the choose-from thingies. This could for instance be used to pack the `mov' and `movq' instructions of the 68k in one template (using `mov\(|q\)')). Anyway, this setup would make a very nice and portable assembler. >They may then find they like C, but the gcc port is too buggy/the code is >too slow/big or whatever, and save up and buy Norcroft. The port isn't buggy! :-) Really, I am busy on a project where the size of the C source has grown beyond half a meg, all of which is compiled flawlessly by `GCC -O'. Tiggr