home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / c128 / text / examples.arc / LOOP.A < prev    next >
Text File  |  1989-12-01  |  1KB  |  36 lines

  1. ;loop.asm
  2. ;===================================================================
  3. ; endloop command for CS-DOS batch files               12feb88 - CS
  4. ;===================================================================
  5.                                   
  6. int0e       = $170e               
  7. lpsave      = $1bc5               
  8. int22       = $1722               
  9. primm       = $ff7d               
  10.                                   
  11. star        = $0b00               
  12.             .wor  star            
  13.             * =  star             
  14.  
  15.             jmp loop
  16.             dw  Date
  17.                       
  18. loop        lda lpsave            ; Make sure saved address is valid
  19.             ora lpsave+1          ; (this is zero'd by the shell when an EXEC begins)
  20.             ora lpsave+2          
  21.             bne loopok            ; ok do it
  22.             jsr primm             
  23.             .asc 13,"Can't loop",13,0
  24.             lda #3                
  25.             jmp int0e             
  26.                                   
  27. loopok      lda lpsave            
  28.             ldx lpsave+1          
  29.             ldy lpsave+2          
  30.             sec                   
  31.             jsr int22             
  32.             lda #0                
  33.             jmp int0e             
  34.                                   
  35.             .end                  
  36.