flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
Nice. That is a palindrome.
I think you can add any arbitrary number of "EB01C3 ... C301EB" bytes at each end to fill out the full 64k. |
|||
![]() |
|
FlierMate
revolution wrote: Nice. That is a palindrome. Your idea is good, never thought of that. ![]() |
|||
![]() |
|
bitRAKE
Technically, RETN is palindromic - from there we might ask which lengths of executables can be palindromic? 1,(34+6n ; n>=0) have been presented so far.
![]() Just to be pedantic we should state they must be valid for the OS and return (halt). |
|||
![]() |
|
revolution
If all, or most, of the code must be executed then the problem is harder.
Otherwise we can have any valid arbitrary code as the first half, and simply place the reversed bytes at the end. |
|||
![]() |
|
bitRAKE
That's a good point. For example,
{C3,...}{...,C3} for even lengths {C3,...}XX{...,C3} for odd. The length should be truncated at the point execution is returned to the OS. So, all the above would have an actual length of one. |
|||
![]() |
|
revolution
Even simpler:
Odd: {anything}C3{reversed anything} Even: {anything...C3}{C3...reversed anything} Where"anything" is any valid code. Hex editor, game, etc. |
|||
![]() |
|
FlierMate
The rules of the contest was:
Quote:
The mirrored side of the code has to be executed to qualify... |
|||
![]() |
|
FlierMate
|
|||
![]() |
|
Tomasz Grysztar
FlierMate wrote: The rules of the contest was: Code: ; arbitrary code A, ending with: jmp filler ; reversed code B (never executed) filler: ; a whole lot of NOPs, or other similarly trivially palindromic code ; arbitrary code B (should end with program termination) ; reverse of "jmp filler", and: ; reversed code A (never executed) And even if you were not allowed, for example, to put NOP sequences in your code, you could replace it with some other instructions that would be trivially palindromic, like a 24 24 ("and al,24h") or 1C 1C ("sbb al,1Ch"), any of the single-byte opcodes that has no disruptive effect on your program (like CLC, STC, AAA), etc. etc. You could even mix and match them to make a randomly-looking filler. I would say it is actually a serious challenge to write good rules for such contest, as I found out myself when writing rules for my 512-byte coding contest last year. In the end organizers may need to rely on human assessment, at least to some extent. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.