First draft of encoder assembly code