Skip to content

Instantly share code, notes, and snippets.

@soharu
Last active August 29, 2015 13:56
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 soharu/9069448 to your computer and use it in GitHub Desktop.
Save soharu/9069448 to your computer and use it in GitHub Desktop.
레지스터 $0에 저장된 명령행 인자 갯수를 이용한 명령행 인자 출력
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