#include <conio.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#define VIDEO_INT 0x10 // Nomor interupsi 10h
#define UCHAR unsigned char
void setMode(UCHAR mode); // Deklarasi fungsi untuk
// mengubah mode video
int main(void)
{
printf("Tekan ENTER untuk mengubah mode...\n");
getch();
setMode(0x01); // Ubah mode video
printf("Mode 01 heksadesimal.\n"); // Informasi
printf("Tekan ENTER kembali ke mode normal...");
getch();
setMode(0x03); // Kembali ke mode normal
printf("Mode normal\n");
getch();
return EXIT_SUCCESS;
}
void setMode(UCHAR mode)
{
union REGS in, out; // Deklarasi variabel
in.h.ah = 0x00; // Register AH = 0
in.h.al = mode; // Register AL = mode
int86(VIDEO_INT, &in, &out); // Jalankan interupsi
return;
}
Gambarnya Sebagai Berikut :
Penjelasannya :
Sebagai contoh, berikut ini adalah program untuk memilih mode video 01
heksadesimal (16 warna, 25 baris dan 40 kolom) kemudian mengembalikannya menjadi mode
video normal menggunakan fungsi int86. Simpan project berikut ini dengan nama
contoh03.ide dan nama file kode program contoh03.cpp.
Pada contoh diatas, setiap terjadi pergantian mode video akan selalu menimbulkanefek clear screen. Bagaimana cara menghilangkan efek clear screen ini? Jawabnya adalah
dengan menset bit ke-7 pada register AL menjadi 1. Berikut ini adalah contoh yang sama
seperti pada contoh03.cpp, namun bit ke-7 pada register AL akan diset menjadi 1 dan
menggunakan teknik inline assembly
Senin, 20 Juni 2016
Langganan:
Posting Komentar (Atom)
About Me
Diberdayakan oleh Blogger.
Popular Posts
-
#include <math.h> #include <stdlib.h> #include "screen.cpp" #include "keyboard.cpp" int main(void) { Screen ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_F1 0x3b /* Kode sc...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char void getCursorP...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 void getMode(union...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char v...
-
#include <stdlib.h> #include "screen.cpp #define KEY_INT 0x16 /* Nomor interupsi keyboard */ UCHAR getKey(void); int main(void) ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_BACKSPACE 0x08 /* ...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsi...
-
#include <math.h> /* Deklarasi prototype atof */ #include <stdlib.h> /* Deklarasi prototype gcvt */ #include "screen.cpp...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 // Nomor interupsi...
Formulir Kontak
Subscribe Here
Ad Home
Random Posts
Recent Posts
Recent
Header Ads
Popular Posts
-
#include <math.h> #include <stdlib.h> #include "screen.cpp" #include "keyboard.cpp" int main(void) { Screen ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_F1 0x3b /* Kode sc...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char void getCursorP...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 void getMode(union...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char v...
-
#include <stdlib.h> #include "screen.cpp #define KEY_INT 0x16 /* Nomor interupsi keyboard */ UCHAR getKey(void); int main(void) ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_BACKSPACE 0x08 /* ...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsi...
-
#include <math.h> /* Deklarasi prototype atof */ #include <stdlib.h> /* Deklarasi prototype gcvt */ #include "screen.cpp...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 // Nomor interupsi...
Flickr
Newsletter
Subscribe Our Newsletter
Enter your email address below to subscribe to our newsletter.
Ad Banner
About Us
Random Posts
Popular Posts
-
#include <math.h> #include <stdlib.h> #include "screen.cpp" #include "keyboard.cpp" int main(void) { Screen ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_F1 0x3b /* Kode sc...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char void getCursorP...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 void getMode(union...
-
#include <conio.h> #include <dos.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsigned char v...
-
#include <stdlib.h> #include "screen.cpp #define KEY_INT 0x16 /* Nomor interupsi keyboard */ UCHAR getKey(void); int main(void) ...
-
#include <stdlib.h> #include "screen.cpp" #define KEY_INT 0x16 /* Nomor interupsi keyboard */ #define KEY_BACKSPACE 0x08 /* ...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 #define UCHAR unsi...
-
#include <math.h> /* Deklarasi prototype atof */ #include <stdlib.h> /* Deklarasi prototype gcvt */ #include "screen.cpp...
-
#include <conio.h> #include <dos.h> #include <stdio.h> #include <stdlib.h> #define VIDEO_INT 0x10 // Nomor interupsi...
Blog Archive
-
▼
2016
(30)
-
▼
Juni
(30)
- Contoh 27 (Coding) dan Gambarnya
- Contoh Mouse.cpp (Coding)
- Contoh 26 (Coding) dan Gambarnya
- Contoh 25 (Coding) dan Gambarnya
- Contoh 24 (Coding) dan Gambarnya
- Contoh 23 (Coding) dan Gambarnya
- Contoh 22 (Coding) dan Gambarnya
- Contoh 21 (Coding) dan Gambarnya
- Contoh 20 (Coding) dan Gambarnya
- Contoh 19 (Coding) dan Gambarnya
- Contoh 18 (Coding) dan Gambarnya
- Contoh 17 (Coding) dan Gambarnya
- Contoh Keyboard.cpp (Coding)
- Contoh 16 (Coding) dan Gambarnya
- Contoh 15 (Coding) dan Gambarnya
- Contoh 14 (Coding) dan Gambarnya
- Contoh 13 (Coding) dan Gambarnya
- Contoh 12 (Coding) dan Gambarnya
- Contoh 11 (Coding) dan Gambarnya
- Contoh 10 (Coding) dan Gambarnya
- Contoh Screen.cpp (Coding)
- Contoh 9 (Coding) dan Gambarnya
- Contoh 8 (Coding) dan Gambarnya
- Contoh 7 (Coding) dan Gambarnya
- Contoh 6 (Coding) dan Gambarnya
- Contoh 5 (Coding) dan Gambarnya
- Contoh 4 (Coding) dan Gambarnya
- Contoh 3 (Coding) dan Gambarnya
- Contoh 2 (Coding) dan Gambarnya
- Contoh 1 (Coding) dan Gambarnya
-
▼
Juni
(30)










0 komentar:
Posting Komentar