Recent

Author Topic: My simple Win32 Compiler  (Read 5964 times)

FlierMate

  • Guest
Re: My very simple Win32 Compiler (prototype)
« Reply #15 on: January 13, 2021, 02:56:23 pm »
......Even if that lot is beyond you for the moment, just remember that it is a mistake to try to apply high-level text processing commands to the input.

MarkMLl

Noted with thanks, it is beyond my level at the moment, but I appreciate you for pointing out the mistake in the program.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6682
Re: My very simple Win32 Compiler (prototype)
« Reply #16 on: January 13, 2021, 03:11:23 pm »
That was intended to be more of a general warning that anything else, but /is/ derived from having done this sort of thing multiple times without the questionable benefit of a computer science background.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: My very simple Win32 Compiler (prototype)
« Reply #17 on: January 13, 2021, 03:51:42 pm »
[...] I have disowned and removed the source code from everywhere.

Badly done, IMHO. You should own it even as a "failure" and keep it around somewhere, even if just as an example of how things should NOT be done.

Even (or specially) bad code can be a very useful didactic resource: most students will look at it and maybe laugh a little at its clumsiness in public ... but privately they will think "Wow! I was about to do exactly that! Thank the gods I saw it in time!", and it'll at least have served a purpose as an aid in learning.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

hansotten

  • Jr. Member
  • **
  • Posts: 88
Re: My Win32 Reassembler (prototype)
« Reply #18 on: January 13, 2021, 04:02:19 pm »


IF (note the big IF) you can find it at a reasonable price, the book : Per Brinch Hansen on Pascal Compilers might very well be the best introductory text on compilers ever written but it's out of print and used copies are usually sold for exorbitant prices (don't pay more than $50.00 and a reasonable shipping fee)

I is here: http://pascal.hansotten.com/per-brinch-hansen/

FlierMate

  • Guest
Re: My very simple Win32 Compiler (prototype)
« Reply #19 on: January 13, 2021, 04:29:00 pm »
Badly done, IMHO. You should own it even as a "failure" and keep it around somewhere, even if just as an example of how things should NOT be done.

Even (or specially) bad code can be a very useful didactic resource: most students will look at it and maybe laugh a little at its clumsiness in public ... but privately they will think "Wow! I was about to do exactly that! Thank the gods I saw it in time!", and it'll at least have served a purpose as an aid in learning.

Never thought of that, thanks. I learn the right attitude from you- own it as a failure. Nevertheless, I think I will be able to rewrite the code with minor improvement if I want to.
For example, I will use Cardinal for DWORD, and Array [1..2] of Cardinal for 4-byte address and 4-byte size. However, I am not sure how the Cardinal will be stored in binary - MSB and LSB in reversed order?

I is here: http://pascal.hansotten.com/per-brinch-hansen/

OMG  :o , you're an expert. I am speechless, the book(s) are free!


MarkMLl

  • Hero Member
  • *****
  • Posts: 6682
Re: My very simple Win32 Compiler (prototype)
« Reply #20 on: January 13, 2021, 04:42:05 pm »
For example, I will use Cardinal for DWORD, and Array [1..2] of Cardinal for 4-byte address and 4-byte size. However, I am not sure how the Cardinal will be stored in binary - MSB and LSB in reversed order?

Stick to native numeric representation until you really need something different, i.e. only do the conversion at input/output time.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

FlierMate

  • Guest
Re: My very simple Win32 Compiler (prototype)
« Reply #21 on: January 13, 2021, 05:11:18 pm »
Stick to native numeric representation until you really need something different, i.e. only do the conversion at input/output time.

MarkMLl

 ;D I am grateful for your guidance( tips & tricks) thus far.

440bx

  • Hero Member
  • *****
  • Posts: 4014
Re: My Win32 Reassembler (prototype)
« Reply #22 on: January 13, 2021, 06:57:04 pm »
I is here: http://pascal.hansotten.com/per-brinch-hansen/
You've really done a a great job with your website.

I am extremely pleased to see the book Brinch Hansen on Pascal Compilers available for download.  IMO, it's the best starting point.  Anyone interested in compilers should read that book at least twice. :)

;D I am grateful for your guidance( tips & tricks) thus far.
Read the Brinch Hansen on Pascal Compilers book, you'll be glad you did (for multiple reasons.)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6682
Re: My Win32 Reassembler (prototype)
« Reply #23 on: January 13, 2021, 07:49:47 pm »
I is here: http://pascal.hansotten.com/per-brinch-hansen/

