Final answer:
The Fill Random procedure involves creating assembly language code to generate N random integers within a given range and to store these in an array, ensuring that register values are preserved between calls.
Step-by-step explanation:
The student is asked to implement a procedure named Fill Random in assembly language. The procedure should populate an array with N random integers that must fall within the range defined by j and k (inclusive). The procedure must be designed to preserve register values between calls and will be used by a test program that provides the necessary parameters.
To implement this procedure, the student would use an assembly language loop that iterates N times, and within the loop, a random number generation routine would be called to generate a number within the specified range. The generated number would then be stored in the array at the appropriate index. Care should be taken to preserve register values as required.
Example pseudo-assembly code snippet:
Fill Random:
Pusha; Preserve register values.
mov ecx, [esp+36]; Move N into ECX
mov ebx, [esp+40]; Move array pointer into EBX.
mov edx, [esp+44]; Move j into EDX.
mov Esi, [esp+48]; Move k into ESI.
; Loop N times
. repeat:
; Generate random integer in the range of j to k.
; Store the generated value in the address pointed by EBX.
; Increment the pointer EBX.
loop. repeat
poppa ; Restore register values.
ret; Return from procedure.
This code is a simplified representation and would need to be fleshed out with the random number generation logic that clamps values between j and k, error checking, and potentially other platform-specific details.