How to write pixels in a pixel screen?

I need to write in order, the pixels in the pixel screen, the address is from 8000H to 807FH, and I do not know how to do this.

I tried ADD 1H at address 8000H and a pixel appeared. So I tried at the next address 8010H, another pixel appeared, but far away. I need to know how to write 2 pixels one by one.

+4
source share
1 answer

Pixels must be sorted in some systematic way. I hope 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 lines, then the lines were arranged vertically again, which was unpleasant for the program.

In any case, presumably one bit is equal to one pixel, because it is monochrome. So you just need to change the different bits and find out which bit matches which pixel.

To switch the LSB byte, you must XOR the byte from 1. To set it, you must OR from 1. To switch the MSB, you must XOR byte from 128. If you do not know what MSB and LSB you need to read them and manipulate with bits.

+3
source

Source: https://habr.com/ru/post/1347869/


All Articles