????1???????????:?????????????????
????2?????????????????????????????????????????????????????洢????????????????????????????????????????δ???????????????δ??????????????????????????????????????????????????????Щ???????????????????????????????BSS??(bss segment)??????????????????δ?????????????????????????BSS?????Block Started by Symbol?????
????3?????:?????????????????????????????????????????????????????????????????е????
????4??????:???????????????????????????????????????????OS??????????????????е?????????£?????????????????????????
????5???????в?????:????????в?????????????????
????????????????????????????????????????????????????????в???????????????????????????????vc?????£????????????????????洢????У?????????????????洢?????????????TC?????????
??????linux??:???????????-c??????????????????磺
????gcc -c *.c
????gcc *.o -Map test.txt -o test.elf
???????????????test.txt???????????Щbss?Σ?data?Σ?text?ε?????????????ж??????????????objdump?????.o??????????????????????gcc -S *.c????????.S??????????
????1?????????Conventional Memory????????????????????λ?????0KB??640KB?????000000H??109FFFFH???????640KB?????????????????????沢????DOS??????????????????????Low Dos Memory????DOS??棩????????????棨Base Memory????????????????BIOS??DOS??????????Χ?豸???????????ж?????????Щ???????????п?????????????????????????????????С?
????2????λ??棨UM???????Upper Memory????д????????????????????棨640KB??1024KB???? ????
????3????????????HMA???????High Memory Area????д??????1024KB??1088KB????64KB??棬??????????????????100000H??10FFEFH???????CPU????????????Segment:OFFSET(?ε?????????)???????????????????????????FFFF??FFFF??????10FFEFH?? ????
????4??EMB?????Extended Memory Block????????飩????д??????????????洢????EPM?????????EMS?淶(?????EMM386.exe)??????????????洢????EXM?????????XMS?淶???????Himem.sys?????????????1MB?????????????????100000H????????????????????????棬???????????CPU??????????
        ??????溯??
????????????malloc()??farmalloc()??calloc()??farcalloc()??realloc()??farealloc()
??????????: malloc
?????? ??: ?????亯??
?????? ??: void *malloc(unsigned size);
??????????: farmalloc
?????? ??: ??????з???洢??
?????? ??: void far *farmalloc(unsigned long size);
??????????: calloc
?????? ??: ???????洢??
?????? ??: void *calloc(size_t nelem?? size_t elsize);
??????????: farcalloc
?????? ??: ??????????????
?????? ??: void far *farcalloc( unsigned long units?? unsigned ling unitsz );
??????????: realloc
?????? ??: ???·???????
?????? ??: void *realloc(void *ptr?? unsigned newsize);
??????????: farrealloc
?????? ??: ????????е?????
?????? ??: void far *farrealloc( void far *block?? unsigned long newsize );
??????ú?????memcpy()??memset()??memmove()??movedata()
??????????: memcpy
?????? ??: ???source?п???n?????????destin??
?????? ??: void *memcpy(void *destin??void *source??unsigned n);
??????????: memset
?????? ??: ????s?е?????????ch?? s??????С??n????
?????? ??: void *memset(void *s?? char ch?? unsigned n);
??????????: memmove
?????? ??: ?????????
?????? ??: void *memmove(void *destin??void *source??unsigned n);
??????????: movedata
?????? ??: ???????
?????? ??: void movedata(int segsrc?? int offsrc?? int segdest?? int offdest?? unsigned numbytes);
????????????free()??farfree()
??????????: free
?????? ??: ??????????
?????? ??: void free(void *ptr);
??????????: farfree
?????? ??: ?????????????
?????? ??: void farfree(void);
????????????????MK_FP()??FP_OFF()??FP_SEG()
??????????: MK_FP
?????? ??: ???????????
?????? ??: void far *MK_FP(unsigned seg?? unsigned off);
??????????: FP_OFF
?????? ??: ????????????
?????? ??: unsigned FP_OFF(void far *farptr);
??????????: FP_SEG
?????? ??: ??????????
?????? ??: unsigned FP_SEG(void far *farptr);