home .. forth .. colorforth mail list archive ..

RE: [colorforth] To kernel, or not to kernel


> >
> > I'm interested in Albert's "postit prefix assembler". I guess that what
> > people dislike is not having an assembler so each time you  need a CPU
> > specific instruction you have to enter again into Intel's nightmarish
opcode
> > encoding. OTOH a full assembler is somewhat overkill. Albert's assembler
> > seems to me an interesting intermediate solution, requiring a moderate
> > knowledge of Intel assembly and eventually a small quickref card.
> 
> Oops. Maybe I gave the wrong impression. The postit prefix assembler
> is your typical Forth battle axe. Very powerful, in skilled hands.
> Its simplicity derives partly from not hiding anything of the Intel
> Pentiums ugliness. So you cannot without the original Intel
> datasheets.
> An example: the Pentium has in fact no instruction
>     MOV   EAX, EBX
> You may not know but there normal assemblers are taking a decision for
> you!
> 

I do know; I've implemented my own postfix 8086 assembler for my system.

> In pifu you have to choose from the two equivalent instructions:
>     MOV, X| F| AX'| R| BX|
> ("move xcell from primary register AX register BX")
>     MOV, X| T| BX'| R| AX|
> ("move xcell to primary register BX register AX")
> 
> (There are countless LEA instructions to that same effect, but I will
> leave it at this.)
> 

Clearly it needs some knowledge of the Intel opcodes encoding. I'm not
thinking of a full blown assembler anyone but about a set of definitions to
help with producing the right bytes for a given instruction. Combined with
the right documentation _in situ_ ( that is, for each memomnic the proper
encoding scheme), this could be good enough for producing hex code snippets,
when the machineForth macros are not enough. BTW ( Here I answer to
objections made by other posters ) how do you create the machineForth
macros?

> > Furthermore, it might don't needs to actually assemble 
> things into memory:
> > it can just display the hex stuff that you then insert into 
> the source.
> 
> It would become a lot more complicated if I tried that!
> 

Why?

> 
> It is a full i386 assembler (all addressing modes but not all the MMX
> and FP instruction enhancements.) This could be the starting point for
> a tool that fits nicely into colorforth, maybe leaving some things
> out, aiming for half a dozen screens.
> 
> OTOH I could imagine that the proper way for colorforth is what
> I would call an eclectic assembler. This means a very limited
> selection of exactly those things needed colorforth.
> 

My idea is the opposite: maybe ideally an interactive and comprehensive
datasheet of the Intel chip.

	Amicalement,
	Frederic

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com