.286
decoder segment
  assume cs:decoder, ds:decoder, es:decoder
 
 jumps

cMAX_FILE   equ 05
cNAME_LEN   equ 12
cPASS_LEN   equ 10
cBUF_SIZE   equ 300
 
start:
  push ds
  pop ax
  xor si, si
  
loo1:
  cmp ax, ds:[si+16h]
  jz root
  mov ax, ds:[si+16h]
  mov ds, ax
  jmp loo1

root:
  mov ax, ds:[2ch]
  mov es, ax
  dec ax

  mov ds, ax
  mov bx, ds:[3h]

  xor di, di
  xor ax, ax
  xor cx, cx
  not cx

searchEND1:
  repnz scasb
  cmp byte ptr es:[di], 0
  jz EXEC
  jmp searchEND1

EXEC:
  inc di
  inc di
searchEND2:
  repnz scasb
  cmp byte ptr es:[di], 0
  jz EEEE
  jmp searchEND2

EEEE:
  mov ax, di
  shr ax, 4

  sub ax, bx

  cmp ax, 40h
  jl NO_MEM

NO_MEM:
  mov ah, 4ch
  int 21h
decoder ends
end start
