相关代码 |
|
INCLUDE PROLOG.H _CC1: PUBLIC _strlen _strlen: SUB SP,2 MOV BX,0 ADD BX,SP PUSH BX ; MOV BX,6 ADD BX,SP MOV BX,[BX] XCHG DX,BX MOV BX,1 SUB DX,BX MOV BX,DX POP DX MOV SI,DX MOV [SI],BX _CC3: MOV BX,0 ADD BX,SP MOV DX,BX MOV BX,[BX] INC BX MOV SI,DX MOV [SI],BX MOV AL,[BX] CBW MOV BX,AX OR BX,BX JNZ $+5 JMP _CC4 JMP _CC3 _CC4: MOV BX,0 ADD BX,SP MOV BX,[BX] XCHG DX,BX MOV BX,4 ADD BX,SP MOV BX,[BX] SUB DX,BX MOV BX,DX ADD SP,2 RET INCLUDE EPILOG.H END