Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

embarrassing question

2006-02-07 by G B

Hello,

I have been doing assembly so long, that I am having trouble with
my C program.

I have records of 64 bytes in length, and the start of the record area
must start on an even 0x0100 boundary in ram.

In assembly, doing tests on the pointer for being in the middle of a
record, or to jump to the next record is a piece of cake.

assuming:
unsigned char data[2048]; is aligned on an even boundary
unsigned char *ptr;
#define RECORD_SIZE 64
#define INCREMENT_MASK 0xffc0
#define LINE_MASK 0x3f		//record_size -1

	ptr = data;
	....
the compiler hates:
	ptr &= INCREMENT_MASK;	// in case we are in the middle of a rec
but tolerates this:
	ptr += RECORD_SIZE;	//jump to the start of the next record

since the ram area is 64k, i would think this would work.

TIA

Glen

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.