Hey. You know when you do things imitating what you saw/read and stuff tends to work right? Well, I allways want to mess things up and experiment with weird ways to understand how they work if that's not documented or something (at least in the assembler docs). The bellow stff is some things I found out using asm-one and asm-pro. I think they're right but If somwone can confirm and share their experience please do so.
Please refer to the numbers for simplicity....
1- using the dc asm directive
can't define constants before the end of the program.. If I made a dc.b (didn't try with .w or .l), even with an align after (of course..) debbuger reported error in the instructions after. Errors disabppeared after I deleted the dc.b declarationj. I even tried to use the asm directive section code, after the dc, thinking that the asm had automatically changed the section but no luck...
So is this a given... you can't use dc unless in the end of the programs, and is this the same for all assemblers?
2- section assembler directive
asm- one (and asm-pro I assume, diddn't try) accepts data, code and bss. While I see what it is, I can't see why the different section defenitions exist. Shouldn't the assembler distinguish bettwee them? Do they have to be in a particular order(and could this be the reason for my previous errors in the debugger I described in 1-?
can they be miixed? Are all assembler the same?
by the way, dss is declare storage section right?
3- offset asm directive
from what I tried, only changes the values of labels(adding the offset) for constant declerations at the and of the program. Does nothing if used before the labels of the program instructions. ..
I tied to find more references to this but tutorial in general assume that the program has a cetain structore or sometihng, so I wanted to know if one can do this or not...