惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
G
Google Developers Blog
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
J
Java Code Geeks
U
Unit 42
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
V
V2EX
T
Tailwind CSS Blog

博客园 - O和尚O

Time.timeScale 对 协程WaitForSeconds的影响 [转]Coroutine,你究竟干了什么? 转:Automatic Layout Groups How to Add Collider to Line Renderer in Unity [转] Edit Terrain foliage/texture at runtime [转]How to translate WORLD coordinates to TERRAIN coordinates in Unity3d [转]如何获取Untiy地形某一位置的贴图类型 Path Follow System using Waypoints C# [转]一步步使用3Dmax+Photoshop为游戏关卡设计瓦片化3D模型和无缝贴图(视频教程) [转]Unity游戏开发视频培训 [转]如何管理一个远程团队 [转]以《AI War》为例阐述AI元素概念与代码 [转]分享AI寻径设计的射线追踪法 [转]如何反推一个游戏 Physics.Raycast重载方法的参数隐式转换引发的血案 转:相机碰撞检测 转:拾起并拖拽物体(使用rigidbody.velocity) 转:如何设计一个沉浸式UI 转:如何实现一个滚动列表
mac下汇编hello world
O和尚O · 2015-11-21 · via 博客园 - O和尚O

来自:http://snipplr.com/view/29150

; Hello World in assembly for mac
; nasm -f macho hello.asm
; ld -e _start -o hello hello.o
;
section     .text
 global _start                       ;must be declared for linker (ld)

_syscall:           
     int     0x80            ;system call
     ret

_start:                         ;tell linker entry point

     push    dword len       ;message length
     push    dword msg       ;message to write
     push    dword 1         ;file descriptor (stdout)
     mov     eax,0x4         ;system call number (sys_write)
     call    _syscall        ;call kernel

                             ;the alternate way to call kernel:
                             ;push   eax
                             ;call   7:0

     add     esp,12          ;clean stack (3 arguments * 4)

     push    dword 0         ;exit code
     mov     eax,0x1         ;system call number (sys_exit)
     call    _syscall        ;call kernel

                             ;we do not return from sys_exit,
                             ;there's no need to clean stack
section .data

msg     db      "Hello, world!",0xa     ;our dear string
len     equ     $ - msg                 ;length of our dear string