Hmm... Something about this is not working for me....
When I try to load my .hack files into the CPU Emulator I get the error, "illegal character".
I modified my assembler (I'm using C#, for better or for worse) and what I'm reading here:
https://www.arclab.com/en/kb/csharp/read-write-text-file-ansi-utf8-unicode.html...seems to be telling me to use Encoding.Default for ANSI output (I've also tried Unicode and UTF8, fwiw, all with the same result)
File.WriteAllText(fileOut, ThisOutput(outStream), System.Text.Encoding.Default);
// convert List of words into a string for output to a file
private static string ThisOutput(List<String> list)
{
using (StringWriter stream_out = new StringWriter())
{
string line;
int i = 0;
while (i < list.Count)
{
line = list[i];
stream_out.Write(line + "\r\n");
i++;
}
return stream_out.ToString();
}
}
Is my currently failing solution... Any pointers would be appreciated, thank you!