It must be hard being an ex-mod where you can just see in your head the ban button.. lolCombuster wrote:must...not...feed...troll
I rest my case.
your favorite function
Re: your favorite function
Re: your favorite function
OT: im sorry, but when did the great combuster become an "ex-mod"??
respond to this if u want, otherwise please keep thread going, this is very interesting
respond to this if u want, otherwise please keep thread going, this is very interesting
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: your favorite function
The day they realized he could think for himself, the powers that be don't like that quality very much.GhostXoPCorp wrote:OT: im sorry, but when did the great combuster become an "ex-mod"??
respond to this if u want, otherwise please keep thread going, this is very interesting
Re: your favorite function
The reason Combuster mentioned this is that Objective-C is based on a message-passing architecture. I don't know ObjC myself, but I know this much. Thus, I must conclude that objc_msgSend is the integral dispatcher function that allows all object-oriented calls in ObjC; a truly important function.geppyfx wrote:Or do you suggest I learn ObjC? Maybe objc_msgSend is a macro or compiler/language related function? How come programming language related issues belong to osdev site not to mention "OS Development" forum(before it was moved).
So this thread is indeed not pointless as you and possibly others who search here have just learned something. Which is, again, Combuster's point.
Re: your favorite function
Seriosly, which function can you remove and keep functionality of the kernel at the same level?
Code: Select all
void do_nothing() {}
Re: your favorite function
Hey, you can't remove that function! Removing it would breakscgtrp wrote:Seriosly, which function can you remove and keep functionality of the kernel at the same level?Code: Select all
void do_nothing() {}
Code: Select all
static void (*const pointless_pointer)() = do_nothing;
Re: your favorite function
FTFY.Hobbes wrote:Hey, you can't remove that function! Removing it would breakscgtrp wrote:Seriosly, which function can you remove and keep functionality of the kernel at the same level?Code: Select all
void do_nothing() {}
Code: Select all
static void (*const pointless_pointer)() = &do_nothing;
Re: your favorite function
JamesM, please don't spoil my joke! The & operator in this case is optional. In my opinion it even is redundant.
Re: your favorite function
It can be less ambiguous for the person doing the programming though. Seeing it without the & makes the next person to work on it think "hmm.. Well thats where that bug is, they meant to put `()`"Hobbes wrote:JamesM, please don't spoil my joke! The & operator in this case is optional. In my opinion it even is redundant.
Re: your favorite function
Let's agree to disagree. I prefer to call funcptr() instead of (*funcptr)() as well.
Re: your favorite function
Asm (func,op1,op2,op3,op4,op5,op6,op7,op8)
basically, this function calls func, and func will use op1 up to op8 as parameters.
func is pure asm code, terminated by a ret.
basically, this function calls func, and func will use op1 up to op8 as parameters.
func is pure asm code, terminated by a ret.
welcome in my dream.
Re: your favorite function
I don't like the look of that - if you really had to create your own assembly linkage, how about:edfed wrote:Asm (func,op1,op2,op3,op4,op5,op6,op7,op8)
basically, this function calls func, and func will use op1 up to op8 as parameters.
func is pure asm code, terminated by a ret.
Code: Select all
Asm(func,argc,...)
I use something similar to this version for calling real mode functions from protected mode. For Pmode->Pmode calls, I used the System V ABI, declare the function as extern "C" and just call it directly.
Cheers,
Adam
Re: your favorite function
you don't know how it works, why do you say you don't like that?
lets say, it's not code, but only datas, pointed to by esi.
in pure asm, it have this form:
the asm fucntion permits to use asm code inside fool tree.
as an example, it is a basic implementation of asm for fool design.
will do that:
then, if i want this object to do something else, it is easy, just replace movdw by the label you want.
lets say, it's not code, but only datas, pointed to by esi.
in pure asm, it have this form:
Code: Select all
mov esi,asmtest
call caller
...
asmtest dd f.asm,@f,1,2,3,4
@@:
push eax ebx ecx edx
mov eax,[esi+asm.op1]
mov ebx,[esi+asm.op2]
lea eax,[eax*8+ebx+45]
mov ecx,[esi+asm.op3]
mov [ecx],eax
mov edx,[esi+asm.op4]
lea eax,[ecx*4+ebx]
mov [edx],eax
pop edx ecx ebx eax
ret
as an example, it is a basic implementation of asm for fool design.
Code: Select all
Asm movdw,destination,source
Code: Select all
mov eax,[esi+asm.op1]
mov ebx,[esi+asm.op2]
mov [eax],ebx
welcome in my dream.