Section courante

A propos

Section administrative du site

Assembleur SuperH

MOV

SuperH Move Data

Syntaxe

MOV Rm,Rn
MOV.B Rm,@Rn
MOV.W Rm,@Rn
MOV.L Rm,@Rn
MOV.B @Rm,Rn
MOV.W @Rm,Rn
MOV.L @Rm,Rn
MOV.B Rm,@-Rn
MOV.W Rm,@-Rn
MOV.L Rm,@-Rn
MOV.B @Rm+,Rn
MOV.W @Rm+,Rn
MOV.L @Rm+,Rn
MOV.B Rm,@(R0,Rn)
MOV.W Rm,@(R0,Rn)
MOV.L Rm,@(R0,Rn)
MOV.B @(R0,Rm),Rn
MOV.W @(R0,Rm),Rn
MOV.L @(R0,Rm),Rn
MOV #imm,Rn
MOV.W @(disp,PC),Rn
MOV.L @(disp,PC),Rn
MOV.B @(disp,GBR),R0
MOV.W @(disp,GBR),R0
MOV.L @(disp,GBR),R0
MOV.B R0,@(disp,GBR)
MOV.W R0,@(disp,GBR)
MOV.L R0,@(disp,GBR)
MOV.B R0,@(disp,Rn)
MOV.W R0,@(disp,Rn)
MOV.L Rm,@(disp,Rn)
MOV.B @(disp,Rm),R0
MOV.W @(disp,Rm),R0
MOV.L @(disp,Rm),Rn

Description

Cette instruction permet de transférer l'opérande source ou une valeur immédiate dans l'opérande de destination.

Algorithme

MODULE MOV(m,n) * MOV Rm,Rn
   R[n] ← R[m]
   PC ←PC + 2

MODULE MOVBS(m,n) * MOV.B Rm,@Rn
   Write_Byte(R[n],R[m])
   PC ← PC + 2

MODULE MOVWS(m,n) * MOV.W Rm,@Rn
   Write_Word(R[n],R[m])
   PC ← PC + 2

MODULE MOVLS(m,n) * MOV.L Rm,@Rn
   Write_Long(R[n],R[m])
   PC ← PC + 2

MODULE MOVBL(m,n) * MOV.B @Rm,Rn
   R[n] ← (long)Read_Byte(R[m])
   SI R[n] ∩ 80h = 0 ALORS
      R[n] ← R[n] ∩ 000000FFh
   SINON
      R[n] ← R[n] U FFFFFF00h
   FIN SI
   PC ← PC + 2

MODULE MOVWL(m,n) * MOV.W @Rm,Rn
   R[n] ← (long)Read_Word(R[m])
   SI R[n] ∩ 8000h = 0 ALORS
      R[n] ∩ 0000FFFFh
   SINON
      R[n] ← R[n] U FFFF0000h
   FIN SI
   PC ← PC + 2

MODULE MOVLL(m,n) * MOV.L @Rm,Rn
   R[n] ← Read_Long(R[m])
   PC ← PC + 2

MODULE MOVBM(m,n) * MOV.B Rm,@-Rn
   Write_Byte(R[n]-1,R[m])
   R[n] ← R[n] - 1
   PC ← PC + 2

MODULE MOVWM(m,n) * MOV.W Rm,@-Rn
   Write_Word(R[n]-2,R[m])
   R[n] ← R[n] - 2
   PC ← PC + 2

MODULE MOVLM(m,n) * MOV.L Rm,@-Rn
   Write_Long(R[n]-4,R[m])
   R[n] ← R[n] - 4
   PC ← PC + 2

MODULE MOVBP(m,n) * MOV.B @Rm+,Rn
   R[n] ← (long)Read_Byte(R[m])
   SI R[n]∩ 80h = 0 ALORS
      R[n] ← R[n] ∩ 000000FFh
   SINON
      R[n] ← R[n] U FFFFFF00h
   FIN SI
   SI n ≠ m ALORS
      R[m] ← R[m] + 1
   FIN SI
   PC ← PC + 2

MODULE MOVWP(m,n) * MOV.W @Rm+,Rn
   R[n] ← (long)Read_Word(R[m])
   SI R[n] ∩ 8000h = 0 ALORS
      R[n] ← R[n] ∩ 0000FFFFh
   SINON
      R[n] ← R[n] U FFFF0000h
   FIN SI
   SI n ≠ m ALORS
      R[m] ← R[m] + 2
   FIN SI
   PC ← PC + 2

MODULE MOVLP(m,n) * MOV.L @Rm+,Rn
   R[n] ← Read_Long(R[m])
   SI n ≠ m ALORS
      R[m] ← R[m] + 4
   FIN SI
   PC ← PC + 2

MODULE MOVBS0(m,n) * MOV.B Rm,@(R0,Rn)
   Write_Byte(R[n]+R[0],R[m])
   PC ← PC + 2

