0100 ;ECHO.M65 0110 ;Bill Aycock 3-87 0120 ; 0130 ;Show the arguments on a 0140 ; SpartaDOS command line 0150 ; 0160 ;For further info, see the 0170 ; SpartaDOS owner's manual 0180 ; (pgs 108-111) 0190 ; 0200 ;----------------------------- 0210 ; 0220 ;assemble the code out of the 0230 ;way of everything 0240 ; 0250 *= $4000 0260 ; 0270 ; 0280 ;SpartaDOS will run a loaded 0290 ;file at the beginning address 0300 ;of the first segment, so 0310 ;start the code with a JMP 0320 ;to the control routine. 0330 ;(start the routine with a 0340 ; byte $60 (rts) if you don't 0350 ; want the routine re-entered) 0360 ; 0370 JMP START 0380 ; 0390 ; 0400 ;---equates------------------- 0410 ; 0420 ; 0430 ZCR .WORD 0 ;get an arg 0440 CFN .WORD 0 ;arg buffer 0450 DOSVEC = $0A ;addr of comtab 0460 CIOV = $E456 ;cio vector 0470 COM = $0342 ;iccom 0480 ADR = $0344 ;icbal 0490 LEN = $0348 ;icbll 0500 ; 0510 ; 0520 ;------------------------------ 0530 ; 0540 FIXPTRS 0550 ; 0560 ;set up the pointers to the 0570 ;SpartaDOS routine to get an 0580 ;arg (ZCRNAME) and to the 0590 ;arg buffer (COMFNAM) 0600 ; 0610 LDA DOSVEC+1 ;zcr=comtab+3 0620 STA ZCR+1 0630 LDA DOSVEC 0640 CLC 0650 ADC #3 0660 BCC OK1 0670 INC ZCR+1 0680 OK1 0690 STA ZCR 0700 LDA ZCR+1 ;cfn=comtab+33 0710 STA CFN+1 0720 LDA ZCR 0730 CLC 0740 ADC #30 0750 BCC OK2 0760 INC CFN 0770 OK2 0780 STA CFN 0790 RTS 0800 ; 0810 ; 0820 ;----------------------------- 0830 ; 0840 CALLZ 0850 ; 0860 ;fake an indirect jsr to zcr 0870 ;by 'jsr callz' 0880 ; 0890 JMP (ZCR) 0900 ; 0910 ; 0920 ;----------------------------- 0930 ; 0940 SHOW 0950 ; 0960 ;show the arg in the buffer 0970 ;(note that 'Dn:' is added 0980 ;in front of each argument, 0990 ;so skip 3 bytes if necessary) 1000 ; 1010 LDX #0 1020 STX LEN+1 1030 LDA CFN 1040 STA ADR 1050 LDA CFN+1 1060 STA ADR+1 1070 LDA #28 1080 STA LEN 1090 LDA #9 ;print text line 1100 STA COM 1110 JSR CIOV 1120 RTS 1130 ; 1140 ; 1150 ;----------------------------- 1160 ; 1170 START 1180 ; 1190 ;set it up and do it 1200 ; 1210 JSR FIXPTRS 1220 GO 1230 JSR CALLZ 1240 BEQ QUIT ;z set=no args 1250 JSR SHOW 1260 TYA 1270 BPL GO 1280 QUIT 1290 RTS 1300 ; 1310 .END 4444444444444444444444444444444444444444444444444444444444444444444444444444