I examined the output file and it does not produce unicode. This code did not work either:
Code: Select all
? ? char *ret = string;
? ? while (*string++);
? ? return string - 1 - ret;
I am compiling it using the -c comand line option with bcc:
bcc -c <sourcefile>
Then I am linking it like this:
ld86 -d <objectfiles> -o kernel
I am loading it by writing it to the second sector of a floppy drive, and writing a bootsector which loads the second sector to the first sector. However, I finally got it to work, using this assembly language code which I found in the standard library for this compiler:
Code: Select all
int strlen(string) char * string;
{#asm
#if !__FIRST_ARG_IN_AX__
mov bx,sp
#endif
push di
#ifdef PARANOID
push es
push ds ! Im not sure if this is needed, so just in case.
pop es
cld
#endif
! This is almost the same as memchr, but it can
! stay as a special.
#if __FIRST_ARG_IN_AX__
mov di,ax
#else
mov di,[bx+2]
#endif
mov cx,#-1
xor ax,ax
repne
scasb
not cx
dec cx
mov ax,cx
#ifdef PARANOID
pop es
#endif
pop di
#endasm
}
Thanks.