Re: Making C compiler generate obfuscated code

Walter Banks <walter@bytecraft.com>
Tue, 21 Dec 2010 13:40:01 -0500

          From comp.compilers

Related articles
[8 earlier articles]
Re: Making C compiler generate obfuscated code gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-12-18)
Re: Making C compiler generate obfuscated code rpw3@rpw3.org (2010-12-18)
Re: Making C compiler generate obfuscated code DrDiettrich1@aol.com (Hans-Peter Diettrich) (2010-12-16)
Re: Making C compiler generate obfuscated code torbenm@diku.dk (2010-12-20)
Re: Making C compiler generate obfuscated code gneuner2@comcast.net (George Neuner) (2010-12-21)
Re: Making C compiler generate obfuscated code gneuner2@comcast.net (George Neuner) (2010-12-21)
Re: Making C compiler generate obfuscated code walter@bytecraft.com (Walter Banks) (2010-12-21)
Re: Making C compiler generate obfuscated code gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-12-21)
Re: Making C compiler generate obfuscated code martin@gkc.org.uk (Martin Ward) (2010-12-22)
Re: Making C compiler generate obfuscated code DrDiettrich1@aol.com (Hans-Peter Diettrich) (2010-12-22)
Re: Making C compiler generate obfuscated code gneuner2@comcast.net (George Neuner) (2010-12-23)
Re: Making C compiler generate obfuscated code torbenm@diku.dk (2011-01-04)
Re: Making C compiler generate obfuscated code gneuner2@comcast.net (George Neuner) (2011-01-06)
| List of all articles for this month |

From: Walter Banks <walter@bytecraft.com>
Newsgroups: comp.compilers
Date: Tue, 21 Dec 2010 13:40:01 -0500
Organization: Byte Craft Limited
References: 10-12-017 10-12-023 10-12-025 10-12-027 10-12-028 10-12-034
Keywords: C, code, history, comment
Posted-Date: 21 Dec 2010 22:34:11 EST

George Neuner wrote:


> There were a few other issues with the ROM code for the custom disk
> controller and video (in particular the hi-res graphics IIRC). Here
> the problem was not having Wozniak's hardware ... work-alike code for
> OTS video display and disk controllers couldn't be fit into the same
> address space.


Woz's disk controller was very clever. It used a simple state machine
to encode the data on and off the disk. At one point I wired up a
3 1/2 drive for my own use that read and write apple ][ disks (and
higher density that could not be read on an apple). At the time I
was impressed how well thought out Woz's design was. In my "one of"
I did something similar and used a 2708 eprom to store the jump
tables for a state machine.


> YMMV but I don't consider implementing a virtual machine to be a
> "trick". Wozniak created Sweet16 to make programming easier ... it
> ultimately saved some ROM space, but it was never intended to deceive
> anyone ... the Sweet16 interpreter and the fact that it was used was
> documented in the Apple ][ Integer BASIC manual. I don't recall if
> Sweet16 ever was mentioned in the FP BASIC manual, but FP BASIC was an
> extension of Integer BASIC and so, ISTM, anyone interested should have
> inferred that Sweet16 had been used in FP BASIC's implementation as
> well.


Woz wrote a Byte article documenting the Sweet16 code and use.
I don't think the FP basic used the Sweet 16 library. Sweet 16 was
used in the integer basic.


He also wrote a floating point package for the apple. At the time not all
6502's had an unconditional branch which meant that Woz used conditional
branches even when one was not needed. This single "feature" obfuscated
the sources almost to the point of almost being unreadable.


http://www.6502.org/source/floats/wozfp3.txt


All the best of the season,


Walter Banks
--
Byte Craft Limited
http://www.bytecraft.com
[Fascinating though this is, it doesn't have much to do with compilers
any more. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.