Contoh 5
Contoh cpp 5
#include <conio.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#define VIDEO_INT 0x10
void getMode(union REGS *reg);
int main(void)
{
union REGS layar;
getMode(&layar);
printf("Informasi Layar\n");
printf("Banyak kolom\t\t: %d\n", layar.h.ah);
printf("Nomor mode\t\t: %0x\n", layar.h.al);
printf("Halaman tampilan\t: %d\n", layar.h.bh);
getch();
return EXIT_SUCCESS;
}
void getMode(union REGS *reg)
{
union REGS *in;
in->h.ah = 0x0f;
int86(VIDEO_INT, in, reg);
return;
}
Output
#include <conio.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#define VIDEO_INT 0x10
void getMode(union REGS *reg);
int main(void)
{
union REGS layar;
getMode(&layar);
printf("Informasi Layar\n");
printf("Banyak kolom\t\t: %d\n", layar.h.ah);
printf("Nomor mode\t\t: %0x\n", layar.h.al);
printf("Halaman tampilan\t: %d\n", layar.h.bh);
getch();
return EXIT_SUCCESS;
}
void getMode(union REGS *reg)
{
union REGS *in;
in->h.ah = 0x0f;
int86(VIDEO_INT, in, reg);
return;
}
Output
Komentar
Posting Komentar