1 / 11

Struct Code generation

Struct Code generation. code example 1. Struct simple { int one; int two; } simple j; void main ( ) { j.two = 1; }. code example 1. Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4. Struct simple { int one; int two; } simple j;

dirk
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Struct Code generation

  2. code example 1 Struct simple { int one; int two; } simple j; void main ( ) { j.two = 1; }

  3. code example 1 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Struct simple { int one; int two; } simple j; void main ( ) { j.two = 1; }

  4. code example 1 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Struct simple { int one; int two; } simple j; void main ( ) { j.two = 1; } DataFrame j db 0x0 dup(8)

  5. code example 1 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 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

  6. code example 1 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 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

  7. code example 2 Struct simple { int one; int two; } simple [] j = new simple 3; void main ( ) { j[1].two = 1; }

  8. code example 2 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Entry Type Elements ElSize j array 3 8 Struct simple { int one; int two; } simple [] j = new simple 3; void main ( ) { j[1].two = 1; }

  9. code example 2 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Entry Type Elements ElSize j array 3 8 Struct simple { int one; int two; } simple [] j = new simple 3; void main ( ) { j[1].two = 1; } DataFrame j db 0x0 dup(24)

  10. code example 2 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Entry Type Elements ElSize j array 3 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

  11. code example 2 Symbol Table Entry Type size fields fieldsize fieldstart simple struct 8 one 4 0 two 4 4 Entry Type Elements ElSize j array 3 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

More Related