In the source of uc/os, I couldn’t understand the following code.
*stk = _DS;
It’s comments is to get current value of DS.
Can you tell me why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Almost certainly, the compiler recognises
_DSas a special “variable” and, instead of extracting the contents of that variable from wherever variables are stored, it just uses the contents of the data segment register directly.In other words,
a = bmight be compiled as:whereas
a = _DSmay be: