ncrtso.s
来自「操作系统源代码」· S 代码 · 共 45 行
S
45 行
! This is the C run-time start-off routine. It's job is to take the! arguments as put on the stack by EXEC, and to parse them and set them up the! way _main expects them.! It also initializes _environ when this variable isn't defined by the! programmer. The detection of whether _environ belong to us is rather! simplistic. We simply check for some magic value, but there is no other! way..extern _main, _exit, crtso, __penvp.extern begtext, begdata, begbss, endtext, enddata, endbss.textbegtext:crtso: mov bx,sp mov cx,(bx) add bx,*2 mov ax,cx inc ax shl ax,#1 add ax,bx mov __penvp,ax ! save envp in __envp ! Test whether address of environ < address of end. ! This is done for separate I&D systems. mov dx,#_environ cmp dx,#__end jae 1f cmp _environ,#21331 ! is it our _environ? jne 1f mov _environ,ax1: push ax ! push environ push bx ! push argv push cx ! push argc xor bp,bp ! clear bp for traceback of core files call _main add sp,*6 push ax ! push exit status call _exit.databegdata:__penvp: .data2 0.bssbegbss:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?