home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.1 / Assembler / debug / test.asm < prev    next >
Encoding:
Assembly Source File  |  1992-08-27  |  777 b   |  36 lines

  1.  
  2. ;
  3. ; Copyright (c) 1988 Commodore-Amiga, Inc.
  4. ;
  5. ; Executables based on this information may be used in software
  6. ; for Commodore Amiga computers.  All other rights reserved.
  7. ;
  8. ; This information is provided "as is"; no warranties are made.
  9. ; All use is at your own risk, and no liability or responsibility is assumed.
  10. ;
  11.  
  12.         CODE
  13.  
  14.         INCLUDE    "exec/types.i"
  15.         INCLUDE    "printf.mac"
  16.  
  17.         DEBUGENABLE
  18.  
  19. ; a simple little program to test if the printf macro works OK
  20. Start        printf <'Starting: d0=%ld a0=$%lx\n'>,d0,a0
  21.         cmpi.w    #1,d0
  22.         bne.s    PrintArgs
  23.         printf <'No arguments given\n'>
  24.         bra.s    AllDone
  25.  
  26. PrintArgs    printf <'Arg string = '>
  27.         subq.w    #1,d0
  28. ArgLoop        move.b    (a0)+,d1        get next character
  29.         printf <'%c'>,d1        print it out
  30.         dbra    d0,ArgLoop        and loop for next
  31.  
  32. AllDone        rts
  33.  
  34.         END
  35.  
  36.