الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعدة فى تصحيح هذه الاكواد بالسي

بدأه الخارقة في 17 يونيو 2012 · 1 رد · 617 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

اخوانى اخواتى خبراء التعامل مع لغة سى احتاج لمساعدة منكم فى تصحيح هذه الاكواد وجعلها تعمل .... لانى حاولت معها دون جدوى ...

الكود الاول

كود:void clrscr(void);void getch(void);main(void){ clrscr(); getch();}void clrscr(void){ asm mov ax, 3 asm int 10h}void getch(void){ asm mov ax, 10 asm int 16h}الكود التانى

كود:#include<dos.h>void clrscr(void);void getch(void);main(void){ clrscr(); getch();}void clrscr(void){ union REGS regs; regs.x.ax = 0x0003; int86(0x0010, &regs, &regs);}void getch(void){ union REGS regs; regs.x.ax = 0x0010; int86(0x0016, &regs, &regs);}الكود التالت

كود:#include<dos.h>void putch(char ch);void clrscr(void);void getch(void);main(void){ clrscr(); putch('H'); putch('e'); putch('l'); putch('l'); putch('o'); putch(10); /*New Line (ASCII)*/ putch(13); /*Return Carriage (ASCII)*/ getch();}void printch(char ch){ union REGS inregs, outregs; inregs.h.ah = 0x0002; inregs.h.dl = ch; intdos(&inregs, &outregs);/*Or int86(0x0021, &inregs, &outregs);*/} void clrscr(void){ union REGS inregs, outregs; inregs.x.ax = 0x0003; int86(0x0010, &inregs, &outregs);}void getch(void){ union REGS regs; regs.x.ax = 0x0010; int86(0x0016, &regs, &regs);الكود الرابع

كود:void gotoxy(int x, int y){ union REGS inregs, outregs; inregs.h.ah = 0x02; inregs.h.bh = 0x00; inregs.h.dh = y; inregs.h.dl = x; int86(0x0010, &inregs, &outregs);}void getxy(int *x, int *y){ union REGS inregs, outregs; inregs.h.ah = 0x03; inregs.h.bh = 0x00; int86(0x0010, &inregs, &outregs); *x = outregs.h.dl; *y = outregs.h.dh;}void clrscr(void){ int i; for(i=0;i<25;i++) printf("\n"); gotoxy(0, 0);}void putc(char ch, int color){ union REGS inregs, outregs; inregs.h.ah = 0x09; inregs.h.al = ch; inregs.h.bh = 0x00; inregs.h.bl = color; inregs.x.cx = 0x0001; int86(0x0010, &inregs, &outregs);}void puts(char *str, int color){ union REGS regs; int getx; regs.h.ah = 0x03; regs.h.bh = 0x00; int86(0x0010, &regs, &regs);getx = regs.h.dl; while(*str){ putc(*str++, color); regs.h.ah = 0x02; regs.h.bh = 0x00; regs.h.dl = ++getx; int86(0x0010, &regs, &regs); }}اتمنى منكم مساعدة سريعة لانه عندى امتحان فاينل ولازم نقراهم بعد التنفيد ...

وشكرا جزيلا لكم

مصدر الموضوع الى خبراء لغة السى ... طلب بسط - منتديات الهندسة نت http://www.alhandasa...1#ixzz1y0AnAoFZ

New Text Document.txt

تم تعديل هذه المشاركة بواسطة الخارقة في 17 يونيو 2012 في 02:37

#2

بعض التنظيم للكود قد يساعد في الحل ...

الكود الاول

كود:

void clrscr(void);
void getch(void);
main(void)
{
 clrscr();
 getch();
 }
 void clrscr(void)
 {
 asm mov ax, 3 
 asm int 10h
 }
 void getch(void)
 {
 asm mov ax, 10 
 asm int 16h
 }

الكود التانى

كود:

#include<dos.h>
void clrscr(void);
void getch(void);
main(void)
{
 clrscr();
 getch();
 }
 void clrscr(void)
 {
 union REGS regs;
 regs.x.ax = 0x0003;
 int86(0x0010, &regs, &regs);
 }
 void getch(void)
 {
 union REGS regs;
 regs.x.ax = 0x0010;
 int86(0x0016, &regs, &regs);
 }

الكود التالت

كود:

#include<dos.h>
void putch(char ch);
void clrscr(void);
void getch(void);
main(void)
{
 clrscr();
 putch('H');
 putch('e');
 putch('l');
 putch('l');
 putch('o');
 putch(10);
 /*New Line (ASCII)*/ putch(13);
 /*Return Carriage (ASCII)*/ getch();}
 void printch(char ch)
 { union REGS inregs, outregs;
 inregs.h.ah = 0x0002;
 inregs.h.dl = ch;
 intdos(&inregs, &outregs);
 /*Or int86(0x0021, &inregs, &outregs);*/
 } 
 void clrscr(void)
 { union REGS inregs, outregs;
 inregs.x.ax = 0x0003;
 int86(0x0010, &inregs, &outregs);
 }
 void getch(void){
 union REGS regs;
 regs.x.ax = 0x0010;
 int86(0x0016, &regs, &regs);

الكود الرابع

كود:

void gotoxy(int x, int y)
{ 
union REGS inregs, outregs;
 inregs.h.ah = 0x02;
 inregs.h.bh = 0x00;
 inregs.h.dh = y;
 inregs.h.dl = x;
 int86(0x0010, &inregs, &outregs);
 }
 void getxy(int *x, int *y)
 {
 union REGS inregs, outregs;
 inregs.h.ah = 0x03;
 inregs.h.bh = 0x00;
 int86(0x0010, &inregs, &outregs);
 *x = outregs.h.dl;
 *y = outregs.h.dh;
 }
 void clrscr(void)
 {
 int i;
 for(i=0;i<25;i++)
 printf("\n");
 gotoxy(0, 0);
 }
 void putc(char ch, int color)
 {
 union REGS inregs, outregs;
 inregs.h.ah = 0x09;
 inregs.h.al = ch;
 inregs.h.bh = 0x00;
 inregs.h.bl = color;
 inregs.x.cx = 0x0001;
 int86(0x0010, &inregs, &outregs);
 }
 void puts(char *str, int color)
 {
 union REGS regs;
 int getx;
 regs.h.ah = 0x03;
 regs.h.bh = 0x00;
 int86(0x0010, &regs, &regs);
 getx = regs.h.dl;
 while(*str)
 {
 putc(*str++, color);
 regs.h.ah = 0x02;
 regs.h.bh = 0x00;
 regs.h.dl = ++getx;
 int86(0x0010, &regs, &regs);
 }
 }

تم تعديل هذه المشاركة بواسطة مصطفى 36a2 في 19 يونيو 2012 في 19:34

مواضيع مشابهة