Toddler's Corner > Romper Room

Playing

<< < (2/5) > >>

jj2007:
include \masm32\MasmBasic\MasmBasic.inc
assCt=0
AssignCt MACRO arg
  xchg eax, arg
  mov tCount(assCt), eax
  assCt=assCt+1
ENDM

  Init
  PrintCpu 0                            ; for better comparisons ;-)

  Let esi=FileRead$("mshtmlc.bi")      ; 2,488,437 bytes

  $Data type sp case-sensitive, no sp cs, cs+full word, sp+case-insensitive, no sp cis, cis+fw, 1st char case-insensitive, 1st cis+fw
  $Data end type sp case-sensitive, end type sp cis, end type cs, end type cis
  Read Desc$()

  Dim tCount() As DWORD

  NanoTimer()
  AssignCt Count(esi, "type ", 0)      ; type<space>, 0=case-sensitive
  AssignCt Count(esi, "type", 0)       ; no space, case-sensitive
  AssignCt Count(esi, "type", 4)       ; 4=cs+full word
  AssignCt Count(esi, "type ", 1)      ; space, 1=case-insensitive
  AssignCt Count(esi, "type", 1)       ; no space, case-insensitive
  AssignCt Count(esi, "type", 1+4)     ; 1=case-insensitive, full word
  AssignCt Count(esi, "type", 2)       ; 2=first char case-insensitive
  AssignCt Count(esi, "type", 2+4)     ; 2=first char case-insensitive, full word
  AssignCt Count(esi, "end type ", 0)  ; type<space>, 0=case-sensitive
  AssignCt Count(esi, "end type ", 1)  ; type<space>, 1=case-insensitive
  AssignCt Count(esi, "end type", 0)   ; type, 0=case-sensitive
  AssignCt Count(esi, "end type", 1)   ; type, 1=case-sensitive
  Print Str$("counting took %2f seconds\n", NanoTimer(us)/1000000)
  For_ ct=0 To Desc$(?)-1
        PrintLine Str$(ct), Str$("\t%i matches\t", tCount(ct)), "[", Desc$(ct), "]"
  Next
  Inkey "for comparison: MS Word, case sensitive, full word: 2563-845=1718"
EndOfCode

Output:
--- Code: ---Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz
counting took 0.027 seconds
0       1583 matches    [type sp case-sensitive]
1       2573 matches    [no sp cs]
2       2563 matches    [cs+full word]
3       1636 matches    [sp+case-insensitive]
4       5356 matches    [no sp cis]
5       2595 matches    [cis+fw]
6       5324 matches    [1st char case-insensitive]
7       2563 matches    [1st cis+fw]
8       0 matches       [end type sp case-sensitive]
9       0 matches       [end type sp cis]
10      845 matches     [end type cs]
11      845 matches     [end type cis]
for comparison: MS Word, case sensitive, full word: 2563-845=1718
--- End code ---

jj2007:
The new menu looks certainly different :bgrin:

Beta attached, use at your own risk. Extract as
\Masm32\MasmBasic\Res\UserDef\RichMasm.ini
\Masm32\MasmBasic\RichMasm.exe

jj2007:
New version - we are getting nearer  :t

Interesting that the screenshot taken with an aero theme shows the tooltip, while the "normal" theme doesn't allow to capture the tip. This stuff is really messy. For example, if you have Aero enabled, Dwmapi::DwmIsCompositionEnabled returns 1 but uxtheme::IsCompositionActive returns 0 ::)

MSDN Social has a How to detect if Aero is enabled thread:
--- Quote ---VC6 is far too old and too rotten to support to find out if Aero is enabled or not
--- End quote ---

I like their sense of humour :P

hutch--:
What I would really like is a decent 64 bit dis-assembler and so far I have not found one. The ARkDasm I have been using was very good for analysis during the development of 64 bit MASM but its asm output is too different to be useful for re-constructing asm code from a binary file. The best I have so far is the ordinary Microsoft Dumpbin with its results being able to be re-formatted back into MASM code with some massaging.

jj2007:
What's wrong with x64 except that they have ruthlessly stolen ideas from Olly?
--- Code: ---include \Masm32\MasmBasic\Res\JBasic.inc
Init ; OPT_64 1 ; put 0 for 32 bit, 1 for 64 bit assembly
  PrintLine Chr$("This code was assembled with ", @AsmUsed$(1), " in ", jbit$, "-bit format")
  int 3 ; BREAK
  fldpi ; the FPU still exists!
  sub rsp, QWORD
  fld st
  fistp qword ptr [esp]
  movlps xmm0, qword ptr [esp]
  fst qword ptr [esp]
  movlps xmm1, qword ptr [esp]
  add rsp, QWORD
  MsgBox 0, "Wow, it works!!!!", "Hi", MB_OK or MB_SETFOREGROUND
EndOfCode
--- End code ---


--- Code: ---000000014000108D | CC                                | int3                                  |
000000014000108E | D9 EB                             | fldpi                                 |
0000000140001090 | 48 83 EC 08                       | sub rsp, 8                            |
0000000140001094 | D9 C0                             | fld st0                               |
0000000140001096 | 67 DF 3C 24                       | fistp qword ptr ds:[esp]              |
000000014000109A | 67 0F 12 04 24                    | movlps xmm0, qword ptr ds:[esp]       |
000000014000109F | 67 DD 14 24                       | fst qword ptr ds:[esp]                |
00000001400010A3 | 67 0F 12 0C 24                    | movlps xmm1, qword ptr ds:[esp]       |
00000001400010A8 | 48 83 C4 08                       | add rsp, 8                            |
00000001400010AC | 48 8D 15 C6 01 00 00              | lea rdx, qword ptr ds:[140001279]     | 140001279:"Wow, it works!!"
00000001400010B3 | 49 C7 C1 00 00 01 00              | mov r9, 10000                         |
00000001400010BA | 4C 8D 05 C8 01 00 00              | lea r8, qword ptr ds:[140001289]      | 140001289:"Hi"
00000001400010C1 | 33 C9                             | xor ecx, ecx                          |
00000001400010C3 | FF 15 27 03 00 00                 | call qword ptr ds:[<&MessageBoxA>]    |
00000001400010C9 | 33 C9                             | xor ecx, ecx                          |
00000001400010CB | FF 15 3F 03 00 00                 | call qword ptr ds:[<sub_140001410>]   |
00000001400010D1 | 48 8D 0D B4 01 00 00              | lea rcx, qword ptr ds:[<sub_14000128C | 14000128C:"user32"
00000001400010D8 | 48 8D 15 01 03 00 00              | lea rdx, qword ptr ds:[<sub_1400013E0 |
00000001400010DF | E8 27 00 00 00                    | call <sub_14000110B>                  |
00000001400010E4 | C3                                | ret                                   |
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version