Академический Документы
Профессиональный Документы
Культура Документы
Arithmetic Instructions
Unsigned numbers are defined as data in which all the bits are used to represent data
Addition of unsigned numbers ADDLW k ADDWF fileReg, d, a ADDWFC (adding two 16-bit numbers) Flags that could affect are C, DC, Z, N or OV.
16 Bit Addition.
Addition of 3CE7H + 3B8DH When the first byte is added, there is a carry (E7 + 8D = 74, CY = 1). The Carry is propagated to the higher byte, which results in 3C + 3B + 1 = 78.
16 Bit Addition.
There is no single instruction for the division of byte/byte numbers. You need to write a program
Repeated subtraction The numerator is place in a fileReg Denominator is subtracted from it repeatedly The quotient is the number of times we subtracted The reminder is in fileReg upon completion
Complement Instructions
COMF FileReg,d
NEGF FileReg
Example
Compare Instructions
Rotate instruction