Autor
| usable memory in assembly
|
Chardson msx lover Mensajes: 93 | Publicado: Mayo 03 2005, 05:27   |
Quote:
|
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)
|
Why is that B.S.? Give me arguments. Stating it this way is easy and newbies might see you as a "ultra-r4x0r" programmer maintainer of the truth.
I always tell people to start at 0C000h because this way they can program for every MSX machine, most of then won`t use even 4Kb of code and if needed, a simple "jp 4000h" will give them this 'indispensable' memory. |
|
Maggoo msx professional Mensajes: 591 | Publicado: Mayo 03 2005, 06:33   |
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 using register SP (address of the stack) to figure that out ? That's usually what I do. The highest address you can use is:
(SP)-xx where xx is the number of bytes you might need for your stack (push/pop/calls...). |
|
AuroraMSX
 msx master Mensajes: 1262 | Publicado: Mayo 03 2005, 08:59   |
Quote:
| Can I also use the vdp memory to store data?
|
Well, not the VDP itself, but you could use the VRAM (Video RAM), of course. 
Main disadvantage is that it's not directly accessible from the Z80 -- you need to copy data back and forth between normal RAM and VRAM through the VDP's I/O ports...
Quote:
|
simple example:
I use screen 5, so the vdp area for screen 8 I dont use......
|
Ehm, I'm not quite sure what you mean.
Screen 5 and screen 8 both use VRAM. The same VRAM. Only because of the screen characteristics, screen 5 manages to have 4 video pages, whereas screen 8 can handle only 2. But it's still the same 128kB of VRAM.
Quote:
| can I then store simple variables in the vdp memory?
|
I would recommend against that. As said: you need to access the VRAM through the VDPs I/O ports and compared to accessing normal RAM, that's slow. Dead slow. |
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 03 2005, 09:55   |
ofcourse it ain't no shame to start your code at #c000 if yer makin' some little dittie. I do that too.
But remember that WBASS2, like at stated earlier, might use that space too to store your sourcecode (if that source code exceeds the 16k limit).
Starting your code at #4000 for example will ensure you to have a full 16k memmap available. 16k of data that can be used. While using a MEMORY MANAGER (like dos 2, memman, f-kernel etc) that space will be SAVED while executing other programms (that is if you reserve a piece of mem and don't de-alloc)
Using BASIC and code is, well, stupid. Why use BASIC when you got all that asmlines ready for take off? why use BASIC, as a catalysator? I mean if you're purely using BASIC to start your code in screen 5 for example. why not set screen in your asm rout and GO #4000 and reset screen afterwards (well, wbass does it for you but it's a clean solution)
I won't say #c000 or alike is BAD, not at all. but it's a good habit not to use it incase your code and source exceeds the limits. than you'll have to rearange again...
about the screens and VRAM data.
Sure you can use VRAM as a temp buffer but not for realtime streaming. it's to slow. Screen5 and Screen8 (and all other screens) use the SAME VRAM !!
Just check it: load a picture in screen 8 page 1 (page 0 will be flushed remember). then swith to screen 5 page 2 or 3 and wait a minute.. hey, that looks familair!
|
|
BiFi msx guru Mensajes: 3142 | Publicado: Mayo 04 2005, 22:34   |
Quote:
| 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!)
|
this is very immature behaviour... kicking a respected member of the MSX community where he can't react...
*sigh* |
|
flyguille msx master Mensajes: 1225 | Publicado: Mayo 04 2005, 23:00   |
and GO GO GO!!!
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Mayo 05 2005, 02:07   |
wooohooooooo! food fight!!!
|
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 05 2005, 18:44   |
now this problem occurs:
I asm my programm which starts at $c000 and goes to $c7b5 with
Wbass says:
label niet gedefinieerd in 952,988,992,978
so 4 labels are completely changed when I look in the code
then I load the programm again and start at $c400 (until $cbb5)
I asm, and......
label niet gedefinieerd in 978
so now only one label is messed up after assembling
I reload the programm again, this time I start it at $c200 (until $c9b5
I asm, and......
label ´K´! C niet gedefinieerd in 952
label niet gedefinieerd in 978
label XE^4* niet gedefinieerd in 992
And then...................
I reload the programm and start at $c400
I asm
and no problems, it works again.
so now I keep starting my program at $c400........
What is this? (something to do with the stack?)
I have no jumps to anywhere before the programm, and I do not write any
(I hope) to a memory address before the programm !!
|
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 05 2005, 18:50   |
another thing
if I go my programm all the sprite patterns are loaded into the videomemory,
and the game start playing.
When I end the programm the sprite patterns are automaticaly removed from
videomemory, and when I restart the programm I have to load the patterns
into videomemory again.
So, I have in my maingamefile also 64 sprite patterns.
every sprite pattern is 32 bytes long and start like this
sprites:
db 12,44,25,55,64,3,35............. sprite 1
db 23,25,55.............. sprite 2 etc etc
this makes my programm so much longer.
should I split the loading of my sprites patterns into a different file?
and how do I operate after I have 2 files: main game file and sprite pattern file.
should I assemble them both differently and have a call spritepatterns
at the begin of my main programm, and a ret at the end of the spritepattern
programm? or can the sprite patterns be stored into videoram permanently?
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Mayo 06 2005, 00:11   |
All this is probably cause because you have way too much data in your source file. When you assemble you're probably overwriting part of the source data, which causes the label errors. You're better off loading the sprites and other raw data into memory on address $8000 or something. First separate them from your original source, and save them in a different file. Use PAGE to set an empty bank at $8000, and have your data source start here. Then assemble, and use DSAVE "FILENAME.EXT",STARTADD,ENDADD to save the data to disk as a raw file. You can then later DLOAD "FILENAME.EXT",$8000 to load that data without having to compile. Be sure to PAGE first, ofcourse... Anyhoo, that will probably save a lot of source-code-memory and solve your problem. You will have to keep track of your labels though, probably by using a couple of EQU's or using an INCLUDE file with the proper addresses...
|
|
norakomi msx professional Mensajes: 861 | Publicado: Mayo 07 2005, 03:50   |
cewl !!
ill start right away !!!!!
|
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 08 2005, 14:40   |
Oh Beefman shut your piehole will ya.. I loved them foodfights and I kinda hate guyver not being here, so shut your cakecavern dude. (foodfight?! hell yeah)
and euh, norakomi. as I said: don't start your funky code on page 3.. just don't.
start learing and using the memory manager. aaight. you gotta check your source START address 'cuz the default is somewhere in page 2. WBASS2 does that so you can still use some BASIC. BASIC sources start (default) at #8000. Wbass2 default is somewhere euh... dunoo #a000 maybe?
to sum up:
- skip the BASIC dude
- while skipping basic you'll have more space for your sources. set the start address at #8000 for example (no basic posible anymore!)
- in wbass swich your PAGE (e.g. page 1,3,0,3 on turbo r) to memory manager page (in this example it's 3)
- start coding on #4000 from now on.
it's a long journey but you'll get there. just start learning and listening. (I now my comments are kinda fragmented but hey, I don't feel like teaching)
|
|
AuroraMSX
 msx master Mensajes: 1262 | Publicado: Mayo 09 2005, 08:49   |
Quote:
| and euh, norakomi. as I said: don't start your funky code on page 3.. just don't.
|
I still fail to see why. Just because WBASS2 might dump some source code there? Then I'd say: Don't use WBASS2. Just don't.
Quote:
| ... but hey, I don't feel like teaching)
|
Then don't. Just don't!
|
|
ro msx guru Mensajes: 2347 | Publicado: Mayo 09 2005, 09:42   |
Wbass2 is a great development environment, especially for all the BASIC peeps (wb2 + basic runs smooth) It's easy and FAST, it's got a monitor, disassembler oh and did I mention it is FAST? Every one has it's favourite ofcourse but wb2 is great, and not just for beginners.
It's not only that wb2 might use space in page 3, it's the little space you got left in that very page. why not use dos2 for example to preserve 1 memory mapper and map it in page 1 and store your code there? you got 16k of space, always at hand. when running some other app which MIGHT use page 3 RAM too you already lost your code so you'll have to boot that again 
it's just a good practise to start using page 1 for your code (use page 2 for data, especially since DOS routines won't be able to load data directly in page 1..so another good practise is to use page 2 for data only.. just for convenience)
if one decides to use wb2 and starts complaing about sources being distorted while assembling on page 3; stop using that space. period. that's why.
I don't feel like teaching the obvious; there's sooo many specs out there. but things like *this* are to be learned from asking (in a forum like this for example)
then you MIGHT better be listening to the ppl that have the experience. if not, then don't ask.
So eurora, stop wining, start learning
all the best, ro. |
|
AuroraMSX
 msx master Mensajes: 1262 | Publicado: Mayo 10 2005, 14:11   |
Quote:
| Wbass2 is a great development environment, especially for all the BASIC peeps (wb2 + basic runs smooth)p/quote]
To be honest, I've never used or even seen WBAss2, so I really can't tell.
Gen80, zas (the assembler shipped with HiTech C) and pasmo is all I've ever used.
[quote]It's not only that wb2 might use space in page 3, it's the little space you got left in that very page. why not use dos2 for example to preserve 1 memory mapper and map it in page 1 and store your code there?
|
Maybe because I don't want to create a DOS2 only application?
Quote:
| it's just a good practise to start using page 1 for your code (use page 2 for data, especially since DOS routines won't be able to load data directly in page 1..so another good practise is to use page 2 for data only.. just for convenience)
|
But using page 1 and 2 is very inconvenient if your prog has to run from a BASIC program (remember that DEFUSR command?)
Quote:
| So eurora, stop wining, start learning 
|
I'm not w hining  <-- Learn ro, learn
Even better
|
|
|
|
|