Below is the message processing routine extracted a tutorial downloaded from
the Iczelion Windoze assembly site:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
LOCAL pt:POINT
LOCAL rect:RECT
.if uMsg==WM_CREATE
invoke CreatePopupMenu
mov hPopupMenu,eax
invoke AppendMenu,hPopupMenu,MF_STRING,IDM_RESTORE,addr RestoreString
invoke AppendMenu,hPopupMenu,MF_STRING,IDM_EXIT,addr ExitString
.elseif uMsg==WM_DESTROY
invoke DestroyMenu,hPopupMenu
invoke PostQuitMessage,NULL
.elseif uMsg==WM_SIZE
.if wParam==SIZE_MINIMIZED
mov note.cbSize,sizeof NOTIFYICONDATA
push hWnd
pop note.hwnd
mov note.uID,IDI_TRAY
mov note.uFlags,NIF_ICON+NIF_MESSAGE+NIF_TIP
mov note.uCallbackMessage,WM_SHELLNOTIFY
invoke LoadIcon,NULL,IDI_WINLOGO
mov note.hIcon,eax
invoke lstrcpy,addr note.szTip,addr AppName
invoke ShowWindow,hWnd,SW_HIDE
invoke Shell_NotifyIcon,NIM_ADD,addr note
.endif
.elseif uMsg==WM_COMMAND
.if lParam==0
invoke Shell_NotifyIcon,NIM_DELETE,addr note
mov eax,wParam
.if ax==IDM_RESTORE
invoke ShowWindow,hWnd,SW_RESTORE
.else
invoke DestroyWindow,hWnd
.endif
.endif
.elseif uMsg==WM_SHELLNOTIFY
.if wParam==IDI_TRAY
.if lParam==WM_RBUTTONDOWN
invoke GetCursorPos,addr pt
invoke SetForegroundWindow,hWnd
invoke TrackPopupMenu,hPopupMenu,TPM_RIGHTALIGN or
TPM_RIGHTBUTTON,pt.x,pt.y,NULL,hWnd,NULL
invoke PostMessage,hWnd,WM_NULL,0,0
.elseif lParam==WM_LBUTTONDBLCLK
invoke SendMessage,hWnd,WM_COMMAND,IDM_RESTORE,0
.endif
.endif
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
WndProc endp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
That code snippet makes no sense. All those .if/.else/.endif constructs are
meaningless gibberish to anyone who writes using native Intel syntax. In
order to see what the code really does, I generated a list file, using MASM
with the "/Sa" option. This produced pages of errors and warnings and a 3 MB
(!!!) list file. The section above, reformatted as assembly source, appears
below:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WndProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL pt:POINT
LOCAL rect:RECT
push ebp
mov ebp,esp
add esp,0FFFFFFE8h
;.if uMsg==WM_CREATE
cmp uMsg,WM_CREATE
jne @C0005
;invoke CreatePopupMenu
call CreatePopupMenu
mov hPopupMenu,eax
;invoke AppendMenu,hPopupMenu,MF_STRING,IDM_RESTORE,addr RestoreString
push OFFSET RestoreString
push 0000003E8h
push 000000000h
push hPopupMenu ;It's already in EAX??!!
call AppendMenuA
;invoke AppendMenu,hPopupMenu,MF_STRING,IDM_EXIT,addr ExitString
push OFFSET ExitString
push 0000003F2h
push 000000000h
push hPopupMenu
call AppendMenuA
;.elseif uMsg==WM_DESTROY
jmp @C0007
@C0005: cmp uMsg,WM_DESTROY
jne @C0008
;invoke DestroyMenu,hPopupMenu
push hPopupMenu
call DestroyMenu
;invoke PostQuitMessage,NULL
push 000000000h
call PostQuitMessage
;.elseif uMsg==WM_SIZE
jmp @C000A
@C0008: cmp uMsg,WM_SIZE
jne @C000B
;.if wParam==SIZE_MINIMIZED
cmp wParam,SIZE_MINIMIZED
jne @C000D
mov note.cbSize,sizeof NOTIFYICONDATA
push hWnd
pop note.hwnd
mov note.uID,IDI_TRAY
mov note.uFlags,NIF_ICON+NIF_MESSAGE+NIF_TIP
mov note.uCallbackMessage,WM_SHELLNOTIFY
;invoke LoadIcon,NULL,IDI_WINLOGO
push 000007F05h
push 000000000h
call LoadIconA
mov note.hIcon,eax
;invoke lstrcpy,addr note.szTip,addr AppName
push OFFSET AppName
push OFFSET note+000000018h
call lstrcpyA
;invoke ShowWindow,hWnd,SW_HIDE
push 000000000h
push dword ptr[ebp+8]
call ShowWindow
;invoke Shell_NotifyIcon,NIM_ADD,addr note
push OFFSET note
push 000000000h
call Shell_NotifyIconA
;.endif
;.elseif uMsg==WM_COMMAND
jmp @C000F
@C000B: cmp uMsg,WM_COMMAND
jne @C0010
;.if lParam==0
cmp lParam,000h
jne @C0012
;invoke Shell_NotifyIcon,NIM_DELETE,addr note
push OFFSET note
push 000000002h
call Shell_NotifyIconA
mov eax,wParam
;.if ax==IDM_RESTORE
cmp ax,IDM_RESTORE
jne @C0014
;invoke ShowWindow,hWnd,SW_RESTORE
push 000000009h
push dword ptr[ebp+8]
call ShowWindow
;.else
jmp @C0016 ;Only a compiler would do this
;invoke DestroyWindow,hWnd
@C0014: push dword ptr[ebp+8]
call DestroyWindow
;.endif
;.endif
;.elseif uMsg==WM_SHELLNOTIFY
@C0016: jmp @C0017
@C0010: cmp uMsg,WM_SHELLNOTIFY
jne @C0018
;.if wParam==IDI_TRAY
cmp wParam,IDI_TRAY
jne @C001A
;.if lParam==WM_RBUTTONDOWN
cmp lParam,WM_RBUTTONDOWN
jne @C001C
;invoke GetCursorPos,addr pt
lea eax,POINT ptr[ebp+0FFFFFFF8h]
push eax
call GetCursorPos
;invoke SetForegroundWindow,hWnd
push dword ptr[ebp+8]
call SetForegroundWindow
;invoke TrackPopupMenu,hPopupMenu,TPM_RIGHTALIGN or
TPM_RIGHTBUTTON,pt.x,pt.y,NULL,hWnd,NULL
push 000000000h
push dword ptr[ebp+8]
push 000000000h
push dword ptr[ebp+0FFFFFFFCh]
push dword ptr[ebp+0FFFFFFF8h]
push 00000000Ah
push hPopupMenu
call TrackPopupMenu
;invoke PostMessage,hWnd,WM_NULL,0,0
push 000000000h
push 000000000h
push 000000000h
push dword ptr[ebp+8]
call PostMessageA
;.elseif lParam==WM_LBUTTONDBLCLK
jmp @C001E ;This is a good one
@C001C: cmp lParam,WM_LBUTTONDBLCLK
jne @C001F ;This is good too
;invoke SendMessage,hWnd,WM_COMMAND,IDM_RESTORE,0
push 000000000h
push 0000003E8h
push 000000111h
push dword ptr[ebp+8]
call SendMessageA
;.endif
;.endif
@C001F:
@C001E:
;.else
jmp @C0021
;invoke DefWindowProc,hWnd,uMsg,wParam,lParam
@C0018: push dword ptr[ebp+14h]
push dword ptr[ebp+10h]
push dword ptr[ebp+0Ch]
push dword ptr[ebp+8]
call DefWindowProcA
ret
leave ;Dead code - never runs
ret 10h ;Dead code - never runs
;.endif
@C0021:
@C0017:
@C000F:
@C000A:
@C0007:
@C000D:
@C0012:
@C001A:
xor eax,eax
ret
leave ;Dead code - never runs
ret 10h ;Dead code - never runs
WndProc endp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ignoring the jumps to jumps, comical C-compiler-like expansion and disdain
for the use of registers, this routine contains a fatal programming flaw
introduced by the MASM syntax. Notice that the combination of PROC and LOCAL
at the head of the routine generates a standard C-style stack frame. Also
notice that this is done without the programmer's knowledge or consent. And,
finally, notice that the local variable space allocated on the stack every
time this routine runs is never deallocated! The two (redundant) instances
of LEAVE at the bottom are NEVER RUN. If allowed to run long enough, this
program will eventually produce a stack overflow and crash.
The most ironic thing about this is that the same routine written in C would
be optimized by the compiler and end up being smaller and not crashing. A
compiler would surely use registers and deallocate its own local variables.
This is such a classic example of why we should all program in assembly that
shows exactly why we should not.
As a point of comparison, an equivalent message routine from one my programs
is shown below. It does not do exactly what the program above does, but it
is similar. Notice that this was created from the ground up, utilizing the
power of assembly to do things efficiently. It was not adapted from C or
written from a high-level perspective.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WinProc:
MOV EAX,[ESP+8] ;Get message
PUSH EDI
XOR ECX,ECX
MOV CL,offset MSGCNT ;Count of messages processed here
MOV EDI,offset MessageList ;Point to message list
REPNZ SCASW ;Message in list?
POP EDI
JNZ DefWindowProcA ;No, pass msg to default msg handler
POP EAX ;Restore callback return address
XCHG EBX,[ESP] ;Get window handle, save EBX
XCHG ESI,[ESP+4] ;Get message, save ESI
XCHG EDI,[ESP+8] ;Get wParam, save EDI
XCHG EAX,[ESP+12] ;Get lParam, save return address
PUSH EBP
MOV EBP,offset OBAS ;Point into variable space
MOV EDX,offset MsgJumpTable ;Point to message jump address table
MOVZX ECX,word ptr[EDX+ECX*2] ;Get msg routine jump offset
ADD ECX,EDX ;Form jump address
CALL ECX ;Process message
POP EBP
POP EBX
POP ESI
POP EDI
XOR EAX,EAX ;Return code
RET
MessageList:
DW WM_TRAYMOUSE ;4
DW WM_NXFILE ;3
DW WM_COMMAND ;2
DW WM_DESTROY ;1
DW WM_CLOSE ;0
MSGCNT EQU ($-MessageList)/2
MsgJumpTable:
DW MsgClose - MsgJumpTable ;0
DW MsgClose - MsgJumpTable ;1
DW MsgCommand - MsgJumpTable ;2
DW MsgNextFile - MsgJumpTable ;3
DW MsgTrayMouse - MsgJumpTable ;4
MsgClose:
PUSH 0 ;Exit code
CALL PostQuitMessage
RET
MsgCommand:
TEST EAX,EAX ;lParam = 0?
JNZ short PNXRET ;No
SUB EDI,4 ;Pause/Play or status item?
JS short PNXRET ;Status
JZ short PausePlay ;Pause/Play
DEC EDI ;Exit?
JNZ short MsgClose ;Yes
PlayNext:
;Do some stuff here
RET
PausePlay:
;Do some other stuff here
RET
MsgNextFile:
;Do even more stuff here
RET
MsgTrayMouse:
TEST EDI,EDI ;wParam = 0? (Icon ID)
JNZ short MTMRET ;No
CMP EAX,WM_RBUTTONDOWN ;Right-click?
JNZ short MTMRET ;No
LEA ECX,[EBP+CursorX-OBAS] ;Point to cursor position structure
PUSH ECX
CALL GetCursorPos ;Get mouse cursor position
PUSH EBX ;Window handle
CALL SetForegroundWindow ;Change focus to MPJ window
XOR ESI,ESI ;Clear for null pushes
PUSH ESI ;Null no dismissal area pointer
PUSH EBX ;Window handle
PUSH ESI ;Reserved
PUSH dword ptr[EBP+CursorY-OBAS] ;Vertical position
PUSH dword ptr[EBP+CursorX-OBAS] ;Horizontal position
PUSH TPM_Flags ;Tracking flags
PUSH dword ptr[EBP+MenuHan-OBAS] ;Menu handle
CALL TrackPopupMenu ;Send menu select info to window
PUSH ESI
PUSH ESI
PUSH WM_NULL
PUSH EBX ;Window handle
CALL PostMessageA ;Post dummy message
MTMRET: RET
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Judge for yourself. Is MASM32 an evil Microsoft plot to bring shoddy
programming to assembly? Or is it an excuse for high-level programmers to
write a few lines of ".elseif uMsg==WM_DESTROY" so they can make the claim
that they "write in assembly?"
I look forward to a relentless stream of vapid rationalization.
> [ ... snip .. ]
>
> Judge for yourself. Is MASM32 an evil Microsoft plot to bring
> shoddy programming to assembly? Or is it an excuse for high-level
> programmers to write a few lines of ".elseif uMsg==WM_DESTROY" so
> they can make the claim that they "write in assembly?"
Take your pick. Hehe!
> I look forward to a relentless stream of vapid rationalization.
_____
You'll have to wait for a few ((( `\
days. Randy Hyde is currently _ _`\ )
indisposed. Hehehe! (^ ) )
~-( )
_'((,,,)))
,-' \_/ `\
( , |
`-.-'`-.-'/|_|
\ / | |
=()=: / ,' aa
> I keep seeing MASM programming examples that don't make any sense. I
> keep seeing MASM tutorials modeled after C programs that have little
> or nothing to do with actual assembly programming. Normally, I ignore
> them, but one day I needed to extract some actual code from one of
> these horrid MASM example programs, so I had to dig below the surface.
> It's worse than I thought.
>
> Below is the message processing routine extracted a tutorial
> downloaded from the Iczelion Windoze assembly site:
> [...]
You are almost right on all points. But there is a serious
problem with you overall rantings, that is that you are mixing
a lot of things together, that should be made separated.
I mean, you should not make one single packet with inside,
Iczelion, MASM32, Win32, and the way for doing the things.
___________
* Iczelion.
This is the most important programmer of the Assembly
rebirth. Unfortunately, as many "Opening doors" guys
of that time, he used MASM32, and when way better Tools
were made available, he did not upgrade, and he is now
gone. Another point, with his contribution, is that,
when i discovered and explained how to do all these things
he has shown us, he had to start from the _C_ state of
the things. This point explains a lot of things. A third
point with Iczelion writing style, is that it is a pionner
pedagogic work. Not at all in any way a model about how
to write Assembly. At this point of view, it would be,
nowadays, a complete counter-example.
Nevertheless, you must never forget that, without these
guys (Iczelion, Test Departement and Ron Thomasz), who,
all, wrote in that awfull and inacceptable MASM32 "Style",
none of us would be, today, writing any App for Win32.
_________
* MASM32.
Not considering perfect stupidites, like HLA, that does
not deserve more comment from me, MASM32 is the worst
of the actually available Assembler. In fact, it is not
an Assembler, but a Compiler for Assembly Language. To
know what it outputs, you need a... Disassembler :))
Plus, its syntax is radicaly stupid and faultive.
Nowadays all the actual Assemblers conform, more or less,
with the basics of NASM.
________
* Win32.
- The OS is what it is. Asm under Win32 remains nevertheless
perfectely possible.
- If the way your MASM32 example does it can evidently not
be defended, in any way, your own example, at the bottom
of your Post, is not perfect either, in my own point of
view. You write like an "old-timer", used to the old
fashion Linear Asm. There is no reason for writing like
this (I have also been writing the way you write many
years ago...). [Too long discussion...].
- The size of Win32Asm Apps.
A Win32Asm App is made of "Sections", that are, by default
aligned on 0200h Bytes, in the dead File, and on 01000h
Bytes, once uploaded in Memory. This explains the size
you see (mainly zeros). This is not important, because,
the bigger your app is, the less important (%) this is.
Plus, there are _advantages_ with this, as the Files
are clearly divided into clean parts. Anyway, this has
no importance nowadays. Personaly, i am not interrested,
at all with minimum size contests. I would rather be
interrested with maximum size contests, if you see what
i mean... :))
_________________________________________________________
_________________________________________________________
Now, if you wish to bash MASM32 shit, this is a decent
pass-time ;), but, unfortunately, this is no use. It is
about the same as with HLA: If a guy is stupid enough
for choosing such pathetic shit, whereas they have so
many choices with free offers of very good packages...
good for them. Let them die. Assembly will survive. :)
Betov.
> when i discovered and explained
!!! Awfull freudian typo slip !!!
I ment "when he discovered and explained". :)
Betov.
> Nevertheless, you must never forget that, without these
> guys (Iczelion, Test Departement and Ron Thomasz), who,
> all, wrote in that awfull and inacceptable MASM32 "Style",
> none of us would be, today, writing any App for Win32.
Don't you think you overestimate the importance of these
people. I never was and I'm still not interested in
Windows programming. But when I wrote my fist simple
Win32 assembler program two years ago, I didn't use
any of this information (I refuse to read anything written
in this idiotic Intel syntax). I searched for the smallest
exe program included in Windows (which was write.exe)
and rewrote it byte by byte in assembler so I got the
identical binary exe file. Using the exe file format
specification and the API documentation on MSDN, I
tried to identify the meaning of any byte in the exe.
Then I removed any unnecessary code and got a simple
template (including all exe headers) as a starting
point for new programs.
Assembly programming doesn't mean to download a tool
like MASM or RosAsm and start to write some processor
instructions which then are embedded somewhere in
the exe file by the assembler, but to understand how
the things work at the lowest level. Does a user of
RosAsm really know how an API call works (Import Directory,
Thunk Table, etc.). Once you got this understanding,
you don't need to generate any processor instruction
yourself. There is nothing wrong to use the support
of a compiler to generate processor instructions.
It is like building a house. You can simply buy an
already build house (download an assembler), which is
nothing but a place where you can live. Or you can
build your own house, start with the design of the
house and be present when the house is built, so you
know any detail of the house. This is not only a
place where you live, this is your home. For you,
assembly programming is to write processor instructions,
for me assembly programming is to know anything that
happens at the lowest level. You say, if an owner of
a house needs a hole in the wall, he has to make it
himself and it is not necessary that he knows where
all the water and power lines are buried in the wall.
I say, it doesn't matter whether the owner of the house
hires a craftsman (compiler) to make the hole as long
as he knows where the water and power lines are buried
in the wall, so he can tell the craftsman where it is
save to make the hole.
So, if you want to learn assembly programming you don't
need one of the bloated assemblers, a simple editor
and the processor manual is sufficient. And once you have
learned assembly programming you also don't need such
an assembler, because then you can use a HLL combined
with an inline assembler or an simple extern assembler.
> Betov wrote:
>
>
>> Nevertheless, you must never forget that, without these
>> guys (Iczelion, Test Departement and Ron Thomasz), who,
>> all, wrote in that awfull and inacceptable MASM32 "Style",
>> none of us would be, today, writing any App for Win32.
>
> Don't you think you overestimate the importance of these
> people. I never was and I'm still not interested in
> Windows programming.
:) This maight explain all the following... ;)
> But when I wrote my fist simple
> Win32 assembler program two years ago, I didn't use
> any of this information (I refuse to read anything written
> in this idiotic Intel syntax). I searched for the smallest
> exe program included in Windows (which was write.exe)
> and rewrote it byte by byte in assembler so I got the
> identical binary exe file. Using the exe file format
> specification and the API documentation on MSDN, I
> tried to identify the meaning of any byte in the exe.
> Then I removed any unnecessary code and got a simple
> template (including all exe headers) as a starting
> point for new programs.
This is quite similar to what i did for the very first
pre-release of SpAsm... :)
> Assembly programming doesn't mean to download a tool
> like MASM or RosAsm and start to write some processor
> instructions which then are embedded somewhere in
> the exe file by the assembler,
"Assembly programming"... Evident. You can also use
any Hexa Editor if you like to... :) But, maybe, an
Hexa Editor is too far HLL for you, isn't it? :)
> but to understand how
> the things work at the lowest level. Does a user of
> RosAsm really know how an API call works (Import Directory,
> Thunk Table, etc.).
Without any specific study... evidently: No. As i did
my best to _free_ the programmer from these things that
are ZERO interrest, for writting an _Application_. RosAsm
is _NOT_ a Tool for learning Assembly. Even if it _IS_,
actually, evidently, the best way, far away from any other
method, for learning Assembly, it has never been designed
for this purpose. Unfortunatly for you, you cannot give
it a try,... because you already now Assembly. :)) :)) :))
> Once you got this understanding,
> you don't need to generate any processor instruction
> yourself. There is nothing wrong to use the support
> of a compiler to generate processor instructions.
???!!!... If this means something, ... my "English" is
fucking me...
> It is like building a house.
Fine. :)
> You can simply buy an
> already build house (download an assembler), which is
> nothing but a place where you can live. Or you can
> build your own house, start with the design of the
> house and be present when the house is built, so you
> know any detail of the house. This is not only a
> place where you live, this is your home. For you,
> assembly programming is to write processor instructions,
> for me assembly programming is to know anything that
> happens at the lowest level. You say, if an owner of
> a house needs a hole in the wall, he has to make it
> himself and it is not necessary that he knows where
> all the water and power lines are buried in the wall.
> I say, it doesn't matter whether the owner of the house
> hires a craftsman (compiler) to make the hole as long
> as he knows where the water and power lines are buried
> in the wall, so he can tell the craftsman where it is
> save to make the hole.
As i spent most of my life at building houses, with my
hands, this is me, who can explain something to you, here,
with this example.
When you build a house, unless you would be building
a complete primitive house, entirely made with the
materials as found under your feet, you effectively
_always_ do it with prebuilt elements. You need wood
made by a complete Industry. You need ciment made by
a complete Industry. You need Tiles, made by a complete
industry. Your need stones (whatever) made (or prepared)
by a complete industry... and so on, and so on...
So, the point is not if "pre-built" or "not-pre-built",
but at what level of "pre-built" you mean to work.
Effectively, you can do a house with pre-built "low-level"
materials (example FASM). You can build a house with
pre-built "groups of materials" (example RosAsm),...
...
and you can buy a ready to live caravane...
> So, if you want to learn assembly programming you don't
> need one of the bloated assemblers, a simple editor
> and the processor manual is sufficient.
This is possible. My job is not to teach Assembly. My
job is to provide an Assembly Environnement that could
compete with the most in use HLL. Almost done, you
admit it or not.
> And once you have
> learned assembly programming you also don't need such
> an assembler, because then you can use a HLL combined
> with an inline assembler or an simple extern assembler.
Yes. You constant opinion, that you have expressed, here
several times.
My point is that (and my work is for...) that there is no
reason to use any HLL because everything can be done in
Assembly, as easily, and often times way more easily.
Now, this is a _serious_ discussion. As you recall, you
sent me several (great) version of a (great) program
called "Erde", in C and in Asm. I told you that we will
restart this discussion the day i will be ready to show
you the complete RosAsm version of it, so that we could
compare to the C version, and so that we could see,
exactely, on what point, why and how, the C version could
have any advantage on the RosAsm one.
Unfortunately, as you may know, i am _overflown_ by
the amount of work i have to do, and the more i get old,
and deseased, the less i can work. So, thanks for
patience... :)
Betov.
> Herbert Kleebauer <kl...@unibwm.de> écrivait news:41933D7B.431C8AE1
> @unibwm.de:
>
>> Betov wrote:
>> [...]
By the way, it's also _your_ fault, if i could not
have ported your "Erde" to RosAsm syntax, sooner:
1) All of your comments and names are in german.
For a guy like me, who got 3 years of German at
school, when young, this did not help much.
2) The main problem i had for understanding was
with the Table, as long as i failed to understand
how they are used in the program, and this is not
the "explanations" that could have helped me a lot... :)
3) As most of the explanations are for the C version,
and as C does not output, _AT ALL_, what you have
written in the C Source... :(
Betov.
> By the way, it's also _your_ fault, if i could not
> have ported your "Erde" to RosAsm syntax, sooner:
>
> 1) All of your comments and names are in german.
> For a guy like me, who got 3 years of German at
> school, when young, this did not help much.
No, the documentation is English.
http://groups.google.com/groups?selm=2kvceb%24rjr%40tukki.cc.jyu.fi&output=gplain
All I had was this documentation and the binary code of
the program. I first disassembled it and rewrote it as a
DOS com program, then converted it to a C Windows program
and in a last step wrote the Windows assembler version.
Because this is all much easier using RosAsm you should
be able to do all this in a few hours.
> 2) The main problem i had for understanding was
> with the Table, as long as i failed to understand
> how they are used in the program, and this is not
> the "explanations" that could have helped me a lot... :)
It is all described in the above documentation.
> 3) As most of the explanations are for the C version,
> and as C does not output, _AT ALL_, what you have
> written in the C Source... :(
Yes, the C compiler does a very good job optimizing the
code, but I have you also sent the binary with optimization
switched off.
> Here it is in its bloated pseudo C glory, MASM1K.
[...code snipped...]
> Ain't it just sheer disgusting that an assembler as powerful as MASM
> can produce a 1k (1024 byte) working window that is a legal PE file
> with no handwritten stub or PE header.
What is more disgusting is what your precious MASM actually generates. Below
is the expanded message routine:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0000009E WndProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
0000009E 55 * push ebp
0000009F 8B EC * mov ebp, esp
000000A1 83 7D 0C 02 cmp dword ptr uMsg, WM_DESTROY
000000A5 75 07 jne @F
invoke PostQuitMessage,NULL
000000A7 6A 00 * push +000000000h
000000A9 E8 00000000 E * call PostQuitMessage
000000AE @@:
invoke
DefWindowProc,hWin,uMsg,wParam,lParam
000000AE FF 75 14 * push dword ptr ss:[ebp]+000000014h
000000B1 FF 75 10 * push dword ptr ss:[ebp]+000000010h
000000B4 FF 75 0C * push dword ptr ss:[ebp]+00000000Ch
000000B7 FF 75 08 * push dword ptr ss:[ebp]+000000008h
000000BA E8 00000000 E * call DefWindowProcA
ret
000000BF C9 * leave
000000C0 C2 0010 * ret 00010h
000000C3 WndProc endp
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This garbage is supposed to convince us that the MASM way is the correct way?
Look at the superfluous stack frame code MASM created for you (So much for
the so-called myth debunking your site--MASM DOES create code you do not
specify.)
I look at this and I see
push ebp
mov ebp,esp
generated by MASM, but nowhere in the source code. I also see RET expanded
to
leave ;Particularly funny when EBP = ESP
ret 10h
I also see a blatant violation of the API calling procedures. The WM_DESTROY
message is processed by the WndProc routine, then passed to DefWindowProc
anyway. It might be harmless in this simple example, but doing that in a
more complex program is sure to create chaos.
And, finally, I see a block of C-style parameter passing that is totally
unnecessary. The message is already on the stack. Why push it again, call
DefWindowProc and pop it off? Just jump to DefWindowProc and let it pop it
off.
This is how the message routine should be coded:
WndProc:
CMP dword ptr[ESP+8],WM_DESTROY ;Destroy window?
JNZ DefWindowProcA ;No, pass msg to default msg handler
PUSH 0
CALL PostQuitMessage ;Send WM_QUIT message
XOR EAX,EAX ;Return code
RET 16
If you're going to brag about how small the code can be with MASM, at least
write small code. Nobody is going to believe the propaganda on your site
until you do. The problem is that you will have to give up all the PROC,
PROTO and LOCAL nonsense that makes MASM such a travesty to assembly. Then
you could use most any assembler and the whole advocacy for MASM disappears.
Thanks for proving my point.
> No, the documentation is English.
>
> http://groups.google.com/groups?selm=2kvceb%24rjr%40tukki.cc.jyu.fi&out
> put=gplain
>
> All I had was this documentation and the binary code of
> the program. I first disassembled it and rewrote it as a
> DOS com program, then converted it to a C Windows program
> and in a last step wrote the Windows assembler version.
>
> Because this is all much easier using RosAsm you should
> be able to do all this in a few hours.
Good joke, Herbert. What do you expect me to do with
this "Documentation"? You expect me, to 1) Read it?
2) Understand it?? 3) Translate it in Assembly???
May be you did not understood my previous post, but,
for me, actually, the medications i have to take, in
order to survive, leave me with these 'few hours' per
day, you talk about up there, and i have _TONS_ of
"urgent" works to do... for about 2 years...
Now, if _you_ cannot wait, you can run RosAsm, load
your C Version Erde.exe, Click upon [Disassemble],
when it proposes you, and Click again on [Run].
Then you can [replace] the wanted Names and possibly
the comments, where it needs some, and make by yourself
an idea of what it can look like, in RosAsm HLL style.
That is, something evidently _way_ more readable than
your C version.
:)
Betov.
Ray, before discussing about how MASM32 is weird,
and the most deffective of all actual Assemblers
(what it _surely_ _is_, there no doubt on this
point), you'd better study, first, at least, a
little bit, how the Win32 Applications work.
First, the WinMain of an Application is Re-Intrant.
So, it needs some particular care, to not corrupt
the Stack, during any Process.
Second, for a real life Application, in Assembly,
the readability of the Source in _WAY_ more
important than the execution speed. By the way,
there is almost never any speed problem, in such
a Procedure, so that making it "Pure Asm" does not
make any difference but to push the readability
down.
And, finally, the main problem i see with your
remarks, is that, as they are not founded, you
will have answers, explaining to you... How MASM32
is great, and mind you,... the explanations will
be right, and you will be wrong,... and this will
achieve into nothing but a good promotion of MASM32.
Something that NOBODY needs, as the existence of
MASM32 is one of the main reason why the Assembly
Rebirth is so difficult to push.
Think twice.
Betov.
GAHH!!
Who do i believe? Who should i believe in?
Well, shouldn't effect me, i am on Linux so Masm doesn't work anyway :)
Percival
> I am interested in how you produce the extra RET in the disassembly...
It's not a disassembly. It is the actual output generated by MASM with "/Fl
/Sa" specified as options.
> ...as tools like CL from the VCTOOLKIT remove the stack frame
> from a simple procedure like the one above...
And you don't. Once again, the C compiler beats MASM.
> ...old style DOS junk...
Herein lies the fundamental tenet of insane MASM worship.
> If you want genuine speed for a WndProc...
Oh, now that your "small" example isn't, you shift gears to "speed". That's
a disingenuous tactic, which will be ignored. My examples are small. No
claim was ever made for speed.
> Look and weep at how to do a FAST WndProc...
You crack me up. I hold several software patents, one of which has to do
with ultra efficient branching to the proper handler based on the content of
the message which wakes up a process. It's on my Web site, if you care to
look. While you're there, take a peek at all the embedded controller boards
I have designed. Every one of those contains or uses firmware written by me
in assembly. The complex ones contain multi-tasking kernels written by me in
assembly. Many of those products have been in service for up to twenty
years, with a zero crash rate. I have written assembly code for virtually
every processor ever created. I write and use my own assemblers, linkers and
debuggers. I've been doing it for almost thirty years. Since I started
writing Windoze applications earlier this year, I have written nearly a
hundred of them. Sometimes I crank out two or three a day. Many run
perpetually--and they never crash. Yeah, I need a lesson from a MASM guy
whose Internet site is filled with programming examples written by other
people.
> ...EXAMPLE9\DISPATCH\TYPE1...
Okay, let's see you apply this technique to the messages used in my first
WndProc example:
WM_DESTROY EQU 2
WM_CLOSE EQU 10H
WM_COMMAND EQU 111H
WM_TRAYMOUSE EQU 405H
WM_NXFILE EQU 8000H
Let's see you do it in fewer bytes than my example. Lets see you make it
fast, without creating a monstrous jump table. Let's see you waste a week
doing it. And be sure to use a lot of ".IFs".
> ...SCASW...
It's small, not fast. Would you like me to post a fast version?
> ...CMP MEM, IMMEDIATE is as fast as a CMP REG, IMMEDIATE...
It's small, not fast. You're the one who started in on small. If you want
to change the context officially to fast, I would be more than willing to
post examples that will blow away any lame MASM crap you care to post.
> ...design is not properly extendable . . .nesting...
Here we go with another disingenuous argument. The example posted was
extracted from a real application, and clearly stated in the post as being
such. It handles the messages it needs to handle. It does not need to be
extended and there is no nesting required. It is properly designed for the
job it needs to do. I notice you focus exclusively on that first example
(which was not in any way associated with your code) and ignore the one
posted in response to your awful MASM1K message handler. Come on, Mr.
Disingenuous, tell us what is wrong with the alternative message handler I
posted for MASM1K.
[...insipid opinions and more MASM lessons snipped...]
> The virtue of posting the example "MASM1K"...
Whatever virtue you expect or claim for that pile of MASM, is rendered
irrelevant by the fact that it: 1) violates the Windoze API, and 2) closes
improperly, leaving something running in memory, consuming resources (on my
computer, at least). For what it's worth, changing the message compare from
WM_DESTROY to WM_CLOSE makes it close properly.
Despite your mix-and-match criticism of my programming style and use of
"ancient DOS" instructions, I have somehow managed to write real Windoze
applications in assembly. Many are available for download on my site. How
many have you written? How many has the entire MASM community written? You
can say what you want about the subjective and personal choice of style. The
fact is, I am spending my time writing applications, not devoutly promoting
my tools of choice or employing twisted logic to find fault with a
programming style which does not suit me.
If MASM is the superlative choice in the realm of assemblers, then why are
there so few Windoze applications created with it? If MASM is the best way
to create Windoze assembly code, then why do programmers who actually produce
Windoze assembly applications (not examples and tutorials) choose not to use
it? These are viable questions, which need answering if you expect your
crusade to continue sucking in the gullible.
> [Tons of incredible bullsits]
"hutch--" wrote:
> [Tons of incredible bullsits]
There are some marvelous discussion at alt.lang.asm
since ever, but, this time, we are breacking the
limits of demency, in matter of boxing art:
_________________
At my right hand:
Hutch--, --, --, the famous illegal receller of a
stolen MicroSoft Product, who writes his Apps in
Power Basic, and who pushes an unsignificant shit
called MASM32, in order to fight against the Assembly
Rebirth, and in order to fight against the GPL.
An insane fucky one, of course compromissed up to
the ears with Randall Hyde, the famous swindler.
Needless to say, Hutch--, --, --, never wrote anything
significative in Assembly and his "best performance" :)
is a pathetic Edit Control that he calls "A Sources
Editor".
________________
At my left hand:
Ray Moon Random
Who provides illegaly TASM32 at his Page,
Who wrote a couple of small things having no interrest,
Who believes that he can "hold several software patents,
one of which has to do with ultra efficient branching
to the proper handler based on the content of the message
which wakes up a process" (!!!... A gun, someone???!!!...)
and who estimates himself a great expert.
_________________________________________________________
By the way, Dictionary-ass, if you can recall one of your
famous "sentences" saying: "TASM was a Tool for producing
Viruses", as long it is not possible to have you both
shuting up your shit boxes, this would be, at least a more
funny delirium theme.
Betov.
> "hutch--" wrote:
>
> > ...old style DOS junk...
>
> Herein lies the fundamental tenet of insane MASM worship.
Yep. It's called 'neophilia.' Mikro$loth has relied heavily
upon this aberration of human nature to assure the continued
inflow of cash to its corporate coffers.
> [ ... most of message snipped ... ]
>
> These are viable questions, which need answering if you
> expect your crusade to continue sucking in the gullible.
_____
Heck...Hutch is a piker when it ((( `\
comes to "sucking in the gullible." _ _`\ )
(^ ) )
Just wait till Randy Hyde returns, ~-( )
and continues the shameless self- _'((,,,)))
promotion of his 'HLA' text ,-' \_/ `\
convertor (a higher-level 'front ( , |
end' for MA$M). `-.-'`-.-'/|_|
\ / | |
Me, I'm just biding my time till =()=: / ,' aa
WinDoze collapses under the weight
of its own bulk and inefficiency.
Talk about "sucking in the gullible," that's Mikro$loth's
stock-in-trade: trailing-edge technology with never even
one original innovation, while foisting off marginally
adequate software on a technically unsophisticated buying
public.
That giant sucking sound you hear is coming from Redmond,
Washington, U.S.A. Hehehe!
> That giant sucking sound you hear is coming from Redmond,
> Washington, U.S.A. Hehehe!
I just put up a Windoze XP fun-and-games page:
http://www.micosyen.com/bad/badxp.php
> ...Who provides illegaly TASM32 at his Page...
Don't you have anything better to do than endlessly prove what a moron you
are? Anyone can download TASM32 from the Borland site for FREE. It's part
of the FREE C command-line tools package. I feel I must tell you this, due
to the numerous past instances where you have jumped to ridiculous
conclusions or made inane assumptions, rather than doing three seconds of
research on the Internet. I would hate to see you make a fool of yourself
again over such a trivial matter.
> Who wrote a couple of small things having no interrest,
When was the last time anyone wrote anything of any interest to you? No,
never mind, don't answer. I'm not sure we could stand the sound of another
emotional "fucky" bomb detonation.
> ...software patents...
While this patent is specific to the discrimination of Q.921 and Q.931
protocols, the "two-dimensional multi-tasking input event filter" described
therein is applicable to a wide range of software applications and most
definitely "...has to do with ultra efficient branching to the proper handler
based on the content of the message which wakes up a process." You don't
have to believe it, but any disagreement is only going to add to the
inescapable notion that you are a moron, studiously endeavoring to become an
imbecile.
> and who estimates himself a great expert.
That is a matter of conjecture, of course, but compared to a blowhard,
menstrual pipsqueak such as you, who has yet to offer even the tiniest shred
of proof to support any of his vast repertoire of condescending pretence and
ownership of all knowledge, I am the Lord, Master and Creator of the Universe
and beyond. Hutch may be wrong, but at least he constructs quasi-intelligent
tangential arguments in defense of his position, placing him about 50 rungs
higher on the evolutionary scale than you.
Keep up the good work. Every newsgroup needs its village idiot.
> [Tons of incredible bullshits, as usual]
Now, you'd better go on your mentaly deffective
discussion with Hutch--, --, --, than with me.
I have other tings to do than discussing with
a mentaly deseased illegal receller of a Borland
product not even able to understand how a WinMain
Works, and who believes that he can have any
intellectual right on a routing method.
You are a shit, and walking on a shit smells bad.
Betov.
> Talk about "sucking in the gullible," that's Mikro$loth's
> stock-in-trade: trailing-edge technology with never even
> one original innovation, while foisting off marginally
> adequate software on a technically unsophisticated buying
> public.
Common, Halo for XBox was something good that MS put out...
Oh wait, that was Bungiee...
Nm :) Well, probably XBox then. Or should i give credit to IBM? :)
Percival
> [Tons of incredible bullshits, as usual]
Yes, everything about me is incredible--even my bullshit.
> Now, you'd better go on your . . . discussion with Hutch...
At least that will be a discussion between rational beings, possessed of
intellect and reason. Somebody might actually give an example or two, trying
to prove something or other. However it turns out, it will be 900 orders of
magnitude closer to a real discussion than any of your famous trolling
negative monologues, replete with steaming portions of massive ignorance.
> I have other tings to do...
Yes, you have. I'll bet the French National Gay Pseudo-Intellectual Society
of Homely Dorks is assembled and waiting for you to chair the annual meeting.
I hear the subject this year is "Women - What are they? - What's it like to
get within 20 meters of one? - Are they really better than Jerry Lewis?"
> ...WinMain...
You're still on that kick, huh? I say WinMain is not reentrant. Prove
otherwise, genius boy. Furthermore, I say WndProc is reentrant and your
lowly one-dimensional brain has confused the two. There is no need to ask
for proof on that one (the lowly part, not the confusion part). I also say
all the WndProc routines I have posted are fully reentrant. (Hold on, let me
think about this for a moment. The routines access no common resources and
write to no global variables, yet genius boy says...) Ah, who gives a rat's
banana what he says. He also says my routine handles the stack incorrectly.
Now, let me think about that one. Thirty years of experience says that any
callback routine that mangles the stack will crash long before reentrancy, or
lack thereof, becomes a factor, yet genius boys says... Yessir, genius boy
will not give up until the whole world knows he's a moron.
> intellectual right on a routing method.
Try this one on for size: You attack and insult me for no reason. I rout
you and your ten-cent excuse for a brain. Just try some witty comeback and
see what happens. I might urge you to avoid your usual profanity, but I know
you can't help it. Tiny, illiterate minds have an unwitting affinity for the
profane once they exhaust their meager share of wit and sarcasm.
> You are a shit, and walking on a shit smells bad.
The implication being you now have shit on you (eww, eww, eww). I suggest
you wash it off. There's nothing worse than the Head Dork at the dork's
meeting smelling like he shit his pants (even though he probably did - right,
now he's trying to blame me).
Thanks for crashing my browser (opera).
--
The©Wannabee®@SZMyggenPV™.Com
> I just put up a Windoze XP fun-and-games page:
> http://www.micosyen.com/bad/badxp.php
_____
Hehe! Good stuff, Ray. ((( `\
_ _`\ )
And your site did NOT cause (^ ) )
a browser crash. ~-( )
_'((,,,)))
But then, I was using Lynx ,-' \_/ `\
under SunOS 5.2. ( , |
`-.-'`-.-'/|_|
\ / | |
=()=: / ,' aa
> > I am interested in how you produce the extra RET in the disassembly...
>
> It's not a disassembly. It is the actual output generated by MASM with "/Fl
> /Sa" specified as options.
Congratulations, MASM produces a C2 opcode with its normal stack frame
exit. So much for your criticism of Iczelion's code where he wrote the
code to have multiple exits.
> > ...as tools like CL from the VCTOOLKIT remove the stack frame
> > from a simple procedure like the one above...
>
> And you don't. Once again, the C compiler beats MASM.
With MASM you have the choice of how you write a proc, if you want a
stack frame, MASM does it for you, if you don't MASM does that too.
With the MASM1K example, as a matter of fact, the C compiler cannot
deliver that form of SIZE optimisation.
> > ...old style DOS junk...
>
> Herein lies the fundamental tenet of insane MASM worship.
And herein lies the ugly facts that modern MASM style code rebuilt the
assembler market in the face of old style DOS junk code.
> > If you want genuine speed for a WndProc...
>
> Oh, now that your "small" example isn't, you shift gears to "speed". That's
> a disingenuous tactic, which will be ignored. My examples are small. No
> claim was ever made for speed.
MASM1K is 1024 bytes, the legal minimum for a legal PE file, where is
your size saving ?
> > Look and weep at how to do a FAST WndProc...
>
> You crack me up. I hold several software patents,
Congratulations.
one of which has to do
> with ultra efficient branching to the proper handler based on the content of
> the message which wakes up a process.
Big deal. If your SCAS code is an example, I simply don't beleive you.
It's on my Web site, if you care to
> look. While you're there, take a peek at all the embedded controller boards
> I have designed. Every one of those contains or uses firmware written by me
> in assembly. The complex ones contain multi-tasking kernels written by me in
> assembly. Many of those products have been in service for up to twenty
> years, with a zero crash rate.
This makes sense with the age of your code designs. I have not missed
the point by referring to it as old dos junk. I make no reference at
all to any other code form because 1, I have not seen it and 2. I am
not particularly interested in seeing it.
> Yeah, I need a lesson from a MASM guy whose Internet site is filled with
> programming examples written by other people.
It was your choice to become the self appointed critic of other
people's code design. If you don't like the criticism, pick the log
out of your own eye first. I have never had any problems at all in
promoting code written by many other people and a lot of it is very
good code.
> Let's see you do it in fewer bytes than my example. Lets see you make it
> fast, without creating a monstrous jump table. Let's see you waste a week
> doing it. And be sure to use a lot of ".IFs".
I have answered your question here with the MASM1K example, show us
how all this old DOS junk comes in at under 1024 bytes when the legal
minimum is 2 sections at 512 bytes each.
> > ...SCASW...
>
> It's small, not fast. Would you like me to post a fast version?
Feel free to join the rest of the world who actually bothered to read
the Intel manuals and find out have to scan data at higher speed. Not
everyone is a prisoner of out of date DOS junk design.
> It's small, not fast. You're the one who started in on small. If you want
> to change the context officially to fast, I would be more than willing to
> post examples that will blow away any lame MASM crap you care to post.
Feel free to show us how its all done, with at least 5 minutes
experience at coding windows software, tell all of us hicks who have
been coding windows software for upwards of 15 years how its done.
> > ...design is not properly extendable . . .nesting...
>
> Here we go with another disingenuous argument. The example posted was
> extracted from a real application, and clearly stated in the post as being
> such. It handles the messages it needs to handle. It does not need to be
> extended and there is no nesting required.
Whoopie, you are the one who posted that pile of old DOS junk to tell
us all how its done in the first place. It is lousy design code that
is difficult to read, is not properly extendable and not suitable for
normal nesting. An ".IF" block clearly outperforms it for those
reasons.
It is properly designed for the
> job it needs to do. I notice you focus exclusively on that first example
> (which was not in any way associated with your code) and ignore the one
> posted in response to your awful MASM1K message handler. Come on, Mr.
> Disingenuous, tell us what is wrong with the alternative message handler I
> posted for MASM1K.
Who cares when the existing one does the job. Its original purpose was
to compare it to a VCTOOLKIT example I wrote which built at 1536
bytes.
> Despite your mix-and-match criticism of my programming style and use of
> "ancient DOS" instructions, I have somehow managed to write real Windoze
> applications in assembly. Many are available for download on my site. How
> many have you written? How many has the entire MASM community written?
Ypu appear to be taking ignorance lessons from another highly self
acclaimed leading assembler guru who frequents this newsgroup. I in
fact get little time to write direct application code these days as
the MASM32 project takes up a lot of my time but if you have not seen
the MASM code I have written over the years, you have gone out of your
way not to look.
You
> can say what you want about the subjective and personal choice of style. The
> fact is, I am spending my time writing applications, not devoutly promoting
> my tools of choice or employing twisted logic to find fault with a
> programming style which does not suit me.
Welcome to the club, with the MASM32 project having passed 1 million
downloads some time ago, I don't care if you have a team of outworkers
in Botswanaland working 48 hours a day, you just cannot produce that
much code. With MASM being THE industry standard in 32 bit windows
assembler, no-one needs to advertise their use of MASM to write code
with.
> If MASM is the superlative choice in the realm of assemblers, then why are
> there so few Windoze applications created with it? If MASM is the best way
> to create Windoze assembly code, then why do programmers who actually produce
> Windoze assembly applications (not examples and tutorials) choose not to use
Your logic here is as bad as your code design, you assume that because
you use another method of code production that the rest of the world
does so as well. Its the head in the sand routine when a very large
proportion of Windows assembler programmers take advantage of the
sheer power of MASM to write their time critical code.
> it? These are viable questions, which need answering if you expect your
> crusade to continue sucking in the gullible.
There is only one form of answer necessary to someone such as yourself
who has the arrogance to take on a massive number of programmers in
what they use and why they use it. MASM resurrected assembler from the
dead by breaking from the traddition of writing obscure lousy hard to
read code that was neither readable, maintainable or debuggable. The
alternative sits in the dustbin of history with the rest of the
claptrap that went with it.
It is evident that you know litle about MASM which is of course your
right to do whatever you like but when we start hearing platitudes
based on your personal ignorance, you will hear criticism in reverse
for that ignorance. Funny enough people who write MASM do know about
really high speed dispatchers, coding procedures without stack frames,
coding minimum sized apps where required and they did not need you to
tell them how to do it.
You have chosen to be the critic of other people's code design, that
also means you have chosen to be criticised for having done so.
Regards,
hutch at movsd dot com
> On Sat, 13 Nov 2004 01:02:22 GMT, "Ray M. Ransom" <ray@mîcôsÿêñ.com>
> wrote:
>
> Sitting here, somewhat incredulously... it seems that much has happened
> over the years...
incredulity [Show phonetics]
noun [U]
He felt a sense of incredulity, anger and pain at the accusation made
against him.
- Thanks for sharing PH. Thats great! And keep up the good work.
Hehehe.
>
> Jeff
>
> http://www.jefftturner.com
> WndProc:
> CMP dword ptr[ESP+8],WM_DESTROY ;Destroy window?
> JNZ DefWindowProcA ;No, pass msg to default msg handler
> PUSH 0
> CALL PostQuitMessage ;Send WM_QUIT message
> XOR EAX,EAX ;Return code
> RET 16
First you make a direct jump into the guts of an API call without
having a clue about what goes on inside the system code, a
particularly dangerous coding practice that risks falling down around
your ears if Microsoft change any of the internals of how the function
works.
What you are assuming here is the architecture of old DOS junk where
byte level size optimisation was supposed to matter but any script
kiddie already knows that procedure alignment trashes most of the so
called advantages of doing so.
Now your next blunder is to call the default windows message handler
when you are following it with a PostQuitMessage() function call. Now
if you had bothered to track down what actually happens when the
PostQuitMessage() sends the WM_QUIT message you would have found out
that the WM_QUIT message is documented to do the following.
WIN32.HLP
======================
Return Values
This message does not have a return value, because it causes the
message loop to terminate before the message is sent to the
application's window procedure.
======================
A classic example of a redundant function call by a highly self
acclaimed leading assembler guru who has all of 5 minutes experience
at programming windows code.
> If you're going to brag about how small the code can be with MASM, at least
> write small code. Nobody is going to believe the propaganda on your site
> until you do. The problem is that you will have to give up all the PROC,
> PROTO and LOCAL nonsense that makes MASM such a travesty to assembly. Then
> you could use most any assembler and the whole advocacy for MASM disappears.
It seems that there is the assumption that you are the only person
around who knows how to manually lay out a procedure.
label:
; your code
retn
Lets do it in HEX to please the kiddies.
;; label:
;; your code to be added
C3 ;; retn
Is there supposed to be some profundity at addressing the stack
manually or is it supposed to be some form of hidden knowledge that a
stack address without a stack frame begins at [esp+4] ?
> Thanks for proving my point.
Not even divine intervention could help you here.
For once, _seriously_, Annie:
I well know that this is the "Stuff" you appreciate.
Nevertheless, this guy is a perfect idiot unable to
understand anything. I did my best to try to tell
him that his so stupid posts, here, will achieve
into nothing, but a marvelous opportunity, for Hutch,
to promote _MASM_. Unfortunately, it is now clear,
that this idiot is here for a while, and that there
will be no way to have him shuting up.
Given the fact that all programmers are not completely
idiot, this is a thing that we have not seen here,
since a very long time (not considering Randall Hyde
vicious Propaganda, that is using FASM, for promoting
MASM...).
MASM has been, in the past, one of the main reason,
why Assembly was almost dead, none of the fellows
involved with the Assembly Rebirth, through the new
Assemblers developements need this.
Please, save myself from your usual jokes: This is
serious and _sad_.
Betov.
> For once, _seriously_, Annie:
>
> I well know that this is the "Stuff" you appreciate.
> Nevertheless, this guy is a perfect idiot unable to
> understand anything.
Au contraire, mon cher Betov. Je pense qu'il comprend
tous les choses tres bien.
The thing that YOU must understand, Rene, is that WinDoze
is a 'fucky' operating system.
Therefore, any assembler designed to support WinDoze pro-
gramming is -- by definition -- a 'fucky' assembler.
C'est vrai pour MA$M, et aussi pour RosAsm. Comprenez-
vous cela?
> I did my best to try to tell
> him that his so stupid posts, here, will achieve
> into nothing, but a marvelous opportunity, for Hutch,
> to promote _MASM_. Unfortunately, it is now clear,
> that this idiot is here for a while, and that there
> will be no way to have him shuting up.
'Shutting him up' is not the answer, Rene. People have a
right to their own opinions.
You might disagree with their opinions, and you might find
their opinions to be inconvenient.
But you do not have the right, or the ability, to 'shut
them up.'
If you believe that your opinion, and your assembler, is
superior, then you must demonstrate WHY this is true.
You must compete in the 'marketplace of ideas.'
'Shutting him up' is a Communist concept. Remember, the
Communist idea of 'peace' is to 'shut up' (kill) all
dissenters, so that no one remains to voice a contrary
opinion.
This is not acceptable...even in France. Hehe!
> Given the fact that all programmers are not completely
> idiot, this is a thing that we have not seen here,
> since a very long time (not considering Randall Hyde
> vicious Propaganda, that is using FASM, for promoting
> MASM...).
Randy Hyde is a totally different matter. One of Randy's
main goals is (in my opinion) ego gratification.
Randy will always follow the prevailing mainstream trends,
because they are acceptable to the largest number of people
..and therefore will give him the largest potential exposure.
If the prevailing operating system was Merde-Doze, Randy
would write an assembler for Merde-Doze.
> MASM has been, in the past, one of the main reason,
> why Assembly was almost dead, none of the fellows
> involved with the Assembly Rebirth, through the new
> Assemblers developements need this.
Life does not always go the way we would like it to go,
my French friend. C'est...bien, c'est la vie.
> Please, save myself from your usual jokes: This is
> serious and _sad_.
> _____
> Betov. ((( `\
_ _`\ )
Seulement si on PENSE cela. (^ ) )
~-( )
I realize that, to you, your _'((,,,)))
assembler is a tool to promote ,-' \_/ `\
a particular political agenda. ( , |
`-.-'`-.-'/|_|
However, not everyone believes \ / | |
that political considerations are =()=: / ,' aa
valid criteria for judging assemblers.
C'est un chose difficile a' comprendre, je sais...
mais c'est vrai.
So relax! Have a little fun. Have a glass of good
French pinot noir. Et je pense aussi que tu as
besoin d'une femme. Hehehe!
Avec amour, tu chou vieux,
- Annie
> If you believe that your opinion, and your assembler, is
> superior, then you must demonstrate WHY this is true.
> You must compete in the 'marketplace of ideas.'
If i had to, this would be the demonstration that
it is not true. Good products "sells by themselves".
Betov.
> First you make a direct jump into the guts of an API call without
> having a clue about what goes on inside the system code...
Why do I have to know? If Microsoft changes the format of a message, it will
have to change in the same way for both the callback routine and the default
message handler. See below for a further explanation (I really expected you
to understand such a simple thing).
> ...call the default windows message handler
> when you are following it with a PostQuitMessage() function call...
Now we know why high-level programmers need MASM. They don't know the
difference between a jump and a call. PostQuitMessage is only called if the
JUMP IS NOT TAKEN!!! I really expected you to understand such a simple
thing.
Okay, here is the stack frame when the kernel calls WndProc:
[esp+16] - lParam
[esp+12] - wParam
[esp+8] - message
[esp+4] - hWnd
[esp] - Return address to kernel
If you decide to call DefWindowProc, you push this exact same information on
the stack. This is the stack frame when DefWindowProc gets it:
[esp+36] - lParam
[esp+32] - wParam
[esp+28] - message
[esp+24] - hWnd
[esp+20] - Return address to kernel
[esp+16] - lParam
[esp+12] - wParam
[esp+8] - message
[esp+4] - hWnd
[esp] - Return address to WndProc
DefWindowProc processes the message, clears the parameters off the stack and
returns, probably with a RET 10h. Now the stack frame looks like this when
it comes back to WndProc:
[esp+16] - lParam
[esp+12] - wParam
[esp+8] - message
[esp+4] - hWnd
[esp] - Return address to kernel
WndProc might do some more stuff, but it ultimately returns to the kernel
with a RET 10h--exactly the same as DefWindowProc. This is an inviolable
fact, dictated by the functionality of the routines, not a thing left to the
whims of Microsoft. So, I have to ask: Why not jump to DefWindowProc and
let it do exactly what WndProc would do anyway?
There's really no point in discussing this further. It has become evident
that you need the high-level hand-holding MASM offers because you don't
really understand what processors do.
> ...So much for your criticism of Iczelion's code where he wrote the
> code to have multiple exits...
He didn't write it that way. MASM did. And my criticism was of that.
> ...if you want a stack frame, MASM does it for you...
That has been my point all along. If your assembler does things for you,
you're not really writing in assembly. Your playing high-level games.
> With the MASM1K example, as a matter of fact, the C compiler cannot
> deliver that form of SIZE optimisation.
You couldn't be more wrong. The minimum size of a PE file is dictated by the
PE format and determined by the LINKER. The tool used to generate the object
file or files is totally irrelevant. But, being a MASM devotee, I suppose
you don't know that assembling (or compiling) and linking are separate
processes, performed by separate programs. ML.EXE calls LINK.EXE unless you
specify "/c" on the command line. You should know all this.
> ...if you have not seen the MASM code I have written over the years...
All it takes is a link or a post. Until then, it's just talk.
> Thanks for crashing my browser (opera).
Could you please provide further details. I test all my pages with Opera and
have never had a problem.
What? RMR has just used a variant of the simple optimisation
known as the 'tail call'. (Several compilers make this
optimisation automatically.) The only way for this to break a
programme is if M$ change the API (ie. the parameters/calling
convertions) of DefWindowProcA or WndProc. Such a change as
this would likly break everything used these APIs anyway,
whether or not it implemented the call to DefWindowProcA this
way.
C
2004-11-13
Details : Clicked on link ---> Opera crashed.
> ...PostQuitMessage() sends the WM_QUIT message you would have
> found out that the WM_QUIT message is documented to do the following.
[...Inappropriate documentation snipped...]
WM_QUIT is processed in WinMain, jackass. How, exactly, does that relate to
WndProc.
Keep talking. The more stupid things you say, the more we see why you need
an assembler that tells you how to write software.
I have a problem with this page:
http://www.micosyen.com/funny.php
The symptoms are a wet keyboard and monitor.
Phil
--
They no longer do my traditional winks tournament lunch - liver and bacon.
It's just what you need during a winks tournament lunchtime to replace lost
... liver. -- Anthony Horton, 2004/08/27 at the Cambridge 'Long Vac.'
> What? RMR has just used a variant of the simple optimisation
> known as the 'tail call'. (Several compilers make this
> optimisation automatically.) The only way for this to break a
> programme is if M$ change the API (ie. the parameters/calling
> convertions) of DefWindowProcA or WndProc. Such a change as
> this would likly break everything used these APIs anyway,
> whether or not it implemented the call to DefWindowProcA this
> way.
Absurd.
First, no matter the name, this method is known since
the earlier days of Win32Asm.
Second, as long as "JZ mem" does not exist, this locks
you to the Jumps Table solution, instead of Direct calls,
that a bit more important than those stupidities.
Third, the return value of DefWindowProcA depends on the
Message. See what i mean?
Excuse my tone, C, i am furious that there is no way to
shut up these two fucky uncompetent bastards, who never
wrote anything significative in Assembly, who redistribute
illegally commercial SoftWare and come here and play the
expert fight game. A compensation to Randall Hyde actual
silence, must be...
Betov.
If there is no argument for a product, I personally would not spend
several weeks learning it. Most people are content with what they have,
and are ignorant to change. Most change is considered bad in people's
eyes, no matter how much good the change really is. Thus, you have to
PROVE it to them, why this thing is better than the old way.
Percival
> ...as long as "JZ mem" does not exist, this locks
> you to the Jumps Table solution...
And this is somehow a different case from the one in which "CALL mem" doesn't
exist? If so, it's only because your pitiful excuse for an assembler can't
handle it. An external is an external. The instruction that references it
is irrelevant. All of my assemblers properly handle relative branches to
externals. I would expect other to do so as well. If they can't or don't,
it's not my fault. It doesn't make by code bad. It only shows the tools to
be lacking.
> ...the return value of DefWindowProcA depends on the
> Message...
Oh, right, genius boy, jumping to DefWindowProc and letting it return a value
to the kernel is vastly different from letting DefWindowProc return a value
to your message handler, leaving it in a register and returning it to the
kernel from there. You get dumber by the second.
As usual, your big mouth is flapping, but the only sound is the swimming hole
of stupidity being filled from the firehose of ignorance.
In light of another series of outrageous claims, unsupported by fact or
proof, I think the time has come to honor you for your extreme
accomplishments. Not only have you never produced any code of significance,
you've never said or written anything of significance. Your slippage means
you no longer qualify as genius boy. Henceforth, you shall be known as the
Epitome of Profound Ignorance, abbreviated, EoPI.
Come on, EoPI. Come on and get me. If I'm so wrong about everything, all
you have to do is prove it. Rather than pleading with the Easter Bunny to
"...shut up these two fucky uncompetent bastards...," why not simply prove me
wrong? I'll be forced to shut up. I'll be forced to admit that EoPI knows
all.
(takes notes)
Optimization tricks. Who said that flame-wars were useless :)
Percival
Just to make sure that everyone understands, i'll put it in simpler
terms. (I didn't understand it when C said it)
nasm code:
myfunction:
cmp eax, ebx
je myfunction2
mov eax, -1
ret
myfunction2:
add eax, ebx
ret
Now, if you remember, a call is EXACTLY equal to:
push eip ; the instruction pointer
jmp (address)
Well, not exactly, cause i don't think you could push eip directly, but
thats what call does.
So, if you have your parameters on the stack like this:
| [epb-k]
0 | eip of last "call"
4 | first parameter
8 | second parameter
So, if you jump to another function directly, it is as if you called
that function, with the same parameters passed to your own function, and
will return that value.
In C/C++: it can be thought of like this:
int myfunction(int p1, int p2){
return myfunction2(p1, p2);
|
Instead of pushing those back onto the stack, and then cleaning up, and
then returning whatever myfunction2 returned, a jump is going to do the
same thing.
Meh, I write badly. Perhaps i shouldn't try this again. Well,
optimization tricks i guess are pritty hard to conceptualize.
Percival
> I'll be forced to shut up. I'll be forced to admit that EoPI knows all.
This post made me want to compose a little song.
- "Let sing a song everybody"
Melody "Betovens 59. (The carzello overture)"
My brain is gone , my roofs undone,
my PC's leaking gas.....
I hate the nurse, the doctor too, and everyone of
you......
courus:
I'll be forced. I'll be forced. I'll be forced.
- I'll be forced to admit I was wrong.
Because he is the genious boy......
and once he proves me wrong.....
I'll be forced I'll be forced I'll be forced.
I be forced to admit that he knows it all....
Tadaditadada, dideli - dudelum
I'll be beforced by invisible powers....
I be forced by my illgal powders.....
I be hot in the light from a fire....
I ll be forced I'll be forced I'll be forced.
(Applause)
.........
A little knowledge is dangerous, it tends to come with 5 minutes of
programming experience in Windows.
> WM_QUIT is processed in WinMain, jackass. How, exactly, does that relate to
> WndProc.
A WM_QUIT message is sent when the PostQuitMessage() is sent !!!! FROM
!!!! the WndProc in the WM_DESTROY message processing and it is
processed in the MAIN MESSAGE LOOP. FORGET the WinMain.
Just to padd out your obvious inexperience in Windows programming, the
real dirty work is done when the GetMessage() function returns ZERO in
the MAIN MESSAGE LOOP which then exits the loop and proceeds to the
program termination code.
> Keep talking. The more stupid things you say, the more we see why you need
> an assembler that tells you how to write software.
This is truly underwhelming stuff from a man who apparently still
cannot use a MACRO assembler. Pssssst, I will let you in on a little
secret, in MASM you can actually write your own macros and even worse,
you can actually understand what you are doing and get it to work TOO.
This may be a far too complex notion for a man who sees the virtues of
pre 1990 mnemonic only coding and while I would like to welcome you to
the 21st century, as a matter of fact, the 1990 version of MASM 6.0
was a fully blown MACRO assembler so you are nearly 15 years off the
pace.
Its not as if I see your contribution as worthless, its hard to get
anyone to defend code as badly written as the rubbish you posted and
it is very useful for programmers of the future to be able to see the
contrast between old DOS junk and modern 21st century MASM
programming.
Instead of obscure unreliable slow code, you can write modern fast
pure MASM and get all of the performance advantages from doing so.
Clean fast easy to read code that can be maintained and extended
without any melodrama.
My thanks for your contribution Ray.
Regards,
hutch at movsd dot com
Pssssst, here is another little tip for you in your world discovery
tour of Windows coding, ALWAYS try and follow the documented function
details as the next dork in Microsoft who upgrades the code will
probably not have a clue about its previous behaviour and will try and
make it conform to the existing documentation. It will be a bit before
your time but when the UNICODE layer was implimented, all sorts of
things did not work properly any more.
Anyway, the claim is correct. If the stack, and everything else looks like
it should do when the jump is made, it doesnt matter how it is done.
The message receiving function below, works for win98/NT 2000 and XP, it
seems.
Its now quite some time since wolfgang helped me with my dispatch proc,
and I havent found any problems with it yet. Some times, I have suspected
it to be wrong, but everytime I have investigated it, it turns up the
error is elsewhere.
It shouldnt make any diffrence, if the proc is reentrent or not. What I
understand as reentrant, would be what happens if while processing one
message, you call an API that SENDS another message, while you're inside
the processing of the last. So that the call to DefWndProc :
1. "Getting" WM_SIZE message
2. App process WM_SIZE, and in the process, calls UpdateWindow.
3. "Getting" WM_PAINT message (while still inside UpdateWindow)
4. Processes WM_PAINT
5. (optional calls defWndProc)
6. Returns from UpdateWindow
7. (optional calls defWndProc)
Heres the code wolfgang helped me make. I have modified it somewhat, for
this posting.
[mRet:0]
Application.Dispatch:
pop D$Mret
cmp D$esp+4 MaxMessageTable | jae @NoHandler
mov eax D$esp + 0_4
mov ecx D$WinMessagesJumpTable + eax*4
cmp ecx 0 | je @NoHandler
call ecx
cmp eax &TRUE ; Means message was handel by app _OR_ need not
defaulthandling
;wolfgang would use or eax eax
je @MessageWasHandled
@NoHandler:
call ThisApplication.Dispatch
cmp eax &TRUE ;
je @MessageWasHandled
call 'User32.DefWindowProcA'
@MessageWasHandled:
jmp D$Mret
>
> Percival
The list of blunders here nearly knock you over. When you get a few
years of Windows programming under your belt after learning not to
make silly mistakes, you will probably get to see them.
> > First you make a direct jump into the guts of an API call without
> > having a clue about what goes on inside the system code...
>
> Why do I have to know? If Microsoft changes the format of a message, it will
> have to change in the same way for both the callback routine and the default
> message handler. See below for a further explanation (I really expected you
> to understand such a simple thing).
To save the 4 pushes of the stack parameters passed to the address set
in the WNDCLASSEX structure, you take a dangerous route of junping to
the start address of a system API without having a grasp of
differences between OS versions. Microsoft have used this technique
since at least Windows 3.0 and among other things, the Default Window
proc return address is an interface to other capacities, try a
WM_NCHITTEST message with the nonsense you have posted where you need
the return value of the default processing to respond to the message.
> Now we know why high-level programmers need MASM. They don't know the
> difference between a jump and a call. PostQuitMessage is only called if the
> JUMP IS NOT TAKEN!!! I really expected you to understand such a simple
> thing.
Perhaps you have yet to learn that modern processor design pair
CALL/RET and messing it up with jumps into existing functions makes
you code even slower, not that this appears to matter much to someone
who preaches old dos style byte level size optimisation. A perousal of
the Intel manuals for the PIV would help dilute this ignorance some.
> [esp+16] - lParam
> [esp+12] - wParam
> [esp+8] - message
> [esp+4] - hWnd
> [esp] - Return address to kernel
I am impressed that you can manually code stack parameters like any 13
year old script kiddie but you have fallen for another blunder of
trusting one OS version to perform like another and with some
experience you will learn you cannot garantee than, an assembler dump
of bits of kernel32.dll works for that version, not necessarily for
another. there is in fact good reason why you stick to the published
interface for API calls, its about the only thing that Microsoft
follow most of the time in later OS versions.
> DefWindowProc processes the message, clears the parameters off the stack and
> returns, probably with a RET 10h. Now the stack frame looks like this when
> it comes back to WndProc:
>
> [esp+16] - lParam
> [esp+12] - wParam
> [esp+8] - message
> [esp+4] - hWnd
> [esp] - Return address to kernel
>
> WndProc might do some more stuff, but it ultimately returns to the kernel
> with a RET 10h--exactly the same as DefWindowProc.
I wonder what this nonsense means to someone who balances the stack
using ESP and EBP rather than opcode C2 ?
> There's really no point in discussing this further. It has become evident
> that you need the high-level hand-holding MASM offers because you don't
> really understand what processors do.
Is this said by a man who does not understand what CALL/RET pairing is
about ?
PURE MASM
call label
......
label:
; write some code
retn
Here is another secret for you, how to write a MASM module without a
stack frame.
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
align 4
ucCatStr proc wstr1:DWORD,wstr2:DWORD
mov edx, [esp+4]
sub edx, 2
mov ecx, [esp+8]
xor eax, eax
@@:
add edx, 2
cmp WORD PTR [edx], 0 ; find the end
jne @B
@@:
mov ax, [ecx] ; append 2nd string
mov [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jnz @B
ret 8
ucCatStr endp
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
Do you get the feeling that someone has been feeding you bullsh*t
about writing assembler in MASM. And what is even uglier to purists
such as yourself is that you call the about procedure with that
wicked, illegal, immoral and fattening MASM "invoke" syntax.
invoke ucCatStr,str1,str1
And even worse than that, you can get MASM to load the effective
address of both stack parameters by using the ADDR syntax.
Must be tough when you have to try and compete against a MACRO
assembler as powerful as MASM. Is it just embarrasment that the kids
writing their own macros are leaving you behind ?
Now its not as if you are without hope, try taking a WALK ON THE WILD
SIDE, wind up your copy of MASM and crank out some REAL FAST MODERN
assembler code and you may even catch up to the kids who are already
doing it.
With apologies to Lou Reed,
And all the coloured girl went,
boop, beedoo, beedoo, beedoobydoo, boop, beedoo, beedoo, beedoobydoo
etc ....
<snip>
>This may be a far too complex notion for a man who sees the virtues of
>pre 1990 mnemonic only coding and while I would like to welcome you to
>the 21st century, as a matter of fact, the 1990 version of MASM 6.0
>was a fully blown MACRO assembler so you are nearly 15 years off the
>pace.
The 1984 version of MASM 3.0 had macros, also. Not quite as fancy,
but useful.
<snip>
--
Arargh411 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
To reply by email, remove the garbage from the reply address.
> "Betov" wrote (in the third person, because he's too much of a wimp to
> come after me directly):
>
>> ...as long as "JZ mem" does not exist, this locks
>> you to the Jumps Table solution...
>
> And this is somehow a different case from the one in which "CALL mem"
> doesn't exist? If so, it's only because your pitiful excuse for an
> assembler can't handle it. An external is an external. The
> instruction that references it is irrelevant. All of my assemblers
> properly handle relative branches to externals. I would expect other
> to do so as well. If they can't or don't, it's not my fault. It
> doesn't make by code bad. It only shows the tools to be lacking.
Does this absurdity deserve any answer?
Not only you hardly need to learn the basics of Win32Asm,
but you also need a fresh new brain. Go and buy one,
please.
> [...] Not only have you never produced any code of
> significance, you've never said or written anything of significance.
> Your slippage means you no longer qualify as genius boy. Henceforth,
> you shall be known as the Epitome of Profound Ignorance, abbreviated,
> EoPI.
As you like, Ray. As opposed to you, i do not feel any
need of having anything to prove.
> Come on, EoPI. Come on and get me. If I'm so wrong about everything,
> all you have to do is prove it.
When facing individual like you, with a low IQ, a high
level of aggressivity, and a even higher self-esteeme,
this is useless to try to prove anything.
I already tried to warn you that your stupidities would
have no other effect than offering to Hutch a marvelous
opportunity for promoting his MASM shit. This is done,
and even though you will never win any debate against
Hutch, because you really know nothing, this would not
make you shut up. So...
> Rather than pleading with the Easter
> Bunny to "...shut up these two fucky uncompetent bastards...," why not
> simply prove me wrong? I'll be forced to shut up. I'll be forced to
> admit that EoPI knows all.
I fail to see what i could prove. I have no "whose's
bigger dick game" to play with you, Ray: My Megas of
working Assembly coding are made public, and anyone can
easily see, at your own Pages, that you have nothing
to show, but pathetic durty small things, that i would
not even accept to have in the RosAsm User's Demos Page.
For example, your pathetic "Sources Editor". Mind you,
there was, in the past, a RosAsm user who wrote something,
say, one hundread times better than yours, and i did not
published it. Also, when i said that Hutch had never
written anything serious in Assembly, but a pathetic
"Sources Editor", that is nothing but an Edit Control,
i must admit that, compared to yours, Hutch work is a
pure marvel.
Betov.
PS. To the beginners who could read this absurd debate
between a TASM defender and a MASM defender, the actual
significative Assemblers are: NASM, RosAsm, FASM, GoAsm.
The older ones are completely obsolete, illegal and
incompatible with the actual Asm standards, as defined
by NASM.
I think you have hit the big time when Betov calls you such sweet
names, it means he is impressed with your technology and feels
threatened.
You have hit the cream de la cream when he starts calling you the
"fucky one", its a special exhalted status that Betov reserves for
only a few. Now what you will find is he gets a bit flaky around the
edges when you start asking him questions like why his
assembler/compiler/ide/whateverelse could not even manage a hash table
that handled unique names correctly. He may have fixed it by now but
you should have heard the waffle when Randy Hyde pointed it out.
Still, Betov is not without use, he has almost single handedly helped
to keep MASM above the 90% market download rate where it may have
slipped down to 89% without his contribution. A very large number of
people have been able to learn the sheer brutal power of MASM through
Betov's endless whinging. Anything that someone hated so badly HAD to
have truly wicked performance when you learnt how to write it
properly.
I look forward to many more pages of entertainment with the dynamics
of two highly self acclaimed leading assembler gurus betaing out the
remains of each other's half a brain instead of writing fast slick
MASM like the majority of Windows assembler programmers.
Muhahahaha.
> (takes notes)
>
> Optimization tricks. Who said that flame-wars were useless :)
Yeah, discussion of the code is interesting. We've been over this very
same function before... "Guillermito's Particles" takes one approach
(not a good one, I think), Wolfgang was taking another, as I recall. I
think I like Ray's version best of all. But there's been a lot of
argument that this is *not* a good thing to do...
I don't find the "it might break another version of the API" argument
too persuasive. If we've got the "expected thing" on the stack, I don't
see how Windows can know how it got there. (this assumes that we *do*
have the expected thing on the stack, with any "alternative" tricks we
try!). And of course, we need to know if the "ret" from any "black
boxes" cleans up parameters or not, and what any "black boxes" we return
to expect...
The fact that doing something like this might screw up call/ret pairing
is another matter. Which processors do this? How bad is the penalty? Any
way to avoid it? Will this particular "trick" cause a problem with that?
(I think not, actually, in this case) More discussion of that would be
interesting.
Discussion of the code's author's parentage, and whether they're fucky
or not,... less interesting. (IMO)
Best,
Frank
Indeed, Annie, when it comes to Microsoft, we never disagree...and as we
almost never agree on anything else, people can take this as an indication
of the _objective reality_ of the comments...it's not opinion - or,
undoubtedly, we'd be fighting tooth and claw, as with everything else
"opinion" or "philosophical" - but a simple fact...
And, yes, it _must_ be an aberration of human nature as it _does_ work when
there's no actual legitimate logical reason why it should...
Mind you, to get back to a previous disagreement (sort of), this aberration
of human nature _has_ been scientifically tracked down...an American
scientist (sorry, terrible for recalling names...the experiment is famous
so it won't be hard to track down but as I'm Shakespearean - "A rose by any
other name" - when it comes to names and classifications, it's the first
things I always forget ;) did an experiment where he got volunteers to
administer electric shocks to "victims"...the victims were actors and the
electric shocks weren't real...but it was part of the experiment that the
volunteers themselves were not to know this and truly believe they were
giving shocks to the "victim" (an actor who gave out suitable cries of pain
and such at the right times)...
The experiment was to test people's trust in authority for authority's
sake...so, just wearing white coats, holding a clipboard and looking
"official", the experimenters asked the volunteers to give the "victims"
shocks...and they did so...then they asked them "turn up the power and do
it again"...and they did so...a _MAJORITY_ proceeded to do so when they
knew that this was causing the "victim" serious pain (or, at least, the
actor's cries and the experimenter's suggestions lead them to truly believe
that this was the case)...many proceeded - with no apparent want to stop -
regardless of how high they told them to turn the shocks...they would have
happily, if this had been real, continued to shock someone to death simply
because a man in a white coat who appeared to have "authority" told them to
do so...interestingly, they would have happily committed murder on the
authority of a total stranger, just because he seemed to be "authority"...
But most important: No-one challenged _WHY_ they were inflicting
shocks...no-one challenged the actual "authority" of the
experimenters...no-one even thought to ask a pretty serious question like:
"If I cause serious harm or death to the victim, then could I be charged
with assault or murder?" because if they weren't somehow "protected" (a
likely prospect) then they would, on the say-so of a total stranger just
because he looked "kind of official", have been called in to volunteer to
cause serious harm and possibly death...
The veneer of "authority" was all that was needed...but we also know of
this - under non-scientific conditions - by the con-men who simply turn up
with a clipboard at someone's door and get people to sign away practically
anything just because they are "authority", apparently...
It is a serious aberration in human nature...we've got some built-in
instinct to obey "authority"...to plead the Nurenburg defence (which
doesn't actually in any way protect you in law at all): "I was following
orders"...why did you commit genocide? "I was following orders"...as if
this appeal to authority somehow totally absolves them from the acts they
committed...the Nurenburg trials set it in stone: There is no defence in
law on these grounds...if you're ordered to commit a war crime, then you
should and must reject that order...
"Lemming instinct"; Even if "authority" jumped off a cliff then the human
race does appear "programmed" to jump along with their "great leader" to
their deaths...conscience seemed to switch off...if "King and country"
demands it then its citizens happily abandon their morals...
Indeed, when the experiment was done then, as the conclusions were
contravertial, we saw yet another "appeal to authority"...it was called on
that no experiment should so cruelly dupe its volunteers ever again and for
this to be made "law" (made "authority" to blindly comply to regardless of
context)...but was this concern for the volunteers or a means to hide the
results and what they said about human nature from ever being revealed
again? To conceal that, in truth, "authority" has no power but what we
provide them by compliance...that the "King" is nothing but a
man...fallible, stupid and cruel as all the rest of us...
You know which "great leader" I'm thinking about at the moment so I won't
bore you or patronise you by stating it aloud...indeed, that's the whole
problem with this "aberration" in human nature...people do it, even when
they know it should not be done..."King Lemming" has jumped so it's only
"patriotic" to jump too (even when that logically means that the country to
which one is being "patriotic" to is killed en masse as they jump blindly
over the edge)...
It's the soldier ants laying down their lives for the Queen ant...moronic,
blind compliance to a lie, so long as it's the "official" lie of that
day...
Oh...and the big point here is beyond national boundaries, for sure...as
noted, this was the defence in the Nurenburg trials of the war crimes of
the Holocaust...and it'll be the defence - even though no such defence is
legitimate or accepted by any court because it is logically bankrupt -
every single time until some future "King Lemming" orders the entire world
to jump off the cliff...
My constant ranting has demonstrated one thing...no-one - though it was the
initial defence - no longer holds to "it's not going to happen"
anymore...now the defences all relate to more appeals to authority...we'll
have fusion..."authority" tells me so...the problem is far away because the
"authority" tells me so (even when the OPEC figures _CLEARLY CONTRADICT_
their conclusions, outrightly and openly...how could they be so obvious and
believe they'd get away with it? Simple, because they are "authority", they
will...who - other than "anti-authority" me - has even drawn your attention
to this contradiction? No-one...it's there, plain as day, as a lie sitting
there straight in front of your faces...but, somehow, the "authority" is
infallible...somehow, it's me who's got it wrong...even though this is
purely mathematical and completely undeniable...direct photographic
evidence of torture is broadcast directly into your eyeballs but, no, it's
not that...it's got to be something else because "authority" must be
trusted implicitly...if it happened, then it must be "deserved"
somehow...even people who would otherwise have stated that this behaviour
is NEVER "deserved" end up defending "authority" when it does it)...
Countries, culture and national identity would not collapse if the leaders
were finally challenged on this...there is no fear in defying them...the
fear is totally in NOT challenging them...every time the people have defied
"King Lemming" in revolution, the people have made a _better
world_...founded democracy, rejected corrupt communism, overthrown
dictators, won better civil rights, won Liberty, won Equality...
Check out all those adverts and spam they send you...they are composed of
this lie: "You are weak! Buy our product so you will be strong!" / "you are
miserable and ugly...buy our product to become rich and successful"...the
oldest trick of them all: Break 'em down so you can build them up in your
own image...the military train killers that way...advertisers somehow
manage to plant a hundred useless articles that you knew all along you'd
never need in your homes that way...governments maintain power and control
over people that way...
Time to shatter the lie: _YOU_ are "authority"...no more or less so than
any other human being on this planet...recognise the "aberration" and then
don't "comply" with a defunct animal instinct to jump like a Lemming after
idiots...it's an animal inheritance but those who wish to wield power over
you - governments, businesses, advertisers, armies, etc. - have realised a
"second use" for it...to paste up "Big Brother is Watching You" posters and
_knowing_ your fear will make you "comply to authority"...hey, it's only a
poster! But it's an "authority" poster...
While even one of us complies to this nonsense, our race shall never be
truly be free...
Think different...challenge everything...
Beth :)
> On Sat, 13 Nov 2004 08:45:34 -0800, The Wannabee
> <faq@.@.@szmyggenpv.com> wrote:
>
>> PÃ¥ Sat, 13 Nov 2004 02:03:32 -0500, skrev pH <hi...@cidity.level>:
>>
>>> On Sat, 13 Nov 2004 01:02:22 GMT, "Ray M. Ransom" <ray@mîcôsÿêñ.com>
>>> wrote:
>>>
>>> Sitting here, somewhat incredulously... it seems that much has happened
>>> over the years...
>>
>> incredulity [Show phonetics]
>> noun [U]
>> He felt a sense of incredulity, anger and pain at the accusation made
>> against him.
>>
>> - Thanks for sharing PH. Thats great! And keep up the good work.
>>
>> Hehehe.
>
> Frickin net tards...
Thats my point. If thats how you feel, then why stay? Why dont you _add_
something for a change ?
I admit, freely, that my contributions to this NG, are sometimes, if not
all the time, quite lame, but you know what? The people who give me critic
for it, is allways the few retards like yourself, that doesnt add ZIPPO,
to keep this NG alive. You're just such a stiff upper lip, pH. you're a
whiner. your first post to this NG, in a long time, and its a complaint
about how you feel "incredulously" = anger an pain at accusations made
againt you. You just dont get it do you ? I bet my last cent, its because
you just take youself a tad too seriously there.
Life is short, ph. And its not allways a rosy cosy place. The way I see
it, I bet your are a pieceful and honerable man. Or at least, thats how
you see yourself. Well, look again. Calling people net retards, just
because they doesnt say the things you want them to say, in a post, that
nobody forced you to read, from an author you allready know you have no
likings for. Hmm. Is that the best you could do ? You _hate_ me pH. Why
dont you come out and say it ? You're disgusted and angry and sad, and
whatever. Why dont you take "Int 10"-Annie's advice ? Its just squiggles
on the screen. Thats all, it doesnt reflect, on the _ordinary "real
life"_. We are virtual here, and its really a blessing. We can experiment
with language, and ways to say things on the net, that we are deprived
from expressing in "real life". In real life, we usually dont call people
"net retards" directly to their face. It happens, I admit, but its not
that common. Unless its a close friend.
The reason for my presens in here is tenfolds. First, I was raised by a
lunatic. Still a man, but in the eyes of many people he was real psyco.
Second, my teacher from 1-6 grade, was a female christian psyco, absorbed
with the really weird _fundamentalistic_ part of religion. A phony that
was obsorbed by christianity. The christian fundamentals absorbed her
whole life, and everything she said or did, was passing through this
filter of utter insanity. Everything she said or did, was in sync with her
oh so twisted religion, and when she said or did something it was
sanctioned by God, and that made it an absolute truth to her, and made her
say and do things that if it would be today, you would just want to have
her shoot. And you would call it a mercykill.
Now, in addition to this, when I was a kid, I was constantly beeing
herassed, mobbed, because my father was this psyco, that controlled
everything we said, everything we did. How we dressed, how we acted, how
we ate our food. He was allways there, trying to control us. He used
whatever tool he could to enforce his litle regime. Including belts, and
humiliations like bare ass whopping. He was really a gonner. Its a sad
thing, because he wasnt stupid. And in fact his father was not that much
of a nice man either. But anyway, because of theese two people, mainly, I
became a scared and silent kid. An outcast. A prime target for harassment
from other boys. I never understood it, and luckily it passed when I was
about 14-18, when I first got my sexual experience, having two women in
bed at once. Later I got "popular" from selling stolen goods, tobacco and
sigarettes at school.
But my popularity was shortlived. When I was about 18-19, one day sitting
on the bus, staring at the mirror of my own face, in the reflection from
the buswindow, something broke through to the surface. I dont know what it
was. Only way to describe it was that I became aware that this reflection
starting back at me, was real. That I was a real person. A reality. A
human beeing, a meat popsticle with the possibility of dying. Dont know
what I thought. In past tense, i think it was caused by 5 years of heavy
drinking, smoking, gasoline sniffing. It was a wakeupcall, and I got very
scared. It was like loosing all your clothing. I became naked. All my
self-esteem, the little that was left, vanished, in an instant. And I
developed a serious personality problem. At school, when we should read
from the book, in english class, my voice broke. I couldnt talk cleanly,
meeting nothing but laughter. I had no defence. My world, the one I had
known, or thought I had known, was collapsing around me, and my brain was
spending 99% of its capasity to try to regain self-control. I wasnt even
conserned with the reading, or other matters at all. I was getting the
feeling of slowly going insane, and there was nobody to help me or
understand. The gifts I got from my home, and from my early childhood was
no help to me.
I tried to talk to all my friends, I had quite a few. Nobody would
understand. Most people would just shake their head. Maybe say like Annie
: "Hehe" or like Betov : "you're diseased".
Today I would say, that what I was experiencing was simply "existential
crisis". At 18. It lasted until I was 30. Those 12 years, I consider 12
years in hell. And while it lasted, I wouldnt want that on anybody. And
there was no answers, and no help anywhere. I tried to talk to a lot of
people. Including friends and some shrinks. None of what they told me
_ever_ made a diffrence. In fact, the more they spoke to me, the more I
felt strongly, that theese people wore quite stupid, and that they couldnt
help me, in their wildest dreams.
Then I met with a few people doing meditations stuff. I took one that is
called "Dynamics". Its a very vital meditation, or really, an active
meditation. Its not really a meditation, but a preparation for meditation.
It had a servere and lasting effect on me. I was able to relive myself of
all stress and anger, from the day I was crippled, by my parent, and
during the longs years of anxiety, upto that day. I was again ready to
receive real love, to feel at ease with myself. To feel real real secure,
and balanced. No paranoia, just at ease with myself, like Neo, when he
absorbed the Agent, and the room sort of bowed...? In fact, I felt so
relaxed, that I started to sleep like a baby again. You know, that is like
sleeping deep, without dreams, and when you wake up you just stretches in
bed, and you know you have sleept like a God. And still, you are full with
energy and ready for a new day. To me, that was a long forgotten state.
And the contrast to what I was used to, was mindblowing.
During the following months, I learned a lot of things. First I learned
that most people are in this stressed state, most of the time. Because my
ruhe, was so deep, I never ever had a single thought. Not a single doubt
about anything. My mind was completly blank, like in an animal. My voice
cleared up, and got deeper, my ears got cleared, my eyes got better. I
tell you. I could see straight through the people. If I went into a disco,
I could see all the people there. If someone came over to hug another
person, I could see if it was honest gesture, or a fake one. I could see
them lying to each other. And you know. I could even see who loved their
spouses and who didnt. It was amazing. It was unreal. It was tremendous. I
was simply feeling like half a God. And my heart was wide open. It was
simply impossible for me to hate. Feeling so good about myself, so
energic, so secure, I lost allmost all needs. The funny part was, I who
used to attack women at the dancefloor, eager to put my hands on their
asses, I lost the need for women. Not for all women, but for most. Woman,
who I had earlier sworned wore sexy, they didnt mean nothing to me
anymore. I saw them on TV, the very best looking womens, and I saw
straight through them. What I was feeling, sitting around doing nothing,
allready felt like a thousands of orgasms. And an orgasm, just felt like
one. If you understand....
In the state I was, I was _temporarily_ a bit like Neo. Because I was no
more afraid, - fear never entered my mind - I could talk to anybody. I
could go talk to anybody. If some real giant man, (I am 6 feet +) myself,
came over to try to bulley me, I could completly disarm him, simply by
smiling to him, and give him a kiss. He would be totally disarmed in an
instant. My energy was light and intoxicating, and it allways seemed to
work. It was never a question if it would work. I knew it would work. I
could see what people thought and how they ticked, long before they would
approach me, and I never needed to plan how to act. It all came naturally,
and whatsoever I did, was done with a deep calm, and an inner knowledge,
that just extracted itself from my deeper beeing, without any need to
force it, or plan it or prepare it beforehand. In short, life wasnt good.
Life was Godly. Life was extremly well.
Now. I told you I lost my need for most women. I lost my hanger for sex. A
strange thing, because previosly I had allways had a great need and hanger
for sex. For instance, before I took that dynamics meditation, I was
constanly dreaming about fucking the female instructor. But within a few
days, I actually didnt want her at all anymore. My need was totally phony,
and subconsciously must have been something totally diffrent.
Anyways. There was really one woman that I truely loved. I think the
reason I loved her, was the things I had projected on her with regards to
my new experiences. I think I subconsciosly (still) must have made her the
responsible for my new life. I felt a deep , profound gratitude for her.
So heartfelt and deep, that it was impossible to express it with mere
words. But my need to express it was really growing. At the same time, my
ruhe, my inner ruhe and deep meditation was beginning to lose its power.
Because, living in an ordinary sosiety, like the western, it is simply
impossible to keep this state of mind, unless you can live with a group of
same conscience. Because there is so many stressed out people and we do
influence each other, to a strong degree. We are each others "agents". We
keep each other at bay. Nobody can stay connected, for real long, unless
they totally reject the moderns ways of living. This is why I hate modern
society and living.
Well. Becoming more and more back to my own self, allthough a much altered
personality, my needs to tell her how I felt, my inner extacy, my deep
gratitude, my many climpses still of how wonderful life can really be, and
could have been, if we could only have the clearity to see it. So I
started to send her SMS's. I dont know how many. Quite a few. Sometimes,
she answered. But In a moment of total insanity, I sent her a joke. It was
not my joke. It was a joke that came into my phone, allmost by accident.
It was a very very perverted joke. A sick joke. But, if you are an
ordinary person, sick is sometimes equated to fun, so if you wanted to
laugh at it, you could. It was funny, in a sick kind of a way. But it was
not the right person to send it to. I will regret sending that joke, for
the rest of my life. What I wanted to express to her, was not a personal
love, like in "lovers", it was gratitude. A deep heartfelt gratitude, that
she was the one that helped my wake up, and to loose the last 12 years of
insanity and anxiety. It was nothing but deeply felt, friendly love. And
what I wanted to express to her was gratitude. Not this stupid joke. She
cut all bonds. This was the woman that had took care of my bodily
wellbeeing, through massages and mediations gatherings for the last couple
of years. She had hugged me many times, and allthough we worent close,
like lovers are, and that I never even considered it, she had just told me
a week before that yes, we had some spesial connection. (I had told her, i
"felt such enourmous love, when she was present". ( A mentally radiating
love. No words can really explain it. You probably know how it feels,
otherwise your couldnt have played such a decent guitar?).
She cut off all connections. But I was very surpriced at her reactions.
She told me she wouldnt want a single message, a letter, a phone, no
nothing. Otherwise, she would call the cops. It killed me.
I knew I was dead before I put down the letter. I also knew I was going to
survive, long enough to regret it. She was the only person I ever knew,
that I couldnt find any faults in. That was not a fake, but was a genuine
person. Or at least thats what I thought. And while the letter was burning
in my ashtray, I realized a few things. First, i realized that the pain
would be swallowed by the gifts of mediation. I knew that I could get over
this in a week. And that I could forget the whole things easily. That I
could be perfectly happy, even laughing at the whole thing. I knew that
the new understandings I had gotten, was ,much to powerful to be killed
off by a letter. I rationalized in all sorts of ways. But in fact, it was
allready happening. The uttermost love, turned into the uttermost hate. I
had periods where I could tell myself, that I didnt hate her, but I did.
Frankly I have burned her at the stakes for millions of times in a million
of dreams. Pictured I poored gazoline over her body, and just lighted it.
Screaming with joy as she dies the ultimate horrible death. Because that
day, she planted a cancer in my body, and all she needed to do to get rid
of me was to explain what I did wrong, and to just tell me gently that
with her mental state and balance, she couldnt take such insane jokes. She
could have done anything else. She told me there had been hints. But there
hadnt really been any. She probably thought so, and she may have sent
them, but I think she didnt make it quite clear, telling my a week before,
that yes, we had some form of connection.
I guess I discovered for the first time in my life what it really means to
loose somebody. I never knew from before. During the following months and
years, I grew to understand why people had the need to ridicule me. Why
they had the need to put me down. Because I now felt the need to put down
someone else. And I forgave them. In fact, my whole perspective of life
turned 180 degrees. I started to repects assholes, and hate beggers.
I started to feel the need to grow an asshole within. I wanted to pay back
my pain. Not only the pain of loosing Her, but also the pain I had
accumulated through the years. The many mistakes, the family love that was
never there. The betrayal of a sick sosiety that tells us to worship
money, and a sick perverted needy God. I started feeling the need to harm
people. Of course, it was a psysical need as well as a mental need. But so
far, I have managed to keep it a mental need, and to limit abusing of
other to emails or chat. Yes. I turned into an asshole. And I like it. I
feel sorry for the people who gets in the way. But I actually want you too
feel my pain. Somehow.
In time, maybe the pain will decrease. So much as that I can begin to
belive in something again. Now I have nothing. I actually want to die.
Sometimes I crave to die. But its not all sadness either. I have found one
mission in life. One that I can truely put my heart in. And that would be
to one day find a way to express a sentance or two, which contains truth.
So far, I have never witnessed truth. Or at least, I have never been able
to speak the truth. I will customize this art, for as long as I will live.
It will become my mission. And you know what, in the process, many people
will get hurt. Because thats what happens with truth it hurts. And I will
try to cause as much hurt as I can telling the truth, Just like you when I
tell you you're a retard as well. And you know what? I dont care. I want
you to hurt. I have been told there is no god. If there was, it would be
the target of my pain. But lacking a God, until my wounds have healed, I
will throw my pain at "you". And I dont really much care who gets hurt or
not. I only make exceptions for REAL people. Phonies and fakes, get the
full broadside. Because what you dont disserve, I dont diserve. Pain in /
pain out. You are all a bunch of fucking liers anyhow. You dont really
deserve beeing treated with respect.
But. Hehe. Words are words. Squiggles on the Screen as Int10-Annie says.
Maybe this letter was all a sick joke. Maybe I didnt speak a word of
truth. Maybe I just dont giva fuck. Maybe I am the "agent". The agent of
lies. The agent of caos and confusion.
Maybe to your christian stuckup sick litle mind, I am the evil. If thats
what you think, then know this truth : You are deseased too. And you have
no choise but to fight this desease, and tr y to help healing all the
other assholes that shares this belifes. This sick and diving idea that
theres someone who is good, and someone who is bad, when its nothing but
fear fear fear.
Hehehe. Our own now long dead Ibsen I think it was that said : "Løgn og
forbannet dikt". A wise man that Ibsen. How could you ever know ?
> Jeff
> http://www.jefftturner.com
Each day from now on and until I die, I will tell myself this : Knowing
that I can die, any day, can I really afford not saying whats _really_ on
my mind ?
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
> Think different...challenge everything...
Thanks Beth. We shall try.
>
> Beth :)
> Does this absurdity deserve any answer?
I didn't ask a question, moron.
> ...Not only you hardly need to learn the basics of Win32Asm...
Uh-huh. What you fail to grasp, dear pathetic mentally-impoverished
EoPI-san, is that Win32Asm is no different from any other asm.
Distinguishing it from the crowd is its peculiar API, which is, fortunately,
well documented, and a slightly-odd recommended structure for an application.
The API is so massive, nobody ever learns it completely, but the application
structure takes no more than ten seconds to comprehend fully. Once absorbed,
it easily collapses down to a level of understanding beyond your abilities.
Just because you don't get it doesn't automatically make it wrong. Other
people do get it. Take some time off from being a raging lunatic and read
the thread.
> ...but you also need a fresh new brain. Go and buy one,
> please...
"Uh... Abby something..." (I already hear that shooting miles above EoPI's
little pinhead.)
And so we come to the ultimate profound distillation of EoPI's entire life
and philosophy, written by the master of reason himself:
> ...i do not feel any need of having anything to prove...
End of story.
[...pitiful attempted insult snipped...]
> I think you have hit the big time when Betov calls you such sweet
> names, it means he is impressed with your technology and feels
> threatened...
Yes, that is most obvious. He has, uncharacteristically, spent the time to
visit some of my pages, rather than assuming and blasting. The really funny
thing is that I don't really care anything about what says, thinks or feels.
I have zero respect for his skill at and knowledge of programming. It was
more than evident the first time I read any of his insane ramblings that he
was an immature hothead, only one tiny step above the common troll. It was
more than evident the first time he attacked me for no reason that ego is his
entire purpose. I just get a tremendous kick out of stirring him up and
watching him spew. The way he takes my non-sequitur jokes seriously is
priceless.
As I said previously, every newsgroup needs its EoPI. (This comment is mostly
meant for EoPI, who is sure to read it and, even after having done so, will
assume, blast and become more the fool.)
[...everything snipped...]
I'm finished.
Once you have destroyed you credibility though repeated incorrect analyses of
a bone-simple, six-line routine, nothing you say could possibly be relevant.
There is no point in continuing.
Please note that nobody else has jumped in to take your side (not that
anything resembling a side can be found in your senseless wandering, waffling
and context changes).
It is time to move on to part 2 of my MASM Evil Plot series.
> Percival wrote:
>
>> (takes notes)
>>
>> Optimization tricks. Who said that flame-wars were useless :)
>
> Yeah, discussion of the code is interesting. We've been over this very
> same function before... "Guillermito's Particles" takes one approach
> (not a good one, I think), Wolfgang was taking another, as I recall. I
> think I like Ray's version best of all. But there's been a lot of
> argument that this is *not* a good thing to do...
No: This discussion is of no interrest, and all of those
absurd things have already been discussed in the depth,
around 1995.
> I don't find the "it might break another version of the API" argument
> too persuasive. If we've got the "expected thing" on the stack, I don't
> see how Windows can know how it got there. (this assumes that we *do*
> have the expected thing on the stack, with any "alternative" tricks we
> try!). And of course, we need to know if the "ret" from any "black
> boxes" cleans up parameters or not, and what any "black boxes" we
return
> to expect...
>
> The fact that doing something like this might screw up call/ret pairing
> is another matter. Which processors do this? How bad is the penalty?
Any
> way to avoid it? Will this particular "trick" cause a problem with
that?
> (I think not, actually, in this case) More discussion of that would be
> interesting.
>
> Discussion of the code's author's parentage, and whether they're fucky
> or not,... less interesting. (IMO)
If it was from a another beginner, with a working
brain, it would be enough to point him to the proper
standard way for doing this, and to indicate to him
that there is absolutely nothing to optimize there,
and for what reasons. This is not the case.
If you want to help Hutch at promoting his MASM shit
at low cost, Franck,... go on... :(
Betov.
> Indeed, Annie, when it comes to Microsoft, we never disagree...
_____
The difference is, you continue ((( `\
to install and use Mikro$loth _ _`\ )
products on your computers. (^ ) )
~-( )
Mine are 100% Mikro$loth-free. _'((,,,)))
,-' \_/ `\
You 'talk the talk;' I 'walk ( , |
the walk.' `-.-'`-.-'/|_|
\ / | |
Let me know when you get that =()=: / ,' aa
solar panel installed. Hehe!
I share your views above but believe that society
is an organism that operates above the actions of
the individual unless those actions are seen by
the mob as representing the mobs views.
By the way I think the behaviour of the Lemmings
is a Walt Disney myth.
John
As you mentioned the game we played some month ago
with possible variations of WinMain and recuded stack-pollution:
My last solution looks a bit different:
http://web.utanet.at/schw1285/KESYS/index.htm [codesnips][Test04]
It now follows Betov's advice and does:
MainWindowProc:
pushad
mov eax D$esp+028 ;msg
mov ebx D$esp+02c ;wP
cmp eax &WM_CHAR |jnz L7>>
...
L5: cmp bl 01b |jz EXIT
L8: popad |jmp 'User32.DefWindowProcA' instead.
L9: popad |xor eax eax |ret 16
__
wolfgang
I missed this one amidst a pile of other waffle.
> He didn't write it that way. MASM did. And my criticism was of that.
You make assumptions about Iczelion that don't have a basis, Iczelion
quite easily wrote code in HEX, TASM, MASM, C, C++, and the normal
scripting like win32asp :) His assumptions were the same as mine at
the time that far more programmers would learn assembler if it was
understandable and history has proven both of us right.
> That has been my point all along. If your assembler does things for you,
> you're not really writing in assembly. Your playing high-level games.
MASM is a MACRO assembler, you appear to be a little off the pace
here, about 15 years or so. One of the members posted info that MASM
3.0 had a MACRO capacity so the comment is in fact even further off
the pace.
> > With the MASM1K example, as a matter of fact, the C compiler cannot
> > deliver that form of SIZE optimisation.
>
> You couldn't be more wrong. The minimum size of a PE file is dictated by the
> PE format and determined by the LINKER.
You are right so far, 2 sections at 512 bytes each if you use that
alignment adds up to 1024 bytes.
> But, being a MASM devotee, I suppose
> you don't know that assembling (or compiling) and linking are separate
> processes, performed by separate programs. ML.EXE calls LINK.EXE unless you
> specify "/c" on the command line. You should know all this.
Wow, you have learnt a MASM command line at last,
drv:\path\ml.exe /c /coff "yourfile.asm"
Then if you use resources you do something vulgar like this,
drv:\path\rc.exe /v "yourres.rc"
Turn the compiled resource into an object module with,
drv:\path\cvtres /machine:ix86 "yourres.res"
And then you just rock and roll with whichever linker you like.
The Microsoft linker works well but there is a performance advantage
using Pelle Orinius's linker PoLink.exe and you don't even need to use
CVTRES with it.
drv:\path\Link /SUBSYSTEM:WINDOWS "yourfile.obj" yourres.res
> > ...if you have not seen the MASM code I have written over the years...
>
> All it takes is a link or a post. Until then, it's just talk.
www.masm32.com
www.masmforum.com/website
Experience the sheer brutal power of the most powerful assembler for
the most popular OS and you can hit the big time like more than a
million downloads before you.
Regards,
>
> It now follows Betov's advice and does:
>
> MainWindowProc:
> pushad
> mov eax D$esp+028 ;msg
> mov ebx D$esp+02c ;wP
> cmp eax &WM_CHAR |jnz L7>>
> ...
> L5: cmp bl 01b |jz EXIT
> L8: popad |jmp 'User32.DefWindowProcA' instead.
> L9: popad |xor eax eax |ret 16
> __
> wolfgang
And no need to aks why ? Its faster, right :-) ?
------------------
Whence, thinkest thou, kings and parasites arose?
Whence that unnatural line of drones who heap
Toil and unvanquishable penury (120)
On those who build their palaces and bring
Their daily bread?--From vice, black loathsome vice;
From rapine, madness, treachery, and wrong;
From all that genders misery, and makes
Of earth this thorny wilderness; from lust,
Revenge, and murder.--And when reason's voice,
Loud as the voice of Nature, shall have waked
The nations; and mankind perceive that vice
Is discord, war and misery; that virtue
Is peace and happiness and harmony; (130)
When man's maturer nature shall disdain
The playthings of its childhood;--kingly glare
Will lose its power to dazzle, its authority
Will silently pass by; the gorgeous throne
Shall stand unnoticed in the regal hall,
Fast falling to decay; whilst falsehood's trade
Shall be as hateful and unprofitable
As that of truth is now.
------------------
Had not submissive abjectness destroyed
Nature's suggestions? Look on yonder earth:
The golden harvests spring; the unfailing sun
Sheds light and life; the fruits, the flowers, the trees,
Arise in due succession; all things speak
Peace, harmony and love. The universe,
In Nature's silent eloquence, declares
That all fulfil the works of love and joy,--
All but the outcast, Man. He fabricates
The sword which stabs his peace; he cherisheth (200)
The snakes that gnaw his heart; he raiseth up
The tyrant whose delight is in his woe,
Whose sport is in his agony. Yon sun,
Lights it the great alone? Yon silver beams,
Sleep they less sweetly on the cottage thatch
Than on the dome of kings? Is mother earth
A step-dame to her numerous sons who earn
Her unshared gifts with unremitting toil;
A mother only to those puling babes
Who, nursed in ease and luxury, make men (210)
The playthings of their babyhood and mar
In self-important childishness that peace
Which men alone appreciate?
------------------
Kings, priests and statesmen blast the human flower
Even in its tender bud; their influence darts
Like subtle poison through the bloodless veins
Of desolate society. The child,
Ere he can lisp his mother's sacred name,
Swells with the unnatural pride of crime, and lifts
His baby-sword even in a hero's mood. (110)
This infant arm becomes the bloodiest scourge
Of devastated earth; whilst specious names,
Learnt in soft childhood's unsuspecting hour,
Serve as the sophisms with which manhood dims
Bright reason's ray and sanctifies the sword
Upraised to shed a brother's innocent blood.
Let priest-led slaves cease to proclaim that man
Inherits vice and misery, when force
And falsehood hang even o'er the cradled babe,
Stifling with rudest grasp all natural good. (120)
------------------
(Google for 'shelley queen mab' for a full copy.)
C
2004-11-15
> By the way I think the behaviour of the Lemmings
> is a Walt Disney myth.
Not exactly, lemmings have an instinct to, at certain
seasons, run for in groups for large distances. (This
instinct propably development to help the lemming
population become dispersed so as not to overly
deplete the resources of the area.)
The trouble is that if that group of lemmings happen
to be running towards a cliff, the lemmings at the
back (who are just following and do not yet know they
are heading towards the cliff) push the lemmings in
front of them forward. As a result, these 'leading'
lemmings, with nowhere else to go, are forced to jump
off the cliff.
Therefore, it is not the intention of the lemmings to
actually jump off the cliff, only that by choosing a
direction without knowledge or forethought as to where
it will take them, combined with the group dynamics
described above, results in lots of base jumping
lemmings.
In whole, it seems a good analogy for politicians.
C
2004-11-15
> [ ... snip .. ]
>
> ...lemmings, with nowhere else to go, are forced to jump
> off the cliff.
>
> In whole, it seems a good analogy for politicians.
> _____
> C ((( `\
_ _`\ )
Or WinDoze users. Hehe! (^ ) )
~-( )
_'((,,,)))
,-' \_/ `\
( , |
`-.-'`-.-'/|_|
\ / | |
=()=: / ,' aa
| > It now follows Betov's advice and does:
| >
| > MainWindowProc:
| > pushad
| > mov eax D$esp+028 ;msg
| > mov ebx D$esp+02c ;wP
| > cmp eax &WM_CHAR |jnz L7>>
| > ...
| > L5: cmp bl 01b |jz EXIT
| > L8: popad |jmp 'User32.DefWindowProcA'
| > L9: popad |xor eax eax |ret 16
| And no need to aks why ? Its faster, right :-) ?
Faster by only a few cycles (5 for saving one 'ret')
('jmp[mem]' and 'call[mem]' are both 4-cycle instructions),
the small penalty for unaligned call/ret pairing can be
neglected as we save on one more stack element (L1),
but it's shorter, [D$ mret] is not needed and our demand
to avoid doubled pushes is satisfied.
In addition the code is more logical and transparent for my view :)
We could save three more cycles by replacing the
jmp 'User32.DefWindowProcA' (a FF .. jmp[mem]) with
an E9 ... jmp relative.
But I wouldn't do this, as the offset calculation had
to be done prior to MainWinProc during run-time.
It can make sense for fast graphic routines, assuming
the API is fast as well (which I heavy doubt anyway).
btw: if three or less registers are to be saved/restored,
the pushad/popad should be replaced by single push/pop's.
I think windoze wont rely on values in eax,ecx,edx anyway.
__
wolfgang
Hehe, yes :-)
C
2004-11-15
> I'm finished.
It was finished before you started, posting a pile of old DOS junk on
the basis that old dos style byte level size optimisation actually
mattered and that there was some form of virility test being performed
by manually coding mnemonics left the posting in the trashcan. At
least its in the same place as the technology that went with it.
Just wondering annie, whats your opinion on Linux. I promise I won't bite :)
Percival
> Just wondering annie, whats your opinion on Linux. I promise
> I won't bite :)
_____
Linux is okay for what it is: ((( `\
a 'techie'-oriented text-mode _ _`\ )
multitasking operating system; (^ ) )
essentially, a Unix clone. ~-( )
_'((,,,)))
In its unvarnished form, it's ,-' \_/ `\
probably too cryptic (rela- ( , |
tively speaking) to gain wide- `-.-'`-.-'/|_|
spread acceptance among non- \ / | |
'techie' users. =()=: / ,' aa
From a programming standpoint, Linux has much the
same limitations as WinDoze. It locks you into a
restrictive prison of API calls and 'virtualization.'
Given the inherent nature of multitasking O.S.es as
they're currently constituted, this is inevitable.
It's sorta like 'The Maxtrix.' You have the ILLUSION
that you're living and functioning, but it's all
'virtual.' You're actually unconscious in a little
capsule...controlled by external forces.
Personally, I prefer the freedom of a single-tasking
O.S. that allows direct communication with the hard-
ware, and doesn't get in your way if you want to
programmatically access the 'reality' of bare metal.
Multitasking has never been a big draw for me. I seldom
use more than one app at a time. With a small, efficient
single-tasking O.S., getting out of one app and into
another simply isn't a problem. On those rare occasions
when I need two or more apps open simultaneously, a task
switcher is, for me, quite sufficient.
What do I think of Linux? It has its occasional uses. I'll
boot it up every once in awhile for specialized tasks, just
as I'll occasionally boot QNX and REAL/32. But I doubt that
Linux will ever be my primary operating system.
Just like the allegedly-altruistic 'Nanny State' that Beth
reveres, Linux has too much inefficient, freedom-restricting
overhead to justify the few dubious 'benefits' that it pro-
vides. Hehehe!
___
"I'm a 'nut'...scratch every single non-technical thing I've ever said
on this newsgroup and don't expect any more from me ever again..."
- Beth Stone, in ALT.LANG.ASM newsgroup - November 9, 2004
> Just wondering annie, whats your opinion on Linux. I promise
> I won't bite :)
desires, Linux has too much inefficient, freedom-restricting
The Sting lyrics "that's my soul up there" (from "King of Pain") came to
mind reading this..."a flag pole rag and the wind won't stop, that's my
soul up there"...
Wouldn't it be beautiful if, looking towards the past from Shelley to
Shakespeare ("Now is the Winter of our discontent" is another passage that
rings truth about the dispositions of some of our gangster "Kings"
today...some empty revenge on a bully or beauty long since gone), we could
honestly say that the past was a stranger to us?
That when we read these words or those of the twisted King, we could look
on it and think "You are a stranger; I do not know you"...
That when we turned on the TV news, we're actually shocked by what we see
and hear...not thinking "oh no, not again"...
That when studying of dictators and imperial madmen of the past, no modern
equivalents - chillingly similar - would spring to mind...
Wouldn't it be beautiful if, as much as the poem and prose is elegant,
there had never been any need of writing this whatsoever in the first
place? That this kind of past was forever a stranger...
"Shed some skin for the fear within
Is starting to hurt me with everything
Freed from the memory
Escape from our history, history
And I just Hope that you can forgive us
But everything must go
And if you need an explanation
Then everything must go
I look to the future it makes me cry
But it seems too real to tell you why
Freed from the century
With nothing but memory...memory...
And I just Hope that you can forgive us
But everything must go
And if you need an explanation
Then everything must go
Freed us eventually
Just need to be happy...happy...
And I just Hope that you can forgive us
But everything must go
And if you need an explanation
Then everything must go
And I just hope that you can forgive us
But everything must go
And if you need an explanation, nation:
Then everything must go"
[ "Everything Must Go", Manic Street Preachers ]
Beth :)