cataloguing tapes

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
kaydav
Officer Cadet
Posts: 37
Joined: Tue Aug 27, 2019 9:20 am

cataloguing tapes

Post by kaydav »

Does Oric/Atmos have any kind of command or utility that will catalogue a tape? The BBC Micro had an inbuilt command *CAT that would list the names of the programs on the tape. I have a bunch of user-made C60s and C90s that I want to verify the contents of, and it would help a lot to be able to do this.

I'm fairly sure Oric-1 didn't have a *CAT type of command inbuilt, but did Atmos? Or did anyone release software that would essentially do the same job?
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: cataloguing tapes

Post by Dbug »

There definitely was a software doing that, it's what I used to print these lists in

I believe it was a type-in program from the magazine Theoric.
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: cataloguing tapes

Post by Chema »

That was a really nice video Dbug!

You were ordered and meticulous indeed :)

I remember when I was looking for a home computer. I had the ZX Spectrum on mind, though back then, the games were quite primitive. I had a crush somewhat for the Atari, but it was too expensive. I saw a C64 too, but it did not look very nice and was also very expensive, its Basic was terrible, and I only tried a couple of horrible games. Yeah, I got the wrong impression :)

In the end, it was my father who came with an Oric-1 as a surprise. Nobody had one, and the lack of games back then sent me down the programming alley :twisted:

Sorry for hijacking the thread. I just loved the video.
User avatar
mikeb
Flight Lieutenant
Posts: 282
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: cataloguing tapes

Post by mikeb »

I recall an article in Oric Computing, headlined something like "Has anybody seen my cat?" which had a listing for this ... let me find it...

Ah yes, Issue 2, page 4. If you don't have the magazine, click below

http://www.defence-force.org/computing/ ... /index.htm

It's machine code/assembler.
User avatar
Steve M
Squad Leader
Posts: 787
Joined: Fri Mar 24, 2006 3:33 am
Location: Cumbria, UK
Contact:

Re: cataloguing tapes

Post by Steve M »

There was a program in the PD list that sent a catalogue to the printer. Tapecat.

There's one called Casscat. A Basic program, so you can list it.

I think there are others.
There's a copy of Lcat7 from Théoric on Rhetoric disk 5, which has Casscat too.
Attachments
CASSCAT.tap
(1.86 KiB) Downloaded 305 times
User avatar
kaydav
Officer Cadet
Posts: 37
Joined: Tue Aug 27, 2019 9:20 am

Re: cataloguing tapes

Post by kaydav »

Many thanks all!

I've had a go with CassCat and Lcat7 but so far haven't managed to get them to work for me. CassCat hangs at the point where you play the tape and TRON gets you to line 240 (in Oricutron, not tried on real Oric). LcatK7 says "break on byte #1302", but I don't know what it means or how to fix it.
Steve M wrote: Wed Sep 11, 2019 6:55 pm There was a program in the PD list that sent a catalogue to the printer. Tapecat.
Where would I find this PD list? EDIT: I found it! And it looks like it works! Thank you :)

I'll have a look at the listings in Théoric and Oric Computing and see if I can muddle my way through the machine code. Back in the day I was fine in BASIC but my brain did an "undefined statement" error every time it was presented with machine code :lol: Do you just type that stuff in as it is printed in the magazine? Or go via an assembler?

Loved the video, dBug! I was about 12 when my parents bought our Oric so I wasn't really involved in how they decided which one to go for. My dad had access to computers at school though, he brought home a Commodore PET and a ZX81 (with RAM pack!) for a short while each, I think to prepare classwork on, and we were able to have a go. The PET would crash when it ran out of memory, about 5 lines of BASIC was its max. I think they liked the proper keyboard of the Oric vs the keyword keys of the ZX computers. We always felt the Oric was a better computer but less well supported and marketed than the Spectrum. It's lovely to see some of our old programs and games come back to life off these tapes!
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: cataloguing tapes

Post by iss »

IMHO casscat and lcat7 are better choice.
With full respect to mikeb's good memories ;) here is OCR-error-free source from Oric Computing in XA assembler:

Code: Select all

L_9700  LDA    $9C             ; 9700  A59C      
        LDY    $9D             ; 9702  A49D      
        STA    $00             ; 9704  8500      
        STY    $01             ; 9706  8401      
        PHP                    ; 9708  08        
        JSR    $E725           ; 9709  2025E7    
        JSR    $E6CA           ; 970C  20CAE6    
        JSR    $9723           ; 970F  202397    
        JSR    $E804           ; 9712  2004E8    
        PLP                    ; 9715  28        
        LDX    $00             ; 9716  A600      
        LDA    $01             ; 9718  A501      
        STA    $90             ; 971A  8590      
        STX    $9C             ; 971C  869C      
        PLA                    ; 971E  68        
        PLA                    ; 971F  68        
        JMP    $C96B           ; 9720  4C6BC9    
        JSR    $E563           ; 9723  2063E5    
        LDA    #$6E            ; 9726  A96E      
        LDY    #$97            ; 9728  A097      
        JSR    $E576           ; 972A  2076E5    
        JSR    $E696           ; 972D  2096E6    
        JSR    $E630           ; 9730  2030E6    
        CMP    #$24            ; 9733  C924      
        BNE    $9730           ; 9735  D0F9      
        LDX    #$09            ; 9737  A209      
        JSR    $E630           ; 9739  2030E6    
        STA    $50,X           ; 973C  9550      
        DEX                    ; 973E  CA        
        BNE    $9739           ; 973F  D0F8      
        JSR    $E630           ; 9741  2030E6    
        BEQ    $974E           ; 9744  F008      
        STA    $49,X           ; 9746  9549      
        STA    $9781,X         ; 9748  9D8197    
        INX                    ; 974B  E8        
        BNE    $9741           ; 974C  D0F3      
        STA    $49,X           ; 974E  9549      
        STA    $9781,X         ; 9750  9D8197    
        JSR    $E6F0           ; 9753  20F0E6    
        TXA                    ; 9756  8A        
        BNE    $975D           ; 9757  D004      
        JSR    $E4D8           ; 9759  20D8E4    
        RTS                    ; 975C  60        
        LDA    #$81            ; 975D  A981      
        LDY    #$97            ; 975F  A097      
        JSR    $CBED           ; 9761  20EDCB    
        LDA    #$70            ; 9764  A970      
        LDY    #$97            ; 9766  A097      
        JSR    $CBED           ; 9768  20EDCB    
        JMP    $972D           ; 976B  4C2D97    

L_976E .BYT  $10,$07,$43,$41,$54,$41,$4C,$4F,$47,$55,$45,$20,$2E,$2E,$00
L_9770 .BYT  $0D,$0A,$0A,$00
L_9781 .BYT  $33,$2D,$44,$20,$50,$4C,$4F,$54,$00
L_978A .BYT  $5E,$A0,$97,$20,$76,$E5,$20,$C4,$10,$07,$56,$65,$72,$69,$66,$79,$69,$6E,$67
Important: it's only Oric-1 compatible!
User avatar
mikeb
Flight Lieutenant
Posts: 282
Joined: Wed Sep 05, 2018 8:03 pm
Location: West Midlands, UK
Contact:

Re: cataloguing tapes

Post by mikeb »

kaydav wrote: Thu Sep 12, 2019 7:11 pm my brain did an "undefined statement" error every time it was presented with machine code :lol: Do you just type that stuff in as it is printed in the magazine? Or go via an assembler?
For most simple stuff like this, unless you have an @iss around to type it up for you :) , you'd cobble together a BASIC loader to poke the raw bytes into memory, something like :-

10 FOR A = #9700 TO #9900
20 READ D
30 POKE A,D
40 NEXT
50 DATA #A5, #9C, #A4, #9D etc. etc.

Run that, then CSAVE "WHATEVER", A#9700, E#9900 to save the data block.

OCR errors aside (if it's from the Oric Computing source I think it's from, OCR errors are quite likely because the dotmatrix print quality is already so-so, the OCR used is not the sharpest, and I gave up all hope of ever getting it to take on board my suggestions, even though manual correction and learning is theoretically possible ...) you had to make sure you typed every byte exactly right!
User avatar
kaydav
Officer Cadet
Posts: 37
Joined: Tue Aug 27, 2019 9:20 am

Re: cataloguing tapes

Post by kaydav »

mikeb wrote: Fri Sep 13, 2019 4:46 pm For most simple stuff like this, unless you have an @iss around to type it up for you :) , you'd cobble together a BASIC loader to poke the raw bytes into memory, something like :-

10 FOR A = #9700 TO #9900
20 READ D
30 POKE A,D
40 NEXT
50 DATA #A5, #9C, #A4, #9D etc. etc.

