需要此C代码的说明....请帮助 [英] Need Explanation For This C Code.... Please help

查看:56
本文介绍了需要此C代码的说明....请帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请有人解释此代码

somebody please explain this code

void setpos(int p)      
{
    union REGS regs;
    regs.h.ah = 2;
    regs.h.bh = 0;
    regs.h.dh = 4;
    regs.h.dl = p;
    int86(0x10,&regs,&regs);
}

推荐答案

这是C程序中的某种汇编代码.分配是将值存储在处理器寄存器中,然后调用中断0x10.
AH寄存器中值为2的0x10中断意味着设置光标位置.
寄存器BH是屏幕页面(0表示可见屏幕),寄存器DH和DL是屏幕上的x和y坐标.

此处看看 [ ^ ],了解有关中断的信息,请此处 [ ^ ],以获取有关中断10的详细信息.
That''s sort of assembly code within a C program. The assignments are to store values in the processor registers and then call interrupt 0x10.
Interrupt 0x10 with the value 2 in register AH means to set the cursor position.
Register BH is the screen page (0 means the visible screen) and registers DH and DL are the x and y coordinates on the screen.

Have a look here[^] for information on interrupts and here[^] for information specifically about interrupt 10.


这篇关于需要此C代码的说明....请帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