Section courante

A propos

Section administrative du site

Assembleur SuperH

DIV1

SuperH Divide 1 Step

Syntaxe

DIV1 Rm,Rn

Description

Cette instruction permet d'effectuer une division d'un bit d'un registre générale de 32 bits du dividende par le diviseur.

Algorithme

MODULE DIV1(m,n) * DIV1 Rm,Rn
   old_q ← Q
   Q ← (unsigned char)(80000000h ∩ R[n]) ≠ 0
   R[n] ← R[n] << 1
   R[n] ← R[n] U (unsigned long)T
   EVALUER CAS old_q
      CAS 0
         EVALUER CAS M
            CAS 0
               tmp0 ← R[n]
               R[n] ← R[n] - R[m]
               tmp1 ← R[n] > tmp0
               EVALUER CAS Q
                  CAS 0
                     Q ← tmp1
                  CAS 1
                     Q ← (unsigned char) tmp1 = 0
               FIN EVALUER CAS
            CAS 1
               tmp0 ← R[n]
               R[n] ← R[n] + R[m]
               tmp1 ← R[n] < tmp0
               EVALUER CAS Q
                  CAS 0
                     Q ← (unsigned char) tmp1 = 0
                  CAS 1
                     Q ← tmp1
               FIN EVALUER CAS
         FIN EVALUER CAS
      CAS 1
         EVALUER CAS M
            CAS 0
               tmp0 ← R[n]
               R[n] ← R[n] + R[m]
               tmp1 ← R[n] < tmp0
               EVALUER CAS Q
                  CAS 0
                     Q ← tmp1
                  CAS 1
                     Q ← (unsigned char) tmp1 = 0
               FIN EVALUER CAS
            CAS 1
               tmp0 ← R[n]
               R[n] ← R[n] - R[m]
               tmp1 ← R[n] > tmp0
               EVALUER CAS Q
                  CAS 0
                     Q ← (unsigned char) tmp1 = 0
                  CAS 1
                     Q ← tmp1
               FIN EVALUER CAS
         FIN EVALUER CAS
   FIN EVALUER CAS
   T ← Q = M
   PC ← PC + 2

Mnémonique

Instruction Abstrait Opcode Cycle
DIV1 Rm,Rn 1 saut la division (Rn ÷ Rm) 0011nnnnmmmm0100 1


Dernière mise à jour : Mardi, le 28 juillet 2015