home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
pb
/
library2
/
toolbox.fix
< prev
next >
Wrap
Text File
|
1990-03-31
|
10KB
|
287 lines
Dear Turbo Database Toolbox User,
Here are the changes that need to be made to the database toolbox files
so that you may compile and run under PowerBASIC. There are six "blocks"
of changes that need to be made. The assembly routines that are commented
in changes 2 and 4 need not be written into your code, but we suggest that
you do so for future reference. Please call me if you have any questions
or comments. Good programming!
Sincerely,
Tim McFarland
Technical Support
(408) 730-9291
===========================================================================
Change One:
In file FEXISTS.BOX, DEF fnFileExists, replace:
SaveDS% = REG(8)
REG 8, (PEEK(1) * ...
I% = VARPTR(FileSpec1$)
REG 4, (PEEK(I% + 3) * ...
CALL INTERRUPT &H21
REG 8, SaveDS%
with:
REG 8, STRSEG(FileSpec1$)
REG 4, STRPTR(FileSpec1$)
CALL INTERRUPT &H21
===========================================================================
Change Two:
In file SCRNASM.BOX, sub WriteVid INLINE, remove all of the $INLINE
statements and replace them with:
$INLINE &H55, &H8B, &HEC, &H6 , &H1E, &HC5
$INLINE &H76, &HA , &H8E, &H4 , &HC5, &H76, &H6 , &H8B, &H3C, &HC5
$INLINE &H76, &H22, &H8B, &H4 , &H50, &HC5, &H76, &HE , &H8B, &H4
$INLINE &HC5, &H76, &H12, &H8B, &H1C, &H3 , &HD8, &HC5, &H76
$INLINE &H26, &H8B, &HC , &HC5, &H76, &H1A, &H8B, &H34, &H3
$INLINE &HF0, &HD1, &HE7, &HFC, &H58, &H3D, &H0 , &H0
$INLINE &H74, &H28, &HBA, &HDA, &H3 , &H57, &HC5, &H7E, &H1E, &H8E
$INLINE &H1D, &HAC, &HC5, &H7E, &H16, &H8E, &H1D, &H8A, &H27, &H43
$INLINE &H50, &HB4, &H09, &HEC, &HD0, &HD8, &H72, &HFB, &HFA, &HEC
$INLINE &H22, &HC4, &H74, &HFB, &H58, &H5F, &HAB, &HFB, &HE2, &HDD
$INLINE &HEB, &H13, &H57, &HC5, &H7E, &H1E, &H8E, &H1D, &HAC, &HC5
$INLINE &H7E, &H16, &H8E, &H1D, &H8A, &H27, &H43, &H5F, &HAB, &HE2
$INLINE &HED, &H1F, &H07, &H5D
The assembly code for the above is:
' push bp
' mov bp,sp
' push es
' push ds
' lds si,[bp+10]
' mov es,[si] ;dest seg into ES
' lds si,[bp+6]
' mov di,[si] ;dest disp into DI
' lds si,[bp+34]
' mov ax,[si] ;Retracemode% to AX
' push ax
' lds si,[bp+14]
' mov ax,[si] ;Stringdisp%
' lds si,[bp+18]
' mov bx,[si] ;addr of attr string into BX
' add bx,ax ;add string displacement
' lds si,[bp+38]
' mov cx,[si] ;Numbytes% to CX
' lds si,[bp+26]
' mov si,[si] ;source ptr to SI
' add si,ax ;add string displacement
' shl di,1 ;displ * 2 for dest
' cld ;string direction forwd
' pop ax
' cmp ax,0
' jz h ;not retracemode
' mov dx,03dah ;DX to CGA status port
' z:
' push di
' lds di,[bp+30] ;source seg addr
' mov ds,[di] ;source seg
' lodsb ;grab a video byte
' lds di,[bp+22] ;attr seg addr
' mov ds,[di] ;attr seg
' mov ah,[bx]
' inc bx
' push ax
' mov ah,9 ;save retrace mask
' o: in al,dx ;get 6845 status
' rcr al,1 ;check horiz retrace
' jb o ;loop if in horiz retr:
' ; Prevents starting in
' ; mid-retr, since there
' ; is enough time for 1
' ; & only 1 STOSW during
' ; horizontal retrace.
' cli ;no ints, critical sect
' t: in al,dx ;get 6845 status
' and al,ah ;chk horiz & vert retr:
' ; If the video board
' ; doesn t report horiz
' ; retr while in vert,
' ; retr, this will allow
' ; several chars to be
' ; stuffed in during
' ; vertical retrace.
' jz t ;loop if 0
' pop ax ;get the video byte
' pop di
' stosw ;store the video word
' sti ;allow interrupts
' loop z ;go do next word
' jmp short f
' h: push di
' lds di,[bp+30]
' mov ds,[di] ;source seg
' lodsb ;grab a video byte.
' lds di,[bp+22]
' mov ds,[di] ;attr seg
' mov ah,[bx]
' inc bx
' pop di
' stosw ;video word into screen
' loop h ;repeat for len in CX
' f: pop ds
' pop es
' pop bp
===========================================================================
Change Three:
In file SCRNSUBS.BOX, sub WriteScreenArea, replace:
CALL WriteVid(NumberOfCols, Scrn.Retrace, Text$, Attr$, SavePtr, _
Scrn.Segment, ScreenDisplacement + ((i - 1) * 80))
with:
CALL WriteVid(NumberOfCols, Scrn.Retrace, STRSEG(Text$), STRPTR(Text$), _
STRSEG(Attr$), STRPTR(Attr$), SavePtr, _
Scrn.Segment, ScreenDisplacement + ((i - 1) * 80))
>>> A note to toolbox users: If you call WriteVid yourself, instead of via
WriteScreenArea, be sure to change your parameters so that you pass the
segment and offset of the text and attribute strings, instead of the
strings themselves. Also, the CLIENT.BAS demonstration program needs
more than the default amount of stack space. Increase it by putting a
$STACK metastatement at the beginning of CLIENT.BAS. $STACK 32000
definitely works, much smaller values are likely to work as well.
===========================================================================
Change Four:
In file SCRNASM.BOX, sub ReadVid INLINE, remove all of the $INLINE
statements and replace them with:
$INLINE &H55,&H8B,&HEC,&H1E,&H06,&HC5,&H76,&H26,&H8B,&H0C,&HC5,&H76,&H12
$INLINE &H8B,&H1C,&HC5,&H7E,&H0E,&H8B,&H05,&H03,&HD8,&HC5,&H7E,&H06
$INLINE &H8B,&H15,&HC5,&H7E,&H1A,&H8B,&H3D,&H03,&HF8,&HC5,&H76,&H22,&H8B
$INLINE &H04,&HC5,&H76,&H0A,&H8E,&H1C,&H8B,&HF2,&HBA,&HDA,&H03,&HD1
$INLINE &HE6,&HFC,&H0B,&HC0,&H74,&H26,&HB4,&H09,&HEC,&HD0,&HD8,&H72,&HFB
$INLINE &HFA,&HEC,&H22,&HC4,&H74,&HFB,&HAD,&HFB,&H56,&HC4,&H76,&H1E
$INLINE &H26,&H8E,&H04,&HAA,&HC4,&H76,&H16,&H26,&H8E,&H04,&H26,&H88,&H27
$INLINE &H43,&H5E,&HE2,&HDC,&HEB,&H16,&HAD,&H56,&HC4,&H76,&H1E,&H26
$INLINE &H8E,&H04,&HAA,&HC4,&H76,&H16,&H26,&H8E,&H04,&H26,&H88,&H27,&H43
$INLINE &H5E,&HE2,&HEA,&H07,&H1F,&H5D
The assembly code for the above is:
' push bp
' mov bp,sp
' push ds
' push es
' lds si,[bp+38] ;NumBytes%
' mov cx,[si] ; to CX
' lds si,[bp+18] ;disp of attr str
' mov bx,[si] ; to BX
' lds di,[bp+14]
' mov ax,[di] ;Stringdisp%
' add bx,ax ;add string displacement
' lds di,[bp+6] ;Disp%
' mov dx,[di] ; to DX for now (SI later)
' lds di,[bp+26] ;disp of text str
' mov di,[di] ; to DI
' add di,ax ;add string displacement
' lds si,[bp+34] ;Retracemode%
' mov ax,[si] ; to AX
' lds si,[bp+10] ;Sourceseg%
' mov ds,[si] ; to DS
' mov si, dx ;Disp% to SI
' mov dx,03dah ;point DX to CGA status port
' shl si,1 ;displacement * 2 for source
' cld ;set string direction to forward
' or ax,ax
' jz .7 ;not retmode, use simpler routine
'.5: mov ah,9 ;move horiz. + vertical retrace
' ; mask to fast storage
'.9: in al,dx ;get 6845 status
' rcr al,1 ;check horizontal retrace
' jb .9 ;loop if in horizontal retrace:
' ; this prevents starting in mid
' ; retrace, since there is enough
' ; time for 1 and only 1 STOSW
' ; during horizontal retrace
' cli ;no ints during critical section
'.6: in al,dx ;get 6845 status
' and al,ah ;check for both kinds of retrace:
' ; if the video board does not
' ; report horizontal retrace while
' ; in vertical retrace, this will
' ; allow several characters to be
' ; stuffed in during vertical
' ; retrace
' jz .6 ;loop if zero. else clear to
' ; access video ram
' lodsw ;grab char + attribute).
' sti ;allow interrupts
' push si
' les si, [bp+30]
' mov es, es:[si]
' stosb ;get character
' les si, [bp+22]
' mov es, es:[si]
' mov es:[bx],ah ;get screen attribute
' inc bx ;increment ptr to scr attribute
' pop si
' loop .5 ;do cx (numbytes) times
' jmp short .8
'.7: lodsw ;grab character + attribute
' push si
' les si, [bp+30]
' mov es, es:[si]
' stosb ;get character
' les si, [bp+22]
' mov es, es:[si]
' mov es:[bx],ah ;get screen attribute
' inc bx ;increment ptr to scr attribute
' pop si
' loop .7 ;do cx (numbytes) times
'.8: pop es
' pop ds
' pop bp
===========================================================================
Change Five:
In file SCRNSUBS.BOX, sub SaveScreenArea, replace:
CALL ReadVid(NumberOfCols, Scrn.Retrace, SaveText$, SaveAttr$, SavePtr, _
Scrn.Segment, ScreenDisplacement + ((i - 1) * 80))
with:
CALL ReadVid(NumberOfCols, Scrn.Retrace, STRSEG(SaveText$), _
STRPTR(SaveText$), STRSEG(SaveAttr$), STRPTR(SaveAttr$), SavePtr, _
Scrn.Segment, ScreenDisplacement + ((i - 1) * 80))
>>> A note to toolbox users: If you call ReadVid yourself, instead of via
SaveScreenArea, be sure to change your parameters so that you pass the
segment and offset of the text and attribute strings, instead of the
strings themselves.
===========================================================================
Change Six:
The CLIENT.BAS demonstration program needs more than the default amount of
stack space. Increase it by putting a $STACK metastatement at the beginning
of CLIENT.BAS. $STACK 32000 definitely works, much smaller values are
likely to work as well.
===========================================================================