Index: trunk/sim/memory.hex
===================================================================
--- trunk/sim/memory.hex	(revision 18)
+++ trunk/sim/memory.hex	(revision 19)
@@ -1,81 +1,325 @@
-201d
-1000
-3c1f
-dead
-37ff
-beef
-0000
-0000
-27bd
-ffe8
-afbe
-0010
-03a0
-f021
-3c02
-faba
-3442
-1210
-afc2
-0008
-8fc3
-0008
-2402
-0048
-ac62
-0000
-8fc3
-0008
-2402
-0065
-ac62
-0000
-8fc3
-0008
-2402
-006c
-ac62
-0000
-8fc3
-0008
-2402
-006c
-ac62
-0000
-8fc3
-0008
-2402
-006f
-ac62
-0000
-8fc3
-0008
-2402
-0021
-ac62
-0000
-8fc3
-0008
-2402
-000a
-ac62
-0000
-0000
-1021
-03c0
-e821
-8fbe
-0010
-27bd
-0018
-03e0
-0008
-0000
-0000
-0000
-0000
-0000
-0000
-0000
+9de3
+bf50
+0100
+0000
+0100
+0000
+0100
+0000
+0100
+0000
+0300
+0000
+0500
+0100
+8210
+6000
+8410
+a0c0
+8328
+7020
+8410
+8001
+81c0
+8000
+0100
+0000
+0100
+0000
+0100
+0000
+0100
+0000
+0100
+0000
+b580
+2005
+a210
+2000
+8210
+20a9
+8328
+7020
+e270
+6000
+e270
+6040
+e270
+6080
+e270
+60c0
+a210
+2000
+8210
+2010
+e2f0
+4840
+a210
+2003
+e2f0
+08a0
+a348
+0000
+819c
+6820
+8780
+2025
+c0f0
+23c0
+c0f0
+23c8
+c0f0
+23d0
+c0f0
+23d8
+c0f0
+23e0
+c0f0
+23e8
+c0f0
+23f0
+c0f0
+23f8
+8f90
+2000
+a190
+2000
+8d80
+2000
+8580
+2000
+8780
+2000
+8410
+2000
+8990
+8000
+8410
+2000
+b180
+8000
+8410
+2001
+8528
+b03f
+af80
+8000
+b380
+8000
+bf98
+8000
+8180
+0000
+9190
+200f
+9390
+2000
+9590
+2006
+9790
+2000
+9b90
+2000
+9990
+2007
+9d90
+2007
+8210
+2018
+c0f0
+0a01
+c0f0
+0b01
+a210
+2003
+e2f0
+0960
+a210
+2003
+8210
+20aa
+8328
+7020
+e270
+6000
+e270
+6040
+e270
+6080
+e270
+60c0
+a346
+8000
+0300
+0007
+8210
+6300
+a20c
+4001
+a334
+7008
+0300
+0000
+0500
+0130
+8210
+6000
+8410
+a000
+8328
+7020
+8410
+8001
+a32c
+7003
+c458
+8011
+8210
+2080
+c4f0
+4b00
+2f00
+0200
+8b9d
+c000
+2100
+0000
+0300
+0130
+a014
+2000
+8210
+6140
+a12c
+3020
+8210
+4010
+8528
+b007
+8200
+4002
+e258
+4000
+e2f0
+06e0
+e258
+6008
+e2f0
+07e0
+e258
+6010
+e2f0
+06a0
+e258
+6020
+e2f0
+06c0
+e258
+6018
+e2f0
+07a0
+e258
+6028
+e2f0
+07c0
+e258
+6040
+e2f0
+0660
+e258
+6048
+e2f0
+0760
+e258
+6050
+e2f0
+0620
+e258
+6060
+e2f0
+0640
+e258
+6058
+e2f0
+0720
+e258
+6068
+e2f0
+0740
+9410
+2080
+c0f2
+8ae0
+c0f2
+8be0
+a210
+2008
+c0f4
+4420
+a210
+2010
+c0f4
+4420
+a210
+200f
+e2f0
+08a0
+0300
+0000
+0500
+0510
+8210
+6000
+8410
+a000
+8328
+7020
+8410
+8001
+8748
+0000
+8f90
+2001
+8810
+2000
+8399
+0000
+8f90
+2000
+9010
+2000
+81c0
+8000
+8198
+2800
+0100
+0000
+0100
+0000
+8210
+200f
+c2f0
+08a0
+c0f0
+0860
+8348
+0000
+0100
+0000
+0100
+0000
+0100
+0000
+0100
+0000
+8210
+2000
+8338
+6000
+b010
+0001
+81cf
+e008
+0100
 0000
      
