mac自带了nasm, 但是, 但是, 但是, 老得一塌糊涂.
apple版本
brew install nasm
安装完之后重启.
最新版本
之后就是和写c差不多了. 但是, 我们要讲究一些, 写个32, 写个64, 好吧.
64
nasm -f macho64 -o helloworld.o helloworld.asm
ld -o helloworld -e _main helloworld.o
./helloworld
运行
32
运行
我汇编很佛系的, 最近也是要开始认真学了. 喜欢记得点赞哦, 有意见或者建议评论区~
参考文章: http://gaoryrt.com/2015/11-18-assembly/ https://blog.csdn.net/u011987514/article/details/72615406
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有