(Cursor End Register - CER) (0Bh) - 2


crt_address = bios_var_ptr->wAddrCRT;


//

//


//

WriteReg(crt_address++, 0x0A);


//

top = (unsigned char) ReadReg(crt_address--);


//

WriteReg(crt_address++, 0x0B);


//

bottom = (unsigned char) ReadReg(crt_address);


//

printf("\n : %d\n"

"\n : %d\n",

top, bottom);


getch();

}

WriteReg ReadReg, DESIGN.C ( 4.5).

4.5. DESIGN.C

//=========================================================

// WriteReg(unsigned reg, unsigned char data)

//

//

// :

// reg -

// data - , reg

//=========================================================

void WriteReg(unsigned reg, unsigned char data) {

_asm {

mov dx,reg

mov al,data

out dx,al

}

}


//=========================================================

// unsigned char ReadReg(unsigned reg)

//

//

// :

// reg -

//

// :

// , reg

//=========================================================

unsigned char ReadReg(unsigned reg) {


unsigned char data;


_asm {

mov dx,reg

in al,dx

mov data,al

}

return(data);

}