FASM源代码分析01

来源:互联网 发布:家庭网络改造 编辑:程序博客网 时间:2024/06/05 14:03

全汇编操作系统Kolibri 0.7.7基于MenuetOS使用fasm汇编编译器

第2个光盘安装的,肯定不用下的

第1个软盘镜像是我们需要的

第3个是源代码

第4个是APP开发包

在其官网http://kolibrios.org/可以下到的文件有

kolibri_0.7.7.0_img_en.7z ------------软盘镜像文件

kolibri_0.7.7.0_sdk.7z------------------APP开发包

kolibri_0.7.7.0_src.7z ------------------操作系统源代码

all_soft.7z ---------------------------------所有软件

latest-distr.7z 最新发布版,与其他项目档案 Archive with additional programs



fasm源代码官网下载地址:

http://flatassembler.net/download.php

代码都差不多,因为在XP上看所以就下了这个:flat assembler 1.71.39 for Windows

fasm源代码分析:
看了很多的书得出由浅到深,所以我们定个分析方向:先从文件小的开始分析
VERSION.INC-----------------------------------版本信息
VERSION_STRING equ "1.71.39"
VERSION_MAJOR = 1
VERSION_MINOR = 71
MESSAGES.INC--------------------------------错误提示信息

_out_of_memory db 'out of memory',0
_stack_overflow db 'out of stack space',0
_main_file_not_found db 'source file not found',0
_unexpected_end_of_file db 'unexpected end of file',0
_code_cannot_be_generated db 'code cannot be generated',0
_format_limitations_exceeded db 'format limitations exceeded',0
_invalid_definition db 'invalid definition provided',0
_write_failed db 'write failed',0
_file_not_found db 'file not found',0
_error_reading_file db 'error reading file',0
_invalid_file_format db 'invalid file format',0
_invalid_macro_arguments db 'invalid macro arguments',0
_incomplete_macro db 'incomplete macro',0
_unexpected_characters db 'unexpected characters',0
_invalid_argument db 'invalid argument',0
_illegal_instruction db 'illegal instruction',0
_invalid_operand db 'invalid operand',0
_invalid_operand_size db 'invalid size of operand',0
_operand_size_not_specified db 'operand size not specified',0
_operand_sizes_do_not_match db 'operand sizes do not match',0
_invalid_address_size db 'invalid size of address value',0
_address_sizes_do_not_agree db 'address sizes do not agree',0
_disallowed_combination_of_registers db 'disallowed combination of registers',0
_long_immediate_not_encodable db 'not encodable with long immediate',0
_relative_jump_out_of_range db 'relative jump out of range',0
_invalid_expression db 'invalid expression',0
_invalid_address db 'invalid address',0
_invalid_value db 'invalid value',0
_value_out_of_range db 'value out of range',0
_undefined_symbol db 'undefined symbol',0
_symbol_out_of_scope_1 db 'symbol',0
_symbol_out_of_scope_2 db 'out of scope',0
_invalid_use_of_symbol db 'invalid use of symbol',0
_name_too_long db 'name too long',0
_invalid_name db 'invalid name',0
_reserved_word_used_as_symbol db 'reserved word used as symbol',0
_symbol_already_defined db 'symbol already defined',0
_missing_end_quote db 'missing end quote',0
_missing_end_directive db 'missing end directive',0
_unexpected_instruction db 'unexpected instruction',0
_extra_characters_on_line db 'extra characters on line',0
_section_not_aligned_enough db 'section is not aligned enough',0
_setting_already_specified db 'setting already specified',0
_data_already_defined db 'data already defined',0
_too_many_repeats db 'too many repeats',0
_invoked_error db 'error directive encountered in source file',0
_assertion_failed db 'assertion failed',0

VARIABLE.INC-------------------------------------------核心变量

memory_start dd ?
memory_end dd ?


additional_memory dd ?
additional_memory_end dd ?


stack_limit dd ?


initial_definitions dd ?
input_file dd ?
output_file dd ?
symbols_file dd ?


passes_limit dw ?


; Internal core variables:


current_pass dw ?


include_paths dd ?
free_additional_memory dd ?
source_start dd ?
code_start dd ?
code_size dd ?
real_code_size dd ?
written_size dd ?
headers_size dd ?


current_line dd ?
macro_line dd ?
macro_block dd ?
macro_block_line dd ?
macro_block_line_number dd ?
macro_symbols dd ?
struc_name dd ?
struc_label dd ?
instant_macro_start dd ?
parameters_end dd ?
default_argument_value dd ?
locals_counter rb 8
current_locals_prefix dd ?
anonymous_reverse dd ?
anonymous_forward dd ?
labels_list dd ?
label_hash dd ?
label_leaf dd ?
hash_tree dd ?
addressing_space dd ?
undefined_data_start dd ?
undefined_data_end dd ?
counter dd ?
counter_limit dd ?
error_info dd ?
error_line dd ?
error dd ?
tagged_blocks dd ?
structures_buffer dd ?
number_start dd ?
current_offset dd ?
value dq ?
fp_value rd 8
adjustment dq ?
symbol_identifier dd ?
address_symbol dd ?
address_high dd ?
format_flags dd ?
resolver_flags dd ?
symbols_stream dd ?
number_of_relocations dd ?
number_of_sections dd ?
stub_size dd ?
stub_file dd ?
current_section dd ?
machine dw ?
subsystem dw ?
subsystem_version dd ?
image_base dd ?
image_base_high dd ?
resource_data dd ?
resource_size dd ?
actual_fixups_size dd ?
reserved_fixups dd ?
reserved_fixups_size dd ?
last_fixup_base dd ?
last_fixup_header dd ?
parenthesis_stack dd ?
blocks_stack dd ?
parsed_lines dd ?
logical_value_parentheses dd ?
file_extension dd ?


operand_size db ?
size_override db ?
operand_prefix db ?
opcode_prefix db ?
rex_prefix db ?
vex_required db ?
vex_register db ?
immediate_size db ?


base_code db ?
extended_code db ?
supplemental_code db ?
postbyte_register db ?
segment_register db ?
xop_opcode_map db ?


mmx_size db ?
jump_type db ?
push_size db ?
value_size db ?
address_size db ?
label_size db ?
size_declared db ?


value_undefined db ?
value_constant db ?
value_type db ?
value_sign db ?
fp_sign db ?
fp_format db ?
address_sign db ?
compare_type db ?
logical_value_wrapping db ?
next_pass_needed db ?
output_format db ?
code_type db ?
adjustment_sign db ?


macro_status db ?
skip_default_argument_value db ?
prefixed_instruction db ?
formatter_symbols_allowed db ?
free_address_range db ?




characters rb 100h
converted rb 100h
message rb 200h

0 0
原创粉丝点击