Updated wumpus to use `fastrand` instead of `random`.
[vvhitespace] / examples / hunt-the-wumpus / wump_ui.pvvs
CommitLineData
2da74194
AT
1#ifndef WUMP_UI
2#define WUMP_UI
3
4@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5@ This files contains user interface functions for Hunt the Wumpus.
6@ (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
7@ See LICENSE.txt file for copyright and license details.
8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
9
10@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
11@ Name:
12@ seed_rng
13@ Description:
14@ Generate seed from keyboard input.
15@ Call Stack:
16@ <empty>
17@ Return Stack:
18@ <empty>
19@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
20#include <logic.pvvs>
21NSSVTSSSSSTTN | MARK: 10000011 (seed_rng)
22
23SSSTSSSSN | PUSH 16 (loop counter)
24SSSSN | PUSH 0 (rng seed)
25
26NSSVTSSSSSTTSSSSSSSSN | MARK: 10000011 00000000 (seed_rng:main loop)
27@ Get character from user and print ASCII '.' as feedback.
28SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
29TNTS | GETCHAR
30SSSTSTTTSN | PUSH ASCII '.'
31TNSS | PUTCHAR
32@ Left shift the seed by 4 bits.
33SSSTSSN | PUSH 4 (shift count)
34NSTTSTTSTN | JSR > 101101 (lshift)
35@ XOR seed with character from user.
36SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
37TTT | LOAD
38NSTTSTSTTN | JSR > 101011 (xor)
39@ Decrement counter
40SNT | SWAP
41SSSTN | PUSH +1
42TSST | SUBTRACT
43@ Test for loop completion
44SNS | DUP
45NTSTSSSSSTTSSSSSSSTN | BRZ > 10000011 00000001 (seed_rng:cleanup and return)
46SNT | SWAP
47NSNTSSSSSTTSSSSSSSSN | JMP > 10000011 00000000 (seed_rng:main loop)
48
49@ Store seed, clean up and return.
50NSSVTSSSSSTTSSSSSSSTN | MARK: 10000011 00000001 (seed_rng:cleanup and return)
51SNN | DROP
52SSSSN | PUSH 0 (seed address)
53SNT | SWAP
54TTS | STORE
55SSSTSTSN | PUSH ASCII '\n'
56SSSTSTSN | PUSH ASCII '\n'
57TNSS | PUTCHAR
58TNSS | PUTCHAR
59NTN | RTS
60
28a945f7
AT
61@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
62@ Name:
63@ is_room_adjacent
64@ Description:
65@ Checks if 'room_number' is adjacent to the player's current room.
66@ Call Stack:
67@ room_number <-- TOS
68@ Return Stack:
69@ (1 or 0) for true/false <-- TOS
70@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
71#include <stack.pvvs>
72NSSVTSTSSTSSN | MARK: 10100100 (is_room_adjacent)
73
74SSSTSSSSSSSSSSTTN | PUSH 0x1003 (ptr to number_of_tunnels_per_room)
75TTT | LOAD
76SSSTN | PUSH +1
77TSST | SUBTRACT
78
79@ TOS> tunnel_index, destination_room_num
80NSSVTSTSSTSSSSSSSSSSN | MARK: 10100100 00000000 (is_room_adjacent:main_loop)
81SSSTSN | PUSH +2
82NSTTTSSN | JSR > 1100 (deepdup)
83SSSTSN | PUSH +2
84NSTTTSSN | JSR > 1100 (deepdup)
85SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player_location)
86TTT | LOAD
87NSTTSSSTSSSN | JSR > 10001000 (get_tunnel_destination)
88TSST | SUBTRACT
89NTSTSTSSTSSSSSSSSSTN | BRZ > 10100100 00000001 (is_room_adjacent:found_tunnel)
90SSSTN | PUSH +1
91TSST | SUBTRACT
92SNS | DUP
93NTTTSTSSTSSSSSSSSTSN | BMI > 10100100 00000010 (is_room_adjacent:no_match)
94NSNTSTSSTSSSSSSSSSSN | JMP > 10100100 00000000 (is_room_adjacent:main_loop)
95
96NSSVTSTSSTSSSSSSSSSTN | MARK: 10100100 00000001 (is_room_adjacent:found_tunnel)
97SNN | DROP
98SNN | DROP
99SSSTN | PUSH +1
100NTN | RTS
101
102NSSVTSTSSTSSSSSSSSTSN | MARK: 10100100 00000010 (is_room_adjacent:no_match)
103SNN | DROP
104SNN | DROP
105SSSSN | PUSH 0
106NTN | RTS
107
108@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
109@ Name:
110@ move_player
111@ Description:
112@ Prompts the player for a room number. Moves to that room, checking the new
113@ environment and executing consequences (fell in a pit, etc) as appropriate.
114@ Call Stack:
115@ <empty>
116@ Return Stack:
117@ <empty>
118@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
119#include <stdio.pvvs>
120#include <convert.pvvs>
121#include <math.pvvs>
00ec7afc 122#include <string.pvvs>
28a945f7
AT
123NSSVTSTSSSTTN | MARK: 10100011 (move_player)
124
125A"To which room do you wish to move?\n"
126SSSSN | PUSH 0 (number of string substitutions)
127NSTTSSSN | JSR > 1000 (printf)
00ec7afc
AT
128SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer address)
129SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer size)
130NSTTSSSTSN | JSR > 100010 (get_user_string)
28a945f7
AT
131SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
132NSTTTSSSSN | JSR > 110000 (atoi)
133SNN | DROP
134
135@ The desired room number is now on the TOS. Verify that it is valid.
136SNS | DUP
137NSTTSTSSTSSN | JSR > 10100100 (is_room_adjacent)
138NTSTSTSSSTTSSSSSSSTN | BRZ > 10100011 00000001 (invalid room number)
139NSNTSTSSSTTSSSSSSSSN | JMP > 10100011 00000000 (valid room number)
140
141NSSVTSTSSSTTSSSSSSSTN | MARK: 10100011 00000001 (invalid room number)
142@ TOS> room_number
143SNN | DROP
144A"*Oof!* (you hit the wall)\n"
145SSSSN | PUSH 0 (number of string substitutions)
146NSTTSSSN | JSR > 1000 (printf)
83a8624e 147NSTTSSTTN | JSR > 10011 (fastrand)
28a945f7
AT
148SSSTTSN | PUSH 6 (chance)
149TSTT | MODULO
150NTSTSTSSSTTSSSSSSTSN | BRZ > 10100011 00000010 (woke the wumpus)
151NTN | RTS
152NSSVTSTSSSTTSSSSSSTSN | MARK: 10100011 00000010 (woke the wumpus)
153A"Your colorful comments awaken the wumpus!\n"
154SSSSN | PUSH 0 (number of string substitutions)
155NSTTSSSN | JSR > 1000 (printf)
83a8624e 156NSTTSSTTN | JSR > 10011 (fastrand)
28a945f7
AT
157SSSTSSSSSSSSSSTTN | PUSH 0x1003 (ptr to number of tunnels per room)
158TSTT | MODULO
159SSSTSSSSSSSSSTTTN | PUSH 0x1007 (ptr to wumpus location)
160TTT | LOAD
161NSTTSSSTSSSN | JSR > 10001000 (get_tunnel_destination)
162SSSTSSSSSSSSSTTTN | PUSH 0x1007 (ptr to wumpus location)
163SNT | SWAP
164TTS | STORE
165SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
166TTT | LOAD
167NSTTSTSSSSSN | JSR > 10100000 (room_has_wumpus)
168NTSTSTSSSTTSSSSSSTTN | BRZ > 10100011 00000011 (wumpus did not move to player)
169NSTTTTTTTTTSSSSSSSSN | JSR > 11111111 00000000 (wump_kill)
170SSSSN | PUSH 0 (number of string substitutions)
171NSTTSSSN | JSR > 1000 (printf)
172NNN | DIE
173NSSVTSTSSSTTSSSSSSTTN | MARK: 10100011 00000011 (wumpus did not move to player)
174NTN | RTS
175
176NSSVTSTSSSTTSSSSSSSSN | MARK: 10100011 00000000 (valid room number)
177@ TOS> room_number
178@ Move player to new room
179SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
180SNT | SWAP
181TTS | STORE
182@ Check for wumpus in new player location
183SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
184TTT | LOAD
185NSTTSTSSSSSN | JSR > 10100000 (room_has_wumpus)
186NTSTSTSSSTTSSSSSTSSN | BRZ > 10100011 00000100 (no wumpus in new room)
187NSTTTTTTTTTSSSSSSSSN | JSR > 11111111 00000000 (wump_kill)
188SSSSN | PUSH 0 (number of string substitutions)
189NSTTSSSN | JSR > 1000 (printf)
190NNN | DIE
191NSSVTSTSSSTTSSSSSTSSN | MARK: 10100011 00000100 (no wumpus in new room)
192@ Check for pits in new player location
193SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
194TTT | LOAD
195NSTTSSSTTSTN | JSR > 10001101 (room_has_pits)
196NTSTSTSSSTTSSSSSTSTN | BRZ > 10100011 00000101 (no pits in new room)
83a8624e 197NSTTSSTTN | JSR > 10011 (fastrand)
28a945f7
AT
198SSSTTSN | PUSH 6 (chance)
199TSTT | MODULO
200NTSTSTSSSTTSSSSSTTSN | BRZ > 10100011 00000110 (survived the pits)
201NSTTTTTTTTTSSSSSTSTN | JSR > 11111111 00000101 (pit_kill)
202SSSSN | PUSH 0 (number of string substitutions)
203NSTTSSSN | JSR > 1000 (printf)
204NNN | DIE
205NSSVTSTSSSTTSSSSSTTSN | MARK: 10100011 00000110 (survived the pits)
206NSTTTTTTTTTSSSSSTTSN | JSR > 11111111 00000110 (pit_survive)
207SSSSN | PUSH 0 (number of string substitutions)
208NSTTSSSN | JSR > 1000 (printf)
209NSSVTSTSSSTTSSSSSTSTN | MARK: 10100011 00000101 (no pits in new room)
210@ Check for bats in new player location
211SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
212TTT | LOAD
213NSTTSSSTTSSN | JSR > 10001100 (room_has_bats)
214NTSTSTSSSTTSSSSSTTSN | BRZ > 10100011 00000110 (no bats in new room)
215A"*flap* *flap* *flap* (humongous bats pick you up and move you!)\n"
216SSSSN | PUSH 0 (number of string substitutions)
217NSTTSSSN | JSR > 1000 (printf)
83a8624e 218NSTTSSTTN | JSR > 10011 (fastrand)
28a945f7
AT
219SSSTSSSSSSSSSSTTN | PUSH 0x1003 (ptr to number of tunnels per room)
220TSTT | MODULO
221SSSTSSSSSSSSSTTSN | PUSH 0x1006 (ptr to player location)
222TTT | LOAD
223NSTTSSSTSSSN | JSR > 10001000 (get_tunnel_destination)
224NSNTSTSSSTTSSSSSSSSN | JMP > 10100011 00000000 (valid room number)
225NSSVTSTSSSTTSSSSSTTSN | MARK: 10100011 00000110 (no bats in new room)
226NTN | RTS
227
f0e3023d
AT
228@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
229@ Name:
230@ move_or_shoot
231@ Description:
232@ Parse user input, branching to the appropriate subroutine to move or shoot.
233@ This function does not perform any boundary checks/limits.
234@ Call Stack:
235@ <empty>
236@ Return Stack:
237@ <empty>
238@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
239#include <stdio.pvvs>
00ec7afc 240#include <string.pvvs>
f0e3023d
AT
241NSSVTSTSSSTSN | MARK: 10100010 (move_or_shoot)
242
00ec7afc
AT
243SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer address)
244SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer size)
245NSTTSSSTSN | JSR > 100010 (get_user_string)
f0e3023d
AT
246
247@ Examine the first character of the user input buffer for 'm' or 's'.
248@ If character is something else, prompt user to try again.
249SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
250TTT | LOAD
251SSSSTTSTTSTN | PUSH 109 (ASCII 'm')
252TSST | SUBTRACT
253NTSTSTSSSTSSSSSSSSSN | BRZ > 10100010 00000000 (move)
254SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
255TTT | LOAD
256SSSSTTTSSTTN | PUSH 115 (ASCII 's')
257TSST | SUBTRACT
258NTSTSTSSSTSSSSSSSSTN | BRZ > 10100010 00000001 (shoot)
259NSTTTTTTTTTSSSSTSSSN | JSR > 11111111 00001000 (problem_with_input)
260SSSSN | PUSH 0 (number of string substitutions)
261NSTTSSSN | JSR > 1000 (printf)
262NSNTSTSSSTSN | JMP > 10100010 (move_or_shoot)
263
264@ User typed 'm'
265NSSVTSTSSSTSSSSSSSSSN | MARK: 10100010 00000000 (move)
28a945f7 266NSTTSTSSSTTN | JSR > 10100011 (move_player)
f0e3023d
AT
267NTN | RTS
268
269@ User typed 's'
270NSSVTSTSSSTSSSSSSSSTN | MARK: 10100010 00000001 (shoot)
271@ TODO: JSR shoot
272NTN | RTS
273
2da74194
AT
274@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
275@ Name:
276@ get_answer
277@ Description:
278@ Parse user input, returning 0 if user string started with 'n' or 1 if 'y'.
279@ This function does not perform any boundary checks/limits.
280@ Call Stack:
281@ <empty>
282@ Return Stack:
283@ (1 or 0 for True/False) <--- TOS
284@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
285#include <stdio.pvvs>
00ec7afc 286#include <string.pvvs>
2da74194
AT
287NSSVTSSTTSSSN | MARK: 10011000 (get_answer)
288
289@ TODO: Consider extending the GETCHAR instruction in VVS to indicate an empty
290@ buffer instead of blocking. This would allow a character by character
291@ check without printing a slew of retry messages if the buffer is
292@ non-empty.
00ec7afc
AT
293SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer address)
294SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (buffer size)
295NSTTSSSTSN | JSR > 100010 (get_user_string)
2da74194
AT
296
297@ Examine the first character of the user input buffer for 'y' or 'n'.
298@ If character is something else, prompt user to try again.
299SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
300TTT | LOAD
301SSSSTTTTSSTN | PUSH 121 (ASCII 'y')
302TSST | SUBTRACT
303NTSTSSTTSSSSSSSSSSSN | BRZ > 10011000 00000000 (answer: yes)
304SSSTTSSSSSSSSSSSSN | PUSH 0x3000 (USER_INPUT_BUFFER address)
305TTT | LOAD
306SSSSTTSTTTSN | PUSH 110 (ASCII 'n')
307TSST | SUBTRACT
308NTSTSSTTSSSSSSSSSSTN | BRZ > 10011000 00000001 (answer: no)
f0e3023d 309NSTTTTTTTTTSSSSTSSSN | JSR > 11111111 00001000 (problem_with_input)
2da74194
AT
310SSSSN | PUSH 0 (number of string substitutions)
311NSTTSSSN | JSR > 1000 (printf)
312NSNTSSTTSSSN | JMP > 10011000 (get_answer)
313
314@ User typed 'y'
315NSSVTSSTTSSSSSSSSSSSN | MARK: 10011000 00000000 (answer: yes)
316SSSTN | PUSH 1
317NTN | RTS
318
319@ User typed 'n'
320NSSVTSSTTSSSSSSSSSSTN | MARK: 10011000 00000001 (answer: no)
321SSSSN | PUSH 0
322NTN | RTS
323
2da74194
AT
324@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
325@ Name:
326@ print_cave_description
327@ Description:
328@ Prints information about the cave (number of rooms, etc).
329@ Call Stack:
330@ <empty>
331@ Return Stack:
332@ <empty>
333@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
334#include <stdio.pvvs>
335NSSVTSSTTSTTN | MARK: 10011011 (print_cave_description)
336NSTTTTTTTTTSSSSTSTSN | JSR > 11111111 00001010 (cave_description)
337SSSTSSSSSSSSSTSTN | PUSH 0x1005 (number_of_arrows address)
338TTT | LOAD
339SSSTSSSSSSSSSSSTN | PUSH 0x1001 (number_of_pits address)
340TTT | LOAD
341SSSTSSSSSSSSSSTSN | PUSH 0x1002 (number_of_bats address)
342TTT | LOAD
343SSSTSSSSSSSSSSTTN | PUSH 0x1003 (number_of_tunnels address)
344TTT | LOAD
345SSSTSSSSSSSSSSSSN | PUSH 0x1000 (number_of_rooms address)
346TTT | LOAD
347SSSTSTN | PUSH 5 (number of substitions)
348NSTTSSSN | JSR > 1000 (printf)
349NTN | RTS
350
351@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
352@ Name:
353@ print_room_stats
354@ Description:
355@ Prints information about current room and hints about nearby rooms.
356@ Call Stack:
357@ <empty>
358@ Return Stack:
359@ <empty>
360@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
361#include <wump_game.pvvs>
362#include <stdio.pvvs>
363#include <stack.pvvs>
364NSSVTSTSSSSTN | MARK: 10100001 (print_room_stats)
365
366@ Print location and arrow quantity remaining.
367A"You are in room %u of the cave and have %u arrows remaining.\n"
368SSSTSSSSSSSSSTSTN | PUSH 0x1005 (number_of_arrows address)
369TTT | LOAD
370SSSTSSSSSSSSSTTSN | PUSH 0x1006 (player_location address)
371TTT | LOAD
372SSSTSN | PUSH 2 (number of substitutions)
373NSTTSSSN | JSR > 1000 (printf)
374
375@ Print if bats/pits/wumpus nearby.
376SSSTSSSSSSSSSTTSN | PUSH 0x1006 (player_location address)
377TTT | LOAD
378SNS | DUP
379NSTTSSTTTSSN | JSR > 10011100 (are_bats_near)
380NTSTSTSSSSTSSSSSSSSN | BRZ > 10100001 00000000 (no_bats)
381A"*rustle* (Bats must be nearby.)\n"
382SSSSN | PUSH 0 (number of substitutions)
383NSTTSSSN | JSR > 1000 (printf)
384NSSVTSTSSSSTSSSSSSSSN | MARK: 10100001 00000000 (no_bats)
385SNS | DUP
386NSTTSSTTTSTN | JSR > 10011101 (are_pits_near)
387NTSTSTSSSSTSSSSSSSTN | BRZ > 10100001 00000001 (no_pits)
388A"*whoosh* (You feel a draft from nearby pits.)\n"
389SSSSN | PUSH 0 (number of substitutions)
390NSTTSSSN | JSR > 1000 (printf)
391NSSVTSTSSSSTSSSSSSSTN | MARK: 10100001 00000001 (no_pits)
392NSTTSSTTTTSN | JSR > 10011110 (is_wumpus_near)
393NTSTSTSSSSTSSSSSSTSN | BRZ > 10100001 00000010 (no_wumpus)
394A"*sniff* (You smell the evil Wumpus nearby!)\n"
395SSSSN | PUSH 0 (number of substitutions)
396NSTTSSSN | JSR > 1000 (printf)
397NSSVTSTSSSSTSSSSSSTSN | MARK: 10100001 00000010 (no_wumpus)
398
399@ Print a list of nearby rooms.
400A"This room contains tunnels to the following rooms:"
401SSSSN | PUSH 0 (number of substitutions)
402NSTTSSSN | JSR > 1000 (printf)
403SSSTSSSSSSSSSTTSN | PUSH 0x1006 (player_location address)
404TTT | LOAD
405SSSTSSSSSSSSSSTTN | PUSH 0x1003 (number_of_links_per_room address)
406TTT | LOAD
407SSSTN | PUSH 1
408TSST | SUBTRACT
409@ Print one room on each pass through this loop.
410@ TOS> tunnel_index, room_number
411NSSVTSTSSSSTSSSSSSTTN | MARK: 10100001 00000011 (print_room_list_loop)
412A" %u"
413SSSTSTN | PUSH 5
414NSTTTSSN | JSR > 1100 (deepdup)
415SSSTTTN | PUSH 7
416NSTTTSSN | JSR > 1100 (deepdup)
417NSTTSSSTSSSN | JSR > 10001000 (get_tunnel_destination)
418SSSTN | PUSH 1 (number of substitutions)
419NSTTSSSN | JSR > 1000 (printf)
420@ Test for end of loop
421SNS | DUP
422NTSTSTSSSSTSSSSSTSSN | BRZ > 10100001 00000100 (print_room_list_loop_end)
423SSSTN | PUSH 1
424TSST | SUBTRACT
425NSNTSTSSSSTSSSSSSTTN | JMP > 10100001 00000011 (print_room_list_loop)
426@ Clean up and return.
427NSSVTSTSSSSTSSSSSTSSN | MARK: 10100001 00000100 (print_room_list_loop_end)
428SSSTSTSN | PUSH 10 (ASCII '\n')
429TNSS | PUTCHAR
430SNN | DROP
431SNN | DROP
432NTN | RTS
433
434#endif