Index: trunk/sim/hello.dump
===================================================================
--- trunk/sim/hello.dump	(revision 18)
+++ 	(revision )
@@ -1,48 +1,0 @@
-
-hello.bin:     file format elf32-tradlittlemips
-
-Disassembly of section .text:
-
-00000000 <main-0x10>:
-   0:   201d1000        addi    $29,$0,4096
-   4:   3c1fdead        lui     $31,0xdead
-   8:   37ffbeef        ori     $31,$31,0xbeef
-   c:   00000000        sll     $0,$0,0x0
-
-00000010 <main>:
-  10:   27bdffe8        addiu   $29,$29,-24
-  14:   afbe0010        sw      $30,16($29)
-  18:   03a0f021        addu    $30,$29,$0
-  1c:   3c02faba        lui     $2,0xfaba
-  20:   34421210        ori     $2,$2,0x1210
-  24:   afc20008        sw      $2,8($30)
-  28:   8fc30008        lw      $3,8($30)
-  2c:   24020048        addiu   $2,$0,72
-  30:   ac620000        sw      $2,0($3)
-  34:   8fc30008        lw      $3,8($30)
-  38:   24020065        addiu   $2,$0,101
-  3c:   ac620000        sw      $2,0($3)
-  40:   8fc30008        lw      $3,8($30)
-  44:   2402006c        addiu   $2,$0,108
-  48:   ac620000        sw      $2,0($3)
-  4c:   8fc30008        lw      $3,8($30)
-  50:   2402006c        addiu   $2,$0,108
-  54:   ac620000        sw      $2,0($3)
-  58:   8fc30008        lw      $3,8($30)
-  5c:   2402006f        addiu   $2,$0,111
-  60:   ac620000        sw      $2,0($3)
-  64:   8fc30008        lw      $3,8($30)
-  68:   24020021        addiu   $2,$0,33
-  6c:   ac620000        sw      $2,0($3)
-  70:   8fc30008        lw      $3,8($30)
-  74:   2402000a        addiu   $2,$0,10
-  78:   ac620000        sw      $2,0($3)
-  7c:   00001021        addu    $2,$0,$0
-  80:   03c0e821        addu    $29,$30,$0
-  84:   8fbe0010        lw      $30,16($29)
-  88:   27bd0018        addiu   $29,$29,24
-  8c:   03e00008        jr      $31
-  90:   00000000        sll     $0,$0,0x0
-  94:   00000000        sll     $0,$0,0x0
-  98:   00000000        sll     $0,$0,0x0
-  9c:   00000000        sll     $0,$0,0x0
Index: trunk/sw/test.dump
===================================================================
--- trunk/sw/test.dump	(revision 19)
+++ trunk/sw/test.dump	(revision 19)
@@ -0,0 +1,169 @@
+
+test.o:     file format elf64-sparc
+
+
+Disassembly of section .text:
+
+0000000000000000 <main>:
+   0:	9d e3 bf 50 	save  %sp, -176, %sp
+   4:	01 00 00 00 	nop 
+   8:	01 00 00 00 	nop 
+   c:	01 00 00 00 	nop 
+  10:	01 00 00 00 	nop 
+  14:	03 00 00 00 	sethi  %hi(0), %g1
+  18:	05 00 01 00 	sethi  %hi(0x40000), %g2
+  1c:	82 10 60 00 	mov  %g1, %g1
+  20:	84 10 a0 c0 	or  %g2, 0xc0, %g2
+  24:	83 28 70 20 	sllx  %g1, 0x20, %g1
+  28:	84 10 80 01 	or  %g2, %g1, %g2
+  2c:	81 c0 80 00 	jmp  %g2
+  30:	01 00 00 00 	nop 
+  34:	01 00 00 00 	nop 
+  38:	01 00 00 00 	nop 
+  3c:	01 00 00 00 	nop 
+  40:	01 00 00 00 	nop 
+  44:	b5 80 20 05 	wr  %g0, 5, %asr26
+  48:	a2 10 20 00 	clr  %l1
+  4c:	82 10 20 a9 	mov  0xa9, %g1
+  50:	83 28 70 20 	sllx  %g1, 0x20, %g1
+  54:	e2 70 60 00 	stx  %l1, [ %g1 ]
+  58:	e2 70 60 40 	stx  %l1, [ %g1 + 0x40 ]
+  5c:	e2 70 60 80 	stx  %l1, [ %g1 + 0x80 ]
+  60:	e2 70 60 c0 	stx  %l1, [ %g1 + 0xc0 ]
+  64:	a2 10 20 00 	clr  %l1
+  68:	82 10 20 10 	mov  0x10, %g1
+  6c:	e2 f0 48 40 	stxa  %l1, [ %g1 ] #ASI_DCACHE_INVALIDATE
+  70:	a2 10 20 03 	mov  3, %l1
+  74:	e2 f0 08 a0 	stxa  %l1, [ %g0 ] #ASI_LSU_CONTROL_REG
+  78:	a3 48 00 00 	rdhpr  %hpstate, %l1
+  7c:	81 9c 68 20 	wrhpr  %l1, 0x820, %hpstate
+  80:	87 80 20 25 	wr  %g0, 0x25, %asi
+  84:	c0 f0 23 c0 	stxa  %g0, [ 0x3c0 ] %asi
+  88:	c0 f0 23 c8 	stxa  %g0, [ 0x3c8 ] %asi
+  8c:	c0 f0 23 d0 	stxa  %g0, [ 0x3d0 ] %asi
+  90:	c0 f0 23 d8 	stxa  %g0, [ 0x3d8 ] %asi
+  94:	c0 f0 23 e0 	stxa  %g0, [ 0x3e0 ] %asi
+  98:	c0 f0 23 e8 	stxa  %g0, [ 0x3e8 ] %asi
+  9c:	c0 f0 23 f0 	stxa  %g0, [ 0x3f0 ] %asi
+  a0:	c0 f0 23 f8 	stxa  %g0, [ 0x3f8 ] %asi
+  a4:	8f 90 20 00 	wrpr  0, %tl
+  a8:	a1 90 20 00 	wrpr  0, %gl
+  ac:	8d 80 20 00 	wr  %g0, 0, %fprs
+  b0:	85 80 20 00 	wr  %g0, 0, %ccr
+  b4:	87 80 20 00 	wr  %g0, 0, %asi
+  b8:	84 10 20 00 	clr  %g2
+  bc:	89 90 80 00 	wrpr  %g2, %tick
+  c0:	84 10 20 00 	clr  %g2
+  c4:	b1 80 80 00 	mov  %g2, %asr24
+  c8:	84 10 20 01 	mov  1, %g2
+  cc:	85 28 b0 3f 	sllx  %g2, 0x3f, %g2
+  d0:	af 80 80 00 	mov  %g2, %asr23
+  d4:	b3 80 80 00 	mov  %g2, %asr25
+  d8:	bf 98 80 00 	wrhpr  %g2, %hstick_cmpr
+  dc:	81 80 00 00 	mov  %g0, %y
+  e0:	91 90 20 0f 	wrpr  0xf, %pil
+  e4:	93 90 20 00 	wrpr  0, %cwp
+  e8:	95 90 20 06 	wrpr  6, %cansave
+  ec:	97 90 20 00 	wrpr  0, %canrestore
+  f0:	9b 90 20 00 	wrpr  0, %otherwin
+  f4:	99 90 20 07 	wrpr  7, %cleanwin
+  f8:	9d 90 20 07 	wrpr  7, %wstate
+  fc:	82 10 20 18 	mov  0x18, %g1
+ 100:	c0 f0 0a 01 	stxa  %g0, [ %g0 + %g1 ] #ASI_IMMU
+ 104:	c0 f0 0b 01 	stxa  %g0, [ %g0 + %g1 ] #ASI_DMMU
+ 108:	a2 10 20 03 	mov  3, %l1
+ 10c:	e2 f0 09 60 	stxa  %l1, [ %g0 ] #ASI_ESTATE_ERROR_EN
+ 110:	a2 10 20 03 	mov  3, %l1
+ 114:	82 10 20 aa 	mov  0xaa, %g1
+ 118:	83 28 70 20 	sllx  %g1, 0x20, %g1
+ 11c:	e2 70 60 00 	stx  %l1, [ %g1 ]
+ 120:	e2 70 60 40 	stx  %l1, [ %g1 + 0x40 ]
+ 124:	e2 70 60 80 	stx  %l1, [ %g1 + 0x80 ]
+ 128:	e2 70 60 c0 	stx  %l1, [ %g1 + 0xc0 ]
+ 12c:	a3 46 80 00 	rd  %asr26, %l1
+ 130:	03 00 00 07 	sethi  %hi(0x1c00), %g1
+ 134:	82 10 63 00 	or  %g1, 0x300, %g1	! 1f00 <main+0x1f00>
+ 138:	a2 0c 40 01 	and  %l1, %g1, %l1
+ 13c:	a3 34 70 08 	srlx  %l1, 8, %l1
+ 140:	03 00 00 00 	sethi  %hi(0), %g1
+ 144:	05 00 01 30 	sethi  %hi(0x4c000), %g2
+ 148:	82 10 60 00 	mov  %g1, %g1
+ 14c:	84 10 a0 00 	mov  %g2, %g2
+ 150:	83 28 70 20 	sllx  %g1, 0x20, %g1
+ 154:	84 10 80 01 	or  %g2, %g1, %g2
+ 158:	a3 2c 70 03 	sllx  %l1, 3, %l1
+ 15c:	c4 58 80 11 	ldx  [ %g2 + %l1 ], %g2
+ 160:	82 10 20 80 	mov  0x80, %g1
+ 164:	c4 f0 4b 00 	stxa  %g2, [ %g1 ] #ASI_DMMU
+ 168:	2f 00 02 00 	sethi  %hi(0x80000), %l7
+ 16c:	8b 9d c0 00 	wrhpr  %l7, %htba
+ 170:	21 00 00 00 	sethi  %hi(0), %l0
+ 174:	03 00 01 30 	sethi  %hi(0x4c000), %g1
+ 178:	a0 14 20 00 	mov  %l0, %l0
+ 17c:	82 10 61 40 	or  %g1, 0x140, %g1
+ 180:	a1 2c 30 20 	sllx  %l0, 0x20, %l0
+ 184:	82 10 40 10 	or  %g1, %l0, %g1
+ 188:	85 28 b0 07 	sllx  %g2, 7, %g2
+ 18c:	82 00 40 02 	add  %g1, %g2, %g1
+ 190:	e2 58 40 00 	ldx  [ %g1 ], %l1
+ 194:	e2 f0 06 e0 	stxa  %l1, [ %g0 ] (55)
+ 198:	e2 58 60 08 	ldx  [ %g1 + 8 ], %l1
+ 19c:	e2 f0 07 e0 	stxa  %l1, [ %g0 ] (63)
+ 1a0:	e2 58 60 10 	ldx  [ %g1 + 0x10 ], %l1
+ 1a4:	e2 f0 06 a0 	stxa  %l1, [ %g0 ] (53)
+ 1a8:	e2 58 60 20 	ldx  [ %g1 + 0x20 ], %l1
+ 1ac:	e2 f0 06 c0 	stxa  %l1, [ %g0 ] (54)
+ 1b0:	e2 58 60 18 	ldx  [ %g1 + 0x18 ], %l1
+ 1b4:	e2 f0 07 a0 	stxa  %l1, [ %g0 ] (61)
+ 1b8:	e2 58 60 28 	ldx  [ %g1 + 0x28 ], %l1
+ 1bc:	e2 f0 07 c0 	stxa  %l1, [ %g0 ] (62)
+ 1c0:	e2 58 60 40 	ldx  [ %g1 + 0x40 ], %l1
+ 1c4:	e2 f0 06 60 	stxa  %l1, [ %g0 ] #ASI_PCACHE_SNOOP_TAG
+ 1c8:	e2 58 60 48 	ldx  [ %g1 + 0x48 ], %l1
+ 1cc:	e2 f0 07 60 	stxa  %l1, [ %g0 ] #ASI_WCACHE_SNOOP_TAG
+ 1d0:	e2 58 60 50 	ldx  [ %g1 + 0x50 ], %l1
+ 1d4:	e2 f0 06 20 	stxa  %l1, [ %g0 ] #ASI_PCACHE_DATA
+ 1d8:	e2 58 60 60 	ldx  [ %g1 + 0x60 ], %l1
+ 1dc:	e2 f0 06 40 	stxa  %l1, [ %g0 ] #ASI_PCACHE_TAG
+ 1e0:	e2 58 60 58 	ldx  [ %g1 + 0x58 ], %l1
+ 1e4:	e2 f0 07 20 	stxa  %l1, [ %g0 ] #ASI_WCACHE_DATA
+ 1e8:	e2 58 60 68 	ldx  [ %g1 + 0x68 ], %l1
+ 1ec:	e2 f0 07 40 	stxa  %l1, [ %g0 ] #ASI_WCACHE_TAG
+ 1f0:	94 10 20 80 	mov  0x80, %o2
+ 1f4:	c0 f2 8a e0 	stxa  %g0, [ %o2 ] #ASI_IMMU_DEMAP
+ 1f8:	c0 f2 8b e0 	stxa  %g0, [ %o2 ] #ASI_DMMU_DEMAP
+ 1fc:	a2 10 20 08 	mov  8, %l1
+ 200:	c0 f4 44 20 	stxa  %g0, [ %l1 ] #ASI_MMU
+ 204:	a2 10 20 10 	mov  0x10, %l1
+ 208:	c0 f4 44 20 	stxa  %g0, [ %l1 ] #ASI_MMU
+ 20c:	a2 10 20 0f 	mov  0xf, %l1
+ 210:	e2 f0 08 a0 	stxa  %l1, [ %g0 ] #ASI_LSU_CONTROL_REG
+ 214:	03 00 00 00 	sethi  %hi(0), %g1
+ 218:	05 00 05 10 	sethi  %hi(0x144000), %g2
+ 21c:	82 10 60 00 	mov  %g1, %g1
+ 220:	84 10 a0 00 	mov  %g2, %g2
+ 224:	83 28 70 20 	sllx  %g1, 0x20, %g1
+ 228:	84 10 80 01 	or  %g2, %g1, %g2
+ 22c:	87 48 00 00 	rdhpr  %hpstate, %g3
+ 230:	8f 90 20 01 	wrpr  1, %tl
+ 234:	88 10 20 00 	clr  %g4
+ 238:	83 99 00 00 	wrhpr  %g4, %htstate
+ 23c:	8f 90 20 00 	wrpr  0, %tl
+ 240:	90 10 20 00 	clr  %o0
+ 244:	81 c0 80 00 	jmp  %g2
+ 248:	81 98 28 00 	wrhpr  0x800, %hpstate
+ 24c:	01 00 00 00 	nop 
+ 250:	01 00 00 00 	nop 
+ 254:	82 10 20 0f 	mov  0xf, %g1	! f <main+0xf>
+ 258:	c2 f0 08 a0 	stxa  %g1, [ %g0 ] #ASI_LSU_CONTROL_REG
+ 25c:	c0 f0 08 60 	stxa  %g0, [ %g0 ] #ASI_DCACHE_UTAG
+ 260:	83 48 00 00 	rdhpr  %hpstate, %g1
+ 264:	01 00 00 00 	nop 
+ 268:	01 00 00 00 	nop 
+ 26c:	01 00 00 00 	nop 
+ 270:	01 00 00 00 	nop 
+ 274:	82 10 20 00 	clr  %g1	! 0 <main>
+ 278:	83 38 60 00 	sra  %g1, 0, %g1
+ 27c:	b0 10 00 01 	mov  %g1, %i0
+ 280:	81 cf e0 08 	rett  %i7 + 8
+ 284:	01 00 00 00 	nop 
Index: trunk/sw/compila
===================================================================
--- trunk/sw/compila	(revision 18)
+++ trunk/sw/compila	(revision 19)
@@ -7,3 +7,6 @@
 
 ## fa il dump del file
