Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Last active April 3, 2023 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ismael-VC/b3d60add9ae31247ad0f2324db79651d to your computer and use it in GitHub Desktop.
Save Ismael-VC/b3d60add9ae31247ad0f2324db79651d to your computer and use it in GitHub Desktop.
Uxntal for and while loops
;list print-digits
BRK
@print-digits ( list* -- )
LDA2k SWP2 INC2 INC2
&loop
LDAk LIT "0 ADD #18 DEO
INC2 GTH2k ?&loop
POP2 POP2
#0a18 DEO
JMP2r
@list =&end [ 00 01 02 03 04 05 06 07 08 09 ] &end
;list print-digits
BRK
@print-digits ( list* -- )
&loop
LDAk LIT "0 ADD #18 DEO
INC2 LDAk ?&loop
POP2
#0a18 DEO
JMP2r
@list [ 00 01 02 03 04 05 06 07 08 09 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment