View difference between Paste ID: zPwkn5RM and tk0J0Cai
SHOW: | | - or go back to the newest paste.
1-
DECLARE FUNCTION AddrOfSetUEvent&
1+
		UEVENT ON:  ON UEVENT GOSUB EventISR
2
        ' *** Create ISR code for events ***
3-
DEFLNG L
3+
        DIM iSeg AS INTEGER, iOff AS INTEGER
4-
DEFINT I
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-
lPev = AddrOfSetUEvent '<- asm that return seg:off of SetUEvent()
6+
        lSeg = (((lPev AND &HFFFF0000) \ &H10000) AND &HFFFF&)
7
        lOff = (lPev AND &HFFFF&)
8-
'split seg/off
8+
        PRINT HEX$(lSeg) + ":" + HEX$(lOff) '<-prints seg:off of SetUEvent
9-
iSeg = (CINT((lPev AND &HFFFF0000) \ &H10000))
9+
        lSeg = lSeg * 256&: lOff = lOff * 256&
10-
iOff = (lPev AND &HFFFF&)
10+
11
		'inlined assembly hehe'
12-
CLS
12+
        lsr(0) = &H90000068 + lSeg 'push 0000h  / nop
13
        lsr(1) = &H60000068 + lOff 'push 0000h  / pusha
14-
UEVENT ON
14+
        lsr(2) = &H5EFFEC8B        'mov bp,sp / call far [bp+10h]
15-
ON UEVENT GOSUB Load
15+
        lsr(3) = &HE620B010        'mov al,20 / out 20,al
16
        lsr(4) = &HC4836120        'popa / add sp, 4
17-
DO
17+
        lsr(5) = &HCF04            'iret