Skip to main content
added 18 characters in body
Source Link
Matteo Italia
  • 3.8k
  • 2
  • 17
  • 22

PDP-11 assembler for Unix System 6 - 73 68 74 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 108 bytes.

# cat mini.as s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> # as mini.as # ls -l a.out mini.as -rwxrwxrwx 1 root 108 Oct 10 12:3536 a.out -rw-rw-rw- 1 root 74 Oct 10 12:36 mini.as # od -h a.out 0000000 0107 0022 0000 0000 0018 0000 0000 0000 0000020 15c0 0001 8904 0012 0010 15c0 0004 8923 0000040 01f7 2034 2038 3531 3120 2036 3332 3420 0000060 3b32 0000 0000 0000 0002 0000 0000 0000 0000100 0000 0000120 0000 0000 0073 0000 0000 0000 0002 0000 0000140 006d 0000 0000 0000 0002 0012 0000154 # ./a.out 4 8 15 16 23 42; 

PDP-11 assembler for Unix System 6 - 73 68 74 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 108 bytes.

# cat mini.as s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> # ls -l a.out mini.as -rwxrwxrwx 1 root 108 Oct 10 12:35 a.out -rw-rw-rw- 1 root 74 Oct 10 12:36 mini.as # od -h a.out 0000000 0107 0022 0000 0000 0018 0000 0000 0000 0000020 15c0 0001 8904 0012 0010 15c0 0004 8923 0000040 01f7 2034 2038 3531 3120 2036 3332 3420 0000060 3b32 0000 0000 0000 0002 0000 0000 0000 0000100 0000 0000120 0000 0000 0073 0000 0000 0000 0002 0000 0000140 006d 0000 0000 0000 0002 0012 0000154 # ./a.out 4 8 15 16 23 42; 

PDP-11 assembler for Unix System 6 - 73 68 74 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 108 bytes.

# cat mini.as s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> # as mini.as # ls -l a.out mini.as -rwxrwxrwx 1 root 108 Oct 10 12:36 a.out -rw-rw-rw- 1 root 74 Oct 10 12:36 mini.as # od -h a.out 0000000 0107 0022 0000 0000 0018 0000 0000 0000 0000020 15c0 0001 8904 0012 0010 15c0 0004 8923 0000040 01f7 2034 2038 3531 3120 2036 3332 3420 0000060 3b32 0000 0000 0000 0002 0000 0000 0000 0000100 0000 0000120 0000 0000 0073 0000 0000 0000 0002 0000 0000140 006d 0000 0000 0000 0002 0012 0000154 # ./a.out 4 8 15 16 23 42; 
deleted 26 characters in body
Source Link
Matteo Italia
  • 3.8k
  • 2
  • 17
  • 22

PDP-11 assembler for Unix System 6 - 73 6868 74 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 35.43 jmpbr s m: <4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 104108 bytes.

# edcat mini.as ? a s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 35.43 jmpbr s m: <4 8 15 16 23 42;> . w 68 q # as mini.as # ls -l mini.as a.out mini.as -rwxrwxrwx 1 root 104108 Oct 10 12:3335 a.out -rw-rw-rw- 1 root 6874 Oct 10 12:3336 mini.as # od -h a.out 0000000 0107 00200022 0000 0000 0018 0000 0000 0000 0000020 15c0 0001 8904 00100012 0010 15c0 18600004 8923 0077 fff0 0000040 01f7 2034 2038 3531 3120 2036 3332 3420 3b32 0000060 0000 00023b32 0000 0000 0000 0002 0000 0000 00030000 0000100 0000 0000120 0000 0000 0073 0000 0000 0000 0002 0000 0000140 006d 0000 0000140 0000 0000 0002 00100012 00001500000154 # ./a.out 4 8 15 16 23 42; 

PDP-11 assembler for Unix System 6 - 73 68 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s: sys write;m;18 mov $6240.,r0 sys 35. jmp s m: <4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 104 bytes.

# ed mini.as ? a s: sys write;m;18 mov $6240.,r0 sys 35. jmp s m: <4 8 15 16 23 42;> . w 68 q # as mini.as # ls -l mini.as a.out -rwxrwxrwx 1 root 104 Oct 10 12:33 a.out -rw-rw-rw- 1 root 68 Oct 10 12:33 mini.as # od -h a.out 0000000 0107 0020 0000 0000 0018 0000 0000 0000 0000020 8904 0010 0010 15c0 1860 8923 0077 fff0 0000040 2034 2038 3531 3120 2036 3332 3420 3b32 0000060 0000 0002 0000 0000 0000 0000 0000 0003 0000100 0000 0000120 0073 0000 0000 0000 0002 0000 006d 0000 0000140 0000 0000 0002 0010 0000150 # ./a.out 4 8 15 16 23 42; 

