Re: disassembler prefix-byte check -- wanting comments good and bad
From: Bx.C (invalid-email-address_at_invalid.shiragajin)
Date: 03/28/04
- Next message: Beginner Programmer: "RAMDrive Source / RAMDisk Source"
- Previous message: Charles A. Crayne: "Re: NASM fails to FAR Jump to specified Address"
- In reply to: Matt Taylor: "Re: disassembler prefix-byte check -- wanting comments good and bad"
- Next in thread: Bx.C: "Re: disassembler prefix-byte check -- wanting comments good and bad"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 28 Mar 2004 04:04:55 +0000 (UTC)
(snip)
> <snip>
> > in this way, the only subset i would've had to restore AL before checking,
> > is the four normal segment registers ES/CS/SS/DS... of course, i would've
> > had to place a mov al,cl at the beginning of each of these sections, or
> > handled the data in CL without moving it again...
>
> I really have no idea of what you're talking about. I don't know what cl
> holds. You did not say how you allocated the registers. It was fairly
> obvious that al was the byte you were processing, but beyond that...
>
look back at the original code... immediately before prefix cases are tested, i have this...
mov al,[bx+si]
mov cl,al
i needed to save a copy of the byte, because i didn't want to keep reloading from memory
everytime i masked out some of the bits for a grouped test like prefix bytes 26/2E/36/3E... this
is done by AND AL,0E7h and CMP AL,026h
(snip)
> > in any case, the task is NOT complex... and even decoding MOD-REG-R/M and
> > SCL-IDX-BAS isn't very much ASM code at all... it's all done in the same
> > manner... test for exceptions (like Mod-R/M=006h in 16-bit)... if that
> falls
> > through, then go with the rules... AND-Mask the byte, and follow the
> > groupings...
>
> If you plan only to disassemble 16-bit code.
>
if that were the case, why would i bother with the scale-index-base byte? *smiles*
> > i see it as a very simple task...
>
> You have given no mention of the second opcode map. Supporting that and
> 3DNow is the complex part. Supporting the basic Intel stuff through 486 is
> easy. Even supporting though MMX is reasonably easy. After that it gets very
> complex--there are conflicts between Cyrix and Intel opcodes, 3DNow is a
> pain to decode, and SSE is also a pain to decode. With a code-based
> approach, it will be less of a pain for you; however, it will be a lot of
> work with a lot of cases, and it will be a pain to maintain.
>
> I said before that I prefer tables. The reason is because you can resolve
> some of these conflicts in an interesting way--decide which CPU you want to
> disassemble for. If you disassemble for a Cyrix CPU, then you use the Cyrix
> opcodes instead of the Intel ones. It also resolves the loadall/syscall
> conflict. It also simplifies the handling of things like ModR/M and SIB
> decoding and decoding 3DNow.
>
target CPU: AMD x86-64 architecture
phase 1 goal: disassembler library for 16-bit & 32-bit code
phase 2 goal: disassembler library for 64-bit code
phase 3 goal: assembler library for 16-bit & 32-bit code
phase 4 goal: assembler library for 64-bit code
both the 16-bit and 32-bit disassembler portions are being developed right now... the 64-bit
portion will take a bit longer
- Next message: Beginner Programmer: "RAMDrive Source / RAMDisk Source"
- Previous message: Charles A. Crayne: "Re: NASM fails to FAR Jump to specified Address"
- In reply to: Matt Taylor: "Re: disassembler prefix-byte check -- wanting comments good and bad"
- Next in thread: Bx.C: "Re: disassembler prefix-byte check -- wanting comments good and bad"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|