The Gateway to Computer Science Excellence
0 votes
60 views
what will be the three address code for x=A[i][j] Given A[M][N] and w is word size;

t1=i*N;

t2=t1+j;

t3=t2*w;

t4=base address of array A[M][N]

t5=t4+t3;

x=t5;

My doubt here: Is there any need of t4 variable for storing the base address of arrary or we can directly do it as

t4=A[t3];

x=t4;
in Compiler Design by Active (3.2k points)
edited by | 60 views
0
as per my knowledge,

it depends upon addressing modes which your architecture support
0
That mean depending on the architecture both are correct!

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,492 answers
195,439 comments
100,696 users