vi small.c =>
Code:
void mini ()
{
while (1);
}
cc -S small.c; cat small.s =>
Code:
.file "small.c"
.text
.globl mini
.type mini, @function
mini:
pushl %ebp
movl %esp, %ebp
nop
.L2:
jmp .L2
.size mini, .-mini
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.4 (pre 3.3.5 20040809)"
<= OK: THIS IS PRETTY MUCH THE CODE WE'D EXPECT
cc -c small.c; objdump -d small.o =>
Code:
small.o: file format elf32-i386
Disassembly of section .text:
00000000 <mini>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 90 nop
4: eb fe jmp 4 <mini+0x4>
<= HEY: GUESS WHAT? EXACTLY 24 BYTES!
Sorry - not exactly 24 *bits* ;-)
And for that matter, 24 bytes/bits of *what*? You said something about "registers": registers are part of the CPU; they don't take up any RAM. We're definitely curious why you asked this question...