mapmef@gdr.bath.ac.uk (M E Fletcher) (09/05/89)
Help! I have a totally inexplicable bug. When running the below program, the variable i should be printed out as 0,0,1,1,2,2,3,3 etc, but quickly gets assigned weird values in region of 24000. Sorry about the mass of surrounding program, but this was smallest subset of my program I could get which still produced the bug. It looks weird due to cutting down, I already know that I havent initialised those arrays etc.! Does anyone have any explanation about this? Matthew Fletcher, University of Bath, England mapmef@uk.ac.bath.gdr #include <stdio.h> #include <bios.h> static unsigned acc[18],residue[9],modulo[9],secret[9]; main() {long *timeptr; int i; unsigned status; i=0; while (i!=9) {modulo[i]=residue[i]; i++;} _bios_serialcom(_COM_INIT,0,_COM_CHR8 |_COM_NOPARITY|_COM_9600|_COM_STOP1); i=0; while (i!=9) {do {status=_bios_serialcom(_COM_SEND,0,(modulo[i] & 0xff00)/256); printf("%x %d\n",status,i); } while (status & 0x0000); do {status=_bios_serialcom(_COM_SEND,0,modulo[i] & 0x00ff); printf("%x %d\n",status,i);} while (status & 0x0000); i++; } }
gwyn@smoke.BRL.MIL (Doug Gwyn) (09/06/89)
In article <1989Sep5.144722.27495@gdt.bath.ac.uk> mapmef@gdr.bath.ac.uk (M E Fletcher) writes: >Help! I have a totally inexplicable bug. ... >Does anyone have any explanation about this? How could they?