The following C function prints the integer in the accumulator. It doesn't work (due to overflow) if it happens to be the most negative integer. The contents of the accumulator are lost. void printint(void) { int weight = 1; if (AC<0) {putchar('-'); AC = -AC;} while (AC/weight >= 10) weight *= 10; while(1) { putchar(AC/weight+'0'); if(weight==1) return; AC %= weight; weight /= 10; } } Here's a translation to assembly language. toprint: W 1 weight: I 1 charminus: C'-' char0: I 48 mask: H 80000000 C0: I 0 C1: I 1 C10: I 10 printint: W 1 STA toprint AND mask BZE while1 LDA charminus out1: OUT out1 LDA C0 SUB toprint STA toprint while1: LDA toprint DIV weight SUB C10 AND mask BZE body1 BUN while2 body1: LDA weight MUL C10 STA weight BUN while1 while2: LDA toprint DIV weight ADD char0 out2: OUT out2 LDA weight XOR C1 BZE return LDA toprint MOD weight STA toprint LDA weight DIV C10 STA weight BUN while2 return: BIN printint