Jump to content
IGNORED

Division with Remainder Problem


Fort Apocalypse

Recommended Posts

Hey,

 

I'm doing the following at the top of my bB game:

 

include div_mul16.asm

 

and then at one point I do this:

 

handleroom

temp6 = proom // 10

rem *** remainder (last digit) stored in temp1

if temp1 = 1 then gosub room1

if temp1 = 2 then gosub room2

if temp1 = 3 then gosub room3

if temp1 = 4 then gosub room1

if temp1 = 5 then gosub room2

if temp1 = 6 then gosub room3

if temp1 = 7 then gosub room1

if temp1 = 8 then gosub room2

if temp1 = 9 then gosub room3

if temp1 = 0 then gosub room1

return

 

when compiling I get the following error. Can anyone see what I'm doing wrong? I want to get the remainder of dividing proom by 10 in order to get the last digit of that number (for now it is just as proof of concept).

 

---------- Capture Output ----------

> "C:\Atari2600\bB\2600bas.bat" C:\Atari2600\projects\fmadventure\2padv0.3.bas

2600 Basic compilation complete.

DASM V2.20.07, Macro Assembler ©1988-2003

bytes of ROM space left

--> cycle74_HMCLR f084

914 bytes of ROM space left

914 bytes of ROM space left

914 bytes of ROM space left

--- Unresolved Symbol List

div16 0000 ???? (R )

 

Fatal assembly error: Source is not resolvable.

 

> Terminated with exit code 0.

Link to comment
Share on other sites

I've also tried including both in the top:

 

include div_mul.asm

include div_mul16.asm

 

and then I get the error:

 

---------- Capture Output ----------

> "C:\Atari2600\bB\2600bas.bat" C:\Atari2600\projects\fmadventure\2padv0.3.bas

2600 Basic compilation complete.

DASM V2.20.07, Macro Assembler ©1988-2003

bytes of ROM space left

--> cycle74_HMCLR f084

 

> Terminated with exit code 0.

Link to comment
Share on other sites

Here's the full source

2padv0.3.bas

You need to place includes before anything else. Particularly, if you put them after the "set" directive, they might be ignored. Hmmm.... Maybe I should have the compiler generate a warning instead?

 

Thanks! That was definitely it. Yes, it would be great to have a compiler warning if it's not too hard. The more compilation warnings the better, IMO.

Edited by Fort Apocalypse
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...