1、8086生成物理地址:
段寄存器左移4位形成20位段地址,十六进制左移1位,然后加上16位偏移地址,合成物理地址
物理地址可在8086的20位地址总线上传递并寻址。
2、进制表示
0x开头或H结尾:16进制,如:0x3f、3fH
B结尾:2进制,如:01010000B
3、nasm:
nasm:需要一系列参数才能正常工作。
-f 参数的作用是指定输出文件的格式
-f bin 要求nasm生成的文件只包含纯二进制的mkwpw,无损作系统所需要的加载和重定位信息
-o 指定编译后输出的文件名
更多说明如下:

To assemble a file, you issue a command of the form
nasm -f <format> <filename> [-o <output>]
For example,
nasm -f elf myfile.asm
will assemble myfile.asm into an ELF object file myfile.o. And
nasm -f bin myfile.asm -o myfile.com
will assemble myfile.asm into a raw binary file myfile.com.
To produce a listing file, with the hex codes output from NASM displayed on the left of the original
sources, use the -l option to give a listing file name, for example:
nasm -f coff myfile.asm -l myfile.lst
To get further usage instructions from NASM, try typing
nasm -h
The option --help is an alias for the -h option.
If you use Linux but aren’t sure whether your system is a.out or ELF, type
file nasm
(in the directory in which you put the NASM binary when you installed it). If it says something like
nasm: ELF 32-bit LSB executable i386 (386 and up) Version 1
then your system is ELF, and you should use the option -f elf when you want NASM to produce Linux
object files. If it says
nasm: Linux/i386 demand-paged executable (QMAGIC)
or something similar, your system is a.out, and you should use -f aout instead (Linux a.out systems
have long been obsolete, and are rare these days.)
Like Unix compilers and assemblers, NASM is silent unless it goes wrong: you won’t see any output at
all, unless it gives error messages.-f format     select output file formatbin                  Flat raw binary (MS-DOS, embedded, ...) [default]ith                  Intel Hex encoded flat binarysrec                 Motorola S-records encoded flat binaryaout                 Linux a.outaoutb                NetBSD/FreeBSD a.outcoff                 COFF (i386) (DJGPP, some Unix variants)elf32                ELF32 (i386) (Linux, most Unix variants)elf64                ELF64 (x86-64) (Linux, most Unix variants)elfx32               ELFx32 (ELF32 for x86-64) (Linux)as86                 as86 (bin86/dev86 toolchain)obj                  Intel/Microsoft OMF (MS-DOS, OS/2, Win16)win32                Microsoft extended COFF for Win32 (i386)win64                Microsoft extended COFF for Win64 (x86-64)rdf                  Relocatable Dynamic Object File Format v2.0ieee                 IEEE-695 (LADsoft variant) object file formatmacho32              Mach-O i386 (Mach, including MacOS X and variants)macho64              Mach-O x86-64 (Mach, including MacOS X and variants)dbg                  Trace of all info passed to output stageelf                  Legacy alias for "elf32"macho                Legacy alias for "macho32"win                  Legacy alias for "win32"

hello,world例子

(base) [myhaspl@localhost nasm]$ cat test.asm
section .data                           ;section declaration
msg     db      "Hello, world!",0xA     ;our dear string
len     equ     $ - msg                 ;length of our dear string
section .text                           ;section declaration;we must export the entry point to the ELF linker orglobal _start       ;loader. They conventionally recognize _start as their;entry point. Use ld -e foo to override the default.
_start:
;write our string to stdoutmov     eax,4   ;system call number (sys_write)mov     ebx,1   ;first argument: file handle (stdout)mov     ecx,msg ;second argument: pointer to message to writemov     edx,len ;third argument: message lengthint     0x80    ;call kernel
;and exitmov     eax,1   ;system call number (sys_exit)xor     ebx,ebx ;first syscall argument: exit codeint     0x80    ;call kernel
(base) [myhaspl@localhost nasm]$ (base) [myhaspl@localhost nasm]$ nasm  -f elf64 test.asm
(base) [myhaspl@localhost nasm]$ ls
test.asm  test.o
(base) [myhaspl@localhost nasm]$ ld -s -o test test.o
(base) [myhaspl@localhost nasm]$ ls
test  test.asm  test.o
(base) [myhaspl@localhost nasm]$ ./test
Hello, world!

4、基本输入输出系统(BIOS)

