home *** CD-ROM | disk | FTP | other *** search
- 'This program does a call to BIOS to find the current video mode, char/line,
- 'and video page as a test for the INTCALL machine language subroutine.
-
- 'Info is passed to INTCALL as integers giving Int #, Location of register
- 'data for the interrupt, and location to put returned register data,
- 'in that order.
-
- 'The register data is passed to/from the interrupt in integer arrays (as
- 'integers) in the following order:
- 'ax,bx,cx,dx,si,di,ds,es as elements 1 thru 8 of an integer array. The
- 'location passed is the pointer to element 1 of the array.
-
- Wherein%=0:Whereout%=0 'Save a place for variables
- Inter%=&H10 'General video BIOS int
- Option base 1:Dim Inar%(8), Outar%(8) 'Dimension integer arrays (1-8)
- Print "Find current Video mode; do Int 10h with AH=0Fh. Returns AL=width in chars,"
- Print "AL=Video mode, and BH=Video page number."
- Print "Register passed are:"
- For x%=1 to 8 'Read data statement
- Read R$,A$ 'Read register and value
- xx=val("&H"+A$) 'Convert to hex
- Gosub Convert 'Convert unsigned to signed
- Inar%(x%)=xx% 'Enter in array
- Next x% 'Do all registers
-
- Wherein%=varptr(Inar%(1)):Whereout%=varptr(Outar%(1)) 'Get array pointers
- call Intcall(Inter%,Wherein%,Whereout%) 'Do call, pass interrupt number,
- 'passed array and returned array locations
-
- Print "Returned registers are: 'Print returned register values
- Restore 'Restore data pointer
- For x%=1 to 8 'Read returned data
- Read R$,A$ 'Read register; A$ is dummy var
- xx%=Outar%(x%) 'Get returned value
- gosub Printit 'Print register and value
- next x% 'Do all registers
-
- 'Now print the meaning of the returned data.
- Mode%=Outar%(1) and &HFF 'Get mode
- Char%=Outar%(1)/256 'Get chars/line
- Page%=Outar%(2)/256 'Get video page
- print"Video mode is";Mode% 'Print answers
- print"There are";Char%;"Chars/line"
- print"Video page is";Page%
- end
-
- 'Subroutine for converting unsigned to signed number and print reg & value.
- Convert:
- if xx>&H7FFF then xx=-(65536-xx)
- xx%=int(xx):gosub Printit:return
-
- Printit: print R$;"=";right$("0000"+hex$(xx%),4):return
-
- 'Register data goes here.
- Data AX,0F00,BX,2222,CX,3333,DX,4444,SI,5555,DI,6666,DS,7777,ES,8888
-
-