The codes life :)

A processor with 32 address bus
2^32 -> 4294967296 address slots in memory

4294967296 * 1 byte since byte addressable = 4294967296 bytes
= 4194304 kb
= 4096 mb
----------
i.e 4 GB data can be stored and addressed !!
so the address space in Hex would look like : (4*8 = 32 ) [seg = segment; off = offset]
0000 : 0000
| |
| |
V
V
FFFF : FFFF
-------------------
SEG OFF

0000-FFFF (16 bits i.e 65536 bytes of data i.e 64 kb of data .... if the code is 64 kb its a COM)
MOV ... FFFF:0000 D0
FFFF:0001 FE

SO ..... Program .. its LIFe
Programmer writes a program in HL/LL :)
It uses shared libs or dyn libs
Lets say .c code

which uses a printf func and a socket from winsocks
///Now the printf is statically linked to the code during compile time whereas net32api.dll is done during the runtime.

Programmer compiles the code .... using a compiler


STAGES
-------- ------------- -------------------- --------------------- -------------------------------------
CODE.C | -> | cc code.c | -> internal .obj in ASM -> | sent to LINKER :) | -> | forms the executable .. i.e a.out |
-------- ------------- -------------------- --------------------- -------------------------------------

Now,
LINKER is synonymous to LOADER in UNIX. The linker takes the obj file and tries to resolve symbols (variables, function calls !!).
In case of a static link i.e printf() ... the lib file code is embeded into the yet to be OUTPUT EXE.
The dynamic link is post-poned till the runtime where necessary steps are taken to call dynamic procs.


The funnie thing is I learnt it now what i seeked for in my engg ..... haa haaa ...
Yep its late night ... my coffee cup is dry ...... and the burger is gone

See ya soon ..... i gotta REFRESH

0 comments: