1 # print 'n' with enough leading spaces to be right-justified in 'width' 2 fn print-int32-decimal-right-justified screen: (addr screen), n: int, _width: int { 3 # tweak things for negative numbers 4 var n-width/eax: int <- decimal-size n 5 var width/ecx: int <- copy _width 6 { 7 compare n-width, width 8 break-if->= 9 print-grapheme screen, 0x20 # space 10 width <- decrement 11 loop 12 } 13 print-int32-decimal screen, n 14 }