dat2rdram 629 Bytes
#!/usr/local/bin/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);
   }
}