Society of Robots - Robot Forum
Software => Software => Topic started by: mpuvdd on March 25, 2008, 07:42:12 PM
-
Hi everyone,
I read in 123 PIC MCU Experiments For The Evil Genius (a book) that the MPASM Assembler somehow has a built-in calculator. Could anyone tell me how to access and use it, or is it not literally a calculator? To me, and from context, it sounds like something you can literally plug values in and get answers from.
Thanks a lot,
mpuvdd
-
Hi everyone,
I read in 123 PIC MCU Experiments For The Evil Genius (a book) that the MPASM Assembler somehow has a built-in calculator. Could anyone tell me how to access and use it, or is it not literally a calculator? To me, and from context, it sounds like something you can literally plug values in and get answers from.
Thanks a lot,
mpuvdd
MPASM assembler takes the assembly code and makes hex code out of it - thats all it does
I don't know what you are saying about a built-in-calculator
-
Gotch ya ;)
Well thanks again,
mpuvdd
-
Actually, it has a preprocessor that you can use to make look-up tables. I used it for converting the 8 bit Analog To Digital value of a Sharp IR Sensor to a rough distance estimate. Since the Sensor is nonlinear I took some data and did a best fit curve and had the preprocessor generate the table from the function.
-
Really!
So how do you open the table/preprocessor?
-
I used it for converting the 8 bit Analog To Digital value of a Sharp IR Sensor to a rough distance estimate. Since the Sensor is nonlinear I took some data and did a best fit curve and had the preprocessor generate the table from the function.
You can do a similar thing using c, by declaring arrays like:
far rom char[10] = {0x01,0x09,0x05 etc....}
This way it doesnt take up ram space, but you can still access the array table like a normal variable.
As for the original post, there is not a calculator as such built into mpasm. You can load up the mpasmwin.exe for the mpasm suite, but there is no standard calculator. You will notice though that there are several different radix base outputs etc, so it is capable of supporting calculations. Its function is to act like a big calculator
-
OK,
Makes sense,
Thanks again