Of Mice and Ray Stevens

 BBS: Inland Empire Archive
Date: 11-30-92 (11:08)             Number: 395
From: STEVE GARTRELL               Refer#: NONE
  To: TONY ELLIOT                   Recvd: NO  
Subj: Of Mice and Ray Stevens        Conf: (2) Quik_Bas
;I did use a slightly method for linkable approach.
; Just for your amusement....|-}
   .model medium, basic

   EXTRN BASIC SetUevent:PROC

   .code
axREG   dw      0
bxREG   dw      0
cxREG   dw      0
dxREG   dw      0
siREG   dw      0
diREG   dw      0
dsREG   dw      0


MousEv  PROC

Start:
 ; might call with "any event" mask so
 ;  prevent overworking...
 nop
 mov     BYTE PTR cs:start, 0CBh
 push    bp
 pushf
 push    es
 push    ds
 push    di
 push    si
 push    dx
 push    cx
 push    bx
 push    ax

 mov     di, ss           ;stack/data seg to ds
 mov     ds, di

 mov     si, sp           ;stack address for regs to si
 cld

 mov     di, cs           ;code seg es
 mov     es, di
 mov     di, OFFSET axREG ;code offset to di

 mov     cx, 07h          ;save ax,bx,cx,dx,si,di,ds
 rep     movsw
 mov     cx, ds
 mov     es, cx           ;es = ds

 call    FAR PTR SetUevent

 pop     ax
 pop     bx
 pop     cx
 pop     dx
 pop     si
 pop     di
 pop     ds
 pop     es
 popf
 pop     bp
 mov     BYTE PTR cs:start, 90h
 retf

MousEv  ENDP

SetUp   PROC FAR USES ax cx dx es ds, WhichEvents:WORD

 mov     dx, SEG MousEv
 mov     es, dx
 mov     dx, OFFSET MousEv
 mov     cx, WhichEvents
 mov     ax, 0Ch
 int     33h
 ret

SetUp   ENDP

ReadMouse   PROC FAR USES cx si di es ds, DestType:FAR PTR WORD

 cld
 les     di, DestType  ;QB/PDS/VBDOS user def type
 mov     si, SEG axREG
 mov     ds, si
 mov     si, OFFSET axREG
 mov     cx, 07h
 rep     movsw
 ret

ReadMouse   ENDP

 END     ;this is the end, FIDO


--- D'Bridge 1.30/071082
 * Origin: RadioLink! Columbus, OH (614)766-2162 HST/DS (1:226/140)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET