How do you make use of INTs? (Development MSX Fora)MSX Resource Center MSXdev 2008 - MSX1 development bonanza!           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 134 gasten en 0 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - How do you make use of INTs?

Ga naar pagina ( Vorige pagina 1 | 2 )
Schrijver

How do you make use of INTs?

jltursan
msx professional
Berichten: 830
Geplaatst: 14 Juli 2006, 09:53   
About IM2 mode, from the Thomas Scherrer Z80 FAQ :

Quote:

Mode 2: Is the most powerful, in that it allows for an indirect call to
any location in memory. With this mode the CPU forms a 16-bit memory address
where the upper 8-bits are the content of register I and the lower 8-bits
are supplied by the interrupting device. This address points to the first of
two sequential bytes in a table where the address of the service routine is
located. The CPU automatically obtains the starting address and performs a
CALL to this address. The RETI is also used to return to the main programm.



The ugly thing is that in common Z80 machines, the LSB (the one that comes from the device) never has a constant value; so you can't predict the value of the built jumping address (256 different addresses). The only solution is to set up a vector table whith 257 identical values, say $C1 for example, and then you'll be sure that when we get the interrupt address, it will be always $C1C1.

As you can see it's only a bit more work (and 257 bytes free less). The advantage is the total control of the CPU.
tokumaru
msx lover
Berichten: 83
Geplaatst: 14 Juli 2006, 16:17   
Oh I get it now. So register I combined with a the lower byte from the device points to the address of the interrupt routine... This must be specially useful on machines with more than 1 interrupt!

For some reason I just assumed that the MSX didn't have a IM2 mode (just as it doesn't use NMI's), but it turns out you just have to waste a bunch of memory to make sure it'll jump to the correct place. Thanks a bunch jltursan!
NYYRIKKI
msx master
Berichten: 1500
Geplaatst: 14 Juli 2006, 22:00   
If you are more interested about working of databus, you may want to check out this program, that I wrote for monitoring it:
http://www.msx.org/forumtopic3816.html

Alex
msx lover
Berichten: 90
Geplaatst: 15 Juli 2006, 14:44   
Quote:

Oh I get it now. So register I combined with a the lower byte from the device points to the address of the interrupt routine... This must be specially useful on machines with more than 1 interrupt!

For some reason I just assumed that the MSX didn't have a IM2 mode (just as it doesn't use NMI's), but it turns out you just have to waste a bunch of memory to make sure it'll jump to the correct place. Thanks a bunch jltursan!



As far as I know, MSX always contains pull-up resistors on the data bus. It means that the Z80 will read the value 0xFF for the high-part of the pointer as there is no device to put any other value on the bus.

tokumaru
msx lover
Berichten: 83
Geplaatst: 15 Juli 2006, 18:33   
In the thread that NYYRIKKI posted above, some MSX models will have random values. Or didn't I get what you just said? =)
 
Ga naar pagina ( Vorige pagina 1 | 2 )
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.