![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
汇编
2021乐乐
交流学习
展开
-
汇编:在bss段和data段声明数据的区别
在bss段中声明数据的一个好处是数据不包含在可执行的程序中。在数据段中定义数据时必须被包含在可执行的程序中,因为必须使用特定值初始化。test1.s.section .text.global _start_start:movl $1, %eaxmovl $0, %ebxint $0x80 运行:$ as -o test1.o test1.s$ ld -o tes...转载 2018-10-25 23:22:56 · 3566 阅读 · 0 评论 -
汇编:冒泡排序
求的一个数组的最大值:.section .datadata_items:.long 3,67,54,99.section .text.globl _start_start: nop movl $0, %edi movl data_items(,%edi,4), %eax movl %eax, %ebx start_loop: cmpl $0, %eax ...原创 2018-11-13 11:17:33 · 194 阅读 · 0 评论 -
Win32 汇编 小知识学习笔记(一)
1. win32 API调用中把参数放入堆栈,顺序是最后一个参数最先进栈。 2. invoke 不是80386的指令,而是一个MASM编译器的伪指令,解决调用API参数过多的问题格式: invoke 函数名[,参数1][,参数2]3. dword(double world) 其实就是一个32 位的整数4.在win32 环境中,和字符相关的API共有两类,分别对应两个字符集:一类...转载 2019-01-18 22:19:22 · 135 阅读 · 0 评论 -
win32 汇编学习(二)
我们学习汇编需要有适合自己的asm编辑器,由于笔者太笨, 不会用atom和bracket编写汇编。因此采用RadASM。采用的操作系统是win7.RadASM 的编辑器下载地址:http://www.xue51.com/soft/5455.html .386 .model flat,stdcall option casemap:none;>>>>>...原创 2019-01-19 16:23:31 · 168 阅读 · 0 评论 -
win32 汇编学习(三)
三:模块和句柄1 . 程序结构模式分为两种,过程驱动方式和事件驱动方式2. PostMessage 是把一个消息放到其他程序的消息队列中,而SendMessage 则越过消息队列直接调用目标程序的窗口过程。3.一个应用程序为了区分地址空间中的不同模块,每个模块都有一个唯一的模块句柄来标识。取模块句柄使用的API函数是GetModuleHandler 具体用法是: invok...转载 2019-01-20 15:52:44 · 622 阅读 · 0 评论 -
win32 汇编学习(四)
本小节内容主要是为了解决窗体间的通信.1.基本知识点:首先了解SendMessage 和 PostMessage 函数的用法:invoke PostMessage ,hWnd,Msg,wParam,lParaminvoke SendMessage ,hWnd,Msg,wParam,lParamSendMessage 函数相当于直接调用其他窗口的窗口过程来处理这个消息,并...转载 2019-01-21 20:09:24 · 207 阅读 · 0 评论 -
win32 基本知识2
保护模式不能进行纯MS-DOS系统运行。转载 2019-02-22 20:25:21 · 123 阅读 · 0 评论 -
80386 内存分页机制
转载 2019-02-22 11:03:02 · 399 阅读 · 2 评论 -
windows 的内存安排
转载 2019-02-22 11:15:35 · 128 阅读 · 0 评论 -
FPU 操作浮点数
.section .datavalue1: .int 40value2: .float 92.4405value3: .double 221.440321.section .bss .lcomm intl ,4 .lcomm control ,2 .lcomm status ,2 .lcomm result ,4.section ....转载 2018-11-04 23:14:36 · 887 阅读 · 0 评论 -
FPU 寄存器
FPU 状态寄存器:fstsw 可以把状态寄存器读取到一个双字节内存位置或者AX寄存器中。.section .dataoutput: .asciz "The is %d\n".section .bss .lcomm status ,2.section .text.globl _start_start: nop fstsw %ax f...转载 2018-11-04 22:00:02 · 1421 阅读 · 0 评论 -
运行AT&T汇编程序和汇编gdb调试
注意: Ubuntu16.04 不包含 linux.so.2库,因此不能运行包含C库函数的汇编,因此本文作者在ubuntu14.04 (32位的系统)上运行成功。1:运行程序的方法 只要是在汇编源程序中出现 call print 、exit或者其他C语言语句 ,统称为汇编语言使用C库函数。 方法1:运行汇编语言(未使用C库函数)as -o test.o test...原创 2018-10-30 17:24:04 · 598 阅读 · 0 评论 -
AT&T 冒泡程序
.section .datavalues: .int 105,235,61,315,134,221,53,145,117,5.section .text.global _start_start: movl $values ,%esi movl $9 ,%ecx movl $9 ,%ebxloop: movl (%esi),%eax ...原创 2020-03-05 19:28:25 · 81 阅读 · 0 评论 -
AT&T 汇编 hello world!
汇编源代码hello.s:.section .data output: .asciz "hello world !".section .text.globl _start_start: pushl $output call printf call exit 运行代码指令:$ as -gstabs -o hello.o hello.s$ ld -dyna...原创 2018-10-30 22:47:55 · 272 阅读 · 0 评论 -
Inter 小尾数法
转载:https://blog.csdn.net/q_l_s/article/details/54897093大尾小尾 是数据在存储器中的存储格式,INtel采用的是小尾表示,即数据的高位存储在存储器的高地址,低位存储在存储器的低地址,例如一个十六进制数据0x1234存储在内存中,那么该数据在内存中的存储格式为: 34 12 == 内存方向是 从底(左)到高(右)而大尾数据存储格式,一般存在...转载 2018-11-03 21:17:48 · 280 阅读 · 0 评论 -
linux系统调用
转载:1.linux常用查看硬件设备信息命令 https://blog.csdn.net/shaozengwei/article/details/390541692.linux的所有进程https://www.cnblogs.com/zwgblog/p/5971455.html 常见的格式 :ps options ps ax显示所有的进程清单3.内核版本,系统运行那...转载 2018-11-06 17:04:10 · 115 阅读 · 0 评论 -
AT&T 汇编四则运算
1 :加法 1.1 add source ,destination ADD指令可以将8,16,32位指令相加。其中b(用于字节),w(用于字),或者l(用于汉字) 使用add指令特别关注溢出问题,addb超过255就会溢出,标志位设置为1,addw 超过65525就会溢出,设置标志位为1.有时 候程序员不清楚何时溢出,此时溢出标志就很重要了 ..se...转载 2018-11-04 10:10:19 · 2532 阅读 · 0 评论 -
AT&T 汇编移位运算
1.移位乘法 sal destination sal %c1, destination sal shifter, destination 第一种格式destination的值向左移1位,这等同于使值乘以2. 线第二种格式把destination的值向左移动CL寄存器中指定的位数。 最后一个版本把destination的值向左移动shife...转载 2018-11-04 12:09:18 · 769 阅读 · 0 评论 -
at&t 位测试(test)
TEST 指令最常见的用途是检查EFLAGES寄存器的标志位.section .dataoutput_cpuid: .asciz "This processor supports the CPUIDinstruction\n"output_nocpuid: .asciz "This processor does not support the CPUID ins...转载 2018-11-04 16:15:57 · 1048 阅读 · 0 评论