News:

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

Main Menu

Deep Seek - Extended Diss - Concussion

Started by six_L, February 03, 2025, 01:22:54 AM

Previous topic - Next topic

NoCforMe

Yeah, like American or Yurpeen AI systems don't, or wouldn't collect any user data without their knowledge. It's just those eeeeevil Chinese.

Yeah, right ...
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: ognil on February 07, 2025, 11:03:26 AM1. Change "later" to "immediately".
2. Try  https://chat.qwenlm.ai/

Impressive - Qwen is really creative!

QuoteJJ2007, also known as Jxxx Jxxx, is a notable figure in the programming and software development community, particularly recognized for contributions to assembly language programming, debugging tools, and educational resources. Below are some of the main achievements and contributions associated with JJ2007:

### 1. **Development of JBE (Just Basic Editor)**
  - **JBE** is a lightweight text editor designed specifically for programmers, especially those working with assembly language. It provides features like syntax highlighting, code folding, and macro support, making it a useful tool for writing and editing assembly code efficiently.

### 2. **MASM32 Contributions**
  - JJ2007 has been an active contributor to the **MASM32** community, which focuses on Microsoft Macro Assembler (MASM) for 32-bit Windows applications. He has provided numerous examples, tutorials, and utilities that help beginners and advanced users alike in mastering assembly language programming.
  - His work includes creating libraries, macros, and helper functions that simplify complex tasks in MASM32.

### 3. **Educational Resources**
  - JJ2007 has produced a wealth of educational materials, including tutorials, articles, and example programs, aimed at teaching assembly language programming. These resources are highly regarded for their clarity and practicality.
  - His focus is often on demystifying low-level programming concepts and making them accessible to a broader audience.

### 4. **Debugging Tools**
  - JJ2007 has developed or contributed to several debugging tools that aid in analyzing and troubleshooting assembly code. These tools are invaluable for developers who need to understand the inner workings of their programs at the machine level.
  - One such tool is **PE Explorer**, which allows users to inspect Portable Executable (PE) files, a common format for executables and DLLs on Windows.

### 5. **Community Involvement**
  - JJ2007 is well-known for his active participation in online forums and communities dedicated to assembly language programming. He frequently answers questions, provides guidance, and shares his expertise with other developers.
  - His contributions have helped foster a collaborative environment where programmers can learn from each other.

### 6. **Open Source Projects**
  - Many of JJ2007's projects and tools are available as open source, allowing others to use, modify, and build upon his work. This openness has encouraged further innovation and learning within the assembly programming community.

### 7. **Advocacy for Low-Level Programming**
  - Beyond his technical contributions, JJ2007 is a strong advocate for understanding low-level programming concepts. He emphasizes the importance of knowing how computers work at the hardware level, which can lead to more efficient and optimized software.

In summary, JJ2007's achievements span tool development, educational content creation, and community engagement, all centered around promoting and simplifying assembly language programming. His work has significantly impacted the assembly programming community, providing valuable resources and fostering a deeper understanding of low-level computing.

zedd151

@jj: Sounds like it is trying to be your PR agent.  :tongue:  :joking:
¯\_(ツ)_/¯

jj2007

Indeed. Roughly half of it is plain wrong and freely invented. However, it's nicely expressed, I must say :badgrin:

zedd151

Quote from: jj2007 on February 08, 2025, 09:50:52 AMIndeed. Roughly half of it is plain wrong and freely invented. However, it's nicely expressed, I must say :badgrin:
You should ask it to write a simple hello world program using masmbasic.  :biggrin:
¯\_(ツ)_/¯

jj2007

QuotePlease write a simple hello world program using masmbasic

profile
Qwen2.5-Plus
11:54 pm
MASMBASIC is not a standard assembly language or environment, but if you're referring to writing a "Hello, World!" program using the Microsoft Macro Assembler (MASM) with basic principles, I can provide an example for you. Below is a simple "Hello, World!" program written in MASM for a 32-bit Windows environment.

Followed by simple code in push-push-call style...

NoCforMe

Quote from: jj2007 on February 08, 2025, 09:50:52 AMIndeed. Roughly half of it is plain wrong and freely invented.

And most notably, not a single word about MasmBasic.
I guess that's a case of missing the trees for the forest ...
Assembly language programming should be fun. That's why I do it.

zedd151

