/**
 * <BR>You can read the source of this class <A HREF="./DebuggableFileRegisters.java.html"> here</A>.
 */
public class DebuggableFileRegisters extends FileRegisters {

	public DebuggableFileRegisters() {
		PicRam = new RAM();
		PicSyst = new DebuggableSystemRegisters();
		infos = false;
		Infos = null;
	}

	public String[] Display() {
		int i;
		String s[] = new String[80];

		for(i = 0 ; i < 12 ; i++)
			s[i] = address(i) + ":  Bank0>" + Utils.hex(((DebuggableSystemRegisters)PicSyst).Read(i, 0), 2, 2) +
						"  ;  Bank1>" + Utils.hex(((DebuggableSystemRegisters)PicSyst).Read(i, 1), 2, 2);
		for(i = 12 ; i <= 79 ; i++)
			s[i] = address(i) + ":  " + Utils.hex(Read(i), 2, 2);

		return s;
	}

	public void setSymbolicInfos(SymbolicInfos[] i) {
		Infos = i;
		if(Infos != null)
			infos = true;
	}

	protected String address(int i) {
		if(infos) {
			String r = Disassembler.FindCorellation(i, Infos);
			if(r != null)
				return (r + "        ").substring(0, 8);
		}
		return Utils.hex(i, 3, 3) + "     ";
	}

	protected boolean infos;
	protected SymbolicInfos[] Infos;
}