a64725e8736614650244f8414ac5a3fbd316c8d8
[rrq/maintain_lilo.git] / src / strlen.S
1 /* strlen.S
2
3  Copyright 2000-2004 John Coffman.
4  All rights reserved.
5
6  Licensed under the terms contained in the file 'COPYING' in the 
7  source directory.
8
9 */
10
11 ;
12 ; strlen:  find length of a string
13 ;       enter with:
14 ;               DS:BX = pointer to string
15 ;
16 ;       return with:
17 ;               AX = length of string
18 ;
19 strlen:
20         mov     ax,bx
21 strlen1:
22         test    byte (bx),#0xFF
23         jz      strlen2
24         inc     bx
25         jmp     strlen1
26 strlen2:
27         sub     bx,ax
28         xchg    ax,bx
29         ret
30
31 ; end strlen.S