Re: your favorite function
Posted: Wed Nov 18, 2009 7:54 pm
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.
The Place to Start for Operating System Developers
https://f.osdev.org/
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.
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
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).
Seriosly, which function can you remove and keep functionality of the kernel at the same level?
Code: Select all
void do_nothing() {}
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;
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;
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.
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,...)
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
Code: Select all
Asm movdw,destination,source
Code: Select all
mov eax,[esi+asm.op1]
mov ebx,[esi+asm.op2]
mov [eax],ebx