# M12

Members

15

## Community Reputation

1 Neutral

• Rank
• Birthday 04/11/1994

• Gender
Male
1. ## Quick Question: Does 7800basic have bit shift operators?

Thanks! And thanks again for letting me know about the 16-bit shift, cause I needed that too.
2. ## Supporting Numbers > 255 and Fixed Numbers with greater precision

Ah yup. I see. I read that x.y notation within the last few days and already forgot about it. Thanks! And your extra precision makes sense, but then I'd have to interpret the numbers in an odd way. I am getting around to not using fixed numbers at all in my program. Take 1.23 for instance. I just store that as the whole number as 123 and interpret it as 1.23. In other words, forget about precision. Instead, I'm focused on making large numbers!
3. ## Supporting Numbers > 255 and Fixed Numbers with greater precision

What do you mean by this?
4. ## Supporting Numbers > 255 and Fixed Numbers with greater precision

Yup, I am attempting to write my special-case code. It's rather tedious. Thanks. And this is definitely helpful. I was using an algorithm known as CORDIC to implement some trigonometry functions. ... But as long as I have the space, I ought to just make a large lookup table for my sine, cosine, and cotangent functions.
5. ## Quick Question: Does 7800basic have bit shift operators?

Does 7800basic have bit shift operators? I can't find them in the documentation here: http://www.randomterrain.com/7800basic.html And if it doesn't, then how would I use the 7800basic "asm" command to write the 6502 assembly code to perform the operation, say, num1 << num2 (logical shift left)? Thanks!

7. ## Supporting Numbers > 255 and Fixed Numbers with greater precision

Does 7800basic have any built-in mechanic to support numbers larger than 255? And does it have support for fixed numbers with greater precision? I've implemented my own multiplication function for fixed numbers, but the division function relies on iterations of the multiplication function, which leads to errors, so I believe I need to be more precise with my calculations and then round at the end. Thanks
8. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

That was it. It works now.
9. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Another thing I just noticed was that even a simple function such as function foo return 0 does not let the game play. It just displays the familiar Atari screen, then it goes to a black screen. I did not even call the function yet. Is there a certain area I should be writing my function declarations?
10. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Ahhh, I see now. And now I also see that you explained this in the earlier post, but I didn't realize. Sorry I didn't catch it then. Thanks a bunch!
11. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Cool. I'll just leave 'end' out then. Thanks. And as for the fixed point. The integer part is represented correctly. I understand BCD as well. But yeah, the fractional parts aren't a representation I'm familiar with. A thing I mentioned previously is that when you do take the fractional parts and add them together, it gets what you'd expect anyway. ... 1.5 (0180) + 7.7 (07B3) = 9.2 (0933) ... note that 80 + B3 = 34 and 34 - 1 = 33 (since 1 is carried), which is the arithmetic for the fractional parts.
12. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Well they are hexadecimal numbers, but I am good with normal hex conversions. If you do the conversion, it is not what you'd expect though. Thanks anyways
13. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Thanks RevEng and ErikM. That cleared up a lot. Mord, your solution worked. I'm not too sure how to deal with functions in 7800 basic. function multiply temp1 = temp1 - 1 temp4 = temp2 for temp3 = 1 to temp1 : temp2 = temp2 + temp4 return temp2 end Whenever I try to compile my code that includes this, it says that 'end' is an "unknown keyword". But this is a keyword according to the 7800basic guide. I also tried making 'end' not have any indentation, but then this resulted in "extraneous end statement found". I also have a question about fixed point numbers. fp1 = 3.5 is for some reason represented as 0380 when I try to display it using the following: plotvalue scoredigits_8_wide 0 fp1 4 x y I am not sure why the decimal part of the number is represented as 80. Whenever I have say the numbers 1.5 and 7.7 (0180 and 07B3), adding them together results in 9.2 (0933). So the representation of the decimal part has some meaning because 80 + B3 = 133 - FF = 34 (not 33 because we carried the 1 over to the integer part). Why are the decimal parts represented like this and how do I convert it to a more familiar representation?
14. ## Assembling .a, .S files; .bas files; Fixed point; Functions; Questions?

Here's another question. I'm going through the source code for BASE78 because it includes the Asteroids code, which I am going to look through further. I had thought that the ".O" files were the machine code files, but when I tried to run the emulator (MESS) on the ".O" files by itself, it didn't work. How do I output the file used by the Atari or emulator from the source code?