(Horizontal Panning Register - HPR) (13) - 2


void VerScroll(unsigned);

void SetColumn(unsigned char);

void main(void) {

struct videoconfig vc;

unsigned char i,j;

// ,

//

_setvideomode(_DEFAULTMODE);

// 100

SetColumn(100);

// 24

for(i = 0; i < 24; i++)

printf("\ntext text text");

//

// i

for(i = 0; i < 13; i++) {

getch();

HorScroll(i,8);

}

//

// i

for(i = 0; i < 13; i++) {

getch();

VerScroll(i);

}

getch();

_setvideomode(_DEFAULTMODE);

}

HorScroll VerScroll. HorScroll , VerScroll . 4.12.

4.12. SPLIT.ASM

/**

*.Name HorScroll

*

*.Title .

*

*.Descr

* .

*

*.Proto void HorScroll(unsigned offset, unsigned wide)

*

*.Params unsigned offset - ,

*

* unsigned wide - (8 9).

*

*.Return .

*

*.Sample scroll.c

**/

void HorScroll(unsigned offset, unsigned wide) {

unsigned start_addr_reg, panning_reg;

div_t res;

res = div(offset,wide);

start_addr_reg = res.quot;

panning_reg = (wide == 9) ?

((res.rem == 0) ? 8 : res.rem - 1 ) : res.rem;

_asm {

push ds

; 1 (3BAh/3DAh)