MODULE MOVWS0(m,n) * MOV.W Rm,@(R0,Rn)
   Write_Word(R[n]+R[0],R[m])
   PC ← PC + 2

MODULE MOVLS0(m,n) * MOV.L Rm,@(R0,Rn)
   Write_Long(R[n]+R[0],R[m])
   PC ← PC + 2

MODULE MOVBL0(m,n) * MOV.B @(R0,Rm),Rn
   R[n] ← (long)Read_Byte(R[m]+R[0])
   SI R[n] ∩ 80h = 0 ALORS
      R[n] ← R[n] ∩ 000000FFh
   SINON
      R[n] ← R[n] U FFFFFF00h
   FIN SI
   PC ← PC + 2

MODULE MOVWL0(m,n) * MOV.W @(R0,Rm),Rn
   R[n] ← (long)Read_Word(R[m]+R[0])
   SI R[n] ∩ 8000h = 0 ALORS
      R[n] ← R[n] ∩ 0000FFFFh
   SINON
      R[n] ← R[n] U FFFF0000h
   FIN SI
   PC ← PC + 2

MODULE MOVLL0(m,n) * MOV.L @(R0,Rm),Rn
   R[n] ← Read_Long(R[m]+R[0])
   PC ← PC + 2

MODULE MOVI(i,n) * MOV #imm,Rn
   SI i ∩ 80h = 0 ALORS
      R[n] ← (000000FFh ∩ (long)i)
   SINON
      R[n] ← (FFFFFF00h U (long)i)
   FIN SI
   PC ← PC + 2

MODULE MOVWI(d,n) * MOV.W @(disp,PC),Rn
   disp ← (000000FFh ∩ (long)d)
   R[n] ← (long)Read_Word(PC+(disp << 1))
   SI R[n] ∩ 8000h = 0 ALORS
      R[n] ← R[n] ∩ 0000FFFFh
   SINON
      R[n] ← R[n] U FFFF0000h
   FIN SI
   PC ← PC + 2

MODULE MOVLI(d,n) * MOV.L @(disp,PC),Rn
   disp ← (000000FFh ∩ (long)d)
   R[n] ← Read_Long((PC ∩ FFFFFFFCh)+(disp << 2))
   PC ← PC + 2

MODULE MOVBLG(d) * MOV.B @(disp,GBR),R0
   disp ← (000000FFh ∩ (long)d)
   R[0] ← (long)Read_Byte(GBR + disp)
   SI R[0] ∩ 80h =0 ALORS
      R[0] ← R[0] ∩ 000000FFh
   SINON
      R[0] ← R[0] U FFFFFF00h
   FIN SI
   PC ← PC + 2

MODULE MOVWLG(d) * MOV.W @(disp,GBR),R0
   disp ← (000000FFh ∩ (long)d)
   R[0] ← (long)Read_Word(GBR + (disp << 1))
   SI R[0] ∩ 8000h = 0 ALORS
      R[0] ← R[0] ∩ 0000FFFFh
   SINON
      R[0] ← R[0] U FFFF0000h
   FIN SI
   PC ← PC + 2

MODULE MOVLLG(d) * MOV.L @(disp,GBR),R0
   disp ← (000000FFh ∩ (long)d)
   R[0] ← Read_Long(GBR + (disp << 2))
   PC ← PC + 2

MODULE MOVBSG(d) * MOV.B R0,@(disp,GBR)
   disp ← (000000FFh ∩ (long)d)
   Write_Byte(GBR + disp,R[0])
   PC ← PC + 2

MODULE MOVWSG(d) * MOV.W R0,@(disp,GBR)
   disp ← (000000FFh ∩ (long)d)
   Write_Word(GBR + (disp << 1),R[0])
   PC ← PC + 2

MODULE MOVLSG(d) * MOV.L R0,@(disp,GBR)
   disp ← (000000FFh ∩ (long)d)
   Write_Long(GBR + (disp << 2),R[0])
   PC ← PC + 2

MODULE MOVBS4(d,n) * MOV.B R0,@(disp,Rn)
   disp ← (0000000Fh ∩ (long)d)
   Write_Byte(R[n] + disp,R[0])
   PC ← PC + 2

MODULE MOVWS4(d,n) * MOV.W R0,@(disp,Rn)
   disp ← (0000000Fh ∩ (long)d)
   Write_Word(R[n]+(disp << 1),R[0])
   PC ← PC + 2

MODULE MOVLS4(m,d,n) * MOV.L Rm,@(disp,Rn)
   disp ← (0000000Fh ∩ (long)d)
   Write_Long(R[n] + (disp << 2),R[m])
   PC ← PC + 2

MODULE MOVBL4(m,d) * MOV.B @(disp,Rm),R0
   disp ← (0000000Fh ∩ (long)d)
   R[0] ← Read_Byte(R[m]+disp)
   SI R[0] ∩ 80h = 0 ALORS
      R[0] ← R[0] ∩ 000000FFh
   SINON
      R[0] ← R[0] U FFFFFF00h
   FIN SI
   PC ← PC + 2

