Classic Computer Magazine Archive PROGRAM LISTING: 84-12/PRNTSC.ASM


10 ;
20       .TITLE "PRNTSC ROUTINE"
30       .PAGE "ROUTINES FOR PRINTING ON THE SCREEN"
40 ;
50       *=  $5000
60 ;
70 BUFLEN =  25
80 ;
90 EOL   =   $9B     ;ATASCII CODE FOR END OF LINE CHARACTER
0100 ;
0110 OPEN =  $03     ;TOKEN FOR OPENING A DEVICE OR FILE
0120 OWRIT = $08     ;TOKEN FOR "OPEN FOR WRITE OPERATIONS"
0130 PUTCHR = $0B    ;TOKEN FOR "PUT CHARACTER"
0140 CLOSE = $0C     ;TOKEN FOR CLOSING A DEVICE OR FILE
0150 ;
0160 IOCB2 = $20     ;OFFSET FOR IOCB NO.2
0170 ICCOM = $0342   ;COMMAND BYTE (CONTROLS CIO OPERATIONS)
0180 ICBAL = $0344   ;BUFFER ADDRESS (LOW BYTE)
0190 ICBAH = $0345   ;BUFFER ADDRESS (HIGH BYTE)
0200 ICBLL = $0348   ;BUFFER LENGTH (LOW BYTE)
0210 ICBLH = $0349   ;BUFFER LENGTH (HIGH BYTE)
0220 ICAX1 = $034A   ;AUXILIARY BYTE NO.1
0230 ICAX2 = $034B   ;AUXILIARY BYTE NO.2
0240 ;
0250 CIOV =  $E456   ;CIO VECTOR
0260 ;
0270 DEVNAM .BYTE "E:",EOL
0280 ;
0290 OPNSCR
0300     LDX #IOCB2
0310     LDA #OPEN
0320     STA ICCOM,X
0330 ;
0340     LDA #DEVNAM&255
0350     STA ICBAL,X
0360     LDA #DEVNAM/256
0370     STA ICBAH,X
0380     ;   
0390     LDA #OWRIT
0400     STA ICAX1,X
0410     LDA #0
0420     STA ICAX2,X
0430     JSR CIOV
0440 ;
0450     LDA #PUTCHR
0460     STA ICCOM,X
0470 ;
0480     LDA #TXTBUF&255
0490     STA ICBAL,X
0500     LDA #TXTBUF/256
0510     STA ICBAH,X
0520     RTS 
0530 ;
0540 PRNT
0550     LDX #IOCB2
0560     LDA #BUFLEN&255
0570     STA ICBLL,X
0580     LDA #BUFLEN/256
0590     STA ICBLH,X
0600     JSR CIOV
0610     RTS 
0620 ;
0630 CLOSED
0640     LDX #IOCB2
0650     LDA #CLOSE
0660     STA ICCOM,X
0670     JSR CIOV
0680     RTS 
0690 ;
0700 TXTBUF = *
0710 ;
0720     *=  *+BUFLEN
0730 ;
0740     .END 

Back to previous page