Ada errorr.....help
3 posters
Page 1 of 1
Ada errorr.....help
- Code:
/* Feeling Blue */
#include <stdio.h>
#include <dos.h>
#define VIDEO 0x10
#define BLUE 0x1F
void dcolor(char ch,unsigned char color);
void main()
{
char *text="Am I Blue?";
unsigned char x;
while(*text)
{
dcolor(*text,BLUE);
text++;
}
putchar('\n');
} <---- error
void dcolor(char ch,unsigned char color)
{
union REGS regs;
int x,y;
/* First,read the cursor */
regs.h.ah=0x03; //Read cursor
regs.h.ah=0x00; //"page"
int86(VIDEO,®s,®s);
y=regs.h.dl; //save Y pos.
x=regs.h.dh; //save X pos.
/* Now,write the color char */
regs.h.ah=0x09; //Write color
regs.h.al=ch; //character
regs.h.bh=0x00; //"page"
regs.h.bl=color; //count
int86(VIDEO,®s,®s);
/* Move the cursor forward one notch */
y++;
/* Reset the cursor's position(locate()) */
regs.h.ah=0x02; //Move cursor
regs.h.bh=0x00; //"page"
regs.h.dh=x; //row
reg.h.dl=y; //coloumn
int86(VIDEO,®s,®s);
}
Tolong kalo ada yang bisa....maklum lagie belajar neh, tutornya gak ada.
gearboxxx
g34rboxxx- Admin
- Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo
Re: Ada errorr.....help
itu udah kombinasi antara C++ ma assembly yah... keren...
1. void main() <= diganti sama int main(), or pake main() doank, tapi gak yakin juga seh...
2. } <---- error <= coba tambah double slash jadi } // <---- error, or buang ajah tanda panah sama tulisan errornya
3. tambahin int int86(int ivec, union REGS *in, union REGS *out); setelah baris #define BLUE 0x1F
4. tambah s di baris ke3 dari terakhir, reg.h.dl=y; menjadi regs.h.dl=y;
jadi kalo boleh di ubah jadinya:
coba deh di compile, error atau enggak??? kalo di tempat gw seh, masih tetep error.
errornya ada di baris 21. si compiller bilang kalo "aggregate 'REGS regs' has incomplete type and cannot defined". bingung juga gak tau kenapa errornya. iseng buka" file dos.h ternyata gak ada deklarasi buat 'REGS' nya. padahal kalo diliat dari reverensi yang ada harusnya didalem file dos.h ada deklarasi:
tapi dos.h yg punya gw gak ada, aneh...
yang pokoknya intinya masih ada 1 error lage
tapi cobain ajah, kali ajah di komputer laen bisa jalan
1. void main() <= diganti sama int main(), or pake main() doank, tapi gak yakin juga seh...
2. } <---- error <= coba tambah double slash jadi } // <---- error, or buang ajah tanda panah sama tulisan errornya
3. tambahin int int86(int ivec, union REGS *in, union REGS *out); setelah baris #define BLUE 0x1F
4. tambah s di baris ke3 dari terakhir, reg.h.dl=y; menjadi regs.h.dl=y;
jadi kalo boleh di ubah jadinya:
- Code:
#include <stdio.h>
#include <dos.h>
#define VIDEO 0x10
#define BLUE 0x1F
int int86(int ivec, union REGS *in, union REGS *out);
void dcolor(char ch,unsigned char color);
int main(){
char *text="Am I Blue?";
unsigned char x;
while(*text){
dcolor(*text,BLUE);
text++;
}
putchar('\n');
}
void dcolor(char ch,unsigned char color){
union REGS regs;
int x,y;
regs.h.ah=0x03;
regs.h.ah=0x00;
int86(VIDEO,®s,®s);
y=regs.h.dl;
x=regs.h.dh;
regs.h.ah=0x09;
regs.h.al=ch;
regs.h.bh=0x00;
regs.h.bl=color;
int86(VIDEO,®s,®s);
y++;
regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=x;
regs.h.dl=y;
int86(VIDEO,®s,®s);
}
coba deh di compile, error atau enggak??? kalo di tempat gw seh, masih tetep error.
errornya ada di baris 21. si compiller bilang kalo "aggregate 'REGS regs' has incomplete type and cannot defined". bingung juga gak tau kenapa errornya. iseng buka" file dos.h ternyata gak ada deklarasi buat 'REGS' nya. padahal kalo diliat dari reverensi yang ada harusnya didalem file dos.h ada deklarasi:
- Code:
Struct WORDREGS
{
unsigned int ax, bx, cx, dx, si, di, cflag;
}
Struct BYTEREGS
{
unsigned char al, ah, bl, bh, cl, ch, dl, dh;
}
union REGS
{
struct WORDREGS x;
struct BYTEREGS h;
}
tapi dos.h yg punya gw gak ada, aneh...
yang pokoknya intinya masih ada 1 error lage
tapi cobain ajah, kali ajah di komputer laen bisa jalan
Last edited by mons on Thu Oct 22, 2009 2:12 am; edited 1 time in total (Reason for editing : biar lebih keren...)
vailo- Posts : 137
Join date : 2009-10-18
Re: Ada errorr.....help
klw nu pke compiler di Geany... errornya Buanyak bener...!!!
yang punya nick nm MOnst U ikut BUgs Finder gx??? Lumayan tuh hadiahnya ....
yang punya nick nm MOnst U ikut BUgs Finder gx??? Lumayan tuh hadiahnya ....
Re: Ada errorr.....help
sinax89 wrote:klw nu pke compiler di Geany... errornya Buanyak bener...!!!
yang punya nick nm MOnst U ikut BUgs Finder gx??? Lumayan tuh hadiahnya ....
gak suka ikut lomba
mase harus banyak belajar saiiah
Last edited by monstm on Sun Nov 01, 2009 5:52 am; edited 1 time in total
vailo- Posts : 137
Join date : 2009-10-18
Re: Ada errorr.....help
[code]
#include <stdio.h>
#include <dos.h>
#define VIDEO 0x10
#define BLUE 0x1F <== apa harus dibuat dulu??
int int86(int ivec, union REGS *in, union REGS *out);
void dcolor(char ch,unsigned char color);
int main(){
char *text="Am I Blue?";
unsigned char x;
while(*text){
dcolor(*text,BLUE);
text++;
}
putchar('\n');
} <== selalu error
void dcolor(char ch,unsigned char color){
union REGS regs;
int x,y;
regs.h.ah=0x03;
regs.h.ah=0x00;
int86(VIDEO,®s,®s);
y=regs.h.dl;
x=regs.h.dh;
regs.h.ah=0x09;
regs.h.al=ch;
regs.h.bh=0x00;
regs.h.bl=color;
int86(VIDEO,®s,®s);
y++;
regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=x;
regs.h.dl=y;
int86(VIDEO,®s,®s);
}
[code]
Dah om compile hasilnya 17 errornya....kalo yang om punya cuman 1 errornya. Oh ya mungkin karena on compile di c++ ver 5.02 kali yeee. Tapi harusnya gak bgitu ngaruh. Atau kita musti buat file "#define" dulu.....
Ayo yang lain bantuuuuuuuuuuuuin.......biar sama-sama bljar....
gearboxxx
#include <stdio.h>
#include <dos.h>
#define VIDEO 0x10
#define BLUE 0x1F <== apa harus dibuat dulu??
int int86(int ivec, union REGS *in, union REGS *out);
void dcolor(char ch,unsigned char color);
int main(){
char *text="Am I Blue?";
unsigned char x;
while(*text){
dcolor(*text,BLUE);
text++;
}
putchar('\n');
} <== selalu error
void dcolor(char ch,unsigned char color){
union REGS regs;
int x,y;
regs.h.ah=0x03;
regs.h.ah=0x00;
int86(VIDEO,®s,®s);
y=regs.h.dl;
x=regs.h.dh;
regs.h.ah=0x09;
regs.h.al=ch;
regs.h.bh=0x00;
regs.h.bl=color;
int86(VIDEO,®s,®s);
y++;
regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=x;
regs.h.dl=y;
int86(VIDEO,®s,®s);
}
[code]
Dah om compile hasilnya 17 errornya....kalo yang om punya cuman 1 errornya. Oh ya mungkin karena on compile di c++ ver 5.02 kali yeee. Tapi harusnya gak bgitu ngaruh. Atau kita musti buat file "#define" dulu.....
Ayo yang lain bantuuuuuuuuuuuuin.......biar sama-sama bljar....
gearboxxx
g34rboxxx- Admin
- Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo
Re: Ada errorr.....help
ZZZZZZZZzzzzzzzzz.......
kok bisa beda smua yah???
saiiah pake "devcpp-4.9.9.2-beta"
kok bisa beda smua yah???
saiiah pake "devcpp-4.9.9.2-beta"
vailo- Posts : 137
Join date : 2009-10-18
Re: Ada errorr.....help
Ayo oprek lagie dunks ......keep on rockinn......
gearboxxx
gearboxxx
g34rboxxx- Admin
- Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Mon Mar 20, 2017 9:17 pm by fitch65221023
» Tag Heuer Gets A Taste
Mon Mar 20, 2017 9:11 pm by fitch65221023
» U.s. Remains World's Top Platinum Watch Market
Wed Dec 28, 2016 8:54 pm by fitch65221023
» The U.S. platinum watch market saw some other notable trends
Wed Dec 28, 2016 8:50 pm by fitch65221023
» Do You Love Luxury Panerai Watches?
Wed Dec 28, 2016 8:46 pm by fitch65221023
» Aqua Master Watches for this Christmas Season
Wed Dec 28, 2016 8:40 pm by fitch65221023
» A Guide To Womens Watches: Styles And Types
Thu Nov 10, 2016 9:25 pm by fitch65221023
» Aqua Master Diamond Watches For Women
Thu Nov 10, 2016 9:09 pm by fitch65221023
» A Luxury Watch To Celebrate Achievements
Mon Sep 12, 2016 10:03 pm by fitch65221023