6. Implementation of REP MOVS instruction using C++ and verify the functioning of the instruction. (25 points) a) Write a C++ /Python code the emulate the function of REP MOVS instruction in X86 and verify its function. You may decide the length of the string used. b) Implement REP MOVS instruction using the RSIC ARM7 Assembly language programing and verify using Keil micro-vision. c) Make sure you comment your C++/Python and AM7 code well. REP MOVS (DEST SRC) Destination - Source; if(IsByteMove()){ if(DF 0) { IF AddressSize = 16 THEN (E)SI - (E)SI + 1; (E )DI - (E)DI + 1; Use CX for CountReg; ELSE IF AddressSize = 64 and REX.W used THEN Use RCX for CountReg; Fl; ELSE else { (E)SI - (E)SI - 1; (E)DI - (E)DI - 1; Use ECX for CountReg; else if(IswordMove()) { if(DF 0) { Fl; WHILE CountReg # 0 (E)SI - (E)SI + 2; (E)DI - (E)DI + 2; DO else ( Service pending interrupts (if anyk Execute associated string instruction CountReg + (CountReg - 1); IF CountReg = 0 THEN exit WHILE loop; Fl; IF (Repeat prefix is REPZ or REPE) and (ZF = 0) or (Repeat prefix is REPNZ or REPNE) and (ZF = 1) THEN exit WHILE loop; Fl; (E)SI - (E)SI 2; (E) DI - (E)DI 2; else ( //doubleword move if(DF 0) ( (E)SI - (E)SI + 4; (E)DI - (E)DI + 4; else { (E)SI - (E)SI 4; OD; (E) DI - (E)DI 43;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

Please answer as detailed with all the steps

6. Implementation of REP MOVS instruction using C++ and verify the
functioning of the instruction. (25 points)
a) Write a C++ /Python code the emulate the function of REP MOVS
instruction in X86 and verify its function. You may decide the length
of the string used.
b) Implement REP MOVS instruction using the RSIC ARM7 Assembly
language programing and verify using Keil micro-vision.
c) Make sure you comment your C++/Python and AM7 code well.
REP MOVS (DEST SRC)
Destination = Source;
if(IsByteMove ()) {
if (DF 0) {
IF AddressSize = 16
(E)SI = (E)SI + 1;
(E)DI = (E)DI + 1;
THEN
Use CX for CountReg;
ELSE IF AddressSize = 64 and REX.W used
THEN Use RCX for CountReg; Fl;
else {
(E)SI - (E)SI - 1;
(E)DI = (E)DI - 1;
ELSE
Use ECX for CountReg;
}
else if(IswordMove ()) {
Fl;
if (DF 0) {
WHILE CountReg = 0
DO
(E)SI = (E)SI + 2;
(E) DI = (E)DI + 2;
else (
Service pending interrupts (if anyk
Execute associated string instruction:
CountReg + (CountReg - 1);
IF CountReg = 0
THEN exit WHILE loop; Fl;
IF (Repeat prefix is REPZ or REPE) and (ZF = 0)
or (Repeat prefix is REPNZ or REPNE) and (ZF = 1)\
THEN exit WHILE loop; Fl;
(E)SI = (E)SI - 2;
(E)DI = (E)DI - 2;
}
}
else { //doubleword move
if (DF 0) {
(E)SI = (E)SI + 4;
(E) DI - (E) DI + 4;
else {
(E)SI = (E)SI - 4;
(E) DI = (E)DI
OD;
4;
Transcribed Image Text:6. Implementation of REP MOVS instruction using C++ and verify the functioning of the instruction. (25 points) a) Write a C++ /Python code the emulate the function of REP MOVS instruction in X86 and verify its function. You may decide the length of the string used. b) Implement REP MOVS instruction using the RSIC ARM7 Assembly language programing and verify using Keil micro-vision. c) Make sure you comment your C++/Python and AM7 code well. REP MOVS (DEST SRC) Destination = Source; if(IsByteMove ()) { if (DF 0) { IF AddressSize = 16 (E)SI = (E)SI + 1; (E)DI = (E)DI + 1; THEN Use CX for CountReg; ELSE IF AddressSize = 64 and REX.W used THEN Use RCX for CountReg; Fl; else { (E)SI - (E)SI - 1; (E)DI = (E)DI - 1; ELSE Use ECX for CountReg; } else if(IswordMove ()) { Fl; if (DF 0) { WHILE CountReg = 0 DO (E)SI = (E)SI + 2; (E) DI = (E)DI + 2; else ( Service pending interrupts (if anyk Execute associated string instruction: CountReg + (CountReg - 1); IF CountReg = 0 THEN exit WHILE loop; Fl; IF (Repeat prefix is REPZ or REPE) and (ZF = 0) or (Repeat prefix is REPNZ or REPNE) and (ZF = 1)\ THEN exit WHILE loop; Fl; (E)SI = (E)SI - 2; (E)DI = (E)DI - 2; } } else { //doubleword move if (DF 0) { (E)SI = (E)SI + 4; (E) DI - (E) DI + 4; else { (E)SI = (E)SI - 4; (E) DI = (E)DI OD; 4;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education