NO

Author Topic: ChatGPT examples  (Read 2076 times)

Offline Vortex

  • Member
  • *
  • Posts: 655
    • http://www.vortex.masmcode.com
Re: ChatGPT examples
« Reply #15 on: April 23, 2023, 01:11:23 PM »
Question : Create a Windows based hello world example with Pelle's macro assembler Poasm.

ChatGPT's output :

Code: [Select]
; Program to print "Hello, World!" to the console in Windows

format PE console
entry start

section '.data' data readable writeable

message db 'Hello, World!', 0

section '.text' code readable executable

start:
    ; Print the message to the console
    push dword -11
    call [GetStdHandle]
    mov dword [handle], eax
    push dword 0
    push dword message
    push dword 13
    push dword [handle]
    call [WriteConsoleA]

    ; Exit the program
    push dword 0
    call [ExitProcess]

section '.idata' import data readable

library kernel32, 'kernel32.dll',\
        user32, 'user32.dll'

import kernel32,\
       ExitProcess, 'ExitProcess',\
       GetStdHandle, 'GetStdHandle',\
       WriteConsoleA, 'WriteConsoleA'

section '.data' data readable writeable

handle dd ?

Naturally, this is the syntax of the Flat Assembler and not Poasm.
Code it... That's all...

Offline John Z

  • Member
  • *
  • Posts: 660
Re: ChatGPT examples
« Reply #16 on: April 26, 2023, 10:44:57 PM »
Google BARD released a pseudo-coder too now .... "Coders can choose from 20+ different coding languages too...."

https://www.tomsguide.com/news/googles-bard-ai-can-now-write-code-heres-how-to-use-it

John Z


Offline Vortex

  • Member
  • *
  • Posts: 655
    • http://www.vortex.masmcode.com
Re: ChatGPT examples
« Reply #17 on: April 27, 2023, 09:19:34 PM »
Quote
Question : What are differences between the macro engines of Masm and Poasm?

Quote
Masm (Microsoft Macro Assembler) and Poasm (Pelle's Macro Assembler) are both macro assemblers that support the x86 architecture. While they are similar in many respects, there are some differences between their macro engines:

Syntax: Masm and Poasm use slightly different syntax for defining and invoking macros. Masm uses the MACRO and ENDM directives to define a macro and the INVOKE directive to invoke it, while Poasm uses the macro and endm directives to define a macro and the invoke directive to invoke it.

Parameter passing: Masm and Poasm handle parameter passing differently. Masm passes parameters using the stack, while Poasm uses registers.

Macro expansion: Masm and Poasm expand macros differently. Masm expands macros recursively, which can lead to excessive code duplication if macros are not written carefully. Poasm expands macros non-recursively, which can result in more efficient code generation.

Error checking: Masm and Poasm perform error checking differently. Masm checks for errors during the expansion phase, while Poasm checks for errors during the assembly phase.

Overall, both Masm and Poasm are powerful macro assemblers that are widely used in the industry. The choice between the two largely depends on personal preference and specific project requirements.

ChatGPT is serioulsy confused here.
Code it... That's all...

Offline John Z

  • Member
  • *
  • Posts: 660
Re: ChatGPT examples
« Reply #18 on: August 09, 2023, 01:28:28 AM »
More test results
https://www.theregister.com/2023/08/07/chatgpt_stack_overflow_ai/

“ ChatGPT, OpenAI's fabulating chatbot, produces wrong answers to software programming questions more than half the time, according to a study from Purdue University. That said, the bot was convincing enough to fool a third of participants.”


John Z


Offline Vortex

  • Member
  • *
  • Posts: 655
    • http://www.vortex.masmcode.com
Re: ChatGPT examples
« Reply #19 on: August 09, 2023, 03:26:00 PM »
Hi John,

The incorrect results are not unexpected. ChatGPT and similar tools will evolve and we will get no perfect but better results.
Code it... That's all...

Offline KunJohn

  • Member
  • *
  • Posts: 3
Re: ChatGPT examples
« Reply #20 on: September 23, 2023, 02:25:10 PM »
I read somewhere recently that AI already uses probably 9 programming languages..but integrating AI software into an already diverse business environment requires the use of a range of programming tools, such as several languages, frameworks and libraries. These technologies often require extraordinary competence and expertise.

Offline Vortex

  • Member
  • *
  • Posts: 655
    • http://www.vortex.masmcode.com
Re: ChatGPT examples
« Reply #21 on: September 23, 2023, 08:56:37 PM »
Hi KunJohn,

Welcome to Pelles C forum.

I agree with you. The artificial intelligence is powered by big compainies investing a lot of efforts and money. Time will help to improve the quality of the code written by the artificial intelligence.
Code it... That's all...