Using the highest memory address

Página 1/2
| 2

Por Bit Addict

Resident (34)

Imagen del Bit Addict

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 sesión o register para postear comentarios

Por DarkSchneider

Paladin (944)

Imagen del DarkSchneider

22-05-2016, 10:36

I think is defined by SP.

Por gdx

Enlighted (5503)

Imagen del gdx

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).

Por hit9918

Prophet (2923)

Imagen del hit9918

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.

Por gdx

Enlighted (5503)

Imagen del gdx

23-05-2016, 10:08

Por Metalion

Paragon (1509)

Imagen del Metalion

23-05-2016, 10:33

Nice, gdx.
Marked for future reference.

Por santiontanon

Paragon (1636)

Imagen del santiontanon

23-05-2016, 20:26

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

Por Metalion

Paragon (1509)

Imagen del Metalion

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.

Por santiontanon

Paragon (1636)

Imagen del santiontanon

24-05-2016, 02:52

Oh! I see! makes sense Smile

Por Daemos

Paragon (1964)

Imagen del Daemos

24-05-2016, 10:42

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

Por DarkSchneider

Paladin (944)

Imagen del DarkSchneider

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.

Página 1/2
| 2