PDA

Click to See Complete Forum and Search --> : Visual Basic for MS-DOS


Jason B
Nov 20th, 2000, 08:01 AM
Hello

I need to call the "Int86x" type of interrupt call, not the following which is for a different call type:

CALL INTERRUPT(&H21, regs, regs)

Does Visual Basic for ms-dos support the Int86x call?

I need to call an interrupt something like this:
CALL int86x(&H60, InRegs, OutRegs, SegRegs)

Can anyone help me please!!

Cheers

Paul282
Nov 21st, 2000, 01:37 AM
Qbasic can do that.
As can any language that can handle assembly language

VB can't do jack to help you here though

Lord Orwell
Feb 27th, 2001, 03:17 AM
Wrong.
Vb for dos can do that. Allow me to post code samples and the declaration i use myself. Note, you have to include a library that comes with it. You can either use the include.bi file or just use my declaration.
DECLARE SUB interrupt (intnum%, iReg AS RegType, oReg AS RegType)

Type RegType
ax As Integer
bx As Integer
cx As Integer
dx As Integer
bp As Integer
si As Integer
di As Integer
flags As Integer
ds As Integer
es As Integer
End Type
Keep in mind that you need both a .qlb and a .lib. Include the .qlb when loading your project. When it compiles, it should find the .lib automatically. If it doesn't you willhave to use the dos compiler.

Lord Orwell
Feb 27th, 2001, 03:28 AM
read_sector:
If sector > 0 Then
If e_o_d = 13 Then
sector = sector - 1
GoSub read_sector2: sector = sector + 1
spare_data = sector_data
End If
End If
read_sector2:
iReg.ax = Drive
iReg.bx = VarPtr(packet)
iReg.ds = VARSEG(packet)
iReg.cx = &HFFFF
Mid$(packet, 1, 4) = MKL$(sector)
Mid$(packet, 5, 2) = MKI$(1)
Mid$(packet, 7, 2) = MKI$(VarPtr(sector_data))
Mid$(packet, 9, 2) = MKI$(VARSEG(sector_data))
interrupt &H25, iReg, oReg
Return

write_sector:
iReg.ax = Drive
iReg.bx = VarPtr(packet)
iReg.ds = VARSEG(packet)
iReg.cx = &HFFFF
Mid$(packet, 1, 4) = MKL$(sector)
Mid$(packet, 5, 2) = MKI$(1)
Mid$(packet, 7, 2) = MKI$(VarPtr(sector_data))
Mid$(packet, 9, 2) = MKI$(VARSEG(sector_data))
interrupt &H26, iReg, oReg
Return

mouse_reset:
iReg.ax = 0
interrupt &H33, iReg, oReg
Return

mouse_on:
iReg.ax = 1
interrupt &H33, iReg, oReg
Return

mouse_hide:
iReg.ax = 2
interrupt &H33, iReg, oReg
Return

mouse_position:
iReg.ax = 3
interrupt &H33, iReg, oReg
mouse_buttons = oReg.bx
If oReg.cx / 8 + 1 <> x_pos Or oReg.dx / 8 + 1 <> y_pos Then
t = 0
m_x_pos = oReg.cx / 8 + 1
m_y_pos = oReg.dx / 8 + 1
GoSub restore_char
x_pos = m_x_pos
y_pos = m_y_pos
GoSub get_new
Call show_code
GoSub show_cursor

End If
Return
pen_position:
iReg.ax = &H400
interrupt &H10, iReg, oReg
If oReg.ax And 256 = 1 Then
GoSub restore_char
x_pos = (oReg.ax And 255) + 1
y_pos = oReg.bx / 8 + 1
GoSub position_mouse_cursor
GoSub get_new
End If
Return
position_mouse_cursor:

iReg.ax = 4
iReg.cx = (x_pos - 1) * 8
iReg.dx = (y_pos - 1) * 8
interrupt &H33, iReg, oReg

Return

drv_info:
Color 1, 7
iReg.ax = &H3600
iReg.dx = Drive + 1
interrupt &H21, iReg, oReg
sectors_per_cluster = oReg.ax: free_clusters = oReg.bx: bytes_per_sector = oReg.cx: total_clusters = oReg.dx
total_sectors = sectors_per_cluster * total_clusters

If total_sectors = 708 Then b_o_d = 5: e_o_d = 11: fat_type$ = "FAT 12": fat_allocation_size$ = " 2 sectors "
If total_sectors = 3352 Then b_o_d = 7: e_o_d = 7: fat_type$ = "FAT 8": fat_allocation_size$ = " 4 sectors "
If total_sectors = 2371 Then b_o_d = 15: e_o_d = 28: fat_type$ = "FAT 12": fat_allocation_size$ = " 2 sectors "
If total_sectors = 2847 Then b_o_d = 19: e_o_d = 32: fat_type$ = "FAT 12": fat_allocation_size$ = " 1 sector "
If total_sectors = 1426 Then b_o_d = 7: e_o_d = 13: fat_type$ = "FAT 12": fat_allocation_size$ = " 2 sectors "

real_total_sectors = total_sectors + e_o_d