Merge pull request #2496 from xexyl/buzzard1-92
This commit is contained in:
2 files changed
+124
-48
No files matched your search
+62
-24
@@ -33,7 +33,7 @@ Notice how many statements it takes to do anything useful?
|
|||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
What you shouldn't think about `buzzard.1`:
|
### What you shouldn't think about `buzzard.1`:
|
||||||
|
|
||||||
`buzzard.1` doesn't just do a mass of `#define`s as its obfuscation.
|
`buzzard.1` doesn't just do a mass of `#define`s as its obfuscation.
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ What you shouldn't think about `buzzard.1`:
|
|||||||
I didn't just submit the post-C-preprocessed output as an entry.
|
I didn't just submit the post-C-preprocessed output as an entry.
|
||||||
|
|
||||||
|
|
||||||
#### Cute trick warning
|
### Cute trick warning
|
||||||
|
|
||||||
`buzzard.1` contains only a numeric `printf(3)`, yet sometimes it prints out
|
`buzzard.1` contains only a numeric `printf(3)`, yet sometimes it prints out
|
||||||
short strings.
|
short strings.
|
||||||
@@ -126,36 +126,74 @@ place to site some references on the AE, but I don't have any.
|
|||||||
[Don't read this unless you're stumped!]
|
[Don't read this unless you're stumped!]
|
||||||
|
|
||||||
```
|
```
|
||||||
MACRO FUNCTION MNEMONIC
|
MACRO FUNCTION MNEMONIC
|
||||||
|
|
||||||
V begin variable declarations Variable
|
V begin variable
|
||||||
C begin program Code
|
declarations Variable
|
||||||
|
|
||||||
Q(b,a) let b = a eQuals
|
C begin program Code
|
||||||
A(c,a,b) let c = a + b Add
|
|
||||||
S(c,a,b) let c = a - b Subtract
|
|
||||||
D(c,a,b) let c = a / b, where b is a *constant* Divide
|
|
||||||
U(c,a,b) let c = a / b, where b is anything Unknown
|
|
||||||
M(c,a,b) let c = a * b Multiply
|
|
||||||
|
|
||||||
O(c,a,b) let c = a boolean-or b (a,b are 0 or 1) Or
|
Q(b,a) let b = a eQuals
|
||||||
B(b, a) let b = boolean value of a Boolean
|
A(c,a,b) let c = a + b Add
|
||||||
P(b, a) let b = 1 if a>0, else 0. Positive
|
S(c,a,b) let c = a - b Subtract
|
||||||
|
|
||||||
l emit next sequential label Label
|
D(c,a,b) let c = a / b,
|
||||||
J(x) goto label #x Jump
|
where b is a Divide
|
||||||
|
constant
|
||||||
|
|
||||||
Z(a,d) if a is 0 goto d (a is 0 or 1) Zero
|
U(c,a,b) let c = a / b,
|
||||||
E(a,d) if a is 1 goto d (a is 0 or 1) Else
|
where b is Unknown
|
||||||
|
anything
|
||||||
|
|
||||||
H halt Haly
|
M(c,a,b) let c = a * b Multiply
|
||||||
|
|
||||||
K(x) let x = number of cmd line arguments Kount
|
O(c,a,b) let c = a Or
|
||||||
G(x,y) let x = the value if the yth argument Get argument
|
boolean-or
|
||||||
|
b (a,b are
|
||||||
|
0 or 1)
|
||||||
|
|
||||||
T end of code; begin output section Terminate
|
B(b, a) let Boolean
|
||||||
X(y) print out hexadecimal value of y heXadecimal
|
b = boolean
|
||||||
T end of output section and program Terminate
|
value of a
|
||||||
|
|
||||||
|
P(b, a) let b = 1 if
|
||||||
|
a>0, else 0. Positive
|
||||||
|
|
||||||
|
l emit next
|
||||||
|
sequential Label
|
||||||
|
label
|
||||||
|
|
||||||
|
J(x) goto label #x Jump
|
||||||
|
|
||||||
|
Z(a,d) if a is 0
|
||||||
|
goto d (a is Zero
|
||||||
|
0 or 1)
|
||||||
|
|
||||||
|
E(a,d) if a is 1
|
||||||
|
goto d Else
|
||||||
|
(a is 0 or 1)
|
||||||
|
|
||||||
|
H halt Halt
|
||||||
|
|
||||||
|
K(x) let x = number
|
||||||
|
of cmdline Kount
|
||||||
|
arguments
|
||||||
|
|
||||||
|
G(x,y) let x = the
|
||||||
|
value
|
||||||
|
of the yth Get arg
|
||||||
|
argument
|
||||||
|
|
||||||
|
T end of code;
|
||||||
|
begin output Terminate
|
||||||
|
section
|
||||||
|
|
||||||
|
X(y) print hex
|
||||||
|
value of y heX
|
||||||
|
|
||||||
|
T end of output Terminate
|
||||||
|
section
|
||||||
|
and program
|
||||||
```
|
```
|
||||||
|
|
||||||
You can figure out the other macros yourself. In the sample program, I've
|
You can figure out the other macros yourself. In the sample program, I've
|
||||||
|
|||||||
+62
-24
@@ -413,11 +413,11 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
cat babble.cppcb</code></pre>
|
cat babble.cppcb</code></pre>
|
||||||
<p>Notice how many statements it takes to do anything useful?</p>
|
<p>Notice how many statements it takes to do anything useful?</p>
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||||
<p>What you shouldn’t think about <code>buzzard.1</code>:</p>
|
<h3 id="what-you-shouldnt-think-about-buzzard.1">What you shouldn’t think about <code>buzzard.1</code>:</h3>
|
||||||
<p><code>buzzard.1</code> doesn’t just do a mass of <code>#define</code>s as its obfuscation.</p>
|
<p><code>buzzard.1</code> doesn’t just do a mass of <code>#define</code>s as its obfuscation.</p>
|
||||||
<h3 id="what-you-should-be-glad-about">What you should be glad about:</h3>
|
<h3 id="what-you-should-be-glad-about">What you should be glad about:</h3>
|
||||||
<p>I didn’t just submit the post-C-preprocessed output as an entry.</p>
|
<p>I didn’t just submit the post-C-preprocessed output as an entry.</p>
|
||||||
<h4 id="cute-trick-warning">Cute trick warning</h4>
|
<h3 id="cute-trick-warning">Cute trick warning</h3>
|
||||||
<p><code>buzzard.1</code> contains only a numeric <code>printf(3)</code>, yet sometimes it prints out
|
<p><code>buzzard.1</code> contains only a numeric <code>printf(3)</code>, yet sometimes it prints out
|
||||||
short strings.</p>
|
short strings.</p>
|
||||||
<h3 id="what-it-does">What it does</h3>
|
<h3 id="what-it-does">What it does</h3>
|
||||||
@@ -466,36 +466,74 @@ simulate any existing machine–although not quickly). This would be a good
|
|||||||
place to site some references on the AE, but I don’t have any.</p>
|
place to site some references on the AE, but I don’t have any.</p>
|
||||||
<h3 id="definition-of-the-input-language-to-buzzard.1-or-what-exactly-do-all-the-macros-do">Definition of the input language to buzzard.1 (OR What Exactly Do All The Macros Do?)</h3>
|
<h3 id="definition-of-the-input-language-to-buzzard.1-or-what-exactly-do-all-the-macros-do">Definition of the input language to buzzard.1 (OR What Exactly Do All The Macros Do?)</h3>
|
||||||
<p>[Don’t read this unless you’re stumped!]</p>
|
<p>[Don’t read this unless you’re stumped!]</p>
|
||||||
<pre><code> MACRO FUNCTION MNEMONIC
|
<pre><code> MACRO FUNCTION MNEMONIC
|
||||||
|
|
||||||
V begin variable declarations Variable
|
V begin variable
|
||||||
C begin program Code
|
declarations Variable
|
||||||
|
|
||||||
Q(b,a) let b = a eQuals
|
C begin program Code
|
||||||
A(c,a,b) let c = a + b Add
|
|
||||||
S(c,a,b) let c = a - b Subtract
|
|
||||||
D(c,a,b) let c = a / b, where b is a *constant* Divide
|
|
||||||
U(c,a,b) let c = a / b, where b is anything Unknown
|
|
||||||
M(c,a,b) let c = a * b Multiply
|
|
||||||
|
|
||||||
O(c,a,b) let c = a boolean-or b (a,b are 0 or 1) Or
|
Q(b,a) let b = a eQuals
|
||||||
B(b, a) let b = boolean value of a Boolean
|
A(c,a,b) let c = a + b Add
|
||||||
P(b, a) let b = 1 if a>0, else 0. Positive
|
S(c,a,b) let c = a - b Subtract
|
||||||
|
|
||||||
l emit next sequential label Label
|
D(c,a,b) let c = a / b,
|
||||||
J(x) goto label #x Jump
|
where b is a Divide
|
||||||
|
constant
|
||||||
|
|
||||||
Z(a,d) if a is 0 goto d (a is 0 or 1) Zero
|
U(c,a,b) let c = a / b,
|
||||||
E(a,d) if a is 1 goto d (a is 0 or 1) Else
|
where b is Unknown
|
||||||
|
anything
|
||||||
|
|
||||||
H halt Haly
|
M(c,a,b) let c = a * b Multiply
|
||||||
|
|
||||||
K(x) let x = number of cmd line arguments Kount
|
O(c,a,b) let c = a Or
|
||||||
G(x,y) let x = the value if the yth argument Get argument
|
boolean-or
|
||||||
|
b (a,b are
|
||||||
|
0 or 1)
|
||||||
|
|
||||||
T end of code; begin output section Terminate
|
B(b, a) let Boolean
|
||||||
X(y) print out hexadecimal value of y heXadecimal
|
b = boolean
|
||||||
T end of output section and program Terminate</code></pre>
|
value of a
|
||||||
|
|
||||||
|
P(b, a) let b = 1 if
|
||||||
|
a>0, else 0. Positive
|
||||||
|
|
||||||
|
l emit next
|
||||||
|
sequential Label
|
||||||
|
label
|
||||||
|
|
||||||
|
J(x) goto label #x Jump
|
||||||
|
|
||||||
|
Z(a,d) if a is 0
|
||||||
|
goto d (a is Zero
|
||||||
|
0 or 1)
|
||||||
|
|
||||||
|
E(a,d) if a is 1
|
||||||
|
goto d Else
|
||||||
|
(a is 0 or 1)
|
||||||
|
|
||||||
|
H halt Halt
|
||||||
|
|
||||||
|
K(x) let x = number
|
||||||
|
of cmdline Kount
|
||||||
|
arguments
|
||||||
|
|
||||||
|
G(x,y) let x = the
|
||||||
|
value
|
||||||
|
of the yth Get arg
|
||||||
|
argument
|
||||||
|
|
||||||
|
T end of code;
|
||||||
|
begin output Terminate
|
||||||
|
section
|
||||||
|
|
||||||
|
X(y) print hex
|
||||||
|
value of y heX
|
||||||
|
|
||||||
|
T end of output Terminate
|
||||||
|
section
|
||||||
|
and program</code></pre>
|
||||||
<p>You can figure out the other macros yourself. In the sample program, I’ve
|
<p>You can figure out the other macros yourself. In the sample program, I’ve
|
||||||
actually implemented subroutines by saving a return address in a variable and
|
actually implemented subroutines by saving a return address in a variable and
|
||||||
then jumping to a routine– specifically, a routine that converts a number into
|
then jumping to a routine– specifically, a routine that converts a number into
|
||||||
|
|||||||
Reference in new issue
Block a user