Mixed Programming of C and assembly in MCU {Single Chip Microcomputer}

Source: Internet
Author: User

Let's take a look!


I should have understood this! In fact, many of them are those that do not have a learning standard.

Assembly has its own format just like C. What is its format?

Name cs_t
? PR? Cs_t? Cs_t segment code
Public cs_t
Rseg? PR? Cs_t? Cs_t
Cs_t:
Push ACC
NOP
NOP
NOP
NOP
NOP
Pop ACC
RET

End

This is its format. There are many advantages for learning compilation.

For example:

1. It can crack the program;

2. It can be used as a shellcode tool;

3. write very confidential code;

..... That's enough for three.

-------------------

Command Line operations...

C: \> C51 text1.c debug

C: \> lx51 text1.obj

C: \> ohx51 text1

A single C program compiles connections to generate hex files

A51 asample1.a51 debug xref
A51 asample2.a51 debug xref
A51 asample3.a51 debug xref
Bl51 asample1.obj, asample2.obj, asample3.obj to asample precede (var1) ixref
Oh51 asample

Generate hex files through compilation links of multiple assemblies

C51 Ma _. c debug

A51 fun _. A51 debug

A51 fun_1.asm debug

Lx51 Ma _. OBJ, fun _. OBJ, fun_1.obj

Ohx51 Ma _

C and ASM Hybrid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.