Segment prefix when using pointers as function parameters
问题 I have an assembler/c question. I just read about segment prefixes, for example ds:varX and so on. The prefix is important for the calculation of the logical address. I read too, that default is "ds" and as soon as you use the ebp register to calculate an address, "ss" is used. For code "cs" is default. That all makes sense. Now I have the following in c: int x; // some static var in ds void test(int *p){ ... *p =5; } ... main(){ test(&x); //now x is 5 } If you now think about the