I need help on this program below I got from another tutorial site. For some reason it doesn't work because of the PCOPY within it. Plus it comes up with another error #499 I think and highlights the CALL absolute as the error. PCOPY is a statement which is used in Quickbasic or Qbasic. I've even tried it in quickbasic but still doesn't work.
'-------------| START MOUSE PROGRAM (START COPYING HERE)--------------------
DEFINT A-Z
DECLARE SUB mouse (cx, dx, bx)
DECLARE SUB MousePointer (SW)
DIM SHARED a(9) 'Set up array for code
DEF SEG = VARSEG(a(0)) 'Get array segment (nnnn: )
' (two 8 bit)
FOR i = 0 TO 17 'length of DATA to
READ r 'read
POKE VARPTR(a(0)) + i, r 'into array/2 (nnnn:iiii) (one 8 bit)
NEXT i 'until 17
'**************************** Machine Code *********************************
DATA &HB8,&H00,&H00 : ' mov AX,[n] [Swap code-(L),(H)] in AX
DATA &H55 : ' push BP Save BP
DATA &H8B,&HEC : ' mov BP,SP Get BP to c Seg
DATA &HCD,&H33 : ' int 33 Interrupt 33
DATA &H92 : ' xchg AX,[reg] [Swap code-reg] in AX
DATA &H8B,&H5E,&H06 : ' mov BX,[BP+6] Point to (variable)
DATA &H89,&H07 : ' mov [BX],AX Put AX in (variable)
DATA &H5D : ' pop BP Restore BP
DATA &HCA,&H02,&H00 : ' ret 2 Far return
SCREEN 13
'****************************** Mouse set up ******************************
CALL MousePointer(0) 'Reset mouse and
CALL MousePointer(1) 'turn pointer on
CALL MousePointer(3) 'Get coordinates
'****************************** P R O G R A M ******************************
DO 'Put your code here
CALL mouse(cx, dx, bx)
LOCATE 1, 1: PRINT dx; cx; bx
LOOP UNTIL INKEY$ = CHR$(27) 'Stop your code here
END
SUB mouse (cx, dx, bx)
POKE VARPTR(a(4)), &H92 'Swap code,Get CX setup
CALL absolute(cx, VARPTR(a(0))) 'Run Code
' cx = cx / 8 'Adjust 25x80
POKE VARPTR(a(4)), &H91 'Swap code,Get DX setup
CALL absolute(dx, VARPTR(a(0))) 'Run Code
dx = dx / 2 'Adjust 25x80
POKE VARPTR(a(4)), &H93 'Swap code,Get BX setup
CALL absolute(bx, VARPTR(a(0))) 'Run Code
'Note :
'Remove the /8
'for graphics modes.
END SUB
SUB MousePointer (SW)
POKE VARPTR(a(0)) + 1, SW 'Swap code,Set AX = (SW)
CALL absolute(c, VARPTR(a(0))) 'Run Code
'Note:
'SW = 0-reset
'SW = 1-on
'SW = 2-off
'SW = 3-coordinates
END SUB
'-------------| START MOUSE PROGRAM (START COPYING HERE)--------------------
DEFINT A-Z
DECLARE SUB mouse (cx, dx, bx)
DECLARE SUB MousePointer (SW)
DIM SHARED a(9) 'Set up array for code
DEF SEG = VARSEG(a(0)) 'Get array segment (nnnn: )
' (two 8 bit)
FOR i = 0 TO 17 'length of DATA to
READ r 'read
POKE VARPTR(a(0)) + i, r 'into array/2 (nnnn:iiii) (one 8 bit)
NEXT i 'until 17
'**************************** Machine Code *********************************
DATA &HB8,&H00,&H00 : ' mov AX,[n] [Swap code-(L),(H)] in AX
DATA &H55 : ' push BP Save BP
DATA &H8B,&HEC : ' mov BP,SP Get BP to c Seg
DATA &HCD,&H33 : ' int 33 Interrupt 33
DATA &H92 : ' xchg AX,[reg] [Swap code-reg] in AX
DATA &H8B,&H5E,&H06 : ' mov BX,[BP+6] Point to (variable)
DATA &H89,&H07 : ' mov [BX],AX Put AX in (variable)
DATA &H5D : ' pop BP Restore BP
DATA &HCA,&H02,&H00 : ' ret 2 Far return
SCREEN 13
'****************************** Mouse set up ******************************
CALL MousePointer(0) 'Reset mouse and
CALL MousePointer(1) 'turn pointer on
CALL MousePointer(3) 'Get coordinates
'****************************** P R O G R A M ******************************
DO 'Put your code here
CALL mouse(cx, dx, bx)
LOCATE 1, 1: PRINT dx; cx; bx
LOOP UNTIL INKEY$ = CHR$(27) 'Stop your code here
END
SUB mouse (cx, dx, bx)
POKE VARPTR(a(4)), &H92 'Swap code,Get CX setup
CALL absolute(cx, VARPTR(a(0))) 'Run Code
' cx = cx / 8 'Adjust 25x80
POKE VARPTR(a(4)), &H91 'Swap code,Get DX setup
CALL absolute(dx, VARPTR(a(0))) 'Run Code
dx = dx / 2 'Adjust 25x80
POKE VARPTR(a(4)), &H93 'Swap code,Get BX setup
CALL absolute(bx, VARPTR(a(0))) 'Run Code
'Note :
'Remove the /8
'for graphics modes.
END SUB
SUB MousePointer (SW)
POKE VARPTR(a(0)) + 1, SW 'Swap code,Set AX = (SW)
CALL absolute(c, VARPTR(a(0))) 'Run Code
'Note:
'SW = 0-reset
'SW = 1-on
'SW = 2-off
'SW = 3-coordinates
END SUB
Comment