汇编解析(3)-nasm基础、物理地址相关推荐

  1. arm汇编解析—qnnpack卷积实现

    目录 前言 基础直通车 arm基础知识 arm指令释义 qnn汇编代码解析 前言 最近在移植QNNPACK神经网络加速库,涉及到对卷积arm汇编的修改,这边做个记录,对汇编部分的内容进行注释,顺便学习 ...

  2. 【Android 逆向】使用 Python 解析 ELF 文件 ( Capstone 反汇编 ELF 文件中的机器码数据 | 创建反汇编解析器实例对象 | 设置汇编解析器显示细节 )

    文章目录 一.创建 Capstone 反汇编解析器实例对象 二.设置 Cs 汇编解析器显示细节 一.创建 Capstone 反汇编解析器实例对象 使用 Capstone 反汇编框架 , 首先创建 Ca ...

  3. RV32I 基本指令集汇编解析

    RV32I 基本指令集汇编解析@cctvjack 本文为作者自学RV用户指令集手册中RV32I基本指令集及其汇编格式的内容,参考RV 用户指令集手册.https://riscv.org/specifi ...

  4. 小吴学汇编之第一章基础知识 (2)

    小吴学汇编写的比较基础,针对没入门又想学习的小白比较适合.有什么问题大家留言一起探讨.写这个博客,主要还是记录自己在看书过程中,觉得比较重要的东西记录下来,然后看书遇到的问题,也会一一记录下来,大家一 ...

  5. 东华大学2020考研计算机复试准备上机题解析答案_基础篇 前言

    东华2020考研复试准备上机题解析答案_基础篇 前言 大家好,我是今年参加东华大学研究生入学考试的学生,前不久东华大学发布了关于复试上机的通知,还有题库供大家练习.我于是刷完了所有的题目,并且把题目和 ...

  6. ARM/THUMB汇编(补丁开发类)基础教程

    一.汇编基础(1).ARM与THUMB 汇编是与C语言挂钩的,没有C语言基础,很难学汇编.索尼爱立信的固件主要用的是THUMB指令,当然还有小部分是ARM指令.如何区分THUMB和ARM指令呢?在ID ...

  7. 汇编解析(6)-二进制文件(嵌入式,纯二进制格式的文件)进行反汇编和汇编

    二进制文件(嵌入式,纯二进制格式的文件) 除了nasm可以汇编,使用gas也可以的 (base) [myhaspl@localhost gasm]$ cat test3.asm .global _st ...

  8. scrapy 解析css,Scrapy基础(六)————Scrapy爬取伯乐在线一通过css和xpath解析文章字段...

    上次我们介绍了scrapy的安装和加入debug的main文件,这次重要介绍创建的爬虫的基本爬取有用信息 通过命令(这篇博文)创建了jobbole这个爬虫,并且生成了jobbole.py这个文件,又写 ...

  9. arm汇编解析—tengine winograd_nhwc卷积实现

    与xnn/qnn卷积的异同点 tengine中实现了NHWC的winograd,目前nhwc的卷积主要以xnn/qnn框架为典型,所以这里拿tengine中的U*V和xnn/qnn卷积做个比较,简单总 ...

最新文章

  1. 关于代码运行时间Stopwatch的使用
  2. linux增量编译不成功,Linux学习笔记-增量编译(Makefile进一步使用)
  3. Android Monkey压力测试
  4. 基于Rx-netty和Karyon2的云就绪微服务
  5. 2022年中国CRM行业研究报告
  6. 打印机(Brother MFC-7860DN)一直提示更换墨盒
  7. 奇妙的等式 精妙的证明(二)
  8. 重装系统解决:CUPS服务未启动,不能管理打印机
  9. 查看本机外网IP地址
  10. Flask流式传输文件
  11. 在小写与大写之间加下划线
  12. 第一章 如何学习单片机
  13. win7系统网页激活实验
  14. 计算机毕业生怎么参加清华暑校,上完清华暑校后,怎么才能进清华?
  15. 集线器等(概念,工作原理,以及,应用场景)
  16. 论文写作 9: 引言需要讲述完整的故事
  17. 大山深处的孩子,正在看见更远的星空
  18. powermill2020错误代码1603_未知错误1603解决方法
  19. AppScan(4)安装证书和绕过登录深入扫描
  20. 产品思考 - 小米的机会

热门文章

  1. [Design Pattern] 抽象工厂模式
  2. Personal Introduction—037尤碧璇
  3. springmvc学习笔记(19)-RESTful支持
  4. Django 基础教程
  5. c#和VB混用出现的错误
  6. Test Report
  7. 30、驱动程序调用驱动程序
  8. 内联函数与普通函数、成员函数与静态函数的区别(知识整理)
  9. Javascript学习笔记12——Ajax入门
  10. 游戏UI设计(1.2)--Textures Sprite之封装