9 output reg [31:0] cp_read = 0,
13 , output reg [8:0] sys_odata = 0,
14 input [8:0] sys_idata,
15 output reg sys_tookdata = 0
19 /* Terminal pretends to be cp5. */
22 reg [8:0] indata = 0; /* High bit is if data is present. */
33 if (cp_req && (cp_rnw == 0) && (cp_insn[27:24] == 4'b1110) && (cp_insn[19:16] == 4'b0000) && (cp_insn[11:8] == 4'h5))
38 end else if (cp_req && (cp_rnw == 1) && (cp_insn[27:24] == 4'b1110) && (cp_insn[19:16] == 4'b0001) && (cp_insn[11:8] == 4'h5))
40 cp_read = {23'h0, indata[8:0]};
42 didread = cp_insn[7:5] == 1;
48 $c("{extern void term_output(unsigned char d); term_output(",data,");}");
49 else if (didread || !indata[8])
50 indata = $c("({extern unsigned int term_input(); term_input();})");
54 sys_odata = {towrite,data};
55 if (didread || !indata[8])