News:

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

Main Menu

Recent posts

#1
ObjAsm / Re: UTF8 performance
Last post by Biterider - Today at 09:50:45 PM
Hi
The required size determination for the inverse function is even simpler:

; --------------------------------------------------------------------------------------------------
; Procedure:  WideToUTF8Size
; Purpose:    Calculate the amount of memory needed to store the converted UTF8 stream from a
;             WIDE string.
; Arguments:  Arg1: -> Source WIDE string. Must be zero terminated.
; Return:     eax = Number of BYTEs requred. Zero if failed.
; Notes:      The ZTC is always included in size calculations.
;             The returned value can only be zero if the procedure fails.
;             Wide chars can only encode the Basic Multilingual Plane (BMP, or Plane 0),
;             meaning that sequences of a maximum of three bytes can be generated.

.code
align ALIGN_CODE
WideToUTF8Size proc pSource:POINTER
  xor eax, eax
  ?mov ecx, pSource
  .if xcx == NULL
    ret
  .endif

@@NextChar:
  movzx edx, CHRW ptr [xcx]
  test edx, edx
  .if ZERO?
    inc eax                                             ;Include this last ZTC
    ret
  .endif

  .if edx <= 07Fh
    inc eax
  .elseif edx <= 07FFh
    add eax, 2
  .else
    add eax, 3
  .endif
  add xcx, sizeof(CHRW)
  jmp @@NextChar
WideToUTF8Size endp

Biterider
#2
The Workshop / Re: Looking for MASM feature p...
Last post by fearless - Today at 01:52:46 PM
I think it was https://bytepointer.com

But seems to be down, the last snapshot on the wayback machine is this one:

https://web.archive.org/web/20240623141221/https://bytepointer.com/masm/index.htm
#3
The Workshop / Looking for MASM feature per v...
Last post by Shintaro - Today at 09:31:45 AM
Hi,

There was a website that showed the different releases of MASM and when the feature/keyword was released.

For the life of me I cannot find that website.

Does anyone know it?

Cheers.
#4
UASM Assembler Development / Re: Linux users, please
Last post by NoCforMe - Today at 05:24:45 AM
Quote from: daydreamer on June 20, 2025, 04:42:14 PMCross platform, wrapper functions
Like proc with winapi function names,inside is invoke to Linux same function?
Or the other way around?

You're asking about the package I wrote?
None of the above; it was just an overlay for DOS programs that gave you a text-based windowed interface.
#5
UASM Assembler Development / Re: Linux users, please
Last post by daydreamer - Today at 05:01:56 AM
The only "multitasking" in oldest computers was main basic program, while machine code snippet was setup as vblank retrace interrupt
Inspired me to setup wm_timer 1/30 second for game / animation physics + start wm_paint message

#6
UASM Assembler Development / Re: Linux users, please
Last post by TimoVJL - Today at 01:27:56 AM
linux have wine libs for common Win32 API

A IBM TopView had rival:
DESQview
#7
The Campus / Re: Nested .REPEAT, .IF and .W...
Last post by _japheth - Today at 12:14:41 AM
Hi,

GOTO is an "assembly-time" jump, accepted inside macros only, and probably only useful if combined with conditional assembly instructions ( IF, ELSE [note the missing "dot"]).
That's supposedly not at all what you did want to do!? A simple JMP should work better.
#8
ObjAsm / Re: UTF8 performance
Last post by Biterider - June 20, 2025, 11:15:27 PM
Hi
I had to write a procedure to determine the required buffer size in advance when converting from UTF-8 to wide characters.
The code is essentially a stripped-down version of the code used for the conversion.

; --------------------------------------------------------------------------------------------------
; Procedure:  UTF8ToWideSize
; Purpose:    Calculate the amount of memory needed to store the converted WIDE string from a
;             UTF8 stream.
; Arguments:  Arg1: -> Source UTF8 BYTE stream. Must be zero terminated.
; Return:     eax = Number of BYTEs requred. Zero if failed.
; Notes:      The ZTC is always included in size calculations.
;             The returned value can only be zero if the procedure fails.

.code
align ALIGN_CODE
UTF8ToWideSize proc pSource:POINTER
  ?mov ecx, pSource
  xor eax, eax

@@NextChar:
  movzx edx, BYTE ptr [xcx]
  test edx, edx                                           ;ZTC?
  .if ZERO?
    add eax, sizeof(WORD)                                 ;ZTC
    ret
  .endif

  test edx, 10000000y
  .if ZERO?
    ;1 Byte encoding (0xxxxxxx)
    add eax, sizeof(WORD)
    inc xcx
    jmp @@NextChar
  .endif

  and edx, 11111000y
  .if edx == 11110000y                                   ;11110xxx
    ;4 Byte encoding (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx)
    add eax, sizeof(WORD)
    add xcx, 4*sizeof(BYTE)
    jmp @@NextChar
  .endif

  and edx, 11110000y
  .if edx == 11100000y                                   ;1110xxxx
    ;3 Byte encoding (1110xxxx 10xxxxxx 10xxxxxx)
    add eax, sizeof(WORD)
    add xcx, 3*sizeof(BYTE)
    jmp @@NextChar
  .endif

  and edx, 11100000y
  .if edx == 11000000y                                   ;110xxxxx
    ;2 Byte encoding (110xxxxx 10xxxxxx)
    add eax, sizeof(WORD)
    add xcx, 2*sizeof(BYTE)
    jmp @@NextChar
  .endif

  xor eax, eax                                          ;Conversion error
  ret
UTF8ToWideSize endp

Biterider
#9
UASM Assembler Development / Re: Linux users, please
Last post by FORTRANS - June 20, 2025, 10:09:18 PM
Hi,

Quote from: NoCforMe on June 19, 2025, 09:37:21 AMI had never heard of that,

   Ah, well it was fairly short lived, I suppose.  But it was fun to
try it out.

Quotebut yeah, like that. Except that it wasn't anything like a multi-user multitasking "environment", just an overlay on top of DOS programs. It sure looked like the screenshots of the IBM thing, though.

   Well, I was wondering about that.  Nice to hear about it.

Thanks,

Steve N.
#10
The Campus / Re: Nested .REPEAT, .IF and .W...
Last post by Quan - June 20, 2025, 07:18:14 PM
Adding to this, I'm essentially trying to replicate this chunk of code in a macro so I can use it multiple times.
xor eax, eax
mov esi, offset strHW
loop_start:
inc eax
mov edi, offset strHW + 5
add esi, eax
xor ecx, ecx
add ecx, 11
cld
repe cmpsb
jz found

cmp eax, 10
jne loop_start

found:
mov ebx, -1
Is anything I'm doing wrong or unconventional?

EDIT: Minor, unrelated logic error, cmp instruction at the end of the loop is supposed to compare eax with 10, not ecx with 10.