There is built-in asm support IIRC, but it requires TASM, which isn't
included in the free versions of TC.

On 6/14/06, Arkady V.Belousov <[EMAIL PROTECTED]> wrote:
> Hi!
>
> 14-Июн-2006 19:01 [EMAIL PROTECTED] (Alain M.) wrote to
> [email protected]:
>
> >> AB> Now the the real reason for the mail. Arkady said that the int*()
> >> AB> function do not pass on the flags correctly.
> >>      They do not do this at all.
> AM> Yes. it leaves it uninitialized!
>
>      No, CF state _always_ initialized, but initialization value depends
> from (internal) code of int*() function.
>
>      And quick observation of intr() source code shows, that before calling
> interrupt, CF is 1 before INT 0-25 and 0 before INT 26-FF (see cmp/jb and
> cmp/ja below):
>
> asm     cmp     al, 025h
> asm     jb      NormalIntr
> asm     cmp     al, 026h
> asm     ja      NormalIntr
> [...a lot of "asm mov"...]
> asm     jmp     SetRegs
> NormalIntr:
> asm     mov     byte ptr Code+5, 0CAh
> asm     mov     word ptr Code+6, 2
> SetRegs:
> [...a lot of "asm lds/push/mov"...]
>         /* Call the interrupt routine */
>         (* Vector)();
>
> >> AB> Of course using asm{} is more efficient, but is not C++.
> >>      This depends. First, yes - in OW asm{} forces saving all registers
> on
> >> stack (even if in asm{} no registers used), but TC/BC is smarter in this
> >> (they check, which registers mentioned in instructions).
> AM> IMHO, for portability, there could be an asm function to do those
> AM> things.
>
>      (Inline) asm function does _not_ better for portability (unless there
> is no C-like way to perform required task).
>
> AM> It is just too bad that just one bit got left out of the
> AM> Standard/Borland functions...
>
>      ?
>
> >>      Second, see how much workarounds you apply (store firstly to _CX and
> >> _BX, then move to _DX and _AX) to avoid registers injuring. But with
> >> pseudo-variables you can't guarantee non-injuring - only reviewing
> listing
> >> may ensure, that with this compiler version your code compiled as
> expected.
> >> Whereas with asm{} you get only what you wrote - no more, no less.
> AM> I am used to BC31, which has asm{}, but unfortunately FreeDOS has to use
> AM> the older versions  :(
>
>      Yes, I forget, that there is no built-in inline asm support in TC. :(
>
>
> _______________________________________________
> Freedos-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freedos-devel
>


-- 
Fall is my favorite season in Los Angeles, watching the birds change
color and fall from the trees.
   David Letterman (1947 - )

See ya

_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to