Recent posts

#31
OxygenBasic Examples / Re: Asm multiplication
Last post by Frank Brübach - May 21, 2024, 03:06:08 PM
Hi I have the solution

' multiplication of two values
'
byte val1
byte val2
int result ''resd 1
   
    val1=4
    val2=6 '

     mov eax,val1 
     mov eax,val2  ''multiply eax by ebx  "
     mul val1 'ebx 
     mov result,eax
     
print "the result of val1*val2 is " + str(result) '24
#32
Very interesting topic.
I often look into this. There are many videos on YouTube.

Most people say that they think its even more REAL then their previous life.
#33
OxygenBasic Examples / Re: Asm multiplication
Last post by Theo Gottwald - May 21, 2024, 09:39:18 AM
That is not a simple question, as you do not say what datatypes you want to multiply.
Then there may be differences in handling signed, unsigned Integer and/or FP-Data.
FP-Numbers can also be different formats.

Let me say that such questions get most easily answers if you just let AI explain it to you.



QuoteTo multiply two numbers in x86 assembly, you can use the mul instruction. Here is an example of how to multiply two numbers stored in the eax and ebx registers:

Move the first number into the eax register:
mov eax, first_number

Move the second number into the ebx register:
mov ebx, second_number

Multiply the two numbers using the mul instruction. The mul instruction multiplies the value in the eax register by the value in the specified register or memory location, and stores the result in the eax (lower 32 bits) and edx (upper 32 bits) registers:
mul ebx

The result of the multiplication is now stored in the eax register (if the result is less than 32 bits) or in the edx:eax register pair (if the result is 64 bits).
Here is the complete code:


section .data
    first_number dd 5
    second_number dd 10

section .bss
    result resd 1

section .text
    global _start

_start:
    ; load the first number into eax
    mov eax, [first_number]

    ; load the second number into ebx
    mov ebx, [second_number]

    ; multiply eax by ebx
    mul ebx

    ; store the result in [result]
    mov [result], eax

    ; exit the program
    mov eax, 1
    xor ebx, ebx
    int 0x80
In this example, the first number is 5 and the second number is 10. The result of the multiplication is 50, which is stored in the eax register.
#34
General Discussion / Re: Why is it so hard to retur...
Last post by Theo Gottwald - May 21, 2024, 09:35:51 AM


#35
General Discussion / Re: The future of ... PowerBas...
Last post by Theo Gottwald - May 21, 2024, 09:25:44 AM
Hallo Johann and anybody who can login to the Powerbasic Forum,
I can not download any stuff from the Powerbasic Forum, due they removed me some years ago.

If you find some interesting stuff there, you are free, to copy the posts - especially those with attachments to this forum.

When the PB Forum has been closed parts may still be available in the wayback machine but attachments will not.
#36
OxygenBasic Examples / Asm multiplication
Last post by Frank Brübach - May 21, 2024, 12:49:14 AM
Hello

Simple question I have how to multiply two values in asm?

' multiplication of two values
'
byte val1
byte val2
int result

macro myMul(val1,val2)
    val1=5
    val2=10

    ! mov eax,val1
    ''! mov eax,val2
    ! mul val2
    ! mov result,wax
end macro

'print "the result of val1*val2 is " + str(myMul(val1,val2)) 
'print "the result of val1*val2 is " + str(result) 
#37
OxygenBasic Examples / Re: Tabcontrol color
Last post by Zlatko Vid - May 20, 2024, 10:16:24 PM
Hi Pierre

I have troubles to get this work properly
I mean ..how to change at runtime color of edit control
i tried this:

ASE WM_CTLCOLOREDIT
'by Pierre Bellisle..
  select GetDlgCtrlID(lparam)
case ed1ID
             if theme = 4 : SetBkColor(wparam, RGB(43,42,54)): end if
                SetTextColor(wparam,RGB(240,230,230))     
              return darkBrush 'darkColor
         case else
              darkBrush = CreateSolidBrush(RGB(255,255,255))
             SetBkColor( wparam, RGB(255,255,255))
        if theme <> 4 : SetTextColor( wparam,RGB(0,0,0)) : end if
            return  darkBrush
       
  end select
#38
Professor Studied NDE's For 30 Years; What She Discovers Is Incredible (Near Death Experiences)

The Other Side NDE
13 feb 2024




Raymond Moody - Life After Death? - Suncoast In-Depth Podcast

Suncoast Community Church Video
26 mar 2024


#39
General Discussion / Re: The future of ... PowerBas...
Last post by Johan Klassen - May 20, 2024, 03:46:01 PM
I have no problem signing in to their forum
my opinion is that powerbasic will shut down including the forum
#40
General Discussion / Re: Why is it so hard to retur...
Last post by Charles Pegge - May 20, 2024, 03:21:25 PM
The ascent propulsion system of the Lunar module  ???

https://en.wikipedia.org/wiki/Ascent_propulsion_system