Question

In: Computer Science

Write an inline assembly program that initialized a 100 byte area of memory using the STOS...

Write an inline assembly program that initialized a 100 byte area of memory using the STOS instruction.

Solutions

Expert Solution

ASSEMBLY PROGRAM:---

MOV AL,0 ------>moves the value zero to AL register

LEA DI,BUFFER ------> loads effective address

MOV CX,100 ----->moves value 100 to CX register

CLD ----->clears direction flag

REP STOS BUFFER ------>repeats the above steps until count is zero

AL: Low byte of AX register

MOV: Command used to move data between registers and memory.

LEA: Load effective address.

DI : it is the destination index ,it is a pointer used to compare current character in string .

BUFFER : sequence of bytes.

CX : it is a 16 bit register.

CLD : It clears the direction flag. Direction flag is used to decide in which direction instructions work when used with REP command.

REP: This is similar to loops in java,but in this it is used to repeat all the instructions until count is 0.

STOS: it is used to store data(in bytes,word etc)  from registers(AX,BX,CX) into specific memory locations(operands).The address is read from either  ES:EDI or the ES:DI registers (depending on the address-size attribute of the instruction, 32 or 16, respectively).


Related Solutions

Write an inline assembly program that initializes a 100 byte area of memory to 0xFF using...
Write an inline assembly program that initializes a 100 byte area of memory to 0xFF using the STOS instruction with REP using DWORD transfers.
Write an assembly code the counts the number of accuracies of the byte AAh in memory...
Write an assembly code the counts the number of accuracies of the byte AAh in memory from address 120Ah to address 130Ah. You need to use a subroutine and call it 'COUNT' to do so. You also need to provide the count in BCD if it was less than 64h so that you need to include another subroutine called 'ToBCD' to do so. assembly 8086
Write an assembly language program to define an array of 5 double words initialized to 33,44,25,72,23,11...
Write an assembly language program to define an array of 5 double words initialized to 33,44,25,72,23,11 (all decimal). Add the first three numbers together and subtract the last two numbers from the sum. Store the sum in EAX register. Display the sum by using Irvine32 library procedures or by dumping registers to the display and taking a screenshot.
Write an Intel 8085 assembly program to find the largest of N numbers stored in memory...
Write an Intel 8085 assembly program to find the largest of N numbers stored in memory using the algorithm below. Hand trace (execute) the program showing the changes made to all affected registers and memory locations. Max = a(1) For i = n to N If max < a(i) then max = a(i) Next i
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
HCS12 Assembly Language: 1. Write a program to convert a decimal number stored at memory location...
HCS12 Assembly Language: 1. Write a program to convert a decimal number stored at memory location $1010 into a binary number. Store the result in memory location $2000
Using the windows 32 framework , write an assembly language program ; write a procedure to...
Using the windows 32 framework , write an assembly language program ; write a procedure to read a string and shift each character of the string by one. As an example, if your input string is Abcz, your output should be Bcda. Note that you must test your string for non-alphabetic characters (such as numbers and special characters). If there are non-alphabetic characters, you should terminate your program with an appropriate message. You should display your converted string using the...
Write a 'C' program to calculate the surface area of the cone and by using that,...
Write a 'C' program to calculate the surface area of the cone and by using that, also calculate the volume of the cone and print the values as surface area of the cone and volume of the cone. where as: surface area of the cone = πr2 (r is the radius of the surface) volume of the cone = (1/3)πr2h (h is the height of the cone)
Write a program that uses an array of doubles initialized to whatever values you wish. Write...
Write a program that uses an array of doubles initialized to whatever values you wish. Write methods to calculate and return the minimum and a method to calculate and return the maximum value in the array. You must write YOUR ORIGINAL methods for minimum and maximum. You MAY NOT use Math class methods or other library methods. Write an additional method that accepts the array as a parameter and then creates and returns a new array with all the same...
Write a program that creates a two-dimensional array initialized with test data. The program should have...
Write a program that creates a two-dimensional array initialized with test data. The program should have the following functions: Hi There I really appreciate your help with this project. ▪ getTotal . This function should accept a two-dimensional array as its argument and return the total of all the values in the array. ▪ getAverage . This function should accept a two-dimensional array as its argument and return the average of all the values in the array. ▪ getRowTotal ....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT