³o¤@³¹¨Ó»¡¤@»¡¥Î²Õ¦X»y¨¥³]p Win64 À³¥Îµ{¦¡®É¡A¦p¦ó³B²z¡BÀx¦s¡BÅã¥Ü¥H¸U°ê½X½s½Xªº¦r¤¸¡Cº¥ý»¡©ú¤°»ò¬O¸U°ê½X©O¡H¦b¦´Á¹q¸£èµo®iªºªì´Á¡A¤j¬ù¬O¥Á°ê¤»¡B¤C¤Q¦~ªº®ÉÔ¡A¨º®ÉÔ¦U°êµo®i¦U¦Ûªº¦r¤¸½s½X¼Ð·Ç¡C²³©Ò©Pª¾¡A¹q¸£¾Õªøªº¬O³B²z¼ÆÈ¡A¦ý¬O¤HÃþ©Ò¨Ï¥Îªº¬O¦U¦¡¦U¼Ëªº¤å¦r¡A©Ò¿×¦r¤¸½s½X¬O«ü¦b¹q¸£¤¤¥H¬YÓ¼ÆÈ¥Nªí¬YÓ¤å¦r¡C
¨Ò¦p¬ü°ê°ê®a¼Ð·Ç¾Ç·|¡]American National Standard Institute¡AANSI¡^¨î©wªº ASCII¡]American Standard Code for Information Interchange¡A¬ü°ê¼Ð·Ç¸ê°T¥æ´«½X¡^¡A´N¬O¥H 41h ¥Nªí "A"¡A¥H 42h ¥Nªí "B"¡K¡K§¹¾ãªº ASCII ½X¥i¥H¬d¾\ºû°ò¦Ê¬ì©Î DOS ²Õ¦X»y¨¥ªþ¿ý¥|¡C¨ä¥L°ê®a¤]¹ï¦Û¤vªº¤å¦r¶i¦æ½s½X¡A¨Ò¦p¤é¥»±Ä¥Î Shift_JIS¡A¤¤µØ¥Á°ê¡B»´ä¡B¿Dªù±`¥Îªº¬O Big5¡]¤j¤½X¡^¡A¤¤°ê¤j³°±`¥Îªº¬O GB2312¡C¦³³o»ò¦h°ê®a¦a°Ï¡A±Ä¥Î¤£¦Pªº½s½X¤è¦¡¡AÁöµM¥L̪º«e± 128 ½X³£»P ASCII ¬Û®e¡A¦ýÁÙ¬O·|³y¦¨¥æ´«¸ê°Tªº§xÃø¡C
¨Ò¦p¡u»¨³Ç¡v¤G¦rªº Big5 ½X¤À§O¬O BBA8h¡BB3C7h¡AGB2312 ¤¤³o¨â¼Æ¤À§O¬O¡uªá¡v¡B¡u«°¡v¡C°²³]¦b¤¤µØ¥Á°ê¦³Ó¥Î Big5 ½s½Xªº¯Â¤å¦rÀÉ¡Aùر¦³¡u»¨³Ç¡v¤@µü¡FÀx¦s¦b¹q¸£¤¤¡A¤£½×¦¡µwºÐ¡BÀH¨ºÐ¡A³£¬O BBA8h¡BB3C7h ¨âÓ¤Q¤»¶i¦ì¼Æ¡C¦pªG®³¨ì²ßºD¥H GB2312 ½s½Xªº¤¤°ê¤j³°¤W¥h¡A¥Î¥L̪º³nÅé¶}±Ò¡A¡u»¨³Ç¡v´NÅܦ¨¤F¡uªá«°¡v¡A³o½ÖÁÙ¯à¬Ý±oÀ´¡H³oÁÙºâ¦n¡A¦Ü¤Ö³oÓ¨Ò¤lÁÙ¹ïÀ³ªº¬O¤¤¤å¦r¡A¥u¬O¬Ý±o¤£ª¾©Ò¤ª¡C¦pªG¬O¹ïÀ³ªº¬O²Å¸¹¡A©Î®Ú¥»¤£¥Î³o¼ÆȽs½X¡A¨º§ó¬O¬Ý¤£À´¡A³o´N¬O¶Ã½X²£¥Íªºì¦]¡C
¨ì¤Fºô»Úºô¸ôµo®i¨Ã²±¦æªº®É¥N¡A³o°ÝÃD§ó¥[ÄY«¡A¤£¯à¦A±Ä¥Î¦U¦æ¨ä¬Oªº½s½X¤è¦¡¤F¡C¬°¤F¸Ñ¨M³oÓÃøÃD¡A¦Û¥Á°ê 73 ¦~¶}©l¡A¦³°ê»Ú²Õ´¤Î³\¦hª¾¦W°ê»Ú¼t°Ó¦@¦PµÛ¤â¬ã¨s¡A©ó¬O¦b¥Á°ê 80 ¦~¥ª¥k¡A¥L̤½¥¬¤F¬ã¨s¦¨ªG¡A·N§Y ISO 10646/Unicode ¼Ð·Ç¡A²ºÙ Unicode¡A¤¤¤å¥i½Ķ¦¨¸U°ê½X©Î²Î¤@½X¡C
¸U°ê½X¤è¦¡¦¬¶°¤F´X¥G¥þ¥@¬Éªº»y¨¥¤å¦r»P²Å¸¹¡A³£±N¨ä½s½X¡A¤@Ó¦r²Î¤@¥Î¤@Ó¼ÆȪí¥Ü¡C¸g¹L³o¨Ç¦~¨Óªº±À°Ê¡A²{¦b¤w¸g¦¨¬°©ñ½Ñ¥|®ü¬Ò·Çªº¦r¤¸½s½X¤è¦¡¤F¡C±Ä¥Î³o®M½s½X¤è¦¡¡A¬Æ¦Ü¥i¥H¦b¦P¤@¤å¥ó¤¤Åã¥Ü¤£¦Pªº°ê®aªº¤å¦r¡C¯u¥¿§¹¦¨¤F¨Ï¥Î¹q¸£¯àÅã¥Ü¡BÀx¦s¡B¶Ç°e¦U°ê¤å¦r¡A¸¨¹ê²Î¤@¥þ²y¤å¦r¥æ´«¼Ð·Ç¡C
³o®M¸U°ê½X±q¶}©lµoªíªº¤C¤d¦h¦r¡A³v¦~ÂX¥R¡A¨ì¤µ¦~¡]¥Á°ê113¦~¡^¬°¤î¡A¤w¦¬¿ý¤F¤Q¤¸U¦r¡AÁÙ¦b³v¨BÂX¼W¤¤¡C»¡¨Ó¥i¯à«Ü¦h¤H¤£´±¬Û«H¡A¸U°ê½X³ºµMÁÙ¦¬¿ý¤F¥j¥N®J¤Î¸t®ÑÅé¡]±q 13000h ¶}©l¬O¥j¥N®J¤Î¸t®ÑÅé¦r¤¸¡^¡I
Windows §@·~¨t²Î¦Û Windows 3.0 ¶}©l¡A½s½X¤è¦¡±Ä¥Î¦U¦Û°ê®aªº½s½X¤è¦¡¡C¨Ò¦p¦b¤¤µØ¥Á°ê³c°âªº Windows 3.1 ±Ä¥Î Big5 ½X¡A¦ý¦b·L³n¤º³¡ºÙ¬° code page 950¡A¡ucode page¡v¤@¯ë½Ķ¦¨¤º½X¶¡C¦b¤¤°ê¤j³°±Ä¥Î GB2312¡A¤º½X¶¬O 936¡F¦Ó¤é¤åª©ªº Windows 3.0¡A¤º½X¶¬° 932¡C
¦ý¦P¤@®É´Á¡A´£¨Ñµ¹¥ø·~¥Îªº Windows NT 3.1 «o¤w±Ä¥Î¸U°ê½X¡C«á¨Ó¨ÑÓ¤H¨Ï¥Îªº Windows 95/98/98 SE/Me ©µÄò Windows 3.x¡A¤´±Ä¥Î Big5 ©Î GB2312 ½s½X¡FWindows NT 3.5/4.0/2000 «h±Ä¥Î¸U°ê½X¡C¥Á°ê 90 ¦~µo°âªº Windows XP ¾ã¦XÓ¤H»P¥ø·~¨Ï¥Îªº¨t²Î¡A±Ä¥Î Windows NT ªº®Ö¤ß¡A¥Î¸U°ê½X½s½X¡C
»¡¨ì³o¨à¡A²{¦bªº Windows §@·~¨t²Î¤º³¡½s½X¤è¦¡¦¤w¬O¸U°ê½X¡A©Ò¥H²{¥N¼¶¼gµ{¦¡À³¸Ón¦Ò¼{±Ä¥Î¸U°ê½X½s¼gµ{¦¡¡C¨º»ò¹ï©ó¥j¦Ñªº²Õ¦X»y¨¥¨Ó»¡¡A¯à§_¤ä´©¥H¸U°ê½X¤è¦¡¼¶¼gÀ³¥Îµ{¦¡©O¡H·íµM¬O¥i¥Hªº¡A§_«h´N¤£·|¦³³o¤@³¹¤F¡C
¦´Á¡AANSI ¨î©wªº ASCII ½s½X¤è¦¡¥u±Ä¥Î 7 ¦ì¤¸´N¤w¨¬°÷¡C7 Ӧ줸¯àªí¥Ü 27 Ó¼ÆÈ¡A¤@ӼƥNªí¤@Ó¦r¡A^¤å¦r¥À¥]§t¤j¡B¤p¼g¦@ 52 Ó¡A¥[¤W¤QÓªü©Ô§B¼Æ¦r¤Î¼ÐÂI²Å¸¹¡A127 ӼƦr«D±`°÷¥Î¡C
¦ý¬O¡A«e±´£¹L¸U°ê½Xªº¥ø¹Ï¤ß«Ü¤j¡A¥´ºâ±N¥þ¥@¬É¥j©¹¤µ¨Ó¡A¥¿¦b¨Ï¥Î»P´¿¸g¨Ï¥Î¹Lªº¤å¦r³£¯Ç¤J¨ä¤¤¡C¦pªG¬O³o¼Ë¡A¥²¶·¨Ï¥Î¥|Ӧ줸²Õ¨Ó½s½X¡A¥|Ӧ줸²Õ¦@ 32 Ӧ줸¡A¤]´N¬OÂù¦r²Õ¡]¥ç§Y²Õ¦X»y¨¥±`¥Îªº DWORD¡^¡A¦ý³W©wÂù¦r²Õªº³Ì°ª¦ì¤¸¥²¶·¬°¹s¡A©Ò¥H¥i¥H½s½XªºÁ`¼Æ°ª¹F 231 Ó¡A¤]´N¬O¥i¥H¨Ï¤G¤Q¤@»õ¦hÓ¤å¦r¶i¦æ½s½X¡A³o¼Ëªº½s½XºÙ¬° UCS¡Ð4¡A¥¦¯à°÷²[»\©Ò¦³¤å¦r¦Óºïºï¦³¾l¡CUSC ¬O universal coded character set ªºÁY¼g¡A¤¤¤å¥i½Ķ¦¨³q¥Î¦r¤¸¶°¡C
¦ý²{¹ê¬O¡A§Y¨Ï¥]§t¤¤¡B¤é¡BÁú¤TºØ±`¥Îªº¤å¦r¡AÁ`¦@¤]¤£·|¶W¹L¤»¸UÓ¡C°²¦p¯uªº¨Ï¨CÓÀɮתº¤å¦r³£¥Î UCS¡Ð4 ½s½X¡A¨º¨CÓ¦r³£n¥e¥Î¥|Ӧ줸²Õ¡A«D±`®ö¶OªÅ¶¡¡C©ó¬O³\¦h¤H»{¬°¡A¦pªG±Ä¥Î¨âӦ줸²Õ¨Ó½s½X¡A¥i¥H½s½Xªº¤å¦r¦³ 216 Ó¤å¦r¡A¤]´N¬O 65536 Ó¡A¤w¸g¥i¥Hº¡¨¬¥@¬É¤W±`¥Îªº¤å¦r¤F¡A³o¼Ëªº½s½X¤è¦¡ºÙ¬° UCS¡Ð2¡A¥¦ÁöµMµLªk²[»\¥@¬É¤W©Ò¦³¤å¦r¡A¦ý«o¯àº¡¨¬µ´¤j³¡¥÷¤H¦bµ´¤j³¡¤À±¡ªp¨Ï¥Î¡C
UCS¡Ð2 ÂàÅܦ¨ UCS¡Ð4 ªº¤èªk¥u»Ý¦A¼W¥[¨âӦ줸²Õ¡A¦Ó¥B³o¨âӦ줸²Õ³£¬O 0¡C¨Ò¦p¡u»¨¡v¦rªº¸U°ê½X¬O 8C6Ah¡A³o¬O UCS¡Ð2 ½s½X¤è¦¡¡FÂà´«¦¨ UCS¡Ð4 ´N¬O 00008C6Ah¡C¤£½×¬O UCS¡Ð2 ÁÙ¬O UCS¡Ð4¡A¹ï^¤å¦r¥À¡Bªü©Ô§B¼Æ¦r¤Î¹³¡u,¡v¡B¡u.¡v¡B¡u+¡v¡B¡u-¡v¡K¡Kµ¥²Å¸¹¦Ó¨¥¡A³£³Q½s¦¨»P ANSI ¨î©wªº ASCII ½X¤@¼Ë¡A³o¼Ë´N¯à»P¦´Áªº¹q¸£¬Û®e¡C¨Ò¦p^¤å¦r¥À "A" ªº ASCII ½X¬O 41h¡AÂà´«¦¨ UCS¡Ð2 ¬O 0041h¡AÂà´«¦¨ UCS¡Ð4 ¬O 00000041h¡C
µ²½×´N¬O¡A¸U°ê½X¦Ü¤Ö¥i¤À¬° UCS¡Ð2 »P UCS¡Ð4 ¨âºØ½s½X¤è¦¡¡]¨Æ¹ê¤WÁÙ¦³§ó¦h½s½X¤è¦¡¡^¡A¦pªG©Ò¨Ï¥Îªº¤å¦r¬O±`¥Î¤å¦r¡A¨º»ò¨Ï¥Î UCS¡Ð2 ´N¥i¥H¤F¡A§_«h´N¥²¶·¨Ï¥Î UCS¡Ð4¡C¦P¤@¥÷¤å¥ó©ÎÀÉ®×ùØ¥u¯à¿ï¾Ü¨ä¤¤¤@ºØ¡A¤£¬O UCS¡Ð2 ´N¬O UCS¡Ð4¡A¤£¯à²V¥Î¡A¥H§K³y¦¨¤@Ó¦r¤£©wªø«×ªº¯ÊÂI¡C¦³Å²©ó UCS¡Ð4 ·¥¨ä¤Ö¥Î¡A©Ò¥H©³¤Uªº¤º®e¡A¦p¤£¯S§OÁn©ú¸U°ê½X½s½X¤è¦¡¡A³£¬O«ü UCS¡Ð2¡C
¤£½×¬O UCS¡Ð2 ÁÙ¬O UCS¡Ð4¡A¤£ºÞþºØ¸U°ê½X½s½X¤è¦¡¡A³£¬O¥H¨âӦ줸²Õ©Î¶W¹L¨âӦ줸²Õªº¤è¦¡±N¤å¦r½s½X¡A©Ò¥HÀ³¥Îµ{¦¡¤ºªº¤å¦r¦pªG¬O¥Î¸U°ê½X½s¦¨ªº¡A¤@¯ëºÙ¬°¼e¦r¤¸À³¥Îµ{¦¡¡]Wide Character Application¡^©Î¸U°ê½XÀ³¥Îµ{¦¡¡F¦pªG¬O¥H ANSI ¨î©wªº ASCII ½s½Xªº¡A¥iºÙ¬° ANSI À³¥Îµ{¦¡¡C¦Ó¦b¤¤µØ¥Á°ê¡B»´äµ¥¦a°Ï¨Ï¥Îªº Big5 ½X¡A¬O¦b ASCII ªº°ò¦¤WÂX¥R¤@Ӧ줸²Õ¨Óªí¥Ü¤¤¤å¡A¬Û®e©ó ASCII ½s½X¤è¦¡¡C©Ò¥H¡A§Y¨Ï Big5 ½s½Xªº¤¤¤å¦r¦³¨âӦ줸²Õ¡A¤]ÄÝ©ó ANSI À³¥Îµ{¦¡¡C¦b¥»³¹¤§«eªºµ{¦¡¡A³£ÄÝ©ó ANSI À³¥Îµ{¦¡¡C
©³¤U¥H²Ä¤@³¹ªº FIRST.ASM ¬°¨Ò¤l¡A»¡©ú¦p¦ó¨Ï¥Î²Õ¦X»y¨¥¼¶¼g¼e¦r¤¸À³¥Îµ{¦¡¡A¦¹µ{¦¡ºÙ¬° FIRSTU.ASM¡A¥DÀɦW³Ì«áªº U ¥Nªí¦¹¬°¸U°ê½Xª©¥»¡Cª`·N¡I¦]¬°²ÕĶ¾¹¡AUASM64.EXE ©Î ML64.EXE ³£¥u¯àÃѧO ANSI/ASCII ®æ¦¡ªºì©lµ{¦¡¡A©Ò¥H§Y¨Ï½s¼g¼e¦r¤¸À³¥Îµ{¦¡¤]¬On§âì©lµ{¦¡¦s¦¨ ANSI/ASCII ®æ¦¡¡C¡Cì©lµ{¦¡¡AFIRSTU.ASM ¦p¤U¡G
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 |
OPTION CASEMAP:NONE
OPTION WIN64:3
OPTION LITERALS:ON ;¨Ïinvokeª½±µ±µ¨ü¦r¦ê°Ñ¼Æ
UNICODE EQU 1 ;©I¥sWin64 APIªº¼e¦r¤¸ª©¥»
INCLUDE WINDOWS.INC
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
;*******************************************************************************
.CONST
;¦]¬°¡uOPTION LITERALS:ON¡v¡A¥i¥H¥Î¡uDW¡v§â^¤å¦r¥ÀÂà´«¦¨UCS-2½s½X
szText DW "This sentence is encoded in UCS-2."
;*******************************************************************************
.CODE
;-------------------------------------------------------------------------------
main PROC
invoke MessageBox,0,OFFSET szText,L"Unicode String",MB_OK
call ExitProcess
main ENDP
;*******************************************************************************
END main |
¤W± FIRSTU.ASM µ{¦¡½X¤¤¥Hµµ¬õ¦â¼Ð¥Ü¥X¨Óªº¡A´N¬O¼¶¼g¸U°ê½XªºÃöÁä¡A©³¤U¤@¤@»¡©ú¡G
²ÕĶ»P³sµ²¤è¦¡¬O¥ý¶}±Ò¡u©R¥O´£¥Ü¦r¤¸¡v¿é¤J¤U±¶À¦â¦rªº«ü¥O¡A»s§@¥X¨Óªº FIRSTU.EXE µe±¦p¥k¹Ï¡G
Microsoft Windows [ª©¥» 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\wanker>uasm [Enter] ¡÷°õ¦æ UASM.BAT §å¦¸ÀÉ¡A¬Ù¤F³\¦h¥´¦r¿é¤J¡A¨£²Ä 11 ³¹ UASM.BAT C:\Users\wanker>SET INCLUDE=C:\UASM\Include C:\Users\wanker>SET LIB=C:\UASM\lib64 C:\Users\wanker>SET PATH=C:\UASM;C:\UASM\bin64;C:\Windows\system32;C:\Windows;C: \Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fi les (x86)\UltraEdit-32 C:\Users\wanker>E: E:\>CD E:\HOMEPAGE\SOURCE\WIN64 LINK=/SUBSYSTEM:WINDOWS /DEBUG E:\HomePage\SOURCE\Win64>cd UNICODE [Enter] ¡÷¤Á´«¦Ü UNICODE ¤l¥Ø¿ý E:\HomePage\SOURCE\Win64\UNICODE>uasm64 -win64 FIRSTU.ASM [Enter] UASM v2.56, Oct 27 2022, Masm-compatible assembler. Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved. Source code is available under the Sybase Open Watcom Public License. FIRSTU.ASM: 22 lines, 3 passes, 519 ms, 0 warnings, 0 errors E:\HomePage\SOURCE\Win64\UNICODE>link firstu.obj [Enter] Microsoft (R) Incremental Linker Version 14.25.28614.0 Copyright (C) Microsoft Corporation. All rights reserved. /SUBSYSTEM:WINDOWS /DEBUG E:\HomePage\SOURCE\Win64\UNICODE>
µ²½×¡Gn»s§@^¤åªº¼e¦r¤¸À³¥Îµ{¦¡¡A«Ü²³æ¡A¥un¦bì©lµ{¦¡¤¤³]©w¡uOPTION LITERALS:ON¡v¡A¥[¤J¡uUNICODE EQU 1¡v§Y¥i¡C«eªÌ¨Ï¡uDW¡v°²«ü¥O©w¸q¸U°ê½X¦r¤¸¡A«áªÌ¨ÏÀ³¥Îµ{¦¡©I¥s Win64 API ªº¼e¦r¤¸ª©¥»¡C
¹ï©ó¼¶¼g¤¤¤åªº¼e¦r¤¸À³¥Îµ{¦¡´N¨S³o»ò©¯¹B¤F¡A¦ý¬OÁÙ¬O¦³¤èªkªº¡C©³¤U¥ý¨Ó¬Ý¬Ý¡A§â FIRSTU.ASM §ï¦¨¤¤¤åª©ªº FIRSTUC.ASM ¬O¤°»ò¼Ë¤l¡H¥DÀɦW³Ì«á¤@Ó¦r¤¸¡uC¡vªí¥Ü¤¤¤åªº·N«ä¡C©³¤U¬O FIRSTUC.ASM ªº¤º®e¡G
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 |
OPTION CASEMAP:NONE
OPTION WIN64:3
UNICODE EQU 1 ;©I¥sWin64 APIªº¼e¦r¤¸ª©¥»
INCLUDE WINDOWS.INC
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
;**********************************************************************************************
.CONST
szTitle DW 986fh,793ah,842ch,570bh,78bch,5b57h,4e32h,0 ;Åã¥Ü¸U°ê½X¦r¦ê
szText DW 9019h,500bh,53e5h,5b50h,662fh,4ee5h,55h,43h,53h,0ff0dh,32h ;³oÓ¥y¤l¬O¥HUCS¡Ð2
DW 7de8h,78bch,800ch,6210h,3002h,0 ;½s½X¦Ó¦¨¡C
;**********************************************************************************************
.CODE
;---------------------------------------------------------------------------------------------
main PROC
invoke MessageBox,0,OFFSET szText,OFFSET szTitle,MB_OK
call ExitProcess
main ENDP
;**********************************************************************************************
END main |
¤¤¤åª©ªº¼e¦r¤¸À³¥Îµ{¦¡»P ANSI À³¥Îµ{¦¡¤£¦P¤§³B¡A¤]¦b¤W±ì©l½X¤¤¥Hµµ¬õ¦âªº¦r¼Ð¥Ü¥X¨Ó¤F¡C²Ä 4 ¦æ¡A¸ò^¤åª©ªº¤@¼Ë¡A¡uUNICODE EQU 1¡v¥Î¨Ó¨ÏÀ³¥Îµ{¦¡©I¥s¼e¦r¤¸ª©ªº Win64 API¡C²Ä 11¡ã13 ¦æ©w¸qªº¦r¦ê¡A¥þ³¡¥Î¼ÆȪí¥Ü¡C«Ü©úÅã¡A²Ä 11 ¦æ²Ä¤@Ó¦r²Õ¡A986Fh ¬O UCS¡Ð2 ½s½X¡A¨ä¤¤¤å¦r´N¬O«á±µù¸Ñªº¡uÅã¡v¡C¨Ì¦¹Ãþ±À¡A793Ah ¬O¡u¥Ü¡vªº UCS¡Ð2 ½s½X ¡K¡K¡A³o¼Ë´N«Ü¦nÁA¸Ñ¤F¡C
¦]¬°²ÕĶ¾¹¡A¤£½×¬O UASM64.EXE ÁÙ¬O ML64.EXE ³£¥u¯àŪ¨ú ANSI ¨î©wªº ASCII ¯Â¤å¦rÀɮסA¦Ó§Ú̵Lªk¦b¦r¦ê¤¤¥H UCS¡Ð2 ½s½X¡A¦b¨ä¥L°²«ü¥O©Î x86 «ü¥O¥Î ASCII ½s½X¡C©Ò¥H¥u¯à¥Î¤W±³o¼ËªºÅܳq¤è¦¡¡A¦bªí¥Ü¦r¦ê®É¡A¥H UCS¡Ð2 ½s½X«áªº¤Q¤»¶i¦ì©Î¤Q¶i¦ì¼ÆȪí¥Ü¡C
ÁٳѤU¤@Ó°ÝÃD¡AÃø¹D¥Î¤¤¤å¸U°ê½X¦r¦ê¡A¬O¤£¬On¤@Ó¦r¤@Ó¦rªº¬dªí¡A¬d¥X¸Ó¦rªº½s½X¡H·íµM¤£¬O¡A¦pªG¬O³o¼Ë¡A¼gÓµ{¦¡°Z¤£¦Ûh¡H¦b¤U¤@³¹¡A¤p¤ì°¸·|¼¶¼g¤@Óµ{¦¡¡A¸Ñ¨M³oÓ°ÝÃD¡C
²ÕĶ¡B³sµ² FIRSTUC.ASM ªº¨BÆJ¸ò FIRSTU.ASM ¤@¼Ë¡A¤£¦A±Ôz¡A¦Ó¥¦°õ¦æªºµ²ªG¦p¥k¹Ï¡C¬Ý°_¨Ó¦ü¥G¸ò ANSI À³¥Îµ{¦¡¨S¤°»ò®t§O¡A¦ý¬O¦pªG¥Î x64dbg ¸ü¤J¥¦¡AÆ[¹î¥¦¦b .CONST °Ï¬qªº¤º®e¡A´N¯à¬Ý¥X¥¦½T¹ê¬O¦p°²¥]´«ªº¼e¦r¤¸À³¥Îµ{¦¡¡A¨BÆJ¦p¤U¡G
Á¿¨ì³o¨à¡AÅýÀ³¥Îµ{¦¡Åã¥Ü¡BÀx¦s©Î³B²zªº¦r¤¸¡A¬O¥H¸U°ê½X½s½Xªº¤è¦¡§¹¦¨¡Aºâ¬O§i¤@¬q¸¨¡C¦A²`¤J¤@ÂI¡A´N¬OÅýÀ³¥Îµ{¦¡¯à¥H¦hºØ¤£¦P¤å¦rÅã¥Ü¡AÅý§ó¦h°ê®aªº¤H¯à¨Ï¥Î¡A¹³³o¼Ëªºµ{¦¡ºÙ¬°¦h»y¨¥À³¥Îµ{¦¡¡]Multilingual Application¡^©Î°ê»Ú¤ÆÀ³¥Îµ{¦¡¡]Internationalized Application¡^¡C
°ê»Ú¤ÆÀ³¥Îµ{¦¡^¤å¬O internationalized application¡A©Î I18N Application¡]I18N ¬O Internationalization ÁY¼g¡A¬O¶}ÀYªº I ©Mµ²§Àªº n ¤§¶¡¦³ 18 Ó¦r¥À¡^¡A¬O«ü¥i¥HÅý¨Ï¥ÎªÌ¿ï¾Ü¬YºØ»y¨¥ªºÀ³¥Îµ{¦¡¡A³oºØÀ³¥Îµ{¦¡¨ã¦³¦h»y¨¥¤¶±¡Cn¼¶¼g³oºØµ{¦¡¡A¦Ü¤Ö¦³¤TºØ¤èªk¡G
¥»³¹µÛ«¦b²Ä¤GºØ¤èªk¡C¬°¤F¥Î³oºØ¤èªk¼¶¼g°ê»Ú¤ÆÀ³¥Îµ{¦¡¡A¥²¶·¥ýÁA¸Ñ¦r¦êªí¡A¥H¤Î¦p¦ó¸ü¤J¥¦¡C
¦r¦êªí¦b¸ê·½´yzÀɤº¡A¥¦ÄÝ©ó¸ê·½ªº¤@ºØ¡C¥i¥H¨Ì©³¤U®æ¦¡«Ø¥ß¦r¦êªí¡G
STRINGTABLE [optional-statements] BEGIN stringID,string ⁝ END
¨ä¤¤ STRINGTABLE ¬O«O¯d¦r¡A¥Nªí¦r¦êªí±q³o¨à¶}©l¡Coptional-statements ¬O¥i¥H¬Ù²¤ªº¡A¨ä·N¸q¸ò¸ê·½´yzÀɤ¤ªº¥\¯àªí°Ï¶ô¤@¼Ë¡A½Ð°Ñ¾\²Ä¤Q¤»³¹¡C
¦b BEGIN »P END ¤§¶¡¤~¬O¯u¥¿©w¸q¤F¦U¦¡¦U¼Ëªº¦r¦ê¡ABEGIN/END ¤]¥i¥H¥Î¤@¹ï¡u{ }¡v¥N´À¡A¦b¥¦Ì¤§¶¡ªº¨C¤@²Õ¦r¦ê³£¬O¥Ñ¤@Ó¤Q¤»¦ì¤¸ªº¦r¦êÃѧO½X¤Î¦r¦êºc¦¨¡C¤Q¤»¦ì¤¸¥i¥Hªí¥Ü 1¡ã65535 ¤§¶¡ªº¾ã¼Æ¡A¦]¦¹¦r¦êÃѧO½X¤]¬O¦b³oÓ½d³ò¤º¡C¦r¦ê¥²¶·¥H¤@¹ï¤Þ¸¹¡]"¡^¬A¦í¡A¦r¦ê¤]¥i¥H¥]§t´«¦æ²Å¸¹¡A¥i¥H¥Î¡u\12¡v©Î¥Î¤Q¤»¶i¦ì¡u\x0c¡vªí¥Ü¡A¤]¥i¥H¥Î²ßºD¤Wªº¡u\x0d\x0a¡v¨Óªí¥Ü¡C¦pªG¦b¦r¦ê¤¤nªí¥Ü "¡A¥i¥H¥Î¨âÓ³sÄòªº " ªí¥Ü¡A³o¼Ë¥u·|¥X²{¤@Ó "¡C¦r¦ê»P¦r¦êÃѧO½X¤§¶¡¡A¥i¥H¥ÎªÅ¥Õ©Î¡u,¡v¤À¹j¡C©³¤U¨Ò¤l¥i¨Ñ°Ñ¦Ò¡G
#define IDS_FILE 2000 #define IDS_EDIT 2001 STRINGTABLE { IDS_FILE,"ÀÉ®×" IDS_EDIT "½s¿è" }
¸ü¤J¦r¦êªí¤¤ªº¦r¦ê¡A¥i©I¥s LoadString¡A¥¦ªºì«¬¬O¡G
invoke LoadString,\ hInstance,\ ; handle of module containing string resource uID,\ ; resource identifier lpBuffer,\ ; address of buffer for resource nBufferMax ; size of buffer
hInstance ¬O¼Ò²Õ¥N½X¡FuID ¬On¸ü¤Jªº¦r¦êÃѧO½X¡FlpBuffer ¥Î¨Ó«ü©w¸ü¤J«áªº¦r¦ê¦s©ñ¦ì§}¡FnBufferMax ¬O¦s©ñ¦r¦êªºªÅ¶¡¤j¤p¡AANSI ª©ªº API ¥H¦ì¤¸²Õ¬°³æ¦ì¡A¼e¦r¤¸ª©¥H¦r¤¸¬°³æ¦ì¡A¦¹ªÅ¶¡¤j¤p¥]§t³Ì«áµ²§Àªº 0¡C¦pªG¦r¦êªø«×¶W¹L nBufferMax¡A¨º»ò¥u·|¨ú±o¦r¦êªº«e nBufferMax¡Ð1 Ӧ줸²Õ©Î¦r¤¸¡A´î±¼ªº¤@¬O«O¯dµ¹¦r¦êµ²§Àªº 0¡C
LoadString ÁÙ¦³Ó¥\¯à¡A¦pªG nBufferMax ³]¬°¹s¡A¨º»ò lpBuffer ©Ò«üªº¦ì§}¤¤·|±o¨ì¸Ó¦r¦êªº¦ì§}¡A³oÓ¦ì§}¬O°ßŪ¤£¯à¼g¤J¡C¦pªGn³]©w nBufferMax ¬°¹s¡A¦b½sĶ *.RC ÀɮɡA³Ì¦n¯à¿é¤J¡u-n¡v©Î¡u/n¡v°Ñ¼Æ¡A¦p¤U¡G
E:\HomePage\SOURCE\Win64\UNICODE>rc /n muln1.rc [Enter]
¡u/n¡v¬O·|¨Ï¦r¦êªí¤¤ªº¦r¦êµ²§À³B¥[¤W¡uNULL¡v¡A³o¼Ëªº¦n³B¬Oµ{¦¡¤£¥²¬°¸ü¤Jªº¦r¦ê·Ç³Æ¤@¶ô°O¾ÐÅé¡C
nÅýÀ³¥Îµ{¦¡¯à°÷ÀH¨Ï¥ÎªÌªº²ßºD¡A¿ï¨ú¤£¦Pªº»y¨¥¤¶±¡AÀ³¸Ó¦³³\¦hºØ¤èªk¡A¦ý¤p¤ì°¸ªº«ä¸ô¬O¹³¤U±³o¼Ë¡G
STRINGTABLE BEGIN 1000, "ÀÉ®×" 1001, "½s¿è" 1002, "»y¨¥" ⁝ 5000, "File" 5001, "Edit" 5002, "Language" ⁝ END
©³¤U¹ê§@¤@Ó¨Ò¤l»¡©ú¤W±ªºµ¦²¤¡C
MULN1 ¤¤ªº MU¡BLN ¬O«ü Multilingual ¤¤ Mu ¤Î lin¡A·N§Y¦h»y¨¥À³¥Îµ{¦¡¡C¥¦°õ¦æ®É·|«Ø¥ß¤@Ó¹ï¸Ü²°µe±¦p¤U¹Ï¡A¥iÅý¨Ï¥ÎªÌ¿é¤J¦W¦r¡AµM«á«ö¤U¡u°ÝÔ¡v«ö¶s¡A¥i¥H¦b¹ï¸Ü²°¤W¦L¥X¡u§A¦n¡A¢æ¢æ¡vªº°ÝÔ»y¦r¼Ë¡]¥Ò¹Ï¡^¡C¨Ï¥ÎªÌ¤]¥i¥HÂI¿ï¥\¯àªí¤¤ªº»y¨¥¡A¦³¥¿Å餤¤å¡B²Å餤¤å¡B^¤å¡B¦è¯Z¤ú¤å¡B¦L¦a¤å¥|ºØ»y¨¥¡]¤A¹Ï¡^¡A³o¥|ºØ»y¨¥¬O¥@¬É¨Ï¥Î¤H¤f³Ì¦hªº¥|ºØ»y¨¥¡C¤@¥¹¨Ï¥ÎªÌ§ïÅÜ»y¨¥«á¡A¨Ò¦p¿ï¾Ü¡u¦L¦a»y¡v¡A¹ï¸Ü²°¤¤ªº¥\¯àªí¡B±±¨î¶µ¤Wªº¤å¦r³£·|ÀH¤§Åܦ¨¦L¦a»y¤å¦r¡]¤þ¹Ï¡^¡C
¥ý¨Ó¬Ý¬Ý MULN1.EXE.MANIFEST ªº¤º®e¡Aª`·N¡A¥¦»P«e¤@³¹Â²µu«Ü¦h¡A¦]¬°¬Ù²¤¤F<assemblyIdentity ¡K¡K> ¤¸¯À¡C³oÓ¤¸¯À¥Î¨Ó´yzÀ³¥Îµ{¦¡¥»¨¡A¦p¤£»Ýn¬O¥i¥H¬Ù²¤ªº¡C
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly> |
©³¤U¬O¸ê·½´yzÀÉ¡AMULN1.RC¡Aªº¤º®e¡G
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
31 32 33 34 35 36
37 38 39 40 41 42
43 44 45 46 47 48
49 50 51 52 53 54
55 56 57 58 59 60
61 62 63 64 65 66
67 68 69 70 71 72
73 74 75 76 77 78
79 80 81 82 83 84
85 86 87 88 89 90
91 92 93 94 95 96
97 98 99 100 101 102
103 104 105 106 107 108
109 110 111 112 113 114
115 116 117 118 119 120
121 122 123 |
#pragma code_page(65001)
#include "RESOURCE.H"
#define MANIFEST 24
#define ID_DLG 1000
#define ID_ICON 1001
#define ID_MENU 1002
#define IDS_NAME 2001
#define IDE_NAME 2002
#define IDS_GREET 2003
#define IDB_GREET 2004
#define IDB_QUIT 2005
#define IDM_OPEN 30000
#define IDM_SAVE 30001
#define IDM_QUIT 30002
#define IDM_HELP 30003
#define IDM_TC 31000
#define IDM_SC 32000
#define IDM_EN 33000
#define IDM_ES 34000
#define IDM_HI 35000
ID_DLG DIALOGEX 350,180,126,56
CAPTION "¦h»y¨¥À³¥Îµ{¦¡½d¨Ò"
FONT 12,"Times New Roman",400,0,0
STYLE WS_VISIBLE|WS_OVERLAPPEDWINDOW
BEGIN
RTEXT "½Ð¿é¤J©m¦W¡G",IDS_NAME,6,3,51,17
EDITTEXT IDE_NAME, 61, 6,51,9
LTEXT "",IDS_GREET,14,20,93,9
PUSHBUTTON "°ÝÔ",IDB_GREET,32,32,36,12
PUSHBUTTON "Â÷¶}",IDB_QUIT, 74,32,36,12
END
ID_MENU MENU
BEGIN
POPUP "ÀÉ®×"
{
MENUITEM "¶}±Ò",IDM_OPEN
MENUITEM "Àx¦s",IDM_SAVE
MENUITEM "Â÷¶}",IDM_QUIT
}
POPUP "»y¨¥"
{
MENUITEM "¥¿Å餤¤å",IDM_TC
MENUITEM "简Ê^¤¤¤å",IDM_SC
MENUITEM "English",IDM_EN
MENUITEM "Español",IDM_ES
MENUITEM "स्पेनिश",IDM_HI
}
MENUITEM "»¡©ú",IDM_HELP
END
1 MANIFEST "muln1.exe.manifest"
ID_ICON ICON "muln1.ico"
STRINGTABLE
BEGIN
IDM_TC, "ÀÉ®×"
IDM_TC+1, "»y¨¥"
IDM_TC+2, "»¡©ú"
IDM_TC+3, "¶}±Ò"
IDM_TC+4, "Àx¦s"
IDM_TC+5, "Â÷¶}"
IDM_TC+6, "½Ð¿é¤J©m¦W¡G"
IDM_TC+7, "°ÝÔ"
IDM_TC+8, "Â÷¶}"
IDM_TC+9, "§A¦n¡A"
IDM_TC+10,"¦h»y¨¥À³¥Îµ{¦¡½d¨Ò"
IDM_TC+11,"¦h»y¨¥À³¥Îµ{¦¡½d¨Ò\x0a²Ä1.00ª©"
IDM_SC, "¤å¥ó"
IDM_SC+1, "语¨¥"
IDM_SC+2, "说©ú"
IDM_SC+3, "开启"
IDM_SC+4, "¦s储"
IDM_SC+5, "°h¥X"
IDM_SC+6, "请输¤J©m¦W¡G"
IDM_SC+7, "问Ô"
IDM_SC+8, "°h¥X"
IDM_SC+9, "§A¦n¡A"
IDM_SC+10,"¦h语¨¥应¥Îµ{§ÇS¨Ò"
IDM_SC+11,"¦h语¨¥应¥Îµ{§ÇS¨Ò\12²Ä1.00ª©"
IDM_EN, "File"
IDM_EN+1, "Language"
IDM_EN+2, "Help"
IDM_EN+3, "Open"
IDM_EN+4, "Save"
IDM_EN+5, "Quit"
IDM_EN+6, "Please input your name:"
IDM_EN+7, "Greeting"
IDM_EN+8, "Quit"
IDM_EN+9, "Hello, "
IDM_EN+10,"Multilingual program examples"
IDM_EN+11,"Multilingual Program Examples\12Version 1.00"
IDM_ES, "Archivo"
IDM_ES+1, "Idioma"
IDM_ES+2, "Ayuda"
IDM_ES+3, "Abrir"
IDM_ES+4, "Guardar"
IDM_ES+5, "Salir"
IDM_ES+6, "Por favor, ingrese su nombre:"
IDM_ES+7, "Hola"
IDM_ES+8, "Salir"
IDM_ES+9, "Hola, "
IDM_ES+10,"Ejemplo de programa multilingüe"
IDM_ES+11,"Ejemplo de Programa Multilingüe\12Versión 1.00"
IDM_HI, "फ़ाइल"
IDM_HI+1, "भाषा"
IDM_HI+2, "सहायता"
IDM_HI+3, "खोलें"
IDM_HI+4, "सहेजना"
IDM_HI+5, "बाहर निकलें"
IDM_HI+6, "कृपया अपना नाम दर्ज करें:"
IDM_HI+7, "सादर प्रणाम"
IDM_HI+8, "बाहर निकलें"
IDM_HI+9, "नमस्ते, "
IDM_HI+10,"बहुभाषी कार्यक्रम का उदाह"
IDM_HI+11,"बहुभाषी कार्यक्रम का उदाह\12संस्करण 1.00"
END |
ª`·N¨ì STRINGTABLE °Ï¶ô¡A±q²Ä 57¡ã123 ¦æ¬O¤ºØ»y¨¥¤å¦rªº¦r¦ê¡A¨Ã¥B¥Ñ²Ä 16¡ã20 ¦æ¥i¥H¬Ý¥X¤ºØ¤å¦rªº¦r¦êÃѧO½X¡G¥¿Å餤¤åªº¦r¦êÃѧO½X°_©l©ó 31000¡A²×¤î©ó 31011¡F²Å餤¤å°_©l©ó 32000¡A²×¤î©ó 32011¡K¡K¡A¨Ì¦¹Ãþ±À¡C¦P¤@ºØ»y¨¥ªº¦r¦êÃѧO½X³£¬O³sÄòªº¾ã¼Æ¡A¤£¦PºØªº»y¨¥«h¤£³sÄò¡C°£¦¹¤§¥~¡A¤£¦P»y¨¥¤§¶¡¡A¬Û¹ïÀ³ªº¦r¦êÃѧO½X©Ò¥Nªíªº¦r¦ê¡A·N¸q¬Û¦P¡C¨Ò¦p³o¤ºØ¤å¦rªº°_©l¦r¦êÃѧO½X©Ò¥Nªíªº¦r¦ê¡AÀɮסB¤å¥ó¡BFile¡BArchivo¡Bफ़ाइल³£¬OÀɮתº·N«ä¡A¦P²z²Ä¤GÓ³£¬O»y¨¥ªº·N«ä¡C
¦]¬° MULN1.RC ¤º§t¦hºØ»y¨¥¡A¦]¦¹¦bÀx¦s®É¶·ª`·NÀx¦s®æ¦¡¡A±`¨£±¡§Î¦p¤U¡G
#pragma code_page(¶½X)§iª¾ RC.EXE ³o¥÷¸ê·½´yzÀɪº½s½X¤è¦¡¡C65001 ´N¬O UTF¡Ð8¡A950 ¬O Big5¡A936 ¬O GB2312¡C«ü©w½s½X¤è¦¡«á¡A¦bÀx¦s¸ê·½´yzÀɮɤ]»Ý«ü©w UTF¡Ð8 ®æ¦¡Àx¦s¡C¹ï MULN1.RC ¨Ó»¡¡A¥u¯à«ü©w¡u#pragma code_page(65001)¡v¡C
¦b¨Ï¥Î¸ê·½½sĶ¾¹¡ARC.EXE ½sĶ¸ê·½´yzÀÉ¡AMULN1.RC ®É¡An¤U¹F¡u-n¡v©Î¡u/n¡v¿ï¶µ¡A³o¬O¦]¬°¦b©I¥s LoadString ¨ú±o¦r¦ê®É¡A´¿¨Ï³Ì«á¤@ӰѼƳ]¬°¹s¡C¨£«e± LoadString ªº»¡©ú¡C
³Ì«á¬O MULN.ASM ªº¤º®e¡A¦sÀɮɥ²¶·¥H ANSI/ASCII ®æ¦¡Àx¦s¡G
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
21 22 23 24
25 26 27 28
29 30 31 32
33 34 35 36
37 38 39 40
41 42 43 44
45 46 47 48
49 50 51 52
53 54 55 56
57 58 59 60
61 62 63 64
65 66 67 68
69 70 71 72
73 74 75 76
77 78 79 80
81 82 83 84
85 86 87 88
89 90 91 92
93 94 95 96
97 98 99 100
101 102 103 104
105 106 107 108
109 110 111 112
113 114 115 116
117 118 119 120
121 122 123 124
125 126 127 128
129 130 131 132
133 134 135 136
137 138 139 140
141 142 143 144
145 146 147 148
149 150 151 152
153 154 155 156
157 158 159 160
161 162 163 |
;¦h»y¤åÀ³¥Îµ{¦¡¡C²ÕĶ¡B³sµ²¤è¦¡¡G
;1.§âMULN1.ASM¡BMULN1.RC¡BMELN1.EXE.MANIFEST¡BMULN1.ICO¥|ÓÀÉ®×
; ©ñ¦b¦P¤@¤l¥Ø¿ýùØ
;2.¶}±Ò©R¥O¡A¨Ì§Ç¿é¤J¤U±«ü¥O
; uasm64 -win64 muln1.asm
; rc -n muln1.rc
; link muln1.obj muln1.res
;MULN1¥i¥HÅý¨Ï¥ÎªÌ¦b½s¿è®Ø¿é¤J©m¦W¡A«ö°ÝÔ«ö¶s¡A·|¥X²{°ÝÔ»y¡C
;¥i¥H¸g¥Ñ»y¨¥¥\¯àªí¿ï¾Ü¤ºØ»y¨¥¡A§ïÅÜ»y¨¥«á¡A¥D¥\¯àªí¡B±±¨î¶µ
;ªº¤å¦r³£·|ÀH¤§§ïÅÜ
OPTION CASEMAP:NONE
OPTION WIN64:3
UNICODE EQU 1
ID_DLG EQU 1000
ID_ICON EQU 1001
ID_MENU EQU 1002
IDS_NAME EQU 2001
IDE_NAME EQU 2002
IDS_GREET EQU 2003
IDB_GREET EQU 2004
IDB_QUIT EQU 2005
IDM_OPEN EQU 30000
IDM_SAVE EQU 30001
IDM_QUIT EQU 30002
IDM_HELP EQU 30003
IDM_TC EQU 31000
IDM_SC EQU 32000
IDM_EN EQU 33000
IDM_ES EQU 34000
IDM_HI EQU 35000
INCLUDE WINDOWS.INC
INCLUDE COMMCTRL.INC
INCLUDELIB KERNEL32.LIB
INCLUDELIB USER32.LIB
INCLUDELIB COMCTL32.LIB
INCLUDELIB MSVCRT.LIB ;wcscat¨ç¦¡ªº³sµ²¸ê®Æ¦bMSVCRT.LIB¤º
;*********************************************************************
.DATA
hInst DQ ? ;¼Ò²Õ¥N½X
hMenu DQ ? ;¥D¥\¯àªí¥N½X
hFilMenu DQ ? ;Àɮפl¥\¯àªí¥N½X
hLngMenu DQ ? ;»y¨¥¤l¥\¯àªí¥N½X
lng DD 31000 ;¹w³]ªº»y¨¥
buffer1 DW 40h DUP (0)
buffer2 DW 40h DUP (0)
;*********************************************************************
.CODE
;---------------------------------------------------------------------
chg_lng PROC hdlg:HANDLE
LOCAL mii:MENUITEMINFO,id:DWORD
lea r8,buffer1
mov mii.cbSize,SIZEOF mii
mov mii.fMask,40h ;MIIM_STRING=40h
mov mii.dwTypeData,r8
mov edx,lng
mov id,edx
invoke LoadString,hInst,id,OFFSET buffer1,20h ;ÀÉ®×
invoke SetMenuItemInfo,hMenu,0,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;»y¨¥
invoke SetMenuItemInfo,hMenu,1,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;»¡©ú
invoke SetMenuItemInfo,hMenu,2,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;¶}±Ò
invoke SetMenuItemInfo,hFilMenu,0,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;Àx¦s
invoke SetMenuItemInfo,hFilMenu,1,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;Â÷¶}
invoke SetMenuItemInfo,hFilMenu,2,1,ADDR mii
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;½Ð¿é¤J©m¦W
invoke SetDlgItemText,hdlg,IDS_NAME,OFFSET buffer1
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;°ÝÔ
invoke SetDlgItemText,hdlg,IDB_GREET,OFFSET buffer1
inc id
invoke LoadString,hInst,id,OFFSET buffer1,20h ;Â÷¶}
invoke SetDlgItemText,hdlg,IDB_QUIT,OFFSET buffer1
ret
chg_lng ENDP
;---------------------------------------------------------------------
DlgProc PROC hDlg:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL pCaption:QWORD,pText:QWORD
.if uMsg==WM_INITDIALOG
;³]©w¹ï¸Ü²°¼ÐÃDÄ楪Ã䪺¹Ï¥Ü¬°¸ê·½¤¤©w¸qªº¹Ï¥Ü
invoke SendMessage,hDlg,WM_SETICON,ICON_SMALL,RV(LoadIcon,hInst,ID_ICON)
;³]©w¹ï¸Ü²°ªº¥D¥\¯àªí¬°¸ê·½¤¤©w¸qªº¥\¯àªí
mov hMenu,RV(LoadMenu,hInst,ID_MENU)
invoke SetMenu,hDlg,hMenu
;¨ú±oÀɮפl¥\¯àªí¤Î»y¨¥¤l¥\¯àªí¥N½X
mov hFilMenu,RV(GetSubMenu,hMenu,0)
mov hLngMenu,RV(GetSubMenu,hMenu,1)
.elseif uMsg==WM_COMMAND
mov rax,r8 ;R8W¡×ÃѧO½X
shr rax,10h ;AX¡×³qª¾½X
.if ax==0
.if r8w==IDB_QUIT
jmp quit
.elseif r8w==IDB_GREET
grt: ;«ö¤U¡u°ÝÔ¡v«ö¶s¡A¥ý¨ú±o½s¿è®Ø¤º¦r¦ê¡A¦AÀˬd¸Ó¦r¦ê¬O§_¬°ªÅ¦r¦ê
.if RV(GetDlgItemText,hDlg,IDE_NAME,ADDR buffer2,SIZEOF buffer2-1)==0
mov WORD PTR buffer1,0
.else
mov edx,lng
add edx,9
invoke LoadString,hInst,edx,ADDR buffer1,20h
invoke wcscat,ADDR buffer1,ADDR buffer2
.endif
invoke SetDlgItemText,hDlg,IDS_GREET,ADDR buffer1
.elseif r8w==IDM_OPEN
.elseif r8w==IDM_SAVE
.elseif r8w==IDM_QUIT
jmp quit
.elseif r8w==IDM_HELP
;¨ú±oMessageBox¼u¥X¹ï¸Ü²°¦r¦ê¦ì§}¤Î¼ÐÃD¦ì§}
mov edx,lng
add edx,11
invoke LoadString,hInst,edx,ADDR pText,0
mov edx,lng
add edx,10
invoke LoadString,hInst,edx,ADDR pCaption,0
;Åã¥ÜMessageBox¼u¥X¹ï¸Ü²°
invoke MessageBox,hDlg,pText,pCaption,MB_OK
.elseif (r8w>=IDM_TC) && (r8w<=IDM_HI)
movzx rax,r8w
mov lng,eax
invoke chg_lng,hDlg
invoke DrawMenuBar,hDlg
mov edx,lng
add edx,10
invoke LoadString,hInst,edx,ADDR pCaption,0
invoke SetWindowText,hDlg,pCaption
jmp grt
.endif
.endif
.elseif uMsg==WM_CLOSE
quit: invoke EndDialog,hDlg,0
.else ;¨ä¥L¥¼³B²zªº°T®§ªð¦^ FALSE
xor rax,rax
ret
.endif ;¤w³B²zªº°T®§¡Aªð¦^ TRUE
mov rax,1
ret
DlgProc ENDP
;---------------------------------------------------------------------
main PROC
call InitCommonControls
mov hInst,RV(GetModuleHandle,0)
invoke DialogBoxParam,hInst,ID_DLG,0,OFFSET DlgProc,0
invoke ExitProcess,0
main ENDP
;*********************************************************************
END main |
¦p«e©Òz¡AMULN1 ³Ì«nªº¥\¯à¬O¥i¥H¥Ñ¥\¯àªí¤Wªº¿ï¶µ¡A§ïÅܹï¸Ü²°©ÒÅã¥Üªº»y¨¥¤å¦r¡C³B²z³o¹Lµ{¤¤¡A³Ì«nªºÅܼƬO²Ä 45 ¦æªº lng¡A¥¦¬O language ªºÂ²¼g¡A¹w³]ȬO 31000¡A¤]´N¬O¥¿Å餤¤å°_©l¦r¦êÃѧO½X¡C·í¨Ï¥ÎªÌ¿ï¾Ü»y¨¥¥\¯àªí¤¤ªº¿ï¶µ§ïÅÜ»y¨¥®É¡Alng ¤§È·|ÀH¤§§ïÅÜ¡A¦ý³£¬O¬YºØ»y¨¥¦b¸ê·½¦r¦êªí¤¤¡A°_©l¦r¦êªº¦r¦êÃѧO½X¡C
¨Ò¦p¨Ï¥ÎªÌ¿ï¾Ü^¤å¡A¥Ñ²Ä 29 ¦æ±oª¾¡A^¤åªº¿ï¶µÃѧO½X¡AIDM_EN ¬O 33000¡Alng ·|Åܦ¨ 33000¡A³o«ê¦n¤]¬O MULN1.RC ¤¤²Ä 85 ¦æ¡A^¤åªº°_©l¦r¦êÃѧO½X¡F¤S¨Ò¦p¨Ï¥ÎªÌ¿ï¾Ü¦L¦a¤å¡Alng ·|Åܦ¨ 34000¡A³o¤]«ê¦n¬O MULN1.RC ¤¤ªº IDM_HI¡C·íµM¡A³o¬O¬G·N¦w±Æ¦¨³o¼Ëªº¡C¬°¤°»ò³o¼Ë¦w±Æ¡AÁA¸Ñ¤F chg_lng °Æµ{¦¡ªº¹B§@¡A´Nª¾¹D¬°¦ó³o¼Ë¦w±Æ¡C
¦b»¡³oì¦]¤§«e¡A³o¨àÁÙn¦h»¡¤@ÂIÃD¥~¸Ü¡C¨Ï¥ÎªÌ¿ï¾Ü¥\¯àªí¤Wªº¿ï¶µ©Î«ö¤U¹ï¸Ü²°¤¤ªº«ö¶s¡A¨t²Î³£·|¹ï MULN1 ªº¹ï¸Ü²°¨ç¦¡µo¥X WM_COMMAND¡A¦pªG¬O«eªÌ¡AwParam ªº²Ä 16¡ã31 ¦ì¤¸¤£¨Ï¥Î¡A³]¬°¹s¡F¦pªG¬O«áªÌ¡AwParam ²Ä 16¡ã31 ¦ì¤¸ºÙ¬°³qª¾½X¡A¦Ó¦¹¨è³qª¾½X¬O BN_CLICKED¡A¨äÈ«ê¦n¤]¬O¹s¡C©Ò¥H MULN1 §â³o¨â¨Æ¥óÂ\¦b¤@°_³B²z¡AMULN1 ¬O¾a«ö¶sÃѧO½X¸ò¿ï¶µÃѧO½X°Ï§O¥¦Ì¡C²Ä 103¡B142 ¦æªº .if ax==0/.endif ¤º¥]§t¤F¥t¤@Ó .if/.endif¡A³Q¥]§tªº .if/.endif Àˬd R8W¡]R8W ¬°«ö¶sÃѧO½X©Î¿ï¶µÃѧO½X¡^¨Ó½T©w¨Ï¥ÎªÌ¾Þ§@ªº¬O¿ï¶µÁÙ¬O«ö¶s¡C
¨¥Âk¥¿¶Ç¡A¦^¨ì¦p¦ó§â¥\¯àªí¤Wªº¿ï¶µ¤å¦r¤Î±±¨î¶µ¤å¦r³£´«¦¨¨ä¥L»y¨¥¤å¦r¡C
n§ó§ï¿ï¶µ¤å¦r¡A¤èªk¬O©I¥s SetMenuItemInfo¡ASetMenuItemInfo ªº¸Ô²Ó¥Îªk½Ð°Ñ¾\²Ä¤Q¤K³¹¡A³o¨à²³æ§ãnªº»¡¡A¹ï©ó MULN1 ¥u¶·³]©w MENUITEMINFO µ²ºcÅ餤ªº¤TÓÄæ¦ì§Y¥i¡G①§â cbSize Äæ¦ì¬° MENUITEMINFO µ²ºcÅ馳¦h¤Ö¦ì¤¸²Õ¡C②§â fMask Äæ¦ì¬° MIIM_STRING¡AWinInc ¯Ê¤Ö«Å§i¦¹±`¼Æ¤§È¡A¦ý¬d¾\ºô¸ô¥i§ä¨ì¦¹¼Æ¬° 40h¡C③§â dwTypeData Äæ¦ì³]¬°nÅܧó¤å¦rªº¦r¦ê¦ì§}¡A¦¹¦ì§}´N¬O buffer1 ªº¦ì§}¡ALoadString ¥Ñ¸ê·½¸ü¤Jªº¦r¦ê±N¦s©ó¦¹¦ì§}¡C³o¤T¨BÆJ¨£²Ä 53¡ã56¡A³]©w¦n¤§«á¡AMENUITEMINFO µ²ºcÅé´N¤£»Ý§ïÅÜ¡A§ïÅܪº¬O buffer1 ¤ºªº¦r¦ê¤º®e¡C
±q¸ê·½ªº¦r¦êªí¤¤¸ü¤Jªº¦r¦ê¡A¦s¤J buffer1 ¤º¡A³o¹Lµ{n©I¥s LoadString¡CLoadString ªº²Ä¤GӰѼƬO¸ê·½¦r¦êªí¤¤ªº¦r¦êÃѧO½X¡A¥Î°Ï°ìÅÜ¼Æ id ªí¥Ü¡A¦b²Ä 57¡B58 ¨â¦æ¤w§â lng ¦s¤J id¡C
chg_lng »Ýn§ïÅܪº¿ï¶µ¤å¦r¦³¤»¶µ¡A³o¤»¶µªº¦r¦êÃѧO½X±Æ¦¨³sÄòªº¥¿¾ã¼Æ¡A©Ò¥H¥unª¾¹D°_©lªº¦r¦êÃѧO½X¡A¨C³B²z§¹¤@ӿﶵ«á¡A¨Ï id ¼W¥[¤@¡A´N¯à¸ü¤J¤UÓ¦r¦ê¤F¡C¨£²Ä 59¡ã75 ¦æ¡C¦Ü©ó§ó´««ö¶s¤Wªº¤å¦r¡A¤]¬O¤@¼Ëªº¹D²z¡A´N¤£ÂØz¡C
MULN1 ´N¤¶²Ð¨ì³o¨à¡A©³¤U»¡©ú¦b MULN1 ¤¤·sªº«ü¥O©Î¨ç¦¡¡C
wcscat ¥\¥Î¬O¦X¨Ö¦r¦ê¡A¥¦¨Ã¤£¬O Win64 API¡A¦Ó¬O C »y¨¥µ{¦¡®w¤º«Øªº¼Ð·Ç¨ç¦¡¡A©Ò¥H¦pªGÀ³¥Îµ{¦¡¤¤n©I¥s¥¦¡An¥ý¤Þ¤J MSVCRT.LIB ¨ç¦¡®w¡Cwcscat ¤¤ªº wc ¬O wide character ªº·N«ä¡A¥¦ªºì«¬¬O¡G
invoke wcscat,\ pDestination,\ ; Null-terminated destination string pSource ; Null-terminated source string
pDestination ¬O¥Øªº¦r¦êªº¦ì§}¡ApSource ¬O¨Ó·½¦r¦êªº¦ì§}¡A³o¨âÓ¦r¦ê³£¥²¶·¥H¹sµ²§À¡A¦Ó¥B¨ä¦r¤¸¤]³£¥²¶·¥H¸U°ê½X½s½X¡Cwcscat ·|¦b pDestination ¦ì§}¤Wªº¥Øªº¦r¦ê§ÀºÝ¡]µ²§Àªº¹s«eªº¤@Ó¦ì§}¡^¡A¶ñ¤W¨Ó·½¦r¦ê¡A¹F¨ì¦X¨Ö¦r¦êªº¥\¯à¡C
strcat ¥Î¨Ó§â¨âÓ¦r¦ê³s±µ°_¨Ó¡Astrcat ªº¨Ï¥Î¤è¦¡³£¸ò wcscat ¤@¼Ë¡A¥u¬O strcat ¬O ANSI ª©¥»¡A¤]´N¬O»¡ strcat ¥u¯à³B²z ASCII ¦r¤¸©Ò²Õ¦¨ªº¦r¦ê¡C©I¥s³o¨âӨ禡¤§«e¡A¶·ª`·N pDestination ©Ò«ü¦ì§}¤Wªº¦r¦ê¤§«á¡A¥²¶·¦³¨¬°÷ªºªÅ¶¡¥i®e¯Ç¨Ó·½¦r¦ê¡A§_«h«Ü®e©öÂл\¨ä«áªº¸ê®Æ¡A¦Óµo¥Í¿ù»~¡AÄY«¬Æ¦Ü¤Þµo·¸¦ì¿ù»~¡C
RV ¬O UASM64 ¤º«Øªº¥¨¶°¨ç¦¡¡A¦]¬° Windows À³¥Îµ{¦¡¤¤ªº¥¨¶°¦WºÙ·|°Ï¤À¤j¤p¼g¡A©Ò¥H RV ¤]¥²¶·³£¥Î¤j¼g¡A§_«h·|µo¥Í¿ù»~¡CRV ¬O¦^¶ÇÈ¡]return value¡^ªº·N«ä¡A¥¦¥Î©ó¦b©I¥s¨ç¦¡¤§«á¡A§â¦^¶ÇȦs©ó RAX ¼È¦s¾¹¤¤¡A¦Ó¥i¥Hª½±µ»P¥t¤@«ü¥O·f°t¡C¥¦ªº»yªk¬O¡G
RV(¨ç¦¡¦WºÙ, °Ñ¼Æ¦Cªí)
·íµM¶È¶È¦p¦¹ÁÙ¤£¬O§¹¾ãªº«ü¥O¡A¥u¬O«ü¥Oªº¤@³¡¥÷¡C·Ç½T¦a»¡¥²¶·§â¾ãÓ¡uRV(¨ç¦¡¦WºÙ, °Ñ¼Æ¦Cªí)¡vµø¬° RAX ¹Bºâ¤¸¡A¦A»P«ü¥O¨ä¥L³¡¤À·f°t¡C¨Ò¦pn¨ú±o¼Ò²Õ¥N½X¡A¥»¨Ó¬O¼g¦¨¤U±ªº¼Ë¤l
invoke GetModuleHandle,0 mov hInst,rax
¦pªG¨Ï¥Î RV ¥¨¶°¨ç¦¡¡A¥i¥H¼g¦¨¤@¦æ¡A§â RV(GetModuleHandle,0) ¬Ý¦¨¬O RAX¡G
mov hInst,RV(GetModuleHandle,0)
RV °£¤F»P x86 «ü¥O¡A¹³ MOV¡BADD¡K¡K·f°t¤§¥~¡A¤]¥i¥H¥Î¦b .if/.endif¡B.while/.endw¡K¡K©Î invoke °²«ü¥O¡C¨Ò¦pn³]©wµøµ¡¼ÐÃDÄ楪Ã䪺¹Ï¥Ü¡A¤@¯ë¬O¼g¦¨¹³©³¤Uªºµ{¦¡¡A»Ýn¨â¦æµ{¦¡½X¡G
invoke LoadIcon,hInst,IDI_APPLICATION invoke SendMessage,hDlg,WM_SETICON,ICON_SMALL,rax
¦pªG§ï¥Î RV ¥¨¶°¡A´NÅܦ¨¤@¦æ¡A¦p¤U¡G
invoke SendMessage,hDlg,WM_SETICON,ICON_SMALL,RV(LoadIcon,hInst,IDI_APPLICATION)
¥»³¹´N¤¶²Ð¨ì³o¨à¡A¤w¸gªì¨B¤¶²Ð¤F¸U°ê½X¡A¥H¤Î¦p¦ó¦b²Õ¦X»y¨¥¤¤¡A¹ï¥Ñ^¤å¡Bªü©Ô§B¼Æ¦r²Õ¦¨ªº¦r¤¸¥H¸U°ê½X¤è¦¡½s½X¡C¤U¤@³¹±N¤¶²Ð¨Ï¥Î¤¤¤åªº¸U°ê½X½s½X¤è¦¡²£¥Í¦r¦ê¡A³o¤]¥i¥HÂX¥R¦ÓÀ³¥Î¨ì¨ä¥L»y¨¥ªº¤å¦r¡C
«e¤@³¹¥H¤Î¥»³¹Á`¦@¤¶²Ð¤F¤TÓ C »y¨¥ªº¼Ð·Ç¨ç¦¡¡Asprintf¡Bwcscat¡Bstrcat¡A¦A¥[¤W²Ä¥|³¹¤¶²Ðªº wsprintf¡A³o¥|Ө禡³£¨S¦³©w½w½Ä°Ï¤j¤p¡A¬Y¨Ç±¡ªp·|¦³½w½Ä°Ï·¸¦ì¤Wªº¦w¥þ°ÝÃD¡A¦]¦¹³\¦h¤åÄm¡A¥]§t MSDN ³£«Øij¤£n¨Ï¥Î³o¨Ç¨ç¦¡¡C·L³n¦¤w·Ç³Æ¦n¤@¨Ç Win64 API ¨ç¦¡¥i¨Ñ¨Ï¥Î¡A¦ý»Ýn¾ã²z¡Aµ¥¤p¤ì°¸¾ã²z¦n¦A²K¥[¨ì¬YÓªþ¿ý¤¤§a¡C