AssemblyLanguage Tanka
SAKAI Hiroaki(KOZOS Project)TwitterID:kozossakai
AssemblyLanguageTanka?
What's assemblylanguage tanka?
Write program in 5+7+5+7+7 machine codes.
It's cool and exciting!
Example
68 72 6c 64 2168 6f 20 57 6f 90 9068 48 65 6c 6c89 e5 6a 0c 55 6a 0250 90 6a 04 58 cd 80
Write on Japanese
Tanka card.
Result
Hello World!
in otherlanguages,
Tanka is impossible in other programming
languages.
For example,Shell script
#!/bin/sh(9 letters!)
For example,Language C
#include <stdio.h>
(18 letters!)
XSS Tanka?
XSS tanka has no tankism
Assembly is most tankable
language
in SECCONNagano,
What's displayed?
Assemblylanguagetanka's
hangingscroll!
See well.
Title: Niigata
So,
Let's tanking!
Title: Summer vacationTankist: Me
Check points
See assemblypush $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
Uppersection Lower
section
See assemblypush $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
Uppersection Lower
section
Same instructionin last position.
That is,
Stepped onthe rhyme.
Stepped on the rhyme
by 0x40
Otherpoints
push $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
push $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
Set up registers by value of EAX.
That is,
Like a flowof a brook.
See instructions
push $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
push $0pop %eaxpush %eaxinc %eax
push $0x616d6179push %eaxinc %eax
push $8pop %edxpop %ebxinc %eax
push $0x616b6157push %espinc %eax
pop %ecxint $0x80pop %eaxpop %eaxpop %eaxret
Mnemonic has a rhythm, "push-pop-inc".
Comments While EAX first set as zero increases every sectionby the inc instruction, the value of EAX was divertedand other parameters are set. This seems to be the
flow of a brook. There is a rhythm which is skipped ina mnemonic like "push-pop-push-inc, push-push-inc"and "push-pop-pop-inc, push-push-inc". The sight ofthe children who play the side of a brook is made toconsider. The theme the "summer vacation" is often
expressed.
Muchtankassion!
Information
Book of assembly
language tanka!
Assembly programming in 31 bytes
World of assemblylanguage tanka
Tankists:Sakai Hiroaki
Aiko Kenji Matsuda Kazuki Sakai Takeyasu
Takesako Yoshinori
Now on sale!
Event for book! (January 20) "2014 Let's try assembly language tanka!"
at Mynavi Room
Today'smain
subject!
What is the most tankaful architecture?
RISC architecture: Instruction is fixed in 4 bytes.
If flexible instruction, most architecture has
machine code of even length.
Untankable!
Tankablearchitectures
x86(Intel) M32C(Mitsubishi) MN10300(Panasonic)
RL78(Renesas) RX(Renesas) Xtensa(Tensilica)
Results
RX(Renesas Electronics)
Assemblymov.l #1, r1mov.l #10, r3nop
mov.l #0x6c6c6548, [r0]nop
mov.l #0x6c72, 8[r0] mov.l #0x6f57206f, 4[r0]
mov.l r0, r2mov.l #5, r5int #255
Uppersection
Lowersection
Execution
Hello Worl
(10 letters)
RL78(Renesas Electronics)
Hello Wor
(9 letters)
Others
MN10300
M32CHello Wo
Hello!
(8 letters)
(6 letters)
i386/FreeBSD
x86/LinuxHello World!
Hello World!!
(12 letters)
(13 letters)
Let'scompare.
Beforecomparison
For quantification, a unit is needed.
Define a unitBPT (Byte per Tanka)
How tankafulfor tanking.
Example on RXhello Worl
10 letters: 10BPT
Aggregation
M32C 6BPTMN10300 8BPTRL78 9BPTRX 10BPTi386/FreeBSD12BPTx86/Linux 13BPT
x86 is very tankaful
architecture! (and, Linux too)
Thank youfor my tanking!