A more flushed out version of https://www.quora.com/Homework-Question-How-do-I-write-a-program-that-produces-the-following-output-1/answer/JC-Credland that should directly work in qemu using bits from http://mikeos.sourceforge.net/write-your-own-os.html since the original answer's string print function did not appear correct