Using the highest memory address

Страница 1/2
| 2

By Bit Addict

Resident (34)

Аватар пользователя 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

By DarkSchneider

Paladin (944)

Аватар пользователя DarkSchneider

22-05-2016, 10:36

I think is defined by SP.

By gdx

Enlighted (5996)

Аватар пользователя 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).

By hit9918

Prophet (2926)

Аватар пользователя 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.

By gdx

Enlighted (5996)

Аватар пользователя gdx

23-05-2016, 10:08

By Metalion

Paragon (1616)

Аватар пользователя Metalion

23-05-2016, 10:33

Nice, gdx.
Marked for future reference.

By santiontanon

Paragon (1734)

Аватар пользователя santiontanon

23-05-2016, 20:26

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

By Metalion

Paragon (1616)

Аватар пользователя 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.

By santiontanon

Paragon (1734)

Аватар пользователя santiontanon

24-05-2016, 02:52

Oh! I see! makes sense Smile

By Daemos

Paragon (2021)

Аватар пользователя Daemos

24-05-2016, 10:42

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

By DarkSchneider

Paladin (944)

Аватар пользователя 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.

Страница 1/2
| 2