News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

This is too slow

Started by frktons, November 18, 2010, 03:10:21 AM

Previous topic - Next topic

Antariy

Quote from: frktons on November 21, 2010, 10:17:28 PM
Well I guess I was moving al to [esi] and it didn't work with older MASM versions.

No, this *should* (should!!!) work. At assembly-time is known the size of the operand.

Maybe Dave will test the new release, and we can see, what is up? What you say, Dave?

frktons

Quote from: Antariy on November 21, 2010, 10:19:50 PM
Quote from: frktons on November 21, 2010, 10:17:28 PM
Well I guess I was moving al to [esi] and it didn't work with older MASM versions.

No, this *should* (should!!!) work. At assembly-time is known the size of the operand.

Maybe Dave will test the new release, and we can see, what is up? What you say, Dave?


Alex you have MASM 6.15 on your machine. You can try it yourself.  :P
Mind is like a parachute. You know what to do in order to use it :-)

dedndave


┌─────────────────────────────────────────────────────────────[21-Nov-2010 at 22:21 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Pentium(R) 4 CPU 3.00GHz with 2 logical core(s) with SSE3                │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 ustrv$ + GetNumberFormat     

frktons

Quote from: dedndave on November 21, 2010, 10:22:36 PM

┌─────────────────────────────────────────────────────────────[21-Nov-2010 at 22:21 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Pentium(R) 4 CPU 3.00GHz with 2 logical core(s) with SSE3                │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 ustrv$ + GetNumberFormat     

:lol :lol :lol :lol :lol :lol :lol :lol


; -------------------------------------------------------------------------
; The data read from the Screen Buffer is converted into DOS style.
; The New Buffer is filled with the content of the Screen Buffer, removing
; a char after each byte making it DOS compatible.
; -------------------------------------------------------------------------

ConvertToDOS PROC DestBuffer:DWORD, SourceBuffer:DWORD


    mov  esi, SourceBuffer
    mov  edi, DestBuffer

    mov  ecx, CharNumber
    xor  eax, eax

    xor  ebx, ebx

NextChar:

    mov eax, [esi]
    mov BYTE PTR [edi], al
    shr eax, N16
    mov BYTE PTR [edi+1], al

    add esi, Four
    add edi, Two

    dec ecx
    jnz NextChar

End_cycle:

    ret
   
ConvertToDOS ENDP



Do you see any problem here?

Mind is like a parachute. You know what to do in order to use it :-)

dedndave

manually..
┌─────────────────────────────────────────────────────────────[21-Nov-2010 at 22:21 GMT]─┐
│OS  : Microsoft Windows XP Professional Service Pack 2 (build 2600)                     │
│CPU : Intel(R) Pentium(R) 4 CPU 3.00GHz with 2 logical core(s) with SSE3                │
├──────────────────────────────────┬─────────┬──────────┬──────────┬──────────┬──────────┤
│        Algorithm notes           │Proc Size│ Test # 1 │ Test # 2 │ Test # 3 │ Test # 4 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│01 ustrv$ + GetNumberFormat       │    95   │   93,311 │   92,294 │   89,304 │   89,287 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│02 udw2str + GetNumberFormat      │    65   │   87,343 │   87,847 │   87,956 │   87,071 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│03 wsprintf + GetNumberFormat     │    73   │  106,150 │  106,907 │  106,463 │  120,352 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│04 Clive - IDIV and Stack         │   120   │    8,638 │    8,480 │    8,414 │    8,112 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│05 Clive - reciprocal IMUL        │   157   │    3,516 │    3,481 │    3,530 │    3,516 │
├──────────────────────────────────┼─────────┼──────────┼──────────┼──────────┼──────────┤
│06 Hutch ustr$ + format algo      │   159   │   12,250 │   11,931 │   12,162 │   12,289 │

Antariy

Quote from: frktons on November 21, 2010, 10:21:04 PM
Alex you have MASM 6.15 on your machine. You can try it yourself.  :P

This is thing which is not needed in proving :P It should work, and it work :P

frktons

Quote from: Antariy on November 21, 2010, 10:26:07 PM
Quote from: frktons on November 21, 2010, 10:21:04 PM
Alex you have MASM 6.15 on your machine. You can try it yourself.  :P

This is thing which is not needed in proving :P It should work, and it work :P


Not in Dave's machine.
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 21, 2010, 10:23:06 PM
Do you see any problem here?

No.

You should search for the runtime dependency: maybe somewhere you did not preserve some register, or you rely that this register have the same/specific value, etc.

hutch--

Framk,

The notation,


    mov [esi], al


Has always worked in MASM. The guys are right that its only if the data size is not known that you must specify its size. MASM is historically a fully specified Intel notation but where it can determine the size from a register you can use abbreviated notation.

Either,


    mov BYTE PTR [esi], al
    ; or
    mov [esi], al


are valid as the size can be determined from the register AL.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Antariy

Quote from: frktons on November 21, 2010, 10:27:34 PM
Quote from: Antariy on November 21, 2010, 10:26:07 PM
Quote from: frktons on November 21, 2010, 10:21:04 PM
Alex you have MASM 6.15 on your machine. You can try it yourself.  :P

This is thing which is not needed in proving :P It should work, and it work :P


Not in Dave's machine.

I used ML6.15 just as fovour to ask, and all is copied.
See my previous post for probably reason.

frktons

Probably there is something in this PROC thas is not MASM-old compatible:

; -------------------------------------------------------------------------
; The text is extracted from the Screen Buffer and prepared to be copied
; into the Windows Clipboard with code tags enclosing it and with
; LF+CR at the end of each text line.
; -------------------------------------------------------------------------

CopyScreenText PROC


    lea  esi, TopCode
    lea  edi, TextResults

    movq mm7, qword ptr [esi]
    movq qword ptr [edi], mm7

    add  edi, Eight   
    lea  esi, SavedScreen

    mov  eax, AlgoRow
    imul eax, MaxCols

    mov  ecx, eax
   
    xor  eax, eax
    xor  ebx, ebx



NextCharText:

    mov eax, [esi]
   
    mov BYTE PTR [edi], al

    add esi, Four
    add edi, One
    inc ebx

    cmp ebx, MaxCols
    jl  GoOn

    mov BYTE PTR [edi], CR
    mov BYTE PTR [edi + 1], LF
    add edi, Two
    xor ebx, ebx

GoOn:

    dec ecx
    jnz NextCharText

SetNULL:

    lea  esi, BottomCode

    movq mm7, qword ptr [esi]
    movq qword ptr [edi], mm7

    add  edi, Eight   

    mov WORD PTR [edi], 00A0h;   CR + NULL


End_cycle:

    ret
   
CopyScreenText ENDP


Mind is like a parachute. You know what to do in order to use it :-)

dedndave

that conclusion is not valid
i am not assembling it - i only execute it   :U

Antariy

Quote from: frktons on November 21, 2010, 10:31:36 PM

mov WORD PTR [edi], 00A0h;   CR + NULL


This code is not past LF to end of the string, Frank. 000Ah is LF+NULL.

Antariy

Quote from: dedndave on November 21, 2010, 10:34:00 PM
that conclusion is not valid
i am not assembling it - i only execute it   :U

Dave, do you have anything debugger, 32 bit Windows debugger at your current machine?

dedndave

dad's machine - i have nothing set up here   :'(