Segment off-sets of sequences

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

Hello all. I have a technical question. I am preparing some routines
which use dos interrupts. The routine in question need to know the
seqment address and the segment offset of a sequence that has been
poked into low mem. Here is a portion of the code.

global function get_block (sequence buffer, integer port)
integer getblock,bufferaddress
-- allocate buffer space in mem
bufferaddress = allocate_low(len(buffer))
-- poke the buffer
for i = 0 to (len(buffer) -1)  do
poke(bufferaddress+i, buffer[i+1])
end for
regs=repeat(0,10)
regs[REG_AX] = #1800
regs[REG_CX] = len(buffer)
regs[REG_DX] = port

-- this should be the address of the of the seq. in mem ?

regs[REG_ES] = bufferaddress -- this should be the start of the

-- I don't know this one..needs the segment off-set of the sequence
-- in mem. Maybe should be 0 ?

regs[REG_DI] = ?
regs=dos_interrupt(#14, regs)
getblock = regs(REG_AX)
return getblock
free_low(bufferaddress)
end function

I think that the segment address should be the address returned by
the allocate_low() function and the segment offset should be 0.

Can anybody help with this?

Thanks..

Greg.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu