概要
中古ノート買ってみた。
fasmがx64のexeを吐く、らしいので、やってみた。
参考にしたページ
手順
環境
windows10
fasmw17334.zipをダウンロード
コンパイル、実行
>fasm hello64.asm
flat assembler version 1.73.34 (1048576 kilobytes memory)
4 passes, 1536 bytes.
>hello64
Hello world!
サンプルコード
format PE64 console
entry main
include 'C:\Program Files (x86)\fasmw17334\INCLUDE\win64a.inc'
section '.idata' data readable import
library kernel32, 'kernel32.dll', msvcrt, 'msvcrt.dll'
import kernel32, ExitProcess, 'ExitProcess'
import msvcrt, printf, 'printf', getchar, 'getchar'
section '.text' code executable
main:
cinvoke printf, <'Hello world!', 10, 0>
cinvoke getchar
invoke ExitProcess, 0
以上。