Re: Assembler or machinecode. Was Re: [colorforth] New Linux 4word
Chris Walton <[email protected]>
| Newsgroups | gmane.comp.lang.forth.colorforth |
|---|---|
| Message-ID | <[email protected]> |
You know, bootsectors etc. can be written in forth if you compile 16-bit code (one block different) and just insert a hard jump On Apr 8, 2005 5:16 PM, Albert van der Horst <[email protected]> wrote: > On Fri, Apr 08, 2005 at 08:39:08AM -0700, Jeff Fox wrote: > <SNIP> > > > > > An assembler is the proper starting point. There is no Metacompiler > > > without assembler. And an assembler may be enough. > > > Unless of course you think you have a nice source if it is sprinkled > > > with > > > cd45 2, 12 1, 3135 2, > > > > I heard Chuck talking about this a couple of days ago. He said that > > he had always written a target assembler in Forth because it only > > took a block or two in most cases. Then he would write the assembler > > portion of CODE words or a kernel using the assembler so that it > > would provide more meaningful code representation to the programmer. > > I think this is attainable even for the Pentium. > > > He said that the Pentium assembler was such a mess, and so complex, > > and that he used so few of the Pentium instructions anyway that it > > just worth the effort to provide a full high level Pentium assembler > > for his needs in colorforth. He added that there were so many > > instructions and address modes etc. that people would need to have > > a book in front of them anyway to look up opcodes to see what they > > actually did. So given that he needed only a few Pentium codes, > > and assuming that most readers haven't memorized the entire Pentium > > instruction set, or that the variation of the syntax that Chuck > > would use in a RPN assembler would be completely obvious to readers > > he didn't add a layer of Pentium opcode names. He said, you are > > going to have to go look them up anyway to understand that level > > of the programming. > > Even so. I managed to get the whole of the Intel Pentium Assembler > down to 13 screens. The full content (316 pages) of chapter 25 > of the Intel Pentium architecture Manual is under control. > The whole shit: the sib byte, all addressing modes, prefixes, > 16 bits stuff in 32 bits mode and floating point. > (This is not a RPN assembler, but a new principle PostIt FixUp, > it is more modular.) > > Now if I could trim that to the needs of colorforth, this would > be say 5 screens. Floating point for instance now takes 3 screens, > these could be dropped immediately. > Even a target of 2 or 3 screens seems reasonable. > > I have done a conversion of retroforth, that is in many respects > similar to colorforth. The 1, 2, 3, thingies are automatically > replaced by assembler instructions. > > > He added that after bootstrapping then he was in a position to > > do the normal thing of coding a Forth version that won't need > > a kernel in assembler to get going. It was just a matter of > > priorities. > > I can understand that it is not Chucks priority to do the kind of > research into Intel that I have done. But I would be glad to > share any useful techniques that I have found. > There is no escape: it is either machine code in the kernel or > assembler. I'm convinced that my assembler is preferable over > machine code in the context of colorforth. > > Then there are occasionally useful words in the Pentium > instruction set like RDTSC, (read time stamp counter). > (I use that one quite a lot.) > > <SNIP> > > > Best Wishes > > More information : > google for "Intel Pentium assembler". > My site comes up first! > > Groetjes Albert > > -- > Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS > Economic growth -- like all pyramid schemes -- ultimately falters. > [email protected] http://home.hccnet.nl/a.w.m.van.der.horst > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > Main web page - http://www.colorforth.com > > -- Chris Walton arke on irc.freenode.net