home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
News-Disk 11
/
News_Disk_Issue_11_19xx___BASIC.atr
/
col80.asm
< prev
next >
Wrap
Assembly Source File
|
2023-02-26
|
12KB
|
1 lines
;¢; Col80 - an 80-column FAST file¢; reader... v1.5 ¢;¢; (c) July 1992 Itay Chamiel¢;¢; For everybody:¢;¢; This program was written using¢; T:Edit, and assembled using A65.¢; I take no responsibility for¢; incompatibilities with other¢; assemblers (Who'd want one??)¢;¢; This program is not commented,¢; exept for a few minimal blurbs¢; scattered around it.¢;¢; I take no responsibility for the¢; cleanliness of the code, but I¢; CAN say that this one compiled¢; without errors and had no¢; unexpected bugs - with A65.¢;¢; If you modify it, do NOT change¢; the credits... I'll do that, if¢; you have made any important¢; additions.. and deserve credit..¢; *I* will increment the version¢; number and add your credit..¢; Just send me the modified code¢; (your part commented a bit..)¢; and I'll change the title screen.¢;¢; If you'll want to make it be able¢; to go up when reading, I warn you¢; that you'll have to flush out the¢; entire mess of a main loop that I¢; wrote.. :) ¢;¢; I guess enjoy the hack... it's¢; not THAT bad!!¢;¢; -Itay Chamiel¢; September 3 1992¢;¢;¢;¢; Zero-page equates¢;¢DLDOER=$80¢POS=$82¢X=$83¢Y=$84¢CNTRL=$85¢CNTRH=$86¢PRCHAR=$87¢TEMP=$89¢MORCNTR=$8A¢PRLEN=$8B¢PRCNTR=$8C¢BUFPLC=$8E¢BUFLIM=$90¢MORSIZE=$92¢PRFROM=$94¢STAT=$96¢;¢; Equates¢;¢DLIST=$9C00¢CHARSET=$9800¢SCREEN=$A000-80¢ICCOM=$342¢ICBAL=$344¢ICBAH=$345¢ICPTL=$346¢ICPTH=$347¢ICBLL=$348¢ICBLH=$349¢ICAX1=$34A¢ICAX2=$34B¢CIOV=$E456¢;¢; Main program¢;¢ ORG $2E0¢ DW INIT¢ ORG $294A ; Overwrite Mydos's DUP¢HDLIST¢ DB $70,$70,$30,$42¢ DW HLINES¢ DB $70,$70,$70,$70,$70¢ DB 2,0,2,0,2,0,2,65¢ DW HDLIST¢HLINES¢ DB 'áááב∩∮ÕãáΓ∙áח⌠β∙áבΦβ'¢ DB 'ϕΘσ∮á¡áזσ∮≡≤π≥σσ∈ááá'¢ DB ' ? - Help '¢ DB ' '¢ DB ' <Return> - Line d'¢ DB 'own '¢ DB ' <Spacebar> - Page d'¢ DB 'own '¢ DB ' Q - Quit '¢ DB ' '¢INIT¢ LDA $79¢ BNE NOFEFE¢ LDA #$FE¢ STA $79¢ STA $7A¢NOFEFE¢ LDX #0¢CHLINES¢ LDA #0¢ STA TEMP¢ LDA HLINES,X¢ CMP #128¢ BCC CHNOIN¢ SEC¢ SBC #128¢ SEC¢ ROR TEMP¢CHNOIN¢ CMP #96¢ BCS CHLOK¢ CMP #32¢ BCS CHL1¢ CLC¢ ADC #64+32¢CHL1¢ SEC¢ SBC #32¢CHLOK¢ CLC¢ ADC TEMP¢ STA HLINES,X¢ INX¢ CPX #INIT-HLINES¢ BNE CHLINES¢ LDA 12¢ STA J+1¢ LDA 13¢ STA J+2¢ LDA #RESET&255¢ STA 12¢ LDA #RESET/256¢ STA 13¢ LDY #1¢RESTART¢ TYA¢ PHA¢ LDA #10¢ STA 709¢ LDA #0¢ STA 710¢ STA 712¢ STA 752¢ STA 559¢ TAX¢ERCHSET¢ LDA #0¢ STA CHARSET,X¢ INX¢ CPX #8¢ BNE ERCHSET¢ LDX #0¢TABCHDO¢ LDA XCHARS,X¢ STA DLIST-16,X¢ INX¢ CPX #16¢ BNE TABCHDO¢ JSR VDELAY¢ JSR PRTITLE¢ LDA #34¢ STA 559¢ PLA¢ TAY¢ CMP #128¢ BCC NORST¢ LDA #ERROR/256¢ LDY #ERROR&255¢ JSR CIOPRINT¢ JSR GETFILE¢ JMP NORST2¢RESET¢ LDA #0¢ STA 710¢ STA 559¢ LDA #1¢ STA 752¢ JSR VDELAY¢ LDA $79¢ BNE RSNOFEFE¢ LDA #$FE¢ STA $79¢ STA $7A¢RSNOFEFE¢ JSR PRTITLE¢ LDA #0¢ STA 752¢ LDA #34¢ STA 559¢ JSR VDELAY¢J JSR $FFFF¢NORST¢ JSR GETFILE¢NORST2¢ LDA #255¢ STA MORCNTR¢ LDA #24¢ STA MORSIZE¢ LDA #0¢ STA 559¢ JSR VDELAY¢ LDA #DLIST/256¢ STA 561¢ STA DLDOER+1¢ LDA #DLIST&255¢ STA 560¢ CLC¢ ADC #3¢ STA DLDOER¢ LDA #$70¢ STA DLIST¢ STA DLIST+1¢ LDA #$30¢ STA DLIST+2¢ LDA #SCREEN&255¢ STA CNTRL¢ LDA #SCREEN/256¢ STA CNTRH¢ LDX #0¢DODL¢ LDY #0¢ LDA #$4F¢ STA (DLDOER),Y¢ INY¢ LDA CNTRL¢ STA (DLDOER),Y¢ CLC¢ ADC #LO[40*8]¢ STA CNTRL¢ INY¢ LDA CNTRH¢ STA (DLDOER),Y¢ ADC #HI[40*8]¢ STA CNTRH¢ LDA #$F¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ INY¢ STA (DLDOER),Y¢ LDA DLDOER¢ CLC¢ ADC #10¢ STA DLDOER¢ LDA DLDOER+1¢ ADC #0¢ STA DLDOER+1¢ INX¢ CPX #25¢ BNE DODL¢ LDY #0¢ LDA #65¢ STA (DLDOER),Y¢ INY¢ LDA #DLIST&255¢ STA (DLDOER),Y¢ INY¢ LDA #DLIST/256¢ STA (DLDOER),Y¢ LDA #LO[SCREEN-320]¢ STA DLIST+4¢ LDA #HI[SCREEN-320]¢ STA DLIST+5¢ LDA #LO[SCREEN-640]¢ STA DLIST+134¢ LDA #HI[SCREEN-640]¢ STA DLIST+135¢ LDA #15¢ STA 709¢ LDA #0¢ STA 710¢ JSR CLRSCRN¢;¢ LDA #0¢ STA STAT¢ STA X¢ STA Y¢ LDA #2¢ STA 712¢ LDA #34¢ STA 559¢GOGETDS¢ JSR GETBYTE¢ CPY #136¢ BEQ ENDOF¢ LDA #LO[CHARSET]¢ STA BUFLIM¢ LDA #HI[CHARSET]¢ STA BUFLIM+1¢ LDA #LO[GOGETDS]¢ STA JMPCHN+1¢ LDA #HI[GOGETDS]¢ STA JMPCHN+2¢ JMP LOOPP¢ENDOF¢ LDA #BUFFER&255¢ CLC¢ ADC ICBLL+$20¢ STA BUFLIM¢ LDA #BUFFER/256¢ ADC ICBLH+$20¢ STA BUFLIM+1¢ LDA #LO[ENDOFILE]¢ STA JMPCHN+1¢ LDA #HI[ENDOFILE]¢ STA JMPCHN+2¢LOOPP¢ INC BUFPLC¢ LDA BUFPLC¢ BNE GETCH¢ INC BUFPLC+1¢GETCH¢ LDA BUFPLC¢ CMP BUFLIM¢ BNE PRNTCH¢ LDA BUFPLC+1¢ CMP BUFLIM+1¢ BNE PRNTCH¢JMPCHN JMP $FFFF¢PRNTCH¢ LDY #0¢ LDA (BUFPLC),Y¢ATACHN CMP #1¢ BEQ RET¢ CMP #127¢ BEQ TAB¢ STA PRCHAR¢ JSR PRINT¢ INC X¢ LDA X¢ CMP #80¢ BNE LOOPP¢RET¢ LDA #0¢ STA X¢ INC MORCNTR¢ LDA MORCNTR¢ CMP MORSIZE¢ BEQ DOMORE¢BKMOR¢ INC Y¢ LDA Y¢ CMP #25¢ BNE LOOPP¢ DEC Y¢ JSR SCRLDOWN¢ JMP LOOPP¢TAB¢ LDA X¢ CLC¢ ADC #5¢ STA X¢ CMP #80¢ BCC LOOPP¢ JMP RET¢DOMORE¢ JSR GETKEY¢ CMP #32 ; Spacebar?¢ BNE MNOSPC¢ STA STAT¢ LDA #0¢ STA MORCNTR¢ JMP BKMOR¢MNOSPC¢ CMP #155 ; <Return>?¢ BNE MORCHKQ¢ STA STAT¢ DEC MORCNTR¢ JMP BKMOR¢MORCHKQ¢ CMP #113 ; 'Q'?¢ BNE CHKHLP¢ LDA #0¢ PHA¢ JMP ADSKERR¢CHKHLP¢ CMP #63 ; Qmark?¢ BNE DOMORE¢ JSR DOHELP¢ JMP DOMORE¢ENDOFILE¢ LDA Y¢ CMP #24¢ BNE ENOSCRL¢ LDA STAT¢ BEQ EYSSCRL¢ CMP #32¢ BEQ EYSSCRL¢EOFBLP¢ JSR GETKEY¢ CMP #155¢ BEQ EYSSCRL¢ CMP #32¢ BEQ EYSSCRL¢ CMP #63¢ BNE EOFBLP1¢ JSR DOHELP¢ JMP EOFBLP¢EOFBLP1¢ CMP #113¢ BNE EOFBLP¢ LDA #0¢ PHA¢ JMP ADSKERR¢EYSSCRL¢ JSR SCRLDOWN¢ENOSCRL¢ LDA #0¢ STA X¢ LDA #24¢ STA Y¢ LDA #26¢ LDX #EOFPRN/256¢ LDY #EOFPRN&255¢ JSR PRMESG¢EOFLP¢ JSR GETKEY¢ CMP #63 ; Qmark?¢ BNE EOFLP1¢ JSR DOHELP¢ JMP EOFLP¢EOFLP1¢ CMP #113 ; 'Q'?¢ BNE EOFLP¢ LDA #0¢ PHA¢;¢ADSKERR¢ LDX #$60¢ LDA #12¢ STA ICCOM+$60¢ JSR CIOV¢;¢ LDX #$60¢ LDA #3¢ STA ICCOM+$60¢ LDA #SOPEN/256¢ STA ICBAH+$60¢ LDA #SOPEN&255¢ STA ICBAL+$60¢ LDA #0¢ STA ICAX2+$60¢ LDA #12¢ STA ICAX1+$60¢ JSR CIOV¢;¢ PLA¢ TAY¢ JMP RESTART¢SOPEN DB 'S'¢;¢GETKEY¢ LDA 764¢ CMP #255¢ BEQ GETKEY¢ LDA #1¢ STA 53279¢ LDY 764¢ LDA #255¢ STA 764¢ LDA ($79),Y¢ RTS¢;¢GETKEY2¢ LDA $E425¢ PHA¢ LDA $E424¢ PHA¢ RTS¢;¢PRINT¢ LDA #0¢ STA 767¢ LDA Y¢ ASL A¢ ASL A¢ ADC Y¢ ASL A¢ STA CNTRL¢ LDA #0¢ ADC #0¢ STA CNTRH¢ LDA CNTRL¢ CLC¢ ADC #4 ; LO byte of DL +4¢ STA CNTRL¢ LDA CNTRH¢ ADC #DLIST/256¢ STA CNTRH¢ LDY #0¢ LDA (CNTRL),Y¢ TAX¢ INY¢ LDA (CNTRL),Y¢ STX CNTRL¢ STA CNTRH¢ LDA X¢ LSR A¢ CLC¢ ADC CNTRL¢ STA CNTRL¢ LDA CNTRH¢ ADC #0¢ STA CNTRH¢ LDA X¢ AND #1¢ STA POS¢ LDY #0¢ STY PRCHAR+1¢ STY TEMP¢ LDA PRCHAR¢ CMP #128¢ BCC PRCHRDO2¢ SEC¢ SBC #128¢ PHA¢ LDA #1¢ STA TEMP¢ PLA¢PRCHRDO2¢ CMP #96¢ BCS PRCHAROK¢ CMP #32¢ BCS PRCHRDO1¢ CLC¢ ADC #64¢ JMP PRCHAROK¢PRCHRDO1¢ SEC¢ SBC #32¢PRCHAROK¢ ASL A¢ ASL A¢ ROL PRCHAR+1¢ ASL A¢ ROL PRCHAR+1¢ STA PRCHAR¢ LDA PRCHAR+1¢ CLC¢ ADC #HI[CHARSET]¢ STA PRCHAR+1¢ LDX POS¢WRTCHAR¢ LDA (CNTRL),Y¢ AND POSTBL1,X¢ STA (CNTRL),Y¢ LDA (PRCHAR),Y¢ AND POSTBL2,X¢ ADC (CNTRL),Y¢ PHA¢ LDA TEMP¢ BEQ NOINV¢ PLA¢ EOR POSTBL2,X¢ JMP NOPLA¢NOINV¢ PLA¢NOPLA¢ STA (CNTRL),Y¢ LDA CNTRL¢ CLC¢ ADC #39¢ STA CNTRL¢ LDA CNTRH¢ ADC #0¢ STA CNTRH¢ INY¢ CPY #8¢ BNE WRTCHAR¢ RTS¢POSTBL1 DB $0F¢POSTBL2 DB $F0,$0F¢SCRLDOWN¢ LDA #0¢ STA 767¢ JSR VDELAY¢ LDA DLIST+4¢ STA CNTRL¢ PHA¢ LDA DLIST+5¢ STA CNTRH¢ PHA¢ LDX #0¢SCRLDLP¢ LDA DLIST+14,X¢ STA DLIST+4,X¢ LDA DLIST+15,X¢ STA DLIST+5,X¢ TXA¢ CLC¢ ADC #10¢ TAX¢ CPX #240¢ BNE SCRLDLP¢ JSR ERSLINE¢ PLA¢ STA DLIST+245¢ PLA¢ STA DLIST+244¢ RTS¢ERSLINE¢ LDA #0¢ TAY¢ERS1¢ STA (CNTRL),Y¢ INY¢ CPY #0¢ BNE ERS1¢ INC CNTRH¢ERS2¢ STA (CNTRL),Y¢ INY¢ CPY #320-256¢ BNE ERS2¢ RTS¢CLRSCRN¢ LDX #0¢CLRSCRNL¢ LDA DLIST+4,X¢ STA CNTRL¢ LDA DLIST+5,X¢ STA CNTRH¢ JSR ERSLINE¢ TXA¢ CLC¢ ADC #10¢ TAX¢ CPX #250¢ BNE CLRSCRNL¢ RTS¢PRTITLE¢ LDA #TITLE/256¢ LDY #TITLE&255¢ JMP CIOPRINT¢;¢QUIT¢ STA ASCII2¢ LDA #ASCII2/256¢ LDY #ASCII2&255¢ JSR CIOPRINT¢ LDA #5¢ STA 85¢ LDA #11¢ STA 84¢ LDA #1¢ STA 752¢ LDA #EDOS/256¢ LDY #EDOS&255¢ JSR CIOPRINT¢ LDA J+1¢ STA 12¢ LDA J+2¢ STA 13¢ JMP ($A)¢;¢GETFILE¢ LDA #ASCII/256¢ LDY #ASCII&255¢ JSR CIOPRINT¢ LDA #34¢ STA 559¢GETATA¢ JSR GETKEY2¢ CMP #128¢ BCC GETN128¢ SEC¢ SBC #128¢GETN128¢ CMP #96¢ BCC GETN96¢ SEC¢ SBC #32¢GETN96¢ CMP #81¢ BEQ QUIT¢ CMP #65¢ BNE NOATA¢ STA ASCII2¢ LDA #155¢ STA ATACHN+1¢ JMP GOPROMPT¢NOATA¢ CMP #83¢ BNE GETATA¢ STA ASCII2¢ LDA #10¢ STA ATACHN+1¢GOPROMPT¢ LDA #ASCII2/256¢ LDY #ASCII2&255¢ JSR CIOPRINT¢ JMP NOERRPR¢PRPROMPT¢ LDA #ERROR/256¢ LDY #ERROR&255¢ JSR CIOPRINT¢NOERRPR¢ LDA #PROMPT1/256¢ LDY #PROMPT1&255¢ JSR CIOPRINT¢ LDA #PROMPT/256¢ LDY #PROMPT&255¢ JSR CIOPRINT¢ LDA #155¢ LDX #0¢ERFNAME¢ STA FNAME,X¢ INX¢ CPX #20¢ BNE ERFNAME¢;¢ LDX #0¢ LDA #5¢ STA ICCOM¢ LDA #FNAME/256¢ STA ICBAH¢ LDA #FNAME&255¢ STA ICBAL¢ LDA #20¢ STA ICBLL¢ LDA #0¢ STA ICBLH¢ JSR CIOV¢ BMI PRPROMPT¢;¢ LDA FNAME¢ CMP #155¢ BEQ DIRDO¢ JMP NODIRDO¢GOBACK¢ JMP NOERRPR¢DIRDO¢ LDX #$10¢ LDA #12¢ STA ICCOM+$10¢ JSR CIOV¢;¢ LDA #DIRPR/256¢ LDY #DIRPR&255¢ JSR CIOPRINT¢ JSR GETKEY2¢ CMP #27¢ BEQ GOBACK¢ STA DIRPR2+1¢ LDA #DIRPR2/256¢ LDY #DIRPR2&255¢ JSR CIOPRINT¢ LDA DIRPR2+1¢ CMP #155¢ BEQ NOGOBACK¢ STA DIRNM+1¢ SEC¢ SBC #49¢ CMP #10¢ BCS GOBACK¢NOGOBACK¢;¢ LDX #$10¢ LDA #3¢ STA ICCOM+$10¢ LDA #DIRNM&255¢ STA ICBAL+$10¢ LDA #DIRNM/256¢ STA ICBAH+$10¢ LDA DIRPR2+1¢ CMP #155¢ BNE NODOPATH¢ LDA #DIRNM1&255¢ STA ICBAL+$10¢ LDA #DIRNM1/256¢ STA ICBAH+$10¢NODOPATH¢ LDA #6¢ STA ICAX1+$10¢ LDA #0¢ STA ICAX2+$10¢ JSR CIOV¢;¢DIRLOOP¢;¢ LDX #$10¢ LDA #5¢ STA ICCOM+$10¢ LDA #FNAME&255¢ STA ICBAL+$10¢ LDA #FNAME/256¢ STA ICBAH+$10¢ LDA #30¢ STA ICBLL+$10¢ LDA #0¢ STA ICBLH+$10¢ JSR CIOV¢ BMI DIREND¢;¢ LDA #155¢ STA FNAME+29¢ LDX #0¢ LDA #9¢ STA ICCOM¢ LDA #FNAME&255¢ STA ICBAL¢ LDA #FNAME/256¢ STA ICBAH¢ LDA #30¢ STA ICBLL¢ LDA #0¢ STA ICBLH¢ JSR CIOV¢ JMP DIRLOOP¢DIREND¢ TYA¢ PHA¢ LDX #$10¢ LDA #12¢ STA ICCOM+$10¢ JSR CIOV¢;¢ LDA #155¢ STA FNAME¢ PLA¢ CMP #136¢ BEQ DIRENDOK¢ LDA #FNAME/256¢ LDY #FNAME&255¢ JSR CIOPRINT¢ LDA #ERROR/256¢ LDY #ERROR&255¢ JSR CIOPRINT¢DIRENDOK¢ JMP NOERRPR¢DIRNM¢ DB 'D(:*.*'¢DIRNM1¢ DB 'D:*.*'¢NODIRDO¢ LDA FNAME+1¢ CMP #58¢ BEQ OKCOLON¢ LDA FNAME+2¢ CMP #58¢ BEQ OKCOLON¢ LDX #17¢COLONLP¢ LDA FNAME,X¢ STA FNAME+2,X¢ DEX¢ CPX #255¢ BNE COLONLP¢ LDA #68¢ STA FNAME¢ LDA #58¢ STA FNAME+1¢ LDA #155¢ STA FNAME+19¢OKCOLON¢;¢ LDX #$20¢ LDA #12¢ STA ICCOM+$20¢ JSR CIOV¢;¢ LDX #$20¢ LDA #3¢ STA ICCOM+$20¢ LDA #FNAME/256¢ STA ICBAH+$20¢ LDA #FNAME&255¢ STA ICBAL+$20¢ LDA #4¢ STA ICAX1+$20¢ LDA #0¢ STA ICAX2+$20¢ JSR CIOV¢ BMI GPRPRMPT¢ RTS¢GPRPRMPT¢ JMP PRPROMPT¢CIOPRINT¢ STA ICBAH¢ STY ICBAL¢ LDA #9¢ STA ICCOM¢ LDA #255¢ STA ICBLL¢ STA ICBLH¢ LDA #0¢ STA 767¢ TAX¢ JMP CIOV¢TITLE¢ DB 125,127,127,126¢ DB 'áב∩∮Õãá v1.5'¢ DB 29,29,156¢ DB 'by Itay Chamiel - September 1992'¢ DB 29,156¢ DB 'bruck@brachot.jct.ac.il',29,155¢ASCII¢ DB 29,156,'IJtari EOL or A≤cii? (or Q for DOS)',29,156,'?',28,155¢ASCII2 DB 0¢PROMPT1 DB 155¢PROMPT¢ DB ' Input DEV:filename:',155¢ERROR¢ DB 'Error - try again!',155¢EDOS¢ DB 'Exiting to DOS, please wait...',155¢DIRPR¢ DB 'Directory: drive #? (1-9)',155¢DIRPR2¢ DB 27,0,155¢XCHARS¢ DB 0,34,102,238,238,102,34,0¢ DB 0,136,204,238,238,204,136,0¢;¢GETBYTE¢ LDX #$20¢ LDA #7¢ STA ICCOM+$20¢ LDA #LO[CHARSET-BUFFER]¢ STA ICBLL+$20¢ LDA #HI[CHARSET-BUFFER]¢ STA ICBLH+$20¢ LDA #BUFFER/256¢ STA ICBAH+$20¢ LDA #HI[BUFFER-1]¢ STA BUFPLC+1¢ LDA #BUFFER&255¢ STA ICBAL+$20¢ LDA #LO[BUFFER-1]¢ STA BUFPLC¢ JSR CIOV¢ BMI DSKERR¢DSKERROK¢ RTS¢DSKERR¢ CPY #136¢ BEQ DSKERROK¢ PLA¢ PLA¢ TYA¢ PHA¢ JMP ADSKERR¢VDELAY LDA $14¢VDELW CMP $14¢ BEQ VDELW¢ RTS¢PRMESG¢ STA PRLEN¢ STY PRFROM¢ STX PRFROM+1¢ LDY #0¢ CPY PRLEN¢ BEQ PRMESGEN¢PRMESGLP¢ LDA (PRFROM),Y¢ STA PRCHAR¢ TYA¢ PHA¢ JSR PRINT¢ INC X¢ PLA¢ TAY¢ INY¢ CPY PRLEN¢ BNE PRMESGLP¢PRMESGEN¢ RTS¢EOFPRN DB ' áד∈Σá∩µáµΘ∮σá¡áעá⌠∩áσ°Θ⌠á'¢DOHELP¢ LDA #HDLIST&255¢ STA 560¢ LDA #HDLIST/256¢ STA 561¢ JSR GETKEY¢ LDA #DLIST&256¢ STA 560¢ LDA #DLIST/256¢ STA 561¢ RTS¢FNAME¢BUFFER=FNAME+30¢;¢; <EOF> (c) 1992 Itay Chamiel¢;¢