Question

In: Computer Science

Assembly Language 2. Suppose the processor is executing at the fix speed 755MHz. After how much...

Assembly Language

2. Suppose the processor is executing at the fix speed 755MHz. After how much time will the 32-bit counter overflow?  

3. What exactly happens when “ret” (asm) or “return” (C++) executes?

4. What is the precise name of the greatest program ever built in assembly language?

Solutions

Expert Solution

Solution(a) :

Given,The speed of processor is = 755 MHz

and, 1 MHz= 10-3 GHz = 106 Hz

so, 755 MHz = 755 *106 Hz

Also, the counter is of 32 bit .

so,the total increments possible in counter = 232.

now, the total time required(in seconds ) , so that the counter overflows = ( total increments possible ) / speed of processor clock (in hertz)

= (232 ) / ( 755 * 106 ) seconds

= 4294.967296 / 755 seconds

= 5.7 seconds (approximately).

So,After 5.7 seconds (approximately) ,the 32-bit counter will overflow.

Solution (b) :

Whenever a "ret" command in assembly language or a " return " statement in C++ executes the following thing happens :

(i) It stops the execution of the current function being run in the memory (primary). This means the function which is currently loaded in the primary memory will stop its execution when return statement/ command is called and hence the function will not be able to run its next command in the queue.

(ii) When the "ret" in assembly language or the "return " in C++ language is run the control goes back to the place from where the current function was called. This means the current function will stop and will give back the control to the parent program or the parent function.

(iii) If the return statement / command is initiated then the program stack will unwind itself one step before the current function, which means the program counter which points to the top of the program stack will pop one value and will decrements its value by one.

(iv) The current function will return the required value to the calling function so that scheduling is processed in a proper manner.

Solution (C) :

The Greatest program ever built in an assembly language is named "SDOS". SDOS is an 8-bit operating system which was built in early 80s ,initially for the computational purpose in the advanced systems at that time.It consisted of more than 27K line of the assembly language instructions or commands.


Related Solutions

explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions...
explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions using the computer's architecture?
Understanding Assembly Language. For each problem, show the contents or setting of the requested items after...
Understanding Assembly Language. For each problem, show the contents or setting of the requested items after executing the instructions. mov eax, 0FFFFFBFDh ; i.e., -1027 mov ebx, -16        ; i.e., FFFFFFF0h mov edx, 0 idiv bl Show the hexadecimal digits in eax:_______________ Show the hexadecimal digits in edx:_______________ mov eax, 0FFFFFBFDh ; i.e., -1027 mov ebx, -16        ; i.e., FFFFFFF0h mov edx, 0 cwd idiv bx Show the hexadecimal digits in eax:_______________ Show the hexadecimal digits in edx:_______________ mov eax,...
Problem 2 How much ice is in the final state after 2 kg of ice at...
Problem 2 How much ice is in the final state after 2 kg of ice at -30°C is added to a large quantity of water at 0°C? The final state is ice-water. (10 points)
Suppose the target assembly language for a compiler has these five instructions for integers: load address,...
Suppose the target assembly language for a compiler has these five instructions for integers: load address, reg add reg, reg, reg sub reg, reg, reg mul reg, reg, reg store reg, address In these instructions, an address is the name of a static variable (whose actual address will be filled in by the loader). A reg is the name of an integer register,
a special extra-fast memory location inside the processor. The target assembly language has three integer registers: r1,...
Complete the AVR assembly language fragment below so that it does a multiply by 2 of...
Complete the AVR assembly language fragment below so that it does a multiply by 2 of the two's complement 32-bit quantity in registers r18:r19:r20:r21. (r18 is the most significant byte.) asrlsrlslaslrolrorr18r19r20r21  asrlsrlslaslrolrorr18r19r20r21 asrlsrlslaslrolrorr18r19r20r21  asrlsrlslaslrolrorr18r19r20r21 asrlsrlslaslrolrorr18r19r20r21  asrlsrlslaslrolrorr18r19r20r21 asrlsrlslaslrolrorr18r19r20r21  asrlsrlslaslrolrorr18r19r20r21
Complete the AVR assembly language fragment below so that it performs a division by 2 of...
Complete the AVR assembly language fragment below so that it performs a division by 2 of the 24-bit two's complement value in registers r6:r5:r4. (r6 is the most significant byte.) lslasllsrasrrolrorr4r5r6  lslasllsrasrrolrorr4r5r6 lslasllsrasrrolrorr4r5r6  lslasllsrasrrolrorr4r5r6 lslasllsrasrrolrorr4r5r6  lslasllsrasrrolrorr4r5r6
Write an MSP430 assembly language program that implements the following 2 algorithms: 2) a macro called...
Write an MSP430 assembly language program that implements the following 2 algorithms: 2) a macro called "vdot" that calculates the "dot product" of two vectors "a" and "b", implemented as “arrays” (following the “C” language convention), of 3 elements. the macro should receive 2 pointers to the first element of each vector and return the result in R13.
1. How to create a newline subroutine in micro assembly language that sends the CR and...
1. How to create a newline subroutine in micro assembly language that sends the CR and LF codes to putchUSART0 (write down the full code in micro assembly language). Terminal programs move the cursor to the beginning of a line with a Carriage Return (CR) code 0x0D and down a line with the Line Feed (LF) code 0x0A.
Assembly Language HW For this program you will find the largest common factor for 2 numbers,...
Assembly Language HW For this program you will find the largest common factor for 2 numbers, a and b. The largest common factor is the largest positive number that divides the two numbers. The C++ code for doing this is: int LCF (int a, int b) { if (a == 0 && b == 0)      b = 1; else      if (b == 0)           b = a;      else           if (a != 0)               ...
Language Assembly ( required) Write and test a function, drawshape. The function has 2 parameters, the...
Language Assembly ( required) Write and test a function, drawshape. The function has 2 parameters, the shape's character and the length of the shape's longest line. draw shape(1, x) looks displays x x draw shape(2, y) displays yy y yy draw shape(3, z) displays zzz zz z zz zzz and so on.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT