"E97": example of cycle program

Type latin alphabet from "A" to "Z" on display screen.

The initial symbol "A" has code 65=41h. So we put it into R0 and call ROM subroutine, that outputs character. The next letter can be get after increment of R0. If the result exceeds 5Ah ("Z"), the cycle ends.

AddressCodeOperationComments
0000
0002
0E6D
0030
30 ==> SP set SP for correct
subroutine calls
0004
0006
01D0
0041
41 ==> R0
("A")
first symbol code
0008
000A
9C0D
4088
call subroutine
4088
output to screen
000C2210 R0 + 1 ==> R0 next symbol
000E
0010
04D0
005A
compare R0 with 5A
("Z")
code <= "Z"?
00126DF4 if <=0, then pc=pc+F4 repeat cycle (to 0008)
00140F00 haltstop

Try and examine, how it works in "E97".

Back to main applet page
1