Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn MUL.AB #-1, #-1 produce +1 for large core sizes?

core large
0
Posted

Why doesn MUL.AB #-1, #-1 produce +1 for large core sizes?

0

Remember, numbers in Core War are always positive; -1 is really just another way of writing CORESIZE-1. So, anytime the core size is greater than 2^16 (=65536), -1 times -1 will overflow the 32-bit numbers that CoreWin uses, and the results will not be what you expect. In general, you need to be careful using the MUL instruction when you are writing warriors for large core sizes.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123