dat2rdram
624 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/sbin/perl
#
#
$offset = 0;
while ($#ARGV >= 0){
shift (@ARGV);
$offset = 0x600;
}
$addr = 0;
while (<>) {
chop;
split;
if ($_[1] eq "") {
$W1 = 0;
}
else {
$W1 = $_[1];
}
if ($_[2] eq "") {
$W2 = 0;
}
else {
$W2 = $_[2];
}
if ($_[3] eq "") {
$W3 = 0;
}
else {
$W3 = $_[3];
}
if ($_[4] eq "") {
$W4 = 0;
}
else {
$W4 = $_[4];
}
if ($addr < 512) {
printf "@%4.4X %8.8lX_%8.8lX\n", $offset + ($addr++), hex($W1),hex($W2);
printf "@%4.4X %8.8lX_%8.8lX\n", $offset + ($addr++), hex($W3),hex($W4);
}
}