I have to write in order, pixels in a pixel screen, 开发者_Python百科the address is from 8000H to 807FH, and I don't know how to do it.
I tried to ADD 1H in the address 8000H and a pixel appeared. So I tried in the next address 8010H, another pixel appeared but far away.... What I need is to know how to write 2 pixels one after the other.
The pixels must be arranged in some systematic way. Hopefully they are arranged horizontally which is nice and simple, but I once used a computer where they were arranged vertically, then the bytes were arranged horizontally in rows, then the rows were arranged vertically again, which was annoying to program.
Anyway, presumably one bit equals one pixel, because it's monochrome. So you just need to modify different bits and figure out which bit corresponds with which pixel.
To toggle the LSB of a byte you would XOR the byte with 1. To set it you would OR it with 1. To toggle the MSB you would XOR the byte with 128. If you don't know what the MSB and LSB are you need to read up on them and on bit manipulation.
精彩评论