Author Topic: Happy Mathematics  (Read 2191 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Happy Mathematics
« on: December 12, 2011, 10:08:20 AM »
Deleted

« Last Edit: April 11, 2015, 10:14:17 AM by Peter »

Charles Pegge

  • Guest
Re: Happy Mathematics
« Reply #1 on: December 13, 2011, 01:52:59 PM »

Thanks Peter,I'll come back this thread as soon as I can.

Charles Pegge

  • Guest
Re: Happy Mathematics
« Reply #2 on: December 16, 2011, 02:27:00 PM »

Hi Peter,

Santa Looking and Space Dog GPF because the LoadBmp frame param was set to 0 instead of 1.

LoadBmp Filename, Frames

Otherwise working nicely :)

Charles

Charles Pegge

  • Guest
Re: Happy Mathematics
« Reply #3 on: December 16, 2011, 07:16:06 PM »

Thanks for the Win64 update Peter.

But could you please change the return type for GetAsyncKeyState to short


Charles Pegge

  • Guest
Re: Happy Mathematics
« Reply #4 on: December 16, 2011, 07:20:15 PM »
To demonstrate how to how to handle the different string types in Assembler:

32bit Christmas

Code: [Select]
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 cap[]= "The 32Bit world of OxygenBasic..."
zstring msg[]= "Hello Christmas"

push  0
lea   eax,cap
push  eax
lea eax,msg
push eax
push  0
call  MessageBox


bstring cap= "The 32Bit world of OxygenBasic..."
bstring msg= "Hello Christmas"

push  0
push  cap
push  msg
push  0
call  MessageBox


string cap= "The 32Bit world of OxygenBasic..."
string msg= "Hello Christmas"

push  0
mov   eax,cap
push  [eax]
mov eax,msg
push [eax]
push  0
call  MessageBox


64bit Christmas

Code: [Select]

$FileName "t.exe"
#include  "..\..\inc\RTL64.inc"

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



sub rsp,32

zstring cap[]= "The 64Bit world of OxygenBasic..."
zstring msg[]= "Happy Christmas"

mov  rcx, 0
lea  rdx, msg
lea  r8,  cap
mov  r9,  0
call MessageBox


bstring cap= "The 64Bit world of OxygenBasic..."
bstring msg= "Happy Christmas"

mov  rcx, 0
mov  rdx, msg
mov  r8,  cap
mov  r9,  0
call MessageBox


string cap= "The 64Bit world of OxygenBasic..."
string msg= "Happy Christmas"

mov  rcx, 0
mov  rdx, msg
mov  rdx,[rdx]
mov  r8,  cap
mov  r8,[r8]
mov  r9,  0
call MessageBox

add rsp,32


Charles
« Last Edit: December 16, 2011, 08:24:42 PM by Charles Pegge »