RE:expand-down segments question - explained in more detail
Posted: Wed May 28, 2003 11:00 pm
//I stated that it should generate and exception "(in this case)".
Thats what the extand down flag is used for: the offset of 0xffffffff is interpreted as -1.(The segment expands down from the base adress.)
When i said assembly is not a portable language, i meant between different architectures : PowerPC, ARM, Sparc, ....(The world does not end on Intel and Microsoft)
//I referred to pointers as being unsigned simply because that is the most
//logical way to interpret them, simply because address 0xffffffff is higher in
//memory than 0x0, not lower.
the offset is not a adress, it's a index. So, stating it is C it would look like:
char *base_adr;
base_adr = logical adress of byte 0;
int offset;//note int, not int*;if you need a positive high adres, then use
//unsigned int
base_adr[offset] is the logical adress of the needed byte, which is base_adr + offset. And no cheking is made. If there would be cheking, then it wold be imposible to take a byte before the base adress, which is usefull, if you want to have a grown stack.
//And if you've taken any kind of design class (hardware or software)
// you should have learned that you should plan for future changes
Yes, that's why no programs in todays world are writen in asm. Only small(tiny) pices of code are writen in OSs, like task switching.
Anton.
Thats what the extand down flag is used for: the offset of 0xffffffff is interpreted as -1.(The segment expands down from the base adress.)
When i said assembly is not a portable language, i meant between different architectures : PowerPC, ARM, Sparc, ....(The world does not end on Intel and Microsoft)
//I referred to pointers as being unsigned simply because that is the most
//logical way to interpret them, simply because address 0xffffffff is higher in
//memory than 0x0, not lower.
the offset is not a adress, it's a index. So, stating it is C it would look like:
char *base_adr;
base_adr = logical adress of byte 0;
int offset;//note int, not int*;if you need a positive high adres, then use
//unsigned int
base_adr[offset] is the logical adress of the needed byte, which is base_adr + offset. And no cheking is made. If there would be cheking, then it wold be imposible to take a byte before the base adress, which is usefull, if you want to have a grown stack.
//And if you've taken any kind of design class (hardware or software)
// you should have learned that you should plan for future changes
Yes, that's why no programs in todays world are writen in asm. Only small(tiny) pices of code are writen in OSs, like task switching.
Anton.