1. Problem on dos_interrupt.
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?Also it only have REG_CX in it.
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...
_____________________________________________________
Sent by Hong Kong E-Mail at http://www.hkem.com
It's free. It's easy. Sign up your account Now!
2. Re: Problem on dos_interrupt.
>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?Also > it only
>have REG_CX in it.
ah is the high byte of ax (al is the low byte), so:
ax = al + (ah*256)
or, in this case:
ax = #0100
(assuming al should be 0)
I don't know what you mean by CF, did you misspell CL/CH? Or maybe you mean
the carry flag, if so, you should set REG_FLAGS to 1 (I'm just guessing
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...
DI = destination index
SI = source index
BP = base pointer (?)
AX, BX, CX and DX = main registers
FLAGS = flags
DS = default segment
ES = extra segment
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
3. Re: Problem on dos_interrupt.
- Posted by Mark Brown <mabrown at SENET.COM.AU>
Oct 06, 2000
-
Last edited Oct 07, 2000
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....)
4. Re: Problem on dos_interrupt.
>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)
Just one little remark..
Real mode is *a lot* more complicated than protected mode. With PM, you can
use a flat memory model and access all of your computer's RAM (up to 4 GB)
with just a 32-bit offset. Compared to the sluggish 20-bit segment:offset
pairs of real mode, this is like a dream come through..
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
5. Re: Problem on dos_interrupt.
Hello there,
I hate to say this but, if your asking where AH is when you have
AX in front of you, you had better get yourself a manual on 386
instruction codes. Dealing with machine instructions is much more
critical then programming in a high level language like Euphoria.
You have to have a lot of information about registers and sometimes
even info on every single bit in those registers in front of you,
as well as what they do in response to various other conditions and
since the 386 even a bit more context sensitivity.
Intel used to have alot of information on their web site, you might
just be able to download a manual on the Pentium with full instruction
set. I myself got a manual there a few years back.
I wouldnt look at anything less than 386DX. Thats the most basic with
all the programming models. Usually you will be using 32 bit flat.
On the bright side, you could do anything in assembly language.
You could build your own OS if you wanted to.
Well, good luck with assembly!
--Al
ps. if you have too much trouble finding that manual email me and i might be
able to send you a copy of the one i have. Its in a wordpad format with
variable font sizes etc.