flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
bitRAKE 17 May 2020, 22:54
No reason not to use the direct call interface on the Scintilla control:
Code: ; NOTE: remove the indirection so the handles can be used directly setInfo: ; void setInfo(NppData notpadPlusData) push qword [rcx] push qword [rcx+8] push qword [rcx+16] pop [scintillaSecondHandle] pop [scintillaMainHandle] pop [nppHandle] enter 32,0 xor r9,r9 xor r8,r8 mov edx,SCI_GETDIRECTFUNCTION mov rcx,[scintillaMainHandle] call[SendMessageW] mov [CallScintilla],rax xor r9,r9 xor r8,r8 mov edx,SCI_GETDIRECTPOINTER mov rcx,[scintillaMainHandle] call[SendMessageW] mov [CallScintilla.windows],rax xor r9,r9 xor r8,r8 mov edx,SCI_GETDIRECTPOINTER mov rcx,[scintillaSecondHandle] call[SendMessageW] mov [CallScintilla.windows+8],rax leave retn ; use direct call interface ; view: reg64, [memory] or literal 0 or 1 ; msg: messages defined in Scintilla documentation ; lp,wp: parameters, support ADDR for address calculation macro sciCall view*,msg*,lp=0,wp=0 iterate <R,P>, R8,lp, R9,wp match =0,P xor R,R else match =ADDR? M,P lea R,M else match =R,R ; do nothing is an option else mov R,P end match end iterate mov edx,msg match [M],view movzx ecx,byte[M] mov rcx,[CallScintilla.windows + rcx*8] else mov rcx,[CallScintilla.windows + view*8] end match call [CallScintilla] end macro CallScintilla rq 1 .windows rq 2 ; npp currently only has two Scintilla windows ...and I left out the two most important links: https://github.com/notepad-plus-plus/npp-usermanual/blob/master/content/docs/plugin-communication.md https://www.scintilla.org/ScintillaDoc.html ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.