8086 CPU(实模式)ROM实模式显卡和显存寄存器标志寄存器FLAGS相关工具BochsNetwide Assembler(NASM)dd Convert and copy a file编程语言支持
加电复位后,ROM-BIOS将读取硬盘0面0道1扇区(主引导扇区Main Boot Sector,MBR),共512字节
8086 CPU(实模式)
20根地址线:0x00000~0xFFFFF
DRAM:0x00000~0x9FFFF
ROM:0xF0000~0xFFFFF
外围设备:0xA0000~0xEFFFF
起始地址
结束地址
大小
用途
reset
CS=0xFFF IP=0x0000
指向物理地址:0xFFFF0 (ROM)
指令指向顺序:低地址到高地址推进
ROM
硬件诊断、检测和初始化。
提供一套软件例程,让人民不必了解硬件的细节的情况控制I/O设备
基本输入输出系统(Base Input & Output System,BIOS)
读取主引导扇区到 0x0000:0x7c00 (0x07c00) 并jmp
实模式
- 主引导扇区
512字节 最后两个字节应当是0x55和0xAA
jmp 0x0000:0x7c00 ROM-BIOS将引导扇区加载到此处
显卡和显存
- 图形模式
- 文本模式(80x25 25行,80字符) 0xB8000~0xBFFFF
寄存器
标志寄存器FLAGS
相关工具
Bochs
Netwide Assembler(NASM)
是一款基于英特尔x86 架构的汇编与反汇编工具
nasm xx.asm -o xx.o 汇编文件编译成二进制文件
usage: nasm [-@ response file] [-o outfile] [-f format] [-l listfile]
[options...] [--] filename
or nasm -v for version info
-t assemble in SciTech TASM compatible mode
-g generate debug information in selected format
-E (or -e) preprocess only (writes output to stdout by default)
-a don't preprocess (assemble only)
-M generate Makefile dependencies on stdout
-MG d:o, missing files assumed generated
-MF <file> set Makefile dependency file
-MD <file> assemble and generate dependencies
-MT <file> dependency target name
-MQ <file> dependency target name (quoted)
-MP emit phony target
-Z<file> redirect error messages to file
-s redirect error messages to stdout
-F format select a debugging format
-I<path> adds a pathname to the include file path
-O<digit> optimize branch offsets
-O0: No optimization
-O1: Minimal optimization
-Ox: Multipass optimization (default)
-P<file> pre-includes a file
-D<macro>[=<value>] pre-defines a macro
-U<macro> undefines a macro
-X<format> specifies error reporting format (gnu or vc)
-w+foo enables warning foo (equiv. -Wfoo)
-w-foo disable warning foo (equiv. -Wno-foo)
--prefix,--postfix
this options prepend or append the given argument to all
extern and global variables
Warnings:
error treat warnings as errors (default off)
macro-params macro calls with wrong parameter count (default on)
macro-selfref cyclic macro references (default off)
macro-defaults macros with more default than optional parameters (default on)
orphan-labels labels alone on lines without trailing `:' (default on)
number-overflow numeric constant does not fit (default on)
gnu-elf-extensions using 8- or 16-bit relocation in ELF32, a GNU extension (default off)
float-overflow floating point overflow (default on)
float-denorm floating point denormal (default off)
float-underflow floating point underflow (default off)
float-toolong too many digits in floating-point number (default on)
user %warning directives (default on)
lock lock prefix on unlockable instructions (default on)
hle invalid hle prefixes (default on)
response files should contain command line parameters, one per line.
For a list of valid output formats, use -hf.
For a list of debug formats, use -f <form> -y.
Loading Comments...