comparison gpf/BIN/cg_na9.awk @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 #-----------------------------------------------------------------------------
2 # Project :
3 # Modul :
4 #-----------------------------------------------------------------------------
5 # Copyright 2002 Texas Instruments Berlin, AG
6 # All rights reserved.
7 #
8 # This file is confidential and a trade secret of Texas
9 # Instruments Berlin, AG
10 # The receipt of or possession of this file does not convey
11 # any rights to reproduce or disclose its contents or to
12 # manufacture, use, or sell anything it may describe, in
13 # whole, or in part, without the specific written consent of
14 # Texas Instruments Berlin, AG.
15 #-----------------------------------------------------------------------------
16 #| Purpose : extract stacksize information from ARM9 asm files
17 #-----------------------------------------------------------------------------
18 /.*FUNCTION NAME: \$/{
19 if (infunc)
20 printf ("end %s %d\n\n", fn, s+p);
21 infunc = 1;
22 s = 0;
23 p = 0;
24 fn = gensub(/.*\$([^ ]+) .*/, "\\1", 1, $0)
25 print "proc " fn
26 }
27
28 /BL *\$/{
29 if (infunc)
30 print " call " gensub(/.*\$([^;]+).*$/, "\\1", 1, $0)
31 }
32
33 /FUNCTION VENEER:/{
34 if (infunc)
35 printf ("end %s %d\n\n", fn, s+p);
36 infunc = 0;
37 }
38
39 /ADD *SP, #-/{
40 s = gensub(/.*-([0-9]*).*$/, "\\1", 1, $0)
41 }
42
43 /PUSH/{
44 p0 = split($0, foo, ",")
45 p += p0 * 4
46 }
47
48 END{
49 if (infunc)
50 printf ("end %s %d\n\n", fn, s+p);
51 }