How do you paint pixels in NASM, could someone tell me about it and mabey give me an example?
Painting pixels, not so much tedious work.
Try MCGA mode 13h you can set this using the video bios,
if you are in 32-bit code try passing down the call to the
BIOS through the DPMI server.
AH=0000 AL=0013 INT 10h
INT 10/AH=00 Set Video Mode
10/AH=0C Write Pixel
10/AH=0D Read Pixel
If you are a 32-bit app the EGA Video Ram is located at
or for a 16-bit app it will be located at A000:0000
You can draw pixels by directly writing to the above locations.
Each pixel's color is defined by a byte's value yielding 256 colors,
and the position of the byte in the segment defines its location
on a screen,
the pallete for these colors can be manipulated using I/O
When using a XY coordinate it needs to be turned into its
corresponding position in the video ram.
To do so for zero-base coordinates do:
Hence for a 320x200 pixel screen you would perform
the following calculation:
I'll come back with some example code later.
*NOTE: This all applies to DOS programs...
Edited 7 Years Ago by NotNull: n/a
PAINT_A_PIXEL example code...
bits 16 org 100h start: mov ax, 0xa000 mov es, ax call govideo mov bx, 0 mov cx, 0 mov dl, 0xe call plotpixel call waitkey govideo: push ax mov ax,0013h int 10h pop ax ret waitkey: mov ah,06 mov dl,0ffh int 21h jz waitkey mov ax,0003h int 10h mov ax,4c00h int 21h plotpixel: push dx mov ax,320 xor dx,dx mul bx mov si,ax add si,cx pop dx mov [es:si],dl ret
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I have expanded the program so that it also ...
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...