sannybuilder/dev

HEX..END improvements

Closed this issue · 3 comments

x87 commented
  • {$include} file as a binary blob
  • byte(N) syntax to repeat byte N times, i.e. 00(4) would be equivalent to 00 00 00 00
  • N is a positive integer number (> 0).
  • N could also be expressed as a constant name or in hexadecimal format
const
  x = 0x3
end
hex
   01(x)
end

becomes

hex
  01 01 01
end
  • disassembler packs the trailing sequence of zero bytes using the same syntax
    Requirements for the sequence to be packed by the disassembler:
    • the sequence must be trailing, i.e. complete the hex..end, bytes in the middle are always printed individually
    • the sequence must be 4 and more bytes long
    • the sequence must only contain zero (00) bytes
 hex
     00 00 00 00 01 00 00 00 00
 end

becomes

 hex
     00 00 00 00 01 00(4)
 end

If possible add support for put number with calculates mathematics?
Example: hex 00(4*2) end
for put

hex
   00 00 00 00
   00 00 00 00
end
x87 commented

For now it expects just a single number, not an expression. You will have to precalculate it.

x87 commented

Feedback: add support for constants and hexadecimal numbers for n.
Also enforce n>0