2 NamedReg.CPP version 1.0
\r
3 by Robert Schmidt of Ztiff Zox Softwear 1993
\r
5 Defines the member functions of the NamedRegister class declared in
\r
7 Defines the stream operator >> to read named register info from
\r
8 an istream. (Text mode)
\r
12 #include <iostream.h>
\r
14 #include "Screen.hpp"
\r
15 #include "Register.hpp"
\r
18 // NamedRegister::printCon() prints the register state to the console.
\r
19 // If enableFlag is zero, the value is omitted from the display, and
\r
20 // its place is filled with spaces.
\r
22 void NamedRegister::printCon()
\r
24 textattr(enableFlag?REGENABLE_COLOR:REGDISABLE_COLOR);
\r
25 cprintf("%03hx (%02hx) %24s : %02hx", getPort(), getIndex(),
\r
30 This operator reads the register port number, index and name from the
\r
31 input stream. (*Not* the value!) Used for initializing each element
\r
32 in the register table used by TWEAK.
\r
35 istream& operator>> (istream &in, NamedRegister &r)
\r
38 char *n = new char[128];
\r
43 r.setIndex((unsigned char)(i));
\r
45 n[in.gcount()-1] = '\0';
\r
46 r.name = new char[strlen(n)+1];
\r