摘要: /sys/class/gpio 阅读全文
posted @ 2023-08-21 11:26 杨大茄子 阅读(4) 评论(0) 推荐(0) 编辑
摘要: /usr/include/asm-generic/unistd.h /usr/include/errno.h /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h 阅读全文
posted @ 2023-08-19 17:49 杨大茄子 阅读(4) 评论(0) 推荐(0) 编辑
摘要: x31 arm SP寄存器 16byte对齐 调用函数,必须保存当前位置以便函数调用完成后返回,the link register (LR) which is X30, branch with link (BL) bl 与b 类似,不同的是 bl 在跳转前把下一条指令的地址保存在LR寄存器中,这样b 阅读全文
posted @ 2023-08-19 01:09 杨大茄子 阅读(5) 评论(0) 推荐(0) 编辑
摘要: .data 段的内存引用实例 十进制数不要以0开头,否则会被认为是8进制数 一个数前面可以加-负号或者~取反符号; 申请一个内存块; 重复! 转义字符! 内存对齐 The offset from the PC has 19 bits in the instruction, which gives a 阅读全文
posted @ 2023-08-18 21:38 杨大茄子 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Unconditional Branch The simplest branch instruction is B label 无条件分支跳转 有符号数为负则设置N标志,否则clear 结果为0 设置此标志,否则clear 加法中溢出了则设置此标志,减法不需要借也就是结果不为负则设置,移位中保存最后 阅读全文
posted @ 2023-08-18 17:25 杨大茄子 阅读(6) 评论(0) 推荐(0) 编辑
摘要: make -B 强制重新make gdb之前,需要先在编译时加入 -g 参数以开启debug模式,修改一下makefile; TARGET=move ifdef DEBUG DEBUGFLGS = -g else DEBUGFLGS = endif $(TARGET): $(TARGET).o ld 阅读全文
posted @ 2023-08-17 23:27 杨大茄子 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 负数的表示方法,补码 比如一个正数 1的补码就是 加上就溢出等于0的值, byte范围内,256就溢出了,所以1的补码就是256-1=255,0xFF,所以-1就是FF 另一种计算方法是,负数等于正数的反码加一; 1补数就是反码! 大小端:arm同时支持大小端,但一般都采用小端, carry fla 阅读全文
posted @ 2023-08-17 00:18 杨大茄子 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Programming with 64-Bit ARM Assembly Language Single Board Computer Development for Raspberry Pi and Mobile Devices —Stephen Smith 32 bits ARM64指令: // 阅读全文
posted @ 2023-08-14 22:36 杨大茄子 阅读(89) 评论(0) 推荐(0) 编辑
摘要: BUS_IOC_GPIO0B_IOMUX_SEL_H[11:8] = 4’ha 0xfd5f800c 11:8 a mov x0,#0 ldr w0,=0xFD5F800C ldr w1,[x0] BUS_IOC_GPIO0B_IOMUX_SEL_H[7:4] = 4’ha PMU2_IOC_GPI 阅读全文
posted @ 2023-08-07 15:21 杨大茄子 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 在linux虚拟机里安装arm64交叉编译环境 apt install gcc make binutils gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu flex bison 写一个helloworld.c aarch64-linux-gnu-gc 阅读全文
posted @ 2023-08-03 08:43 杨大茄子 阅读(190) 评论(0) 推荐(0) 编辑