Started work on atari/tos.

This commit is contained in:
Markus F.X.J. Oberhumer
2006-11-12 10:58:04 +01:00
parent a74e239e28
commit 76771b845a
8 changed files with 1564 additions and 1243 deletions
+1203 -905
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -100,7 +100,7 @@ fillbytes_sr: FILLBYTES_SR
decompr_literal:
move.b (a0)+,(a1)+
//.globl decompr_start
.globl decompr_start
decompr_start:
decompr_loop:
#ifdef SMALL
+1 -1
View File
@@ -101,7 +101,7 @@ fillbytes_sr: FILLBYTES_SR
decompr_literal:
move.b (a0)+,(a1)+
//.globl decompr_start
.globl decompr_start
decompr_start:
decompr_loop:
#ifdef SMALL
+1 -1
View File
@@ -99,7 +99,7 @@ fillbytes_sr: FILLBYTES_SR
decompr_literal:
move.b (a0)+,(a1)+
//.globl decompr_start
.globl decompr_start
decompr_start:
decompr_loop:
#ifdef SMALL
+47 -31
View File
@@ -198,9 +198,7 @@ done:
// are contiguous in memory
**************************************************************************/
section tos0
start:
section entry
move.l a0,d0 // a0 is basepage if accessory
beqs 1f
move.l 4(a0),sp // accessory - get stack
@@ -245,24 +243,6 @@ section loop1_set_count.l
move.l #loop1_count,d0
section loop1_label
loop1:
section loop1.small
// copy 4 bytes per loop
move.l -(a4),-(a3)
section loop1_subql
subq.l #1,d0
bnes loop1
section loop1_subqw
subq.w #1,d0
bnes loop1
section loop1_dbra
dbra d0,loop1
section loop2.small
// loop2 - EMPTY section
section loop1.fast
// loop1 - use 10 registers to copy 4*10*4 = 160 bytes per loop
@@ -276,12 +256,29 @@ section loop1.fast
movem.l (a4),d1-d3/d5-d7/a0-a2/a5
movem.l d1-d3/d5-d7/a0-a2/a5,-(a3)
section loop1.small
// loop1 - copy 4 bytes per loop
move.l -(a4),-(a3)
section loop1_subql
subq.l #1,d0
bnes loop1_label
section loop1_subqw
subq.w #1,d0
bnes loop1_label
section loop1_dbra
dbra d0,loop1_label
section loop2.fast
// loop2 - copy the remaining 4..160 bytes
moveq.l #loop2_count,d0
loop2: move.l -(a4),-(a3)
dbra d0,loop2
section loop2.small
// loop2 - EMPTY section
// a3 now points to the start of the compressed block
@@ -340,6 +337,7 @@ section nrv2e.init
moveq.l #0,d7
moveq.l #-0x50,d6 // 0xffffffb0
lsl.w #4,d6 // 0xfffffb00 == -0x500
section lzma.init
// ------------- jump to copied decompressor
@@ -368,11 +366,10 @@ section clear_bss
// d3.l 0
section loop3_label:
loop3:
section loop3.small:
section loop3_label
section loop3.small
move.l d3,(a6)+
section loop3.fast:
section loop3.fast
// the dirty bss is usually not too large, so we don't
// bother making movem optimizations here
move.l d3,(a6)+
@@ -381,12 +378,12 @@ section loop3.fast:
move.l d3,(a6)+
section loop3_subql
subq.l #1,d6
bnes loop3
bnes loop3_label
section loop3_subqw
subq.w #1,d6
bnes loop3
bnes loop3_label
section loop3_dbra
dbra d6,loop3
dbra d6,loop3_label
// ------------- flush the cache
@@ -407,6 +404,8 @@ flush_cache_rts:
// ------------- restore ASTACK
section clear_dirty_stack
lea clear_bss_size_p4:w(ASTACK),sp
// assert sp == clear_bss_end(pc)+4
@@ -414,8 +413,6 @@ flush_cache_rts:
// ------------- clear the dirty stack
section clear_dirty_stack
// clear down to clear_bss(pc) + 32 extra longs
//moveq.l #((L(loop)-clear_bss+3)/4+32-1),d0
moveq.l #clear_dirty_stack_len,d0
@@ -524,6 +521,15 @@ section nrv2e_8.small
#undef d2
section lzma.fast
#include "arch/m68k/m68000/lzma_d_cf.S"
moveq.l #0,d3
section lzma.small
#include "arch/m68k/m68000/lzma_d_cs.S"
moveq.l #0,d3
// note: d3.l is 0 from decompressor above
@@ -608,10 +614,19 @@ section jmpstack
jmp (ASTACK) // jmp clear_bss (on stack)
// ------------- absolute symbols ("*ABS*")
/*************************************************************************
// absolute symbols ("*ABS*")
**************************************************************************/
section abs_symbols
//.globl copy_to_stack_len
//copy_to_stack_len = (clear_bss_end-clear_bss)/2-1
.globl flush_cache_rts_offset
flush_cache_rts_offset = flush_cache_rts - flush_cache
#if 0
#define N(a,b) \
.globl a##_##b##_start_offset; \
a##_##b##_start_offset = a##_##b##_decompr_start - a.b
@@ -628,6 +643,7 @@ N(nrv2e_8,small)
N(lzma,fast)
N(lzma,small)
#undef N
#endif
// vi:ts=8:et:nowrap
+59 -58
View File
@@ -2,71 +2,75 @@ tmp/m68k-atari.tos.bin: file format elf32-m68k
Sections:
Idx Name Size VMA LMA File off Algn Flags
0 tos0 0000003e 00000000 00000000 00000034 2**0 CONTENTS, RELOC, READONLY
0 entry 0000003e 00000000 00000000 00000034 2**0 CONTENTS, RELOC, READONLY
1 loop1_set_count.b 00000002 00000000 00000000 00000072 2**0 CONTENTS, RELOC, READONLY
2 loop1_set_count.w 00000004 00000000 00000000 00000074 2**0 CONTENTS, RELOC, READONLY
3 loop1_set_count.l 00000006 00000000 00000000 00000078 2**0 CONTENTS, RELOC, READONLY
4 loop1_label 00000000 00000000 00000000 0000007e 2**0 CONTENTS, READONLY
5 loop1.small 00000002 00000000 00000000 0000007e 2**0 CONTENTS, READONLY
6 loop1_subql 00000004 00000000 00000000 00000080 2**0 CONTENTS, RELOC, READONLY
7 loop1_subqw 00000004 00000000 00000000 00000084 2**0 CONTENTS, RELOC, READONLY
8 loop1_dbra 00000004 00000000 00000000 00000088 2**0 CONTENTS, RELOC, READONLY
9 loop2.small 00000000 00000000 00000000 0000008c 2**0 CONTENTS, READONLY
10 loop1.fast 0000002a 00000000 00000000 0000008c 2**0 CONTENTS, READONLY
11 loop2.fast 00000008 00000000 00000000 000000b6 2**0 CONTENTS, RELOC, READONLY
5 loop1.fast 0000002a 00000000 00000000 0000007e 2**0 CONTENTS, READONLY
6 loop1.small 00000002 00000000 00000000 000000a8 2**0 CONTENTS, READONLY
7 loop1_subql 00000004 00000000 00000000 000000aa 2**0 CONTENTS, RELOC, READONLY
8 loop1_subqw 00000004 00000000 00000000 000000ae 2**0 CONTENTS, RELOC, READONLY
9 loop1_dbra 00000004 00000000 00000000 000000b2 2**0 CONTENTS, RELOC, READONLY
10 loop2.fast 00000008 00000000 00000000 000000b6 2**0 CONTENTS, RELOC, READONLY
11 loop2.small 00000000 00000000 00000000 000000be 2**0 CONTENTS, READONLY
12 copy_to_stack 00000016 00000000 00000000 000000be 2**0 CONTENTS, RELOC, READONLY
13 nrv2b.init 00000008 00000000 00000000 000000d4 2**0 CONTENTS, READONLY
14 nrv2d.init 00000008 00000000 00000000 000000dc 2**0 CONTENTS, READONLY
15 nrv2e.init 00000008 00000000 00000000 000000e4 2**0 CONTENTS, READONLY
16 jmp_decompressor 0000000c 00000000 00000000 000000ec 2**0 CONTENTS, RELOC, READONLY
17 clear_bss 00000000 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
18 loop3_label: 00000000 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
19 loop3.small: 00000002 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
20 loop3.fast: 00000008 00000000 00000000 000000fa 2**0 CONTENTS, READONLY
21 loop3_subql 00000004 00000000 00000000 00000102 2**0 CONTENTS, RELOC, READONLY
22 loop3_subqw 00000004 00000000 00000000 00000106 2**0 CONTENTS, RELOC, READONLY
23 loop3_dbra 00000004 00000000 00000000 0000010a 2**0 CONTENTS, RELOC, READONLY
24 flush_cache 0000007c 00000000 00000000 0000010e 2**0 CONTENTS, RELOC, READONLY
25 clear_dirty_stack 0000000c 00000000 00000000 0000018a 2**0 CONTENTS, RELOC, READONLY
26 start_program 0000000c 00000000 00000000 00000196 2**0 CONTENTS, READONLY
27 UPX1HEAD 00000020 00000000 00000000 000001a2 2**0 CONTENTS, READONLY
28 CUTPOINT 00000000 00000000 00000000 000001c2 2**0 CONTENTS, READONLY
29 nrv2b_8.fast 0000007c 00000000 00000000 000001c2 2**0 CONTENTS, READONLY
30 nrv2d_8.fast 00000090 00000000 00000000 0000023e 2**0 CONTENTS, READONLY
31 nrv2e_8.fast 00000098 00000000 00000000 000002ce 2**0 CONTENTS, READONLY
32 nrv2b_8.small 00000076 00000000 00000000 00000366 2**0 CONTENTS, READONLY
33 nrv2d_8.small 0000008a 00000000 00000000 000003dc 2**0 CONTENTS, READONLY
34 nrv2e_8.small 00000092 00000000 00000000 00000466 2**0 CONTENTS, READONLY
35 __mulsi3 0000001c 00000000 00000000 000004f8 2**0 CONTENTS, READONLY
36 reloc 0000001a 00000000 00000000 00000514 2**0 CONTENTS, READONLY
37 loop3_set_count.b 00000002 00000000 00000000 0000052e 2**0 CONTENTS, RELOC, READONLY
38 loop3_set_count.w 00000004 00000000 00000000 00000530 2**0 CONTENTS, RELOC, READONLY
39 loop3_set_count.l 00000006 00000000 00000000 00000534 2**0 CONTENTS, RELOC, READONLY
40 jmpstack 00000002 00000000 00000000 0000053a 2**0 CONTENTS, READONLY
41 abs_symbols 00000000 00000000 00000000 0000053c 2**0 CONTENTS, READONLY
16 lzma.init 00000000 00000000 00000000 000000ec 2**0 CONTENTS, READONLY
17 jmp_decompressor 0000000c 00000000 00000000 000000ec 2**0 CONTENTS, RELOC, READONLY
18 clear_bss 00000000 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
19 loop3_label 00000000 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
20 loop3.small 00000002 00000000 00000000 000000f8 2**0 CONTENTS, READONLY
21 loop3.fast 00000008 00000000 00000000 000000fa 2**0 CONTENTS, READONLY
22 loop3_subql 00000004 00000000 00000000 00000102 2**0 CONTENTS, RELOC, READONLY
23 loop3_subqw 00000004 00000000 00000000 00000106 2**0 CONTENTS, RELOC, READONLY
24 loop3_dbra 00000004 00000000 00000000 0000010a 2**0 CONTENTS, RELOC, READONLY
25 flush_cache 00000078 00000000 00000000 0000010e 2**0 CONTENTS, READONLY
26 clear_dirty_stack 00000010 00000000 00000000 00000186 2**0 CONTENTS, RELOC, READONLY
27 start_program 0000000c 00000000 00000000 00000196 2**0 CONTENTS, READONLY
28 UPX1HEAD 00000020 00000000 00000000 000001a2 2**0 CONTENTS, READONLY
29 CUTPOINT 00000000 00000000 00000000 000001c2 2**0 CONTENTS, READONLY
30 nrv2b_8.fast 0000007c 00000000 00000000 000001c2 2**0 CONTENTS, READONLY
31 nrv2d_8.fast 00000090 00000000 00000000 0000023e 2**0 CONTENTS, READONLY
32 nrv2e_8.fast 00000098 00000000 00000000 000002ce 2**0 CONTENTS, READONLY
33 nrv2b_8.small 00000076 00000000 00000000 00000366 2**0 CONTENTS, READONLY
34 nrv2d_8.small 0000008a 00000000 00000000 000003dc 2**0 CONTENTS, READONLY
35 nrv2e_8.small 00000092 00000000 00000000 00000466 2**0 CONTENTS, READONLY
36 lzma.fast 000008ac 00000000 00000000 000004f8 2**0 CONTENTS, READONLY
37 lzma.small 000008ac 00000000 00000000 00000da4 2**0 CONTENTS, READONLY
38 __mulsi3 0000001c 00000000 00000000 00001650 2**0 CONTENTS, READONLY
39 reloc 0000001a 00000000 00000000 0000166c 2**0 CONTENTS, READONLY
40 loop3_set_count.b 00000002 00000000 00000000 00001686 2**0 CONTENTS, RELOC, READONLY
41 loop3_set_count.w 00000004 00000000 00000000 00001688 2**0 CONTENTS, RELOC, READONLY
42 loop3_set_count.l 00000006 00000000 00000000 0000168c 2**0 CONTENTS, RELOC, READONLY
43 jmpstack 00000002 00000000 00000000 00001692 2**0 CONTENTS, READONLY
44 abs_symbols 00000000 00000000 00000000 00001694 2**0 CONTENTS, READONLY
SYMBOL TABLE:
00000000 l d loop1_label 00000000 loop1_label
00000000 l d flush_cache 00000000 flush_cache
00000000 l d loop3_label: 00000000 loop3_label:
00000000 l d tos0 00000000 tos0
00000000 l d loop3_label 00000000 loop3_label
00000000 l d entry 00000000 entry
00000000 l d loop1_set_count.b 00000000 loop1_set_count.b
00000000 l d loop1_set_count.w 00000000 loop1_set_count.w
00000000 l d loop1_set_count.l 00000000 loop1_set_count.l
00000000 l d loop1.fast 00000000 loop1.fast
00000000 l d loop1.small 00000000 loop1.small
00000000 l d loop1_subql 00000000 loop1_subql
00000000 l d loop1_subqw 00000000 loop1_subqw
00000000 l d loop1_dbra 00000000 loop1_dbra
00000000 l d loop2.small 00000000 loop2.small
00000000 l d loop1.fast 00000000 loop1.fast
00000000 l d loop2.fast 00000000 loop2.fast
00000000 l d loop2.small 00000000 loop2.small
00000000 l d copy_to_stack 00000000 copy_to_stack
00000000 l d nrv2b.init 00000000 nrv2b.init
00000000 l d nrv2d.init 00000000 nrv2d.init
00000000 l d nrv2e.init 00000000 nrv2e.init
00000000 l d lzma.init 00000000 lzma.init
00000000 l d jmp_decompressor 00000000 jmp_decompressor
00000000 l d clear_bss 00000000 clear_bss
00000000 l d loop3.small: 00000000 loop3.small:
00000000 l d loop3.fast: 00000000 loop3.fast:
00000000 l d loop3.small 00000000 loop3.small
00000000 l d loop3.fast 00000000 loop3.fast
00000000 l d loop3_subql 00000000 loop3_subql
00000000 l d loop3_subqw 00000000 loop3_subqw
00000000 l d loop3_dbra 00000000 loop3_dbra
@@ -80,6 +84,8 @@ SYMBOL TABLE:
00000000 l d nrv2b_8.small 00000000 nrv2b_8.small
00000000 l d nrv2d_8.small 00000000 nrv2d_8.small
00000000 l d nrv2e_8.small 00000000 nrv2e_8.small
00000000 l d lzma.fast 00000000 lzma.fast
00000000 l d lzma.small 00000000 lzma.small
00000000 l d __mulsi3 00000000 __mulsi3
00000000 l d reloc 00000000 reloc
00000000 l d loop3_set_count.b 00000000 loop3_set_count.b
@@ -95,21 +101,19 @@ SYMBOL TABLE:
00000000 *UND* 00000000 loop2_count
0000000c g start_program 00000000 clear_bss_end
00000000 *UND* 00000000 copy_to_stack_len
00000000 *UND* 00000000 flush_cache_rts_offset
00000076 g *ABS* 00000000 flush_cache_rts_offset
00000000 *UND* 00000000 up31
00000000 *UND* 00000000 clear_bss_size_p4
00000000 *UND* 00000000 clear_dirty_stack_len
00000002 g nrv2b_8.fast 00000000 nrv2b_8_fast_decompr_start
00000002 g nrv2d_8.fast 00000000 nrv2d_8_fast_decompr_start
00000002 g nrv2e_8.fast 00000000 nrv2e_8_fast_decompr_start
00000002 g nrv2b_8.small 00000000 nrv2b_8_small_decompr_start
00000002 g nrv2d_8.small 00000000 nrv2d_8_small_decompr_start
00000002 g nrv2e_8.small 00000000 nrv2e_8_small_decompr_start
00000000 *UND* 00000000 loop3_count
00000002 g *ABS* 00000000 nrv2b_8_fast_start_offset
00000002 g *ABS* 00000000 nrv2d_8_fast_start_offset
00000002 g *ABS* 00000000 nrv2e_8_fast_start_offset
00000002 g *ABS* 00000000 nrv2b_8_small_start_offset
00000002 g *ABS* 00000000 nrv2d_8_small_start_offset
00000002 g *ABS* 00000000 nrv2e_8_small_start_offset
00000000 g *ABS* 00000000 lzma_fast_start_offset
00000000 g *ABS* 00000000 lzma_small_start_offset
RELOCATION RECORDS FOR [tos0]:
RELOCATION RECORDS FOR [entry]:
OFFSET TYPE VALUE
0000001c R_68K_32 up11
00000026 R_68K_32 up12
@@ -157,23 +161,20 @@ OFFSET TYPE VALUE
RELOCATION RECORDS FOR [loop3_subql]:
OFFSET TYPE VALUE
00000003 R_68K_PC8 loop3_label:+0xffffffff
00000003 R_68K_PC8 loop3_label+0xffffffff
RELOCATION RECORDS FOR [loop3_subqw]:
OFFSET TYPE VALUE
00000003 R_68K_PC8 loop3_label:+0xffffffff
00000003 R_68K_PC8 loop3_label+0xffffffff
RELOCATION RECORDS FOR [loop3_dbra]:
OFFSET TYPE VALUE
00000002 R_68K_PC16 loop3_label:
RELOCATION RECORDS FOR [flush_cache]:
OFFSET TYPE VALUE
0000007a R_68K_16 clear_bss_size_p4
00000002 R_68K_PC16 loop3_label
RELOCATION RECORDS FOR [clear_dirty_stack]:
OFFSET TYPE VALUE
00000001 R_68K_8 clear_dirty_stack_len
00000002 R_68K_16 clear_bss_size_p4
00000005 R_68K_8 clear_dirty_stack_len
RELOCATION RECORDS FOR [loop3_set_count.b]:
OFFSET TYPE VALUE