Msx bios call questions (Development Fórums MSX)MSX Resource Center            
                    
English Nederlands Espa�ol Portugu�s Russian              
 Notícias
   Página principal
  Arquivo de notícias
  Tópicos de notícias

 Recursos
   Fórums MSX
  Artigos
  Reviews
  Reportes de feiras
  Fotografias
  Feiras e encontros
  Enquetes
  Links
  Procurar

 Software
   Downloads
  Web-Loja

 MRC
   Quem somos nós
  Entre para nosso time
  Doações
  Políticas
  Contate-nos
  Faça um Link para nós
  Estatísticas

 Procurar
 
  

  

 Login
 

Nome do Usuário

Senha




Você ainda não tem uma conta? Torne-se um amigo-MSX e registre uma conta agora!


 Estatísticas
 

Existem 44 convidados e 1 Amigo do MSX online

Você é um usuário anônimo.
 

Fórums MSX


Fórums MSX

Development - Msx bios call questions

Autor

Msx bios call questions

nikodr
msx addict
Posts: 491
Postado em: 03 Outubro 2008, 17:52   
I have several questions regarding the use of some bios routines,i want to experiment with the bios routines.I just can't understand the use of some of those.

From the site http://map.tni.nl i found several intersting articles.

Now what is the use of bios routine #0138
RSLREG
Address : #0138
Function : Reads the primary slot register
Output : A - for the value which was read
33221100
||||||- Pagina 0 (#0000-#3FFF)
||||--- Pagina 1 (#4000-#7FFF)
||----- Pagina 2 (#8000-#BFFF)
------- Pagina 3 (#C000-#FFFF)
Registers: A

I have seen that in some konami megaroms when the game begins it has something like

Startaddress of rom: DI
call #0138
RRCA
RRCA
and #03
LD C,A
LD B,#00
etc etc (and thing is that most of those games have the same code there).

Why is it that after the call of the 138 there is that RRCA instrucion that rotates the result?
[D-Tail]

msx guru
Posts: 3019
Postado em: 03 Outubro 2008, 18:41   
This piece of code filters out bits 2 and 3 of the A register, previously filled with the slot selection. The code probably wants to know what is mapped in page 1. The RRCA is used twice to shift/rotate the contents of the A register twice, such that bits 2-3 come on positions 0-1. The AND 3 filters this to a clean result, namely the contents of bits 0-1.
[D-Tail]

msx guru
Posts: 3019
Postado em: 03 Outubro 2008, 18:42   
So eventually, the C register contains the slot number mapped to page 1
 
 







(c) 1994 - 2008 Fundação MSX Resource Center. MSX é uma marca registrada da MSX Licensing Corporation.