【问题标题】:Changing mouse color in assembly在装配中更改鼠标颜色
【发布时间】:2017-03-25 13:18:55
【问题描述】:

我正在组装中进行某种绘画,我希望用户选择他想要绘制的颜色,所以我希望鼠标根据用户现在使用的颜色来改变它的颜色。

如何在不创建自己的鼠标的情况下做到这一点?
int 33h可以帮我吗?

【问题讨论】:

  • 什么操作系统?什么平台?
  • 操作系统是Dos,平台是指汇编程序吗?如果是这样,那么 TASM...
  • 平台是指ISA。所以对于 DOS,你可能以 8086 或 80386 为目标。
  • 我已添加标签以更准确地反映您的需求。
  • 您需要自己设置图形光标,使用 INT 33h, AX=0009h

标签: assembly x86 cursor mouse dos


【解决方案1】:

你应该试试这个:

MyFirstBlock:
mov ah, 09h ; Bored stuff...
mov cx, 80h ; 80h covers only the text and 1000h the entire remain screen
mov al, 20h ; More bored stuff...
mov bl, 4fh ; This is the color, try with CMD, Ex. 00 is black-black.
int 10h ; Call VGA to display block

然后,用call MyFirstBlock调用它,这是显示单个块的代码,使用你的打印功能:

mov si, MyEmptyText
call YouFunctionThatPrintTTYCharacters

MyEmptyText: db ' ', 0

完整代码:

MyFirstBlock:
mov ah, 09h ; Bored stuff...
mov cx, 80h ; 80h covers only the text and 1000h the entire remain screen
mov al, 20h ; More bored stuff...
mov bl, 4fh ; This is the color, try with CMD, Ex. 00 is black-black.
int 10h ; Call VGA to display block
; call MyFirstBlock is useless so dont put it!, until you are in a diferent file...
mov si, MyEmptyText
call YouFunctionThatPrintTTYCharacters

MyEmptyText: db ' ', 0

%INCLUDE "SomeBasicFunctions.asm"

我等待这将成为您问题的答案。

哦,int 33h,我认为他只在 MS-DOS 中工作,或者不是?,我从未使用过它,而是使用它。

【讨论】:

    猜你喜欢
    • 2021-08-24
    • 2011-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    • 2011-12-18
    • 2013-10-31
    相关资源
    最近更新 更多