HI Blair,
This is a nice discovery from Arkady: from his explanation below, intr()
has CY=1 for int 21h :)
Arkady, see below
Arkady V.Belousov escreveu:
> 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).
Well, it can help if used judiciously: Andreas made a lib that I use
which is BC31 16 bits and OW 32 bits. What he did is to have a very
limited set of functions that perform special tasks and are inline asm
with conditionals. It works, but for too many functions it could be a PITA
> AM> It is just too bad that just one bit got left out of the
> AM> Standard/Borland functions...
>
> ?
The CY bit was consireded as not-important by someone.
Alain
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel