trennonix New Member Jun 15, 2009 #1 Hello everybody, I'm programming a pic in assembly, and i want to substract one value from another, but of them are situated in general purpose registers, so how do i get one of those values into W??? when i try movlw var, W will have the value of the address of the register
Hello everybody, I'm programming a pic in assembly, and i want to substract one value from another, but of them are situated in general purpose registers, so how do i get one of those values into W??? when i try movlw var, W will have the value of the address of the register
Nigel Goodwin Super Moderator Most Helpful Member Jun 15, 2009 #2 'l' is literal, 'f' is file - so you need 'movfw var'.
blueroomelectronics Well-Known Member Jun 15, 2009 #4 Which PIC, the 18F have a proper subtract instruction, the 16F have a funky one. The movlw instruction will move a literal into W **broken link removed**
Which PIC, the 18F have a proper subtract instruction, the 16F have a funky one. The movlw instruction will move a literal into W **broken link removed**
trennonix New Member Jun 15, 2009 #5 aaaaaaaahhh, thanks alot, i didn't even know that this function existed, i was limited to movwf and movlw btw, blueroomelectronics, i'm using a 16f
aaaaaaaahhh, thanks alot, i didn't even know that this function existed, i was limited to movwf and movlw btw, blueroomelectronics, i'm using a 16f
blueroomelectronics Well-Known Member Jun 15, 2009 #6 The subtract instruction is an odd bird in the 16F http://www.brouhaha.com/~eric/pic/subtract.html
trennonix New Member Jun 15, 2009 #7 thanks blueroomelectronics, i knew that, i just wanted to get a value from a register to W. The movwf worked just fine
thanks blueroomelectronics, i knew that, i just wanted to get a value from a register to W. The movwf worked just fine