Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gitpyr.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!gitpyr!myke From: myke@gitpyr.UUCP (Myke Reynolds) Newsgroups: net.sources.games,net.sources.bugs Subject: Re: Core Wars (fixes?) Message-ID: <1200@gitpyr.UUCP> Date: Thu, 19-Dec-85 17:39:40 EST Article-I.D.: gitpyr.1200 Posted: Thu Dec 19 17:39:40 1985 Date-Received: Sat, 21-Dec-85 06:11:31 EST References: <469@ucdavis.UUCP> Reply-To: myke@gitpyr.UUCP (Myke Reynolds) Distribution: net Organization: School of ICS, Georgia Tech Lines: 58 Xref: watmath net.sources.games:373 net.sources.bugs:621 Summary: fixes? (at least on our pyramid) >>>>>>>> marks a changed line in rcasm.[ly] in rcasm.l: starting at line 40 -------------------------------------------------------------------------------- {L} { static char bufs[2][LABEL_LEN+1]; auto int len = min(yyleng+1, LABEL_LEN); auto char **ptr; if (orc == 1) ptr = &blabel; else ptr = (toggle ? &blabel : &alabel); strncpy(bufs[toggle], &(yytext[1]), len); bufs[toggle][len] = '\0'; *ptr = bufs[toggle]; toggle = (toggle ? 0 : 1); >>>>>>>> blabel = *ptr; /* ADD THIS! */ return(LABEL); } and in rcasm.y: starting at line 137 -------------------------------------------------------------------------------- word order is reverse on our machine, when you set: $$ = inst.modb = $1; modb is a bit field in inst, so when $1 gets passed though inst, it is put in the wrong place and yyval ($$) gets entirely the wrong value. -------------------------------------------------------------------------------- arga : addr INTEGER /* returns addr */ { >>>>>>>> inst.moda = $$ = $1; inst.arga = $2; } | addr LABEL { >>>>>>>> inst.moda = $$ = $1; inst.arga = getsymval(alabel, 0); } ; argb : addr INTEGER /* returns addr */ { >>>>>>>> inst.modb = $$ = $1; inst.argb = $2; } | addr LABEL { >>>>>>>> inst.modb = $$ = $1; inst.argb = getsymval(blabel, 1); } ; -- Myke Reynolds Office of Telecommunications and Networking Georgia Insitute of Technology, Atlanta Georgia, 30332 ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!myke "Drawing from my fine command of the english language, I said nothing."