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

Subversion Repositories blue

[/] [blue/] [trunk/] [blue8/] [asm2bin.awk] - Rev 2

Compare with Previous | Blame | View Log

#!/usr/bin/gawk -f
BEGIN { loc=0 }
 
/^@ [0-9a-fA-F]/ {
  l=loc;
  loc=strtonum("0x" $2);
  if (l>loc) printf(stderr,"Warning: origin overlap at 0x%x\n",$2) >"stderr";
  while (l++<loc) printf("%c%c",0,0);
  next;
}
/^[0-9a-fA-F]/ { 
  x=strtonum("0x" $1);
  x1=int(x/256);
  x2=x-(x1*256);
  printf("%c%c",x1,x2);
  loc++;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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