improve readme and example of the stdio module

This commit is contained in:
2020-10-08 00:56:59 +02:00
parent 9d7f3d25c8
commit 034c7b991f
2 changed files with 40 additions and 2 deletions
+10 -2
View File
@@ -6,12 +6,20 @@
(:loop)
(ld r0 @stdin)
; exit by pressing 'q'
(cmp r0 'q'
(=? (ld @stdout '\n')
(halt)))
; uppercase ASCII
(cmp r0 'a' (<? (j :badchar)))
(cmp r0 'z' (>? (j :badchar)))
(sub r0 32) ; to uppercase
(sub r0 32)
(ld @stdout r0)
(j :loop)
(:badchar)
(ld @stdout '🐈')
(ld @stdout '🐈') ; show a kitty if not ASCII
(j :loop)
)