Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Stefan Reuther Newsgroups: comp.arch.embedded Subject: Re: Portable Assembly Date: Sun, 28 May 2017 18:45:30 +0200 Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net q7xsW23IO5R40zw1slUsNQdCh62upNFE83PRAQj3dleMkGo7vs Cancel-Lock: sha1:V8UIk56gwW3GvTS15iuO7F/OD50= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 Hamster/2.1.0.1538 In-Reply-To: Xref: csiph.com comp.arch.embedded:26671 Am 27.05.2017 um 23:31 schrieb Dimiter_Popoff: > On 28.5.2017 г. 00:17, Les Cargill wrote: >> rickman wrote: >>> Or do I misunderstand how a portable assembler works? Does it >>> require a specific assembly language source format for each target >>> just like using the standard assembler for the target? >> >> That's what C is for. > > Or Basic. Or Fortran etc. > > However, they are by far not what a "portable assembler" - existing > under the name Virtual Processor Assembler in our house is. > And never will be, like any high level language C is yet another > phrase book - convenient when you need to do a quick interaction > when you don't speak the language - and only then. So, then, what is a portable assembler? One major variable of a processor architecture is the number of registers, and what you can do with them. On one side of the spectrum, we have PICs or 6502 with pretty much no registers, on the other side, there's things like x86_64 or ARM64 with plenty 64-bit registers. Using an abstraction like C to let the compiler handle the distinction (which register to use, when to spill) sounds like a pretty good idea to me. If you were more close to assembler, you'd either limit yourself to an unuseful subset that works everywhere, or to a set that works only in one or two places. Stefan