In the following code snippet, GAS fails to assembly a line
which contains a constant defined with .equ.
Furthermore, comments which starts with a digit are not
allowed (GAS thinks they are directives) so I've used
an additional REM.
Platform is Win32.
# GNU assembler version 2.9.4 (i586-cygwin32) using BFD
.set printf, _printf
szFormat: .asciz "9 == %d\n" Len = . - szFormat \# Should be "Len = 9".
mov ebp, esp
\# Direct constant is ok. push 9 push offset szFormat call printf add esp, 8 push Len \# Previou line assembled as \(hex\): \# FF \# REM 35 09 00 00 00 00 \# The program will crash. push offset szFormat call printf add esp, 8 xor eax, eax mov esp, ebp pop ebp ret
Log in to post a comment.