This page (revision-16) was last changed on 03-Feb-2023 15:21 by Roland B. Wassenberg 

This page was created on 14-Mar-2010 18:27 by Carsten Strotmann

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
16 03-Feb-2023 15:21 44 KB Roland B. Wassenberg to previous
15 18-Mar-2020 05:28 44 KB Roland B. Wassenberg to previous | to last
14 18-Mar-2020 05:23 44 KB Roland B. Wassenberg to previous | to last
13 22-May-2019 03:45 44 KB Roland B. Wassenberg to previous | to last
12 22-May-2019 03:43 44 KB Roland B. Wassenberg to previous | to last
11 22-May-2019 03:41 44 KB Roland B. Wassenberg to previous | to last
10 17-Aug-2015 21:51 44 KB Roland B. Wassenberg to previous | to last The XEP80 ==> XEP80
9 17-Aug-2015 21:51 44 KB Roland B. Wassenberg to previous | to last
8 05-Jul-2015 21:19 43 KB Roland B. Wassenberg to previous | to last
7 27-Jun-2015 23:11 43 KB Roland B. Wassenberg to previous | to last
6 22-Jun-2015 12:57 43 KB Roland B. Wassenberg to previous | to last
5 22-Jun-2015 12:56 43 KB Roland B. Wassenberg to previous | to last
4 07-Dec-2014 00:33 43 KB Roland B. Wassenberg to previous | to last
3 20-Dec-2010 18:23 43 KB Carsten Strotmann to previous | to last
2 29-May-2010 21:31 17 KB Stefan Haubenthal to previous | to last Typo
1 14-Mar-2010 18:27 17 KB Carsten Strotmann to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 changed one line
[{TableOfContents }] \\\
[{TableOfContents }]\\\
At line 3 added 2 lines
!! Manual
* [Atari_XEP80_Interface_Module_Owners_Manual.pdf] ; size: 2 MB ; Original Atari XEP80 Manual (C) 1987 Atari
At line 6 added 15 lines
!! ATR-Image
* [XEP80_Boot_Disk-DX5087.atr] ; Original Atari XEP80 Boot Disk DX5087 for NTSC systems (C) 1987 Atari
* [XEP80_Boot_Disk-DX5087-PAL.atr] ; patched driver for PAL systems
* [Altirra-Additions.atr] ; alternate XEP80 driver from the Altirra Additions Diskette ; faster than the original one from Atari!
!! Drivers
* [xep80han.arc] ; XEP80 handler - .com-file\\
* [xep80bxe.arc] ; XEP80 driver to work with OSS BASIC XE
* [xep80-new_stuff.zip] ; archive with 3 atr-images containing XEP80 specific stuff
* [ALTXEP80.SYS] ; alternate XEP80 driver from the Altirra Additions Diskette ; faster than the original one from Atari!
!! Images
[{Image src='XEP80-Label.jpg' width=313 height=256 }]
Original Atari XEP80 Boot Disk DX5087 Label (C) 1987 Atari\\
At line 210 added 1,118 lines
!!! The Original ATARI XEP 80 Handler Source
!! Handler Source
{{{
0100 ;.OPT NOLIST
0110 .OPT NOEJECT
0120 ;
0130 BASE=$6000
0140 ;
0150 ;CHAR EQUATES
0160 ;
0170 LF=10
0180 CR=13
0190 ESC=$1B
0200 SPACE=$20
0210 CNTL=$5E
0220 CLS=$7D
0230 EOL=$9B
0240 ;
0250 ;80 COL COMMANDS
0260 ;
0270 XCH80=$50
0280 LMG80=$60
0290 LMH80=$70
0300 YCR80=$80
0310 SGR80=$99
0320 PAG80=$9A
0330 RMG80=$A0
0340 RMH80=$B0
0350 GET80=$C0
0360 CUR80=$C1
0370 RST80=$C2
0380 PST80=$C3
0390 CLR80=$C4
0400 LIS80=$D0
0410 SCR80=$D2
0420 SCB80=$D3
0430 GRF80=$D4
0440 ICM80=$D5
0450 PAL80=$D7
0460 CRS80=$D9
0470 MCF80=$DB
0480 PNT80=$DD
0490 ;
0500 ;MEMORY EQUATES
0510 ;
0520 DOSINI=$0C
0530 ICDNOZ=$21
0540 ICCOMZ=$22
0550 ICAX1Z=$2A
0560 ICAX2Z=$2B
0570 ICIDNO=$2E
0580 LMARGN=$52
0590 RMARGN=$53
0600 VCP=$54
0610 HCP=$55
0620 IN=$CC
0630 CDTMV3=$21C
0640 SDMCTL=$22F
0650 KEYDEL=$2D9
0660 KEYREP=$2DA
0670 DVSTAT=$2EA
0680 CRSINH=$2F0
0690 CHBAS=$2F4
0700 LISTF=$2FE
0710 SFLAG=$2FF
0720 HATABS=$31A
0730 ICDNO=$341
0740 ICCOM=$342
0750 PAL=$D014
0760 IRQEN=$D20E
0770 SKSTAT=$D20F
0780 PORTA=$D300
0790 PACTL=$D302
0800 DMACTL=$D400
0810 WSYNC=$D40A
0820 VCOUNT=$D40B
0830 NMIEN=$D40E
0840 ;
0850 *=BASE-2
0860 ;
0870 .WORD CEND-BEGIN ;RELOCATER INFO
0880 ;
0890 BEGIN JSR ERTS ;DOSINI VECTOR
0900 JMP CINIT ;RELOCATER JUMP
0910 ;
0920 PAUX1 .BYTE 0
0930 PAUX2 .BYTE 0
0940 ;
0950 READ JSR DISAB;DISABLE IRQ INTS
0960 LDA #GET80
0970 JSR CINP ;REQUEST, GET CHAR
0980 PHA ;SAVE CHAR
0990 JSR INPUT ;GET CURS
1000 JSR CURCK ;CHECK FOR X>$4F
1010 PLA ;RESTORE CHAR
1020 JMP ENAB
1030 ;
1040 CINP JSR CMD
1050 INPUT LDA #00 ;TIME CRITICAL CODE
1060 TAX ;MUST NOT CROSS A
1070 LDY #31 ;PAGE BOUNDARY
1080 STA DATIN
1090 IN0 LDA PORTA ;4
1100 AND INMSK ;4
1110 BEQ IN01 ;3 IF A 0, 2 IF NOT
1120 DEX
1130 BNE IN0
1140 DEY ;TIMEOUT LOOPS
1150 BNE IN0
1160 SEC ;NO RESPONSE
1170 RTS
1180 IN01 LDX #08
1190 LDY #12 ;2
1200 IN1 DEY
1210 BNE IN1 ;5*Y-1
1220 NOP ;2
1230 IN10 LDY #15 ;2 MAIN DLY COUNT
1240 IN2 DEY
1250 BNE IN2 ;5*Y-1
1260 LDA PORTA ;4 GET BYTE
1270 AND INMSK ;4 GET BIT
1280 CLC ;2
1290 BEQ IN25 ;0=3,1=2
1300 SEC ;1=2
1310 IN25 BCC IN26 ;0=3,1=2
1320 IN26 DEX ;2 DEC COUNT
1330 BMI IN3 ;2 (3 DONE)
1340 ROR DATIN ;6 SHIFT IN BIT
1350 BCC IN10 ;3 ALWAYS
1360 IN3 LDY #15 ;DELAY 1/2 BIT
1370 IN33 DEY
1380 BNE IN33
1390 LDA DATIN ;GET CHAR (Y=0)
1400 BCC I5 ;RETURN IF CHAR
1410 BPL I0 ;HORIZ WITH NO VERT
1420 AND #$7F ;CLEAR UPPER FLAG
1430 CMP #$51 ;TEST HORIZ/VERT
1440 BCC I00 ;HORIZONTAL
1450 AND #$1F ;CLEAR MID FLAG
1460 BCS I01 ;SAVE VERT
1470 I00 JSR I0 ;SAVE HORIZ
1480 BCC INPUT ;GET VERT
1490 I0 INY ;OFFSET FOR HORIZ
1500 I01 STA VCP,Y ;CURS POSITION
1510 STA VCS,Y ;CURS SHADOW
1520 CLC ;INDICATE RESPONSE
1530 I5 RTS
1540 ;
1550 CURCK LDA HCP ;CHECK HORIZ CURSOR
1560 CMP #$50 ;FOR >$4F
1570 BCC I5 ;IF NOT
1580 LDA #CUR80 ;GO GET REAL VALUE
1590 JSR CINP
1600 JMP I0 ;AND STORE IT (Y=0)
1610 ;
1620 CMD SEC ;THIS CODE MUST NOT
1630 BCS OUT ;CROSS A PAGE BOUNDARY
1640 OUTPUT CLC ;CMD FLAG=0 FOR CHAR
1650 OUT LDY #00
1660 JSR SEND ;SEND START BIT
1670 LDX #08 ;SETUP BIT COUNT OF 9
1680 NOP
1690 NOP
1700 NOP ;2+2+2+2=8
1710 OUT0 ROR A ;PUT BIT INTO CARRY
1720 BCS HI
1730 BCC LO ;2+3=5 CYCLES TO LO
1740 LO LDY #00 ;5+2 CYCLES TO JSR
1750 JSR SEND ;SEND A 0
1760 BCC OUT1 ;3 CYCLES
1770 HI LDY OUTMS ;3+4 CYCLES TO JSR
1780 JSR SEND ;SEND A 1
1790 BCS OUT1 ;3 CYCLES
1800 OUT1 DEX ;NEXT BIT 2 CYC
1810 BPL OUT0 ;MORE 3 OR 2 CYC
1820 BMI OUT2 ;SEND STOP BIT 3 CYC
1830 OUT2 LDY OUTMS ;SEND A 1
1840 BNE OUT3
1850 OUT3 JSR SEND ;2+3+4+3=12
1860 RTS
1870 SEND STY PORTA ;OUTPUT BIT
1880 LDY #12 ;TIMER FOR 15.7KB
1890 S1 DEY
1900 BNE S1 ;5*Y-1 CYCLES
1910 BEQ S2 ;3
1920 S2 NOP
1930 NOP
1940 NOP
1950 NOP ;2+2+2+2=8
1960 S3 RTS ;6 CYCLES
1970 ;
1980 COM LDA ICCOMZ ;GET COM BYTE
1990 CMP #$14 ;CHECK DEBUG OUT
2000 BNE COM1 ;TRY NEXT XIO
2010 LDA ICAX2Z ;GET AUX 2
2020 COMSD JSR DISAB ;STOP INTERRUPTS
2030 JSR CMD ;GO SEND
2040 JMP ENAB ;ENABLE AND NORM EXIT
2050 COM1 CMP #$15 ;TEST VALID
2060 BNE COM2 ;NEXT
2070 LDA ICAX2Z ;GET AUX 2
2080 BNE COMBR ;GO DO BURST
2090 STA MODE ;MAKE NORMAL
2100 LDA #SCR80 ;GET CMD
2110 BNE COMSD ;GO SEND
2120 COMBR STA MODE ;MAKE BURST
2130 LDA #SCB80 ;GET CMD
2140 BNE COMSD ;GO SEND
2150 COM2 CMP #$16 ;CHECK DEBUG IN
2160 BNE COM3 ;NEXT
2170 LDA ICAX2Z ;GET BYTE TO SEND
2180 JSR DISAB
2190 JSR CINP ;REQUEST, GET CHAR
2200 STA DVSTAT+1 ;FOR NOW
2210 JMP ENAB
2220 COM3 CMP #$19 ;CHECK 80/40
2230 BNE COM4
2240 JMP XIO19 ;DO IT
2250 COM4 RTS
2260 ;
2270 PCOM LDA ICCOMZ ;GET CMD
2280 CMP #$17 ;TEST VALID
2290 BNE S3 ;NO MORE FOR NOW
2300 LDA ICAX2Z ;GET AUX 2
2310 CMP #08 ;CHECK RESERVED
2320 BCS S3 ;NO GOOD
2330 AND #03 ;CHECK 3 AND 7
2340 EOR #03
2350 BEQ S3 ;NOT ALLOWED
2360 LDA ICAX1Z ;GET AUX1
2370 CMP #08 ;CHECK UPPER LIMIT
2380 BCS S3 ;NO GOOD
2390 STA PAUX1
2400 LDA ICAX2Z ;GET AUX 2
2410 STA PAUX2
2420 JMP EXIT
2430 ;
2440 WRITE LDY SFLAG ;CHECK CNTL 1
2450 BNE WRITE ;IF ON
2460 JSR DISAB
2470 LDY DEV ;ARE WE SCREEN?
2480 BEQ WR2 ;YES
2490 PHA
2500 LDA #00
2510 STA DEV
2520 LDA #SCR80
2530 JSR CMD
2540 PLA
2550 WR2 LDY LISTF ;CHECK LIST FLAG
2560 CPY LISTS
2570 BEQ WR3
2580 STY LISTS ;SAVE NEW VALUE
2590 PHA
2600 TYA
2610 BEQ WR25
2620 LDA #01 ;FORCE LSB
2630 WR25 ORA #LIS80
2640 JSR CMD ;SEND NEW VALUE
2650 PLA
2660 WR3 JSR ALIGN ;SET PARMS
2670 LDY CHBAS ;CHECK CHAR SET
2680 CPY CHSH
2690 BEQ WR5
2700 CPY #$E0
2710 BNE WR4
2720 STY CHSH
2730 PHA
2740 LDA #GRF80
2750 WR35 JSR CMD
2760 PLA
2770 JMP WR5
2780 WR4 CPY #$CC
2790 BNE WR5
2800 STY CHSH
2810 PHA
2820 LDA #ICM80
2830 BNE WR35
2840 WR5 LDY CRSINH ;CHECK CURS FLAG
2850 CPY CRSS
2860 BEQ WR6
2870 STY CRSS
2880 PHA
2890 TYA
2900 BEQ WR55
2910 LDA #01
2920 WR55 EOR #CRS80 ;CURSOR ON/OFF
2930 JSR CMD
2940 PLA
2950 WR6 JSR OUTPUT ;SEND CHAR
2960 LDA MODE ;TEST FOR BURST
2970 BNE WWAT ;IF SO
2980 JSR INPUT ;GET NEW CURSOR
2990 JSR CURCK ;CHECK FOR X>$4F
3000 JMP ENAB
3010 WWAT JSR ENAB ;ENABLE INTS
3020 LDY #25 ;OR SUCH
3030 JSR S1
3040 WW1 LDA PORTA
3050 AND INMSK
3060 BEQ WW1
3070 WW2 LDY #01
3080 RTS
3090 ;
3100 POPEN STX TIOCB
3110 LDX ICDNOZ
3120 JSR MATRIX
3130 BCS HANDGO
3140 LDY SDMCTL
3150 BNE WW2
3160 LDA #PST80
3170 JSR DISAB
3180 JSR CINP ;REQUEST, GET CHAR
3190 BNE POP1
3200 LDA #139 ;NOBODY HOME
3210 POP1 JSR ENAB
3220 TAY
3230 RTS
3240 ;
3250 HANDGO LDA ICDNOZ
3260 STX ICDNOZ
3270 PHA
3280 LDA ICCOMZ
3290 AND #08
3300 TAX
3310 JSR HAND
3320 PLA
3330 STA ICDNOZ
3340 RTS
3350 ;
3360 PWRT TAY ;SAVE CHAR
3370 STX TIOCB
3380 LDA ICDNO,X
3390 TAX
3400 JSR MATRIX
3410 TYA
3420 BCC PWP
3430 STA TCHAR ;SAVE CHAR FOR CALL
3440 LDY TIOCB ;GET UNIT #
3450 LDA ICDNO,Y
3460 PHA ;SAVE UNIT #
3470 TXA ;GET NEW VALUE
3480 STA ICDNO,Y ;REPLACE WITH NEW
3490 STA ICDNOZ ;AND ZERO PAGE
3500 LDX #06
3510 JSR HAND ;GO PRINT
3520 PLA ;RESTORE UNIT #
3530 LDX TIOCB ;GET POINTER
3540 STA ICDNO,X ;RESTORE OLD
3550 STA ICDNOZ
3560 RTS
3570 PWP LDY DEV ;CHECK OUTPUT DEV
3580 BNE PW0
3590 PHA
3600 LDY SDMCTL
3610 BEQ PW2
3620 PW1 LDY VCOUNT
3630 CPY #129
3640 BNE PW1
3650 PW2 JSR DISAB
3660 LDA #PNT80
3670 STA DEV
3680 JSR CMD
3690 JSR ENAB
3700 PLA ;RESTORE CHAR
3710 PW0 TAY ;SAVE CHAR
3720 LDA PAUX2 ;GET CNTL
3730 ROR A ;CHECK NO XLATE
3740 TYA ;RESTORE CHAR
3750 BCS DOIT ;DONT XLATE
3760 CMP #EOL ;CHECK EOL
3770 BNE XLATE ;XLATE IF NOT
3780 LDA #CR ;REPLACE WITH CR
3790 JSR DOIT ;SEND
3800 LDA PAUX2 ;GET CNTL
3810 AND #04 ;CHECK NO APPEND
3820 BNE WGDS ;DONT APPEND
3830 LDA #LF ;GET LF
3840 BNE DOIT ;SEND
3850 XLATE LDA PAUX2 ;GET CNTL
3860 CMP #02 ;CHECK LIGHT XLATE
3870 TYA ;RESTORE CHAR
3880 BCC DOIT ;DONE WITH XLATE
3890 AND #$7F ;REMOVE MSB
3900 CMP #$20 ;CHECK ASCII CHAR
3910 BCS DOIT ;GO PRINT ASCII
3920 PHA ;SAVE CHAR
3930 LDA #CNTL ;GET "CNTL" CHAR
3940 JSR DOIT ;SEND
3950 PLA ;RESTORE CHAR
3960 ORA #$40 ;MAKE ALPHA
3970 DOIT LDY SDMCTL
3980 BEQ DO1
3990 DO0 LDY VCOUNT
4000 CPY #129
4010 BNE DO0
4020 DO1 JSR DISAB
4030 JSR OUTPUT
4040 JSR ENAB
4050 WAIT LDY #25 ;FOR NOW
4060 JSR S1
4070 LDY #02
4080 W0 LDX #255 ;FOR NOW
4090 STX CDTMV3 ;SETUP VBLANK COUNT
4100 W1 LDA PORTA
4110 AND INMSK
4120 BNE WGDS ;AVAILABLE
4130 LDA CDTMV3 ;CHECK COUNTDOWN
4140 BNE W1
4150 DEY
4160 BNE W0
4170 WTMO LDY #138 ;DO TIMEOUT
4180 BNE WRTS ;COULD DO BRKKEY ALSO
4190 WGDS LDY #01
4200 WRTS RTS
4210 ;
4220 MATRIX CPX #02
4230 BEQ PNEXT
4240 BCS POVER
4250 LDA PAUX1
4260 LSR A
4270 POVER RTS
4280 PNEXT LDA #03
4290 CMP PAUX1
4300 BCC POVER
4310 LDA PAUX1
4320 AND #02
4330 BEQ POVER
4340 DEX
4350 RTS
4360 ;
4370 HAND LDA $E431,X
4380 PHA
4390 LDA $E430,X
4400 PHA
4410 LDA TCHAR ;RESTORE CHAR
4420 LDX TIOCB ;GET IOCB POINTER
4430 RTS ;CALL PRINTER HANDLER
4440 ;
4450 FORCOM LDA ICCOMZ
4460 CMP #$18
4470 BEQ XIO18
4480 RTS
4490 ;
4500 CINIT LDA #00
4510 STA TOGGLE
4520 JSR JINIT
4530 LDA #$50
4540 LDY #02
4550 JSR FSET
4560 LDA #$53
4570 JSR FIND
4580 LDA HATABS+1,X
4590 STA TEMPSV
4600 LDA HATABS+2,X
4610 STA TEMPSV+1
4620 LDA #$45
4630 JSR FIND
4640 LDA HATABS+1,X
4650 STA IN
4660 LDA HATABS+2,X
4670 STA IN+1
4680 LDY #15
4690 C003 LDA (IN),Y
4700 STA TMTAB,Y
4710 DEY
4720 BPL C003
4730 LDA #FORCOM-1&$FF
4740 STA TMTAB+10
4750 LDA #FORCOM-1/256
4760 STA TMTAB+11
4770 LDA SKSTAT
4780 AND #08
4790 BEQ C004
4800 XIO18 LDA #$45
4810 LDY #00
4820 JSR FSET
4830 LDA #$53
4840 LDY #01
4850 JSR FSET
4860 LDA #WRITE-1&$FF
4870 STA $346
4880 LDA #WRITE-1/256
4890 STA $347
4900 EOPEN LDX #00
4910 JSR FESUB
4920 LDA ICAX1Z ;GET AUX 1
4930 AND #32 ;CHECK CLEAR BIT
4940 BNE C005 ;DONT DO RESET
4950 LDA #00
4960 LDX #06
4970 C0035 STA VCS,X
4980 DEX
4990 BPL C0035
5000 LDA #$E0
5010 STA CHSH
5020 LDA #$4F
5030 STA RMARGS
5040 STA COMPOS
5050 JSR DISAB
5060 IO00 LDA #RST80 ;RESET 80 COL
5070 JSR CINP ;REQUEST, GET CHAR
5080 BCC IO01 ;GOT IT
5090 JSR JTOGL ;SWITCH PORTS
5100 BNE IO00 ;DO IT AGAIN
5110 IO01 LDA PAL ;CHECK COMPUTER TYPE
5120 AND #$0E
5130 BNE IOP1
5140 LDA #PAL80
5150 JSR CMD ;SET 80 COL TO 50HZ
5160 IOP1 JMP ENAB
5170 ;
5180 XIO19 LDX #06
5190 JSR FESUB
5200 LDA #$53
5210 JSR FIND
5220 LDA TEMPSV
5230 STA HATABS+1,X
5240 LDA TEMPSV+1
5250 STA HATABS+2,X
5260 LDA TMTAB+6
5270 STA $346
5280 LDA TMTAB+7
5290 STA $347
5300 C004 LDA #$45
5310 LDY #03
5320 JSR FSET
5330 JMP EXIT
5340 C005 LDA #SCR80 ;IN CASE A PRINT
5350 JMP COMSD ;HAS OCCURED
5360 ;
5370 EDTAB .WORD EOPEN-1 ;OPEN
5380 .WORD EXIT-1 ;CLOSE
5390 .WORD EGET-1 ;GET LINE OF TEXT
5400 .WORD WRITE-1 ;PUT (NO CURS)
5410 .WORD EXIT-1 ;STATUS
5420 .WORD COM-1 ;SPECIAL (CMD OUT)
5430 JMP EXIT ;INIT
5440 .BYTE 0
5450 ;
5460 PRTAB .WORD POPEN-1 ;OPEN
5470 .WORD EXIT-1 ;CLOSE
5480 .WORD ERTS-1 ;GET
5490 .WORD PWRT-1 ;PUT
5500 .WORD POPEN-1 ;STATUS
5510 .WORD PCOM-1 ;SPECIAL
5520 JMP EXIT ;INIT
5530 .BYTE 0
5540 ;
5550 SCTAB .WORD SOPEN-1 ;OPEN
5560 .WORD EXIT-1 ;CLOSE
5570 .WORD SREAD-1 ;GET-LOCATE
5580 .WORD SWRIT-1 ;PUT-PLOT
5590 .WORD EXIT-1 ;STATUS
5600 .WORD ERTS-1 ;SPECIAL
5610 SCT1 JMP EXIT ;INIT
5620 .BYTE 0
5630 ;
5640 TMTAB .WORD EXIT-1,EXIT-1
5650 .WORD EXIT-1,EXIT-1
5660 .WORD EXIT-1,EXIT-1
5670 JMP EXIT
5680 .BYTE 0
5690 ;
5700 SOPEN LDA ICAX2Z
5710 AND #08
5720 BEQ SCT1
5730 LDA ICAX1Z
5740 AND #16
5750 BNE SCT1
5760 LDA #00 ;SEND 0
5770 JSR DISAB
5780 JSR OUTPUT
5790 JSR INPUT
5800 LDA #SGR80 ;SET GRAPHICS
5810 JSR CMD
5820 LDA PAL
5830 AND #$0E
5840 BNE SOP1
5850 LDA #PAG80
5860 JSR CMD
5870 SOP1 LDA #CLR80 ;FILL WITH 0 SENT
5880 JSR CINP ;REQUEST, GET CHAR
5890 LDA #01
5900 JMP COMBR
5910 ;
5920 SREAD JSR DISAB
5930 JSR ALIGN ;SET PARMS
5940 JSR READ ;GET CHAR
5950 CMP #EOL ;CHECK EOL
5960 BNE SCT1 ;RETURN NORMAL
5970 LDA #SPACE ;REPLACE WITH SPACE
5980 BNE SCT1 ;RETURN NORMAL
5990 ;
6000 SWRIT PHA ;SAVE CHAR
6010 LDA #ESC ;FORCE PRINT
6020 JSR WRITE
6030 PLA ;RESTORE CHAR
6040 JMP WRITE ;SEND IT
6050 ;
6060 EGET LDA COMPOS
6070 BEQ EBACK
6080 LDA HCP
6090 STA HCPS
6094 STA HCPE
6100 EG1 JSR KCALL ;GET KB BYTE
6110 CMP #EOL
6120 BEQ EGBAK
6130 JSR WRITE ;SEND TO 80 COL
6132 LDY HCP ;THIS CODE IS FOR
6134 CPY HCPE ;SPECIAL CASE LINES
6140 BCC EG1 ;DONT UPDATE IF LESS
6142 STY HCPE
6144 BCS EG1
6150 EGBAK STY KSTAT ;SAVE STATUS
6160 CPY #$80 ;CHECK STAT
6170 BCS EBA0 ;DO EOL IF EOF/BREAK
6180 JSR DISAB ;DISAB FOR CMD
6190 LDA #00
6200 STA COMPOS
6210 LDA MODE
6220 BEQ EG2
6230 LDA #00
6240 BEQ EG3
6250 EG2 LDA HCPS
6260 EG3 JSR CMD ;X CURS TO OLD VAL
6270 LDA #MCF80 ;Y CURS TO FIRST
6280 JSR CMD
6290 EBACK JSR READ ;GO GET A CHAR
6300 CMP #EOL
6310 BNE EGXT ;NOT DONE YET
6312 LDY HCP
6314 CPY HCPE ;CHECK RIGHTMOST
6315 BCS EBA0 ;CURSOR POSITION
6316 LDA #SPACE ;IF NOT THERE
6318 BNE EGXT ;THEN FAKE SPACE
6320 EBA0 STA COMPOS ;SET NON 0
6330 JSR WRITE
6340 LDA #EOL ;RETURN WITH EOL
6350 EGXT LDY KSTAT ;GET STATUS
6360 RTS
6370 ;
6380 KCALL LDA $E425
6390 PHA
6400 LDA $E424
6410 PHA
6420 RTS
6430 ;
6440 DISAB LDY #00
6450 STY NMIEN
6460 SEI
6470 RTS
6480 ;
6490 ENAB LDY #$C0
6500 STY NMIEN
6510 CLI
6520 EXIT LDY #01
6530 ERTS RTS
6540 ;
6550 VCS .BYTE 0
6560 HCS .BYTE 0
6570 DEV .BYTE 0
6580 LMARGS .BYTE 0
6590 LISTS .BYTE 0
6600 MODE .BYTE 0
6610 CRSS .BYTE 0
6620 ;
6630 CHSH .BYTE 0
6640 RMARGS .BYTE 0
6650 COMPOS .BYTE 0
6660 ;
6670 DATIN .BYTE 0
6680 HCPS .BYTE 0
6685 HCPE .BYTE 0
6690 KSTAT .BYTE 0
6700 INMSK .BYTE 0
6710 OUTMS .BYTE 0
6720 TOGGLE .BYTE 0
6730 TIOCB .BYTE 0
6740 TCHAR .BYTE 0
6750 ;
6760 TEMPSV .WORD 0
6770 ;
6780 INMST .BYTE 02,$20
6790 OUTMT .BYTE 01,$10
6800 ;
6810 FETAB .BYTE 0,0,0,$4F,24,3
6820 .BYTE 62,0,2,39,30,6
6830 ;
6840 LOOKUP .BYTE "ESP"
6850 LOWAD .BYTE EDTAB&$FF,SCTAB&$FF,PRTAB&$FF,TMTAB&$FF
6860 ;
6870 ALIGN LDY HCP ;GET HCURS
6880 CPY HCS ;COMPARE TO SHADOW
6890 BEQ A1 ;NO CHANGE
6900 STY HCS ;SAVE NEW VALUE
6910 PHA ;SAVE CHAR
6920 TYA
6930 CMP #$50
6940 BCC A00
6950 LSR A
6960 LSR A
6970 LSR A
6980 LSR A
6990 ORA #XCH80
7000 PHA
7010 TYA
7020 AND #$0F
7030 JSR CMD
7040 PLA
7050 A00 JSR CMD ;SEND NEW CURSOR
7060 PLA
7070 A1 LDY VCP ;GET VCURS
7080 CPY #25 ;CHECK UPPER LIMIT
7090 BCC A15
7100 LDY #24 ;STATUS LINE
7110 A15 CPY VCS ;COMPARE TO SHADOW
7120 BEQ A2 ;NO CHANGE
7130 STY VCS ;SAVE NEW VALUE
7140 PHA ;SAVE CHAR
7150 TYA
7160 ORA #YCR80 ;SET CMD BIT
7170 JSR CMD ;SEND NEW CURSOR
7180 PLA
7190 A2 LDY LMARGN
7200 CPY RMARGN
7210 BCC A24
7220 LDY #00
7230 STY LMARGN
7240 A24 CPY LMARGS
7250 BEQ A3
7260 STY LMARGS
7270 PHA
7280 TYA
7290 AND #$0F
7300 ORA #LMG80
7310 JSR CMD
7320 LDA LMARGN
7330 LSR A
7340 LSR A
7350 LSR A
7360 LSR A
7370 BEQ A25
7380 ORA #LMH80
7390 JSR CMD
7400 A25 PLA
7410 A3 LDY RMARGN
7420 CPY RMARGS
7430 BEQ A4
7440 STY RMARGS
7450 PHA
7460 TYA
7470 AND #$0F
7480 ORA #RMG80
7490 JSR CMD
7500 LDA RMARGN
7510 LSR A
7520 LSR A
7530 LSR A
7540 LSR A
7550 CMP #04
7560 BEQ A35
7570 ORA #RMH80
7580 JSR CMD
7590 A35 PLA
7600 A4 RTS
7610 ;
7620 FESUB LDA FETAB,X
7630 STA SDMCTL
7640 STA DMACTL
7650 LDA FETAB+1,X
7660 STA VCP
7670 LDA FETAB+2,X
7680 STA HCP
7690 STA LMARGN
7700 LDA FETAB+3,X
7710 STA RMARGN
7720 LDA FETAB+4,X
7730 STA KEYDEL
7740 LDA FETAB+5,X
7750 STA KEYREP
7760 RTS
7770 ;
7780 FIND LDX #00
7790 F1 CMP HATABS,X
7800 BEQ F2
7810 INX
7820 INX
7830 INX
7840 BNE F1
7850 ;
7860 FSET JSR FIND
7870 SET LDA LOWAD,Y
7880 STA HATABS+1,X
7890 LDA #EDTAB/256
7900 STA HATABS+2,X
7910 F2 RTS
7920 ;
7930 JTOGL LDA #01
7940 EOR TOGGLE
7950 STA TOGGLE
7960 JINIT LDX TOGGLE
7970 LDY INMST,X
7980 STY INMSK
7990 LDY OUTMT,X
8000 STY OUTMS
8010 LDA #$FF
8020 STA PORTA
8030 LDX #$38
8040 STX PACTL
8050 STY PORTA
8060 LDX #$3C
8070 STX PACTL
8080 RTS
8090 ;
8100 CEND=*
8110 ;
8120 .END
}}}
!! Relocator Source
{{{
0100 .OPT NOEJECT
0110 DOSINI=$0C
0120 IN=$CC
0130 OUT=$CE
0140 OFFSET=$D0
0150 MEMTOP=$2E5
0160 CBEGIN=LENGTH+2
0170 *=$3000
0180 ENTER SEC
0190 LDA MEMTOP
0200 SBC LENGTH
0210 LDA MEMTOP+1
0220 SBC LENGTH+1
0230 STA OUT+1
0240 STA OFFSET
0250 TAY
0260 DEY
0270 STY MEMTOP+1
0280 LDY #$FF
0290 STY MEMTOP
0300 INY
0310 STY OUT
0320 LDX #00
0330 LDA #CBEGIN&$FF
0340 STA IN
0350 LDA #CBEGIN/256
0360 STA IN+1
0370 JSR MOVI
0380 HERE TAX
0390 BMI MORE
0400 JSR MOVI
0410 CLC
0420 ADC OFFSET
0430 LDX #00
0440 JSR MOV
0450 BMI HERE
0460 MORE INX
0470 BEQ OVER
0480 DEX
0490 JSR MOVI
0500 BMI HERE
0510 MOV STA (OUT),Y
0520 INC OUT
0530 BNE MOVI
0540 INC OUT+1
0550 MOVI LDA (IN),Y
0560 INC IN
0570 BNE MOVO
0580 INC IN+1
0590 MOVO DEX
0600 BPL MOV
0610 ARND RTS
0620 OVER LDA #01
0630 STA OUT
0640 LDA OFFSET
0650 STA OUT+1
0660 LDA DOSINI
0670 STA (OUT),Y
0680 INC OUT
0690 LDA DOSINI+1
0700 STA (OUT),Y
0710 INC OUT
0720 TYA
0730 STA DOSINI
0740 LDA OFFSET
0750 STA DOSINI+1
0760 JMP (OUT)
0770 LENGTH=*
}}}
!! BASIC Relocator
{{{
10 REM RELOCATING PROGRAM FOR XEP80
20 REM TO USE THIS PROGRAM THE FOLLOWING CRITERIA MUST BE MET:
30 REM . THE HANDLER SOURCE CODE MUST BE ASSEMBLED TWICE, THE FIRST
40 REM . ASSEMBLY AT ANY CHOSEN START ADDRESS AND THE SECOND AT
50 REM . THAT ADDRESS+$100. THE FIRST OBJECT CODE WILL BE CALLED
60 REM . H6000.OBJ AND THE SECOND OBJECT CALLED H6100.OBJ. THE
70 REM . RELOCATER CODE MUST BE ASSEMBLED AS FILE MOVE.OBJ. THIS
80 REM . PROGRAM WILL READ IN MOVE.OBJ THEN COMPARE BYTES BETWEEN
90 REM . H6000.OBJ AND H6100.OBJ AND CREATE A LINKED RELOCATABLE
100 REM . STRING. THIS STRING IS APPENDED TO THE MOVE.OBJ STRING
105 REM . THEN WRITTEN TO DISK AS AUTORUN.SYS
110 CLR :DIM A$(2048)
120 DIM REL$(14),OB1$(14),OB2$(14),OUT$(14)
130 REL$="D:MOVE.OBJ"
131 OB1$="D:H6000.OBJ"
132 OB2$="D:H6100.OBJ"
133 OUT$="D:AUTORUN.SYS"
200 PULL=3000:REND=3500:WRITE=4000
205 ADD=5000
210 TREND=32768:IN=1
300 OPEN #1,4,0,REL$:FILE=1
310 TRAP REND:TEND=0
320 GOSUB PULL
322 IF TEND=1 THEN GOTO 340
324 A$(IN,IN)=CHR$(DAT)
325 GOSUB ADD
330 GOTO 320
340 CLOSE #1
350 TRAP TREND
400 OPEN #2,4,0,OB1$
410 OPEN #3,4,0,OB2$
415 TRAP REND:TEND=0
417 FOR X=0 TO 5:FILE=2:GOSUB PULL:FILE=3:GOSUB PULL:NEXT X
418 FOR X=0 TO 1:FILE=2:GOSUB PULL:FILE=3:GOSUB PULL
419 A$(IN,IN)=CHR$(DAT):GOSUB ADD:NEXT X
420 COUNT=0
430 SPOT=IN
440 GOSUB ADD
445 IF COUNT>127 THEN GOTO 487
450 FILE=2:GOSUB PULL:IF TEND=1 THEN GOTO 550
455 T1=DAT
460 FILE=3:GOSUB PULL:T2=DAT
470 IF T1<>T2 THEN GOTO 500
480 A$(IN,IN)=CHR$(T1):COUNT=COUNT+1
485 GOTO 440
487 A$(SPOT,SPOT)=CHR$(128)
490 GOTO 420
500 A$(SPOT,SPOT)=CHR$(COUNT)
510 TR=T1-96:REM SHOULD READ FROM FILE
520 A$(IN,IN)=CHR$(TR)
530 GOSUB ADD
540 GOTO 420
550 A$(SPOT,SPOT)=CHR$(COUNT)
551 A$(IN,IN)=CHR$(0)
552 GOSUB ADD
553 A$(IN,IN)=CHR$(255)
554 CLOSE #2:CLOSE #3
560 START=ASC(A$(3,3))+ASC(A$(4,4))*256
570 FEND=START+IN-7
580 HI=INT(FEND/256):LO=FEND-HI*256
590 A$(5,5)=CHR$(LO):A$(6,6)=CHR$(HI)
591 GOSUB ADD:A$(IN,IN+6)=""
600 REM STOP
700 OPEN #4,8,0,OUT$
710 ? #4;A$;
720 CLOSE #4
800 STOP
900 REM THIS SECTION CAN BE ENABLED TO OUTPUT A HEX VERSION OF THE FILE
1000 DIM T$(16):T$="0123456789ABCDEF"
1002 FOR X=0 TO LEN(A$)-1
1003 M=INT(X/256):MH=X-M*256:H=INT(MH/16):L=MH-H*16:M=M+1:H=H+1:L=L+1
1004 ? T$(M,M);T$(H,H);T$(L,L);" ";
1010 R=ASC(A$(X+1,X+1))
1020 H=INT(R/16):L=R-H*16:H=H+1:L=L+1
1030 ? T$(H,H);T$(L,L)
1040 NEXT X
1050 STOP
3000 GET #FILE,DAT
3010 RETURN
3500 TEND=1:RETURN
}}}
!!!Diagrams
[{Image src='Atari_XEP80_diagram1.jpg' width=800 height=356 }]
Atari XEP80 diagram 1 ; thank you so much Jerzy Sobola for your help! Greatly appreciated!\\
\\
[{Image src='Atari_XEP80_diagram2.gif' width=765 height=447 }]
Atari XEP80 diagram 2
!!! References
* [The XEP 80 - part one from Mathy's collection of special stuff|http://www.mathyvannisselroy.nl/xep_1.htm] ; thank you so much Mathy and Floppydoc! Your help is greatly appreciated. :-)
* [The XEP 80 - part two from Mathy's collection of special stuff|http://www.mathyvannisselroy.nl/xep_2.htm] ; thank you so much Mathy and Floppydoc! Your help is greatly appreciated. :-)
!!! XEP 80 Demos in Basic
!! Attributes Example
{{{
100 REM ATTRIBUTES EXAMPLE
110 REM TO SET ATTRIBUTES USE FOLLOWING DEFINITIONS TO FORM COMMAND
120 REM . THE XEP80 CONTAINS TWO ATTRIBUTE REGISTERS
130 REM . REGISTER A IS USED WHEN A CHARACTER ASCII VALUE IS BELOW 128
140 REM . REGISTER B IS USED WHEN A CHARACTER ASCII VALUE IS ABOVE 127
150 REM . EACH REGISTER REMAINS CONSTANT ACROSS THE SCREEN
160 REM . THAT IS, NO MATTER WHERE A CHARACTER IS PLACED ON THE SCREEN
170 REM . ITS ATTRIBUTES WILL REMAIN THE SAME
180 REM . REGISTER BIT DEFINITIONS:
190 REM . BIT EFFECT IF A 0
200 REM . 0 REVERSE VIDEO
210 REM . 1 NO EFFECT
220 REM . 2 BLINKING
230 REM . 3 NO EFFECT
240 REM . 4 DOUBLE WIDE
250 REM . 5 UNDERLINE
260 REM . 6 BLANK
270 REM . 7 SPECIAL TEXT GRAPHICS
280 REM . TO ISSUE A COMMAND DO THE FOLLOWING:
290 REM . 1) PRINT CHR$(27);
300 REM . 2) PRINT CHR$(VALUE DERIVED FROM ABOVE BIT DEFINITIONS);
310 REM . 3) XIO 20,#1,12,A,"E:"
320 REM . WHERE A=244 FOR REGISTER A AND A=245 FOR REGISTER B
330 REM . THEN PRINT CHARACTERS ON THE SCREEN, EITHER WITH BIT 7 OFF
340 REM . TO USE REGISTER A, OR WITH BIT 7 ON TO USE REGISTER B
400 ? "}";:POSITION 28,11:? "E X A M P L E T E X T ":POKE 752,1
410 GOSUB 2000
500 REM SOME ATTRIBUTE COMBINATIONS
510 ? CHR$(27);CHR$(255-1);:XIO 20,#1,12,245,"E:"
520 ? CHR$(27);CHR$(255-1);:XIO 20,#1,12,245,"E:"
530 GOSUB 2000:REM REVERSE VIDEO
550 ? CHR$(27);CHR$(255-4);:XIO 20,#1,12,244,"E:"
560 ? CHR$(27);CHR$(255-1);:XIO 20,#1,12,245,"E:"
580 GOSUB 2000:REM BLINKING
600 ? CHR$(27);CHR$(255-16);:XIO 20,#1,12,244,"E:"
610 ? CHR$(27);CHR$(255-1);:XIO 20,#1,12,245,"E:"
630 GOSUB 2000:REM SOME DOUDLE WIDE
700 ? CHR$(27);CHR$(255);:XIO 20,#1,12,244,"E:"
710 ? CHR$(27);CHR$(255-16-1);:XIO 20,#1,12,245,"E:"
730 GOSUB 2000:REM OTHERS DOUBLE WIDE
750 ? CHR$(27);CHR$(255-16);:XIO 20,#1,12,244,"E:"
760 ? CHR$(27);CHR$(255-16-1);:XIO 20,#1,12,245,"E:"
780 GOSUB 2000:REM ALL DOUBLE WIDE
800 ? CHR$(27);CHR$(255-128);:XIO 20,#1,12,244,"E:"
810 ? CHR$(27);CHR$(255-128-1);:XIO 20,#1,12,245,"E:"
830 GOSUB 2000:REM ALL GRAPHICS
850 ? CHR$(27);CHR$(255);:XIO 20,#1,12,244,"E:"
860 ? CHR$(27);CHR$(255);:XIO 20,#1,12,245,"E:"
880 GOSUB 2000:REM BACK TO NORMAL
990 POKE 752,0:END
2000 ? "~~";:FOR X=0 TO 999:NEXT X:RETURN
}}}
!! Scrolling Window Example
{{{
100 REM SCROLLING WINDOW EXAMPLE
105 REM SCROLL LEFT AND RIGHT WITH JOYSTICK, WHEN FINISHED PRESS TRIGGER
107 POKE 53774,64:REM DISABLE BREAK KEY
110 POKE 83,255:POKE 752,1:REM SET RIGHT MARGIN, CURSOR OFF
112 FOR COL=0 TO 3*57 STEP 57:GOSUB 1050:REM CLEAR ALL WINDOWS
114 ? CHR$(125);:NEXT COL:COL=0:GOSUB 1050:REM SET FIRST WINDOW
120 ? CHR$(125);:POSITION 0,20:? "USE JOYSTICK TO SCROLL",,,
125 ? "PRESS TRIGGER BUTTON TO EXIT"
130 FOR X=0 TO 15:POSITION X*16,1:? "COLUMN ";X;
140 GOSUB 1000:FOR Y=3 TO 16:REM ALLOW SCROLLING
150 POSITION X*16+2,Y:? INT(RND(0)*100);:REM MAKE UP A VALUE
160 GOSUB 1000:REM ALLOW SCROLLING WHILE PRINTING
170 NEXT Y:NEXT X
180 GOSUB 1000:GOTO 190-STRIG(1)*10:REM ALLOW SCROLLING, CHECK TRIGGER
190 POSITION 0,20:? CHR$(253);:XIO 20,#1,12,220,"E:":POKE 83,79:POKE 752,0
195 POKE 53774,192:REM ENABLE BREAK KEY
200 END :REM WINDOW TO LEFT EDGE, RESET RIGHT MARGIN, CURSOR ON, EXIT
1000 REM JOYSTICK ROUTINE
1010 A=STICK(1):COL=COL+SGN((A=7)-(A=11)):REM GET DIRECTION AND MOVE
1030 COL=COL*(COL>-1 AND COL<177)+(COL=177)*176:REM LIMITS OF SCROLLING
1050 POSITION COL,20:? CHR$(253);:XIO 20,#1,12,220,"E:"
1060 REM LINE 1050 SETS THE NEW CURSOR AND ISSUES THE SCROLL COMMAND
1090 RETURN
}}}
!! Graphics Example (Circle)
{{{
0 GOTO 100:REM KEEP TIME DEPENDENT CODE NEAR BEGINNING
10 FOR M=0 TO 12:V=0:S=128:FOR N=0 TO 7:X=P+N:REM LOOPS FOR CIRCLE LIMITS
20 V=V+S*(X*X+Y*Y*2.3<2500):S=S/2:NEXT N:P=P+8:REM CIRCLE CALCULATION
30 IF V THEN G$(M+1,M+1)=CHR$(V):REM SET BITS FOR OUTPUT STRING
40 NEXT M:? G$;:GOTO 170:REM PRINT OUTPUT STRING
100 REM GRAPHICS DISPLAY EXAMPLE TO DRAW CIRCLE
110 POKE 752,1:? CHR$(125);:DIM G$(40),D$(40):REM CURSOR OFF
111 ? :? " PRESS ANY KEY TO BEGIN GRAPHICS PLOTTING (TOTAL TIME 5 MIN)"
112 ? :? " WHEN PLOT IS FINISHED PRESS ANY KEY TO RETURN TO TEXT SCREEN"
113 IF PEEK(764)=255 THEN 113
114 POKE 764,255:REM RESET CHARACTER INPUT BYTE
115 D$=CHR$(0):D$(40)=CHR$(0):D$(2)=D$:GRAPHICS 8+16:REM INIT STRING
117 POKE 53774,64:REM DISABLE BREAK KEY
120 FOR Y=-32 TO 32:REM VERTICAL AXIS LOOP
130 G$=D$:P=-50:GOTO 10:REM GO TO TIME CRITICAL CODE
170 NEXT Y
180 IF PEEK(764)=255 THEN 180:REM HOLD SCREEN
185 POKE 53774,192:REM ENABLE BREAK KEY
190 POKE 764,255:OPEN #1,12,0,"E:":POKE 752,0:END :REM RESTORE TEXT SCREEN
}}}
!! Printer Configuration Program
{{{
100 REM PRINTER CONFIGURATION PROGRAM
110 DIM A$(2048),IN$(16),OUT$(16):REM ALLOCATE STRINGS
120 IN$="D:AUTORUN.SYS":REM READ THIS FILE
130 OUT$="D:PRINT.SYS":REM CREATE THIS FILE
140 TRAP 32000:REM IF NO AUTORUN.SYS
150 OPEN #1,4,0,IN$
160 TRAP 180:REM TO CATCH EOF
170 A=A+1:GET #1,B:A$(A,A)=CHR$(B):GOTO 170:REM BUILD INPUT STRING
180 CLOSE #1
190 I=136:? "AUX1 VALUE";:INPUT A:REM PRINTER AUX1 BYTE
200 A$(I,I)=CHR$(A)
210 I=137:? "AUX2 VALUE";:INPUT A:REM PRINTER AUX2 BYTE
220 A$(I,I)=CHR$(A)
230 OPEN #2,8,0,OUT$
240 ? #1;A$;:CLOSE #2:REM WRITE MODIFIED STRING TO FILE
250 END
32000 ? "FILE NOT FOUND"
}}}