Tyrann listing

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...
Post Reply
User avatar
maximus
Flying Officer
Posts: 193
Joined: Thu Feb 23, 2006 7:45 pm
Location: Nimes, France

Tyrann listing

Post by maximus » Sun Jan 26, 2014 11:11 am

Hi all
I'm studying this Basic listing,
The first line is Gosub 10 000

Can someone understand and explain this first instruction ?

Code: Select all

10000 REM **** ATMOS OU ORIC-1 ? **** 
10010 IFPEEK(#C001)=#CCTHEN15000   
10020 DOKE#B000,#E6CA
10030 DOKE#B002,#E804
10040 DOKE#B004,621  
10050 DOKE#B006,623
10055 DOKE#B008,#F42D
10100 RETURN  
15000 REM
15005 DOKE#B000,#E76A
15010 DOKE#B002,#E93D
15020 DOKE#B004,634
15030 DOKE#B006,638
15035 DOKE#B008,#F88F
15100 RETURN
the entire file is available for download
Attachments
FaceA-Prog1.zip
the first prog of the tape
(2.15 KiB) Downloaded 178 times

User avatar
Symoon
Archivist
Posts: 1169
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France
Contact:

Re: Tyrann listing

Post by Symoon » Sun Jan 26, 2014 11:34 am

The 1st instruction is a test to know if it's a ROM 1.0 or ROM 1.1 (it's the first byte that differs between the two ROMs).
#CC means ROM 1.1

You can consider that any test of a value in ROM (any address >= #C000) is to deetermine the type of ROM, as these values can't be changed by the user. Unless of course you are using the overlay RAM (which can't be done without an extension like disk drives).

EDIt: just realised you certainly needed an explanation for the whole code - sorry !

User avatar
Dbug
Site Admin
Posts: 2384
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Tyrann listing

Post by Dbug » Sun Jan 26, 2014 1:13 pm

It's just a way to define a number of routines that will work on both the ATMOS and Oric 1.
Here are the values for the Atmos:
15005 DOKE#B000,#E76A - Set 6522 for cassette system
15010 DOKE#B002,#E93D - Reset cassette status
15020 DOKE#B004,634 - 27A - Address of first line of screen
15030 DOKE#B006,638 - 27E - Number of lines of text on screen
15035 DOKE#B008,#F88F - Reset ORIC

User avatar
maximus
Flying Officer
Posts: 193
Joined: Thu Feb 23, 2006 7:45 pm
Location: Nimes, France

Re: Tyrann listing

Post by maximus » Sun Jan 26, 2014 3:46 pm

Thanks gods :D

if i understand, it means you must put than for any program to be sure have compatibility oric-1/atmos

so i can put it at the end of program, with the Gosub in the 1st instruction ?

User avatar
peacer
Flight Lieutenant
Posts: 351
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: Tyrann listing

Post by peacer » Sun Jan 26, 2014 4:20 pm

I think its not an universal code for every program to run in both roms.

It only modifies parameters located in #B000 - #B009 adresses. Probably tyrann machine code routine reads these memory locations to run explained rom routines when needed.

User avatar
Dbug
Site Admin
Posts: 2384
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Tyrann listing

Post by Dbug » Sun Jan 26, 2014 4:26 pm

You only need to do that if you manually call the ROM.
If you just use the normal BASIC functions you should not have to do that.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests