EECS 203 Mailing List
Re: Copying a register


Re: Copying a register

From: Robert Dick <dickrp_at_avoiding.spam>
Date: Sat May 24 2008 - 23:51:58 CDT

Joseph Teno:
> Hi everyone,
>
> Say I have 00011000 in LED_REG and I want to copy that into, say, MEM_REG.
> They are two different registers on two different ports. How might I go
> about doing this?

I'll answer your question but, from the question, you may be on the wrong
path. If you want to explain more about what you are doing, maybe your
classmates can check the idea and give suggestions.

> movlw LED_REG
> addwf MEM_REG
>
> and
>
> movlw LED_REG

LED_REG is a register, not a literal (like 2). Use movfw.

> movwf MEM_REG
>
> both do not accomplish this, and both registers are already set as outputs
> in init_registers.
>
> Thanks.

Why is MEM_REG an output?

-Robert Dick-
Received on Sat May 24 23:51:58 2008

This archive was generated by hypermail 2.1.8 : Sat Aug 23 2008 - 21:08:11 CDT