News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

My ChatGPT+Gemini coding Experiments

Started by zedd151, December 30, 2024, 03:40:41 PM

Previous topic - Next topic

jj2007


guga

Quote from: stoo23 on March 25, 2025, 08:04:53 AMI had placed that file on our server, a while ago and is available via this link:
https://masm32.com/files/GDIPLUS.zip

:thumbsup:

Tks Stoo. I downloaded the one from JJ, but it is good to know there´s a copy in masm site.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

stoo23

Quote from: zedd151 on March 25, 2025, 08:26:30 AMMaybe make a topic for it stoo, and possibly other useful .chm files, in the Reference section? So it can be readily found?
Sure, can do.
If there are other files any of you think Should be available on our server, let me know, so we can organize to upload them and include them via links in the Reference section.


Quote from: guga on March 25, 2025, 11:26:25 AMTks Stoo. I downloaded the one from JJ, but it is good to know there´s a copy in masm site.
:thup:  No Prob's, just wanted you guys to know, there was a copy easily available, for future reference  :wink2:  :smiley:

daydreamer

Zedd,I thought this thread was test AI abilities and learn from that of what tasks it's useful for

Actually writing a windows program in either using c skills or masm skills, the only cpp part necessary is creating the windows class,you can avoid all cpp class programming if you want or not
But you can subclass button in both cpp and masm if you prefer that coding style over handle it in wndproc message handler

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

zedd151

Quote from: daydreamer on March 26, 2025, 08:01:00 PMZedd,I thought this thread was test AI abilities and learn from that of what tasks it's useful for
I was specifically testing AI's coding ability here, in C as well as masm compatible assembly.

But you can post about anything, anywhere that you would like Magnus.

But if you want any good type of responses, what you post should follow the general flow of the converstaion underway, imho.

You seem to be the only member in this topic posting about converting human spoken/written languages, as opposed to 'programming specific' languages like C or assembly. A totally different context.

For better responses from members that also need reliable translations to their local languages, or from their local language to another, maybe start a dedicated topic for it? Just a suggestion.  :smiley:

I have slightly altered the topic title to avoid any further confusion, that might have been caused by the simpler title.

¯\_(ツ)_/¯   :azn:

'As we don't do "requests", show us your code first.'  -  hutch—

daydreamer

Zedd
I have posted about why it's indirectly coding related in game forum


my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

zedd151

#66
Quote from: daydreamer on March 27, 2025, 05:06:54 PMZedd
I have posted about why it's indirectly coding related in game forum
That's fine, daydreamer. But you really didn't have to.

There was a big difference in what you had posted about here imo, compared to what others were posting about here. That is all I was saying.
¯\_(ツ)_/¯   :azn:

'As we don't do "requests", show us your code first.'  -  hutch—

jj2007

How can you load a textfile in an array of strings using MasmBasic?
ChatGPT:
In MasmBasic, you can load a text file into an array of strings using the FileRead$ macro along with Split$ to break the content into individual lines. Here's how you can do it:

include \masm32\MasmBasic\MasmBasic.inc  ; include MasmBasic
SetGlobals hFile, pText, numLines        ; define global variables

.code
start:
    Init                                    ; initialize MasmBasic
    .if FileRead$("example.txt")            ; read file into memory
        Print Str$("File size: %i bytes\n", eax)  ; print file size
        Split$(eax, "\n")                  ; split file content by newline
        mov numLines, eax                  ; store number of lines
       
        ; Loop through lines and print them
        xor ecx, ecx                        ; start at line 0
    @@:
        PrintLine L$([ecx])                ; print each line
        inc ecx
        cmp ecx, numLines
        jb @B                              ; loop until all lines printed
    .else
        MsgBox 0, "File not found!", "Error", MB_OK
    .endif

    Inkey                                  ; wait for key press
    Exit                                    ; exit program
end start

It looks remarkably convincing, but it will not assemble: three little errors. Besides, Split$() works but Recall would be the better function.

What is astonishing is that it adds correct comments. I have no idea where ChatGPT finds these comments - they are definitely not mine :cool:

In short: Don't trust it!

zedd151

Are you saying jj, that ChatGPT is actually learning? (By adding correct comments.)
When I asked for masm syntax assembly code, the comments added are very similar to the comments it adds to an equivalent C source code. I don't remember if it was chatgpt or one of the other AI models though. I don't have those sources anymore.
It was either a message box example or a bare bones window example, iirc. Something kind of simple.

¯\_(ツ)_/¯   :azn:

'As we don't do "requests", show us your code first.'  -  hutch—

guga

ChatGPT, deepseek and Grok, seems to be continuing 'learning', the more you feed their databases.
ChatGPT has many flaws yet. It´s not unusual it answer what you want to hear, like if it was simply patronizing you, instead fixing something that is needed.
Gemini, i don´t use it that often, i tried to use it sometime ago, but it kept producing bad results, or simply resulting in "i´m unable to help....and bla bla bla"
Deepseek, seems to me more like an copy of chatgpt, but in fact produces a more reliable code more often than ChatGPT.
Grok, in the other hand, is really incredible (The site and the version used in X), it don´t try to patronize you and in fact, seems to try to hunt for bugs, rather than show what it 'thinks' you want to read.
But, all of those i tested, has his pros and cons, none of them are perfect, and it is wise to use all of the 3 when one fails to accomplish a given task. For instance, you feed a code in chatgpt and if chatgpt continues to give you faultive code, you use one of it´s results (or logic) onto deepseek, if it also fails, you do the same with Grok...or vice-versa.
Grok, for example i don´t need to insert anymore the default RosAsm macro set on each session, it seems to understand what some of them are doing, and tries to do what u asked. This is something chagpt lacks, because i had to input on each session some of the macro sets since it failed to understand what it was doing. Deepseek also has a good way to imply the logic without having to feed each session with the same default macro set.
Also, they seems to produce reasonable code when u try to port C code to Asm, or maybe try to port RosAsm syntax to masm syntax etc. Didn´t tried that too much yet, but for what i saw the convertions from C to Asm it seems possible.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

NoCforMe

I'm sorry; I just don't understand this at all. At all.
For chrissakes: you're a programmer, right?
Why would you abdicate that role and ask some stupid machine to write code for you?

Hey, in the future, who needs puny hue-mons anyhow? The machines will just write code for the new machines.

Tell me what I'm missing here ...
Assembly language programming should be fun. That's why I do it.

guga

Quote from: NoCforMe on March 28, 2025, 11:22:09 AMI'm sorry; I just don't understand this at all. At all.
For chrissakes: you're a programmer, right?
Why would you abdicate that role and ask some stupid machine to write code for you?

Hey, in the future, who needs puny hue-mons anyhow? The machines will just write code for the new machines.

Tell me what I'm missing here ...

In what is related to programming, IA (Regardless which you use) is basically a faster way for hunt for bugs or to port from one language to another or if you want to develop some functions etc a bit more faster when u don´t have enough free time. None of them are to be used 100% in replacement of a normal work someone is doing. It´s just a additional programming tool, IMHO. (Good one, btw, but just this: another programming tool when used as such)
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

zedd151

Quote from: NoCforMe on March 28, 2025, 11:22:09 AMI'm sorry; I just don't understand this at all. At all.
For chrissakes: you're a programmer, right?
Why would you abdicate that role and ask some stupid machine to write code for you?

Hey, in the future, who needs puny hue-mons anyhow? The machines will just write code for the new machines.

Tell me what I'm missing here ...
Fear Not!  :tongue:
Quote from: zedd151 on March 14, 2025, 01:24:05 PMI get about 25% reliability out of these AI models. In either C code or assembly, on average only 25% of the code produced had correct results and no compile or assembly errors.  :cool:  It was kind of fun playing with it. I lost two or three days while doing so.  :eusa_boohoo:
At a 25% reliability rate AI won't be replacing any programmers any time soon, NoCforMe.
Even lazy programmers like me.  :biggrin:
¯\_(ツ)_/¯   :azn:

'As we don't do "requests", show us your code first.'  -  hutch—

NoCforMe

Quote from: zedd151 on March 28, 2025, 12:18:01 PM
Quote from: NoCforMe on March 28, 2025, 11:22:09 AMI'm sorry; I just don't understand this at all. At all.
For chrissakes: you're a programmer, right?
Why would you abdicate that role and ask some stupid machine to write code for you?

Hey, in the future, who needs puny hue-mons anyhow? The machines will just write code for the new machines.

Tell me what I'm missing here ...
Fear Not!  :tongue:
Quote from: zedd151 on March 14, 2025, 01:24:05 PMI get about 25% reliability out of these AI models. In either C code or assembly, on average only 25% of the code produced had correct results and no compile or assembly errors.  :cool:  It was kind of fun playing with it. I lost two or three days while doing so.  :eusa_boohoo:
At a 25% reliability rate AI won't be replacing any programmers any time soon, NoCforMe.
Even lazy programmers like me.  :biggrin:


True enough. And it'll never get to 95% either.

But what scares me is if it starts approaching, say, 60%, because at some point the boosters, the cheerleaders, the marketroids, the techno-bros, the fanbois behind "AI" are going to declare that it's good enough and can therefore be relied upon for real production work. And all the unwashed masses will believe them.

In which case we are well and truly fucked. I leave it to you to fill in the gory details ...
Assembly language programming should be fun. That's why I do it.

zedd151

Technology marches on, whether any individuals or groups like it or not.
By the time AI reaches any type of 'maturity' (where it can conceivably replace humans) most software will be cloud based, including operating systems.

The home computer will basically be just a terminal of sorts by then, to connect to 'the cloud'.

Hell, I would even venture further...  With the right technology, we wouldn't need physical computers any more. We would have direct connection by a jack in our skull to connect to the cloud... Matrix, anyone?

That is when reality meets sci-fi. At that point, we WILL be screwed.

In the meantime I will still be happily writing my buggy code, until I am pushing up daisies.  :tongue:
¯\_(ツ)_/¯   :azn:

'As we don't do "requests", show us your code first.'  -  hutch—