FASM练习代码

 

;import 构建
;练习之作..

format  PE  GUI  
4.0
entry   _start

;
;data section..
;

section  
' .data'  data   readable

       lpCaption   db    
' test',0
       lpText      db      ' hello world',0

;
;code section
;

section   
' .code'  code  readable  executable

_start:
        
        push 40h
    push lpCaption
    push lpText
    push 0h
    
call  [MessageBox]
    push 0h
    
call  [ExitProcess]

;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

;
;import section
;

section  
' .import'  import  data readable writeable

     ;IMAGE_IMPORT_DESCRIPTOR

     dd 
0 0 0 , RVA user32_dll, RVA user_thunk
     dd 
0 0 0 , RVA kernel_dll, RVA kernel_thuk
     dd 
0 0 0 0 0
 
      ; DLL Name

     user32_dll      db  
' user32.dll',0
     kernel_dll      db   ' kernel32.dll',0
     
     ; THUNK DATA
     user_thunk:
     MessageBox      dd   RVA msg_byname
                     dd   
0
    
     kernel_thuk:
     ExitProcess     dd   RVA process_byname
                     dd   
0
 
     ;import_Byname 
     msg_byname      dw   
0
                     db   
' MessageBoxA',0

     process_byname  dw   
0
                     db   
' ExitProcess',0

     

 ;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
原作者网站http://www.xuyibo.org ,感谢徐艺波辛苦整理写出的该技术手册,为我等FASM学习者提供了良好的参考资料。目前FASM学习资料实在是无比匮乏,网上也鲜见。这个技术手册无疑是雪中送炭,再洗感谢原作者。 1. 简介 1.1 编译器概述 1.1.1 系统需求 1.1.2 编译器使用 1.1.3 编译器选项 1.1.4 在命令行下执行编译器 1.1.5 命令行编译器消息 1.1.6 输出格式 1.2 汇编语法 1.2.1 指令语法 1.2.2 数据定义 1.2.3 常数和标号 1.2.4 数值表达式 1.2.5 跳转和调用 1.2.6 操作数尺寸设置 2. 指令集 2.1 x86 体系指令 2.1.1 数据传送指令 2.1.2 类型转换指令 2.1.3 二进制算术指令 2.1.4 十进制算术指令 2.1.5 逻辑指令 2.1.6 控制转移指令 2.1.7 I/O 指令 2.1.8 字符串操作指令 2.1.9 标志控制指令 2.1.10 条件操作指令 2.1.11 其他指令 2.1.12 系统指令 2.1.13 FPU 指令 2.1.14 MMX 指令 2.1.15 SSE 指令 2.1.16 SSE2 指令 2.1.17 SSE3 指令 2.1.18 AMD 3DNOW!指令 2.1.19 x86-64长模式指令 2.2 控制伪指令 2.2.1 数值常量 2.2.2 条件汇编 2.2.3 重复块指令 2.2.4 地址空间 2.2.5 其他伪指令 2.2.6 多遍扫描 2.3 预处理伪指令 2.3.1 包含源文件 2.3.2 符号常量 2.3.3 宏指令 2.3.4 结构 2.3.5 重复宏指令 2.3.6 条件宏指令 2.3.7 处理顺序 2.4 格式伪指令 2.4.1 MZ 格式 2.4.2 PE 格式 2.4.3 COFF 格式 2.4.4 ELF 格式 3. Windows 编程 3.1 基本头文件 3.1.1 结构 3.1.2 导入表 3.1.3 过程 3.1.4 导出表 3.1.5 COM(组件) 3.1.6 资源 3.1.7 字符编码 3.2 扩展头文件 3.2.1 过程参数 3.2.2 结构化源码
FASMARM v1.42 This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. Version history _______________________________________________________________________________ 1. ARM assembly compatibility There are a few restrictions how the ARM instruction set is implemented. The changes are minor and mostly have a minor impact. For the most part the basic instruction outline is the same. Where possible the original style is used but there are some differences: Not everything matches the ARM ADS assembly style, where possible the original style is used but there are some differences 1) label names cannot begin with a digit 2) CPSIE and CPSID formats are changed, use "iflags_aif" form instead of "aif" (eg. "CPSIE iflags_i" instead of "CPSID i") 3) SRS with writeback must have a separating space after the mode number and before "!" (eg. "SRSDB 16 !" instead of "SRSDB 16!") 4) macro, rept, irp, format, if, virtual etc. are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- cpsie a | cpsie iflags_a | srsdb #29! | srsdb #29 ! ;or, | srsdb 29 ! _______________________________________________________________________________ 2. UAL and pre-UAL syntaxes fasmarm supports the original pre-UAL syntax and the newer UAL syntax. These two syntaxes only affect THUMB encodings. UAL stands for: Universal Assembly Language. pre-UAL syntax is selected wi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值