title: How to assemble Intel-syntax assembly on Windows using gcc?
body: <p>I've been using Ubuntu up until a few weeks ago and now I'm back on Windows.
  I have a test coming up in basic assembly programming. I remember that while I was on Linux I could compile .s assembly files through terminal using gcc file.s, and it all worked fine.</p>
  
  <p>But now that I'm on Windows, it doesn't work so great. Here's the code that I copied from my faculty's website (I didn't write it):</p>
  
  <pre><code>.intel_syntax noprefix
  
  .data
      fmt_string: .asciz "Hello, world!\n"
  
  .text
  .global main
  
  main:
      enter 0,0
      mov rax, 0
      lea rdi, fmt_string
      call printf
      mov rax, 0
      leave
      ret
  </code></pre>
  
  <p>I'm using MinGW in ordere to compile .c and .s files, and here's what I get after tried to compile this code:</p>
  
  <p><a href="https://i.stack.imgur.com/CM6Jo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CM6Jo.png" alt="enter image description here"></a></p>
  
  <p>Now, keep in mind that I'm only starting (trying to start) learning assembly so if you go all theoretical on me I'll probably have no idea what you're talking about. </p>
  
  <p>All I want to know is whether I can compile this assembly code on Windows or if I should think about just going back to Linux.</p>