アスキーセーブされたBASICプログラムをついに読み込むことができました。
RTC_SDカード |
RTC_SD基板 |
回路図 |
アスキーセーブされたBASICプログラムの読み込みに最後までてこずった
BASICプログラムの保存フォーマット |
その他、必要な周辺プログラム
実現できた機能をまとめると
1.SDカードとSDHCカードの両方に対応している。
2.Windows上でSDカードに書き込んだBASICファイル、機械語ファイルやデータファイルがFM-7で読み込める。
3.FM-7上でBASICファイルや機械語ファイルをSDカードに書き込めて、Windows上で読み込める。
4.コマンドとしては F-BASICの FILES、LOAD、LOADM、SAVE、SAVEM、KILLに相当するものが実現できている。
5.オプション機能として、SDカード上のFAT、DIRなどのセクタ表示機能がある。
最大の特長は、特別な専用のフォーマットではなく、Windowsの標準形式で保存されたデータを読み書きできるということです。
制約事項は
F-BASICでの使用が前提なので下記の1,2,3,4はそれに合わせたものです。
1.大きなファイルには対応していない。(恐らく、20KB程度未満)
2.ディレクトリには対応していない。
3.F-BASICと同様、ファイル名には拡張子をつけない。
(あっても良いがチェックしていないので、有無で区別できない。)
4.BASICファイル、機械語ファイルはF-BASICのディスク保存形式でなければならない。
5.ファイル名に小文字は使えない。(ロングファイルネームには対応していないので。)
6.ファイルの保存時のタイムスタンプのためにF-BASICシステムの日付・日時を使用しているので、あらかじめ正しい時刻に設定しておく必要がある。
(STARTUPでRTCから読み込んで設定しておくことができる。)
7.SDHCカードは16GBまでしか動作確認できていない。(何故か手持ちの32GBは読めない...)
使用上の注意点は
1.本プログラムを起動する前に CLEAR ,&H5DFF を実行しておく必要がある。
・F-BASICファイル(アスキーセーブ):先頭に改行($0D,$0A)がある。
・F-BASICファイル(バイナリセーブ):先頭が$FF($FE),$FF,$FFで始まる。
・機械語ファイル:先頭に5バイトのヘッダ($00,2バイトのサイズ、2バイトの先頭アドレス)があり、末尾に5バイトのフッタ($FF,$00,$00,2バイトの実行アドレス)がある。(実際には、フッタはチェックしていない。)
・以上の3つに該当しない場合にはデータファイルとして$2000からにロードする。
【注意】機械語ファイルでなくても、先頭が$00で始まっていると機械語ファイルと誤認識してしまう。
0001 * 0002 * SDRWFM.TXT 0003 * 0004 * SD Read/Write for FM-7 0005 * 0006 * use RTC & SD Card 0007 * 0008 * 6821(PIA) Port A -- RTC (I2C Mode) 0009 * 0010 * SBC RTC Ext IO 0011 * CA2 2 -- -- HV4 LV4 -- IO1 0012 * PA0 3 -- SCL -- HV1 LV1 -- IO4 0013 * PA1 4 -- -- HV2 LV2 -- IO3 0014 * PA7 10 -- SDA -- HV3 LV3 -- IO2 0015 * GND -- -- -- GND 0016 * -- -- -- 3V3 0017 * 0018 * 0019 * 6821(PIA) Port B -- SD (SPI Mode) 0020 * 0021 * SBC SD 0022 * CB2 12 -- HV4 LV4 -- SCK 0023 * PB0 13 -- HV1 LV1 -- CS 0024 * PB1 14 -- HV2 LV2 -- MISO 0025 * PB7 20 -- HV3 LV3 -- MOSI 0026 * GND 31 -- -- GND 0027 * VCC 33 -- -- VCC 0028 * 0029 * cf. all data line use level converter 0030 * 0031 * PB output mode 0032 * CB2 1bit output 0033 * 0034 * READ/WRITE BUFFER $5E00 - 5FFF 0035 * 0036 * Fix date routine '2023.04.12 0037 * Implement write cmd '2023.04.07 0038 * Add command '2023.03.14 0039 * Change use Port B '2023.03.07 0040 * Original version '2022.06.11 0041 * Copyright by Y.Yamamoto 0042 * 0043 6000 STTADR EQU $6000 0044 0045 FBB8 INCHA EQU $FBB8 for FM-7 0046 FBBB OUTCHA EQU $FBBB for FM-7 0047 FBF7 CSRON EQU $FBF7 for FM-7 0048 D807 LININP EQU $D807 for FM-7 (to $043D- ) 0049 00BF DEVNO EQU $BF for FM-7 0050 000D CR EQU $0D 0051 000A LF EQU $0A 0052 0020 SPC EQU $20 0053 001B ESC EQU $1B 0054 0055 5E00 RWBUF EQU STTADR-$200 0056 0057 02FA FMDAT EQU $02FA date of FM-7 0058 FD9E PBDAT EQU $FD9E for FM-7 0059 FD9F PBCTL EQU PBDAT+1 0060 0033 BASADP EQU $33 (33,34) pointer for F-BASIC top 0061 0035 BASAEP EQU $35 (35,36) pointer for F-BASIC end 0062 2000 TXTADR EQU $2000 load adr for TEXT 0063 00E5 DELMK EQU $E5 delete mark 0064 0065 6000 ORG STTADR 0066 0067 6000 16 0098 START LBRA MAIN 0068 6003 01 VN FCB 1 version no 0069 6004 00 SCTN0 FCB 0 top adrs of sct 0070 6005 00 SCTN1 FCB 0 0071 6006 00 SCTN2 FCB 0 0072 6007 00 SCTN3 FCB 0 0073 6008 00 RESDAT FCB 0 response data 0074 6009 00 SDHC FCB 0 sd:0,sdhc:1 0075 0076 600A 0000 SCTBPB FDB 00 sct no of BPB(4bytes) 0077 600C 0000 FDB 00 0078 600E 0000 SCTFAT FDB 00 sct no of FAT#1(4bytes) 0079 6010 0000 FDB 00 0080 6012 0000 SCTDIR FDB 00 sct no of DIR(4bytes) 0081 6014 0000 FDB 00 0082 6016 0000 SCTDSV FDB 00 save sct no of DIR(4bytes) 0083 6018 0000 FDB 00 0084 601A 0000 SCTCLT FDB 00 sct no of top CLUSTER(4bytes) 0085 601C 0000 FDB 00 if SD:#2, SDHC:#3 0086 601E 00 SCTPCL FCB 0 sct per cluster 0087 601F FF DIRENT RMB 32 directory entry 0088 603F FF WMDY RMB 3 mon,day,year 0089 6042 FF WFSIZ RMB 4 file size(4bytes) 0090 6046 FF FILSIZ RMB 2 file size 0091 6048 0000 CLSTH FDB 00 cluster High 0092 604A 0000 CLSTL FDB 00 cluster Low 0093 604C 00 CNT FCB 0 0094 604D 00 MCFLG FCB 0 0:machine code, $FF,$FE:binary save 1:else 0095 604E 00 TPGFLG FCB 0 1:top page 0:else 0096 604F FF FNAME RMB 11 file name(8+3) 0097 605A 00 DPGNO FCB 0 page no of empty dir entry 0098 605B 0000 DIROFS FDB 00 offset of empty dir entry 0099 605D 0000 BASEXP FDB 00 basic exe adr 0100 605F 0000 MCADP FDB 00 machine code start adr 0101 6061 0000 MCAEP FDB 00 machine code end adr 0102 6063 0000 MCEXP FDB 00 machine dode exec adr 0103 6065 0000 EXSTFL FDB 00 ofset of exist dir entry 0104 6067 0000 WK1 FDB 00 0105 6069 0000 WK2 FDB 00 0106 606B 0000 WK3 FDB 00 0107 606D 0000 WK4 FDB 00 0108 0109 606F FF INPBUF RMB 8 0110 6077 FF CNVBUF RMB 4 0111 607B FF FILBUF RMB 32 0112 0113 609B MAIN EQU * 0114 *=====reset pia===== 0115 *portB:output 0116 609B 86 30 LDA #$30 0117 609D B7 FD9F STA PBCTL select ddra, cb2:0 0118 60A0 86 FD LDA #$FD pb0,7:out,pb1:in 0119 60A2 B7 FD9E STA PBDAT set output mode 0120 60A5 86 34 LDA #$34 0121 60A7 B7 FD9F STA PBCTL select peripheral,cb2:0 0122 0123 *for pia exist check 0124 60AA 86 55 LDA #$55 test data 0125 60AC B7 FD9E STA PBDAT 0126 60AF B6 FD9E LDA PBDAT 0127 60B2 84 FD ANDA #$FD pb1=0 0128 60B4 81 55 CMPA #$55 0129 60B6 27 07 BEQ INIT 0130 60B8 8E 6F93 LDX #MERR 0131 60BB 17 0C68 LBSR PSTRNG 0132 60BE 39 RTS Return F-BASIC 0133 0134 60BF INIT EQU * 0135 60BF 17 0091 LBSR SDINIT 0136 0137 **************************************** 0138 * MAIN MENU 0139 **************************************** 0140 60C2 MENU EQU * 0141 60C2 8E 6EAB LDX #MSMENU1 0142 60C5 17 0C5E LBSR PSTRNG 0143 60C8 BD FBF7 JSR CSRON cursor on 0144 60CB BD 6E2D JSR INOUTC 0145 60CE 84 DF ANDA #$DF to upper 0146 0147 60D0 81 44 CMPA #'D 0148 60D2 26 05 BNE MENU1 0149 60D4 17 0328 LBSR DSPDIR 0150 60D7 20 E9 BRA MENU 0151 60D9 81 4C MENU1 CMPA #'L 0152 60DB 26 05 BNE MENU2 0153 60DD 17 03CD LBSR LDFILE 0154 60E0 20 E0 BRA MENU 0155 60E2 81 42 MENU2 CMPA #'B 0156 60E4 26 05 BNE MENU3 0157 60E6 17 05D8 LBSR WRBFILE 0158 60E9 20 D7 BRA MENU 0159 60EB 81 4D MENU3 CMPA #'M 0160 60ED 26 05 BNE MENU4 0161 60EF 17 0641 LBSR WRMFILE 0162 60F2 20 CE BRA MENU 0163 60F4 81 4B MENU4 CMPA #'K 0164 60F6 26 05 BNE MENU5 0165 60F8 17 0571 LBSR KILFILE 0166 60FB 20 C5 BRA MENU 0167 60FD 81 53 MENU5 CMPA #'S 0168 60FF 26 04 BNE MENU6 0169 6101 20 50 BRA SDINIT 0170 6103 20 BD BRA MENU 0171 6105 81 4F MENU6 CMPA #'O 0172 6107 26 04 BNE MENU7 0173 6109 20 0A BRA OPMENU 0174 610B 20 B5 BRA MENU 0175 610D 81 51 MENU7 CMPA #'Q 0176 610F 26 B1 BNE MENU 0177 6111 17 0B5D LBSR PCRLF 0178 6114 39 RTS Return F-BASIC 0179 0180 * 0181 6115 OPMENU EQU * 0182 6115 8E 6F01 LDX #MSMENU2 0183 6118 17 0C0B LBSR PSTRNG 0184 611B BD 6E2D JSR INOUTC 0185 611E 80 30 SUBA #$30 0186 6120 26 02 BNE OPMEN6 0? 0187 6122 20 9E BRA MENU 0188 0189 6124 4A OPMEN6 DECA 1? 0190 6125 26 05 BNE OPMEN7 0191 6127 17 024A LBSR RDSCT 0192 612A 20 E9 BRA OPMENU 0193 612C 4A OPMEN7 DECA 2? 0194 612D 26 05 BNE OPMEN8 0195 612F 17 01C1 LBSR DSPSDDAT 0196 6132 20 E1 BRA OPMENU 0197 6134 4A OPMEN8 DECA 3? 0198 6135 26 05 BNE OPMEN9 0199 6137 17 024D LBSR DSPMBR 0200 613A 20 D9 BRA OPMENU 0201 613C 4A OPMEN9 DECA 4? 0202 613D 26 05 BNE OPMEN10 0203 613F 17 0299 LBSR DSPBPB 0204 6142 20 D1 BRA OPMENU 0205 6144 4A OPMEN10 DECA 5? 0206 6145 26 CE BNE OPMENU 0207 6147 17 02A3 LBSR DSPFAT 0208 614A 20 C9 BRA OPMENU 0209 0210 * 0211 614C SDERR EQU * 0212 614C 8E 6F93 LDX #MERR 0213 614F 17 0BD4 LBSR PSTRNG 0214 6152 39 RTS Return F-BASIC 0215 0216 **************************************** 0217 * SD Initialize routine 0218 **************************************** 0219 6153 SDINIT EQU * 0220 *---------- start ---------- 0221 6153 8E 6F7C LDX #MSINIT 0222 6156 17 0BCD LBSR PSTRNG 0223 * cs:1,di:1,sck>74ms 0224 6159 86 FF LDA #$FF mosi:b7=H,miso:b1=H(for PIA),cs:b0=H 0225 615B B7 FD9E STA PBDAT 0226 615E C6 50 LDB #80 80times 0227 6160 17 0AD3 ISTT LBSR SETCKL 0228 6163 17 0AD9 LBSR SETCKH 0229 6166 5A DECB 0230 6167 26 F7 BNE ISTT 0231 * 0232 *---------- cmd 0 ---------- 0233 6169 SCMD0 EQU * 0234 6169 17 0ACA LBSR SETCKL 0235 616C C6 06 LDB #6 0236 616E 8E 6E47 LDX #CMD0 0237 6171 A6 80 SC01 LDA ,X+ 0238 6173 17 0A53 LBSR SNDDAT 0239 6176 5A DECB 0240 6177 26 F8 BNE SC01 0241 *get response 0242 6179 5F CLRB 0243 617A GR00 0244 617A 5A DECB 0245 617B 27 CF BEQ SDERR 0246 617D 17 0A65 LBSR GETDAT 0247 6180 B6 6008 LDA RESDAT 0248 6183 81 01 CMPA #$01 0249 6185 26 F3 BNE GR00 0250 * 0251 *---------- cmd 8 ---------- 0252 6187 SCMD8 EQU * 0253 6187 17 0AAC LBSR SETCKL 0254 618A 86 FF LDA #$FF dummy cmd 0255 618C 17 0A3A LBSR SNDDAT 0256 618F C6 06 LDB #6 0257 6191 8E 6E5F LDX #CMD8 0258 6194 A6 80 SC80 LDA ,X+ 0259 6196 17 0A30 LBSR SNDDAT 0260 6199 5A DECB 0261 619A 26 F8 BNE SC80 0262 *get response 0263 619C GR80 0264 619C 17 0A46 LBSR GETDAT 0265 619F B6 6008 LDA RESDAT 0266 0267 61A2 17 0A40 LBSR GETDAT 0268 61A5 B6 6008 LDA RESDAT 0269 61A8 81 01 CMPA #$01 0270 61AA 26 F0 BNE GR80 0271 61AC C6 04 LDB #4 0272 61AE 17 0A34 GR81 LBSR GETDAT 0273 61B1 B6 6008 LDA RESDAT 0274 61B4 5A DECB 0275 61B5 26 F7 BNE GR81 0276 * 0277 *---------- cmd 58 ---------- 0278 61B7 SCMD58 EQU * 0279 61B7 17 0A7C LBSR SETCKL 0280 61BA 86 FF LDA #$FF dummy cmd 0281 61BC 17 0A0A LBSR SNDDAT 0282 61BF C6 06 LDB #6 0283 61C1 8E 6E65 LDX #CMD58 0284 61C4 A6 80 SC581 LDA ,X+ 0285 61C6 17 0A00 LBSR SNDDAT 0286 61C9 5A DECB 0287 61CA 26 F8 BNE SC581 0288 *get response 0289 61CC GR580 0290 61CC 17 0A16 LBSR GETDAT 0291 61CF B6 6008 LDA RESDAT 0292 61D2 81 01 CMPA #$01 0293 61D4 26 F6 BNE GR580 0294 61D6 C6 04 GR581 LDB #4 0295 61D8 17 0A0A GR582 LBSR GETDAT 0296 61DB B6 6008 LDA RESDAT 0297 61DE 5A DECB 0298 61DF 26 F7 BNE GR582 0299 61E1 RPT41 EQU * 0300 *---------- cmd 55 ---------- 0301 61E1 SCMD55 EQU * 0302 61E1 17 0A52 LBSR SETCKL 0303 61E4 86 FF LDA #$FF dummy cmd 0304 61E6 17 09E0 LBSR SNDDAT 0305 61E9 C6 06 LDB #6 0306 61EB 8E 6E6B LDX #CMD55 0307 61EE A6 80 SC551 LDA ,X+ 0308 61F0 17 09D6 LBSR SNDDAT 0309 61F3 5A DECB 0310 61F4 26 F8 BNE SC551 0311 *get response 0312 * CLRB 0313 61F6 GR550 0314 61F6 17 09EC LBSR GETDAT 0315 61F9 B6 6008 LDA RESDAT 0316 61FC 81 01 CMPA #$01 0317 61FE 26 F6 BNE GR550 0318 0319 *---------- acmd 41 ---------- 0320 6200 ASCMD41 EQU * 0321 6200 17 0A33 LBSR SETCKL 0322 6203 86 FF LDA #$FF dummy cmd 0323 6205 17 09C1 LBSR SNDDAT 0324 6208 C6 06 LDB #6 0325 620A 8E 6E71 LDX #ACMD41 0326 620D A6 80 ASC411 LDA ,X+ 0327 620F 17 09B7 LBSR SNDDAT 0328 6212 5A DECB 0329 6213 26 F8 BNE ASC411 0330 *get response 0331 6215 GR410 0332 6215 17 09CD LBSR GETDAT 0333 6218 B6 6008 LDA RESDAT 0334 621B 17 09C7 LBSR GETDAT 0335 621E B6 6008 LDA RESDAT 0336 6221 81 00 CMPA #$00 0337 6223 26 BC BNE RPT41 0338 0339 *---------- second cmd 58 ---------- 0340 6225 SCMD258 EQU * 0341 6225 17 0A0E LBSR SETCKL 0342 6228 86 FF LDA #$FF dummy cmd 0343 622A 17 099C LBSR SNDDAT 0344 622D C6 06 LDB #6 0345 622F 8E 6E65 LDX #CMD58 0346 6232 A6 80 SC2581 LDA ,X+ 0347 6234 17 0992 LBSR SNDDAT 0348 6237 5A DECB 0349 6238 26 F8 BNE SC2581 0350 *get response 0351 623A GR2580 0352 623A 17 09A8 LBSR GETDAT 0353 623D B6 6008 LDA RESDAT 0354 6240 81 00 CMPA #$00 0355 6242 26 F6 BNE GR2580 0356 6244 17 099E LBSR GETDAT 0357 6247 B6 6008 LDA RESDAT 0358 624A 48 LSLA 0359 624B 48 LSLA 0360 624C 24 03 BCC GR2581 0361 624E 7C 6009 INC SDHC if sdhc then 1 0362 6251 C6 03 GR2581 LDB #3 0363 6253 17 098F GR2582 LBSR GETDAT 0364 6256 B6 6008 LDA RESDAT 0365 6259 5A DECB 0366 625A 26 F7 BNE GR2582 0367 0368 625C 8E 6F66 LDX #MSSD0 0369 625F B6 6009 LDA SDHC 0370 6262 27 03 BEQ SD1 0371 6264 8E 6F70 LDX #MSSD1 0372 6267 17 0ABC SD1 LBSR PSTRNG 0373 * 0374 *set sct no of BPB 0375 626A 17 0138 LBSR GETMBR 0376 626D 8E 5FCA LDX #RWBUF+446+8+4 0377 6270 108E 600A LDY #SCTBPB 0378 6274 C6 04 LDB #4 0379 6276 A6 82 ILOP1 LDA ,-X 0380 6278 A7 A0 STA ,Y+ 0381 627A 5A DECB 0382 627B 26 F9 BNE ILOP1 0383 0384 *set sct no of FAT#1 0385 627D 17 0142 LBSR GETBPB 0386 6280 8E 600A LDX #SCTBPB 0387 6283 108E 600E LDY #SCTFAT 0388 6287 C6 04 LDB #4 0389 6289 17 08A1 LBSR TRANS 0390 628C 8E 600E LDX #SCTFAT 0391 628F 108E 5E0E LDY #RWBUF+$0E for SD & SDHC 0392 6293 17 0A5F LBSR ADD42 0393 0394 *set sct no of DIR 0395 6296 8E 600E LDX #SCTFAT 0396 6299 108E 6012 LDY #SCTDIR 0397 629D C6 04 LDB #4 0398 629F 17 088B LBSR TRANS 0399 62A2 8E 5E16 LDX #RWBUF+$16 for SD 0400 62A5 7D 6009 TST SDHC 0:SD,1:SDHC 0401 62A8 27 03 BEQ SKP1 0402 62AA C6 0E LDB #$24-$16 0403 62AC 3A ABX for SDHC 0404 62AD 1F 12 SKP1 TFR X,Y 0405 62AF 8E 6012 LDX #SCTDIR 0406 62B2 17 0A40 LBSR ADD42 0407 62B5 17 0A3D LBSR ADD42 skip for FAT#2 0408 0409 *save no of directory 0410 62B8 8E 6012 LDX #SCTDIR 0411 62BB 108E 6016 LDY #SCTDSV 0412 62BF C6 04 LDB #4 0413 62C1 17 0869 LBSR TRANS 0414 0415 *set sct per cluster 0416 62C4 8E 5E0D LDX #RWBUF+$0D 0417 62C7 A6 84 LDA ,X 0418 62C9 B7 601E STA SCTPCL 0419 0420 *set sct no of CLUSTER#2 0421 62CC 8E 6012 LDX #SCTDIR 0422 62CF 108E 601A LDY #SCTCLT 0423 62D3 C6 04 LDB #4 0424 62D5 17 0855 LBSR TRANS 0425 0426 62D8 108E 6069 LDY #WK1+2 0427 62DC 86 00 LDA #$00 0428 62DE A7 A2 STA ,-Y 0429 62E0 86 20 LDA #$20 for SD 0430 62E2 7D 6009 TST SDHC 0431 62E5 27 03 BEQ SKP2 0432 62E7 B6 601E LDA SCTPCL for SDHC 0433 62EA A7 A2 SKP2 STA ,-Y 0434 62EC 8E 601A LDX #SCTCLT 0435 62EF 17 0A03 LBSR ADD42 0436 62F2 39 RTS 0437 0438 **************************************** 0439 * GET SD DATA ROUTINE 0440 * use CMD9 0441 **************************************** 0442 62F3 DSPSDDAT EQU * 0443 62F3 17 097B LBSR PCRLF 0444 62F6 17 093D LBSR SETCKL 0445 62F9 C6 06 LDB #6 0446 62FB 8E 6E77 LDX #CMD9 0447 62FE A6 80 SC91 LDA ,X+ 0448 6300 17 08C6 LBSR SNDDAT 0449 6303 5A DECB 0450 6304 26 F8 BNE SC91 0451 *get response 0452 6306 GR90 0453 6306 17 08DC LBSR GETDAT 0454 6309 B6 6008 LDA RESDAT 0455 630C 81 00 CMPA #$00 0456 630E 26 F6 BNE GR90 0457 0458 6310 C6 14 LDB #16+1+2+1 fe,crcH,crcL,ff 0459 6312 17 08D0 GR91 LBSR GETDAT 0460 6315 B6 6008 LDA RESDAT 0461 6318 5A DECB 0462 6319 26 F7 BNE GR91 0463 631B 17 0953 LBSR PCRLF 0464 0465 *disp offset of MBR,FAT#1,DIR,CLUSTER#2 0466 631E 8E 6FB3 LDX #MSOFS 0467 6321 17 0A02 LBSR PSTRNG 0468 6324 8E 6FC3 LDX #MSBPB 0469 6327 17 09FC LBSR PSTRNG 0470 632A 8E 600A LDX #SCTBPB 0471 632D C6 04 LDB #4 0472 632F A6 80 SCLOP1 LDA ,X+ 0473 6331 17 0914 LBSR DSPBIN 0474 6334 5A DECB 0475 6335 26 F8 BNE SCLOP1 0476 0477 6337 8E 6FCC LDX #MSFAT 0478 633A 17 09E9 LBSR PSTRNG 0479 633D 8E 600E LDX #SCTFAT 0480 6340 C6 04 LDB #4 0481 6342 A6 80 SCLOP2 LDA ,X+ 0482 6344 17 0901 LBSR DSPBIN 0483 6347 5A DECB 0484 6348 26 F8 BNE SCLOP2 0485 0486 634A 8E 6FD5 LDX #MSDIR 0487 634D 17 09D6 LBSR PSTRNG 0488 6350 8E 6012 LDX #SCTDIR 0489 6353 C6 04 LDB #4 0490 6355 A6 80 SCLOP3 LDA ,X+ 0491 6357 17 08EE LBSR DSPBIN 0492 635A 5A DECB 0493 635B 26 F8 BNE SCLOP3 0494 0495 635D 8E 6FDE LDX #MSCL2 0496 6360 17 09C3 LBSR PSTRNG 0497 6363 8E 601A LDX #SCTCLT 0498 6366 C6 04 LDB #4 0499 6368 A6 80 SCLOP4 LDA ,X+ 0500 636A 17 08DB LBSR DSPBIN 0501 636D 5A DECB 0502 636E 26 F8 BNE SCLOP4 0503 6370 17 08FE LBSR PCRLF 0504 6373 39 RTS 0505 0506 * 0507 **************************************** 0508 * READ ROUTINE 0509 * use CMD17 0510 * set sctno to SCTN2,SCTN3 0511 * read data set to RWBUF 0512 **************************************** 0513 6374 RDSCT EQU * 0514 6374 17 08FA LBSR PCRLF 0515 6377 17 0885 LBSR INSCT input sct no 0516 637A 17 07F8 LBSR RD1SCT read 1 sct 0517 0518 *disp data 0519 637D 17 08F1 LBSR PCRLF 0520 6380 17 0828 LBSR DSPBUF 0521 6383 17 08EB LBSR PCRLF 0522 6386 39 RTS 0523 0524 **************************************** 0525 * Read MBR & Disp parameter of BPB 0526 **************************************** 0527 6387 DSPMBR EQU * 0528 6387 17 08E7 LBSR PCRLF 0529 638A 8D 19 BSR GETMBR 0530 0531 *disp BPB 0532 638C 17 08E2 LBSR PCRLF 0533 638F 8E 5FBE LDX #RWBUF+446 1st BPB point 0534 6392 C6 10 GET1 LDB #16 0535 6394 A6 80 GET2 LDA ,X+ 0536 6396 17 08AF LBSR DSPBIN disp data 0537 6399 5A DECB 0538 639A 26 F8 BNE GET2 0539 639C 17 08D2 LBSR PCRLF 0540 639F 8C 5FFE CMPX #RWBUF+510 446+16*4 0541 63A2 25 EE BLO GET1 0542 63A4 39 RTS 0543 0544 *---------------------------------------- 0545 *read MBR 0546 63A5 GETMBR EQU * 0547 63A5 8E 6004 LDX #SCTN0 0548 63A8 C6 04 LDB #4 0549 63AA 4F CLRA 0550 63AB 17 078A LBSR FILL set sct no is 0 0551 63AE 17 0856 LBSR SETSCT 0552 63B1 17 07C1 LBSR RD1SCT read 1 sct 0553 63B4 39 RTS 0554 0555 *---------------------------------------- 0556 *set sector no to SCTN0 0557 *from X,X+1,X+2,X+3 to SCTN0-SCTN3 0558 63B5 SETSNO EQU * 0559 63B5 108E 6004 LDY #SCTN0 0560 63B9 C6 04 LDB #4 0561 63BB 17 076F LBSR TRANS 0562 63BE 17 0846 LBSR SETSCT 0563 63C1 39 RTS 0564 0565 *---------------------------------------- 0566 *read BPB 0567 63C2 GETBPB EQU * 0568 63C2 8D E1 BSR GETMBR 0569 *set sct no of BPB 0570 63C4 8E 5FCA LDX #RWBUF+446+8+4 0571 63C7 108E 6004 LDY #SCTN0 0572 63CB C6 04 LDB #4 0573 63CD A6 82 GTBLOP LDA ,-X 0574 63CF A7 A0 STA ,Y+ 0575 63D1 5A DECB 0576 63D2 26 F9 BNE GTBLOP 0577 63D4 17 0830 LBSR SETSCT 0578 63D7 17 079B LBSR RD1SCT read 1 sct 0579 63DA 39 RTS 0580 0581 **************************************** 0582 * Disp BPB(Bios Parameter Block) 0583 **************************************** 0584 63DB DSPBPB EQU * 0585 63DB 8E 600A LDX #SCTBPB 0586 63DE 8D D5 BSR SETSNO 0587 63E0 17 0792 LBSR RD1SCT read 1 sct 0588 0589 *disp BPB 0590 63E3 17 088B LBSR PCRLF 0591 63E6 17 07C2 LBSR DSPBUF 0592 63E9 17 0885 LBSR PCRLF 0593 63EC 39 RTS 0594 0595 **************************************** 0596 * Disp FAT#1 0597 **************************************** 0598 63ED DSPFAT EQU * 0599 63ED 8E 600E LDX #SCTFAT 0600 63F0 8D C3 BSR SETSNO 0601 63F2 17 0780 LBSR RD1SCT read 1 sct 0602 0603 *disp FAT 0604 63F5 17 0879 LBSR PCRLF 0605 63F8 17 07B0 LBSR DSPBUF 0606 63FB 17 0873 LBSR PCRLF 0607 63FE 39 RTS 0608 0609 **************************************** 0610 * Disp Directory 0611 **************************************** 0612 63FF DSPDIR EQU * 0613 *return no of DIR 0614 63FF 8E 6016 LDX #SCTDSV 0615 6402 108E 6012 LDY #SCTDIR 0616 6406 C6 04 LDB #4 0617 6408 17 0722 LBSR TRANS 0618 640B 8E 6012 DSPFL0 LDX #SCTDIR 0619 640E 8D A5 BSR SETSNO 0620 6410 17 0762 LBSR RD1SCT read 1 sct 0621 0622 *disp FILE name 0623 6413 17 085B LBSR PCRLF 0624 6416 17 0858 LBSR PCRLF 0625 6419 8E 5E00 LDX #RWBUF 0626 0627 641C A6 84 DSPFL1 LDA ,X 0628 641E 1027 008A LBEQ DSPEND if top of filename is 0 then end 0629 6422 81 E5 CMPA #$E5 delete mark? 0630 6424 27 06 BEQ DSPCKE 0631 6426 A6 0B LDA 11,X attr 0632 * CMPA #$0F long file name? 0633 * BEQ DSPCKE 0634 * CMPA #$10 directory? 0635 * BEQ DSPCKE 0636 6428 81 20 CMPA #$20 0637 642A 27 0A BEQ DSPFL2 archive file only 0638 642C 30 88 20 DSPCKE LEAX 32,X next directory entry 0639 642F 8C 6000 CMPX #RWBUF+512 over buf? 0640 6432 24 60 BHS DSPFL5 0641 6434 20 E6 BRA DSPFL1 0642 0643 6436 DSPFL2 0644 *disp filename 0645 6436 C6 08 LDB #8 0646 6438 A6 80 DSPFL3 LDA ,X+ 0647 643A BD FBBB JSR OUTCHA 0648 643D 5A DECB 0649 643E 26 F8 BNE DSPFL3 0650 *disp ext 0651 6440 86 2E LDA #'. 0652 6442 BD FBBB JSR OUTCHA 0653 6445 C6 03 LDB #3 0654 6447 A6 80 DSPFL4 LDA ,X+ 0655 6449 BD FBBB JSR OUTCHA 0656 644C 5A DECB 0657 644D 26 F8 BNE DSPFL4 0658 644F 86 20 LDA #SPC 0659 6451 BD FBBB JSR OUTCHA 0660 6454 BD FBBB JSR OUTCHA 0661 0662 *get FILE time data 0663 6457 30 07 LEAX 7,X 0664 6459 EC 81 LDD ,X++ 0665 645B FD 6067 STD WK1 0666 0667 *get CLUSTER(H) data 0668 645E EC 81 LDD ,X++ 0669 6460 1E 89 EXG A,B 0670 6462 FD 6048 STD CLSTH 0671 6465 30 04 LEAX 4,X 0672 6467 EC 81 LDD ,X++ 0673 6469 1E 89 EXG A,B 0674 646B FD 604A STD CLSTL 0675 0676 *get FILE size data 0677 646E 108E 6046 LDY #WFSIZ+4 0678 6472 C6 04 LDB #4 0679 6474 A6 80 DSPC1 LDA ,X+ 0680 6476 A7 A2 STA ,-Y 0681 6478 5A DECB 0682 6479 26 F9 BNE DSPC1 0683 0684 *disp FILE size 0685 647B 86 20 LDA #SPC 0686 647D BD FBBB JSR OUTCHA 0687 6480 17 0914 LBSR DSPSIZ disp FILE size 0688 0689 *disp FILE time 0690 6483 FC 6067 LDD WK1 0691 6486 17 08AD LBSR DSPYMD disp MM-DD-YY 0692 0693 *disp CLUSTER(H,L) 0694 6489 17 0960 LBSR DSPCLS 0695 648C 17 07E2 LBSR PCRLF 0696 0697 648F 8C 6000 CMPX #RWBUF+512 0698 6492 25 88 BLO DSPFL1 0699 6494 8E 6012 DSPFL5 LDX #SCTDIR 0700 6497 17 06A7 LBSR INCX4 sct no +1 0701 649A 8E 7057 LDX #MSNXTP 0702 649D 17 0886 LBSR PSTRNG 0703 64A0 BD 6E2D DSPFL6 JSR INOUTC 0704 64A3 81 20 CMPA #SPC 0705 64A5 1027 FF62 LBEQ DSPFL0 0706 64A9 BD 6C71 JSR PCRLF 0707 64AC 39 DSPEND RTS 0708 0709 **************************************** 0710 * Load FILE 0711 **************************************** 0712 64AD LDFILE EQU * 0713 64AD 17 0146 LBSR GETFDT 0714 64B0 BE 6065 LDX EXSTFL if 0 not exist 0715 64B3 1027 00EA LBEQ LDNEND 0716 0717 *get cluster no 0718 64B7 EC 88 14 LDD $14,X 0719 64BA 1E 89 EXG A,B 0720 64BC FD 6048 STD CLSTH high cluster no 0721 64BF EC 88 1A LDD $1A,X 0722 64C2 1E 89 EXG A,B 0723 64C4 FD 604A STD CLSTL low cluster no 0724 *sub start cluster no (SD:2,SDHC:3) 0725 64C7 83 0002 SUBD #2 0726 64CA 7D 6009 TST SDHC SD:0,SDHC:1 0727 64CD 27 03 BEQ LD3 0728 64CF 83 0001 SUBD #1 D:cluster no (start 0) 0729 * (A=0,cluster no is only B) 0730 0731 64D2 34 36 LD3 PSHS A,B,X,Y 0732 64D4 8E 601A LDX #SCTCLT top of cluster no 0733 64D7 108E 6067 LDY #WK1 0734 64DB C6 04 LDB #4 0735 64DD 17 064D LBSR TRANS 0736 64E0 35 36 PULS A,B,X,Y 0737 0738 *calc start cluster no of file 0739 *(B)x40h 0740 64E2 34 30 PSHS X,Y 0741 64E4 8E 6067 LDX #WK1 0742 64E7 17 0666 LBSR ADD40H 0743 64EA 35 30 PULS X,Y 0744 0745 *get file size 0746 64EC 34 30 PSHS X,Y 0747 64EE 30 88 20 LEAX 32,X 0748 64F1 108E 6042 LDY #WFSIZ 0749 64F5 C6 04 LDB #4 0750 64F7 A6 82 LD41 LDA ,-X 0751 64F9 A7 A0 STA ,Y+ 0752 64FB 5A DECB 0753 64FC 26 F9 BNE LD41 0754 64FE 35 30 PULS X,Y 0755 0756 6500 EC 88 1D LDD $1D,X upper of file size 0757 6503 1E 89 EXG A,B 0758 6505 44 LSRA wfsiz/$200+1 0759 6506 56 RORB 0760 6507 C3 0001 ADDD #1 0761 0762 650A C1 40 CMPB #$40 40h page? 0763 650C 23 02 BLS LD5 0764 650E C6 40 LDB #$40 0765 6510 F7 604C LD5 STB CNT sct counter 0766 6513 F7 604E STB TPGFLG set top page 0767 0768 *set start sct no of file 0769 6516 34 12 PSHS A,X 0770 6518 8E 7016 LDX #MSLDNG 0771 651B 17 0808 LBSR PSTRNG 0772 651E 35 12 PULS A,X 0773 6520 LDLOP 0774 6520 86 2E LDA #'. 0775 6522 BD FBBB JSR OUTCHA 0776 6525 8E 6067 LDX #WK1 0777 6528 108E 6004 LDY #SCTN0 0778 652C C6 04 LDB #4 0779 652E 17 05FC LBSR TRANS 0780 6531 17 06D3 LBSR SETSCT 0781 6534 17 063E LBSR RD1SCT read 1 file data 0782 0783 6537 7D 604E TST TPGFLG top sector page? 0784 653A 27 3B BEQ LD9 0785 0786 *at top sector, ini set 0787 *offset 00 data is 0788 * $00 :machine code 0789 * $FF,$FE:BASIC PROGRAM (binary save) 0790 * else :general text 0791 653C 10BE 6044 LDY WFSIZ+2 0792 6540 10BF 6046 STY FILSIZ set file size 0793 0794 * LDX FILSIZ 0795 * LEAX 1,X 0796 * STX BASAEP 0797 0798 6544 8E 5E00 LDX #RWBUF 0799 6547 A6 84 LDA ,X 0800 6549 B7 604D STA MCFLG 0801 654C 27 04 BEQ LD8 0802 654E 2A 24 BPL LD81 0803 6550 2B 1E BMI LD80 0804 *at machine code, read header 0805 6552 10AE 01 LD8 LDY 1,X get file size 0806 6555 10BF 6046 STY FILSIZ 0807 6559 EE 03 LDU 3,X get store addr 0808 *offset? 0809 655B 8E 70A4 LDX #MSMCOF 0810 655E 17 07C5 LBSR PSTRNG 0811 6561 BD 6E2D JSR INOUTC 0812 6564 84 DF ANDA #$DF 0813 6566 81 59 CMPA #'Y 0814 6568 26 0D BNE LD9 0815 656A 33C9 E000 LEAU -$2000,U 0816 656E 20 07 BRA LD9 0817 0818 6570 DE 33 LD80 LDU BASADP basic file 0819 6572 20 03 BRA LD9 0820 6574 LD81 0821 6574 CE 2000 LDU #TXTADR (else) not basic file 0822 6577 LD9 0823 6577 8D 30 BSR MEMSET expand memory from rwbuf 0824 0825 6579 7F 604E CLR TPGFLG end of top page 0826 657C 8E 6067 LDX #WK1 0827 657F 17 05BF LBSR INCX4 sct no +1 0828 6582 7A 604C DEC CNT 0829 6585 26 99 BNE LDLOP 0830 0831 6587 LDEND 0832 6587 7D 604D TST MCFLG 0833 658A 27 0B BEQ LDE0 0834 658C 2A 09 BPL LDE0 0835 658E FC 6044 LDD WFSIZ+2 0836 6591 DB 34 ADDB BASADP+1 0837 6593 99 33 ADCA BASADP 0838 6595 DD 35 STD BASAEP end adrs 0839 6597 8E 702E LDE0 LDX #MSLDED 0840 659A 17 0789 LBSR PSTRNG 0841 659D 17 06D1 LDE1 LBSR PCRLF 0842 65A0 39 RTS 0843 0844 65A1 8E 7049 LDNEND LDX #MSNOFL 0845 65A4 17 077F LBSR PSTRNG 0846 65A7 20 F4 BRA LDE1 0847 0848 *expand memory from rwbuf 0849 *X:rwbuf, U:memory adr, Y:filesize 0850 65A9 MEMSET EQU * 0851 65A9 34 30 PSHS X,Y 0852 65AB 8E 5E00 LDX #RWBUF 0853 65AE 10BE 6046 LDY FILSIZ 0854 65B2 7D 604E TST TPGFLG top page? 0855 65B5 27 0F BEQ MSLOP 0856 65B7 7D 604D TST MCFLG 0,$FF($FE),etc 0857 65BA 27 04 BEQ MS0 0858 65BC 2A 08 BPL MSLOP etc 0859 65BE 2B 04 BMI MS1 basic file 0860 * machine code 0861 65C0 30 05 MS0 LEAX 5,X skip header 0862 * LEAY -5,Y 0863 65C2 20 02 BRA MSLOP 0864 65C4 30 03 MS1 LEAX 3,X skip 3 FFs 0865 * LEAY -3,Y 0866 0867 65C6 A6 80 MSLOP LDA ,X+ 0868 65C8 A7 C0 STA ,U+ 0869 65CA 31 3F LEAY -1,Y 0870 65CC 27 05 BEQ MS3 0871 65CE 8C 6000 CMPX #RWBUF+512 0872 65D1 25 F3 BLO MSLOP 0873 65D3 10BF 6046 MS3 STY FILSIZ 0874 65D7 35 B0 PULS X,Y,PC 0875 0876 *---------- 0877 *X:top of FILE NAME 0878 *return C=1:match,C=0:not match 0879 65D9 CMPFN EQU * 0880 65D9 34 10 PSHS X 0881 65DB 108E 604F LDY #FNAME 0882 65DF C6 08 LDB #8 0883 65E1 A6 80 CMPLOP LDA ,X+ 0884 65E3 81 E5 CMPA #$E5 delete mark? 0885 65E5 27 0B BEQ NOTM 0886 65E7 A1 A0 CMPA ,Y+ 0887 65E9 26 07 BNE NOTM 0888 65EB 5A DECB 0889 65EC 26 F3 BNE CMPLOP 0890 65EE 1A 01 MATCH ORCC #$01 C=1 0891 65F0 20 02 BRA CMPEND 0892 65F2 1C FE NOTM ANDCC #$FE C=0 0893 65F4 35 90 CMPEND PULS X,PC 0894 0895 *------------------------------ 0896 *input filename 0897 *output: 0898 * if exist EXSTFL(directory entry) 0899 * not exist EXSTFL(=0) 0900 65F6 GETFDT EQU * 0901 65F6 34 02 PSHS A 0902 65F8 8E 0000 LDX #0 0903 65FB BF 6065 STX EXSTFL 0904 *return no of DIR 0905 65FE 8E 6016 LDX #SCTDSV 0906 6601 108E 6012 LDY #SCTDIR 0907 6605 C6 04 LDB #4 0908 6607 17 0523 LBSR TRANS 0909 0910 660A 35 02 PULS A 0911 660C 81 4D CMPA #'M 0912 660E 26 05 BNE GTF1 0913 6610 8E 6FFE LDX #MSMSV 0914 6613 20 03 BRA GTF2 0915 6615 8E 6FEE GTF1 LDX #MSINFN 0916 6618 17 070B GTF2 LBSR PSTRNG 0917 661B 17 0162 LBSR INPFLDAT input file name 0918 0919 *set filename 0920 661E 8E 607B LDX #FILBUF 0921 6621 17 00E9 LBSR SETFNM 0922 0923 6624 8E 6012 LDFL0 LDX #SCTDIR 0924 6627 17 FD8B LBSR SETSNO 0925 662A 17 0548 LBSR RD1SCT read 1 sct 0926 0927 662D 8E 5E00 LDX #RWBUF 0928 6630 A6 84 LDFL1 LDA ,X 0929 6632 27 37 BEQ LDFLE if top of filename is 0 then end 0930 6634 81 E5 CMPA #$E5 delete mark? 0931 6636 26 10 BNE LD1 0932 6638 A6 0B LDA 11,X attr 0933 663A 81 20 CMPA #$20 archive file only 0934 663C 27 0A BEQ LD1 0935 663E 30 88 20 LEAX 32,X next directory entry 0936 6641 8C 6000 CMPX #RWBUF+512 over buf? 0937 6644 24 0E BHS LDFL5 0938 6646 20 E8 BRA LDFL1 0939 0940 *check file name 0941 6648 LD1 0942 6648 8D 8F BSR CMPFN C=1:match 0943 664A 25 10 BCS LD2 0944 664C 30 88 20 LEAX 32,X 0945 664F 8C 6000 CMPX #RWBUF+512 0946 6652 25 DC BLO LDFL1 0947 0948 6654 LDFL5 0949 6654 8E 6012 LDX #SCTDIR 0950 6657 17 04E7 LBSR INCX4 sct no +1 0951 665A 20 C8 BRA LDFL0 0952 0953 *hit file, get dirctory entry 0954 665C BF 6065 LD2 STX EXSTFL adr of dir entry 0955 665F 108E 601F LDY #DIRENT 0956 6663 C6 20 LDB #32 0957 6665 17 04C5 LBSR TRANS 0958 6668 8E 601F LDX #DIRENT 0959 666B 39 LDFLE RTS 0960 0961 * 0962 **************************************** 0963 * KILL FILE 0964 **************************************** 0965 666C KILFILE EQU * 0966 666C 8D 88 BSR GETFDT 0967 666E BE 6065 LDX EXSTFL if 0 not exist 0968 6671 27 5B BEQ NOFEND 0969 0970 6673 8E 7074 LDX #MSKILL 0971 6676 17 06AD LBSR PSTRNG 0972 6679 BD 6E2D JSR INOUTC 0973 667C 84 DF ANDA #$DF 0974 667E 81 59 CMPA #'Y 0975 6680 26 3E BNE KILEND 0976 6682 8D 01 BSR KILSUB 0977 6684 39 RTS 0978 0979 *---------- 0980 6685 KILSUB EQU * 0981 *write dir 0982 6685 BE 6065 LDX EXSTFL top adr of dir entry 0983 6688 EC 88 1A LDD $1A,X get clstlD 0984 668B 1E 89 EXG A,B B:cluster 0985 668D FD 604A STD CLSTL 0986 6690 86 E5 LDA #$E5 delete mark 0987 6692 A7 84 STA ,X 0988 6694 17 03D0 LBSR WRTSD1 0989 0990 *get fat sct & write 0991 6697 8E 600E LDX #SCTFAT 0992 669A 17 FD18 LBSR SETSNO 0993 669D 17 04D5 LBSR RD1SCT read 1 sct 0994 0995 66A0 FC 604A LDD CLSTL B:cluster 0996 66A3 58 LSLB 0997 66A4 7D 6009 TST SDHC sd:0,sdhc:1 0998 66A7 27 01 BEQ KL1 0999 66A9 58 LSLB 1000 66AA 8E 5E00 KL1 LDX #RWBUF 1001 66AD 30 85 LEAX B,X 1002 66AF C6 02 LDB #2 1003 66B1 7D 6009 TST SDHC sd:0,sdhc:1 1004 66B4 27 02 BEQ KL2 1005 66B6 C6 04 LDB #4 1006 66B8 6F 80 KL2 CLR ,X+ 1007 66BA 5A DECB 1008 66BB 26 FB BNE KL2 1009 66BD 17 03A7 LBSR WRTSD1 1010 66C0 KILEND 1011 66C0 39 RTS 1012 1013 * 1014 **************************************** 1015 * Write BASIC FILE 1016 **************************************** 1017 66C1 WRBFILE EQU * 1018 *basic file exist check 1019 66C1 DC 35 LDD BASAEP 1020 66C3 93 33 SUBD BASADP 1021 66C5 1083 0002 CMPD #2 1022 66C9 22 0A BHI WRB0 exist 1023 66CB 17 05A3 LBSR PCRLF 1024 66CE 8E 7049 NOFEND LDX #MSNOFL 1025 66D1 17 0652 LBSR PSTRNG 1026 66D4 39 RTS 1027 1028 *save BASIC program file(binary saved) 1029 66D5 86 FF WRB0 LDA #$FF 1030 66D7 B7 604D STA MCFLG set basic file 1031 *input file name 1032 66DA 17 FF19 LBSR GETFDT 1033 66DD BE 6065 LDX EXSTFL if 0 not exist 1034 66E0 27 11 BEQ WRB1 1035 1036 *confirm over write 1037 66E2 8E 7087 LDX #MSEXST 1038 66E5 17 063E LBSR PSTRNG 1039 66E8 BD 6E2D JSR INOUTC 1040 66EB 84 DF ANDA #$DF 1041 66ED 81 59 CMPA #'Y 1042 66EF 26 1B BNE WRBEND 1043 *delete exist file 1044 66F1 8D 92 BSR KILSUB 1045 1046 66F3 WRB1 1047 *set filename 1048 66F3 8E 607B LDX #FILBUF 1049 66F6 8D 15 BSR SETFNM 1050 1051 *adrs 1052 * BASADP start adr 1053 * BASAEP end adr 1054 * BASEXP exec adr 1055 1056 *main of write routine 1057 *clear dir entry 1058 66F8 8D 2B BSR CLRDIR 1059 1060 66FA 17 0103 LBSR SRCFAT search empty cluster on FAT 1061 66FD 17 0158 LBSR SRCDIR search empty DIR entry 1062 6700 17 0194 LBSR MKFLDT make file data 1063 6703 17 0219 LBSR WRTFIL write file 1064 6706 17 03BB LBSR WRTDIR write DIR entry 1065 6709 17 03E5 LBSR WRTFAT set FAT 1066 670C WRBEND 1067 670C 39 RTS 1068 1069 *------------------------------ 1070 *set filename 1071 670D SETFNM EQU * 1072 *clear buf 1073 670D 108E 605A LDY #FNAME+11 1074 6711 C6 0B LDB #11 1075 6713 86 20 LDA #$20 1076 6715 A7 A2 WRFLP2 STA ,-Y 1077 6717 5A DECB 1078 6718 26 FB BNE WRFLP2 1079 1080 *store filename 1081 671A A6 80 WRFL1 LDA ,X+ 1082 671C 81 30 CMPA #$30 1083 671E 25 04 BLO WRFL2 until delimiter 1084 6720 A7 A0 STA ,Y+ 1085 6722 20 F6 BRA WRFL1 1086 6724 WRFL2 1087 6724 39 RTS 1088 1089 *------------------------------ 1090 *clear dir entry 1091 6725 CLRDIR EQU * 1092 6725 8E 601F LDX #DIRENT 1093 6728 C6 20 LDB #32 1094 672A 4F CLRA 1095 672B 17 040A LBSR FILL 1096 672E 86 20 LDA #$20 set attr 1097 6730 A7 0B STA $0B,X 1098 6732 39 RTS 1099 1100 * 1101 **************************************** 1102 * Write MACHINE FILE 1103 **************************************** 1104 6733 WRMFILE EQU * 1105 *save machine code 1106 *filename,topadr,endadr,exeadr ...machine file 1107 6733 17 FEC0 LBSR GETFDT 1108 6736 BE 6065 LDX EXSTFL if 0 not exist 1109 6739 27 12 BEQ WRM1 1110 1111 *confirm over write 1112 673B 8E 7087 LDX #MSEXST 1113 673E 17 05E5 LBSR PSTRNG 1114 6741 BD 6E2D JSR INOUTC 1115 6744 84 DF ANDA #$DF 1116 6746 81 59 CMPA #'Y 1117 6748 26 35 BNE WRMEND 1118 *delete exist file 1119 674A 17 FF38 LBSR KILSUB 1120 1121 674D WRM1 1122 674D 7F 604D CLR MCFLG set machine code 1123 1124 *set filename 1125 6750 8E 607B LDX #FILBUF 1126 6753 8D B8 BSR SETFNM 1127 1128 *set top adr 1129 6755 8D 46 BSR ASC2BIN 1130 6757 10BF 605F STY MCADP start adr 1131 675B 8D 30 BSR SRCDLM 1132 675D 8D 3E BSR ASC2BIN 1133 675F 10BF 6061 STY MCAEP end adr 1134 6763 8D 28 BSR SRCDLM 1135 6765 8D 36 BSR ASC2BIN 1136 6767 10BF 6063 STY MCEXP exec adr 1137 1138 *main of write routine 1139 *clear dir entry 1140 676B 8D B8 BSR CLRDIR 1141 1142 676D 17 0090 LBSR SRCFAT search empty cluster on FAT 1143 6770 17 00E5 LBSR SRCDIR search empty DIR entry 1144 6773 17 0121 LBSR MKFLDT make file data 1145 6776 17 01A6 LBSR WRTFIL write file 1146 6779 17 0348 LBSR WRTDIR write DIR entry 1147 677C 17 0372 LBSR WRTFAT set FAT 1148 677F WRMEND 1149 677F 39 RTS 1150 1151 *-------------------- 1152 *input filename & parameter to filbuf 1153 6780 INPFLDAT EQU * 1154 6780 34 24 PSHS B,Y 1155 6782 108E 607B LDY #FILBUF 1156 6786 C6 1E LDB #30 1157 6788 17 06A9 LBSR LININ 1158 678B 35 A4 PULS B,Y,PC 1159 1160 *-------------------- 1161 *search delimiter 1162 *return X:point next char of delimiter 1163 678D SRCDLM EQU * 1164 678D 30 1F LEAX -1,X 1165 678F A6 80 SRDLM1 LDA ,X+ 1166 6791 81 30 CMPA #$30 1167 6793 24 FA BHS SRDLM1 1168 6795 39 RTS 1169 1170 *-------------------- 1171 *skip delimiter 1172 *return X:point next char of delimiter 1173 6796 SKPDLM EQU * 1174 6796 A6 80 LDA ,X+ 1175 6798 81 30 CMPA #$30 1176 679A 25 FA BLO SKPDLM 1177 679C 39 RTS 1178 1179 *-------------------- 1180 *X - X+3, return Y 1181 679D ASC2BIN EQU * 1182 *clr buf 1183 679D 34 10 PSHS X 1184 679F 8E 6077 LDX #CNVBUF 1185 67A2 86 30 LDA #$30 1186 67A4 C6 04 LDB #4 1187 67A6 17 038F LBSR FILL 1188 67A9 35 10 PULS X 1189 1190 *search next delimiter 1191 *return B:char count 1192 67AB 34 10 PSHS X 1193 67AD 5F CLRB 1194 67AE 5C SRLOP1 INCB 1195 67AF A6 80 LDA ,X+ 1196 67B1 81 30 CMPA #$30 count over $30 1197 67B3 24 F9 BHS SRLOP1 1198 67B5 5A DECB 1199 67B6 35 10 PULS X 1200 1201 *trans 1202 67B8 108E 6077 LDY #CNVBUF 1203 67BC 34 04 PSHS B 1204 67BE C6 04 LDB #4 1205 67C0 E0 E4 SUBB ,S 1206 67C2 31 A5 LEAY B,Y 1207 67C4 35 04 PULS B 1208 67C6 A6 80 SRLOP2 LDA ,X+ 1209 67C8 A7 A0 STA ,Y+ 1210 67CA 5A DECB 1211 67CB 26 F9 BNE SRLOP2 1212 1213 *convert to bin 1214 67CD 34 10 PSHS X 1215 67CF 8E 6077 LDX #CNVBUF 1216 67D2 EC 81 LDD ,X++ 1217 67D4 8D 0F BSR CNVSUB 1218 67D6 34 02 PSHS A 1219 67D8 EC 81 LDD ,X++ 1220 67DA 8D 09 BSR CNVSUB 1221 67DC 1F 89 TFR A,B 1222 67DE 35 02 PULS A 1223 67E0 1F 02 TFR D,Y 1224 67E2 35 10 PULS X 1225 67E4 39 RTS 1226 1227 *cnv sub 1228 *return A 1229 67E5 CNVSUB EQU * 1230 67E5 80 30 SUBA #$30 1231 67E7 81 11 CMPA #$11 1232 67E9 25 02 BLO CNV1 1233 67EB 80 07 SUBA #7 1234 67ED 48 CNV1 LSLA 1235 67EE 48 LSLA 1236 67EF 48 LSLA 1237 67F0 48 LSLA 1238 67F1 C0 30 SUBB #$30 1239 67F3 C1 11 CMPB #$11 1240 67F5 25 02 BLO CNV2 1241 67F7 C0 07 SUBB #7 1242 67F9 C4 0F CNV2 ANDB #$0F 1243 67FB 34 04 PSHS B 1244 67FD AB E0 ADDA ,S+ 1245 67FF 39 RTS 1246 1247 *-------------------- 1248 * search empty area in FAT 1249 6800 SRCFAT EQU * 1250 6800 8E 600E LDX #SCTFAT 1251 6803 17 FBAF LBSR SETSNO 1252 6806 17 036C LBSR RD1SCT read 1 sct 1253 1254 6809 8E 5E00 LDX #RWBUF 1255 *search $00 1256 680C SRC0 1257 680C C6 02 LDB #2 SD 1258 680E 7D 6009 TST SDHC 0:SD,1:SDHC 1259 6811 27 02 BEQ SRCLOP 1260 6813 C6 04 LDB #4 SDHC 1261 6815 8D 32 SRCLOP BSR SRC00 search 1st 00 ...1st 00 1262 6817 24 2F BCC SFATED not exist empty area 1263 6819 A6 80 LDA ,X+ next is 00? ..2nd 00 1264 681B 26 EF BNE SRC0 restart 1265 681D 7D 6009 TST SDHC 0:SD,1:SDHC 1266 6820 27 0A BEQ SETX 1267 6822 A6 80 LDA ,X+ next is 00? ..3rd 00 1268 6824 26 E6 BNE SRC0 restart 1269 6826 A6 80 LDA ,X+ next is 00? ..4th 00 1270 6828 26 E2 BNE SRC0 restart 1271 682A 30 1E LEAX -2,X 1272 682C SETX 1273 682C 30 1E LEAX -2,X pos in RWBUF 1274 682E 3089 A200 LEAX -RWBUF,X relative pos 1275 6832 1F 10 TFR X,D 1276 6834 44 LSRA 1277 6835 56 RORB 1/2 1278 6836 7D 6009 TST SDHC 0:SD,1:SDHC 1279 6839 27 02 BEQ SETCL 1280 683B 44 LSRA 1281 683C 56 RORB 1/2 1282 683D FD 604A SETCL STD CLSTL 1283 6840 1E 89 EXG A,B 1284 6842 8E 601F LDX #DIRENT 1285 6845 ED 88 1A STD $1A,X set cluster L to dirent 1286 6848 39 SFATED RTS 1287 1288 *search 00 in FAT 1289 6849 8C 6000 SRC00 CMPX #RWBUF+512 1290 684C 24 07 BHS NOEXST 1291 684E A6 80 LDA ,X+ 1292 6850 26 F7 BNE SRC00 1293 6852 1A 01 EXIST ORCC #$01 set C 1294 6854 39 RTS 1295 6855 1C FE NOEXST ANDCC #$FE reset C 1296 6857 39 RTS 1297 1298 *-------------------- 1299 * search empty DIR entry 1300 * return:DPGNO,DIROFS 1301 6858 SRCDIR EQU * 1302 6858 7F 605A CLR DPGNO 1303 *return no of DIR 1304 685B 8E 6016 LDX #SCTDSV 1305 685E 108E 6012 LDY #SCTDIR 1306 6862 C6 04 LDB #4 1307 6864 17 02C6 LBSR TRANS 1308 6867 8E 6012 SRCFL0 LDX #SCTDIR 1309 686A 17 FB48 SRCFL1 LBSR SETSNO 1310 686D 17 0305 LBSR RD1SCT read 1 sct 1311 1312 6870 8E 5E00 LDX #RWBUF 1313 6873 8C 6000 DLOP1 CMPX #RWBUF+512 1314 6876 24 0D BHS SRCFL5 1315 6878 A6 80 LDA ,X+ 1316 687A 27 15 BEQ DIRGET 1317 687C 81 E5 CMPA #$E5 delete mark? 1318 687E 27 11 BEQ DIRGET 1319 6880 30 88 1F LEAX 32-1,X 1320 6883 20 EE BRA DLOP1 1321 1322 6885 7C 605A SRCFL5 INC DPGNO 1323 6888 8E 6012 LDX #SCTDIR 1324 688B 17 02B3 LBSR INCX4 sct no +1 1325 688E 20 DA BRA SRCFL1 1326 6890 DSPED 1327 6890 39 RTS 1328 1329 6891 30 1F DIRGET LEAX -1,X 1330 6893 BF 605B STX DIROFS 1331 6896 39 RTS 1332 1333 *-------------------- 1334 6897 MKFLDT EQU * 1335 *cluster no & attr already set 1336 *file name input&set 1337 6897 8E 604F LDX #FNAME 1338 689A 108E 601F LDY #DIRENT 1339 689E C6 0B LDB #11 1340 68A0 17 028A LBSR TRANS set file name 1341 1342 *cal file size 1343 68A3 7D 604D TST MCFLG 00,FF(FE),else 1344 68A6 2B 08 BMI MKF1 1345 68A8 FC 6061 LDD MCAEP 1346 68AB B3 605F SUBD MCADP 1347 68AE 20 04 BRA MKF2 1348 68B0 MKF1 1349 68B0 DC 35 LDD BASAEP 1350 68B2 93 33 SUBD BASADP 1351 68B4 1E 89 MKF2 EXG A,B 1352 68B6 8E 601F LDX #DIRENT 1353 68B9 ED 88 1C STD $1C,X 1354 1355 *set date (for FM-7) 1356 68BC 8D 12 BSR STDATE 1357 68BE FC 603F LDD WMDY 1358 68C1 1E 89 EXG A,B 1359 1360 *year,month,day 1361 68C3 8E 601F LDX #DIRENT 1362 68C6 ED 88 18 STD $18,X 1363 68C9 ED 88 10 STD $10,X 1364 68CC ED 88 12 STD $12,X 1365 68CF 39 RTS 1366 1367 *---------- 1368 *FM day to SD 1369 *retuen WMDY,WMDY+1 1370 68D0 STDATE EQU * 1371 68D0 8E 02FA LDX #FMDAT date of FM-7 1372 68D3 108E 603F LDY #WMDY 1373 68D7 C6 03 LDB #3 1374 68D9 34 04 ABLOP PSHS B 1375 68DB EC 81 LDD ,X++ 1376 68DD 8D 2E BSR APLUSB 1377 68DF A7 A0 STA ,Y+ 1378 68E1 35 04 PULS B 1379 68E3 26 F4 BNE ABLOP 1380 *year 1381 68E5 B6 603F LDA WMDY 1382 68E8 8B 14 ADDA #20 ---2000-1980 1383 68EA 48 LSLA 1384 68EB B7 603F STA WMDY 1385 *month 1386 68EE B6 6040 LDA WMDY+1 1387 68F1 48 LSLA 1388 68F2 48 LSLA 1389 68F3 48 LSLA 1390 68F4 48 LSLA 1391 68F5 48 ASLA 1392 68F6 B7 6040 STA WMDY+1 1393 68F9 F6 603F LDB WMDY 1394 68FC C9 00 ADCB #0 plus C 1395 68FE F7 603F STB WMDY 1396 *day 1397 6901 B6 6041 LDA WMDY+2 1398 6904 84 1F ANDA #$1F 1399 6906 BB 6040 ADDA WMDY+1 1400 6909 B7 6040 STA WMDY+1 1401 690C 39 RTS 1402 1403 *lower nibble of A,B to A+B 1404 690D APLUSB EQU * 1405 690D 34 10 PSHS X 1406 690F 34 04 PSHS B 1407 6911 C6 0A LDB #10 1408 6913 3D MUL 1409 6914 1F 01 TFR D,X 1410 6916 35 04 PULS B 1411 6918 3A ABX 1412 6919 1F 10 TFR X,D 1413 691B 1E 89 EXG A,B A:data 1414 691D 35 90 PULS X,PC 1415 * 1416 *-------------------- 1417 691F WRTFIL EQU * 1418 *calc file size 1419 691F 7D 604D TST MCFLG 0,FF(FE),else 1420 6922 2B 08 BMI WRTF1 1421 6924 FC 6061 LDD MCAEP 1422 6927 B3 605F SUBD MCADP 1423 692A 20 04 BRA WRTF2 1424 692C WRTF1 1425 692C DC 35 LDD BASAEP 1426 692E 93 33 SUBD BASADP 1427 6930 FD 6046 WRTF2 STD FILSIZ 1428 6933 1F 02 TFR D,Y file size 1429 6935 10BF 606B STY WK3 1430 6939 1E 89 EXG A,B 1431 693B 8E 601F LDX #DIRENT 1432 693E ED 88 1C STD $1C,X 1433 6941 1E 89 EXG A,B 1434 1435 *add header&footer 1436 6943 7D 604D TST MCFLG 0,FF(FE),else 1437 6946 27 04 BEQ WRT3 1438 6948 2B 07 BMI WRT4 1439 694A 2A 08 BPL WRT5 1440 1441 694C C3 000A WRT3 ADDD #10 header&footer 1442 694F 20 03 BRA WRT5 1443 6951 C3 0003 WRT4 ADDD #3 header 1444 6954 1F 02 WRT5 TFR D,Y 1445 1446 *calc counter (CNT:512byte units) 1447 6956 7F 604C CLR CNT 1448 6959 7C 604C CALLOP INC CNT 1449 695C 83 0200 SUBD #512 1450 695F 22 F8 BHI CALLOP 1451 6961 B6 604C LDA CNT 1452 6964 B7 604E STA TPGFLG set top page 1453 1454 6967 7D 604D TST MCFLG 1455 696A 2B 05 BMI WRTF3 1456 696C BE 605F LDX MCADP saved top adr 1457 696F 20 02 BRA WRTF4 1458 1459 6971 9E 33 WRTF3 LDX BASADP saved top adr 1460 6973 BF 6067 WRTF4 STX WK1 src topadr 1461 6976 CE 5E00 LDU #RWBUF 1462 1463 *get clusterL 1464 6979 8E 601F LDX #DIRENT 1465 697C EC 88 1A LDD $1A,X 1466 697F 1E 89 EXG A,B B:clusterL 1467 1468 6981 BE 601A LDX SCTCLT sct no of top cluster 1469 6984 BF 6069 STX WK2 1470 6987 BE 601C LDX SCTCLT+2 1471 698A BF 606B STX WK2+2 1472 1473 698D C0 02 SUBB #2 for SD 1474 698F 7D 6009 TST SDHC 0:SD,1:SDHC 1475 6992 27 01 BEQ WR2 1476 6994 5A DECB 1477 6995 WR2 1478 1479 *(X)..(X+3)+(B)x40h 1480 6995 8E 6069 LDX #WK2 1481 6998 17 01B5 LBSR ADD40H cal of sct no 1482 1483 *set start sct no of file 1484 699B 34 10 PSHS X 1485 699D 8E 7022 LDX #MSWTNG 1486 69A0 17 0383 LBSR PSTRNG 1487 69A3 35 10 PULS X 1488 1489 69A5 WRLOP 1490 69A5 86 2E LDA #'. 1491 69A7 BD FBBB JSR OUTCHA 1492 69AA 10BE 606B LDY WK3 1493 69AE 1F 20 TFR Y,D 1494 69B0 1083 0200 CMPD #512 1495 69B4 23 04 BLS WR3 1496 69B6 108E 0200 LDY #512 1497 69BA WR3 1498 1499 *write data to rwbuf 1500 * (X)->(U:RWBUF) 1501 * (Y):SIZE 512bytes or Less 1502 69BA BE 6067 LDX WK1 1503 69BD CE 5E00 LDU #RWBUF 1504 69C0 8D 44 BSR WRSUB 1505 1506 *set to sctn0-3 1507 69C2 34 30 PSHS X,Y 1508 69C4 8E 6069 LDX #WK2 1509 69C7 108E 6004 LDY #SCTN0 1510 69CB C6 04 LDB #4 1511 69CD 17 015D LBSR TRANS 1512 69D0 35 30 PULS X,Y 1513 1514 *write data to sd 1515 69D2 17 008F LBSR WRTSD ...not wrtsd1 1516 1517 *inc sctn0-3 1518 69D5 8E 6069 LDX #WK2 1519 69D8 17 0166 LBSR INCX4 1520 69DB BE 6067 LDX WK1 src topadr 1521 69DE 3089 0200 LEAX 512,X 1522 *check top page 1523 69E2 7D 604E TST TPGFLG top page? 1524 69E5 27 0D BEQ WR6 1525 69E7 7D 604D TST MCFLG 1526 69EA 27 04 BEQ WR4 1527 69EC 2B 04 BMI WR5 1528 69EE 2A 04 BPL WR6 1529 69F0 30 1E WR4 LEAX -2,X rewind 3or5 1530 69F2 30 1D WR5 LEAX -3,X 1531 69F4 WR6 1532 69F4 7F 604E CLR TPGFLG 1533 69F7 BF 6067 STX WK1 1534 69FA 7A 604C DEC CNT 1535 * BEQ WREND 1536 * BRA WRLOP 1537 69FD 2A A6 BPL WRLOP 1538 1539 69FF 8E 703B WREND LDX #MSWTED 1540 6A02 17 0321 LBSR PSTRNG 1541 6A05 39 RTS 1542 1543 *---------- 1544 *write data to rwbuf 1545 * (X)->(U:RWBUF) 1546 * (Y):SIZE 512bytes or Less 1547 *clear rwbuf 1548 6A06 WRSUB EQU * 1549 6A06 34 30 PSHS X,Y 1550 6A08 4F CLRA 1551 6A09 8E 5E00 LDX #RWBUF 1552 6A0C 108E 0200 LDY #512 1553 6A10 A7 80 WWCLOP STA ,X+ 1554 6A12 31 3F LEAY -1,Y 1555 6A14 26 FA BNE WWCLOP 1556 6A16 35 30 PULS X,Y 1557 1558 *set data to rwbuf 1559 6A18 CE 5E00 LDU #RWBUF 1560 1561 6A1B 7D 604E TST TPGFLG top page? 1562 6A1E 27 24 BEQ WRLOP1 1563 1564 6A20 7D 604D TST MCFLG 0,$FF($FE),etc 1565 6A23 2B 15 BMI WRS1 1566 6A25 WRS0 1567 * add header of machine code 1568 6A25 34 10 PSHS X 1569 6A27 4F CLRA 1570 6A28 A7 C0 STA ,U+ 00 1571 6A2A BE 6046 LDX FILSIZ 1572 6A2D AF C1 STX ,U++ file size 1573 6A2F BE 605F LDX MCADP 1574 6A32 AF C1 STX ,U++ save adr 1575 6A34 31 3B LEAY -5,Y 1576 6A36 35 10 PULS X 1577 6A38 20 0A BRA WRLOP1 1578 1579 6A3A WRS1 1580 * add header of basic file 1581 6A3A 86 FF LDA #$FF 1582 6A3C A7 C0 STA ,U+ 1583 6A3E A7 C0 STA ,U+ 1584 6A40 A7 C0 STA ,U+ 1585 6A42 31 3D LEAY -3,Y 1586 1587 6A44 A6 80 WRLOP1 LDA ,X+ 1588 6A46 A7 C0 STA ,U+ 1589 6A48 31 3F LEAY -1,Y 1590 6A4A 26 F8 BNE WRLOP1 1591 1592 *check last page 1593 6A4C B6 604C LDA CNT 1594 6A4F 81 01 CMPA #1 1595 6A51 26 10 BNE WRS2 1596 *add footer 1597 6A53 86 FF LDA #$FF 1598 6A55 A7 C0 STA ,U+ 1599 6A57 4F CLRA 1600 6A58 A7 C0 STA ,U+ 1601 6A5A A7 C0 STA ,U+ 1602 6A5C BE 6063 LDX MCEXP 1603 6A5F AF C1 STX ,U++ 1604 6A61 31 3B LEAY -5,Y 1605 6A63 39 WRS2 RTS 1606 1607 *write data to sd 1608 6A64 WRTSD EQU * 1609 6A64 17 01A0 LBSR SETSCT *set SCT No 1610 *copy sct no to cmd param 1611 6A67 8E 6004 WRTSD1 LDX #SCTN0 1612 6A6A 108E 6E5A LDY #CMD24+1 1613 6A6E C6 04 LDB #4 1614 6A70 17 00BA LBSR TRANS 1615 *send cmd 1616 6A73 17 01C0 LBSR SETCKL 1617 6A76 C6 06 LDB #6 1618 6A78 8E 6E59 LDX #CMD24 1619 6A7B A6 80 SDW1 LDA ,X+ 1620 6A7D 17 0149 LBSR SNDDAT 1621 6A80 5A DECB 1622 6A81 26 F8 BNE SDW1 1623 *get cmd response 1624 6A83 SDW2 1625 6A83 17 015F LBSR GETDAT 1626 6A86 B6 6008 LDA RESDAT 1627 6A89 81 00 CMPA #$00 1628 6A8B 26 F6 BNE SDW2 1629 *1byte skip 1630 6A8D 86 FF LDA #$FF 1631 6A8F 17 0137 LBSR SNDDAT 1byte skip 1632 1633 *send data packet 1634 6A92 8E 5E00 LDX #RWBUF <-temp -1="" 008c="" 0093="" 00ab="" 00b3="" 00c3="" 011a="" 011d="" 0126="" 0129="" 012b="" 0133="" 01="" 0200="" 02="" 03="" 04="" 05="" 06="" 08="" 0:sd="" 0f="" 108e="" 10be="" 12="" 1635="" 1636="" 1637="" 1638="" 1639="" 1640="" 1641="" 1642="" 1643="" 1644="" 1645="" 1646="" 1647="" 1648="" 1649="" 1650="" 1651="" 1652="" 1653="" 1654="" 1655="" 1656="" 1657="" 1658="" 1659="" 1660="" 1661="" 1662="" 1663="" 1664="" 1665="" 1666="" 1667="" 1668="" 1669="" 1670="" 1671="" 1672="" 1673="" 1674="" 1675="" 1676="" 1677="" 1678="" 1679="" 1680="" 1681="" 1682="" 1683="" 1684="" 1685="" 1686="" 1687="" 1688="" 1689="" 1690="" 1691="" 1692="" 1693="" 1694="" 1695="" 1696="" 1697="" 1698="" 1699="" 16="" 1700="" 1701="" 1702="" 1703="" 1704="" 1705="" 1706="" 1707="" 1708="" 1709="" 1710="" 1711="" 1712="" 1713="" 1714="" 1715="" 1716="" 1717="" 1718="" 1719="" 1720="" 1721="" 1722="" 1723="" 1724="" 1725="" 1726="" 1727="" 1728="" 1729="" 1730="" 1731="" 1732="" 1733="" 1734="" 1735="" 1736="" 1737="" 1738="" 1739="" 1740="" 1741="" 1742="" 1743="" 1744="" 1745="" 1746="" 1747="" 1748="" 1749="" 1750="" 1751="" 1752="" 1753="" 1754="" 1755="" 1756="" 1757="" 1758="" 1759="" 1760="" 1761="" 1762="" 1763="" 1764="" 1765="" 1766="" 1767="" 1768="" 1769="" 1770="" 1771="" 1772="" 1773="" 1774="" 1775="" 1776="" 1777="" 1778="" 1779="" 1780="" 1781="" 1782="" 1783="" 1784="" 1785="" 1786="" 1787="" 1788="" 1789="" 1790="" 1791="" 1792="" 1793="" 1794="" 1795="" 1796="" 1797="" 1798="" 1799="" 17="" 1800="" 1801="" 1802="" 1803="" 1804="" 1805="" 1806="" 1807="" 1808="" 1809="" 1810="" 1811="" 1812="" 1813="" 1814="" 1815="" 1816="" 1817="" 1818="" 1819="" 1820="" 1821="" 1822="" 1823="" 1824="" 1825="" 1826="" 1827="" 1828="" 1829="" 1830="" 1831="" 1832="" 1833="" 1834="" 1835="" 1836="" 1837="" 1838="" 1839="" 1840="" 1841="" 1842="" 1843="" 1844="" 1845="" 1846="" 1847="" 1848="" 1849="" 1850="" 1851="" 1852="" 1853="" 1854="" 1855="" 1856="" 1857="" 1858="" 1859="" 1="" 1a="" 1e="" 1f="" 20="" 24="" 26="" 27="" 2="" 31="" 34="" 35="" 36="" 39="" 3="" 3a="" 3d="" 3f="" 40="" 44="" 48="" 4b="" 4f="" 54="" 5a="" 5b="" 5e00="" 5e="" 5f="" 6004="" 6008="" 6009="" 600e="" 6012="" 6016="" 601f="" 605a="" 605b="" 68="" 6a95="" 6a99="" 6a9b="" 6a9e="" 6aa0="" 6aa3="" 6aa5="" 6aa7="" 6aa9="" 6aac="" 6aaf="" 6ab2="" 6ab5="" 6ab7="" 6ab9="" 6abc="" 6abf="" 6ac1="" 6ac3="" 6ac4="" 6ac7="" 6acb="" 6acd="" 6acf="" 6ad2="" 6ad5="" 6ad7="" 6ad9="" 6ada="" 6adc="" 6adf="" 6ae2="" 6ae5="" 6ae9="" 6aeb="" 6aed="" 6af0="" 6af1="" 6af4="" 6af7="" 6af9="" 6afb="" 6afd="" 6b00="" 6b03="" 6b05="" 6b07="" 6b09="" 6b0c="" 6b0e="" 6b10="" 6b13="" 6b14="" 6b16="" 6b18="" 6b1a="" 6b1c="" 6b1e="" 6b21="" 6b23="" 6b25="" 6b27="" 6b29="" 6b2c="" 6b2d="" 6b2f="" 6b31="" 6b33="" 6b34="" 6b36="" 6b38="" 6b3a="" 6b3c="" 6b3d="" 6b3f="" 6b41="" 6b43="" 6b45="" 6b47="" 6b49="" 6b4b="" 6b4d="" 6b4f="" 6b50="" 6b52="" 6b54="" 6b56="" 6b58="" 6b5a="" 6b5c="" 6b5e="" 6b60="" 6b62="" 6b64="" 6b66="" 6b68="" 6b6a="" 6b6c="" 6b6e="" 6b70="" 6b71="" 6b73="" 6b75="" 6b78="" 6b7c="" 6b7e="" 6b80="" 6b83="" 6b85="" 6b88="" 6b8a="" 6b8c="" 6b8d="" 6b8f="" 6b91="" 6b94="" 6b96="" 6b98="" 6b9b="" 6b9f="" 6ba1="" 6ba4="" 6ba6="" 6ba8="" 6baa="" 6bab="" 6bae="" 6bb1="" 6bb5="" 6bb7="" 6bb9="" 6bbc="" 6bbe="" 6bc0="" 6bc1="" 6bc3="" 6bc6="" 6bc8="" 6bc9="" 6bcb="" 6bce="" 6bd0="" 6bd2="" 6bd4="" 6bd6="" 6bd9="" 6bdb="" 6bdd="" 6bde="" 6be0="" 6be1="" 6be3="" 6be5="" 6be7="" 6be9="" 6beb="" 6bec="" 6bed="" 6bee="" 6bf0="" 6bf3="" 6bf4="" 6c="" 6e53="" 6e54="" 70="" 7d="" 7f="" 80="" 81="" 84="" 86="" 88="" 89="" 8a="" 8b="" 8d="" 8e="" 96="" a0="" a6="" a7="" a:fill="" a="" abx="" ad="" add0="" add1="" add2="" add3="" add40h="" adda="" addb="" adr="" adx0="" adx1="" adx2="" adx3="" anda="" b1-="" b6="" b7="" b:cnt="" bcc="" beq="" bne="" bra="" bsr="" buf="" busy="" c6="" cb="" ckrs="" clr="" cluster="" cmd="" cmpa="" copy="" crch="" crcl="" cs:b0="L" d="" data="" decb="" df="" dir="" dirofs="" disp="" dpgno="" dspb1="" dspb2="" dspb3="" dspbin="" dspbuf="" e5="" ec="" ed="" equ="" exg="" f4="" f5="" f6="" f7="" f8b2="" f8d6="" f9="" fb="" fc="" fd9e="" fe="" ff3b="" ff77="" ff="" fill="" filop="" get="" getd1="" getdat="" inc="" incx4="" lbsr="" lda="" ldb="" ldd="" ldx="" ldy="" leay="" lsla="" lsra="" miso:b1="H(for" no="" nop="" of="" ora="" param="" pbdat="" pcrlf="" pia="" pshs="" puls="" rd1="" rd1sct="" rd2="" rd3="" read="" resdat="" response="" return="" rts="" save="" sct="" sd:2="" sdhc:4="" sdhc="" send="" setckh="" setckl="" setsno="" sndd1="" snddat="" snddt1="" src="" sta="" temp="" tfr="" to="" token="" trans="" trlop="" tst="" until="" wait="" wrdlop="" wrdskp="" wrf1="" wrf2="" wrf3="" wrtdir="" wrtfat="" wrtsd1="" wspfl0="" x40h="" y:dst="" y="">C 1860 6BF5 79 6008 ROL RESDAT C->b0 1861 6BF8 5A DECB 1862 6BF9 26 EE BNE GETD1 1863 6BFB 8D 39 BSR SETCKL 1864 6BFD 35 86 PULS A,B,PC 1865 * 1866 *------------------------------ 1867 *input SCT No 1868 6BFF INSCT EQU * 1869 6BFF 8E 6F5E LDX #MSSCT 1870 6C02 17 0121 LBSR PSTRNG 1871 6C05 8D 75 BSR GET8CH get 8chr, convert 4bin 1872 1873 6C07 SETSCT EQU * 1874 6C07 34 32 PSHS A,X,Y 1875 6C09 7D 6009 TST SDHC 0:SD,1:SDHC 1876 6C0C 26 1A BNE CALCHC 1877 *SD card 1878 6C0E 8E 6005 LDX #SCTN1 1879 6C11 108E 6004 LDY #SCTN0 1880 6C15 C6 03 LDB #3 1881 6C17 17 FF13 LBSR TRANS 1882 6C1A 7F 6007 CLR SCTN3 1883 *calc top adrs of sct 1884 6C1D CALCSD EQU * 1885 6C1D 78 6007 LSL SCTN3 1886 6C20 79 6006 ROL SCTN2 1887 6C23 79 6005 ROL SCTN1 1888 6C26 35 B2 PULS A,X,Y,PC 1889 1890 *SDHC card 1891 *calc top adrs of sct 1892 6C28 CALCHC EQU * 1893 6C28 8E 6004 LDX #SCTN0 1894 6C2B 108E 6E54 LDY #CMD17+1 1895 6C2F C6 04 LDB #4 1896 6C31 17 FEF9 LBSR TRANS 1897 6C34 35 B2 PULS A,X,Y,PC 1898 1899 * 1900 *set sck:L 1901 6C36 SETCKL EQU * 1902 6C36 34 02 PSHS A 1903 6C38 86 34 LDA #$34 ca2=L 1904 6C3A B7 FD9F STA PBCTL 1905 6C3D 35 82 PULS A,PC 1906 1907 *set sck:H 1908 6C3F SETCKH EQU * 1909 6C3F 34 02 PSHS A 1910 6C41 86 3C LDA #$3C ca2=H 1911 6C43 B7 FD9F STA PBCTL 1912 6C46 35 82 PULS A,PC 1913 1914 *binary(A)->ascii(A)(B) 1915 6C48 DSPBIN EQU * 1916 6C48 34 06 PSHS A,B 1917 6C4A 1F 89 TFR A,B 1918 6C4C 44 LSRA 1919 6C4D 44 LSRA 1920 6C4E 44 LSRA 1921 6C4F 44 LSRA 1922 6C50 8A 30 ORA #$30 1923 6C52 C4 0F ANDB #$0F 1924 6C54 CA 30 ORB #$30 1925 6C56 81 39 CMPA #$39 1926 6C58 23 02 BLS BI21 1927 6C5A 8B 07 ADDA #$07 1928 6C5C C1 39 BI21 CMPB #$39 1929 6C5E 23 02 BLS BI22 1930 6C60 CB 07 ADDB #$07 1931 6C62 BD FBBB BI22 JSR OUTCHA 1932 6C65 1F 98 TFR B,A 1933 6C67 BD FBBB JSR OUTCHA 1934 6C6A 86 20 LDA #$20 1935 6C6C BD FBBB JSR OUTCHA 1936 6C6F 35 86 PULS A,B,PC 1937 1938 *crlf 1939 6C71 PCRLF EQU * 1940 6C71 86 0D LDA #CR 1941 6C73 BD FBBB JSR OUTCHA 1942 6C76 86 0A LDA #LF 1943 6C78 BD FBBB JSR OUTCHA 1944 6C7B 39 RTS 1945 1946 * 1947 6C7C GET8CH EQU * 1948 *input chr 1949 6C7C 8E 606F LDX #INPBUF 1950 6C7F 5F CLRB 1951 6C80 BD 6E2D CLOP JSR INOUTC 1952 6C83 81 0D CMPA #CR 1953 6C85 27 07 BEQ INEND 1954 6C87 A7 85 STA B,X 1955 6C89 5C INCB 1956 6C8A C1 08 CMPB #8 1957 6C8C 25 F2 BLO CLOP 1958 1959 6C8E INEND 1960 *shift 1961 6C8E 5D TSTB 1962 6C8F 27 21 BEQ CLEND 1963 6C91 8E 606F LDX #INPBUF 1964 6C94 3A ABX 1965 6C95 108E 6077 LDY #INPBUF+8 1966 6C99 34 04 PSHS B 1967 6C9B A6 82 SFLOP LDA ,-X 1968 6C9D A7 A2 STA ,-Y 1969 6C9F 5A DECB 1970 6CA0 26 F9 BNE SFLOP 1971 *clr 1972 6CA2 C6 08 CL1 LDB #8 1973 6CA4 E0 E0 SUBB ,S+ 1974 6CA6 27 0A BEQ CLEND 1975 6CA8 8E 606F LDX #INPBUF 1976 6CAB 86 30 LDA #'0 1977 6CAD A7 80 CLLOP STA ,X+ 1978 6CAF 5A DECB 1979 6CB0 26 FB BNE CLLOP 1980 6CB2 CLEND 1981 1982 *convert to bin 1983 6CB2 C6 04 LDB #4 1984 6CB4 8E 606F LDX #INPBUF 1985 6CB7 108E 6004 LDY #SCTN0 1986 6CBB CVT1 1987 6CBB A6 80 LDA ,X+ 1988 6CBD 8D 1E BSR CVBIN 1989 6CBF 25 16 BCS EREND1 1990 6CC1 48 LSLA 1991 6CC2 48 LSLA 1992 6CC3 48 LSLA 1993 6CC4 48 LSLA 1994 6CC5 34 02 PSHS A 1995 6CC7 A6 80 LDA ,X+ 1996 6CC9 8D 12 BSR CVBIN 1997 6CCB 25 08 BCS EREND0 1998 6CCD AB E0 ADDA ,S+ 1999 6CCF A7 A0 STA ,Y+ 2000 6CD1 5A DECB 2001 6CD2 26 E7 BNE CVT1 2002 6CD4 39 RTS 2003 2004 6CD5 35 02 EREND0 PULS A 2005 6CD7 8E 6FA4 EREND1 LDX #MSERR 2006 6CDA 8D 4A BSR PSTRNG 2007 6CDC 39 EEND RTS 2008 2009 *-------------------- 2010 *ascii -> bin 2011 6CDD CVBIN EQU * 2012 6CDD 80 30 SUBA #'0 2013 6CDF 2B 11 BMI CVERR 2014 6CE1 81 09 CMPA #9 2015 6CE3 23 0A BLS CVBEND 2016 6CE5 81 11 CMPA #$11 2017 6CE7 25 09 BLO CVERR 2018 6CE9 81 16 CMPA #$16 2019 6CEB 22 05 BHI CVERR 2020 6CED 80 07 SUBA #7 2021 6CEF CVBEND 2022 6CEF 1C FE ANDCC #$FE reset C 2023 6CF1 39 RTS 2024 6CF2 1A 01 CVERR ORCC #$01 set C 2025 6CF4 39 RTS 2026 2027 *-------------------- 2028 *add 2bytes to 4bytes 2029 * X,X+1,X+2,X+3 + Y,Y+1 2030 * data X is big endian 2031 * data Y is little endian 2032 6CF5 ADD42 EQU * 2033 6CF5 34 36 PSHS A,B,X,Y 2034 6CF7 32 7C LEAS -4,S 2035 6CF9 C6 04 LDB #4 2036 6CFB A6 80 AD1 LDA ,X+ 2037 6CFD A7 E0 STA ,S+ 2038 6CFF 5A DECB 2039 6D00 26 F9 BNE AD1 2040 2041 *add (lower) 2042 6D02 A6 A0 LDA ,Y+ 2043 6D04 AB E2 ADDA ,-S 2044 6D06 A7 E4 STA ,S 2045 6D08 24 02 BCC AD2 2046 6D0A 6C 7F INC -1,S 2047 *add (upper) 2048 6D0C A6 A4 AD2 LDA ,Y 2049 6D0E AB E2 ADDA ,-S 2050 6D10 A7 E4 STA ,S 2051 6D12 24 02 BCC AD3 2052 6D14 6C 7F INC -1,S 2053 6D16 30 1C AD3 LEAX -4,X 2054 6D18 32 7E LEAS -2,S 2055 6D1A C6 04 LDB #4 2056 6D1C A6 E0 AD4 LDA ,S+ 2057 6D1E A7 80 STA ,X+ 2058 6D20 5A DECB 2059 6D21 26 F9 BNE AD4 2060 6D23 35 36 PULS A,B,X,Y 2061 6D25 39 RTS 2062 2063 *-------------------- 2064 * pstring 2065 6D26 PSTRNG EQU * 2066 6D26 34 02 PSHS A 2067 6D28 A6 80 PSLOP LDA ,X+ 2068 6D2A 81 04 CMPA #4 2069 6D2C 27 05 BEQ PSEND 2070 6D2E BD FBBB JSR OUTCHA 2071 6D31 20 F5 BRA PSLOP 2072 6D33 35 02 PSEND PULS A 2073 6D35 39 RTS 2074 2075 *-------------------- 2076 *disp MM-DD-YY 2077 *indata A(Low),B(High) 2078 6D36 DSPYMD EQU * 2079 6D36 1E 89 EXG A,B 2080 6D38 34 10 PSHS X 2081 6D3A 34 06 PSHS A,B 2082 6D3C C4 E0 ANDB #$E0 2083 6D3E 54 LSRB 2084 6D3F 54 LSRB 2085 6D40 54 LSRB 2086 6D41 54 LSRB 2087 6D42 54 LSRB 2088 6D43 47 ASRA 2089 6D44 24 02 BCC DYMD1 2090 6D46 CB 08 ADDB #8 2091 6D48 F7 603F DYMD1 STB WMDY MM 2092 6D4B 35 06 PULS A,B 2093 6D4D 34 04 PSHS B 2094 6D4F C4 1F ANDB #$1F 2095 6D51 F7 6040 STB WMDY+1 DD 2096 6D54 35 04 PULS B 2097 2098 6D56 44 LSRA 2099 * ASLB 2100 * BCC DYMD2 2101 * INCA 2102 6D57 DYMD2 2103 6D57 80 14 SUBA #20 A+1980-2000 2104 6D59 B7 6041 STA WMDY+2 YY 2105 2106 *disp MM-DD-YY 2107 6D5C 86 20 LDA #SPC 2108 6D5E BD FBBB JSR OUTCHA 2109 6D61 8E 603F LDX #WMDY 2110 6D64 A6 80 LDA ,X+ 2111 6D66 8D 14 BSR DB2ASC MM 2112 6D68 86 2D LDA #'- 2113 6D6A BD FBBB JSR OUTCHA 2114 6D6D A6 80 LDA ,X+ 2115 6D6F 8D 0B BSR DB2ASC DD 2116 6D71 86 2D LDA #'- 2117 6D73 BD FBBB JSR OUTCHA 2118 6D76 A6 80 LDA ,X+ 2119 6D78 8D 02 BSR DB2ASC YY 2120 6D7A 35 90 PULS X,PC 2121 * 2122 *---------- 2123 *convert decimal value to ascii code 2124 *(A:BIN)->ASCII 2125 6D7C DB2ASC EQU * 2126 6D7C 34 06 PSHS A,B 2127 6D7E 1F 89 TFR A,B 2128 6D80 86 30 LDA #$30 2129 6D82 C1 0A DBLOP CMPB #10 2130 6D84 25 05 BLO DB2 2131 6D86 C0 0A SUBB #10 2132 6D88 4C INCA 2133 6D89 20 F7 BRA DBLOP 2134 6D8B BD FBBB DB2 JSR OUTCHA 2135 6D8E 1F 98 TFR B,A 2136 6D90 8B 30 ADDA #$30 2137 6D92 BD FBBB JSR OUTCHA 2138 6D95 35 86 PULS A,B,PC 2139 2140 *disp FILE size 2141 6D97 DSPSIZ EQU * 2142 6D97 34 10 PSHS X 2143 6D99 BE 6042 LDX WFSIZ 2144 6D9C 27 07 BEQ DSS1 if 64k over? 2145 6D9E 8E 706F LDX #MSOVR 2146 6DA1 8D 83 BSR PSTRNG 2147 6DA3 20 40 BRA DSEND 2148 2149 6DA5 DSS1 2150 * LDA #SPC 2151 * JSR OUTCHA 2152 * /1024(400h) 2153 6DA5 B6 6044 LDA WFSIZ+2 under 64k 2154 6DA8 44 LSRA 2155 6DA9 44 LSRA 2156 *disp dec 2157 6DAA 1F 89 TFR A,B 2158 6DAC 81 64 CMPA #100 2159 6DAE 23 10 BLS DSS13 2160 6DB0 86 30 LDA #'0 2161 6DB2 C1 64 DSLOP1 CMPB #100 2162 6DB4 25 05 BLO DSS12 2163 6DB6 C0 64 SUBB #100 2164 6DB8 4C INCA 2165 6DB9 20 F7 BRA DSLOP1 2166 6DBB BD FBBB DSS12 JSR OUTCHA 2167 6DBE 20 0B BRA DSS14 2168 2169 *under 100 2170 6DC0 86 20 DSS13 LDA #SPC 2171 6DC2 BD FBBB JSR OUTCHA 2172 6DC5 86 20 LDA #SPC 2173 6DC7 C1 0A CMPB #10 2174 6DC9 25 0B BLO DSS2 2175 2176 6DCB 86 30 DSS14 LDA #'0 2177 6DCD C1 0A DSLOP2 CMPB #10 2178 6DCF 25 05 BLO DSS2 2179 6DD1 C0 0A SUBB #10 2180 6DD3 4C INCA 2181 6DD4 20 F7 BRA DSLOP2 2182 2183 6DD6 BD FBBB DSS2 JSR OUTCHA 10's place 2184 *under 10 2185 6DD9 1F 98 DSS21 TFR B,A 2186 6DDB 8B 31 ADDA #$31 '1 2187 6DDD BD FBBB DSS3 JSR OUTCHA 1's place 2188 6DE0 86 6B LDA #'k 2189 6DE2 BD FBBB JSR OUTCHA 2190 6DE5 86 20 DSEND LDA #SPC 2191 6DE7 BD FBBB JSR OUTCHA 2192 6DEA 35 90 PULS X,PC 2193 2194 *---------- 2195 *disp cluster 2196 *return:clusterH,spc,clusterL 2197 6DEC DSPCLS EQU * 2198 6DEC 34 10 PSHS X 2199 6DEE 86 20 LDA #SPC 2200 6DF0 BD FBBB JSR OUTCHA 2201 6DF3 8E 6048 LDX #CLSTH 2202 6DF6 C6 02 LDB #2 2203 6DF8 A6 80 DCLOP1 LDA ,X+ 2204 6DFA 17 FF7F LBSR DB2ASC 2205 6DFD 5A DECB 2206 6DFE 26 F8 BNE DCLOP1 2207 6E00 86 20 LDA #SPC 2208 6E02 BD FBBB JSR OUTCHA 2209 6E05 C6 02 LDB #2 2210 6E07 A6 80 DCLOP2 LDA ,X+ 2211 6E09 17 FF70 LBSR DB2ASC 2212 6E0C 5A DECB 2213 6E0D 26 F8 BNE DCLOP2 2214 6E0F 35 90 PULS X,PC 2215 2216 *---------- 2217 6E11 FNMIN EQU * 2218 *clr buf 2219 6E11 8E 605A LDX #FNAME+11 2220 6E14 C6 0B LDB #8+3 2221 6E16 86 20 LDA #SPC 2222 6E18 A7 82 FNIN0 STA ,-X 2223 6E1A 5A DECB 2224 6E1B 26 FB BNE FNIN0 2225 2226 *fname in 2227 6E1D 34 24 PSHS B,Y 2228 6E1F 108E 604F LDY #FNAME 2229 6E23 C6 08 LDB #8 2230 6E25 8D 0D BSR LININ 2231 6E27 86 20 LDA #$20 2232 6E29 A7 3F STA -1,Y 2233 6E2B 35 A4 PULS B,Y,PC 2234 2235 *-------------------- 2236 * 2237 6E2D BD FBB8 INOUTC JSR INCHA 2238 6E30 BD FBBB JSR OUTCHA 2239 6E33 39 RTS 2240 2241 *-------------------- 2242 * line input 2243 * input: B:count, Y:buf 2244 * output: FILBUF (terminate $00) 2245 * temp buf $043D - $053C 2246 6E34 LININ EQU * 2247 6E34 0F BF CLR $BF 2248 6E36 BD D807 JSR LININP 2249 2250 6E39 8E 043D LDX #$043D 2251 6E3C A6 80 LINLOP LDA ,X+ 2252 6E3E A7 A0 STA ,Y+ 2253 6E40 5A DECB 2254 6E41 27 03 BEQ LEND 2255 6E43 4D TSTA 2256 6E44 26 F6 BNE LINLOP 2257 6E46 39 LEND RTS 2258 2259 * 2260 ************************************************** 2261 *========== parameter ========== 2262 6E47 40 CMD0 FCB $40,$00,$00,$00,$00,$95 '@ 2263 6E4D 41 CMD1 FCB $41,$00,$00,$00,$00,$FF 'A 2264 6E53 51 CMD17 FCB $51,$00,$00,$00,$00,$FF 'Q 2265 6E59 58 CMD24 FCB $58,$00,$00,$00,$00,$FF 'X 2266 6E5F 48 CMD8 FCB $48,$00,$00,$01,$AA,$87 'H 2267 6E65 7A CMD58 FCB $7A,$00,$00,$00,$00,$FF 'z 2268 6E6B 77 CMD55 FCB $77,$00,$00,$00,$00,$FF 'w 2269 6E71 69 ACMD41 FCB $69,$40,$FF,$80,$00,$FF 'i 2270 6E77 49 CMD9 FCB $49,$00,$00,$00,$00,$FF 'I 2271 * 2272 6E7D 43 MCMD0 FCC /CMD0/,CR,LF 2273 6E83 04 FCB 4 2274 6E84 43 MCMD8 FCC /CMD8/,CR,LF 2275 6E8A 04 FCB 4 2276 6E8B 43 MCMD58 FCC /CMD58/,CR,LF 2277 6E92 04 FCB 4 2278 6E93 43 MCMD55 FCC /CMD55/,CR,LF 2279 6E9A 04 FCB 4 2280 6E9B 41 MCMD41 FCC /ACMD41/,CR,LF 2281 6EA3 04 FCB 4 2282 6EA4 43 MCMD9 FCC /CMD9/,CR,LF 2283 6EAA 04 FCB 4 2284 * 2285 6EAB 0D MSMENU1 FCC CR,LF,CR,LF,/Main MENU/ 2286 6EB8 0D FCC CR,LF,/D)ir, L)oad, save B)asic, save M)code, K)ill, S)etSD, O)ption, Q)uit: / 2287 6F00 04 FCB 4 2288 6F01 0D MSMENU2 FCC CR,LF,CR,LF,/Option MENU/ 2289 6F11 0D FCC CR,LF,/1:Read Sct, 2:Disp SD data, 3:Disp MBR, 4:Disp BPB, 5:Disp FAT, 0:Return: / 2290 6F5D 04 FCB 4 2291 6F5E 53 MSSCT FCC /SctNo: / 2292 6F65 04 FCB 4 2293 6F66 0D MSSD0 FCC CR,LF,/SD Card/ 2294 6F6F 04 FCB 4 2295 6F70 0D MSSD1 FCC CR,LF,/SDHC Card/ 2296 6F7B 04 FCB 4 2297 6F7C 0D MSINIT FCC CR,LF,CR,LF,/SD Card setting.../ 2298 6F92 04 FCB 4 2299 6F93 53 MERR FCC /Setting error!/,CR,LF 2300 6FA3 04 FCB 4 2301 6FA4 49 MSERR FCC /Input error!/,CR,LF 2302 6FB2 04 FCB 4 2303 6FB3 0D MSOFS FCC CR,LF,/Sector no is:/ 2304 6FC2 04 FCB 4 2305 6FC3 0D MSBPB FCC CR,LF,/ BPB: / 2306 6FCB 04 FCB 4 2307 6FCC 0D MSFAT FCC CR,LF,/ FAT: / 2308 6FD4 04 FCB 4 2309 6FD5 0D MSDIR FCC CR,LF,/ DIR: / 2310 6FDD 04 FCB 4 2311 6FDE 0D MSCL2 FCC CR,LF,/ 1stCLUSTER: / 2312 6FED 04 FCB 4 2313 6FEE 0D MSINFN FCC CR,LF,CR,LF,/ FileName: / 2314 6FFD 04 FCB 4 2315 6FFE 0D MSMSV FCC CR,LF,CR,LF,/ FileName & Param: / 2316 7015 04 FCB 4 2317 7016 0D MSLDNG FCC CR,LF,/ Loading / 2318 7021 04 FCB 4 2319 7022 0D MSWTNG FCC CR,LF,/ Writing / 2320 702D 04 FCB 4 2321 702E 0D MSLDED FCC CR,LF,/ Load end./ 2322 703A 04 FCB 4 2323 703B 0D MSWTED FCC CR,LF,/ Write end./ 2324 7048 04 FCB 4 2325 7049 0D MSNOFL FCC CR,LF,/ Not exist!/ 2326 7056 04 FCB 4 2327 7057 0D MSNXTP FCC CR,LF,"Next page (SP:Next): " 2328 706E 04 FCB 4 2329 706F 3E MSOVR FCC />64k/ 2330 7073 04 FCB 4 2331 7074 0D MSKILL FCC CR,LF," Kill OK?(Y/N): " 2332 7086 04 FCB 4 2333 7087 0D MSEXST FCC CR,LF," Exist! Over Write?(Y/N): " 2334 70A3 04 FCB 4 2335 70A4 0D MSMCOF FCC CR,LF," -$2000 Offset?(Y/N): " 2336 70BC 04 FCB 4 2337 2338 ************************************************** 2339 2340 END START 0 error(s), 0 warning(s) is detected. Label address ABLOP 68D9 ACMD41 6E71 AD1 6CFB AD2 6D0C AD3 6D16 AD4 6D1C ADD0 6B52 ADD1 6B60 ADD2 6B68 ADD3 6B70 ADD40H 6B50 ADD42 6CF5 ADX0 6B41 ADX1 6B47 ADX2 6B4B ADX3 6B4F APLUSB 690D ASC2BIN 679D ASC411 620D ASCMD41 6200 BASADP 0033 BASAEP 0035 BASEXP 605D BI21 6C5C BI22 6C62 BUSY 6AB9 CALCHC 6C28 CALCSD 6C1D CALLOP 6959 CKRS 6AAF CL1 6CA2 CLEND 6CB2 CLLOP 6CAD CLOP 6C80 CLRDIR 6725 CLSTH 6048 CLSTL 604A CMD0 6E47 CMD1 6E4D CMD17 6E53 CMD24 6E59 CMD55 6E6B CMD58 6E65 CMD8 6E5F CMD9 6E77 CMPEND 65F4 CMPFN 65D9 CMPLOP 65E1 CNT 604C CNV1 67ED CNV2 67F9 CNVBUF 6077 CNVSUB 67E5 CR 000D CSRON FBF7 CVBEND 6CEF CVBIN 6CDD CVERR 6CF2 CVT1 6CBB DB2 6D8B DB2ASC 6D7C DBLOP 6D82 DCLOP1 6DF8 DCLOP2 6E07 DELMK 00E5 DEVNO 00BF DIRENT 601F DIRGET 6891 DIROFS 605B DLOP1 6873 DPGNO 605A DSEND 6DE5 DSLOP1 6DB2 DSLOP2 6DCD DSPB1 6BB5 DSPB2 6BB7 DSPB3 6BC8 DSPBIN 6C48 DSPBPB 63DB DSPBUF 6BAB DSPC1 6474 DSPCKE 642C DSPCLS 6DEC DSPDIR 63FF DSPED 6890 DSPEND 64AC DSPFAT 63ED DSPFL0 640B DSPFL1 641C DSPFL2 6436 DSPFL3 6438 DSPFL4 6447 DSPFL5 6494 DSPFL6 64A0 DSPMBR 6387 DSPSDDAT 62F3 DSPSIZ 6D97 DSPYMD 6D36 DSS1 6DA5 DSS12 6DBB DSS13 6DC0 DSS14 6DCB DSS2 6DD6 DSS21 6DD9 DSS3 6DDD DYMD1 6D48 DYMD2 6D57 EEND 6CDC EREND0 6CD5 EREND1 6CD7 ESC 001B EXIST 6852 EXSTFL 6065 FILBUF 607B FILL 6B38 FILOP 6B3A FILSIZ 6046 FMDAT 02FA FNAME 604F FNIN0 6E18 FNMIN 6E11 GET1 6392 GET2 6394 GET8CH 6C7C GETBPB 63C2 GETD1 6BE9 GETDAT 6BE5 GETFDT 65F6 GETMBR 63A5 GR00 617A GR2580 623A GR2581 6251 GR2582 6253 GR410 6215 GR550 61F6 GR580 61CC GR581 61D6 GR582 61D8 GR80 619C GR81 61AE GR90 6306 GR91 6312 GTBLOP 63CD GTF1 6615 GTF2 6618 ILOP1 6276 INCHA FBB8 INCX4 6B41 INEND 6C8E INIT 60BF INOUTC 6E2D INPBUF 606F INPFLDAT 6780 INSCT 6BFF ISTT 6160 KILEND 66C0 KILFILE 666C KILSUB 6685 KL1 66AA KL2 66B8 LD1 6648 LD2 665C LD3 64D2 LD41 64F7 LD5 6510 LD8 6552 LD80 6570 LD81 6574 LD9 6577 LDE0 6597 LDE1 659D LDEND 6587 LDFILE 64AD LDFL0 6624 LDFL1 6630 LDFL5 6654 LDFLE 666B LDLOP 6520 LDNEND 65A1 LEND 6E46 LF 000A LININ 6E34 LININP D807 LINLOP 6E3C MAIN 609B MATCH 65EE MCADP 605F MCAEP 6061 MCEXP 6063 MCFLG 604D MCMD0 6E7D MCMD41 6E9B MCMD55 6E93 MCMD58 6E8B MCMD8 6E84 MCMD9 6EA4 MEMSET 65A9 MENU 60C2 MENU1 60D9 MENU2 60E2 MENU3 60EB MENU4 60F4 MENU5 60FD MENU6 6105 MENU7 610D MERR 6F93 MKF1 68B0 MKF2 68B4 MKFLDT 6897 MS0 65C0 MS1 65C4 MS3 65D3 MSBPB 6FC3 MSCL2 6FDE MSDIR 6FD5 MSERR 6FA4 MSEXST 7087 MSFAT 6FCC MSINFN 6FEE MSINIT 6F7C MSKILL 7074 MSLDED 702E MSLDNG 7016 MSLOP 65C6 MSMCOF 70A4 MSMENU1 6EAB MSMENU2 6F01 MSMSV 6FFE MSNOFL 7049 MSNXTP 7057 MSOFS 6FB3 MSOVR 706F MSSCT 6F5E MSSD0 6F66 MSSD1 6F70 MSWTED 703B MSWTNG 7022 NOEXST 6855 NOFEND 66CE NOTM 65F2 OPMEN10 6144 OPMEN6 6124 OPMEN7 612C OPMEN8 6134 OPMEN9 613C OPMENU 6115 OUTCHA FBBB PBCTL FD9F PBDAT FD9E PCRLF 6C71 PSEND 6D33 PSLOP 6D28 PSTRNG 6D26 RD1 6B88 RD1SCT 6B75 RD2 6B8F RD3 6B9F RDSCT 6374 RESDAT 6008 RPT41 61E1 RWBUF 5E00 SC01 6171 SC2581 6232 SC551 61EE SC581 61C4 SC80 6194 SC91 62FE SCLOP1 632F SCLOP2 6342 SCLOP3 6355 SCLOP4 6368 SCMD0 6169 SCMD258 6225 SCMD55 61E1 SCMD58 61B7 SCMD8 6187 SCTBPB 600A SCTCLT 601A SCTDIR 6012 SCTDSV 6016 SCTFAT 600E SCTN0 6004 SCTN1 6005 SCTN2 6006 SCTN3 6007 SCTPCL 601E SD1 6267 SDERR 614C SDHC 6009 SDINIT 6153 SDW1 6A7B SDW2 6A83 SETCKH 6C3F SETCKL 6C36 SETCL 683D SETFNM 670D SETSCT 6C07 SETSNO 63B5 SETX 682C SFATED 6848 SFLOP 6C9B SKP1 62AD SKP2 62EA SKPDLM 6796 SNDD1 6BD0 SNDDAT 6BC9 SNDDT1 6A9E SPC 0020 SRC0 680C SRC00 6849 SRCDIR 6858 SRCDLM 678D SRCFAT 6800 SRCFL0 6867 SRCFL1 686A SRCFL5 6885 SRCLOP 6815 SRDLM1 678F SRLOP1 67AE SRLOP2 67C6 START 6000 STDATE 68D0 STTADR 6000 TPGFLG 604E TRANS 6B2D TRLOP 6B2F TXTADR 2000 VN 6003 WFSIZ 6042 WK1 6067 WK2 6069 WK3 606B WK4 606D WMDY 603F WR2 6995 WR3 69BA WR4 69F0 WR5 69F2 WR6 69F4 WRB0 66D5 WRB1 66F3 WRBEND 670C WRBFILE 66C1 WRDLOP 6AD7 WRDSKP 6ADC WREND 69FF WRF1 6B10 WRF2 6B13 WRF3 6B29 WRFL1 671A WRFL2 6724 WRFLP2 6715 WRLOP 69A5 WRLOP1 6A44 WRM1 674D WRMEND 677F WRMFILE 6733 WRS0 6A25 WRS1 6A3A WRS2 6A63 WRSUB 6A06 WRT3 694C WRT4 6951 WRT5 6954 WRTDIR 6AC4 WRTF1 692C WRTF2 6930 WRTF3 6971 WRTF4 6973 WRTFAT 6AF1 WRTFIL 691F WRTSD 6A64 WRTSD1 6A67 WSPFL0 6ACF WWCLOP 6A10 -temp>
最後に
◎ELM by ChaNさんのブログ ・・・SD,SDHCに関するマニュアル的資料(英文)
◎FM-7 F-BASIC解析マニュアル フェーズ II ・・・F-BASICの解析 (ネット版を参照しました。これがなければアスキーセーブされた F-BASICのプログラム読み込みは実現できませんでした。)