Skip to content

Instantly share code, notes, and snippets.

@pts
Created January 22, 2023 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pts/143db336182267eb4e306f6a3c5f354e to your computer and use it in GitHub Desktop.
Save pts/143db336182267eb4e306f6a3c5f354e to your computer and use it in GitHub Desktop.
Memory map for hellowr.com (DOS 8086 hello-world with write(2)) with
OpenWatcom 2 libc.
* = unreferenced symbol
+ = symbol only referenced locally
.text: (code)
mem_ptr size symbol
---------------------------
0x0100 start-of-file hellowr.com
0x0100 +0x0189 _cstart_ in cstart_t.obj(cstart)
0x0289 +0x0003 __exit_ in cstart_t.obj(cstart)
0x028c +0x00c6 __do_exit_with_msg_ in cstart_t.obj(cstart)
0x0352 +0x0009 __GETDS in cstart_t.obj(cstart)
0x035b +0x0011 main_ in hellowr.c: int main(int argc, char **argv) { write(1, "Hello, World!\n", 14); return 0; }
0x036c * +0x0003 __exit_with_msg_ in clibs.lib(xmsg.c)
0x036f +0x0017 __fatal_runtime_error_ in clibs.lib(xmsg.c)
0x0386 +0x0040 __CMain in clibs.lib(cmain086.c)
0x03c6 * +0x0004 __FInitRtns in clibs.lib(initrtns.c)
0x03ca +0x0057 __InitRtns in clibs.lib(initrtns.c)
0x0421 * +0x0004 __FFiniRtns in clibs.lib(initrtns.c)
0x0425 +0x0177 __FiniRtns in clibs.lib(initrtns.c)
0x059c +0x01b5 write_ in clibs.lib(write.c)
0x0751 +0x001c __EnterWVIDEO_ in clibs.lib(enterdb.c)
0x076d + +0x0001 __null_int23_exit_ in clibs.lib(exit.c)
0x076e +0x0011 exit_ in clibs.lib(exit.c)
0x077f * +0x000f _exit_ in clibs.lib(exit.c)
0x078e +0x0038 __lseek_ in clibs.lib(__lseek.c)
0x07c6 * +0x0005 __dosretax in clibs.lib(dosret.c)
0x07cb * +0x0007 __dosret0 in clibs.lib(dosret.c)
0x07d2 +0x0060 __set_errno_dos_ in clibs.lib(dosret.c)
0x0832 * +0x000a __set_errno_dos_reterr_ in clibs.lib(dosret.c)
0x083c +0x0004 __get_errno_ptr_ in clibs.lib(errno.c)
0x0840 +0x0017 __GetIOMode_ in clibs.lib(iomode.c)
0x0857 +0x0015 __SetIOMode_nogrow_ in clibs.lib(iomode.c)
0x086c +0x0013 stackavail_ in clibs.lib(stack086.c)
0x087f * +0x0017 __STK in clibs.lib(stk086.asm)
0x0896 +0x0180 __STKOVERFLOW_ in clibs.lib(stk086.asm)
0x0a16 +0x0031 __Init_Argv_ in clibs.lib(initargv.c)
0x0a47 +0x000b __Fini_Argv_ in clibs.lib(initargv.c)
0x0a52 +0x0004 __get_doserrno_ptr_ in clibs.lib(doserrno.c)
0x0a56 +0x0000 malloc_ in clibs.lib(nmalloc.c)
0x0a56 * +0x00b9 _nmalloc_ in clibs.lib(nmalloc.c)
0x0b0f +0x0000 _nfree_ in clibs.lib(nfree.c)
0x0b0f +0x00d1 free_ in clibs.lib(nfree.c)
0x0be0 +0x00c8 __MemAllocator in clibs.lib(mem.c)
0x0ca8 +0x017a __MemFree in clibs.lib(mem.c)
0x0e22 +0x0069 __nmemneed_ in clibs.lib(nmemneed.c)
0x0e8b + +0x0067 __LastFree_ in clibs.lib(grownear.c)
0x0ef2 +0x00d3 __ExpandDGROUP_ in clibs.lib(grownear.c)
0x0fc5 +0x0054 __brk_ in clibs.lib(sbrk.c)
0x1019 * +0x0007 sbrk_ in clibs.lib(sbrk.c)
.data:
mem_ptr size symbol
---------------------------
0x1020 +0x0002 __curbrk in clibs.lib(crwdata)
0x1022 +0x0002 __psp in clibs.lib(crwdata)
0x1024 +0x0001 __osmajor in clibs.lib(crwdata)
0x1025 +0x0001 __osminor in clibs.lib(crwdata)
0x1026 +0x0001 __osmode in clibs.lib(crwdata)
0x1027 +0x0001 __HShift in clibs.lib(crwdata)
0x1028 +0x0002 __STACKLOW in clibs.lib(crwdata)
0x102a +0x0002 __STACKTOP in clibs.lib(crwdata)
0x102c +0x0002 __cbyte in clibs.lib(crwdata)
0x102e +0x0002 __child in clibs.lib(crwdata)
0x1030 +0x0001 __no87 in clibs.lib(crwdata)
0x1031 +0x0004 __get_ovl_stack in clibs.lib(crwdata)
0x1035 +0x0004 __restore_ovl_stack in clibs.lib(crwdata)
0x1039 +0x0004 __close_ovl_file in clibs.lib(crwdata)
0x103d +0x0004 ___FPE_handler in clibs.lib(crwdata)
0x1041 +0x0004 __LpCmdLine in clibs.lib(crwdata)
0x1045 +0x0005 __LpPgmName in clibs.lib(crwdata)
0x104a +0x0002 ___uselfn in clibs.lib(uselfn.c)
0x104c +0x0002 __stacksize in clibs.lib(stksize.c)
0x104e + +0x0002 ___WD_Present in clibs.lib(enterdb.c)
0x1050 + +0x0002 ___int23_exit in clibs.lib(exit.c)
0x1052 + +0x0016 ___FPE_handler_exit in clibs.lib(exit.c)
0x1068 + +0x0002 ___NFiles in clibs.lib(iomode.c)
0x106a + +0x0028 ___init_mode in clibs.lib(iomode.c)
0x1092 + +0x0004 ___io_mode in clibs.lib(iomode.c)
0x1096 +0x0002 ___nheapbeg in clibs.lib(nmalloc.c)
0x1098 +0x0002 ___MiniHeapRover in clibs.lib(nmalloc.c)
0x109a +0x0002 ___LargestSizeB4MiniHeapRover in clibs.lib(nmalloc.c)
0x109c +0x0002 __amblksiz in clibs.lib(amblksiz.c)
0x109e +0x0002 ___heap_enabled in clibs.lib(heapen.c)
0x10a0 +0x000c __Start_XI in clibs.lib(sgdef086)
0x10ac +0x0000 __End_XI in clibs.lib(sgdef086)
0x10ac +0x0006 __Start_YI in clibs.lib(sgdef086)
0x10b2 +0x0010 __End_YI in clibs.lib(sgdef086)
0x10c2 end-of-file hellowr.com
.bss: (it doesn't make the file larger)
mem_ptr size symbol
---------------------------
0x10c2 +2 __argc in clibs.lib(argcv.c)
0x10c4 +2 __argv in clibs.lib(argcv.c)
0x10c6 +2 ___argc in clibs.lib(argcv.c)
0x10c8 +2 ___argv in clibs.lib(argcv.c)
0x10ca +2 ____Argc in clibs.lib(___argc.c)
0x10cc +2 ____Argv in clibs.lib(___argc.c)
0x10ce + +4 _errno in clibs.lib(errno.c)
0x10d2 + +2 __doserrno in clibs.lib(doserrno.c)
0x10d4 +2 ___historical_splitparms in clibs.lib(histsplt.c)
0x10d6 + +2 ___MiniHeapFreeRover in clibs.lib(nfree.c)
0x10d8 end-of-memory-image
__END__
k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment