Struct code generation
This presentation is the property of its rightful owner.
Sponsored Links
1 / 11

Struct Code generation PowerPoint PPT Presentation


  • 93 Views
  • Uploaded on
  • Presentation posted in: General

Struct Code generation. code example 1. Struct simple { int one; int two; } simple j; void main ( ) { j.two = 1; }. code example 1. Symbol Table EntryTypesizefieldsfieldsize fieldstart simplestruct8one40 two44. Struct simple { int one; int two; } simple j;

Download Presentation

Struct Code generation

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Struct code generation

Struct Code generation


Code example 1

code example 1

Struct simple

{

int one;

int two;

}

simple j;

void main ( )

{

j.two = 1;

}


Code example 11

code example 1

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

Struct simple

{

int one;

int two;

}

simple j;

void main ( )

{

j.two = 1;

}


Code example 12

code example 1

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

Struct simple

{

int one;

int two;

}

simple j;

void main ( )

{

j.two = 1;

}

DataFrame

j db 0x0 dup(8)


Code example 13

code example 1

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

Struct simple

{

int one;

int two;

}

simple j;

void main ( )

{

j.two = 1;

}

DataFrame

j db 0x0 dup(8)

Calc of address of j.one

mov r1, j

add r1, 4 ; two.fieldstart


Code example 14

code example 1

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

Struct simple

{

int one;

int two;

}

simple j;

void main ( )

{

j.two = 1;

}

DataFrame

j db 0x0 dup(8)

CodeFrame

mov r1, j

add r1, 4

push r1

push 1

pop r2

pop r1

mov [r1], r2

Calc of address of j.one

mov r1, j

add r1, 4 ; two.fieldstart


Code example 2

code example 2

Struct simple

{

int one;

int two;

}

simple [] j = new simple 3;

void main ( )

{

j[1].two = 1;

}


Code example 21

code example 2

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

EntryTypeElements ElSize

jarray3 8

Struct simple

{

int one;

int two;

}

simple [] j = new simple 3;

void main ( )

{

j[1].two = 1;

}


Code example 22

code example 2

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

EntryTypeElements ElSize

jarray3 8

Struct simple

{

int one;

int two;

}

simple [] j = new simple 3;

void main ( )

{

j[1].two = 1;

}

DataFrame

j db 0x0 dup(24)


Code example 23

code example 2

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

EntryTypeElements ElSize

jarray3 8

Struct simple

{

int one;

int two;

}

simple [] j = new simple 3;

void main ( )

{

j[1].two = 1;

}

DataFrame

j db 0x0 dup(24)

Calc of address of j[1].two

mov r1, j

mov r2, 8 ; ElSize

mul r2, 1 ;

add r1,r2 ; j[1]

add r1, 4 ; two.fieldstart


Code example 24

code example 2

Symbol Table

EntryTypesizefieldsfieldsize fieldstart

simplestruct8one40

two44

EntryTypeElements ElSize

jarray3 8

Struct simple

{

int one;

int two;

}

simple [] j = new simple 3;

void main ( )

{

j[1].two = 1;

}

DataFrame

j db 0x0 dup(24)

CodeFrame

mov r1, j

mov r2,8

mul r2,1

add r1,r2

add r1, 4

push r1

push 1

pop r2

pop r1

mov [r1], r2

Calc of address of j[1].two

mov r1, j

mov r2, 8 ; ElSize

mul r2, 1 ;

add r1,r2 ; j[1]

add r1, 4 ; two.fieldstart


  • Login