home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
apps
/
dtp
/
pgsmodst
/
atariimp
/
ascii.s
< prev
next >
Wrap
Text File
|
1991-05-23
|
5KB
|
219 lines
Include "equ.h"
Include "impequ.h"
SECTION ascii,CODE,PUBLIC
***************************************************
*** ***
***************************************************
dumbentry:
clr.l d0
rts
dc.l "IMPT" ; magik number for import module
dc.w 200
dc.l 0
table: dc.l 0
dc.l name,special,check,ascii ;Plain Ascii
check: moveq #1,d0
rts
***
*** Text File Import
***
*
* Plain Ascii
*
ascii: move.l table,a0
move.l spclnum(a0),a1
move.w (a1),crstrip
clr.w crcount
move.l f_openr(a0),a0
jsr (a0)
beq ascii9
move.l table,a0
move.l t_open(a0),a0
jsr (a0)
beq ascii9
ascii1: move.l table,a0
move.l f_get(a0),a0
jsr (a0)
beq ascii9
and.w #$ff,d0
lea ktoi,a0
tst.b 0(a0,d0.w)
bne tput
cmp.b #$a,d0
beq docr
cmp.b #$9,d0
beq dotab
bra ascii1
*
docr: tst.w crstrip
beq docr1
bset #0,crcount
beq ascii1
move.w #CMD_CR,d0
move.l table,a0
move.l t_putw(a0),a0
jsr (a0)
beq ascii9
docr1: move.w #CMD_CR,d0
bra tputw
*
dotab: move.w #CMD_TAB,d0
bra tputw
*
* put as is
*
tput: bclr #0,crcount
beq tput1
move.w d0,-(sp)
move.b #" ",d0
move.l table,a0
move.l t_put(a0),a0
jsr (a0)
beq ascii9a
lea ktoi,a0
move.w (sp)+,d0
tput1: move.b 0(a0,d0.w),d0
move.l table,a0
move.l t_put(a0),a0
jsr (a0)
beq ascii9
bra ascii1
*
* end of input file. close and flush buffer
*
ascii9a:
addq.l #2,sp
ascii9: move.l table,a0
move.l f_closer(a0),a0
jsr (a0)
move.l table,a0
move.l t_close(a0),a0
jmp (a0)
tputw: move.l table,a0
move.l t_putw(a0),a0
jsr (a0)
beq ascii9
bra ascii1
*******************************************************************
*** called when the import routine choosen finds something ***
*** wrong with the file loaded. ***
*******************************************************************
notright:
rts
never: moveq #0,d0
rts
maybe: moveq #1,d0
rts
right: moveq #2,d0
rts
***********************************************************
*** ***
***********************************************************
SECTION ascii,DATA,PUBLIC
IF AMIGA
* Amiga ktoi
ktoi: dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$00-$07
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$08-$0f
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$10-$17
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$18-$1f
dc.b $20,$21,$22,$23,$24,$25,$26,$27
dc.b $28,$29,$2a,$2b,$2c,$2d,$2e,$2f
dc.b $30,$31,$32,$33,$34,$35,$36,$37
dc.b $38,$39,$3a,$3b,$3c,$3d,$3e,$3f
dc.b $40,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4a,$4b,$4c,$4d,$4e,$4f
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5a,$5b,$5c,$5d,$5e,$5f
dc.b $60,$61,$62,$63,$64,$65,$66,$67
dc.b $68,$69,$6a,$6b,$6c,$6d,$6e,$6f
dc.b $70,$71,$72,$73,$74,$75,$76,$77
dc.b $78,$79,$7a,$7b,$7c,$7d,$7e,$00
dc.b 000,000,000,000,000,000,000,000 ;$80
dc.b 000,000,000,000,000,000,000,000 ;$88
dc.b 000,000,000,000,000,000,000,000 ;$90
dc.b 000,000,000,000,000,000,000,000 ;$98
dc.b 000,186,162,163,160,161,142,165 ;$a0
dc.b 000,183,188,136,141,173,184,129 ;$a8
dc.b 155,140,148,149,166,153,181,172 ;$b0
dc.b 000,147,156,137,144,145,146,185 ;$b8
dc.b 192,193,194,195,196,197,198,199 ;$c0
dc.b 200,201,202,203,204,205,206,207 ;$c8
dc.b 157,209,210,211,212,213,214,138 ;$d0
dc.b 159,217,218,219,220,221,158,187 ;$d8
dc.b 224,225,226,227,228,229,230,231 ;$e0
dc.b 232,233,234,235,236,237,238,239 ;$e8
dc.b 189,241,242,243,244,245,246,139 ;$f0
dc.b 191,249,250,251,252,253,190,254 ;$f8
ENDIF
IF ATARIST
* AtariST ktoi
ktoi: dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$00-$07
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$08-$0f
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$10-$17
dc.b $00,$00,$00,$00,$00,$00,$00,$00 ;$18-$1f
dc.b $20,$21,$22,$23,$24,$25,$26,$27
dc.b $28,$29,$2a,$2b,$2c,$2d,$2e,$2f
dc.b $30,$31,$32,$33,$34,$35,$36,$37
dc.b $38,$39,$3a,$3b,$3c,$3d,$3e,$3f
dc.b $40,$41,$42,$43,$44,$45,$46,$47
dc.b $48,$49,$4a,$4b,$4c,$4d,$4e,$4f
dc.b $50,$51,$52,$53,$54,$55,$56,$57
dc.b $58,$59,$5a,$5b,$5c,$5d,$5e,$5f
dc.b $60,$61,$62,$63,$64,$65,$66,$67
dc.b $68,$69,$6a,$6b,$6c,$6d,$6e,$6f
dc.b $70,$71,$72,$73,$74,$75,$76,$77
dc.b $78,$79,$7a,$7b,$7c,$7d,$7e,$00
dc.b 199,252,233,226,228,224,229,231
dc.b 234,235,232,239,238,236,196,197
dc.b 201,230,198,244,246,242,251,249
dc.b 254,214,220,162,163,161,187,164
dc.b 225,237,243,250,241,209,189,156
dc.b 185,000,141,145,144,186,136,137
dc.b 227,245,159,191,247,215,192,195
dc.b 213,000,000,180,181,183,184,182
dc.b 000,000,138,000,000,000,000,000
dc.b 000,000,000,000,000,000,000,000
dc.b 000,000,000,000,000,000,000,000
dc.b 000,000,000,000,000,165,000,151
dc.b 000,000,000,150,000,000,153,000
dc.b 000,000,000,000,000,160,000,000
dc.b 131,140,135,134,000,000,139,130
dc.b 155,172,171,128,147,148,149,173
ENDIF
*
special:
dc.w 2
dc.l spcl1,spcl2
*
name: dc.b "Ascii Text v2.0.0",0
spcl1: dc.b "Paragraph has LF",0
spcl2: dc.b "Line has LF",0
*
SECTION ascii,BSS,PUBLIC
crcount: ds.w 1
crstrip: ds.w 1