Autor
| usable memory in assembly
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 01 2005, 02:19   |
High !!
Im using Wbass2 and allway starting my programm at &hC000
but which part of the memory can I freely use without getting in trouble?
(could I also start my program at lets say &hE000, or &h8000 ?????)
|
|
flyguille msx master Mensajes: 1225 | Publicado: Mayo 01 2005, 02:32   |
well, you can start your program where you want.
we can define two areas
BEFORE your basic program.
AFTER your basic program..
how to set a place AFTER your program?...
CLEAR n, addr
where n is the ammount in bytes reserved for string's variables. And addr, define the last byte used for basic.
So:
CLEAR 200, &HDFFF
you can store your assembler code on &HE000 or later.
How to know where ends the area for your assembler code... normaly up to &HF000 is safe... i not know how to knows exactly the last address usable.
well, about storing your assebler code before the basic....
there is the POKE , that you already knows...
you can use from &H8000 up to where your basic program is -1.
|
|
Chardson msx lover Mensajes: 93 | Publicado: Mayo 01 2005, 03:21   |
It depends how much RAM the targeted machine have. Basicaly, never start before 04000h, cause it is the bios page space. For machines with 16kb, you must start at least on 0C000h. Try not using spaces after 0EFFFh, cause this is the system area, but with some study of the system usage of this space, you can use it without interfering/interference.
If it is a DOS program, start at 0100h.
Last, if you plan on using any kind of mapped memory (MegaROM, Mapper or any other), it is best to start at 0C000h, because you won`t want to flip the system page, thus making this place ideal for controling the program and let the other pages for subroutines, string, GFX, music or whatever more your program may use.
In short, it is very recommended to always begin at 0C000h, unless it is a MSX-DOS software.
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Mayo 01 2005, 03:30   |
Quote:
| High !!
Im using Wbass2 and allway starting my programm at &hC000
but which part of the memory can I freely use without getting in trouble?
(could I also start my program at lets say &hE000, or &h8000 ?????)
|
In WB-ASS2 you can't go much higher than $D800 with your program. (i.e. it has to END before that address) Since the source is stored in the $8000- address range and you'll easily need the whole page that's not an option either. So generally, yeah, start your programs at $C000. If you have an exceptionally large project, you can use WB-ASS2's PAGE function to put a different bank on for instance page 2. This way, you can have WB assemble the code on a different bank than the one the source is stored in. When you use GO to test your code, it'll automatically switch to the bank you specified with the PAGE command.
PAGE will list the current PAGE/SLOT/BANK settings... the first number is the page number, 0-3. The second two numbers are primary and secondary slots, here you'll see the slot numbers of your mapper you can use to change the bank later. The last number is the bank currently selected. By default WB-ASS2 uses bank 1 to store the source. If you change this bank to for instance bank 3, first free bank, you can have the source in bank 1 while the assembled code ends up in bank 3. This way you can have your program start at $8000, without overwriting the source code. Then a simple GO $8000 still does the trick, since WB will do the appropriate bank-switch. With PAGE /I you can reset the settings to their default. Oh, and don't change the settings for page 3  |
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Mayo 01 2005, 03:33   |
So, if you were using a Turbo-R, and you wanted to assemble a source to address $8000 in WB, you'd do a PAGE 2,3,0,3 to make sure the program is assembled to address $8000 (page 2) of slot 3-0 (main RAM) into bank 3 (first free memory bank). Just in case  |
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 01 2005, 11:50   |
B.S.!
in Wbass2 you can code on ANY address, every where. just set them right PAGES will ya (aka. page 1,p,s,3 will set mapper 3 on page 1. p&s being prim and sec slots ofcourse)
how 'bout this (assuming slots prim=3 and sec=1)
page 0,3,1,2
page 1,3,1,3
page 2,3,1,4
Now you'll have 3x16k + himem (#c000-#e000 aprox) to store s'm code in!
But remember that Wbass will store the source code in page 2 and page 3 where page 3 will be the HIMEM just as you applic. So starting code on #c000 is ok untill your source code exceeds page 2 (#8000-#bfff)!
So best practise: start your code on #4000 (you can use a whole 32k of ram to for your code! namely page 1 and 2!)
Hey and if you're a punk; use page 0 aswell! (no need to use that crappy BIOS eh)
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Mayo 01 2005, 14:46   |
Uhm, ro, he codes in a BASIC environment. He needs both the BIOS and the BASIC roms active in order for his program to work. Apart from that, it clearly says for instance page 2, it doesn't say you can only change page 2.
|
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 01 2005, 16:35   |
Where did ya get that info toob? I ain't seeing no BASIC mentioned in his post...
It's the Flyman that starts mentioning BASIC stuff... why? dunno!
ps. the B.S. was for the "better start at #c000" .. thaz pure crap. I recommend NOT starting code there... (even if ya where using BASIC)
|
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 01 2005, 16:37   |
good thing guyver ain't here... this would surely lead to another WAR haha (well, I kinda miss those days anyway.. ALL YOUR GUYVER ARE BELONG TO US!)
|
|
flyguille msx master Mensajes: 1225 | Publicado: Mayo 01 2005, 20:30   |
UHH!! ohh!, i misread all!...
|
|
flyguille msx master Mensajes: 1225 | Publicado: Mayo 01 2005, 20:32   |
anyway, HOW TO KNOW which is the last address available for a assembler program/data being used the space AFTER the basic's program.
AND I WILL NOT ACEPT ANSWER LIKES "in my msx it is &HF37F or &HF14x"...
|
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 02 2005, 08:41   |
BASIC? dude, cut the crap. NO MORE BASIC  |
|
AuroraMSX
 msx master Mensajes: 1262 | Publicado: Mayo 02 2005, 11:39   |
Quote:
| anyway, HOW TO KNOW which is the last address available for a assembler program/data being used the space AFTER the basic's program.
AND I WILL NOT ACEPT ANSWER LIKES "in my msx it is &HF37F or &HF14x"...
|
How about: "It depends on your machine"
[From the top of my head, with no docs at hand - forgive me if I'm wrong  ]
There's a system variable named STKTOP which gives you the address of the stack top. All system vars, I/O buffers and stuff like that is located above this address, the stack (as you might expect) sits below this address.
So, I'd say (STKTOP) is the ab-so-lute last address available, but you need to reserve some space (say 1/2 K or so) for the stack. The real value of STKTOP depends on the machine, the number of disks connected, other cartridges claiming memory, the weather etc.
|
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 03 2005, 00:57   |
Can I also use the vdp memory to store data?
simple example:
I use screen 5, so the vdp area for screen 8 I dont use......
can I then store simple variables in the vdp memory?
|
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 03 2005, 01:01   |
Quote:
| Uhm, ro, he codes in a BASIC environment. He needs both the BIOS and the BASIC roms active in order for his program to work. Apart from that, it clearly says for instance page 2, it doesn't say you can only change page 2.
|
interesting, what other environments are there to use?
and whats bad about programming in a BASIC environment? |
|
|
|
|