- set my own ROM at page 0 (48kbROM setup) (using BIOS calls)
ROM or RAM, but don't use BIOS calls. (BIOS calls are on page 0, so changeing page 0... not a good idea while you execute code there...)
Is that right? Or not? Or could I use the EXX command?
Of course I need to save more registers
It depends... If you use only HL, BC, DE and AF in <my code I want to run on int> then this is fine... Even EX AF,AF' & EXX might do the trick for you, if you are absolutely sure that these shadow registers can be changed any time in you main code without it being crashed.
Interrupts are not magic. Interrut is simply RST #38 (=CALL #38) that can happen any time in your code inside EI / DI block... Same rules apply as with any subroutine, but you want to make sure that registers you are working with don't suddenly have values returned from interrupt handler call.
Thanks! I only use BIOS calls to set my ROM at page 0. Then I never use it again.
I'm a bit busy with real life right now and the thing I was developing is on hold until I have some inspiration again
Interrupts are not magic. Interrut is simply RST #38 (=CALL #38) that can happen any time in your code inside EI / DI block... Same rules apply as with any subroutine, but you want to make sure that registers you are working with don't suddenly have values returned from interrupt handler call.
Nothing magic. At least if you do not forget to read register 0 (in a,(0x99))
Working like a charm now.
Yes... You need to tell to device causing interrupt to lower the interrupt line otherways the interrupt routine will be executed immediately again when you enable the interrupts.
sorry for my interruption, but what is an interrupt?
Interrupt is a way to inform Z80, that something interesting is going on outside of it... For example UART of RS-232 interface or MIDI interface can tell that it received a byte... or MSX-Audio can tell that it has finished playing a sample... or something like this.
In MSX1 usually only device causing interrupts is VDP that tells to Z80 that "Hey, I've finished drawing picture to screen" ... this happens 50 or 60 times in a second.
Normally MSX-BIOS handles this interrupt and uses it to calculate time, check keyboard status etc. Other devices always need interrupt handler to be inserted, if they want to use interrupts. Otherways they will cause infinite loop when interrupt handler does not know how to tell that interrupt has been received.
In MSX2 VDP is a bit more advanced and can be programmed to cause interrups on other situations as well... Like "Hey, I've finished drawing line 128 to screen"... This is what is usually used to cause effect called "screen split"
sorry for my interruption, but what is an interrupt?
You must be kidding. Right?
Assembly learning step 1 - Z80 architecture.
Assembly learning step 1 - Z80 architecture.
Sure in school, but I don't agree that this should be the first step... way too boring stuff... It will come naturally after you have written your first programs...
The first thing to do in asm and any other language is Hello World!
Hmm, doing a simple sum, like a=1; b=5; a=a+b; store_it_in_ram, is much much easier than Hello World in asm.
Anyway, I agree with NYYRIKKI, just start what you want to start with, this isn't school.