News:

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

Main Menu

MACRO for chains in ANSI and/or UNICODE format

Started by TouEnMasm, April 13, 2013, 05:21:02 PM

Previous topic - Next topic

TouEnMasm

I have searched a set of macros who are accepted by ml and JWASM.
It had been a challenge to reach the goal.
Samples are included in the asm file.
Here the result.
Fa is a musical note to play with CL

Vortex

Hi ToutEnMasm,

Kindly, could you provide some example usages?

Gunther

Hi ToutEnMasm,

yes, some examples would be a great help. Thank you.

Gunther
You have to know the facts before you can distort them.

TouEnMasm


The download is an asm files with samples of use (messagebox).
Compile it with jwasm or ml and you will see the result.
The only who can be missing is the sdk32.inc ,get it below


comment * «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    The SDK32 Runtime Library include file.

  ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« *

      .686p   
.XMM
.MMX
                                 
      .model flat, stdcall                     
      option casemap :none               

.NOLIST
include translate.inc ;SDK translate include files
include windows.sdk

;     libraries
;     ~~~~~~~~~
    ; ------------------------------------------
    ; import libraries for Windows API functions
    ; ------------------------------------------
      includelib gdi32.lib
      includelib user32.lib
      includelib kernel32.lib
      includelib Comctl32.lib
      includelib comdlg32.lib
      includelib shell32.lib
      includelib oleaut32.lib
      includelib ole32.lib

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

To switch from ansi to unicode just comment or uncomment those two lines.
Quote
   UNICODE equ
   __UNICODE__ equ UNICODE


Fa is a musical note to play with CL

Gunther

Hi ToutEnMasm,

Quote from: ToutEnMasm on April 13, 2013, 10:04:47 PM
To switch from ansi to unicode just comment or uncomment those two lines.
Quote
   UNICODE equ
   __UNICODE__ equ UNICODE

thank you.  :t

Gunther
You have to know the facts before you can distort them.

dedndave

i'm going to have to take a French class   :P

TouEnMasm


Here is the translate  ;)

The CANS write an ANSI chain in data
The CUNI  write an UNICODE chain in data
The CANS_UNI write an ANSI or UNICODE chain in data ( depends of UNICODE switch)
---------- Used in function -------------------------------
PAU   return the addr of an Ansi or Unicode string write in data
PAA   return the addr of an Ansi string write in data
PUU  return the addr of an Unicode string write in data

replace the P with a O in those macros and get the Offset instead of the adress




Fa is a musical note to play with CL

dedndave

i was trying to read the comments - lol
i can use google translate, i guess

jj2007

Just for curiosity: How do you handle "real" Unicode, e.g. Russian or Chinese? I.e. is there a macro similar to wRes$()?

And given that your editor editmasm can handle Unicode, is there a way to write strings directly in Russian or Chinese?

TouEnMasm


My IDE editmasm use only ANSI to write code,the used of UNICODE is allowed in code by the SDK windows translated .
For the comparison with your macro,made it yourself ,you have the full source code.

Fa is a musical note to play with CL

jj2007

What is the use of Unicode macros if you cannot display Russian or Chinese?

TouEnMasm

some functions need it,I just let microsoft made his soup.

Fa is a musical note to play with CL

TouEnMasm

#12
Here another sample (from the masm32 package) who switch easily between ansi to unicode.
The executable is in unicode

later : the term  cumul in the two macro (CANS and CUNI) is too much usable  and must be replaced by a more unknown like @cumulwxyz.

IF CountTheNumberofChar EQ 0
[b]@cumulwxyz[/b] TEXTEQU <DB "&char">
[b]@cumulwxyz[/b] ;execute
ENDIF

Fa is a musical note to play with CL

TouEnMasm


Added a note about the term cumul who must be renamed @cumulwxyz to avoid conflict with other cumul (valuable for 32/64)
Fa is a musical note to play with CL