File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ ;#include "text-io.dasm"
2+
3+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4+ ;; puts (needs base screen routines)
5+
6+ ; writes a null-terminated string to the current
7+ ; position.
8+ :puts
9+ IFE [A], 0
10+ SET PC, POP
11+ SET PUSH, A
12+ SET A, [A]
13+ JSR putc
14+ SET A, POP
15+ ADD A, 1
16+ SET PC, puts ; tail call
17+
18+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19+ ;; putsn (needs base screen routines)
20+
21+ ;; void putsn(char *src, char len)
22+ ; writes a string of length n to the current
23+ ; position. It is useful for printing a prefix of
24+ ; a string or for pascal strings.
25+ :putsn
26+ IFE B, 0
27+ SET PC, POP
28+ SET PUSH, J
29+ SET PUSH, I
30+ SET J, A
31+ SET I, A
32+ ADD I, B
33+ :putsn_loop
34+ SET A, [I]
35+ JSR putc
36+ ADD I, 1
37+ IFN I, J
38+ SET PC, putsn_loop
39+ SET I, POP
40+ SET J, POP
41+ SET PC, POP
You can’t perform that action at this time.
0 commit comments