%%HP: T(3)A(D)F(.);
@ MEMGRAPH
@ by Bill Menees
@   vv----- Change this to be how many K of RAM you have total (merged).
\<< 32 MEM \-> MAXMEM M
  \<< PICT RCL DUP SIZE RCLF \-> PIC HORZ VERT FLAGS
    \<< -49 CF -50 CF ERASE # 83h # 40h PDIM { # 0h # 0h } PVIEW { # 0h # 20h }
        { # 82h # 2Ah } BOX PICT { # 20h # 0h } "MEMORY USED" 3 \->GROB REPL
        PICT { # 0h # 2Ch } "0k" 2 \->GROB REPL PICT MAXMEM \->STR k + 2
        \->GROB DUP SIZE DROP # 85h SWAP - # 2Ch 2 \->LIST SWAP REPL M NEG
        MAXMEM 1024 * + MAXMEM 1024 * / 131 * IP \-> N
      \<< PICT N R\->B # 9h BLANK NEG { # 1h # 21h } SWAP REPL
      \>> PICT MAXMEM 1024 * M - " BYTES USED." + 1 \->GROB DUP SIZE DROP
        # 83h SWAP - 2 / # Eh 2 \->LIST SWAP REPL PICT M " BYTES FREE." + 1
        \->GROB DUP SIZE DROP # 83h SWAP - 2 / # 15h 2 \->LIST SWAP REPL PICT
        { # 24h # 38h }
        GROB 56 7 C1807C17007C9F22C882A80882A0D58882AC0802A05480FCBA0802A7D58080A90802A0228040980882A0C1C13C07007C90
        REPL { } PICT { # 20h # 2Fh } "PERCENT FREE: " M MAXMEM 1024 * / 100
        * IP \->STR + 37 CHR + 1 \->GROB REPL PVIEW HORZ VERT PDIM PIC PICT STO
        FLAGS STOF
    \>>
  \>>
\>>
