[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 15 KB, 268x248, 1mips.jpg [View same] [iqdb] [saucenao] [google]
9308269 No.9308269 [Reply] [Original]

The top statement is in C, the bottom is in assembly

I understand it all except for why does 8 represent [2]? Is there some sheet I need to use to translate that sort of stuff?

>> No.9308273
File: 287 KB, 836x1065, 1455310679806.png [View same] [iqdb] [saucenao] [google]
9308273

>>9308269
CS majors belong in the >>>/g/hetto

Also, int's are 4 bytes long so 2 int's are an offset of 4*2 bytes.

>> No.9308275

>>9308273
people there don't answer anything

also thanks

>> No.9308663

>>9308269
[math]\mathbb{MIPS}[/math] [math]DETECTED[/math]

>> No.9310501

>>9308269
Because an integer is 4 bytes long, so you need to increase the address by 8 in order to get the element at index of 2.