Files
RomWBW/Source/Images/d_fortran/u0/IOINIT.MAC
2023-06-14 12:45:41 -04:00

41 lines
768 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
TITLE IOINIT - FORTRAN-80 I/O FLAG & VARIABLE INIT
.8080
ENTRY $IOINI
EXT $IOFLG,$LNPTR,$CPMBF,$LUNTB
EXT $FLFLG,$DSKER,$OPNFL
$IOINI: LDA $IOFLG ;SEE IF WE'VE ALREADY BEEN CALLED
ORA A
RNZ
INR A ;SET NON-ZERO
STA $IOFLG
LXI H,$CPMBF
MVI M,132+1 ;MAX CHRS TO READ FOR BDOS CALL
INX H
MVI M,0 ;ZERO NO. OF CHARS READ
INX H
SHLD $LNPTR ;PTR TO BEGINNING OF LINE
MVI M,10 ;STORE LINE FEED AT BEG. OF LINE
LDA $LUNTB ;GET NO. OF LUN'S
DCR A
MOV B,A ;SAVE LOOP COUNT
LXI H,$FLFLG ;INITIALIZE FLAGS FOR DSKDRV
XRA A
FLGLOP: MOV M,A ;ZERO $FLFLG BYTE
INX H ;INCREMENT PTR
DCR B ;DECREMENT COUNT
JNZ FLGLOP ;NEXT
STA $DSKER
XRA A
STA $OPNFL ;CLEAR $OPNFL FOR LPTDRV
RET
END