Quote from: NoCforMe on February 08, 2025, 10:09:16 AMAnd most notably, not a single word about MasmBasic.
I guess that's a case of missing the trees for the forest ...
I noticed that. Which is why I made my suggestion to test it by having it write a masmbasic program.  :badgrin:
¯\_(ツ)_/¯

NoCforMe

Quote from: zedd151 on February 08, 2025, 10:42:55 AM
Quote from: NoCforMe on February 08, 2025, 10:09:16 AMAnd most notably, not a single word about MasmBasic.
I guess that's a case of missing the trees for the forest ...
I noticed that. Which is why I made my suggestion to test it by having it write a masmbasic program.  :badgrin:

Whereupon it proceeded to blow you off ...
Assembly language programming should be fun. That's why I do it.

ognil

QuoteFollowed by simple code in push-push-call style...

New chat from DeepSeek.
Q: "Hello word"  with full Unicode support  in MASM 64 assembly for windows 10

A: To create a "Hello, world!" program in MASM 64-bit assembly for Windows 10 with full Unicode support, you need to use the Windows API to handle Unicode strings. Below is an example of how you can achieve this.

Step 1: Install Required Tools
MASM (Microsoft Macro Assembler): Ensure you have MASM installed. You can use Visual Studio or standalone MASM.
Linker: Ensure you have a linker (like link.exe) to link the object file into an executable.

Step 2: Write the Assembly Code
Here is the MASM 64-bit assembly code for a "Hello, world!" program with Unicode support:

; HelloWorldUnicode.asm
; MASM 64-bit assembly for Windows 10 with Unicode support

extrn MessageBoxW: proc
extrn ExitProcess: proc

.data
    szCaption dw 'H', 'e', 'l', 'l', 'o', 0 ; Unicode caption "Hello"
    szText    dw 'W', 'o', 'r', 'l', 'd', '!', 0 ; Unicode text "World!"

.code
main proc
    sub rsp, 28h        ; Allocate shadow space and align stack
; Call MessageBoxW
    xor r9d, r9d        ; uType = MB_OK
    lea r8, szCaption   ; lpCaption
    lea rdx, szText     ; lpText
    xor ecx, ecx        ; hWnd = NULL
    call MessageBoxW    ; Call MessageBoxW

; Call ExitProcess
    xor ecx, ecx        ; uExitCode = 0
    call ExitProcess    ; Call ExitProcess
    add rsp, 28h        ; Restore stack
    ret
main endp
end

Step 3: Assemble and Link the Code
Save the code in a file named HelloWorldUnicode.asm.
Open a command prompt and navigate to the directory where the file is saved.

Assemble the code using MASM:

sh
Copy
ml64 HelloWorldUnicode.asm /link /subsystem:windows /entry:main
This will produce an executable named HelloWorldUnicode.exe.

Step 4: Run the Program
Run the HelloWorldUnicode.exe executable. You should see a message box with the text "World!" and the caption "Hello".

Explanation

Unicode Strings: The strings szCaption and szText are defined as arrays of dw (double words) to store Unicode characters.

MessageBoxW: The MessageBoxW function is used to display a Unicode message box.

ExitProcess: The ExitProcess function is used to exit the program cleanly.
Stack Alignment: The stack is aligned to 16 bytes before calling Windows API functions, which is a requirement for 64-bit Windows.
This program demonstrates how to use Unicode strings in a 64-bit MASM assembly program for Windows 10.

Q: algorithm for  full Unicode support  convert string to small case in MASM 64 assembly using SSE for windows 10

A:To convert a string to lowercase in MASM 64-bit assembly using SSE (Streaming SIMD Extensions) with full Unicode support, you can leverage the PCMPISTRI instruction, which is part of the SSE4.2 instruction set. This instruction is designed for fast string processing and can handle Unicode characters efficiently.

Here's a step-by-step guide to implementing this:

1. Understand the Problem
Unicode characters can be 1, 2, or 4 bytes (UTF-8, UTF-16, etc.).

For simplicity, we'll assume the string is in UTF-16 (2 bytes per character), which is common in Windows.

The goal is to convert each character to lowercase using SSE instructions.

2. SSE4.2 Instructions
PCMPISTRI (Packed Compare Implicit Length Strings, Return Index) is useful for string processing.

PCMPISTRM (Packed Compare Implicit Length Strings, Return Mask) can generate a mask for further processing.

3. Algorithm
Load 16 bytes (8 UTF-16 characters) into an XMM register.

