Detailed resident EXE file

Source: Internet
Author: User
Tags anonymous relative touch

Run relocation EXE file, reposition factor scheduling overlay module, linker 3 static cover block, analysis stack initial startup

(1) X86 assembly language group, paragraph, class

Pseudo-directive Group/segment, defines the group/segment, which makes:

(1.1) Each segment of the same group, in the same 64k space

(1.2) Paragraph may declare ' alignment, combination, class ' optional attribute:

(1.2.1) The first paragraph, can be aligned to Byte,word,para (16 bytes), PAGE (256 bytes), the default alignment to PARA.

(1.2.2) different sources of the same name similar paragraphs, want to rely on the link to form a space adjacency or overlapping of the same name combinatorial logic

Paragraph, the public,common is required to indicate the combination form:

(1.2.2.1) Public, indicating that this segment is aligned, and that the neighbor is after the last literal paragraph already contained within this combined logical segment

(1.2.2.2) COMMON, indicating that this segment and other literal segments of this combined logical segment are spread from the first of the combined logical segments

The maximum alignment attribute for each participating segment of the combined logical segment (for example, Word is larger than byte) determines the alignment property of the combined logical segment.

A segment that is not combined with another segment is called a single logical segment.

The following, using "logical segment", collectively referred to as combinational logical segments and single logical segments.

(1.3) Classes are specified in the ' CLS ' and unspecified paragraphs of the class are ' anonymous '. Similar paragraphs, adjacent arrangement.

(2) Explanation of the 3 source texts of the spatial relations of each logical segment

A1.asm, declared 1 groups, 4 segments, involving ' anonymous ', ' Dec_ ' class

GRP Group (2.1), containing SEG1 segments

(2.2) SEG1 segment

(2.3) Ovlap segment, with common participation, ' Dec_ ' class

(2.4) Touch segment, with public participation combination

(2.5) Stk1 paragraph, using stack to indicate stack segment and para alignment

GRP GROUP SEG1
SEG1 SEGMENT PAGE
STR1 DB "s1$"
SEG1 ENDS
Ovlap SEGMENT PARA COMMON ' dec_ '
STR3 DB ' 11$ '
Ovlap ENDS
Touch SEGMENT Public
Assume cs:touch,ds:nothing
ORG 11H
@: mov ah,9
MOV bx,grp;
MOV ds,bx
mov dx,offset str1; str1 relative SEG1 bias
int 21h
EXTRN Str2:far
mov dx,offset grp:str2; str2 relative to GRP bias
int 21h
Assume Ds:ovlap
mov bx,seg str3; STR3 segment Value
MOV ds,bx
Lea DX,STR3; str3 relative to DS offset
int 21h
Touch ENDS
Stk1 SEGMENT PAGE STACK
DW 16H DUP (4AH); Initial value 4AH 16H Word
Stk1 ENDS
End @
A2.asm, declared 1 groups, 3 segments, involving ' anonymous ', ' dec_ ', ' _STK ' Category:

(2.6) Ovlap segment, with common participation, ' Dec_ ' class

(2.7) Stk2 paragraph, using stack to indicate stack segment and para alignment, ' _stk ' class

GRP Group (2.8), containing SEG3 segments

(2.9) Seg3 section, ' Dec_ ' class

Ovlap SEGMENT COMMON ' dec_ '
DB ' 2 '
Ovlap ENDS
STK2 SEGMENT WORD STACK ' _STK '
DW 13H DUP (2BH); Initial value 2BH 13H Word
STK2 ENDS
GRP GROUP SEG3
Seg3 SEGMENT ' dec_ '
Public STR3
STR3 DB ' 33$ '
Seg3 ENDS
End

A3.asm, declared 1 groups, 4 segments, involving ' anonymous ', ' _STK ' Category:

GRP Group (2.10), containing SEG2 segments

(2.11) touch segment, with public participation combination

(2.12) SEG2 segment

(2.13) stk2 paragraph, using stack to indicate stack segment and para alignment, ' _stk ' class

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.