当前位置:网站首页>Basic knowledge of assembly language

Basic knowledge of assembly language

2022-07-06 17:02:00 My71

Link to the original text —— SevenOne’Blog

Edit program steps

  1. Edit the source program , extension .asm
  2. assembly : Turn the source program file into the target file , Target file extension .obj
  3. Connect : Turn the target file into an executable , Executable extension .exe

Instructions

  1. mount

    mount  Target drive letter   Local drive letter 
    
  2. Clear the screen :cls

  3. Delete file :del file name

  4. see file :type file name

  5. Assembly instruction :masm file name

  6. Connection instructions :link file name

Programming

Create source program

  1. Instructions edit

  2. grammar

    edit  file name .asm
    
  3. If the file already exists, open the file to continue writing , If it does not exist, a new file will be created .

Segment definition

  1. Instructions :segment( Start ) ends( end )

  2. Paragraph name : No more than eight characters

  3. grammar

     Paragraph name  segment
    
     Paragraph name  ends
    

Segment Association

  1. Instructions :assume

  2. type :CS( Code segment )、DS( Data segment )、SS( stack segment )、ES( Additional segment )

  3. grammar :

    assume  type : Paragraph name 
    
  4. example : Define a code snippet , Segment name code

    code segment
    	assume cs:code
    code ends
    

Store value

  1. Instructions :mov

  2. General registers :AX、BX、CX、DX

  3. grammar mo

    mov  General registers , value 
    
    • General registers : Destination operands
    • value : Source operands

End procedure

mov ah,4ch
int 21h

Instruction classification

  1. Double operand instruction : Separate the two parameters with commas , The one before the comma is called the destination operand , The one after the comma is called the original operand .
  2. Single operand instruction
  3. No operand instruction
  4. In all double operand instructions , The destination operand and source operand types must match .
  5. 8086 There must be registers in the instruction , In addition to immediate addressing .

debug Instructions

  1. sign out :q
  2. see CPU register :r
  3. Disassembly instruction :u
  4. Execute program instructions :g(g offset )
  5. View memory bill :d
原网站

版权声明
本文为[My71]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060922438948.html