That's a particularly good collection. I've just checked and I note that the web page is archived at archive.org, but the PDFs might not be... I don't know whether that's fixable. Alternatively I hope you've got it archived/mirrored somewhere as your professional legacy.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: My very simple Win32 Compiler (prototype)
« Reply #24 on: January 14, 2021, 04:24:17 pm »
IF (note the big IF) you can find it at a reasonable price, the book : Per Brinch Hansen on Pascal Compilers might very well be the best introductory text on compilers ever written but it's out of print and used copies are usually sold for exorbitant prices (don't pay more than $50.00 and a reasonable shipping fee)
I is here: http://pascal.hansotten.com/per-brinch-hansen/

I is here: http://pascal.hansotten.com/per-brinch-hansen/
OMG  :o , you're an expert. I am speechless, the book(s) are free!

I is here: http://pascal.hansotten.com/per-brinch-hansen/
You've really done a a great job with your website.
I am extremely pleased to see the book Brinch Hansen on Pascal Compilers available for download.  IMO, it's the best starting point.  Anyone interested in compilers should read that book at least twice. :)
Now prices will fall...
« Last Edit: January 14, 2021, 04:26:04 pm by valdir.marcos »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: My Win32 Reassembler (prototype)
« Reply #25 on: January 14, 2021, 04:25:29 pm »
I is here: http://pascal.hansotten.com/per-brinch-hansen/
You've really done a a great job with your website.
+1

Quote
I am extremely pleased to see the book Brinch Hansen on Pascal Compilers available for download.  IMO, it's the best starting point.  Anyone interested in compilers should read that book at least twice. :)
+1

FlierMate

  • Guest
Re: My simple Win32 Compiler
« Reply #26 on: January 27, 2021, 09:33:28 pm »
CLARIFICATION:


I wish to point out that this Satay Compiler might generates EXE which will be falsely detected by antivirus software as Trojan.

If you are concerned, my original post about this issue is on FASM official message board: https://board.flatassembler.net/topic.php?t=21786 (External Link)

Please refer to attached screenshots showing Text1.txt.EXE was first reported as malware by Windows Defender. After I submitted report, Microsoft Security Intelligence removed the detection (for that particular EXE only).

The EXE generated by Satay Compiler makes calls to the following Win32 API functions only:
1. GetStdHandle
2. ReadConsoleA
3. WriteConsoleA
4. ExitProcess

It does nothing malicious. It is unclear to me as to why some AV software reporting these canned EXEs as trojan.


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11446
  • FPC developer.
Re: My simple Win32 Compiler
« Reply #27 on: January 27, 2021, 09:44:25 pm »
The EXE generated by Satay Compiler makes calls to the following Win32 API functions only:
1. GetStdHandle
2. ReadConsoleA
3. WriteConsoleA
4. ExitProcess

It does nothing malicious. It is unclear to me as to why some AV software reporting these canned EXEs as trojan.

It is very simple. Antivirus authors are lazy and reverse the burden of proof, basically denying everything unless proven otherwise.

So assume they simply block everything, and then only start adding exceptions for well known "EXE" signatures. If you think that through, you actually get pretty close to actual antivirus behaviour. It can't be coincidence :-)

So inventing a new kind of EXE signature only invites trouble.

FlierMate

  • Guest
Re: My simple Win32 Compiler
« Reply #28 on: January 27, 2021, 10:03:38 pm »
The EXE generated by Satay Compiler makes calls to the following Win32 API functions only:
1. GetStdHandle
2. ReadConsoleA
3. WriteConsoleA
4. ExitProcess

It does nothing malicious. It is unclear to me as to why some AV software reporting these canned EXEs as trojan.

It is very simple. Antivirus authors are lazy and reverse the burden of proof, basically denying everything unless proven otherwise.

So assume they simply block everything, and then only start adding exceptions for well known "EXE" signatures. If you think that through, you actually get pretty close to actual antivirus behaviour. It can't be coincidence :-)

So inventing a new kind of EXE signature only invites trouble.

You are most probably right, because you are developer of Free Pascal Compiler.

 :D   Thank you for the insights.

FlierMate

  • Guest
Re: My simple Win32 Compiler
« Reply #29 on: March 05, 2021, 01:14:15 pm »
Nonetheless, I have hosted this closed-source simple compiler publicly on :

https://sataycompiler.tech/

(Only the IDE itself has Pascal source code)

 

TinyPortal © 2005-2018