I was wondering what is the 1st instruction exectuded in ROM when the Oric boots? Is it on #C000 ? I tried to change the ROM in Euphoric by doing a JMP#C000 in C000, but everything booted normally.
1st instruction on boot ?
Re: 1st instruction on boot ?
I don't understand, you mean "Where is the first instruction ?"Symoon wrote:I was wondering what is the 1st instruction exectuded in ROM when the Oric boots? Is it on #C000 ? I tried to change the ROM in Euphoric by doing a JMP#C000 in C000, but everything booted normally.
6502 starts at NMI vectors (ie $fffa).
If you want to do a ROM here is the code i use to do my own ROM in an EEPROM :
Xa syntax :
Code: Select all
*=$c000
_start
rts
_end_rom
.dsb $ffff-_end_rom-5,0
; NMI
*=$fffa
.byt <_start
.byt >_start
; RESET
*=$fffc
.byt <_start
.byt >_start
; IRQ
*=$FFFE
.byt <_start
.byt >_start
Well I wanted to know the 1st instruction read by the Oric, in other words the 1st adress the Oric reads in ROM when it boots.
You're right, the idea was to know how to make my own ROM: if I want to make it, I'll have to start my code somewhere
Thanks, seems #FFFA works, I just made an infinite loop there (JMP#FFFA) and the Oric hangs when I boots, so it seems good!
Thanks for your code sadly I don't understand it. I have never learnt to code in assembler, I directly code op-codes in hexadecimal (yes, I know ). I don't know "XA", from what I've already read in this forum I guess it's a way to code in assembler?
You're right, the idea was to know how to make my own ROM: if I want to make it, I'll have to start my code somewhere
Thanks, seems #FFFA works, I just made an infinite loop there (JMP#FFFA) and the Oric hangs when I boots, so it seems good!
Thanks for your code sadly I don't understand it. I have never learnt to code in assembler, I directly code op-codes in hexadecimal (yes, I know ). I don't know "XA", from what I've already read in this forum I guess it's a way to code in assembler?
You can download xa, (osdk). You put my code in a txt file, and in command line :Symoon wrote:Well I wanted to know the 1st instruction read by the Oric, in other words the 1st adress the Oric reads in ROM when it boots.
You're right, the idea was to know how to make my own ROM: if I want to make it, I'll have to start my code somewhere
Thanks, seems #FFFA works, I just made an infinite loop there (JMP#FFFA) and the Oric hangs when I boots, so it seems good!
Thanks for your code sadly I don't understand it. I have never learnt to code in assembler, I directly code op-codes in hexadecimal (yes, I know ). I don't know "XA", from what I've already read in this forum I guess it's a way to code in assembler?
xa MYFILE.ASM
You will have a a.o65, you can rename it to toto.rom and it will work in any emulator.
Don't forget to clean video RAM when you do your own rom, and don't forget to put a charset in your rom (and copy it in charset address)
-
- Flying Officer
- Posts: 148
- Joined: Fri Oct 12, 2007 8:08 pm
it's not that simple,
get yourself a manual for the 6502 cpu.
there are 3 vectors,
fffa
fffc
and fffe
one is reset - aka the startup address, the others are IRQ & NMI
if you arent carefull the interupts will crash your code.
the first instruction should be $78 if i remember right,
to block interupts from pulling the cpu out of your code loop.
you can re-enable them once your ready.
get yourself a manual for the 6502 cpu.
there are 3 vectors,
fffa
fffc
and fffe
one is reset - aka the startup address, the others are IRQ & NMI
if you arent carefull the interupts will crash your code.
the first instruction should be $78 if i remember right,
to block interupts from pulling the cpu out of your code loop.
you can re-enable them once your ready.
-
- Squad Leader
- Posts: 774
- Joined: Sat May 21, 2011 7:21 pm
- Location: Between UK and France
- Contact:
No you're wrong,Symoon wrote:Well I wanted to know the 1st instruction read by the Oric, in other words the 1st adress the Oric reads in ROM when it boots.
You're right, the idea was to know how to make my own ROM: if I want to make it, I'll have to start my code somewhere
Thanks, seems #FFFA works, I just made an infinite loop there (JMP#FFFA) and the Oric hangs when I boots, so it seems good!
Thanks for your code sadly I don't understand it. I have never learnt to code in assembler, I directly code op-codes in hexadecimal (yes, I know ). I don't know "XA", from what I've already read in this forum I guess it's a way to code in assembler?
the 6502 when it reset read the two bytes at #FFFC and #FFFD, they will give it the start function address, i.e. i will do at start a
jmp ($FFFC)
so to make a rom, you need to decide a start address for your code, and change the value at $FFFC/D to point on your start address.
Don't hesitate to ask me in French in you want, it could be easier to explain sometimes
Hello.
(the same in french)
Le 6502 demarre en lisant l adresse contenue en FFFC et FFFD, le contenu de ses deux adresses est l' adresse de la première instruction du programme qui initialise la machine. La mise sous tension de la machine équivaut a un saut indirect absolu. (les deux octets de l'adresse intermédiaire qui indique l'adresse finale).
Si tu crée une ROM fait attention de bien inhiber les deux autres vecteurs d interruption, sinon ton programme risque de planter.
(the same in french)
Le 6502 demarre en lisant l adresse contenue en FFFC et FFFD, le contenu de ses deux adresses est l' adresse de la première instruction du programme qui initialise la machine. La mise sous tension de la machine équivaut a un saut indirect absolu. (les deux octets de l'adresse intermédiaire qui indique l'adresse finale).
Si tu crée une ROM fait attention de bien inhiber les deux autres vecteurs d interruption, sinon ton programme risque de planter.
Re: 1st instruction on boot ?
Can you connect a ROM on the expansionport somehow? Many other computers used games on cartridges, did Oric ever have those?
The Microdisc ROM works like this in a way, doesn't it?
The Microdisc ROM works like this in a way, doesn't it?
-
- Flying Officer
- Posts: 148
- Joined: Fri Oct 12, 2007 8:08 pm
Re: 1st instruction on boot ?
easy,
just map it to the adreess you want and use /ROMDIS to disable the internal rom.
better yet,
use a ferro-ram or battery-backed ram,
set it so the romdis signal and the /OE signal on the ram can be fliped on & off.
then you can power your oric & do something like.
for a = $c000 to $ffff
x = peek a
poke a,x
next
for something like that - not used basic in decades!
that should copy your internal rom to your external device.
then change the jumper/switch and your running from it.
then you can patch it on the fly.
just map it to the adreess you want and use /ROMDIS to disable the internal rom.
better yet,
use a ferro-ram or battery-backed ram,
set it so the romdis signal and the /OE signal on the ram can be fliped on & off.
then you can power your oric & do something like.
for a = $c000 to $ffff
x = peek a
poke a,x
next
for something like that - not used basic in decades!
that should copy your internal rom to your external device.
then change the jumper/switch and your running from it.
then you can patch it on the fly.