Message-ID: <3481152A.F796F31C@www.the-link.net> Date: Sun, 30 Nov 1997 01:26:35 -0600 From: Robert McNulty Reply-To: bobbymcn AT www DOT the-link DOT net MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: general protection fault Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: dialin250.mgm.the-link.net Lines: 112 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I have a problem. I get a "general protection fault at 160a". I can't fund the bug. I ried everything I could. here is the source code. ---------------snip--------------------------------- #include #include #include void SetMode13(); void SlowPutPxl(int x, int y, int color); void SetText(); static int dos_seg, length; static char *string; main() { int x=100, y = 240, color = 5; dos_seg = _go32_conventional_mem_selector(); string = "Hello Bobby"; length = 10; asm (" pushw %es movw _dos_seg, %es movl _string, %esi movl $0xb8000, %edi movw _length, %cx rep ; movsb popw %es "); SetMode13(); SlowPutPxl(x, y, color); } void SetMode13() { dos_seg = _go32_conventional_mem_selector(); asm(" pushw %es movw _dos_seg, %es mov $0x002, %ax movw $0xA0000, %bx int $0x02f xor %ah, %ah mov $0x013, %al int $0x010 movw $0x0A0000, %edi movw %di ,%es xor %di, %di ret "); } void SetText() { asm(" movl $0x003, %ax int $0x10 ret "); } void SlowPutPxl(int x, int y, int color) { dos_seg = _go32_conventional_mem_selector(); asm(" pushw %es movw _dos_seg, %es push %ebp movl %sp, %bp pushw %es pushw %di movw $0xA0000, %ax movw %ax, %es movw %bp+8, %ax movw 320, %cx mul %cx add %bp+6, %ax movw %ax, %di movw %bp+10, %di movw %di, %di popw %di popw %es movw %bp, %sp popw %bp ret "); } ---------nd of program-----