home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG006.ARK
/
TMAP.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-04-29
|
2KB
|
70 lines
;TARBELL MAP FOR CP/M
;PRINTS FIRST 11 CHARS READ
CONST EQU 11 ;FUNCTION TO CHECK CONSOLE STAT
WRCON EQU 2 ;WRITE CONSOLE CHAR
PRINT EQU 9 ;PRINT BUFFER FUNCTION
BDOS EQU 5 ;BDOS ENTRY POINT
ORG 100H ;TO TPA BASE
CALL START
DB 'TMAP 09/10/77',0DH,0AH,'$'
START POP D
MVI C,PRINT
CALL BDOS
NEXT MVI B,8+3 ;# OF CHRS TO PRINT
MVI A,10H ;GET TARBELL RESET CHAR
OUT 6EH ;RESET TARBELL
LXI H,BUFF ;INIT
SHLD ADDR ;BUFFER ADDR
CHAR PUSH B ;SAVE COUNT
MVI C,CONST ;FUNCTION TO CHECK CONSOLE STAT
CALL BDOS ;CHECK CONSOLE
DCR A ;WAS IT READY?
JZ FINIS ;YES, EXIT
POP B ;GET COUNT BACK
IN 6EH ;READ STATUS
ANI 10H ;READY?
JNZ CHAR ;NO
IN 6FH ;READ TARBELL CHAR
CPI ' ' ;VALID ASCII?
JC GOT5 ;NO
CPI 'Z'+1
JNC GOT5
LHLD ADDR ;STORE
MOV M,A ;CHR IN BUFF
INX H
SHLD ADDR
DCR B ;MORE CHARS?
JNZ CHAR ;YES
;GOT 11 VALID ASCII CHARS - PRINT THEM
SHOW LXI D,BUFF ;POINT TO BUFF
MVI C,PRINT ;FUNCTION TO PRINT
CALL BDOS ;PRINT THE FILENAME
CALL CRET ;TYPE C/R
JMP NEXT ;DO IT AGAIN
;CHECK IF 5 CHARS READ (FOR OLD TAPE MAP)
GOT5 MOV A,B ;GET COUNT
CPI 7
JNC NEXT ;NOT 5
;GOT 5 - STORE $ IN BUFFER AFTER 5TH CHAR
MVI A,'$'
STA BUFF+5
JMP SHOW
;ABORT
FINIS POP B ;RESET STACK
RET
;ROUTINE TO TYPE C/R
CRET MVI A,0DH ;GET C/R
CALL TYPE
MVI A,0AH ;GET L/F
;ROUTINE TO TYPE CHAR IN A
TYPE PUSH B ;SAVE B (ONLY)
MOV E,A ;CHR MUST BE IN E
MVI C,WRCON ;C HAS FUNCTION
CALL BDOS ;PRINT THE CHAR
POP B ;RESTORE B
RET
ADDR DW BUFF ;CURRENT CHAR POINTER
BUFF DS 11 ;STORE NAME HERE
DB '$' ;END DELIMITER FOR CONSOLE PRINT
END 100H