Giter VIP home page Giter VIP logo

c4's Introduction

c4 - C in four functions

An exercise in minimalism.

Try the following:

gcc -o c4 c4.c
./c4 hello.c
./c4 -s hello.c

./c4 c4.c hello.c
./c4 c4.c c4.c hello.c

内存

汇编指令

IMM : 将 放入寄存器 ax 中。 LC : 将对应地址中的字符载入 ax 中,要求 ax 中存放地址。 LI : 将对应地址中的整数载入 ax 中,要求 ax 中存放地址。 SC : 将 ax 中的数据作为字符存放入地址中,要求栈顶存放地址。 SI : 将 ax 中的数据作为整数存放入地址中,要求栈顶存放地址。 PUSH : 将 ax 的值放入栈中; JMP : 将当前的 PC 寄存器设置为指定的 JZ : jump if ax == 0; JNZ : jump if ax != 0;

CALL : 跳转到地址为 的子函数 RET : 从子函数中返回

ENT : 保存当前的栈指针,同时在栈上保留一定的空间,用以存放局部变量; ADJ : 在将调用子函数时压入栈中的数据清除
LEV: 离开函数调用, 弹出栈, 并返回调用者 LEA : bp偏移offset后的内容赋值给ax

c4's People

Contributors

rswier avatar zhuzhengyi avatar pborreli avatar nubok avatar chainhelen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.