-/opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/objdump -d test.o
+/opt/sparc64-sun-solaris2.8-toolchain/sparc64-sun-solaris2.8/bin/objdump -d test.o >test.dump
+
+### crea memory.hex
+../tools/dump2hex.php <test.dump >../sim/memory.hex
Index: trunk/sw/hello.c
===================================================================
--- trunk/sw/hello.c	(revision 19)
+++ trunk/sw/hello.c	(revision 19)
@@ -0,0 +1,10 @@
+// Sample program that writes two words at a predefined address
+ 
+int main() {
+  unsigned long* address;
+  address = (unsigned long*)0x0000CAC0;
+  (*address) = 0xC1A0C1A0;  // First store
+  address = (unsigned long*)0x0000CAC0;
+  (*address) = 0xFABA1210;  // Second store
+  return 0;
+}
Index: trunk/sw/hello.dump
===================================================================
--- trunk/sw/hello.dump	(revision 19)
+++ trunk/sw/hello.dump	(revision 19)
@@ -0,0 +1,27 @@
+
+hello.o:     file format elf64-sparc
+
+
+Disassembly of section .text:
+
+0000000000000000 <main>:
+   0:	9d e3 bf 40 	save  %sp, -192, %sp
+   4:	82 10 23 2b 	mov  0x32b, %g1
+   8:	83 28 70 06 	sllx  %g1, 6, %g1
+   c:	c2 77 a7 f7 	stx  %g1, [ %fp + 0x7f7 ]
+  10:	c2 5f a7 f7 	ldx  [ %fp + 0x7f7 ], %g1
+  14:	05 30 68 30 	sethi  %hi(0xc1a0c000), %g2
+  18:	84 10 a1 a0 	or  %g2, 0x1a0, %g2	! c1a0c1a0 <main+0xc1a0c1a0>
+  1c:	c4 70 40 00 	stx  %g2, [ %g1 ]
+  20:	82 10 23 2b 	mov  0x32b, %g1
+  24:	83 28 70 06 	sllx  %g1, 6, %g1
+  28:	c2 77 a7 f7 	stx  %g1, [ %fp + 0x7f7 ]
+  2c:	c2 5f a7 f7 	ldx  [ %fp + 0x7f7 ], %g1
+  30:	05 3e ae 84 	sethi  %hi(0xfaba1000), %g2
+  34:	84 10 a2 10 	or  %g2, 0x210, %g2	! faba1210 <main+0xfaba1210>
+  38:	c4 70 40 00 	stx  %g2, [ %g1 ]
+  3c:	82 10 20 00 	clr  %g1
+  40:	83 38 60 00 	sra  %g1, 0, %g1
+  44:	b0 10 00 01 	mov  %g1, %i0
+  48:	81 cf e0 08 	rett  %i7 + 8
+  4c:	01 00 00 00 	nop 
Index: trunk/tools/dump2hex.php
===================================================================
--- trunk/tools/dump2hex.php	(revision 17)
+++ trunk/tools/dump2hex.php	(revision 19)
@@ -6,5 +6,5 @@
 
   // Discard first lines
-  for($i=0; $i<6; $i++) fgets($fp);
+  for($i=0; $i<7; $i++) fgets($fp);
 
   // Print only the opcodes to stdout
@@ -17,10 +17,12 @@
     }*/
 
-    $opcode = substr($line, 8, 4);
+    $opcode = substr($line, 6, 2);
+    $opcode2 = substr($line, 9, 2);
     $caratteri = strlen($opcode);
     if($caratteri != 0){
-        echo $opcode."\n";
-        $opcode = substr($line, 12, 4);
-        echo $opcode."\n";
+        echo $opcode.$opcode2."\n";
+        $opcode = substr($line, 12, 2);
+        $opcode2 = substr($line, 15, 2);
+        echo $opcode.$opcode2."\n";
     }
     else{
