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