equal
deleted
inserted
replaced
7 # |
7 # |
8 # Initial Contributors: |
8 # Initial Contributors: |
9 # Nokia Corporation - initial contribution. |
9 # Nokia Corporation - initial contribution. |
10 # |
10 # |
11 # Contributors: |
11 # Contributors: |
|
12 # Mike Kinghan, mikek@symbian.org, for Symbian Foundation |
12 # |
13 # |
13 # Description: |
14 # Description: |
14 # e32toolp\e32util\armasm2as.pl |
15 # e32toolp\e32util\armasm2as.pl |
15 # Convert an ARMASM assembler source or include file to AS format |
16 # Convert an ARMASM assembler source or include file to AS format |
16 # Syntax: |
17 # Syntax: |
286 $val =~ s/________LE________/\<\=/g; |
287 $val =~ s/________LE________/\<\=/g; |
287 $val =~ s/________GE________/\>\=/g; |
288 $val =~ s/________GE________/\>\=/g; |
288 $val =~ s/\{TRUE\}/(1)/g; |
289 $val =~ s/\{TRUE\}/(1)/g; |
289 $val =~ s/\{FALSE\}/(0)/g; |
290 $val =~ s/\{FALSE\}/(0)/g; |
290 |
291 |
291 my @lops = split( /(\s*\:LAND\:\s*|\s*\:LOR\:\s*|\s*\:LNOT\:\s*|\s*\:DEF\:\s*)/, $val ); |
292 my @lops = split( /(\s*\:LAND\:\s*|\s*\:LOR\:\s*|\s*\:LNOT\:\s*|\s*\:DEF\:\s*|\s*\(\s*|\s*\)\s*)/, $val ); |
|
293 my @lops2; |
292 foreach (@lops) { |
294 foreach (@lops) { |
293 s/\s*\:LAND\:\s*/\:LAND\:/go; |
295 s/\s*\:LAND\:\s*/\:LAND\:/go; |
294 s/\s*\:LOR\:\s*/\:LOR\:/go; |
296 s/\s*\:LOR\:\s*/\:LOR\:/go; |
295 s/\s*\:LNOT\:\s*/\:LNOT\:/go; |
297 s/\s*\:LNOT\:\s*/\:LNOT\:/go; |
296 s/\s*\:DEF\:\s*/\:DEF\:/go; |
298 s/\s*\:DEF\:\s*/\:DEF\:/go; |
304 $sym =~ s/\s*$//; |
306 $sym =~ s/\s*$//; |
305 if ($sym =~ /^(\w|\$|\\)+$/) { |
307 if ($sym =~ /^(\w|\$|\\)+$/) { |
306 push @$outref, "\t.ifdef $sym\n\t.set __defined__$sym, 1\n\t.else\n\t.set __defined__$sym, 0\n\t.endif\n"; |
308 push @$outref, "\t.ifdef $sym\n\t.set __defined__$sym, 1\n\t.else\n\t.set __defined__$sym, 0\n\t.endif\n"; |
307 push @lops2, " __defined__$sym "; |
309 push @lops2, " __defined__$sym "; |
308 } else { |
310 } else { |
309 die "Bad :DEF: operand\n"; |
311 die "Bad :DEF: operand $sym\n"; |
310 } |
312 } |
311 } elsif ($x eq ':LAND:') { |
313 } elsif ($x eq ':LAND:') { |
312 push @lops2, ' && '; |
314 push @lops2, ' && '; |
313 } elsif ($x eq ':LOR:') { |
315 } elsif ($x eq ':LOR:') { |
314 push @lops2, ' || '; |
316 push @lops2, ' || '; |