flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
z0rberg 04 Dec 2016, 20:00
Greetings!
I have a weird issue I don't understand and this is probably the only place left where I can ask. To save on typing, let me first refer to this thread I've made on reddit: https://www.reddit.com/r/asm/comments/5gfuct/execute_fasm_output_in_ram_in_python_how I'd like to ask you to read through the initial post and the comments, but will explain it here again as well. My issue - which is a guess - seems to be an "f" in the binary assembler output, but I'm not actually sure. I'm using fasm.dll and pyfasm. I've tried fasm.exe and I've also tried nasm and they all give me an "f" in the bytecode as output. "Éf©90 ├" For those like me who can't read binary: "nop; mov eax,12345; ret" Someone in the thread suggested that the "f" doesn't seem to belong there. I've crosschecked with a python based assembler I've found on github, pyasm2, and funnily enough this "f" isn't in the output. But what's even more funny is that the code works! Unlike the one with the "f". Sadly I can't use pyasm2, because for some reason whenever I drop a label it excepts with a "privileged instruction" error I didn't manage to figure out. Anyhow ... it makes no sense. All I want to do is generate binary code, jump to it, and continue python. Pycca and pyasm2 both work, but both have other bugs, or lack instructions, so I thought I'd seek a different way and found fasm.dll, which seems perfect ... but doesn't work as I think it should! Is there anything you know that I can do? Maybe I'm missing something? Where does that "f" come from? Why isn't it there in pyasm2's output, yet pyasm2's output actually works? Why? I'm desperate .... Thank you for your time and patience. Last edited by z0rberg on 04 Dec 2016, 20:10; edited 1 time in total |
|||
![]() |
|
revolution 04 Dec 2016, 22:25
Yes, by default fasm starts in 16 bit mode.
A disassembler should have shown this, and even better a debugger would have made it clear that the opsize prefix was in effect. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.