The Command
Encapsulating a sinister order into a discrete executable token.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Necromancy // Imperative Runes
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// BARE METAL ARCHITECTURE RUNE //
section .data
; Command struct: [func_ptr, arg1]
cmd_raise dq raise_dead, 0x100
section .text
global _start
_start:
; Queue and execute the command
mov rsi, cmd_raise
call execute_command
mov rax, 60
syscall
execute_command:
mov rax, [rsi]
mov rdi, [rsi+8]
call rax
ret
raise_dead:
; RDI contains the number of dead to raise
ret
The Command pattern reifies a method call into an object or structure. In the dark arts, an imperative rune encapsulates a function pointer and its arguments, allowing the spell to be queued, delayed, or logged before execution.
Runic Tags:
#command
#assembly
#behavioral
#necromancy