Searching \ for '16C84 addressing' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16C
Search entire site for: '16C84 addressing'.

Truncated match.
PICList Thread
'16C84 addressing'
1996\05\03@174240 by Kevin Rhoades

flavicon
face
This is my first project using a 16C84 and it's special function registers
located on page 1 so it is a learning exercise for me.
In the include files (MPASM) for the '84 it lists:

       TRISA EQU H'0085'

Further, the data book says that the direct addressing mode uses only 7 bits
from the opcode and that operations on page 1 require setting RP0=1.

My question is this, why does the file assign the value of 85 to be used
when addressing the TRISA register if the msb is not even used?  Would not a
value of 05 give the same result?

Thanks,...K.R...

1996\05\03@183515 by Andrew Warren

face
flavicon
face
Kevin Rhoades <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> In the include files (MPASM) for the '84 it lists:
>
>         TRISA EQU H'0085'
>
> Further, the data book says that the direct addressing mode uses
> only 7 bits from the opcode and that operations on page 1 require
> setting RP0=1.
>
> My question is this, why does the file assign the value of 85 to be
> used when addressing the TRISA register if the msb is not even used?
> Would not a value of 05 give the same result?

Kevin:

Yes.  In fact, if you use the include file and write:

   MOVWF   TRISA

MPASM will generate code that's equivalent to "MOVWF 005H".  On top
of that, it'll give you a warning that the operand was truncated.

Given this, it seems silly to use the "085H" definition.  Using that
definition, however,

   1.  more accurately depicts what your code's doing, making it
       more self-documenting,
   2.  allows simulators and emulators to track the TRISA
       register, and
   3.  builds character.

There are any number of ways to keep the "truncated" warning
messages from appearing... One of the most straightforward is to
replace instructions like:

   MOVWF   TRISA

with instructions like:

   MOVWF   080H^TRISA

-Andy

Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\05\05@045447 by Robert Lunn

flavicon
picon face
{Quote hidden}

and...

     4.  you can write:

         MOVLW   TRISA
         MOVWF   FSR

         to access the register indirectly.

___Bob

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...