OpenCores
URL https://opencores.org/ocsvn/blue/blue/trunk

Subversion Repositories blue

[/] [blue/] [trunk/] [blue8/] [asm2bin.awk] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wd5gnr
#!/usr/bin/gawk -f
2
BEGIN { loc=0 }
3
 
4
/^@ [0-9a-fA-F]/ {
5
  l=loc;
6
  loc=strtonum("0x" $2);
7
  if (l>loc) printf(stderr,"Warning: origin overlap at 0x%x\n",$2) >"stderr";
8
  while (l++<loc) printf("%c%c",0,0);
9
  next;
10
}
11
/^[0-9a-fA-F]/ {
12
  x=strtonum("0x" $1);
13
  x1=int(x/256);
14
  x2=x-(x1*256);
15
  printf("%c%c",x1,x2);
16
  loc++;
17
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.