title: AT&T assembly try to "movb" a character constant to register, core dump
body: <p>I'm using ubuntu64 + gas
  I use AT&amp;T assembly, I tried to assign al register with a 'e', and compile it into 32 bit program</p>
  <p>$ cat c2.s</p>
  <pre><code>.code32 
  .globl _start 
  _start: 
  movb 'e',%al   # Problem here!!!!
  mov $1,%eax 
  mov $0,%ebx 
  int $0x80 
  </code></pre>
  <blockquote>
  <p>$ as -g c2.s -o c2.o &amp;&amp; ld c2.o -o c2</p>
  <p>$ c2</p>
  <p>Segmentation fault(SIGSEGV)</p>
  </blockquote>
  <p>I used gdb to debug c2, and found it crash at movb 'e',%al. So weird, how could a &quot;movb&quot; crash?</p>
  <p>Then I switched my syntax to use intel same content:</p>
  <p>$ cat b2.s</p>
  <pre><code>.intel_syntax noprefix 
  .code32 
  .section .text 
  .global _start 
  _start: 
      mov al,'e' 
      mov eax,1 
      mov ebx,0 
      int 0x80 
  </code></pre>
  <blockquote>
  <p>$ as -g b2.s -o b2.o &amp;&amp; ld b2.o -o b2</p>
  <p>$ b2</p>
  </blockquote>
  <p>This time, no problem. But why, is my usage of AT&amp;T assembly has something wrong?</p>