Advertisement
Mysoft

Untitled

Aug 11th, 2023
2,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         UEVENT ON:  ON UEVENT GOSUB EventISR
  2.         ' *** Create ISR code for events ***
  3.         DIM iSeg AS INTEGER, iOff AS INTEGER
  4.         lPev = AddrOfSetUEvent 'lib call to get ptr for qb internal func
  5.         IF lPev = 0 THEN PRINT "addr of SetUEvent failed...": END '<- safety
  6.         lSeg = (((lPev AND &HFFFF0000) \ &H10000) AND &HFFFF&)
  7.         lOff = (lPev AND &HFFFF&)
  8.         PRINT HEX$(lSeg) + ":" + HEX$(lOff) '<-prints seg:off of SetUEvent
  9.         lSeg = lSeg * 256&: lOff = lOff * 256&
  10.  
  11.         'inlined assembly hehe'
  12.         lsr(0) = &H90000068 + lSeg 'push 0000h  / nop
  13.         lsr(1) = &H60000068 + lOff 'push 0000h  / pusha
  14.         lsr(2) = &H5EFFEC8B        'mov bp,sp / call far [bp+10h]
  15.         lsr(3) = &HE620B010        'mov al,20 / out 20,al
  16.         lsr(4) = &HC4836120        'popa / add sp, 4
  17.         lsr(5) = &HCF04            'iret           
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement