Question

In: Computer Science

1. Wite a program to exchange the contents of memory locations 2050H and 2370H using STA...

1. Wite a program to exchange the contents of memory locations 2050H and 2370H using STA and LDA instructions.

Solutions

Expert Solution

Exchange the contents of memory locations 2050H and 2370H.

Program 1:

  1. LDA 2050H : "Get the contents of memory location 2050H into accumulator"
  2. MOV B, A : "Save the contents into B register"
  3. LDA 2370H : "Get the contents of memory location 2370Hinto accumulator"
  4. STA 2050H : "Store the contents of accumulator at address 2050H"
  5. MOV A, B : "Get the saved contents back into A register"
  6. STA 2370H : "Store the contents of accumulator at address 2370H"

Program 2:

  1. LXI H 2050H : "Initialize HL register pair as a pointer to memory location 2050H."
  2. LXI D 2370H : "Initialize DE register pair as a pointer to memory location 2370H."
  3. MOV B, M : "Get the contents of memory location 2050H into B register."
  4. LDAX D : "Get the contents of memory location 2370H into A register."
  5. MOV M, A : "Store the contents of A register into memory location 2050H."
  6. MOV A, B : "Copy the contents of B register into accumulator."
  7. STAX D : "Store the contents of A register into memory location 2370H."
  8. HLT : "Terminate program execution."

Related Solutions

a) Which lines of code contain operations that change the contents of memory in this program?...
a) Which lines of code contain operations that change the contents of memory in this program? b) What are those operations? int main ( void ){             double dScore1;             double dScore2;             double dScore3;             double dAverage;             printf("Enter score 1: ");                                             //line 1             scanf("%lg", &dScore1);                                           //line 2             printf("Enter score 2: ");                                             //line 3             scanf("%lg", &dScore2);                                           //line 4             printf("Enter score 3: ");                                             //line 5             scanf("%lg", &dScore3);                                           //line 6             dAverage = (dScore1 + dScore2...
wite a program in C to print a right and left pointing arrow pattern using '#'...
wite a program in C to print a right and left pointing arrow pattern using '#' symbol. Do so within 10 lines i.e upper half of the occupies 5 lines and lower half occupies other 5 lones. User will enter 'R' or'r' for printing right pointing arrow. 'l' or 'L' for left pointing arrow.'k'' for invalid option. You must use if-else and while loop for do this.
Write an assembly language program for 8085 microprocessor to read consecutive memory locations from 2000 to...
Write an assembly language program for 8085 microprocessor to read consecutive memory locations from 2000 to 2FFF & transfer to 4000 to 4FFF
Random Access Memory (RAM) is _______________ type of memory because the contents are erased when the...
Random Access Memory (RAM) is _______________ type of memory because the contents are erased when the computer is turned off and is therefore used only for temporary storage while a program is running. In Python, the % arithmetic operator gives the ______________________ when one integer is divided by another. _______________ storage is the general name given to storage that can hold data for long periods of time, even when there is no power to the computer. Python uses ______________________ to...
Create C program that takes 1 parameter: a number. Using that number, dynamically allocate a memory...
Create C program that takes 1 parameter: a number. Using that number, dynamically allocate a memory so you store that number of integers. Write integers in order starting from 1 until you fill all that memory. Print the addresses and values of the first and the last integer stored in the memory.
Create C program that takes 1 parameter: a number. Using that number, dynamically allocate a memory...
Create C program that takes 1 parameter: a number. Using that number, dynamically allocate a memory so you store that number of integers. Write integers in order starting from 1 until you fill all that memory. Print the addresses and values of the first and the last integer stored in the memory. Help ASAP!!!
Please Using Microsoft Word Program Report In General About; HydroDynamic Journal Bearing Report Contents: 1- Abstract...
Please Using Microsoft Word Program Report In General About; HydroDynamic Journal Bearing Report Contents: 1- Abstract 2- Introduction 3- Body of Report 4- Conclusions 5- References
Write a program that displays a single character at 100 random screen locations, using a timing...
Write a program that displays a single character at 100 random screen locations, using a timing delay of 100 milliseconds. Hint: Use the GetMaxXY procedure to determine the current size of the console window. How to code this program with a defined character 'A' (I do not want to write a character to get a single character in the output console)
The C++ program below simply copies the contents of one file to another file using standard...
The C++ program below simply copies the contents of one file to another file using standard in and standard out. Do a line-by-line conversion of the complete program into a closely equivalent C program that produces the same output given the same input. Note that the underscores are used solely to force indentation in Canvas. #include using namespace std; int main(void) { char symbol; cin.get(symbol); while (!cin.eof()) ___ { ___ cout.put(symbol); ___ cin.get(symbol); ___ } return 0; }
Java Code using Queue Write a program that opens a text file and reads its contents...
Java Code using Queue Write a program that opens a text file and reads its contents into a queue of characters, it should read character by character (including space/line change) and enqueue characters into a queue one by one. Dequeue characters, change their cases (upper case to lower case, lower case to upper case) and save them into a new text file (all the chars are in the same order as the original file, but with different upper/lower case) use...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT