Re: nibtools, GCR, G64

From: silverdr_at_wfmh.org.pl
Date: Fri, 31 May 2013 01:34:01 +0200
Message-Id: <805EEB55-E5C5-4A92-837D-46045350E99B@wfmh.org.pl>
On 2013-05-30, at 23:54, Peter Rittwage wrote:

> Look closer at the code- those are bit comparisons,  not byte.

I am not sure if I understand what you mean but I understand this code like:

if((buffer[i] == 0xff)		// IF current BYTE from the buffer is 0xff
&&				// AND
(buffer[i+1] != 0xff)		// the next BYTE one is not (we are getting out of SYNC mark)
&&				// AND
((buffer[i+1] & 0x80) == 0x80))	// that same next BYTE has at least MSB set
{ i++; 				// THEN "set first BYTE to shift" (and do the shifting)

meaning we do the shifting ONLY if at least one byte in the SYNC mark has all bits set, right?

The question is what if we have something like:

buffer[i] = 0x1f;
buffer[i+1] = 0xf8;

or any of other possible two-byte combinations [*] that still constitute a valid SYNC mark (10 consecutive bits set) but the first one is not equal to 0xff?

* - 0x7f/0xfe, 0x07/0xfe, ... and so on.

-- 
SD!
       Message was sent through the cbm-hackers mailing list
Received on 2013-05-31 00:00:05

Archive generated by hypermail 2.2.0.