flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved]:playing with 16bit winincludes

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
DimonSoft



Joined: 03 Mar 2010
Posts: 654
Location: Belarus
DimonSoft
Parameter preparation for CreateWindow looks like the author(s) tried being 8086-compatible too hard.
Post 24 Mar 2020, 19:14
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7616
Location: Kraków, Poland
Tomasz Grysztar
DimonSoft wrote:
Parameter preparation for CreateWindow looks like the author(s) tried being 8086-compatible too hard.
AFAIK Windows 3.0 could run on 8086.
Post 24 Mar 2020, 19:29
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 654
Location: Belarus
DimonSoft
But 8086 did support push mem instruction.
Post 24 Mar 2020, 21:04
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7616
Location: Kraków, Poland
Tomasz Grysztar
DimonSoft wrote:
But 8086 did support push mem instruction.
I see PUSH mem used in the SHOWWINDOW and UPDATEWINDOW calls, so my guess would be that it is not used in preparation of CREATEWINDOW for some other reason, perhaps simply a symmetry of code and easier tweaking.
Post 24 Mar 2020, 21:11
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 458
Location: Russian Federation, Sochi
ProMiNick
https://yadi.sk/d/f3kzyjRlFrocHQ updated according to header sets with 8.3 filenames.
Fore folders same restriction?

I found sources with edit creation (hope pascal calling convention mean they are win16)
https://yadi.sk/i/crPorEoRQqtddw (everything exept code in russian)

And I download Microsoft Windows 3.1 DDK, Microsoft Windows 3.1 SDK, Microsoft Windows 95 DDK, Windows Chicago - Build 331 SDK, Borland C++ 4.0 (CD), Borland C++ 4.52, Borland Turbo CPP 4.5 for Windows, Turbo C++ For Win3.1 (5.25)
Hope in one of this toolset I will be able to compile edit sources or found something analogy usefull.
And than reversing output will be simple task.

I am not from generation which had books about assembly (I hope only for internet, accessibility of ancient tools & my code reversing skills).
Post 25 Mar 2020, 00:18
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7616
Location: Kraków, Poland
Tomasz Grysztar
ProMiNick wrote:
https://yadi.sk/d/f3kzyjRlFrocHQ updated according to header sets with 8.3 filenames.
Fore folders same restriction?
Yes, because 8.3 is the limitation of FAT file system structures, and a directory entry is just like a file entry (but with "directory" attribute set).

ProMiNick wrote:
I am not from generation which had books about assembly (I hope only for internet, accessibility of ancient tools & my code reversing skills).
The internet is amazing for this - I can attest, since when I was writing the first versions of fasm I generally had no access to internet and I had to rely on things like RBIL (with its OPCODES.LST) brought home on a bunch of floppies (often failing). I might have not even known that there were new versions of the documents available, and if there was something missing or wrong there I had no one to talk to. And even professional books often did not explain many of the details, or had actual errors, so sometimes experimentation was the only way (even though it was a bad way - just because something works on one machine does not mean that it is a correct method).

So yes, the internet has changed it all for the better. I only brought this old book here, because for legacy stuff the books from that era may sometimes have interesting little insights or clues that might be missing from the later content. But even then the internet might probably give much more - you could for example search Usenet archives. While writing my file formats tutorial I was digging through old Usenet messages to find some information on the history of formats like PE/ELF/Mach-O, and it was truly a fascinating journey.
Post 25 Mar 2020, 09:36
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 458
Location: Russian Federation, Sochi
ProMiNick
https://yadi.sk/d/HTs1wxZvp6BmYw name of package shortened to 8 symbols, (mostly) all content except contents of DOC & PROJECTS are forced to 8.3 format.
PROJECTS are same as DEMOS but in unfinished state. I moved minipad there.
Moreover I found working donor (5kb) with asm source code with EDIT control.

[EDITED]: https://yadi.sk/d/HTs1wxZvp6BmYw package updated - absolutely all names are in 8.3 format.
new part to 32/64:
Code:
HRESULT equ -$80000000+$80000000 xor ;SignExt that looks very nice for eye
S_OK                            = HRESULT(0)
S_FALSE                         = HRESULT(1)
E_NOTIMPL                       = HRESULT($80004001)    
Post 25 Mar 2020, 23:18
View user's profile Send private message Send e-mail Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 654
Location: Belarus
DimonSoft
ProMiNick wrote:
Code:
HRESULT equ -$80000000+$80000000 xor ;SignExt that looks very nice for eye
S_OK                            = HRESULT(0)
S_FALSE                         = HRESULT(1)
E_NOTIMPL                       = HRESULT($80004001)    

Why would one need to sign-extend an HRESULT? It’s not a number but a well defined set of bit fields, some of which are numbers.
Post 28 Mar 2020, 16:04
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 458
Location: Russian Federation, Sochi
ProMiNick
https://yadi.sk/d/HTs1wxZvp6BmYw updated
all examples above require run as admin on systems with UAC - fixed:
NE..ProgramFlags db NE_I086; was NE_INST - it is assumed to make modifications in registry and so on

invoke LoadIcon,0,IDI_APPLICATION & invoke LoadCursor,0,IDC_ARROW got garbage from stack & trash it - fixed
invoke LoadIcon,0,dword IDI_APPLICATION ; added dword that makes param occupy 2 words
invoke LoadCursor,0,dword IDC_ARROW

however no one of that fixes dosn`t fix minipad crash on EDIT CreateWindow.
(donor shrinked from $1200+ bytes to $800+ bytes, Borland HLL logic cuted & zerofilled)
all still in process...
Post 28 Mar 2020, 16:05
View user's profile Send private message Send e-mail Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 458
Location: Russian Federation, Sochi
ProMiNick
DimonSoft wrote:

Why would one need to sign-extend an HRESULT? It’s not a number but a well defined set of bit fields, some of which are numbers.


No matter in what mode 32 or 64 bit HRESULT is always 32bit set.

Its extension no matter zero extension or sign extension because extension is ignored.

BUT!
Only sign extended values could be encoded in large amount of instructions.

So sign extension it is only encode trick (specificaly required by fasm in 64bit mode).
Only one instruction type allow zero extended: mov REG,uint64, all the rest like passing value to stack directly require sign extension.
Code:
use64
HRESULT equ -$80000000+$80000000 xor
E_FAIL                          = HRESULT($80004005)
push E_FAIL ; OK, the reason force fasm to compile things that we need
; we need to pass 32 bit value of HRESULT to stack with indeterminant high part and we did this
push $80004005 ; error
    

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 28 Mar 2020, 17:26
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.