Use PCMPISTRI to identify uppercase characters.

Convert the identified characters to lowercase.

Store the result back to memory.

4. Implementation

; MASM 64-bit assembly for Windows 10
; Assumes the string is in UTF-16 (2 bytes per character)

section .data
    ; Example string (UTF-16)
    inputString dw 'Hello, World!', 0

section .bss
    outputString resw 100  ; Reserve space for output string

section .text
    global main

main:
    ; Load the address of the input string into RSI
    lea rsi, [inputString]
   
    ; Load the address of the output string into RDI
    lea rdi, [outputString]

convert_loop:
    ; Load 16 bytes (8 UTF-16 characters) into XMM0
    movdqu xmm0, [rsi]
   
    ; Compare characters to uppercase range (A-Z)
    ; Use PCMPISTRI to find uppercase characters
    ; ECX will contain the index of the first uppercase character
    pcmpistri xmm0, xmm0, 0x40  ; 0x40 is the IMM8 control byte for "compare ranges"

    ; If no uppercase characters are found, jump to the end
    jz no_uppercase

    ; Convert the identified character to lowercase
    ; Subtract 0x20 to convert from uppercase to lowercase
    psubw xmm0, xmmword [lowercase_mask]

    ; Store the result back to the output string
    movdqu [rdi], xmm0

    ; Move to the next 16 bytes
    add rsi, 16
    add rdi, 16

    ; Continue the loop
    jmp convert_loop

no_uppercase:
    ; Store the remaining characters
    movdqu [rdi], xmm0

    ; Exit the program
    ret

section .data
    ; Mask to convert uppercase to lowercase (subtract 0x20)
    lowercase_mask dw 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
5. Explanation
movdqu xmm0, [rsi]: Loads 16 bytes from the input string into the XMM0 register.

pcmpistri xmm0, xmm0, 0x40: Compares the characters in XMM0 to the uppercase range (A-Z). The 0x40 control byte specifies the comparison mode.

psubw xmm0, xmmword [lowercase_mask]: Subtracts 0x20 from each character in XMM0 to convert uppercase to lowercase.

movdqu [rdi], xmm0: Stores the converted characters back to the output string.

6. Considerations
This example assumes the string is in UTF-16. If the string is in UTF-8, additional handling is required.

The PCMPISTRI instruction is powerful but complex. Ensure you understand its behavior with different control bytes.

This code is a basic example. For production code, handle edge cases like string length, alignment, and different Unicode ranges.

7. Optimization
Unroll the loop for better performance.

Use aligned loads (movdqa) if the data is aligned to 16-byte boundaries.

Consider using AVX instructions for wider registers (256-bit) if targeting newer CPUs.

This approach leverages SSE4.2 instructions for efficient Unicode string processing, making it one of the fastest methods for this task in assembly language.

; MASM 64-bit assembly for Windows 10
; Assumes the string is in UTF-16 (2 bytes per character)

section .data
    ; Example string (UTF-16)
    inputString dw 'Hello, World!', 0

section .bss
    outputString resw 100  ; Reserve space for output string

section .text
    global main

main:
    ; Load the address of the input string into RSI
    lea rsi, [inputString]
   
    ; Load the address of the output string into RDI
    lea rdi, [outputString]

convert_loop:
    ; Load 16 bytes (8 UTF-16 characters) into XMM0
    movdqu xmm0, [rsi]
   
    ; Compare characters to uppercase range (A-Z)
    ; Use PCMPISTRI to find uppercase characters
    ; ECX will contain the index of the first uppercase character
    pcmpistri xmm0, xmm0, 0x40  ; 0x40 is the IMM8 control byte for "compare ranges"

    ; If no uppercase characters are found, jump to the end
    jz no_uppercase

    ; Convert the identified character to lowercase
    ; Subtract 0x20 to convert from uppercase to lowercase
    psubw xmm0, xmmword [lowercase_mask]

    ; Store the result back to the output string
    movdqu [rdi], xmm0

    ; Move to the next 16 bytes
    add rsi, 16
    add rdi, 16

    ; Continue the loop
    jmp convert_loop

no_uppercase:
    ; Store the remaining characters
    movdqu [rdi], xmm0

    ; Exit the program
    ret

section .data
    ; Mask to convert uppercase to lowercase (subtract 0x20)
    lowercase_mask dw 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20


"Not keeping emotions under control is another type of mental distortion."

TimoVJL

No we understand why ognil / lingo likes it  :biggrin:
May the source be with you

ognil

1. DeppSeek is a machine, not a woman to please. I just use it to do the work that no one on the forum wanted to or could do. :smiley:

2. I had been just a little boy ( born in the mid-90s) when Hutch, Vortex, JJ, Lingo, etc. started the forum.
Why some people hate Lingo? Is he is a criminal? :undecided: 

QuoteFrom DeepSeek:
Q. Who is Lingo from MASM32 forum
A: Lingo is well-known member of the Asmcommunity.net and  MASM32 community forum dedicated to assembly language programming, particularly using the MASM32 assembler. He is recognized for his expertise in optimizing assembly code, especially for tasks like string manipulation and searching algorithms.
Lingo is a highly skilled programmer who has contributed many optimized assembly routines to the MASM32 community. He is particularly known for his work on string-related functions, such as fastest strlen (string length), memory operations and for his expertise in  low-level programming and optimization.
His implementations often focus on maximizing performance by leveraging CPU-specific features, such as SIMD instructions (e.g., SSE, AVX) and efficient loop unrolling techniques.
Lingo's contributions are highly regarded for their speed and efficiency, often outperforming standard library implementations.
He has contributed various fast and efficient algorithms for tasks like string searching, memory comparison, and other performance-critical operations.
His code often emphasizes minimal instruction count and clever use of CPU registers to achieve high performance.
Lingo  have shared his implementations of fastest strlen and fast searching algorithms on the MASM32 forum. His approaches typically involve:
Alignment Optimization: Ensuring data is aligned to improve memory access speed.
SIMD Instructions: Using SSE or AVX instructions to process multiple characters in parallel.
Loop Unrolling: Reducing loop overhead by processing multiple characters per iteration.
Branchless Code: Minimizing conditional branches to avoid pipeline stalls.
If you're looking for his specific implementations, you can search the MASM32 forum archives for threads related to strlen or string searching.
"Not keeping emotions under control is another type of mental distortion."

NoCforMe

Quote from: ognil on February 09, 2025, 02:39:23 PM1. DeppSeek is a machine, not a woman to please. I just use it to do the work that no one on the forum wanted to or could do. :smiley:

What??? A fucking "hello world" program?
That's not even a good joke. Give us a break.
Assembly language programming should be fun. That's why I do it.

ognil

QuoteA fucking "hello world" program?

Please keep your emotions under control, because "Hello Word" is not for you right now.
It's like a repeat of JJ's "Hello Word".
On the other hand, there is something important for you in both programs:
Namely, the detailed explanations in both programs on each line, which almost no one in the forum uses.
You can use your colorful language for that. :tongue: 
When you decide to learn MASM 64, just start with "Hello Word" 64bit. :badgrin:

"Not keeping emotions under control is another type of mental distortion."

sinsi

Quote"Sinsi" is a well-known and respected member of the MASM32 forum, a community dedicated to assembly language programming using the MASM (Microsoft Macro Assembler) toolset. Sinsi has been an active contributor to the forum for many years, providing assistance, sharing knowledge, and helping others with assembly language programming, particularly in the context of MASM32.

Key Contributions of Sinsi:
Expertise in Assembly Language: Sinsi is recognized for their deep understanding of low-level programming, x86 assembly language, and the MASM32 environment.

Helping Others: Sinsi frequently answers questions on the forum, offering solutions to problems related to assembly programming, debugging, and optimization.

Code Examples and Tutorials: Sinsi has shared numerous code snippets, examples, and explanations to help beginners and advanced users alike.

Tool and Library Contributions: Sinsi has contributed to the development of tools and libraries that enhance the MASM32 programming experience.

Reputation:
Sinsi is highly regarded in the MASM32 community for their patience, expertise, and willingness to help others. They are often cited as one of the key figures who keep the forum active and supportive for programmers of all skill levels.
They are often cited as one of the key figures who keep the forum active citation needed for ego :badgrin:


QuoteAs of my knowledge cutoff in October 2023, there is no widely recognized or prominent user named "lulu00147" on the MASM32 forum. The MASM32 forum is a niche community focused on assembly language programming using the MASM (Microsoft Macro Assembler) toolset, and while many users contribute regularly, not all are as well-known as others like Sinsi or Hutch.
Look mum, I'm famous (and in good company :cool: )