Trailing-Edge
-
PDP-10 Archives
-
decuslib10-08
-
43,50515/outstr.mac
There are 4 other files named outstr.mac in the archive. Click here to see a list.
TITLE OUTSTR
ENTRY OUTSTR
FT10==1 ;EQUAL TO 1 IF TOPS-10
FT20==0 ;EQUAL TO 1 IF TOPS-20
IFN FT20<
SEARCH MONSYM
>
IFN FT10<
SEARCH UUOSYM
>
OUTSTR:
IFN FT10<
SETO 2, ;GET UDX OF CONTROLLING TTY
TRMNO. 2,
JFCL ;SHOULDN'T HAPPEN
MOVE 4,[XWD 3,1] ;SET UP FOR TRMOP.
MOVEI 1,2010 ;SET FOR TTY NO CRLF
MOVEI 3,1 ;TURN OFF CRLF
TRMOP. 4, ;DO IT
JFCL ;TOO BAD
MOVEI 1,2023 ;NO PAGE MODE NEXT
SETZ 3,
TRMOP. 4, ;DO IT
JFCL
>
IFN FT20<
MOVEI 1,.PRIOU ;DISABLE ALTMODE TRANSLATION
RFCOC ;GET TRANSLATION CHARACTERISTICS
ERJMP [HRROI 1,[ASCIZ/
?ERROR GETTING TERMINAL TRANSLATION CHARACTERISTICS
/]
PSOUT
HALTF]
MOVEM 2,7 ;SAVE TERM. CHARACT. FOR LATER
MOVEM 3,10
TRNN 3,400000 ;TURN OFF TRANSLATION FOR ALTMODES
TRC 3,400000 ;SET TO SEND ACTUAL CODE
TRNE 3,300000
TRC 3,300000
SFCOC ;TURN OFF ALTMODE TRANSLATION
ERJMP [HRROI 1,[ASCIZ/
?ERROR SETTING TERMINAL TRANSLATION CHARACTERISTICS
/]
PSOUT
HALTF] ;STOP THE PROCESS
RFMOD ;READ TERMINAL CHARACTERISTICS
MOVEM 2,11 ;SAVE FOR LATER
ANDCM 2,[TT%LEN+TT%WID+TT%LIC] ;LENGTH AND WIDTH TO ZERO & LC
STPAR ;SET IT
>
MOVEI 2,@(16) ;ADDR OF ARRAY
MOVE 4,@1(16) ;# OF CHARS
JUMPL 4,STRING ;ASCIZ STRING
MOVNS 4,4 ;SET UP AOBJN POINTER
HRLZS 4,4
HRR 4,2
CHROUT: MOVE 1,(4) ;GET THE DATA
TLNE 1,777777 ;LEFT JUSTIFIED?
LSH 1,-35 ;FIX IT UP (ONLY WANT 7 BITS)
IFN FT10<
OUTCHR 1 ;OUT IT GOES!
>
IFN FT20<
PBOUT ;OUT IT GOES!
ERJMP [HRROI 1,[ASCIZ/
?OUTPUT ERROR
/]
PSOUT ;SEND THE MESSAGE
HALTF ;AND STOP
JRST .-1] ;TRY AGAIN ON CONTINUE
>
AOBJN 4,CHROUT ;DONE?
JRST DONE ;YES
STRING:
IFN FT10<
TTCALL 3,@2 ;ASCIZ STRING
>
IFN FT20<
HRRO 1,2 ;SET UP POINTER
PSOUT ;OUT IT GOES
ERJMP [HRROI 1,[ASCIZ/
?OUTPUT ERROR
/]
PSOUT ;PRINT THE MESSAGE
HALTF ;STOP
JRST .-1] ;TRY AGAIN ON CONTINUE
>
DONE:
IFN FT20<
MOVEI 1,.PRIOU
MOVE 2,7
MOVE 3,10
SFCOC ;SET TERMINAL TRANS. CHARCT. BACK
MOVE 2,11 ;GET ORIGINAL DEVICE MODE
STPAR ;SET IT BACK THE WAY IT WAS
>
POPJ 17,0 ;RETURN
END