|
View Message | Back to Messages |
Peter Swinkels Fri Jan 17 2025 at 4:05 pm A mouse interrupt wrapper for CALL ABSOLUTE->
Hey Plasma, could you look at this assembly code?
; Mouse interrupt wrapper for QBasic's CALL ABSOLUTE.
push bp ; Save previous bp.
mov bp,sp ; Set new bp.
push si ; Save si.
mov ax,[bp+8] ; Load argument 1,
mov bx,[bp+10] ; 2,
mov dx,[bp+12] ; 3,
mov cx,[bp+14] ; 4.
int 0x33 ; Mouse.
mov si,[bp+8] ; First argument (ax).
mov [si],ax ; Save to argument 1,
mov [si+2],bx ; 2,
mov [si+4],dx ; 3,
mov [si+6],cx ; 4.
pop si ; Restore si,
pop bp ; bp.
ret 8 ; Return and remove the arguments from the stack.
===
DEFINT A-Z
DIM Int0x33 AS STRING
CLS
OPEN "INT0X33.BIN" FOR INPUT AS 1: CLOSE 1
OPEN "INT0X33.BIN" FOR BINARY AS 1
Int0x33 = INPUT$(LOF(1), 1)
CLOSE 1
ax = 2
DEF SEG = VARSEG(Int0x33)
CALL ABSOLUTE(ax, cx, dx, bx, SADD(Int0x33))
END
The binary is assembled with nasm. It is probably some very minor over sight on my part. I could use an extra pair of eyes here.
|
|