Data types

  • byte: The basic data type. It is defined using the declaration db.
.Data
slot1 db 5
slot2 db 2
slot3 db 3
settings db 3 DUP 1 ; this creates a 3 byte array each with value of 1
plug1 db 2Fh ; hexadecimal value with h postfix
rotten db ? ; declared but not initialized
welcome db 'Enigma style file encryptor'
  • word: a 16 bit value can be defined using the dw declaration.
  • double word: a 32 bit value can be defined using the dd declaration
  • quad word: a full 64 bit value can be defined using the dq declaration.

Data Structures

Complex data structures can be defined using the struct declaration

rotor struct
	hex   dq
	notch db
end
rotor1 rotor <01F46C8037B9AD25eh, 0Fh> ; declaration
start:
	mov rax, [rotor1.hex]

Bitwise operators

  • XOR
  • AND
  • NOT
  • OR
  • SHL
  • SHR
  • SAR
  • ROL
  • ROR
  • BSWAP