Using the highest memory address

Page 1/2
| 2

By Bit Addict

Resident (34)

Bit Addict's picture

22-05-2016, 10:01

What is the highest memory address an assembly program can safely use?

At address F197 the DPB (Drive Parameter Block) starts. Is it safe to use memory below F197?

Login or register to post comments

By DarkSchneider

Paragon (1030)

DarkSchneider's picture

22-05-2016, 10:36

I think is defined by SP.

By gdx

Enlighted (6431)

gdx's picture

22-05-2016, 11:20

System variable "MEMSIZ" (at 0F672h).
The Drive Parameter Blocks are not in a fixed area. To know the DPB of each drive see the "DPBLIST" (at 0F353h ~ 0F363h).

By hit9918

Prophet (2932)

hit9918's picture

22-05-2016, 19:27

yes it is not ld hl,address but ld hl,(variable).
it is variable dependant on disk drives.
the highest one is HIMEM.
ld hl,(0xfc4a)
dec hl
thats the top byte you can use.
and the stackpointer goes somewhere below, need to reload it to be sure.

By gdx

Enlighted (6431)

gdx's picture

23-05-2016, 10:08

By Metalion

Paragon (1628)

Metalion's picture

23-05-2016, 10:33

Nice, gdx.
Marked for future reference.

By santiontanon

Paragon (1831)

santiontanon's picture

23-05-2016, 20:26

Nice figure! How come "BOTTOM" has a higher value than "MEMSIZ" given it's above?

By Metalion

Paragon (1628)

Metalion's picture

23-05-2016, 21:29

santiontanon wrote:

Nice figure! How come "BOTTOM" has a higher value than "MEMSIZ" given it's above?

"(address)" means the value stored at that address.
So "BOTTOM (0FCh48h)" means that the BOTTOM address is stored at 0FC48h.

By santiontanon

Paragon (1831)

santiontanon's picture

24-05-2016, 02:52

Oh! I see! makes sense Smile

By Daemos

Prophet (2169)

Daemos's picture

24-05-2016, 10:42

@Gdx. That image is so nice that it should be added to the WIKI.

By DarkSchneider

Paragon (1030)

DarkSchneider's picture

24-05-2016, 11:04

Hi, according to the MSX technical handbook, MEMSIZ is:

Quote:

MEMSIZ (F672H, 2)
contents: highest address of memory used by BASIC

So maybe is not what you want if your environment is not BASIC. The map can vary if you use binary (ASM) program, with 4000-7fffh available (in that picture is shown as used by BASIC interpreter), or DOS, with also 100-3fffh available.

But, concerning the question, MEMSIZ could not have the highest one to use if not using BASIC. It would be good if someone knows about this.

Page 1/2
| 2