Re: Problem on dos_interrupt.

new topic     » goto parent     » topic index » view thread      » older message » newer message

I'm way out on a limb replying to this one!

A lot of what I am about to say is from dim memory and needs someone else to
confirm
(     revise.....laugh at  :)    )

> i have download Ralf Brown's Interrupt List and for example i want to  GET
STATUS OF LAST OPERATION (Int 13/AH=01h) but how can i set AH? dos_interrupt
just have REG_AX to set, and what about CF?


I know I'm going to get this all wrong but here goes.....

Using Robert's "DOSINT.EX" as an example

reg_list[REG_AX] = #0100   -- function: AH = #01     ie.....01h

AX is a 16 bit general purpose register. It can be used in operations as a
16 bit register (AX) or as
a pair of 8-bit registers (AH ----- High byte of AX, AL ------ low byte of
AX)

If you have a look at #0100 I think that this is the whole value in AX. "01"
is the "high byte" which
contains 01 hex and "00" is the "low byte" which contains zero. ie you load
values into AH and AL by
loading the appropriate halves of AX.

CF is the "carry flag". The CPU has a flags register. Bits in the flags
register will be set
depending on certain conditions following a CPU instruction. If CF is set
then the result of an
arithmetic operation has resulted in a "carry" (overflow?? Perhaps the
result of the operation
was too large and therefore the result can not be considered accurate???).

>Also it only have REG_CX in it.

Sorry....don't understand you here.

> Another question:
> What are REG_DI, REG_SI,REG_BP,REG_BX, REG_DX,REG_CX,
> REG_AX, REG_FLAGS, REG_ES and  REG_DS?
> Please help me...

I haven't tried this in Euphoria but a (very) quick look at this in the
manual, it seems to me that
the Euphoria Dos Interupt function takes a sequence which are the values
that need to be
in the registers when the interupt is called and returns a sequence which
contains any
"results" following the interupt that are now in the registers.

The "constants" (REG_DI, REG_AX etc) are just a nice way that Rob has
supplied to allow
you to easily "unload / load" the required elements of the sequence (and
hence load or
unload the values to / from the registers).

The registers themselves are (again from memory)....

AX, BX, CX, DX     - general purpose registers (useable also as 8 - bit
reg's AH / AL, BH / BL etc)

DI, SI - index registers????.....these can be used  with some instructions
to point at a location that
                                       is an "offset" from a base location
contained in another register????

FLAGS - 16 - bit flags register .....conditions following certain CPU
operations.

ES, DS - I think these registers are a requirement that is a hang over from
the days when
               x86 CPU's couldn't reference a memory "chunk" larger than
64k? To get at locations greater than
               64k the CPU used a "segment" register that would combine with
the value in another register
               to point at a larger address (?????). The CPU would then be
able to reference an individual location
               in a much larger memory map.

             CS - Code Segment ???
             DS - Data Segment ????
             ES - Extra Segment ????

Hopefully some of the above is right (and some help!). This is *very*
complicated stuff and gets a lot
more complicated when you throw in the complexities of 386+ CPU's (where I
seem to remember that
in protected mode seg reg's all point at the same segment???......arrrgh)

If you really want / need to know about this CPU stuff, a good book might
help.

Good Luck !!


Mark (who thought about sending this off anonymously to save on looking like
a goose....)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu