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
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
23 * 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
24 * be case-insensitive unique. A register can have multiple names if these names address different regions (but still have a common
25 * hardware structure), e.g. <code>EAX</code>, <code>AX</code>, <code>AL</code>, <code>AH</code>.
27 * @return all the names of regions addressing this register, must be case-insensitive.
28 * @author Christian Femers
33 * Returns the complete width in bits of the underlying hardware structure the register and possible sub-registers are part of.
35 * @param name the name of the register
36 * @return the width of the (sub-)register in bits.
39 * @author Christian Femers
44 * Returns the width in bits of the register or a named part of it.
46 * @param name the name of the register
47 * @return the width of the (sub-)register in bits.
50 * @author Christian Femers
52 int getWidth(String name);