Hi!

13-Апр-2004 18:41 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

>> > +  fstrcpy(Shell + strlen(Shell), MK_FP(FP_SEG(Config), Config->cfgInitTail));
>> >    endp =  Shell + strlen(Shell);
>>   fstrcpy(endp = Shell + strlen(Shell),
>>           MK_FP(FP_SEG(Config), Config->cfgInitTail));
BO> this won't work. We need the strlen of Shell after the fstrcpy.

     Oh, God, sometime I make silly mistakes. :( Anyway, if you define copy
function, which will return length (preferably) or pointer _after_ copied
string (at terminating zero byte), you will get better code. For example:

        endp = fstrcopy (Shell, ...);
        endp = fstrcopy (endp, MK_FP ...);

>> >  STATIC VOID InitPgm(BYTE * pLine)
>> >  {
>> > +  static char init[NAMEMAX];
>> > +  static char inittail[NAMEMAX];
>> > +
>> > +  Config.cfgInit = init;
>> > +  Config.cfgInitTail = inittail;
>>      As I understand, these assignments may be performed statically.
>> Especially, if cfgInit and cfgInitTail fields will be moved out from Config
>> structure.
BO> ??? I don't understand what you mean here.

char init_buf[NAMEMAX];
char *cfgInit = init_buf;

     Or, if remain cfgInit inside Config:

char init_buf[NAMEMAX];
struct config Config = {
...
init_buf,
...

>> > +             mov     cx,-2 + init_end wrt INIT_TEXT     ; word aligned
>>      BTW, does (or not) NASM supports TASM/MASM compatible syntax:
>>          mov     cx,offset INIT_TEXT:init_end - 2       ; word aligned

     Forget to add question mark here.

BO> NASM doesn't support "offset".

     But does it supports ":" instead "wrt"? If yes (at least, NASM supports
":" when passing far pointers to jmp and call), you may make empty %define
for `offset'. Why? To make code more portable between assemblers.




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to