The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

This moment's ARGH... WTF??? by MrTrick 2007-08-08 21:23:38
Contrary to what I learned in primary school, 12 - 1 = 5.
At least that's what my microcontroller thinks.

For some bizarro reason, the order of arguments is in reverse. For instance, if you want to subtract 0x10 from 0xC0, this:

movlw    0xC0   ; foo = 0xC0
movwf    foo
...
movfw    foo    ; Put foo into the W register,
sublw    0x10   ; and subtract 0x10 from it.
Ends up with 0x50 in the W register.
You have to do it like this:
movlw    0x10 
subwf    foo

[ Reply ]
  No that is correct by Karl-Henrik2007-08-09 00:04:36

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)