Run that, then CSAVE "WHATEVER", A#9700, E#9900 to save the data block.
Aha! suddenly it makes sense :) We used to use POKE all the time and I understood it to be a way of getting a value into an address in memory. But nobody said a machine code program is practically built of POKEs. I notice that for 9700, the corresponding value is A59C, so I guess they go in pairs? 9700 would have A5, 9701 has 9C? And I take it none of the addresses in the block get missed out?
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: cataloguing tapes

Post by Dbug »

kaydav wrote: Fri Sep 13, 2019 9:22 pm I notice that for 9700, the corresponding value is A59C, so I guess they go in pairs? 9700 would have A5, 9701 has 9C? And I take it none of the addresses in the block get missed out?
Not necessarily in pairs, in the 6502 instructions can occupy one, two or three bytes.

In this case, A5 9C maps to "LDA $9C" which means "LoaD the Accumulator register with whatever you find in memory at the zero page address $9C", but if you look down the code, there is "#08" which is just the one byte value for the "PHP" instruction (PusH P).

The whole thing is very logical, and also very easy to get wrong: Since it's just a bunch of bytes, if you get one wrong, you either make the CPU use the wrong instruction, or the wrong address, and a particular value only has a meaning in a particular context, for example A5 A5 would just be "LDA $A5" (Load A with what is at the address $A5 in zero page).

You can see more opcodes there:
http://6502.org/tutorials/6502opcodes.html
User avatar
kaydav
Officer Cadet
Posts: 37
Joined: Tue Aug 27, 2019 9:20 am

Re: cataloguing tapes

Post by kaydav »

iss wrote: Thu Sep 12, 2019 8:30 pm here is OCR-error-free source from Oric Computing in XA assembler:

Code: Select all

L_9700  LDA    $9C             ; 9700  A59C      
        LDY    $9D             ; 9702  A49D      
        STA    $00             ; 9704  8500      
        STY    $01             ; 9706  8401      
        PHP                    ; 9708  08        
        JSR    $E725           ; 9709  2025E7    
        JSR    $E6CA           ; 970C  20CAE6    
        JSR    $9723           ; 970F  202397    
        JSR    $E804           ; 9712  2004E8    
        PLP                    ; 9715  28        
        LDX    $00             ; 9716  A600      
        LDA    $01             ; 9718  A501      
        STA    $90             ; 971A  8590      
        STX    $9C             ; 971C  869C      
        PLA                    ; 971E  68        
        PLA                    ; 971F  68        
        JMP    $C96B           ; 9720  4C6BC9    
        JSR    $E563           ; 9723  2063E5    
        LDA    #$6E            ; 9726  A96E      
        LDY    #$97            ; 9728  A097      
        JSR    $E576           ; 972A  2076E5    
        JSR    $E696           ; 972D  2096E6    
        JSR    $E630           ; 9730  2030E6    
        CMP    #$24            ; 9733  C924      
        BNE    $9730           ; 9735  D0F9      
        LDX    #$09            ; 9737  A209      
        JSR    $E630           ; 9739  2030E6    
        STA    $50,X           ; 973C  9550      
        DEX                    ; 973E  CA        
        BNE    $9739           ; 973F  D0F8      
        JSR    $E630           ; 9741  2030E6    
        BEQ    $974E           ; 9744  F008      
        STA    $49,X           ; 9746  9549      
        STA    $9781,X         ; 9748  9D8197    
        INX                    ; 974B  E8        
        BNE    $9741           ; 974C  D0F3      
        STA    $49,X           ; 974E  9549      
        STA    $9781,X         ; 9750  9D8197    
        JSR    $E6F0           ; 9753  20F0E6    
        TXA                    ; 9756  8A        
        BNE    $975D           ; 9757  D004      
        JSR    $E4D8           ; 9759  20D8E4    
        RTS                    ; 975C  60        
        LDA    #$81            ; 975D  A981      
        LDY    #$97            ; 975F  A097      
        JSR    $CBED           ; 9761  20EDCB    
        LDA    #$70            ; 9764  A970      
        LDY    #$97            ; 9766  A097      
        JSR    $CBED           ; 9768  20EDCB    
        JMP    $972D           ; 976B  4C2D97    

