A bit help with MSX2 memory map in Basic / Turbo Basic

Page 1/2
| 2

By AxelStone

Prophet (3189)

AxelStone's picture

20-01-2015, 11:59

Hi everybody, I'm reading a bit about memory map on MSX2 (http://fms.komkon.org/MSX/Handbook/th-1.txt) and I'm not sure to understand at all. I've seen that MSX uses slots of 64Kb, each of them with 4x16Kb pages. Well I'm using Basic / Turbo Basic and I'd like to access the complete memory map of a standar 128Kb MSX2 computer.

Someone can summarize with small examples how to access all RAM to store data in Basic? This is, how to select slot / page, load data into it and them recover the data stored. I'm not sure how to do the slot / page selection and what pages are "safe" when using Turbo Basic.

Thanks!

Login or register to post comments

By kanima

Master (194)

kanima's picture

20-01-2015, 13:47

I'd say your easiest bet is probably to use NestorBASIC, which is essentially Turbo Basic with many extras, amongst which is support for accessing all available memory.

By AxelStone

Prophet (3189)

AxelStone's picture

20-01-2015, 14:42

Yes but it occupies 51Kb, really I don't need to much memory filled to use only this feature. I've tthought about it, but If only I could manage memory by myself, I could save a lot of memory Wink

By Daemos

Paragon (2044)

Daemos's picture

20-01-2015, 15:28

Do I understand you correctly that you want all the 64Kb of RAM available for your program?

By AxelStone

Prophet (3189)

AxelStone's picture

20-01-2015, 18:56

Daemos wrote:

Do I understand you correctly that you want all the 64Kb of RAM available for your program?

Yeah, except the space occupied by Nestor itself, but I don't know what pages are available in a standar 128Kb MSX2.

By Daemos

Paragon (2044)

Daemos's picture

20-01-2015, 19:20

As far as I can see it goes like this but I do not know the exact details for nextor. Only on plain basic.

normally when the system boots page0 contains the BIOS page 1 and 2 are undefined and page 3 has RAM. If no cartridges floppy disks etc are inserted the system sets page 1 to ROM (which contains basic) page 2 to RAM and Page 3 remains largely unchanged with the exception that some helper routines are copied in and the workarea for basic and BIOS. They are below lets say $FE00 your basic listing starts at $8000 so the more program you type the less free memory you have for your program to run Tongue

So basicly. You can never have page0 and 1 free in basic. Nestor places itself in page1? I guess.
BIOS is left intact for sure.

By Manuel

Ascended (19270)

Manuel's picture

20-01-2015, 20:04

AxelStone: what do you need all that RAM for?

By jltursan

Prophet (2619)

jltursan's picture

20-01-2015, 20:06

Mmm, NestorBasic is not that big!. Suposedly it only wastes 500 bytes of the BASIC main memory and its fully contained in its own RAM segment. So, when using Kun Basic and NestorBasic, the memory is mostly used by Kun.

Btw, here's a nice NB article (I've follow the suggestion in Grauw's MAP ;-)): NestorTIPS for NestorBASIC

EDIT: I've just seen that Manuel already pointed out this article...:-)

By Imanok

Paragon (1198)

Imanok's picture

20-01-2015, 23:20

AxelStone wrote:
Daemos wrote:

Do I understand you correctly that you want all the 64Kb of RAM available for your program?

Yeah, except the space occupied by Nestor itself, but I don't know what pages are available in a standar 128Kb MSX2.

Just load Nestorbasic in an MSX2 with 128kb and execute function #1. It will return the available 16kb ram segments at P(0)

By AxelStone

Prophet (3189)

AxelStone's picture

21-01-2015, 12:53

Imanok wrote:
AxelStone wrote:
Daemos wrote:

Do I understand you correctly that you want all the 64Kb of RAM available for your program?

Yeah, except the space occupied by Nestor itself, but I don't know what pages are available in a standar 128Kb MSX2.

Just load Nestorbasic in an MSX2 with 128kb and execute function #1. It will return the available 16kb ram segments at P(0)

Yeah it returns 8, this is available segments not free segments, right? I don't want to overwrite memory used by nestor itself, kun basic, bios routines...

Manuel wrote:

AxelStone: what do you need all that RAM for?

Basically for store data of the program to be read and not fill the shorts 23kb allowed by Basic program. Similar to use POKE to send data, including graphic tiles.

By ericb59

Paragon (1098)

ericb59's picture

21-01-2015, 13:06

On standard MSX2 128K and Nestor basic
If you don"t use the Moonblaster Replayer, Memory Segments 5,6, and 7 are free.
So 3x16K= 48K
Also there are some bytes available in segment 4.

Page 1/2
| 2