+atari2600land Posted July 9, 2006 Share Posted July 9, 2006 It says in the help file to include the line -include div_mul.asm in order for multiplication to work for variables. But when I assign numbers to variables like in this .bas file, the answer always comes out to be 62 regardless of what I assigned the variables. I'm trying to make a multiplication table for the 2600, and you put in one variable and another and press right for the answer, but it's always 62. Could I have a little help here? numbermenu3.bas Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/ Share on other sites More sharing options...
SeaGtGruff Posted July 9, 2006 Share Posted July 9, 2006 It says in the help file to include the line -include div_mul.asm in order for multiplication to work for variables. But when I assign numbers to variables like in this .bas file, the answer always comes out to be 62 regardless of what I assigned the variables. I'm trying to make a multiplication table for the 2600, and you put in one variable and another and press right for the answer, but it's always 62. Could I have a little help here? I don't have time at the moment to study your code fully, but part of your problem is that you can't use multiplication with the score (at least, it doesn't work that way *yet*). So you'll need to use a variable to do the multiplication, then assign the result to the score, like this: p=n*o : score=p : rem instead of score=n*o Except if I remember correctly from another thread a week or two ago, you can't assign a variable to the score right now, either, because it's broken. Michael Rideout Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098689 Share on other sites More sharing options...
+atari2600land Posted July 9, 2006 Author Share Posted July 9, 2006 (edited) Except if I remember correctly from another thread a week or two ago, you can't assign a variable to the score right now, either, because it's broken. I tried your suggestion and it looks to be broken. I got a message that says "cannot open div.asm for reading" and for the 2600ide, it says: NO_ILLEGAL_OPCODES 0000 ???? ( R ) game 0000 ???? ( R ) scoretable 0000 ???? ( R ) whatever that means. Edited July 9, 2006 by atari2600land Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098703 Share on other sites More sharing options...
djmips Posted July 9, 2006 Share Posted July 9, 2006 62 hmmm.... of by 20 errror. What version of BBasic are you using? The errors that you see, like NO_ILLEGAL_OPCODES are just a side effect of something else going wrong. Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098767 Share on other sites More sharing options...
+atari2600land Posted July 9, 2006 Author Share Posted July 9, 2006 62 hmmm.... of by 20 errror. What version of BBasic are you using? The errors that you see, like NO_ILLEGAL_OPCODES are just a side effect of something else going wrong. Version 3.5, I think. It has a 35 in it somewhere. I just don't remember what the exact version # is at the moment. Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098770 Share on other sites More sharing options...
djmips Posted July 9, 2006 Share Posted July 9, 2006 I got it to work in alpha35 by using the following include div_mul.asm It was the first line in the numbermen3.bas file and it had No Quotes around the file name. Also note the space before the include (important) Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098776 Share on other sites More sharing options...
+atari2600land Posted July 9, 2006 Author Share Posted July 9, 2006 I got it to work in alpha35 by using the following include div_mul.asm It was the first line in the numbermen3.bas file and it had No Quotes around the file name. Also note the space before the include (important) Could you post the .bas file for me so I can see what you did in detail? Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098784 Share on other sites More sharing options...
djmips Posted July 10, 2006 Share Posted July 10, 2006 It was on a different computer that's not on my network at the moment. it was just this: include div_mul.asm 10 set smartbranching on 20 COLUBK=70 : COLUP0=128 25 x=20 : y=20 : n=1 . . . And the remaining code was as you posted. The only change was the first line. When I put include "div_mul.asm" I got the exact same errors as you posted. If you misspell the file or the div_mul.asm isn't in your bbasic folder (or otherwise missing) then you will get the NO_ILLEGAL_OPCODES game and scoretable errors. Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098877 Share on other sites More sharing options...
+atari2600land Posted July 10, 2006 Author Share Posted July 10, 2006 I put the first line include div_mul.asm in and got an error message: (1): Error: Unknown keyword: div_mul.asm Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098905 Share on other sites More sharing options...
djmips Posted July 10, 2006 Share Posted July 10, 2006 (edited) It's hard to see but you need to indent the include statement at least on space. I should have put four or more to make it clear. Sorry. include div_mul.asm edit: Oh yeah, and I forgot that when you post code, the AtariAge forum seems to eat a space, so the above code I posted seems to be missing the aforementioned space! Edited July 10, 2006 by djmips Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098919 Share on other sites More sharing options...
+atari2600land Posted July 10, 2006 Author Share Posted July 10, 2006 Yes, but are all the answers still 62? Because they are on mine. Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1098922 Share on other sites More sharing options...
+batari Posted July 10, 2006 Share Posted July 10, 2006 Yes, but are all the answers still 62? Because they are on mine. I looked at the bB source, and apparently I put in support for score=score+variable but not score=variable. But there is another issue - the score must use a BCD number, but the multiply routines use hexadecimal. So they would need to be converted - the easiest way is in a loop. I went ahead and modified your program. It should work now. numbermenu3.bas Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1099319 Share on other sites More sharing options...
+atari2600land Posted July 10, 2006 Author Share Posted July 10, 2006 How would I tell it that when it's done multiplying to go back to the start if I pressed the reset switch? I thought it would have been 1165 if joy0fire && z=0 then z=1 : goto 1000 if !joy0fire && z=1 then z=0 if joy0right then gosub 1200 if switchreset then goto 20 <- I added this line 1166 goto 1160 but it didn't work. Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1099344 Share on other sites More sharing options...
+atari2600land Posted July 10, 2006 Author Share Posted July 10, 2006 Never mind. I figured it out. Huge thanks go out to Batari for making this program actually work. Here's a (hopefully) final version. multtabl.bas.bin Quote Link to comment https://forums.atariage.com/topic/90384-multiplication-in-batari-basic/#findComment-1099381 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.