|
From: Johannes P. <joh...@pr...> - 2003-02-14 04:28:01
|
Good day
-=0=0-=00--0
I have a C/asm related question that is puzzling me. If possible can
somebody please give some input on it as I don't really have a clue
on where to go from here.
in the example below I add the SEGment of the handler function to the AX
register.
//======================= SNIP START ===========================
void handler(void){
return;
}
void main(void){
asm{
mov ax,SEG handler
}
}
//==========8<============ SNIP END ===========================
with the dos.h and stdio.h this compiles with no problems at all.
But when changing this to a class as seen below.
//========================= SNIP START ========================
class te{
private:
int vga;
protected:
void handler_te(void);
public:
void init(void);
};
void te::handler_te(void){
return 0;
}
void te::init(void){
asm{
mov ax,SEG this.handler_te
}
}
//============= 8< ========== SNIP END ===========================
when compiling this with the same headers you get the following error.
Error SEGTEST.CPP 19: Undefined symbol 'handler_te'
This is confusing me as I don't know how to get around this.
Any input will be appreciated.
Thanks in Advance
Johannes Pretorius
|