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

#91
The Campus / Re: FillConsoleOutputCharacter...
Last post by sskaiser - June 22, 2025, 01:36:29 AM
Quote from: zedd on June 21, 2025, 11:16:28 PMOffhand I would say we need more information. Are you using GetConsoleScreenBufferInfo to fill the CONSOLE_SCREEN_BUFFER_INFO structure? Is the structure getting filled properly? Is the handle to stdout valid?

Perhaps post the (pertinent) code that you used prior to calling your clr procedure??
Have you stepped the code in a debugger? (While watching return values in rax and watching whether or not any exceptions are found)

It just started working after I did absolutely nothing sorry for wasting your time
#92
The Campus / Re: Nested .REPEAT, .IF and .W...
Last post by _japheth - June 22, 2025, 12:37:33 AM
Quote from: Quan on June 22, 2025, 12:19:25 AMBecause putting a label in a macro for the JMP instruction, and then using the macro multiple times causes the compiling to complain about label redefinition. Or is that okay and can safely be ignored?

No, since this is an error and no warning. You have to use the LOCAL directive ( inside the macro and tightly following the MACRO directive) to declare your label inside the macro as "local".
#93
The Campus / Re: Nested .REPEAT, .IF and .W...
Last post by Quan - June 22, 2025, 12:19:25 AM
Ahh, right, I didn't notice that, thanks!

Quote from: _japheth on June 21, 2025, 12:14:41 AMThat's supposedly not at all what you did want to do!? A simple JMP should work better.
I don't think this works? Because putting a label in a macro for the JMP instruction, and then using the macro multiple times causes the compiling to complain about label redefinition. Or is that okay and can safely be ignored?
#94
The Campus / Re: FillConsoleOutputCharacter...
Last post by zedd - June 21, 2025, 11:16:28 PM
Offhand I would say we need more information. Are you using GetConsoleScreenBufferInfo to fill the CONSOLE_SCREEN_BUFFER_INFO structure? Is the structure getting filled properly? Is the handle to stdout valid?

Perhaps post the (pertinent) code that you used prior to calling your clr procedure??
Have you stepped the code in a debugger? (While watching return values in rax and watching whether or not any exceptions are found)
#95
The Campus / FillConsoleOutputCharacterA no...
Last post by sskaiser - June 21, 2025, 09:53:03 PM
Hey i'm writing this code but rn i can't get it to work, here it is:
clr PROC   
   SUB RSP, 40
   MOV RCX, stdout
   MOVZX RAX, csbi.dwSize.X
   MOVZX RBX, csbi.dwSize.Y
   MUL RBX
   MOV RDX, 32
   MOV R8, RAX
   XOR R9, R9
   MOV num, 0
   LEA RAX, num
   mov QWORD PTR [RSP + 32], RAX
   CALL FillConsoleOutputCharacterA
   ADD RSP, 40
   RET
clr ENDP

variables here:
num DWORD ?
csbi CONSOLE_SCREEN_BUFFER_INFO <> (exactly like in the windows docs, i know it works cuz i use it to get the size)

Also I'm not using the SDK because i'm following a challenge of not using any external code.

#96
ObjAsm / Re: UTF8 performance
Last post by Biterider - June 21, 2025, 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
#97
The Workshop / Re: Looking for MASM feature p...
Last post by fearless - June 21, 2025, 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
#98
The Workshop / Looking for MASM feature per v...
Last post by Shintaro - June 21, 2025, 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.
#99
UASM Assembler Development / Re: Linux users, please
Last post by NoCforMe - June 21, 2025, 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.
#100
UASM Assembler Development / Re: Linux users, please
Last post by daydreamer - June 21, 2025, 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