Fascinating! Does anyone have links to more information about this? What purpose might one have for this fingerprinting?
Fascinating! Does anyone have links to more information about this? What purpose might one have for this fingerprinting?
I was extremely frustrated because my textbook's later chapters used MASM as the assembler, which at the time cost some ghastly amount of money (somewhere around $180 if I recall correctly, which was a truly staggering number of birthday and Christmas presents).
Anyway, my point is, in 2022 everyone takes for granted that an assembler for any system that matters can be downloaded for free from the Internet -- or if it doesn't, one will soon be written by some enthusiast and posted on Gitlab.
But back in the 1980's and well into the 1990's, assemblers were expensive products that companies actually got away with charging a lot of money for. Presumably they made a significant amount of revenue from those sales.
So the use case that immediately springs to my mind is being able to prove a particular commercial binary was assembled by your assembler, in order to make a successful accusation of software piracy and extract a monetary settlement from its developer.
Time was worth relatively little in comparison and I figured I will at least know the instruction set inside-out.
Did you bootstrap it with hand-assembled code or some Basic? Did you assemble the assembler with itself?
(Had to Google to remember this bit of trivia again -- funnily enough turned up this [2] HN comment I replied to 9 years ago with nearly the exact same comment I made above.)
[1] https://support.apple.com/kb/TA39083?locale=en_US&viewlocale...
But Woz's trick is far more impressive.
https://www.amazon.nl/Assembly-Language-Programming-Lance-Le...
Memory management was a tricky part and macro expansion only got done after the whole thing worked (that would have saved a lot of time but I couldn't see the wood for the trees at that point).
The nasty part was that instructions were variable length so you could get into these weird errors where your initial guess for a jump target was too small, which would then move everything else as well, which might lead to other jumps becoming too small. I don't have the code any more but I think I fixed that by making all the jumps long jumps initially. A bit wasteful but that way I could at least get it to work in one pass. Later on when I got better at assembly that sort of thing got fixed.
The end product was endless 'data' statements that were poked into memory at 48K and up, right over the basic interpreter, which we had figured out a way to page out and replace from software. This later led to an annotated version of the basic that came with that computer (a version of MS Basic) and subsequently a replacement interpreter with a lot of built in goodies (double speed tape interface, a whole raft of new statements and functions). Good times!
Shout out to my friend Henri G. who did at least half of that work, we had identical home computers (Dragon 32) and worked together a lot on this. He probably still has his in working order :)
Ye that one is annoying.
I am making a VM compiler right now, and I have the same problem. I would probably have to make some intermediate tree to solve it without making every jump a "far jump".
Moving instructions is a headache :)
I had the same problems, only I was programming a Laser 128 (an Apple II clone) that had a built in System Monitor, which let you directly change memory addresses, but no assembler.
So I photocopied the Assembly to Machine Language chart in a book I got from the library, and did it manually - I learned quite a lot. I remember writing a layout and edge detection routine for a Tetris clone I tried to write (never finished it). Basic was too slow for those critical parts, so I called out to the routine, but did most of the code in Basic.
I remember been utterly wowed that Linux came with a free compiler - I could only dream of having software like that back then.
Before that it was a case of writing code on graph paper, looking up the opcodes in the manual, and assembling by hand. Needless to say that writing programs was slow and difficult.
I think I jumped straight from paper -> A86, without using debug.com. Not sure why.
As incentive, he'd send you enhanced versions of the software (with 386 opcode support iirc... or was it 32-bit support?), and a ringbound hardcopy of the manuals.
I remember companies forking out $500-$800 ($3,300 in today's money) for Pascal compilers.
And not just for one title, but $3,300 for each version — per user, per year.
But at least you got a box, and nice thick manuals and tutorials.
My partner was impressed with it, and sent it along to me to evaluate.
My tests showed close compatibility. A bit too good. It didn't take me too long to figure out it was the Microsoft MASM program with the copyright notice patched out.
Dodged a bullet with that one.
The reason assemblers were expensive in those days is they were written in assembler, which is far more expensive than writing in C.
https://www.mail-archive.com/freedos-user@lists.sourceforge....
① The number of customers was smaller than it is today, so to remain profitable the NRE cost had to be paid by a smaller number of sales.
② Legal proprietary PC software distribution was competing with user group meetings, Hamvention, and 1200-baud underground BBSes where people used names like "Warlord of Chaos", not pop-up PC repair shops, anonymous FTP sites, Eggdrop, Napster, BitTorrent, Debian, and GitHub. Faster and cheaper ways of sharing software both made it cheaper for enthusiasts to collaborate on writing free software and made illegal copies cheaper and more accessible. It's easier to stomach paying US$180 (say, US$500 today) for MASM when your alternative is to spend your weekend and US$60 making long-distance calls to BBSes that might or might not have a copy.
https://github.com/dlang/dmd/blob/master/compiler/src/dmd/ba...
The cool thing to do with it is add it to your favorite text editor as a command - highlight some of your text and disassemble it! Great party game - what is your name disassembled? Valid code, or are you a seg fault?
rex.WXB jb 0x6050b4 ; jb offset here is 0x61, 'a'
outsb %gs:(%esi),(%dx)I was just reading a book called “Almost Perfect”, a first-hand history of WordPerfect by one of the founders. He mentions that they bought an IBM PC when it came out and wanted to port their word processor (over from the Data General minis that had been their initial platform). But they had to wait five months for an assembler to become available.
Imagine buying a $5,000 computer and you can’t even get an assembler for it for any money.
(WordPerfect was written entirely in x86 assembly, even when it was a billion-dollar product.)
In fact, if memory serves, RDOS had FORTRAN, ALGOL, and BASIC available, even if most of the system software was written in assembler.
Writing an assembler in BASIC on either the Nova or the IBM PC would have been considerably less hassle than writing it in assembly and hand-assembling it.
Similar fingerprinting techniques were also used by assembly coders as proof of copyright. When reverse-engineering to a spec, it's not unusual for routines, even long routines, as well as lookup tables, etc. to end up being coded the same, or nearly so, as the original software. This isn't necessarily infringing of copyright -- for example there are only a few sensible ways to check if a character is uppercase in ASCII. It can be hard to tell reverse-engineered and re-implemented code, from disassembled and reshuffled code (which is copyright infringement). If the suspect routine incorporates something like an idiosyncratic sequence of NOPs that serve no particular purpose, coincidence is a lot harder to argue.
[1]: https://github.com/woodruffw/steg86
[2]: https://blog.yossarian.net/2020/08/16/Hiding-messages-in-x86...
To prove some program was made with A86, there would have to be a more specific signature that wouldn't match any other assembler, like a copyright message encoded bit-by-bit in the opcode choice.
02 C0 ADD AL,AL
02 C1 ADD AL,CL
00 D0 ADD AL,DL
00 D8 ADD AL,BL
02 C4 ADD AL,AH
02 C5 ADD AL,CH
00 F0 ADD AL,DH
00 F8 ADD AL,BH
Don't know if this would hold up in court for proving that some code was assembled with A86...edit: other ALU ops are the same; for MOV the "direction bit" is inverted.
$ zasm -Mx86 -='add al al;add al dl;add dl al'
000000 - 02 C0 00 D0 02 D0 |...... |
$ hex C3 | ndisasm -au -
00000000 C3 ret
0: C2, C3, CA, or CB, so modrm (ax/cx) (dx/bx) A86 assembler package V4.05 January 14, 2000
The entire package is Copyright 2000 Eric Isaacson. All
rights reserved.It was sold under a shareware model, and if you used it commercially you were supposed to buy the licence. I guess they randomly sampled other people's software to see if it looked like it was built with a86 or not, but honestly I'd never actually heard of them doing that and suspected that it was just enough of a threat to know it was possible that they hoped people would pay up.