Correction (was Re:Important...)

Juergen Buchmueller pullmoll at t-online.de
Sun Jun 17 02:03:48 PDT 2007


On Sun, 17 Jun 2007 08:17:14 +0200
Juergen Buchmueller <pullmoll at t-online.de> wrote:

The reverse bit numbering hit me over the head again :-P
RECNO(0) is of course the more significant bit of recno.

> 	#37 (LSB)	#36 (MSB)
> 	-----------------------------
> 	A = 0		A = 0
> 	B = BUS[13]	B = BUS[12]
> 	C = BUS[11]	C = BUS[10]
> 	D = BUS[9]	D = BUS[8]

corrected:

 	#37 (MSB)	#36 (LSB)
 	-----------------------------
 	A = 0		A = 0
 	B = BUS[13]	B = BUS[12]
 	C = BUS[11]	C = BUS[10]
 	D = BUS[9]	D = BUS[8]


> void increcno(void)
> {
> 	static int successor[4] = {1,3,0,2};
> 	recno = successor[recno];
> }

corrected:

void increcno(void)
{
	static int successor[4] = {2,0,3,1};
	recno = successor[recno];
}

> void rwc(void)
> {
> 	/* map for read, check, write, write (yes, write = 2 or 3) */
> 	static int branch_map[4] = {0,2,3,3};
> 
> 	switch (record) {
> 	case 0: /* KADR[8-9] HEADER read/write/check */
> 		branch = branch_map[(kadr >> 6) & 3];
> 		break;
> 	case 1: /* KADR[10-11] LABEL read/write/check */
> 		branch = branch_map[(kadr >> 4) & 3];
> 		break;
> 	case 2: /* 0,0 from recnod, which maps to READ */
> 		branch = 0;
> 		break;
> 	case 3: /* KADR[12-13] (DATA read/write/check) */
> 		branch = branch_map[(kadr >> 2) & 3];
> 		break;
> 	}
> }

corrected:

void rwc(void)
{
	/* map for read, check, write, write (yes, write = 2 or 3) */
 	static int branch_map[4] = {0,2,3,3};
 
	switch (record) {
	case 0: /* KADR[8-9] HEADER read/write/check */
		branch = branch_map[(kadr >> 6) & 3];
		break;
	case 1: /* 0,0 from recno, which maps to READ */
		branch = 0;
		break;
	case 2: /* KADR[10-11] LABEL read/write/check */
		branch = branch_map[(kadr >> 4) & 3];
		break;
	case 3: /* KADR[12-13] (DATA read/write/check) */
		branch = branch_map[(kadr >> 2) & 3];
		break;
	}
}


More information about the Altogether-devel mailing list