home *** CD-ROM | disk | FTP | other *** search
- exp-basic.src......page 0001
-
- line# loc code line
-
- 0001 0000 ;*****************************************
- 0002 0000 ;* eeeee x x pppp aaa n n dddd *
- 0003 0000 ;* e x x p p a a nn n d d *
- 0004 0000 ;* e x x p p a a n n n d d *
- 0005 0000 ;* eeee x pppp aaaaa n n n d d *
- 0006 0000 ;* e x x p a a n nn d d *
- 0007 0000 ;* e x x p a a n nn d d *
- 00o8 0000 ;* eeeee x x p a a n n dddd *
- 0009 0000 ;* *
- 0010 0000 ;* aaa bbbb aaa sss iiiii ccc *
- 0011 0000 ;* a a b b a a s s i c c *
- 0012 0000 ;* a a b b a a s i c *
- 0013 0000 ;* a a b b a a s i c *
- 0014 0000 ;* aaaaa bbbb aaaaa s i c *
- 0015 0000 ;* a a b b a a s i c *
- 0016 0000 ;* a a b b a a s s i c c *
- 0017 0000 ;* a a bbbb a a sss iiiii ccc *
- 0018 0000 ;* *
- 0019 0000 ;*****************************************
- 0020 0000 ;
- 0021 0000 ;
- 0022 0000 ;*****************************************
- 0023 0000 ;* *
- 0024 0000 ;* expanded basic *
- 0025 0000 ;* *
- 0026 0000 ;* program to append to the cbm basic *
- 0027 0000 ;* version 4.0, 8032, chrget routines *
- 0028 0000 ;* and add commands to cache programs *
- 0029 0000 ;* in the 64k add-on memory. *
- 0030 0000 ;* *
- 0031 0000 ;* 14jul81 rjf (bob) 30jul81 (john) *
- 0032 0000 ;* *
- 0033 0000 ;*****************************************
-
-
- exp-basic.src......page 0002
-
- line# loc code line
-
- 0035 0000 ; system variable definitions
- 0036 0000 ;
- 0037 oo00 status =$96 ;system status variable
- 0039 0000 ds =$13 ;disk status descriptor
- 0039 0000 chrget =$70 ;basic routine to get chars
- 0040 0000 chrgot =$76 ;get last character
- 0041 0000 getptr =$77 ;p0inter to characters
- 0042 0000 chdgot =$d39f ;rom copy of chrgot
- 0043 0000 newstt =$b74a ;new statement exex
- 0044 0000 lnkprg =$b4b6 ;link basic lines
- 0045 0000 stxtpt =$b622 ;set start text pointer
- 0046 0000 op94 =$f4a5 ;open a file on ieee
- 0047 0000 ready =$b3ff ;re-enter basic
- 0048 0000 fload =$b60b ;run an overlay
- 0049 0000 runc =$b5e9 ;clear variables
- 0050 0000 clrch =$ffcc ;clear open channel
- 0051 0000 fclose =$f2e2 ;close a file
- 0032 0000 talk =$f0d2 ;tell device to talk
- 0053 0000 acptr =$f1co ;get a byte
- 0054 0000 clsei =$f72f ;close a file
- 0055 0000 untlk =$f1ae ; untalk
- 0056 0000 tksa =$f193 ;send secondary addr
- 0057 0000 wsw =$b3
- 0058 0000 t1 =$b4
- 0059 0000 t2 =$b5
- 0060 0000 t3 =$b6
- 0061 0000 fnlen =$d1 ;file name length
- 0062 0000 la =$d2 ;logical file number
- 0063 0000 sa =$d3 ;secondary address
- 0064 0000 fa =$d4 ;primary address
- 0065 0000 fnaddr =$da ;file name address
- 0066 0000 index1 =$1f ;temp pointer
- 0067 0000 index2 =$21 ;temp pointer
- 0068 0000 eal =$c9 ;end address pointer
- 0069 0000 vartab =$2a ;variable table pointer
- 0070 0000 memsiz =$34 ;top of mem pointer
- 0071 0000 ;
- 0072 0000 ; program variables and constants
- 0073 0000 ;
- 0074 0000 loc =$7800
- 0075 0000 *=loc
- 0076 7800 4c 2e 79 jmp gooo ;start program
- 0077 7803 ;
- 0079 7803 ;
- 0079 7803 tabhi
- 0080 7803 79 .byt >zz1
- 0081 7804 79 .byt >zz3
- 0082 7805 7a .byt >zz4
- 0083 7806 7a .byt >zz5
- 0084 7807 79 .byt >zz8
- 0095 7808 ;
- 0086 7809 tablo
- 0097 7808 91 .byt <zz1
- 0099 7009 fd .byt <zz3
- 0089 780a 11 .byt <zz4
-
- exp-basic.src......page 0003
-
- line# loc code line
-
- 0090 780b 22 .byt <zz5
- 0091 7b0c 7c .byt <zz8
- 0092 7900 ;
- 0093 7800 ncmd =5
- 0094 7900 52 4c cmd .byt 'rloeq'
- 0095 7812 file *=*+22
- 0096 7828 00 .byt $00
- 0097 7829 entry =25
- 0098 7829 entmax =225 ;entry*9
- 0099 7b29 fitab *=*+256
- 0100 7929 81 b7 wheret .wor $b782-1 ;g0ne3-3-1
- 0101 792b master =$bb ;available space (three bytes
- 0102 792b 4c 51 79 jump jmp start
-
-
- exp-basic.src......page 0004
-
- line# loc code line
-
- 0104 792e ;
- 0105 792e ; init the memory manager (sys to here)
- 0106 792e ;
- 0107 792e gooo
- 0108 792e a2 02 ldx #$02 ;m0ve three bytes
- 0109 7930 bd 2b 79 wedge lda jump,x
- 0110 7933 95 79 sta chrgot+3,x
- 0111 7935 ca dex
- 0112 7936 10 fb bpl wedge
- 0113 7939 ;
- 0114 7938 tabset
- 0115 7939 a2 00 ldx #0
- 0116 793a sa txa
- 0117 793b 9d 29 78 tablp sta fitab,x
- 0118 793e es inx
- 0119 793f do fa bne tablp
- 0120 7941 ;
- 0121 7941 ; setup the start address
- 0122 7941 ;
- 0123 7941 a9 80 lda #$80
- 0124 7943 85 dc sta master+1 ;high byte
- 0125 7945 oa asl a
- 0126 7946 55 88 sta master ;low byte
- 0127 7940 95 bd sta master+2 ;bank select
- 0128 794a b5 34 sta memsiz ;set memsiz to loc
- 0129 794c a9 78 lda #>loc
- 0130 794e 95 35 sta memsiz+1
- 0131 7950 60 rts
-
-
- exp-basic.src......page 0005
-
- line# loc code line
-
- 0133 7951 ;
- 0134 7951 ; this is where we come to do the work
- 0135 7951 ;
- 0136 7951 start
- 0137 7951 c9 21 cmp #'! ;look for the escape character
- 0138 7953 do 21 bne notme
- 0139 7955 20 c9 7a jsr savreg ;save the registers
- 0140 7959 ;
- 0141 7958 ; test here for quote mode etc..........
- 0142 7959 ;
- 0143 7958 20 70 00 jsr chrget ;get the next character
- 0144 795b 49 pha
- 0145 795c fo 14 beq notcmd
- 0146 795e a2 04 ldx #ncmd-1
- 0147 7960 findc ;find the command
- 0148 7960 dd 00 79 cmp cmd,x
- 0149 7963 do oa bne again
- 0150 7965 ;
- 0151 7965 ; put command address on stack
- 0152 7965 ;
- 0153 7965 68 pla ;fix the stack
- 0154 7966 ;
- 0155 7966 bd 03 7b lda tabhi,x ;fdund command...go there
- 0156 7969 49 pha
- 0157 796a bd 08 79 lda tabld,x
- 0159 7960 48 pha
- 0159 796e 60 strts rts
- 0160 796f ;
- 0161 796f again
- 0162 796f ca dex
- 0163 7970 10 ee bpl findc
- 0164 7972 ;
- 0165 7972 notcmd
- 0166 7972 20 do 7a jsr resreg
- 0167 7975 68 pla ;fix the stack
- 0168 7976 notme
- 0169 7976 c9 3a cmp #':
- 0170 7976 00 f4 bcs strts
- 0171 797a 4C 7d 00 jmp chrgot+7
-
-
- exp-dasic.src......pace 0006
-
- line* loc code line
-
- 0173 797d ;
- 0174 797d ; quit command
- 0175 7970 ;
- 0176 797d ; this command exits the memory manager
- 0177 7970 ; and restores the chrget routine
- 0178 797d ;
- 0179 797d quit
- 0180 7970 20 70 00 jsr chrget ;clean up the line
- 0181 7980 00 fb_ bne quit
- 0182 7982 a2 02 ldx #$02
- 0183 7984 rest
- 0184 7984 00 a2 d3 lda chdgot+3,x
- 0195 7907 95 79 sta chrgot+3,x
- 0196 79b9 ca dex
- 0187 799a 10 fo bpl rest
- 0189 799c 20 do 7a jsr resreg
- 0189 798f 4c 76 00 jmp chrgot
-
-
- exp-basic.src......page 0007
-
- line# loc code line
-
- 0191 7992 ;
- 0192 7992 ; load file from disk into expansion memory
- 0193 7992 ;
- 0194 7992 recal
- 0195 7992 20 d7 7a jsr getfn ;get the filename
- 0196 7995 a5 96 lda status
- 0197 7997 do 53 bne recout ;bad status
- 0199 7999 20 10 7b jsr gtype ;get the file type
- 0199 799c a5 96 lda status
- 0200 799e do 4c bne recout
- 0201 79a0 a9 52 lda #'r ;set up for file read
- 0202 79a2 9d 12 78 sta file,x
-
- 0204 79a5 ;open the file
- 0206 79a5 a9 oe lda #14 ;set the logical file number
- 0207 79a7 95 02 sta la
- 0208 79a9 09 60 ora #$60 ;set the secundmy address
- 0209 79a9 85 03 sta sa
- 0210 79ad 20 a5 f4 jsr op94 ;0pen the file
- 0211 79b0 20 38 7b jsr enter ;enter filename into table
- 0212 79b3 80 3f bcs recerr ;bad...
- 0213 79b5 ;
- 0214 7985 a5 04 lda fa
- 0215 79b7 20 02 fo jsr talk
- 0216 79da a5 03 lda sa
- 0217 79bc 20 93 fi jsr tksa
- 0218 79bf rec10
- 0219 79bf 20 co fL jsr acptr ;get a character
- 0220 79c2 78 sei ;kill the irq
- 0221 79c3 20 ae 7b jsr selbnk ;set up exp. ram
- 0222 79c6 ao 00 ldy #0
- 0223 79c9 91 bo sta (master),y
- 0224 79ca a9 00 lda #$00 ;reset the banks
- 0225 79cc bd fo ff sta $fff0
- 0226 79cf 58 cli ;restore the irq
- 0227 7900 20 c6 7b jsr incmas
- 0229 79d3 a5 96 lda status ;terminate on status <> 0
- 0229 79d5 00 04 bne rec20
- 0230 79d7 90 e6 bcc rec10 ;go do more bytes
- 0231 79d9 30 19 bcs recerr ;out of memory
- 0232 79db c9 40 rec20 cmp #64 ;eoi is ok
- 0233 79dd 00 15 bne recerr ;not eoi...
- 0234 79df 20 ae fL jsr untlk
- 0235 79e2 20 2f f7 jsr clsei ;close the file
- 0236 79e5 ao 15 ldy #21
- 0237 79e7 20 6b 7b jsr entlst ;put in the end address
- 0238 79ea a9 00 lda #0
- 0239 79ec recout
- 0240 79ec 85 96 sta status
- 0241 79ee 20 do 7a jsr resreg ;restore registers
- 0242 79f1 4c 70 00 jmp chrget ;back to basic
- 0243 79f4 ;
- 0244 79f4 recerr
- 0245 79f4 20 ae fi jsr untlk ;close the channel
-
-
- exp-basic.src...... page 0008
-
- line* loc code line
-
- 0246 79f7 20 2f f7 jsr clsei
- 0247 79fa a9 20 lda #32 ;send an error back
- 0248 79fc 00 ee bne recout
-
-
- exp-basic.src......page 0009
-
- line# loc code line
-
- 0250 79fe load
- 0251 79fe ;
- 0252 79fe ; this routine loads a file into the expansion memory
- 0253 79fe ;
- 0254 79fe 20 3a 7a jsr loader ; do the load stuff
- 0253 7a01 a6 20 ldx index1+1
- 0256 7a03 56 29 stx vartab+1
- 0257 7a05 a6 1f ldx index1
- 0258 7a07 86 2a stx vartab
- 0259 7a09 20 e9 85 jsr runc ;clear the variables
- 0260 7a0c 20 b6 84 jsr lnkprg ; link basic lines
- 0261 7a0f 4c ff b3 jmp ready ;say ready
- 0262 7a12 ;
-
-
- exp-basic.src......page 0010
-
- line* loc code line
-
- 0264 7a12 ovrly
- 0265 7a12 ;
- 0266 7a12 ; overlay an existing program (i.e. load from basic)
- 0267 7a12 ;
- 0269 7a12 20 3a 7a jsr loader ;load the file
- 0269 7a15 20 22 b6 jsr stxtpt ;pick up the first line
- 0270 7a19 ad 2a 79 lda wheret+1 ;put correct address on stack
- 0271 7a19 49 pha
- 0272 7a1c ad 29 79 lda wheret
- 0273 7a1f 48 pha
- 0274 7a20 4c 00 b6 jmp fload ;g0 run it
- 0275 7a23 ;
-
-
- exp-basic.src......page 0011
-
- line* loc code line
-
- 0277 7a23 exec
- 0279 7a23 ;
- 0279 7a23 ; load and run with a clear so variables are gone
- 0280 7a23 ;
- 0281 7a23 20 3a 7a jsr loader ;load the file
- 0292 7a26 a6 20 ldx index1+1
- 0283 7a29 96 2b stx vartab+1
- 0284 7a2a a6 1f ldx index1
- 0285 7a2c b6 2a stx vartab
- 0286 7a2e 20 e9 b5 jsr runc ;clear variables
- 0287 7a31 20 b6 84 jsr lnkprg ;link lines
- 0299 7a34 20 22 06 jsr stxtpt ;set pointer to first line
- 0289 7a37 4c 4a b7 jmp newstt ;exec it
- 0290 7a3a ;
-
-
- exp-dasic.src......page 0012
-
- line# loc code line
-
- 0292 7a3a ;
- 0293 7a3a ; routine to load files into low ram from 64k
- 0294 7a3a ;
- 0295 7a3a loader
- 0296 7a3a 20 d7 7a jsr getfn ;read the filename
- 0297 7a3d a5 96 lda status
- 0298 7a3f 00 5c bne lderr ;bad filename....
- 0299 7a41 20 7d 7b jsr lukup ;lookup the file in directory
- 0300 7a44 90 57 bcs lderr ;not found...
- 0301 7a46 ;
- 0302 7a46 98 tya ;Lndex into the dir for addres
- 0303 7a47 19 clc
- 0304 7a48 69 12 adc #18
- 0305 7a4a as tay
- 0306 7a4b 89 29 78 lda fitab,y ;start lo
- 0307 7a4e 95 21 sta index2
- 0309 7a50 cs iny
- 0309 7a51 b9 29 78 lda fitab,y ;start hi
- 0310 7a54 95 22 sta index2+1
- 0311 7a56 ;
- 0312 7a56 cs iny
- 0313 7a57 b9 29 78 lda fitab,y ;get the mapper control byte
- 0314 7a5a 95 01 sta fnlen
- 0315 7a5c ;
- 0316 7a5c cs iny
- 0317 7a5d b9 29 79 lda fitab,y ;end lo
- 0318 7a60 95 c9 sta eal
- 0319 7a62 co iny
- 0320 7a63 89 29 79 lda fitab,y ;end hi
- 0321 7a66 95 ca sta eal+1
- 0322 7a69 ;
- 0323 7a69 ; loop to load data into lo ram
- 0324 7a68 ;
- 0325 7a69 lodlp
- 0326 7a68 79 sei ;n0 irq allowed
- 0327 7a69 lodlp0
- 0328 7a69 ao 00 ldy #$0
- 0329 7a6b a6 01 ldx fnlen ;set up the banks
- 0330 7a6d do 04 bne lodlp1
- 0331 7a6f a2 80 ldx #$80 ;select 0,2
- 0332 7a71 00 02 bne stlp
- 0333 7a73 lodlp1
- 0334 7a73 a2 99 ldx #$88 ;select 1,3
- 0335 7a75 stlp
- 0336 7a75 8e fo ff stx $fff0
- 0337 7a79 ;
- 0338 7a78 ;
- 0339 7a79 b1 21 lda (index2),y ;load address lo
- 0340 7a7a 95 1f sta index1
- 0341 7a7c 20 9f 7a jsr bumpx
- 0342 7a7f ;
- 0343 7a7f 81 21 lda (index2),y ;load address hi
- 0344 7a81 95 20 sta index1+1
- 0345 7a83 20 9f 7a jsr bumpx
- 0346 7a86 ;
-
-
- exp-basic.src......page 0013
-
- line# loc code line
-
- 0347 7ab6 lodlp2
- 0349 7ab6 bi 21 lda (index2),y ;transfer a byte
- 0349 7a99 91 if sta (index1),y
- 0350 7a8a ;
- 0351 7a8a e6 1f inc index1 ;bump the destination pointer
- 0352 7a8c 00 02 bne lodlp3
- 0353 7a8e e6 20 inc index1+1
- 0354 7a90 lodlp3
- 0355 7a90 20 9f 7a jsr bumpx ;bump source pointer
- 0356 7a93 90 fi bcc lodlp2 ;done yet?
- 0357 7a95 ;
- 0359 7a95 a2 00 ldx #0 ;restore the rom's
- 0359 7a97 8e fo ff stx $fff0
- 0360 7a9a 58 cli ;we are done let irq go
- 0361 7a98 18 clc
- 0362 7a9c 60 rts
- 0363 7a9d lderr ;load error
- 0364 7a9d 38 sec
- 0365 7a9e 60 rts
- 0366 7a9f ;
- 0367 7a9f ;subroutine to handle data pointers to expansion mem
- 0369 7a9f ;
- 0369 7a9f bumpx
- 0370 7a9f e6 21 inc index2
- 0371 7aai do of bne tstxx
- 0372 7aa3 e6 22 inc index2+1
- 0373 7aa5 do ob bne tstxx
- 0374 7aa7 a2 90 ldx #$80 ;crossed over to other block
- 0375 7aa9 96 01 stx fnlen
- 0376 7aab 96 22 stx index2+1
- 0377 7aad a9 b8 lda #%10111000
- 0373 7aaf bd fo ff sta $fff0
- 0379 7ab2 tstxx ;check for end of file
- 0380 7ab2 a6 c9 ldx eal
- 0381 7ab4 e4 21 cpx index2
- 0382 7ab6 do 08 bne donex
- 0393 7ab9 a6 ca ldx eal+1
- 0384 7a9a e4 22 cpx index2+1
- 0385 7abc do 02 bne donex
- 0396 7abe 38 sec ;done with load
- 0387 7abf 60 rts
- 0389 7aco donex
- 0389 7aco 18 clc
- 0390 7ac1 60 rts
- 0391 7ac2 ;
-
-
- exp-dasic.src......page 0014
-
- line# loc code line
-
- 0393 7ac2 ;
- 0394 7ac2 ;increment pointer to text
- 0395 7ac2 ;
- 0396 7ac2 incptr
- 0397 7ac2 e6 77 inc getptr
- 0399 7ac4 do 02 bne incrts
- 0399 7ac6 e6 79 inc getptr+1
- 0400 7acs incrts
- 0401 7acs 60 rts
- 0402 7ac9 ;
- 0403 7ac9 ;save and restore routines for .a, .x, .y
- 0404 7ac9 ;
- 0405 7ac9 savreg
- 0406 7ac9 85 83 sta wsw
- 0407 7aco 86 84 stx t1
- 0409 7acd 84 b5 sty t2
- 0409 7acf 60 rts
- 0410 7ado ;
- 0411 7a00 resreg
- 0412 7ado a5 b3 lda wsw
- 0413 7ad2 a6 84 ldx t1
- 0414 7ad4 a4 85 ldy t2
- 0415 7ad6 60 rts
-
-
- exp-basic.src......page 0015
-
- line# loc code line
-
- 0417 7ad7 ;
- 0419 7ad7 ; get filename from user command
- 0419 7ad7 ;
- 0420 7ad7 getfn
- 0421 7ad7 20 70 00 jsr chrget
- 0422 7ada fo 57 beg badfi ;not there error
- 0423 7adc c9 22 cmp #'" ;look for open quote
- 0424 7ade 00 f7 bne getfn
- 0423 7aeg ;
- 0426 7aeo a9 00 lda #0
- 0427 7ae2 85 96 sta status
- 0428 7ae4 aa tax
- 0429 7ae5 ab tay
- 0430 7ae6 a9 12 lda #<file
- 0431 7ae9 95 da sta fnaddr
- 0432 7aea a9 78 lda #>file
- 0433 7aec 95 db sta fnaddr+1
- 0434 7aee floop
- 0435 7aee 20 c2 7a jsr incptr
- 0436 7af1 bi 77 lda (getptr),y
- 0437 7af3 c9 22 cmp #'" ;look for end quote
- 0439 7af5 fo oa beq endfi
- 0439 7af7 90 12 78 sta file,x
- 0440 7afa es inx
- 0441 7afb eo 12 cpx #L8
- 0442 7afo 90 ef bcc floop ;g0 get more
- 0443 7aff 80 32 bcs badfi ;too long
- 0444 7b01 endfi
- 0445 7b01 96 01 stx fnlen ;save length (index)
- 0446 7b03 a9 00 lda #0 ;pad filename wih $00 on right
- 0447 7b05 eo 12 fi1o cpx #18
- 0449 7b07 bo 06 bcs endfia
- 0449 7b09 90 12 78 sta file,x
- 0450 7b0c es inx
- 0451 7b00 do f6 bne fi1o
- 0452 7b0f endfia
- 0453 7b0f 60 rts
- 0454 7b10 ;
- 0455 7b10 ; get the file type
- 0456 7b10 ;
- 0457 7b10 gtype
- 0458 7b10 gcomma
- 0459 7b10 20 70 00 jsr chrget
- 0460 7b13 fo Le beq badfi ;not enough info.....
- 0461 7b15 c9 2c cmp #',
- 0462 7b17 do f7 bne gcomma
- 0463 7b19 a6 01 ldx fnlen ;get the current filename length
- 0464 7b1b 9d 12 79 sta file.x
- 0465 7bie 9d 14 78 sta file+2,x ;put comma here also
- 0466 7b21 20 70 00 jsr chrget ;get type byte (s,u,p,r)
- 0467 7b24 fo 00 beq badfi
- 0468 7b26 es inx
- 0469 7b27 9d 12 78 sta file,x ;no value check is done!'!
- 0470 7b2a es inx ;skip to put in the read or wr
- 0471 7b2b es inx ;but do not put in here
-
-
- exp-dasic.src......page 0016
-
- line# loc code line
-
- 0472 7b2c 96 di stx fnlen
- 0473 7b2e ;
- 0474 7b2e ; put in the device number check later*************
- 0475 7b2e ; for now default to 9 unly
- 0476 7b2e ;
- 0477 782e a9 09 lda #8
- 0478 7930 95 04 sta fa
- 0479 7b32 60 rts
- 0490 7b33 ;
- 0481 7b33 badfi
- 0482 7b33 a9 01 lda #$01
- 0483 7b35 95 96 sta status
- 0484 7b37 60 rts
- 0485 7b38 ;
- 0486 7b38 ; enter file into table
- 0487 7b39 ; put in load address and set status in carry
- 0489 7b38 ;
- 0489 7b38 enter
- 0490 7b38 20 7d 7b jsr lukup ;look for file in table
- 0491 7b3b 90 3e bcc badent ; dup found...
- 0492 7b3d ;
- 0493 7b3d ; look for blank entry
- 0494 783d ;
- 0495 793d ao eL ldy #entmax
- 0496 7b3f empty
- 0497 7b3f b9 29 78 lda fitab,y
- 0498 7b42 fo 09 beg empfnd
- 0499 7b44 99 tya
- 0500 7b45 38 sec
- 0501 7b46 e9 19 sbc #entry
- 0502 7b48 as tay
- 0503 7b49 do f4 bne empty
- 0504 7b48 fo 2e beq badent
- 0505 7b4d ;
- 0506 7b4d empfnd ;f0und an entry
- 0507 7b4d 99 tya ;point index1 to entry
- 0509 7b4e 19 clc
- 0509 784f 69 29 adc #<fitab
- 0510 7b51 b5 1f sta index1
- 0511 7b53 a9 79 lda #>fitab
- 0512 7b55 69 00 adc #0
- 0513 7b57 85 20 sta index1+1
- 0514 7b59 ;
- 0515 7b59 ;place entry into dir
- 0516 7859 ;
- 0517 7b59 ao 00 ldy #0
- 0519 7b5b entmor
- 0519 7b59 89 12 78 lda file,y
- 0520 7b5e c9 2c cmp #', ;only put in drive and name
- 0521 7b60 fo 07 beq entfst
- 0522 7b62 91 1f sta (index1),y
- 0523 7b64 c8 iny
- 0524 7b65 co 12 cpy #18
- 0525 7b67 90 f2 bcc entmor
- 0526 7b69 ;
-
-
- exp-basic.src......page 0017
-
- line# loc code line
-
- 0527 7b69 entfst
- 0529 7b69 ao 12 ldy #18
- 0529 7b6b ;
- 0530 7b6b entlst ;enter end address
- 0531 7b6b a5 bb lda master ;save the load address
- 0532 7b6d 91 lf sta (index1),y
- 0533 7b6f co iny
- 0534 7b70 a5 bc lda master+1
- 0535 7b72 91 1f sta (index1),y
- 0536 7b74 co iny ;put in the bank control byte
- 0537 7b75 a5 be lda master+3
- 053b 7b77 91 1f sta (index1),y
- 0539 7b79 ib clc
- 0540 7b7a 60 rts ;come here for bad exit
- 0541 7b7b badent
- 0542 7b7b 38 sec
- 0543 7b7c 60 rts
- 0544 7b70 ;
- 0545 7b7d ; lookup file in directory
- 0546 7b7d ;
- 0547 7b7d lukup
- 0549 787d ao eL ldy #entmax
- 0549 7b7f luk10
- 0550 7b7f b9 29 78 lda fitab,y
- 0551 7db2 do 09 bne lukcmp
- 0552 7b94 luk20
- 0553 7b94 99 tya ;m0ve to next file
- 0554 7095 38 sec
- 0555 7b96 e9 19 sbc #entry
- 0556 7b89 as tay
- 0557 7b89 do f4 bne luk10
- 0558 7bb9 fo if beq notfnd
- 0559 7b9d ;
- 0560 7bod lukcmp
- 0561 7b9d 84 06 sty t3 ;save .y while doing the compare
- 0562 7b8f a2 00 ldx #0
- 0563 7b91 luk30
- 0564 7b91 bd 12 78 lda file,x
- 0565 7b94 c9 2c cmp #', ;comma means done
- 0566 7b96 fo ob beq found
- 0567 7b99 09 29 7b cmp fitab,y
- 0568 7b9b do oa bne trymor
- 0569 7b9d cs iny
- 0570 7b9e e8 inx
- 0571 7b9f eo 12 cpx #18
- 0572 7ba1 90 ee bcc luk30
- 0573 7da3 ;
- 0574 7ba3 found ;i found it
- 0575 7ba3 a4 b6 ldy t3 ;.y points to file
- 0576 7ba5 is clc
- 0577 7ba6 60 rts
- 0579 7ba7 trymor ;i am trying to find it
- 0579 7ba7 a4 b6 ldy t3
- 0580 7ba9 4c 84 7b jmp luk20
- 0581 7dac notfnd ;i lost it
-
-
- exp-basic.src......page 0018
-
- line# loc code line
-
- 0592 7bac 38 sec
- 0583 7bad 60 rts
- 0584 7bae ;
- 0595 7bae ;this routine turns on the proper bank
- 05b6 7bae ;
- 0587 7bae selbnk
- 058A 78ae a6 bd ldx master+2
- 0589 7db0 do 06 bne sel10
- 0590 70b2 a2 80 ldx #$80 ;turn on banks 0 and 2
- 0591 7bb4 se fo ff stx $fff0
- 0592 7bd7 60 rts
- 0593 7899 sel10
- 0594 7bbb a2 88 ldx #$88 ;turn on banks 1 and 3
- 0595 7bba se fo ff stx $fff0
- 0596 7bbd a6 bd ldx master+2 ;one byte has the $40 flag
- 0597 7bbf 70 04 bvs sel30
- 0599 7bci a2 90 ldx #$80
- 0599 7bc3 86 bd stx master+2
- 0600 7bc5 sel30
- 0601 7bc5 60 rts
- 0602 7bc6 ;
- 0603 7bc6 ; bump up the master pointer and set the $40 flag
- 0604 7bc6 ;
- 0605 7bc6 incmas
- 0606 7bc6 e6 08 inc master ;bump pointers
- 0607 7bcb do 10 bne masrts
- 0609 7bca e6 bc inc master+1
- 0609 78cc do oc bne masrts ;check for overflow of bank
- 0610 7bce a6 bd ldx master+2 ;we went over
- 0611 7bd0 do oa bne inc10 ;out of memdry?
- 0612 7bd2 a2 40 ldx #$40 ;set flag for overflow
- 0613 7bd4 96 dd stx master+2
- 0614 7bd6 a2 90 ldx #$80 ;reset pointer hi
- 0615 7bds 86 bc stx master+1
- 0616 7dda masrts
- 0617 7bda 18 clc
- 0619 7bdb 60 rts ;out of memory
- 0619 7bdc inc10
- 0620 7bdc 38 sec
- 0621 7bdd 60 rts
- 0622 7bde ;
- 0623 72de ;
- 0624 78de ;these must be after the definition
- 0625 7bde ;
- 0626 7bde zz1 =recal-1 ;recall from disk
- 0627 7bde zz3 =load-1 ;load low memory from expansion
- 0629 7bde zz4 =ovrly-1 ;overlay program in memory
- 0629 7bde zz5 =exec-1 ;execute without overlay
- 0630 7bde zz8 =quit-1 ;exit program.
- 0631 7bde .end
-
- errors = 0000
-
-
- symbol table
-
- symbol value
- acptr f1c0 again 796f badent 7b7b badfi 7b33
- bumpx 7a9f chdgot d39f chrget 0070 chrgot 0076
- clrch ffcc clsei f72f cmd 7900 donex 7aco
- ds 0013 eal 00c9 empfnd 7b4d empty 7b3f
- endfi 7b01 endfia 7b0f enter 7b39 entfst 7b69
- entlst 7b6b entmax 00e1 entmor 7b5b entry 0019
- exec 7a23 fa 00d4 fclose f2e2 fi10 7b05
- file 7812 findc 7960 fitab 7829 fload b6ob
- floop 7aee fnaddr ooda fnlen 0001 found 7ba3
- gcomma 7810 getfn 7ad7 getptr 0077 gooo 792e
- gtype 7810 inc10 7bdc incmas 78c6 incptr 7ac2
- incrts 7ac8 index1 001f index2 0021 jump 792b
- la 00d2 lderr 7a9d lnkprg b4b6 load 79fe
- loader 7a3a loc 7800 lodlp 7a6b lodlp0 7a69
- lodlp1 7a73 lodlp2 7a86 lodlp3 7a90 luk10 7b7f
- luk20 7b84 luk30 7b91 lukcmp 7b9d lukup 7b7d
- masrts 7bda master oobb memsiz 0034 ncmd 0005
- newstt b74a notcmd 7972 notfnd 7bac notme 7976
- op94 f4a5 ovrly 7a12 quit 7970 ready b3ff
- rec10 79bf rec20 79db recal 7992 recerr 79f4
- recout 79ec resreg 7ado rest 7984 runc b5e9
- sa 0003 savreg 7ac9 sel10 79b9 sel30 7bc5
- selbnk 7bae start 7951 status 0096 stlp 7a75
- strts 796e stxtpt b622 t1 00b4 t2 00b5
- t3 00b6 tabhi 7803 tablo 7809 tablp 793b
- tabset 7938 talk f0d2 tksa fL93 trymor 7ba7
- tstxx 7ab2 untlk f1ae vartab 002a wedge 7930
- wheret 7929 wsw 00b3 zz1 7991 zz3 79fd
- zz4 7a11 zz5 7a22 zz8 797c
- end of assembly
-
-
- expanded-basic
-
- 100 rem******************************
- 110 rem* expanded basic demo *
- 120 rem* *
- 130 rem* boot expanded basic *
- 140 rem* and then cache demo program*
- 150 rem******************************
- 160 if a then sys 7*16^3+8*256
- 170 if a then:!r,"sttest",p:!e,"sttest"
- 180 a=1:dload "expanded-basic"
-
-
- sttest
-
- 10 rem demo for memory manager
- 20 rem first we must get the stuff into memory
- 30 :!r,"test1",p
- 40 :!r,"test2",p
- 50 :!r,"test3",p
- 60 :!r,"test4",p
- 70 rem execute the first program in the chain
- 80 :!e,"test1"
-
-
- test1
-
- 10 rem this is a test
- 15 print"<clr>test1":fori=1to200:next
- 17 print"print the numbers from 1 to 20"
- 19 fori=1to200:next
- 20 fori=1to20
- 30 print,i
- 40 next
- 50 :!e,"test2"
-
-
- test2
-
- 10 rem this is a test
- 15 print"<clr>test2":fori=1to200:next
- 17 print"print the numbers from 20 to 1"
- 19 fori=1to200:next
- 20 fori=20 to 1 step -1
- 30 print,i
- 40 next
- 50 :!e,"test3"
-
-
- test3
-
- 10 rem this is a test
- 15 print"<clr>test3":fori=1to200:next
- 17 print"print the numbers from 51 to 70"
- 18 print"along with the square-root
- 19 fori=1to200:next
- 20 fori=51to70
- 30 print,i,sqr(i)
- 40 next
- 50 :!e,"test4"
-
-
- test4
-
- 10 rem this is a test
- 15 print"<clr>test4":fori=1to200:next
- 17 print"you have seen the system load and"
- 18 print"execute three programs from the
- 20 print"expansion memory. if you look at
- 30 print"the files with the word 'test' in them
- 40 print"you will see how this is done
- 45 print"<dwn><dwn><dwn>type <rev>space<off> to continue or <rev>q<off> to quit"
- 50 geta$:ifa$=""then50
- 60 ifa$="q"then:!q:end
- 65 ifa$=" "then:!e,"test1"
- 70 ifa$="2"then:!e,"test2"
- 80 ifa$="3"then:!e,"test3"
-
-
-