Forums

Notifications
Clear all

RAM MSX

5 posts
2 users
1 Reactions
1,536 views
Posts: 12
Members of the MSX ITA Association
Topic starter
(@daniele)
Eminent Member
Joined: 3 years ago

Hi everyone,

How can I find out the available RAM on MSX?

I mean in the SLOT system and not MEMORY MAPPER.

I would like to include memory detection in the next version of my compiler and was looking for some ready-made code or something similar.

 


4 Replies
thegeps
Posts: 12
Members of the MSX ITA Association
(@thegeps)
Active Member
Joined: 3 years ago

Do you mean the MSX's base RAM, with no possible expansions added but only in its internal slots?

You select the slots one by one and the pages one by one. Each time you write a sequence of say 32 characters in the first 32 bytes of the selected page in that slot. After writing the sequence, you read it and see if you actually find it. If you find it, it means that in that page of that slot you have RAM installed.

Then add 16K to your "amount of RAM" value and move on to the next page. After trying all four slots you will have in the "amount of RAM" variable the exact amount of RAM available. If I remember correctly there is a ready-to-use asm routine on the msx resource center wiki, which however checks all slots, even the external ones

 


Reply
3 Replies
Members of the MSX ITA Association
(@daniele)
Joined: 3 years ago

Eminent Member
Posts: 12

@thegeps Thank you so much, I had something similar in mind but now that you explained it to me I understand better.

I tried it and it works when I use slot 3.

Why does it crash when I read/write in the other slots (0-2) with the RDSLT(#000C) and WRSLT (#0014) functions?

 


Reply
thegeps
Members of the MSX ITA Association
(@thegeps)
Joined: 3 years ago

Active Member
Posts: 12

@daniele RDSLT and WRTSLT disable interrupts BUT do not re-enable them, so after CALL RDSLT and CALL WRYSLT you should put an EI to reset the interrupts. This could be the reason.


Reply
Members of the MSX ITA Association
(@daniele)
Joined: 3 years ago

Eminent Member
Posts: 12

@thegeps Oh ok thanks a lot.

But I saw that it only crashes when I set the address in HL greater than or equal to 0C000h and the slot contains ROM


Reply
Share: