IBC forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Latest topics
» Purchasing Tag Heuer Watches on a Budget
Ada errorr.....help Icon_minitimeMon Mar 20, 2017 9:17 pm by fitch65221023

» Tag Heuer Gets A Taste
Ada errorr.....help Icon_minitimeMon Mar 20, 2017 9:11 pm by fitch65221023

» U.s. Remains World's Top Platinum Watch Market
Ada errorr.....help Icon_minitimeWed Dec 28, 2016 8:54 pm by fitch65221023

» The U.S. platinum watch market saw some other notable trends
Ada errorr.....help Icon_minitimeWed Dec 28, 2016 8:50 pm by fitch65221023

» Do You Love Luxury Panerai Watches?
Ada errorr.....help Icon_minitimeWed Dec 28, 2016 8:46 pm by fitch65221023

» Aqua Master Watches for this Christmas Season
Ada errorr.....help Icon_minitimeWed Dec 28, 2016 8:40 pm by fitch65221023

» A Guide To Womens Watches: Styles And Types
Ada errorr.....help Icon_minitimeThu Nov 10, 2016 9:25 pm by fitch65221023

» Aqua Master Diamond Watches For Women
Ada errorr.....help Icon_minitimeThu Nov 10, 2016 9:09 pm by fitch65221023

» A Luxury Watch To Celebrate Achievements
Ada errorr.....help Icon_minitimeMon Sep 12, 2016 10:03 pm by fitch65221023

IBC chat

ShoutMix chat widget
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Ada errorr.....help

3 posters

Go down

Ada errorr.....help Empty Ada errorr.....help

Post  g34rboxxx Tue Oct 20, 2009 12:23 pm

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,&regs,&regs);
 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,&regs,&regs);

 /* 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,&regs,&regs);

}


Tolong kalo ada yang bisa....maklum lagie belajar neh, tutornya gak ada.


gearboxxx Laughing
g34rboxxx
g34rboxxx
Admin

Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  vailo Thu Oct 22, 2009 2:09 am

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:
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,&regs,&regs);
 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,&regs,&regs);

 y++;

 regs.h.ah=0x02;
 regs.h.bh=0x00;
 regs.h.dh=x;
 regs.h.dl=y;
 int86(VIDEO,&regs,&regs);
}

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

Sad tapi cobain ajah, kali ajah di komputer laen bisa jalan Laughing


Last edited by mons on Thu Oct 22, 2009 2:12 am; edited 1 time in total (Reason for editing : biar lebih keren...)
vailo
vailo

Posts : 137
Join date : 2009-10-18

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  sinax89 Thu Oct 22, 2009 7:13 am

klw nu pke compiler di Geany... errornya Buanyak bener...!!!

yang punya nick nm MOnst U ikut BUgs Finder gx??? Lumayan tuh hadiahnya .... Twisted Evil Laughing
sinax89
sinax89
Admin

Posts : 72
Join date : 2009-10-13
Age : 34
Location : Bekasi

https://ibc-forum.forumotion.com

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  vailo Thu Oct 22, 2009 1:04 pm

sinax89 wrote:klw nu pke compiler di Geany... errornya Buanyak bener...!!!

yang punya nick nm MOnst U ikut BUgs Finder gx??? Lumayan tuh hadiahnya .... Twisted Evil Laughing

gak suka ikut lomba afro
mase harus banyak belajar saiiah study


Last edited by monstm on Sun Nov 01, 2009 5:52 am; edited 1 time in total
vailo
vailo

Posts : 137
Join date : 2009-10-18

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  g34rboxxx Thu Oct 22, 2009 3:10 pm

[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,&regs,&regs);
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,&regs,&regs);

y++;

regs.h.ah=0x02;
regs.h.bh=0x00;
regs.h.dh=x;
regs.h.dl=y;
int86(VIDEO,&regs,&regs);
}
[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
g34rboxxx
Admin

Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  vailo Thu Oct 22, 2009 3:37 pm

ZZZZZZZZzzzzzzzzz.......

kok bisa beda smua yah???
saiiah pake "devcpp-4.9.9.2-beta"
vailo
vailo

Posts : 137
Join date : 2009-10-18

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  g34rboxxx Thu Oct 22, 2009 3:59 pm

Ayo oprek lagie dunks ......keep on rockinn...... lol! lol!


gearboxxx
g34rboxxx
g34rboxxx
Admin

Posts : 250
Join date : 2009-10-19
Age : 47
Location : Tebak hayooo

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  vailo Thu Oct 22, 2009 11:30 pm

Well.. udah nemu neh, jawabannya kenapa revisi punya gw ma punya yang laen beda...

penjelasan pertama ada di link ini, dan penjelasan kedua ada di link ini

itu ngejelasin kenapa hasil revisi gw yang pake devcpp-4.9.9.2-beta punya hasil yang berbeda sama yang laen...
maaf yak.... afro afro study
vailo
vailo

Posts : 137
Join date : 2009-10-18

Back to top Go down

Ada errorr.....help Empty Re: Ada errorr.....help

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum