Author Topic: How to return a structure  (Read 850 times)

jj2007

  • Member
  • *****
  • Posts: 13944
  • Assembly is fun ;-)
    • MasmBasic

jj2007

  • Member
  • *****
  • Posts: 13944
  • Assembly is fun ;-)
    • MasmBasic
Re: How to return a structure
« Reply #1 on: April 21, 2022, 02:26:37 AM »
NYT:
Quote
A few months after GPT-3 went online, the OpenAI team discovered that the neural net had developed surprisingly effective skills at writing computer software, even though the training data had not deliberately included examples of code. It turned out that the web is filled with countless pages that include examples of computer programming, accompanied by descriptions of what the code is designed to do; from those elemental clues, GPT-3 effectively taught itself how to program. (OpenAI refined those embryonic coding skills with more targeted training, and now offers an interface called Codex that generates structured code in a dozen programming languages in response to natural-language instructions.)

Biterider

  • Member
  • *****
  • Posts: 1082
  • ObjAsm Developer
    • ObjAsm
ChatGPT Caused 'Code Red' at Google
« Reply #2 on: December 28, 2022, 06:39:06 PM »
Hi
There is a big hype on ChatGPT. I have tried it quickly and found that it also handles a bit of MASM programming, but not too much  :eusa_dance:

Google seems to be worried about the capabilities of the bot:
https://www.cnet.com/tech/services-and-software/chatgpt-caused-code-red-at-google-report-says/

Biterider

jj2007

  • Member
  • *****
  • Posts: 13944
  • Assembly is fun ;-)
    • MasmBasic
Re: How to return a structure
« Reply #3 on: December 28, 2022, 08:43:25 PM »
Google is worried??? I am worried!

Quote
Can I have a hello world in x86 assembly?
Sure! Here is a simple "Hello, World!" program in x86 assembly language:

Copy code
section .data
    msg db 'Hello, World!',0

section .text
    global _start

_start:
    mov eax, 4
    mov ebx, 1
    mov ecx, msg
    mov edx, 13
    int 0x80

    mov eax, 1
    xor ebx, ebx
    int 0x80
This program prints "Hello, World!" to the console using the Linux system call write. The write system call writes data to a file descriptor, in this case the standard output (file descriptor 1). The int 0x80 instruction is used to invoke system calls in Linux.

The program consists of two sections: a .data section and a .text section. The .data section is used to define initialized data, such as the string "Hello, World!". The .text section contains the program's instructions.

The global _start directive tells the linker that the symbol _start is to be made available to other modules. The _start label marks the beginning of the program's execution.

The program first loads the values 4, 1, msg, and 13 into the registers eax, ebx, ecx, and edx, respectively. The value 4 in eax specifies the write system call, the value 1 in ebx specifies the standard output, the value in ecx specifies the address of the message to be written, and the value in edx specifies the length of the message. The program then invokes the write system call with the int 0x80 instruction.

Finally, the program terminates with the exit system call (system call number 1). The program loads the value 1 into eax to specify the exit system call, and then sets ebx to 0 and invokes the exit system call with the int 0x80 instruction.

I hope this helps! Let me know if you have any questions.

However, if you ask...
Can I have a hello world in x86 assembly for Windows?
... you get this, plus suggestions to assemble and link it with NASM:

Code: [Select]
.386
.model flat, stdcall

.data
message db 'Hello, World!', 0

.code

start:
    mov edx, offset message
    mov ecx, 13
    mov ebx, 1
    mov eax, 4
    int 0x80

    mov eax, 1
    xor ebx, ebx
    int 0x80

end start

Biterider

  • Member
  • *****
  • Posts: 1082
  • ObjAsm Developer
    • ObjAsm
Re: How to return a structure
« Reply #4 on: December 28, 2022, 09:10:50 PM »
Hi
That was my experience as well.
If you try other languages like Python, the performance is way better.
I am sure that it is only a matter of time that it will become a very good and powerful tool.

Biterider

zedd151

  • Member
  • *****
  • Posts: 1957
Re: How to return a structure
« Reply #5 on: December 29, 2022, 12:42:00 AM »
However, if you ask...
Can I have a hello world in x86 assembly for Windows?
... you get this, plus suggestions to assemble and link it with NASM:
  :tongue:  Only a matter of time before it learns not only about macros, but also how to create it's own macros and use them. Beware! :badgrin:
By then Masm coders will de doomed.  :rolleyes:

Regards, zedd.
:tongue:

daydreamer

  • Member
  • *****
  • Posts: 2395
  • my kind of REAL10 Blonde
Re: How to return a structure
« Reply #6 on: December 29, 2022, 08:44:20 PM »
However, if you ask...
Can I have a hello world in x86 assembly for Windows?
... you get this, plus suggestions to assemble and link it with NASM:
  :tongue:  Only a matter of time before it learns not only about macros, but also how to create it's own macros and use them. Beware! :badgrin:
By then Masm coders will de doomed.  :rolleyes:
Well there is a probability that one of us asm coder taught it some part of asm coding, by earlier published code and if you are only hobby coder no worries, but if you are professional programmer you might worry that free Ai bot advice makes you unemployed
my none asm creations
http://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

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How to return a structure
« Reply #7 on: December 31, 2022, 09:36:05 AM »
I would not hold your breath for these predictions to come true.  :tongue:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: How to return a structure
« Reply #8 on: December 31, 2022, 04:33:51 PM »
I would not hold your breath for these predictions to come true.  :tongue:

I'm with you here. However, just to guard against the possibility of being taken over by Eeeevil Robotic Overlords, I have an idea: start sowing programming poison pills everywhere. Post code that works, but just barely, and is the worst code ever. And somehow make sure that these posts rise to the top of Google searches. Flood the net with them. The robots will eat them up and become the laughingstocks of the tech world.