2 ; Ullrich von Bassewitz, 2003-08-12
4 ; char* __fastcall__ getcwd (char* buf, size_t size);
16 ;--------------------------------------------------------------------------
20 ; Remember -size-1 because this simplifies the following loop
32 ; Copy __cwd to the given buffer checking the length
40 ; Copy one character, end the loop if the zero terminator is reached. We
41 ; don't support directories longer than 255 characters for now.
49 ; For some reason the cwd is longer than 255 characters. This should not
50 ; happen, we handle it as if the passed buffer was too short.
52 ; String overflow, return ERANGE
59 tax ; High byte of ERANGE is zero, return zero