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