Last active
August 29, 2015 13:56
-
-
Save soharu/9069448 to your computer and use it in GitHub Desktop.
레지스터 $0에 저장된 명령행 인자 갯수를 이용한 명령행 인자 출력
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cnt IS $0 | |
argv IS $1 | |
t IS $255 | |
k GREG 0 | |
LOC Data_Segment | |
GREG @ | |
NewLn BYTE #a,0 | |
LOC #100 | |
Main SET k,0 | |
Loop LDOU t,argv,k | |
TRAP 0,Fputs,StdOut | |
LDA t,NewLn | |
TRAP 0,Fputs,StdOut | |
ADDU k,k,8 | |
SUB cnt,cnt,1 | |
BNZ cnt,Loop | |
Term TRAP 0,Halt,0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment