include doscall.mac include doscall2.mac include iocscall.mac include fefunc.h include hasmacro.mac include CONST.H include naw.mac _mbuf_size equ 10240*50 * $800で割り切れる必要がある _len_fname equ 512 text even ENT BSR GET_OPT BSR CAUTION m <~OPEN #__readfilename,#2>, * m <~OPEN #__fnametape,#2>, m , , *dummyもどき m , , add.l #1,__para_readcap * * move.l 4(a1),d1 *size of block * lsr #8,d1 move __scsi_block_size,d0 *ここは論理式にせなあかんわ ifEQ move #3,__block_size_for_scsicall elseifEQ move #2,__block_size_for_scsicall elseifEQ move #1,__block_size_for_scsicall else ~~PRINT <'scsi deviceがワイが対応してへんblock size持っとるかも知れんで(?)',CR,LF,EOF> ~EXIT endif move.l #_mbuf_size,d3 1: BSR READ BSR WRITE M , 9: ~CLOSE __fn ~EXIT *---------------- ;GET_FILE_SIZE ; m , , ; m ; m , ;RTS () ;*---------------- ;LEFT_SIZE_CHECK ; move.l #_mbuf_size,d0 ; m , , ; move.l d0,d3 ; IFn LE, , ;RTS ( d3:残りSCSIblock ) *---------------- LEFT_BLOCK_CHECK move.l #_mbuf_size,d0 m , , move.l d0,d3 IFn LE, , RTS ( d3:残りSCSIblock ) *--------------- PRINT_COUNTER m , , PRINT __counter RTS () *--------------- WRITE *motoREAD move.l d3,-(sp) moveq #0,d4 move.l d3,d0 m , , IFn EQ, , move.l d3,d0 m , , m , m , * add.l #$4000/512,d2 ;mac ipl move.l __scsi_id,d4 m , m , , * m , , ~~PRINT <' *',CR,LF,EOS> move.l (sp)+,d3 RTS () *---------------- READ *motoWRITE move.l d3,-(sp) ~READ __fn,#__mbuf,d3 move.l (sp)+,d3 M , move.l d0,d3 ~~PRINT <' 読み終わり(の筈)や。',CR,LF,EOS> move.b #1,__flg_exit_b @@: RTS () *----------------- GET_OPT *(a2) PUSH d0/d1 M , moveq #0,d0 BSR SKIP_SP sub.b #'0',d0 *scsi_id抽出 M , M , M , sub.b #'0',d1 m , *id99迄対応 BSR SKIP_SP @@: move.l d0,__scsi_id BSR GET_FILENAME POP d0/d1 RTS *--- SKIP_SP @@: move.b (a2)+,d0 bEQ USAGE M , M , RTS *------ GET_FILENAME lea __readfilename,a1 move #_len_fname,d7 @@: M , *0ならbreak M , *break M , *break move.b d0,(a1)+ M , M , move.b (a2)+,(a1)+ dbF d7,@B @@: move.b #0,(a1) sub.l #1,a2 RTS *------------- CAUTION move.l __scsi_id,d0 divu #10,d0 add.b #'0',d0 move.b d0,__mes_caution10 swap d0 add.b #'0',d0 move.b d0,__mes_caution1 ~PRINT #__mes_caution ~GETCHAR RTS *-------- USAGE ~PRINT #__mes_usage ~EXIT __mes_usage dc.b 'f2sc.x 0-99(scsi id) filename',CR,LF dc.b 'v0.98',CR,LF,CR,LF dc.b '',CR,LF dc.b '--',CR,LF dc.b 'Seisei Yamaguchi Hi, Ms Mentholatum the art teacher',CR,LF dc.b '山口 青星 美術講師のメンソレさんお元気ですか',CR,LF dc.b ' http://www.vector.co.jp/authors/VA010205/',CR,LF dc.b ' seisei@usa.net bbs://+81-(0)52-805-8392',CR,LF dc.b ' Please correct the errors',CR,LF dc.b ' Copyleft-like',CR,LF dc.b ' 68 lovers capable',CR,LF dc.b '',CR,LF,EOS even *------------- data even __scsi_id dc.l 99 __scsi_access_ptr dc.l 0 __counter dcb.b 16,' ' __flg_exit_b dc.b 0 __fnametape dc.b 'rst0',EOS __readfilename dcb.b _len_fname,EOS __mes_caution dc.b 'scsi id ' __mes_caution10 dc.b '9' __mes_caution1 dc.b '9' dc.b '(digit)に書き込むで。(to cancel by CTRL-C)',CR,LF,EOS bss even __para_readcap ds.l 1 ; ds 1 ; __scsi_block_size ds 5 ; TOO MANY for safety __fn ds 1 __block_size_for_scsicall ds 1 ;__filbuf ;__atr ds.b 1 ;__driveno ds.b 1 ;__dircls ds 1 ;__dirfat ds 1 ;__dirsec ds 1 ;__dirpos ds 1 ;__filename ds.b 8 ;__ext ds.b 3 ;__atr ds.b 1 ;__time ds 1 ;__date ds 1 ;__filelen ds.l 1 ;__packedname ds.b 18+1+3+1 quad __mbuf ds.b _mbuf_size __END__mbuf end ENT