I'm working on a project using an AT89C51CC03 to drive an LCD (SED1330 based). I'm using Bresenhams Line Drawing Algorithm to calculate where a straight line should go given start & end points. The algorithm writes to a character array where it draws a '*' if the line is supposed to go there and a *-* if the pixel (array element) will be empty. To send the finished line to the screen, it needs to be in bit format, ie each '*' needs to be a 1 and an empty pixel 0. How can I address a big array (64 x 64 pixels in the end) like this? I don't mind writing the line image to an array then transferring it to a 1D bitmap array which I will then send to the screen. Cheers.
and use mod (%), div (/), and bitmasks to set individual bits.</i. Why oh why use such complecxities when OR (to set) and AND (to clear) does it without a hitch? Erik
Because "OR" and "AND" are not C operators? Because even if you program in assembly, you still have to perform a mod 8 (mask with 07H, usually) and integer division to derive the bit and offset into the table? This complaint sounds somehing like, "oh, why use complexities like + and - when ADD and SUB does it without a hitch"? It's just notation; the meaning does not change.
Thanks very much for your responses. I'm going ahead using a mask (as suggested) which reads the appropriate character into a temporary set of 8 sbit variables. These 8 sbit's are then sent to port 0 and sent out to the LCD (via another function).
Because "OR" and "AND" are not C operators? HUH???? what about '|' for OR and '&' for AND, last I looked that was part of C Erik