###
# [puts]
# Copyright (c) 2002-2003 by William J. Coleda

.pcc_sub __cmd_puts prototyped
  .param PerlArray argv

  .local int argc 
  argc = argv
  #print "puts got "
  #print argc
  #print " args\n"
  if argc == 0 goto error
 
  S1 = argv[0] 
  if argc == 2 goto twoarg
  print S1
  if argc == 1 goto newline
  if argc > 2 goto error

twoarg:
  if S1 != "-nonewline" goto error
  S2 = argv[1]
  print S2
  goto done 


error:
  print "Bad call to puts: \n"
  goto done

newline:
  print "\n"

done:
  .pcc_begin_return
  .return ""
  .pcc_end_return
.end
