Sharp X68000 Disassemblies
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
674 B

#include <stdio.h>
#include <string.h>
int main(int argc, char **argv) {
char buf[512];
while(fgets(buf, sizeof(buf), stdin)) {
char *from = buf;
char *to = strchr(buf, '\t');
if(!to) continue;
*to = 0;
char *end = strchr(to, '\n');
if(end) *end = 0;
for(unsigned char *c = from; *c; c++) {
if(*c > 127) printf("\\x%02x", *c);
else if(strchr("$.*[\\^/", *c)) printf("\\%c", *c);
else printf("%c", *c);
for(unsigned char *c = to; *c; c++) {
if(strchr("/", *c)) printf("\\%c", *c);
else if(strchr("'", *c)) printf("',$%02x,'", *c);
else printf("%c", *c);
return 0;