E
Edward Rutherford
Hello
I am trying to write code that includes a certain number of NOPs in the
generated machine code, I would like to do it portably so without using
inline asm.
On lccwin, even without optimisations, no NOPs are generated. I have
searched the documentation but there does not seem to be any compiler
option covering NOP generation. Can anyone help?
Here is the C code:
main()
{
;
;
;
;
;
puts("done");
}
Here is the generated assembly - as you can see, the 5 NOPs are missing.
.file "c:\\nop_test.c"
_$M0:
.file "c:\\nop_test.c"
.text
.text
; 1 main()
.type _main,function
_main:
; 2 {
.line 2
; 3 ;
; 4 ;
; 5 ;
; 6 ;
; 7 puts("done");
.line 7
pushl $_$2
call _puts
addl $4,%esp
movl $0,%eax
_$1:
; 8 }
.line 8
ret
_$3:
.size _main,_$3-_main
.globl _main
.extern _puts
.data
_$2:
; "done\x0"
.byte 100,111,110,101,0
I am trying to write code that includes a certain number of NOPs in the
generated machine code, I would like to do it portably so without using
inline asm.
On lccwin, even without optimisations, no NOPs are generated. I have
searched the documentation but there does not seem to be any compiler
option covering NOP generation. Can anyone help?
Here is the C code:
main()
{
;
;
;
;
;
puts("done");
}
Here is the generated assembly - as you can see, the 5 NOPs are missing.
.file "c:\\nop_test.c"
_$M0:
.file "c:\\nop_test.c"
.text
.text
; 1 main()
.type _main,function
_main:
; 2 {
.line 2
; 3 ;
; 4 ;
; 5 ;
; 6 ;
; 7 puts("done");
.line 7
pushl $_$2
call _puts
addl $4,%esp
movl $0,%eax
_$1:
; 8 }
.line 8
ret
_$3:
.size _main,_$3-_main
.globl _main
.extern _puts
.data
_$2:
; "done\x0"
.byte 100,111,110,101,0