1 package net.mograsim.machine;
6 * A register in a machine is defined by this interface. A hardware register may
7 * have {@link Register#names() named sub-registers}.
10 * @author Christian Femers
13 public interface Register {
15 * The unique identifier of the register. This does not have to be the display
16 * name or name in the assembly language.
18 * @return the registers id as case sensitive String
19 * @author Christian Femers
24 * The name(s) of this register. This is the displayed name and the name used in
25 * the assembly language. All names of all registers must be case-insensitive
26 * unique. A register can have multiple names if these names address different
27 * regions (but still have a common hardware structure), e.g. <code>EAX</code>,
28 * <code>AX</code>, <code>AL</code>, <code>AH</code>.
30 * @return all the names of regions addressing this register, must be
32 * @author Christian Femers
37 * Returns the complete width in bits of the underlying hardware structure the
38 * register and possible sub-registers are part of.
40 * @param name the name of the register
41 * @return the width of the (sub-)register in bits.
44 * @author Christian Femers
49 * Returns the width in bits of the register or a named part of it.
51 * @param name the name of the register
52 * @return the width of the (sub-)register in bits.
55 * @author Christian Femers
57 int getWidth(String name);