home *** CD-ROM | disk | FTP | other *** search
- 1000 rem save"0:directory 64.pal",8
- 1010 rem * by eric germain ste-foy, quebec
- 1020 open 8,8,1,"0:directory 64.obj"
- 1030 sys700
- 1040 .opt o8
- 1050 *=$c000
- 1060 ;
- 1070 status = $90 ; file status variable
- 1080 return = $aad3 ; send chr$(13)
- 1090 fixflt = $b391 ; fixed-float conversion
- 1100 shwflt = $bdd7 ; print floating point value
- 1110 acptr = $ffa5 ; input byte from serial port
- 1120 ciout = $ffa8 ; output byte to serial port
- 1130 listen = $ffb1 ; set listen
- 1140 second = $ff93 ; send sa after listen
- 1150 talk = $ffb4 ; set talk
- 1160 tksa = $ff96 ; send sa after talk
- 1170 unlsn = $ffae ; command bus to unlisten
- 1180 untlk = $ffab ; command bus to untalk
- 1190 chrout = $ffd2 ; output character
- 1200 stop = $ffe1 ; test (stop) key
- 1210 ;
- 1220 ; ** directory read demo **
- 1230 ;
- 1240 lda #8 ; device number
- 1250 jsr listen ; and secondary address
- 1260 lda #$f0 ; 'or'ed with $f0
- 1270 jsr second ; to indicate a file to be opened
- 1280 lda #"$" ; "$0"
- 1290 jsr ciout ; sent as filename
- 1300 lda #"0" ; one character at a time
- 1310 jsr ciout
- 1320 jsr unlsn ; stop listening
- 1330 lda #8 ; device number
- 1340 jsr talk ; and secondary address
- 1350 lda #$60 ; 'or'ed with $60
- 1360 jsr tksa ; to indicate normal i/o operation
- 1370 lda #0 ; set status word
- 1380 sta status ; to zero
- 1390 jsr acptr ; get two dummies
- 1400 jsr acptr
- 1410 jsr return ; print carriage return
- 1420 ;
- 1430 main = *
- 1440 jsr acptr ; get two dummies
- 1450 jsr acptr
- 1460 jsr acptr ; line number (low/high)
- 1470 tay
- 1480 jsr acptr
- 1490 ldx status ; check status
- 1500 bne fini ; exit on error
- 1510 ;
- 1520 jsr fixflt ; put line number in fpacc#1
- 1530 ldy #1 ; print line number
- 1540 jsr shwflt ; (which is the block count)
- 1550 lda #32 ; print a space
- 1560 jsr chrout
- 1570 ;
- 1580 loop = *
- 1590 jsr acptr ; get character
- 1600 php
- 1610 jsr chrout ; print it
- 1620 plp
- 1630 bne loop ; if non-zero then continue
- 1640 ;
- 1650 jsr return ; print carriage return
- 1660 jsr stop ; check stop key
- 1670 bne main
- 1680 ;
- 1690 fini = *
- 1700 jsr untlk ; un-talk
- 1710 lda #8
- 1720 jsr listen
- 1730 lda #$e0 ; the secondary address
- 1740 jsr second ; is 'or'ed with $e0
- 1750 jsr unlsn ; to indicate a file to be closed
- 1760 rts ; return to basic
-