Renesas Renasas Single-Chip Microcomputer SH7086 Manual de usuario Pagina 294

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 308
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 293
Q&A-6
CPU
Q
A
What is the difference between the DIV instruction and the DIVX instruction?
Either of the DIV instruction and the DIVX instruction is an instruction for signed division, the sign of
the remainder is different.
The sign of the remainder left after the DIV instruction is the same as that of the dividend, on the
contrary, the sign of the remainder of the DIVX instruction is the same as that of the divisor.
In general, the following relation among quotient, divisor, dividend, and remainder holds.
dividend = divisor quotient + remainder
Since the sign of the remainder is different between these instructions, the quotient obtained either
by dividing a positive integer by a negative integer or by dividing a negative integer by a positive
integer using the DIV instruction is different from that obtained using the DIVX instruction.
For example, dividing 10 by 3 using the DIV instruction yields 3 and leaves +1, while doing the
same using the DIVX instruction yields 4 and leaves 2.
Dividing 10 by +3 using the DIV instruction yields 3 and leaves 1, while doing the same using the
DIVX instruction yields 4 and leaves +2.
Vista de pagina 293
1 2 ... 289 290 291 292 293 294 295 296 297 298 299 ... 307 308

Comentarios a estos manuales

Sin comentarios