|made up byte code: registers vs. literals firstname.lastname@example.org (1996-11-24)|
|Re: made up byte code: registers vs. literals email@example.com (Ray S. Dillinger) (1996-12-01)|
|Re: made up byte code: registers vs. literals firstname.lastname@example.org (1996-12-03)|
|Re: made up byte code: registers vs. literals email@example.com (Russell Bornsch++) (1996-12-03)|
|From:||firstname.lastname@example.org (jon klein)|
|Date:||24 Nov 1996 16:25:22 -0500|
|Organization:||University of Massachusetts, Amherst|
I've got a specific question, part of a much larger general one.
I've created my own simple byte codem specificially meant to do some
mathematical operations, and little more (no memory access, function calling,
etc... just straight math).
The interpreter has a couple of virtual registers to store intermediate
results. The was I'm doing it, each 8-bit operator has 3 8-bit operands,
so that each instruction is 32 bits wide.
ADD %r1,%r2,%r3 ; r3 = r1 + r2
The problem deals with literals. Say I want to:
ADD 5, %r2, %r3
or the more important problem
MOV 10, %r1
The general question then, is: how does the Sparc (or any... I'm just
familiar with Sparc) assembler handle this? It's perfectly legal to say
'mov 40, %l0'. When assebled, how is this supposed to look? How is the
distinction made between register X, and literal X?
Any help is appriciated!
[There's typically separate op codes for "move register to register" and
move "literal to register". Alternatively there may be type bits per operand
like the Vax used. -John]
Return to the
Search the comp.compilers archives again.