Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在汇编语言中使用RGB颜色 我用C++中的x86处理器的汇编语言从下面的代码中绘制屏幕上的一个像素。我不想使用任何函数或方法从C++中,我使用这个代码的引导加载程序。代码如下: /********************************** * Mainvainsoft 2011. * * Writen By: Farid-ur-Rahman * * On: 24 Sep At: 1:34 AM. * **********************************/ #include <conio.h> void main () { // Setting Video mode to 256 colours at 320 X 200 _asm { mov ah , 0x00 // Setting Video mode or Clear Screen mov al , 0x13 // Setting Video mode to 256 Color Mode int 0x10 // Call the Registor mov ah , 0x0c // Plot the Pixel mov al , 4 // Color mov cx , 160 // X-Axis mov dx , 100 // Y-Axis int 0x10 // Call the Registor } getch(); // Wait for the key press } /********************************** *Mainvainsoft 2011* *作者:Farid ur Rahman* *9月24日凌晨1:34* **********************************/ #包括 空干管() { //以320 X 200的速度将视频模式设置为256色 _asm{ mov ah,0x00//设置视频模式或清除屏幕 mov al,0x13//将视频模式设置为256色模式 int 0x10//调用寄存器 mov-ah,0x0c//绘制像素 mov al,4//颜色 mov cx,160//X轴 mov dx,100//Y轴 int 0x10//调用寄存器 } getch();//等待按键 }_C++_Assembly - Fatal编程技术网

在汇编语言中使用RGB颜色 我用C++中的x86处理器的汇编语言从下面的代码中绘制屏幕上的一个像素。我不想使用任何函数或方法从C++中,我使用这个代码的引导加载程序。代码如下: /********************************** * Mainvainsoft 2011. * * Writen By: Farid-ur-Rahman * * On: 24 Sep At: 1:34 AM. * **********************************/ #include <conio.h> void main () { // Setting Video mode to 256 colours at 320 X 200 _asm { mov ah , 0x00 // Setting Video mode or Clear Screen mov al , 0x13 // Setting Video mode to 256 Color Mode int 0x10 // Call the Registor mov ah , 0x0c // Plot the Pixel mov al , 4 // Color mov cx , 160 // X-Axis mov dx , 100 // Y-Axis int 0x10 // Call the Registor } getch(); // Wait for the key press } /********************************** *Mainvainsoft 2011* *作者:Farid ur Rahman* *9月24日凌晨1:34* **********************************/ #包括 空干管() { //以320 X 200的速度将视频模式设置为256色 _asm{ mov ah,0x00//设置视频模式或清除屏幕 mov al,0x13//将视频模式设置为256色模式 int 0x10//调用寄存器 mov-ah,0x0c//绘制像素 mov al,4//颜色 mov cx,160//X轴 mov dx,100//Y轴 int 0x10//调用寄存器 } getch();//等待按键 }

在汇编语言中使用RGB颜色 我用C++中的x86处理器的汇编语言从下面的代码中绘制屏幕上的一个像素。我不想使用任何函数或方法从C++中,我使用这个代码的引导加载程序。代码如下: /********************************** * Mainvainsoft 2011. * * Writen By: Farid-ur-Rahman * * On: 24 Sep At: 1:34 AM. * **********************************/ #include <conio.h> void main () { // Setting Video mode to 256 colours at 320 X 200 _asm { mov ah , 0x00 // Setting Video mode or Clear Screen mov al , 0x13 // Setting Video mode to 256 Color Mode int 0x10 // Call the Registor mov ah , 0x0c // Plot the Pixel mov al , 4 // Color mov cx , 160 // X-Axis mov dx , 100 // Y-Axis int 0x10 // Call the Registor } getch(); // Wait for the key press } /********************************** *Mainvainsoft 2011* *作者:Farid ur Rahman* *9月24日凌晨1:34* **********************************/ #包括 空干管() { //以320 X 200的速度将视频模式设置为256色 _asm{ mov ah,0x00//设置视频模式或清除屏幕 mov al,0x13//将视频模式设置为256色模式 int 0x10//调用寄存器 mov-ah,0x0c//绘制像素 mov al,4//颜色 mov cx,160//X轴 mov dx,100//Y轴 int 0x10//调用寄存器 } getch();//等待按键 },c++,assembly,C++,Assembly,我想使用RGB颜色在像素上显示。模式13h使用带有256个18位RGB(每个6位)条目的调色板。例如,您可以将条目4设置为所需的RGB颜色,并在使用颜色4时打印像素 有关如何设置调色板条目的示例,请参见。设置视频模式后,您可以执行以下操作: // Set entry 4 mov dx, 0x3c8 mov al, 4 out dx, al inc dx mov al, Red out dx, al mov al, Green out dx, al mov al, Blue out dx, a

我想使用RGB颜色在像素上显示。

模式13h使用带有256个18位RGB(每个6位)条目的调色板。例如,您可以将条目4设置为所需的RGB颜色,并在使用颜色4时打印像素

有关如何设置调色板条目的示例,请参见。设置视频模式后,您可以执行以下操作:

// Set entry 4
mov dx, 0x3c8
mov al, 4
out dx, al

inc dx
mov al, Red 
out dx, al
mov al, Green
out dx, al
mov al, Blue
out dx, al

// draw pixel

模式13h使用带有256个18位RGB(每个6位)条目的调色板。例如,您可以将条目4设置为所需的RGB颜色,并在使用颜色4时打印像素

有关如何设置调色板条目的示例,请参见。设置视频模式后,您可以执行以下操作:

// Set entry 4
mov dx, 0x3c8
mov al, 4
out dx, al

inc dx
mov al, Red 
out dx, al
mov al, Green
out dx, al
mov al, Blue
out dx, al

// draw pixel

在您使用的视频模式中,帧缓冲区的每个字节都指向调色板。因此,如果你有24位的RGB颜色信息,你不能直接写入像素,因为像素只包含调色板索引


当然,您可以将颜色输入调色板,但这可能相当复杂。

在您使用的视频模式中,帧缓冲区的每个字节都指向调色板。因此,如果你有24位的RGB颜色信息,你不能直接写入像素,因为像素只包含调色板索引


当然,您可以将颜色输入调色板,但这可能相当复杂。

使用RGB颜色而不是15种汇编语言颜色。因为提到的模式0x13不支持同时超过256种颜色,并且没有支持更多颜色的标准BIOS模式。但是,vesa bios扩展支持更高的颜色模式。使用RGB颜色代替15种汇编语言颜色因为所提到的模式0x13不支持同时超过256种颜色,并且没有支持更多颜色的标准BIOS模式。但是,vesa bios扩展支持更高的颜色模式。