A Small Program Translated into Machine-Language

The SPOT Program
write 1,c2
write 10,c3
fred:
jump-if-gt finish,c2,c3
say c2
say ","
inc c2
jump fred
finish:
stop
Instruction codes
15WRITE #,C
33JUMP
34JUMP-IF-GT
51SAY C
52SAY CHAR
23INC C
0STOP

Machine-Language Version

Memory locationValueComment
10015WRITE
10111
1022C2
10315WRITE
1041010
1053C3
10634JUMP-IF-GT
1079(9 locations forward to 118 from 109)
1082C2
1093C3
11051SAY
1112C2
11252SAY
11344Ascii code for ","
11423INC
1152C2
11633JUMP
117-11(-11 locations backward to 106)
1180STOP
119