From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <616f0c88d4d9cacc230a6593fd84805c@plan9.bell-labs.com> From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: RE: [9fans] flatassembler on Plan 9? In-Reply-To: <81132473206F3A46A72BD6116E1A06AE479C6C@black.aprote.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 16 Sep 2003 11:35:47 -0400 Topicbox-Message-UUID: 3b14c3b8-eacc-11e9-9e20-41e7f4b1d025 On Tue Sep 16 07:57:27 EDT 2003, t.lankots@aprote.ee wrote: > $ find sys -name '*.s' -exec wc -l \{\} \; |awk 'BEGIN {sum=0} > > {print $0; sum += $1} > > END {print sum}' > 423 sys/src/9/alphapc/l.s > 197 sys/src/9/alphapc/memmove.s > 61 sys/src/9/alphapc/memset.s > 103 sys/src/9/bitsy/bitsyreset.s > 12 sys/src/9/bitsy/init9.s > 856 sys/src/9/bitsy/l.s > 119 sys/src/9/mtx/inb.s > 567 sys/src/9/mtx/l.s > 110 sys/src/9/pc/apbootstrap.s > 98 sys/src/9/pc/apmjump.s > 23 sys/src/9/pc/initcode.s > 830 sys/src/9/pc/l.s > 52 sys/src/9/pc/plan9l.s > 126 sys/src/9/pc/ptclbsum386.s > 54 sys/src/9/pc/rebootcode.s > 29 sys/src/9/ppc/init9.s > 841 sys/src/9/ppc/l.s > 4501 > > That's 4501 lines of assembly for _all_ architechtures. A few weeks ago I looked for an alternative to writing x86 assembler (especially the 16-bit mode stuff) and this was one I looked at, but it didn't look worth the effort to change the output format and figure out how to bootstrap it. Others I looked at all seemed to have similar problems or were handicapped by some form of licence. I'm always in 2 minds when it comes to this. We'd manage much better code for bootstraps, etc. but we'd run the risk of overusing it. Also, every time I need to use it is, I'm sure, the last time... The list above is a minimal set, you really do need to write some stuff in the C library in assembler too.