Society of Robots - Robot Forum

Software => Software => Topic started by: mpuvdd on March 25, 2008, 07:42:12 PM

Title: MPASMAssembler
Post 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
Title: Re: MPASMAssembler
Post by: airman00 on March 25, 2008, 07:53:05 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

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
Title: Re: MPASMAssembler
Post by: mpuvdd on March 25, 2008, 08:18:53 PM
Gotch ya  ;)
Well thanks again,
mpuvdd
Title: Re: MPASMAssembler
Post by: JesseWelling on March 25, 2008, 10:53:06 PM
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.
Title: Re: MPASMAssembler
Post by: mpuvdd on March 27, 2008, 09:37:16 AM
Really!
So how do you open the table/preprocessor?
Title: Re: MPASMAssembler
Post by: paulstreats on March 27, 2008, 01:57:41 PM
Quote
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
Title: Re: MPASMAssembler
Post by: mpuvdd on March 27, 2008, 06:00:29 PM
OK,
Makes sense,
Thanks again