MODULE MOVWL4(m,d) * MOV.W @(disp,Rm),R0
   disp ← (0000000Fh ∩ (long)d)
   R[0] ← Read_Word(R[m]+(disp << 1))
   SI (R[0] ∩ 8000h = 0 ALORS
      R[0] ← R[0] ∩ 0000FFFFh
   SINON
      R[0] ← R[0] U FFFF0000h
   FIN SI
   PC ← PC + 2

MODULE MOVLL4(m,d,n) * MOV.L @(disp,Rm),Rn
   disp ← (0000000Fh ∩ (long)d)
   R[n] ← Read_Long(R[m]+(disp << 2))
   PC ← PC + 2

Mnémonique

Instruction Abstrait Opcode Cycle
MOV Rm,Rn Rn ← Rm 0110nnnnmmmm0011 1
MOV.B Rm,@Rn (Rn) ← Rm 0010nnnnmmmm0000 1
MOV.W Rm,@Rn (Rn) ← Rm 0010nnnnmmmm0001 1
MOV.L Rm,@Rn (Rn) ← Rm 0010nnnnmmmm0010 1
MOV.B @Rm,Rn Rn ← extension de signe ← (Rm) 0110nnnnmmmm0000 1
MOV.W @Rm,Rn Rn ← extension de signe ← (Rm) 0110nnnnmmmm0001 1
MOV.L @Rm,Rn Rn ← (Rm) 0110nnnnmmmm0010 1
MOV.B Rm,@-Rn Rn ← Rn - 1, (Rn) ← Rm 0010nnnnmmmm0100 1
MOV.W Rm,@-Rn Rn ← Rn - 2, (Rn) ← Rm 0010nnnnmmmm0101 1
MOV.L Rm,@-Rn Rn ← Rn - 4, (Rn) ← Rm 0010nnnnmmmm0110 1
MOV.B @Rm+,Rn Rn ← extension de signe ← (Rm), Rm ← Rm + 1 0110nnnnmmmm0100 1
MOV.W @Rm+,Rn Rn ← extension de signe ← (Rm), Rm ← Rm + 2 0110nnnnmmmm0101 1
MOV.L @Rm+,Rn Rn ← (Rm), Rm ← Rm + 4 0110nnnnmmmm0110 1
MOV.B Rm,@(R0,Rn) (R0 + Rn) ← Rm 0000nnnnmmmm0100 1
MOV.W Rm,@(R0,Rn) (R0 + Rn) ← Rm 0000nnnnmmmm0101 1
MOV.L Rm,@(R0,Rn) (R0 + Rn) ← Rm 0000nnnnmmmm0110 1
MOV.B @(R0,Rm),Rn Rn ← extension de signe ← (R0 + Rm) 0000nnnnmmmm1100 1
MOV.W @(R0,Rm),Rn Rn ← extension de signe ← (R0 + Rm) 0000nnnnmmmm1101 1
MOV.L @(R0,Rm),Rn Rn ← (R0 + Rm) 0000nnnnmmmm1110 1
MOV #imm,Rn Rn ← extension sign ← imm 1110nnnniiiiiiii 1
MOV.W @(disp,PC),Rn Rn ← extension sign ← (disp × 2 + PC) 1001nnnndddddddd 1
MOV.L @(disp, PC),Rn Rn ← (disp × 4 + PC) 1101nnnndddddddd 1
MOV.B @(disp,GBR),R0 R0 ← sign extension ← (disp + GBR) 11000100dddddddd 1
MOV.W @(disp,GBR),R0 R0 ← sign extension ← (disp × 2 + GBR) 11000101dddddddd 1
MOV.L @(disp,GBR),R0 R0 ← (disp × 4 + GBR) 11000110dddddddd 1
MOV.B R0,@(disp,GBR) (disp + GBR) ← R0 11000000dddddddd 1
MOV.W R0,@(disp,GBR) (disp × 2 + GBR) ← R0 11000001dddddddd 1
MOV.L R0,@(disp,GBR) (disp × 4 + GBR) ← R0 11000010dddddddd 1
MOV.B R0,@(disp,Rn) (disp + Rn) ← R0 10000000nnnndddd 1
MOV.W R0,@(disp,Rn) (disp × 2 + Rn) ← R0 10000001nnnndddd 1
MOV.L Rm,@(disp,Rn) (disp × 4 + Rn) ← Rm 0001nnnnmmmmdddd 1
MOV.B @(disp,Rm),R0 R0 ← sign extension ← (disp + Rm) 10000100mmmmdddd 1
MOV.W @(disp,Rm),R0 R0 ← sign extension ← (disp × 2 + Rm) 10000101mmmmdddd 1
MOV.L @(disp,Rm),Rn Rn ← disp × 4 + Rm) 0101nnnnmmmmdddd 1


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