??? 09/06/04 13:07 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#76970 - What Assembler? Responding to: ???'s previous message |
For Keil A51, it's all on page 123 of the Manual:
The Keil A51 Manual said:
The DS directive reserves space in the current segment at the current address.
The current address is then increased by the value of the expression. The sum of the location counter and the value of the specified expression should not exceed the limitations of the current address space. Robert Revens said:
it doesn't initialise the reserved space in any way The only parameter to DS is the length (number of bytes) to reserve. There is no way to specify any initialisation value(s), so how could it know what initial value(s) to set?! Look at DB and DW instead... Robert Revens said:
Does this mean that all DS does is advance the location counter of the relevant segment so that this space is not used? That's certainly what the above Keil quote says! Robert Revens said: And why not?
ASM51 is quite happy to let me use the data directive (for example) to assign a symbol to one of the addresses I thought I'd reserved There are plenty of reasons why you might want to use different names for the same location. Maybe the term "reserve" is a little misleading here? Robert Revens said:
I was expecting some kind of warning? If you need hand-holding, you should use 'C' instead. The whole point of Assembler is that You are completely & totally in charge; that's why you need assembler for "cunning tricks" that you can't do in 'C', but the Assembler won't try to distinguish between "cunning tricks" and "stupid mistakes" - it's all down to you. That is both the power and the danger of Assembler! |
Topic | Author | Date |
What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
RE: What does DS actually do? | 01/01/70 00:00 | |
What Assembler? | 01/01/70 00:00 | |
RE: What Assembler?![]() | 01/01/70 00:00 |