L_976E .BYT  $10,$07,$43,$41,$54,$41,$4C,$4F,$47,$55,$45,$20,$2E,$2E,$00
L_9770 .BYT  $0D,$0A,$0A,$00
L_9781 .BYT  $33,$2D,$44,$20,$50,$4C,$4F,$54,$00
L_978A .BYT  $5E,$A0,$97,$20,$76,$E5,$20,$C4,$10,$07,$56,$65,$72,$69,$66,$79,$69,$6E,$67
Important: it's only Oric-1 compatible!
Iss, thank you very much for doing this! I don't really know what I'm doing but I went to the OSDK and used XA on a text file (isscat.txt) of this code. Is command-line xa isscat.txt -o isscat.s -e errorlog.txt correct usage? I got this as errorlog.txt output:
Cross-Assembler 65xx V2.2.5 (12:35:32 / Apr 6 2019)
(c) 1989-98 by A.Fachat
65816 opcodes and modes coded by Jolse Maginnis
Oric C adaptation and debugging by Mickael Pointier
Clean Linux port by Jean-Yves Lamoureux

BNE $9730
isscat.txt(25): 1037:Branch out of range error
BNE $9739
isscat.txt(30): 1041:Branch out of range error
BEQ $974E
isscat.txt(32): 1046:Branch out of range error
BNE $9741
isscat.txt(36): 104e:Branch out of range error
BNE $975D
isscat.txt(41): 1059:Branch out of range error
christian
Pilot Officer
Posts: 96
Joined: Sun Nov 24, 2013 9:58 pm

Re: cataloguing tapes

Post by christian »

The default start address for the .text segment is $1000.
So, the program is assembled at $1000, and BNE $9730 is out of range.

You must set the start address with the -bt option: xa isscat.txt -o isscat.s -e errorlog.txt -bt 38656

Note: 38656 = $9700
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: cataloguing tapes

Post by iss »

+1 @christian !

Just for the record: you can set the start address from inside the assembler source too inserting this as first line:

Code: Select all

        * = $9700
L_9700  LDA    $9C             ; 9700  A59C
.......
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: cataloguing tapes

Post by iss »

Well, I played a bit and here is really working basic source:

Code: Select all

10 HIMEM#96FF:CLS:PAPER0:INK7
20 FOR A = #9700 TO #9700+130-1:READ D:POKE A,D:NEXT
30 DOKE #2F5,#9700:!" "
40 END
50 REM LM 
51 DATA #A5,#9C,#A4,#9D,#85,#00,#84,#01,#08,#20,#25,#E7,#20,#CA,#E6,#20
52 DATA #23,#97,#20,#04,#E8,#28,#A6,#00,#A5,#01,#85,#90,#86,#9C,#68,#68
53 DATA #4C,#6B,#C9,#20,#63,#E5,#A9,#6E,#A0,#97,#20,#76,#E5,#20,#96,#E6
54 DATA #20,#30,#E6,#C9,#24,#D0,#F9,#A2,#09,#20,#30,#E6,#95,#50,#CA,#D0
55 DATA #F8,#20,#30,#E6,#F0,#08,#95,#49,#9D,#81,#97,#E8,#D0,#F3,#95,#49
56 DATA #9D,#81,#97,#20,#F0,#E6,#8A,#D0,#04,#20,#D8,#E4,#60,#A9,#81,#A0
57 DATA #97,#20,#ED,#CB,#A9,#7D,#A0,#97,#20,#ED,#CB,#4C,#2D,#97,#10,#07
58 DATA #43,#41,#54,#41,#4C,#4F,#47,#55,#45,#20,#2E,#2E,#00,#0D,#0A,#00
59 DATA #00,#00
It's catbas.txt in the attached ZIP-file together with the asm-source and ready to use catbas.tap file.
For Oricutron, under Linux, I'm using:

Code: Select all

./oricutron -m1 --turbotape off catbas.tap
catbas.png
Attachments
cat.v2.zip
(1.84 KiB) Downloaded 296 times
User avatar
kaydav
Officer Cadet
Posts: 37
Joined: Tue Aug 27, 2019 9:20 am

Re: cataloguing tapes

Post by kaydav »

iss wrote: Sat Sep 14, 2019 11:15 am Well, I played a bit and
It's catbas.txt in the attached ZIP-file together with the asm-source and ready to use catbas.tap file.
For Oricutron, under Linux, I'm using:

Code: Select all

./oricutron -m1 --turbotape off catbas.tap
That's fantastic, Iss, it works perfectly :D Thank you so much! I now have a screenshot of output from one of my old tapes:
catbas output.jpg
Post Reply