Message Integrity Checking
[uccvend-snackrom.git] / ROM2 / src2asm.pl
1 #!/usr/bin/perl -w
2
3 # keep the format of this next line the same to match regex in check-romsrc.pl
4 $origin = 0x9d80;
5 $hole_start = 0xb600;
6 $hole_size = 0x0200;
7
8 print <<EOT;
9 .sect .rodata
10 .global _rom_src_data
11 .global _rom_src_len
12
13 .align 7 ; for a 128-bit boundary
14 _rom_src_data:
15 EOT
16 my $size = 0;
17 my $a;
18 while (read STDIN,$a,1) {
19         if ($origin+$size == $hole_start) {
20                 for($i = 0; $i < $hole_size; $i++) {
21                         print "\t.byte 0xff\n";
22                 }
23                 $size += $hole_size;
24         }
25         printf "\t.byte 0x%04x\n", ord($a);
26         $size++;
27 }
28 print <<EOT;
29
30         .align 2
31 _rom_src_len:
32         .word $size
33 EOT

UCC git Repository :: git.ucc.asn.au