3rd Chapter Assembly Language Foundation

Source: Internet
Author: User

Tag: Requires not symbol to indicate tag Identifier assembly language program DUP

Https://files.cnblogs.com/files/student-note/MASM615.zip

Integer constants:
Format [{+/-}] number [cardinality]
Common cardinality suffixes
H: Hex D: decimal B: Binary q/o: Octal r: Encoded real number

Hex If the letter is opened with a 0 plus, to prevent the compiler as an identifier

Priority level: ()->+-(one dollar)->*/->mod->+-

instruction format [: designator] Instruction mnemonic | operand [; note]
Label:
An identifier that acts as an instruction or data location tag
Data Label:
Count DWORD 100
Comment Syntax:
Single use;
Multi-line user-defined symbol content user-defined symbol with COMMENT
TITLE program Template (TEMPLATE.ASM)
; Description of the program:
Author
; creation Time:
Modify
; Date: Modified by:
INCLUDE irvine32.inc; Import header file
. Data
;(Insert variable here)
. Code
Main proc
;(Insert Code)
Exit
Main ENDP
;(insert another subroutine here)
End Main

--common compiler statements use masm615
ML/C/coff 1.asm
Link32/subsystem:console irvine32.lib Kernel32.lib 1.obj

Data definition syntax
[Variable name] data type pseudo-instruction initial value [, initial value]
The initial value is replaced by, indicating that the value can be dynamically assigned using the execution instruction.
Defining strings
Greeting1 byte "Good Afternoon", 0
Greeting2 byte ' Good Night ', 0
the continuation character (\) is used to concatenate two lines into a single program statement, which can only be placed on the last side of each line
GREETING1 \
Byte "Good Afternoon", 0
The DUP operator uses a constant expression as a counter to allocate storage space for multiple data items:
BYTE 3 DUP ("XXX") 9 bytes

. Data? Pseudo-directives can be used to declare uninitialized data
Code data can be switched casually, can be used for local variables
eg
. Code
MOV ax,3900h
. Data
Val Word 1
. Code
MOV ax,val
Symbolic constants: syntax name = expression
Count=1
MOV Ax,count
Redefine:
COUNT =5
MOV al,count;5
count=10
MOV al,count;10

To calculate the size of an array and a string:
eg
List byte 10,20,39
Listsize= ($-list); $ represents the current address
EQU pseudo-directive
Grammar:
Name EQU expression
Name equ symbol
Name Equ <text>

3rd Chapter Assembly Language Foundation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.