PDP-11 assembler for Unix System 6 - 73 68 74 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 108 bytes.

# cat mini.as s:mov $1,r0 sys write;m;18 mov $6240.,r0 sys 43 br s m:<4 8 15 16 23 42;> # ls -l a.out mini.as -rwxrwxrwx 1 root 108 Oct 10 12:35 a.out -rw-rw-rw- 1 root 74 Oct 10 12:36 mini.as # od -h a.out 0000000 0107 0022 0000 0000 0018 0000 0000 0000 0000020 15c0 0001 8904 0012 0010 15c0 0004 8923 0000040 01f7 2034 2038 3531 3120 2036 3332 3420 0000060 3b32 0000 0000 0000 0002 0000 0000 0000 0000100 0000 0000120 0000 0000 0073 0000 0000 0000 0002 0000 0000140 006d 0000 0000 0000 0002 0012 0000154 # ./a.out 4 8 15 16 23 42; 
added 25 characters in body
Source Link
Matteo Italia
  • 3.8k
  • 2
  • 17
  • 22

PDP-11 assembler for Unix System 6 - 7373 68 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s: sys write;msg;18write;m;18 mov $6240.,r0 sys 35. jmp s msgm: <4 8 15 16 23 42\n>42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 104 bytes:.

# cated minifiedmini.as ? a s: sys write;msg;18write;m;18 mov $6240.,r0 sys 35. jmp s msgm: <4 8 15 16 23 42\n>42;> . w 68 q # as mini.as # ls -l minifiedmini.as a.out -rw-rw-rw-rwxrwxrwx 1 root  73104 Oct 10 12:51 minified.as # as minified.as # ls -l33 a.out -rwxrwxrwxrw-rw-rw- 1 root 104 68 Oct 10 12:5133 amini.outas # od -h a.out 0000000 0107 0020 0000 0000 0018 0000 0000 0000 0000020 8904 0010 0010 15c0 1860 8923 0077 fff0 0000040 2034 2038 3531 3120 2036 3332 3420 0a323b32 0000060 0000 0002 0000 0000 0000 0000 0000 0003 0000100 0000 0000120 0073 0000 0000 0000 0002 0000 736d006d 00670000 0000140 0000 0000 0002 0010 0000150 # ./a.out 4 8 15 16 23 42; 

PDP-11 assembler for Unix System 6 - 73 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s: sys write;msg;18 mov $6240.,r0 sys 35. jmp s msg: <4 8 15 16 23 42\n> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 104 bytes:

# cat minified.as s: sys write;msg;18 mov $6240.,r0 sys 35. jmp s msg: <4 8 15 16 23 42\n> # ls -l minified.as -rw-rw-rw- 1 root  73 Oct 10 12:51 minified.as # as minified.as # ls -l a.out -rwxrwxrwx 1 root 104 Oct 10 12:51 a.out # od -h a.out 0000000 0107 0020 0000 0000 0018 0000 0000 0000 0000020 8904 0010 0010 15c0 1860 8923 0077 fff0 0000040 2034 2038 3531 3120 2036 3332 3420 0a32 0000060 0000 0002 0000 0000 0000 0000 0000 0003 0000100 0000 0000120 0073 0000 0000 0000 0002 0000 736d 0067 0000140 0000 0000 0002 0010 0000150 

PDP-11 assembler for Unix System 6 - 73 68 characters

Talking about the 70s, it's mandatory to honor Unix and the hardware where it all started!

s: sys write;m;18 mov $6240.,r0 sys 35. jmp s m: <4 8 15 16 23 42;> 

You can easily run it here (but first you have to rediscover the joys of using ed to insert the text - in my specific case, I even had to discover how to actually edit text in it :)).

Assembled it becomes 104 bytes.

# ed mini.as ? a s: sys write;m;18 mov $6240.,r0 sys 35. jmp s m: <4 8 15 16 23 42;> . w 68 q # as mini.as # ls -l mini.as a.out -rwxrwxrwx 1 root 104 Oct 10 12:33 a.out -rw-rw-rw- 1 root 68 Oct 10 12:33 mini.as # od -h a.out 0000000 0107 0020 0000 0000 0018 0000 0000 0000 0000020 8904 0010 0010 15c0 1860 8923 0077 fff0 0000040 2034 2038 3531 3120 2036 3332 3420 3b32 0000060 0000 0002 0000 0000 0000 0000 0000 0003 0000100 0000 0000120 0073 0000 0000 0000 0002 0000 006d 0000 0000140 0000 0000 0002 0010 0000150 # ./a.out 4 8 15 16 23 42; 
Source Link
Matteo Italia
  • 3.8k
  • 2
  • 17
  • 22
Loading