Msgbox asm

Started by Frank Brübach, May 06, 2024, 07:48:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frank Brübach

Hello Charles

Can you Help for this msgbox expl with asm?
Doesn't Work Here

' uses corewin
' msgbox 64 bit
'
print "ok"

Declare Function MessageBox Lib "user32.dll" alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

zstring tit[] ="The great world of OxygenBasic..."
zstring msg[] ="Happy Easter"

sub  rsp,32
mov  r9d, 0 ' error here     
lea  r8,  tit   
lea  rdx, msg   
mov  rcx, 0       
call MessageBox
add  rsp,32

print "not ok2"

Charles Pegge

#1
Needs to use 32bit asm with the 32bit default oxygen.dll

Declare Function MessageBox Lib "user32.dll" alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

zstring tit[] ="The great world of OxygenBasic..."
zstring msg[] ="Happy Easter"

'32bit asm
'=========
push 0 '1
addr eax,tit
push eax
addr eax,msg
push eax
push 0
call MessageBox

But you can create a 64bit binary instead of a JIT:

$filename "t.exe"
uses rtl64
'msgbox 64 bit
'
Declare Function MessageBox Lib "user32.dll" alias "MessageBoxA" (ByVal hwnd As sys, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

zstring tit[] ="The great world of OxygenBasic..."
zstring msg[] ="Happy Easter"

sub  rsp,32
mov  r9d, 0     
lea  r8,  tit   
lea  rdx, msg   
mov  rcx, 0       
call MessageBox
add  rsp,32