Change i386 assembler/disassembler for SIB with INDEX==4
Quoted 8 lines · H. J. Lu
Subject: Change i386 assembler/disassembler for SIB with INDEX==4
I am proposing to change i386 assembler/disassembler for SIB with INDEX==4
Quoted 9 lines
http://sources.redhat.com/bugzilla/show_bug.cgi?id=658
It will change the assembler output for (%ebx,[1248]). I am not too worried about the disassembler output since assembler can't generate SIB with INDEX==4 directly today. Any comments?
H.J.
This change would give programmers the freedom to write instruction- syntax that the processor cannot actually execute, is that right?
Perhaps the downside to this would lie in the hours of debugging and private research each programmer would then be faced with, trying to figure out why " movl (%esi,2),%eax " wasn't doing what he/she had
intended, and which the assembler had dutifully accepted. --ABC
Quoted 17 lines · Allan B. Cruse
Quoted 15 lines · H. J. Lu
Subject: Change i386 assembler/disassembler for SIB with INDEX==4
I am proposing to change i386 assembler/disassembler for SIB with INDEX==4
http://sources.redhat.com/bugzilla/show_bug.cgi?id=658
It will change the assembler output for (%ebx,[1248]). I am not too worried about the disassembler output since assembler can't generate SIB with INDEX==4 directly today. Any comments?
Quoted 6 lines
Quoted 2 lines
H.J.
This change would give programmers the freedom to write instruction- syntax that the processor cannot actually execute, is that right?
No. Assemberl will turn "mov (%ebx,2),%eax" into "8b 04 63", which is valid i386 machine code.
Quoted 6 lines
Perhaps the downside to this would lie in the hours of debugging and private research each programmer would then be faced with, trying to figure out why " movl (%esi,2),%eax " wasn't doing what he/she had
intended, and which the assembler had dutifully accepted. --ABC
What do you expect "movl (%esi,2),%eax" will do?
H.J.
Quoted 22 lines · H. J. Lu
Quoted 21 lines · Allan B. Cruse
Quoted 17 lines · H. J. Lu
Subject: Change i386 assembler/disassembler for SIB with INDEX==4
I am proposing to change i386 assembler/disassembler for SIB with INDEX==4
http://sources.redhat.com/bugzilla/show_bug.cgi?id=658
It will change the assembler output for (%ebx,[1248]). I am not too worried about the disassembler output since assembler can't generate SIB with INDEX==4 directly today. Any comments?
H.J.
Quoted 5 lines
Quoted 2 lines
This change would give programmers the freedom to write instruction- syntax that the processor cannot actually execute, is that right?
No. Assemberl will turn "mov (%ebx,2),%eax" into "8b 04 63", which is valid i386 machine code.
I don't see any particular need to support generation of this instruction coding. Feeding the output of the disassembler back to the assembler won't generate the same encodings for many instructions, eg. there are two ways to encode mov %eax,%ebx (and some people even use the two reg->reg move encodings to hide messages in code). Another example is that the assembler chooses the smallest immediate or displacement encoding.
Quoted 5 lines
Quoted 5 lines
Perhaps the downside to this would lie in the hours of debugging and private research each programmer would then be faced with, trying to figure out why " movl (%esi,2),%eax " wasn't doing what he/she had
intended, and which the assembler had dutifully accepted. --ABC
Huh? The assembler will warn about this construct, and we certainly should continue to warn, so that people who meant to write "mov (,%esi,2),%eax" get a clue.
Quoted 5 lines
What do you expect "movl (%esi,2),%eax" will do?
H.J.
Signature · 2 lines
Alan Modra IBM OzLabs - Linux Technology Centre