Question: STORAGE MAPPING FUNCTION ============================================= Suppose we are generating code for an imperative PL on a machine with 8-byte floating-point numbers, 4-byte integers, and 1-byte characters.

STORAGE MAPPING FUNCTION

=============================================

Suppose we are generating code for an imperative PL on a machine with 8-byte floating-point numbers, 4-byte integers, and 1-byte characters. Also assume that characters, integers and floating-point numbers must each align to the left of a word (32-bits, or 4-bytes, long). We plan to use a contiguous row-major layout for multidimensional arrays. Furthermore, we do not wish to reorder fields of records or to pack either records or arrays. And we will assume without checking that all array subscripts are in bounds.

Consider the following variable declarations: A: array [1:10 , 10:100 ] of real; I: integer;

Show the storage mapping function Loc for this array A and then use it to compute the address of element

A[ 3 , I ]. Assume Loc( A[ 1, 10 ] ) = 1234.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!