# Thread: asm not making sense

1. ## asm not making sense

So I've disassembled a project (PIC16F887), which has this snippet:
Code:
```0x009C        0x081E              MOVF       ADRESH, 0
0x009D        0x00F1              MOVWF      R0+1
0x009E        0x01F0              CLRF       R0
0x009F        0x1683              BSF        STATUS, 5
0x00A1        0x04F0              IORWF      R0, 1
0x00A2        0x3000              MOVLW      0
0x00A3        0x04F1              IORWF      R0+1, 1
0x00A4        0x0008              RETURN```
(Non-bold for context)
The manual states this about MOVLW:
The eight-bit literal ‘k’ is loaded into
W register. The “don’t cares” will
assemble as ‘0’s.
Inclusive OR the W register with
register ‘f’. If ‘d’ is ‘0’, the result is
placed in the W register. If ‘d’ is
‘1’, the result is placed back in
register ‘f’.
(My source)
So, to my understanding, these 2 instructions would result in C code that looks round-about something like
Code:
`R0+1 |= 0;`
And I have to say, that it doesn't make any sense at all why someone would do this. (Note that this is from an optimized library.)

Am I perhaps reading this wrong?

Thanks

2. What does the syntax "R0+1" mean? I doubt it means "The value in R0, plus 1".

3. I assumed it was actually an address (of course, I'm no asm guru, and could be very wrong)
That is, "R0+1" is "R1" or something.
I guess this because, I know in PICs, system registers/variables are simply defs to fixed addresses, so it would make sense that if R0 is already just a pointer or equivalent, adding 1 would be valid.

EDIT: Okay, yeah that looks like that's the deal. Before the 2 instructions in question, ADRESL and ADRESH get put into R0 and R0+1, respectively. The 'L' and 'H' stand for low and high bytes.

4. As it turns out, leaving those instructions out of the new code didn't effect anything (that I can tell). I'm still really confused why those would even be in there, especially since it works fine without them.
Anyway, thanks for the response.