asmsupt.lst
来自「DOS SOURCE CODE,DOS-C started in 1988 as」· LST 代码 · 共 200 行
LST
200 行
Turbo Assembler Version 3.1 04/11/13 12:54:49 Page 1
ASMSUPT.ASM
1 ; File:
2 ; asmsupt.asm
3 ; Description:
4 ; Assembly support routines for miscellaneous functions
5 ;
6 ; Copyright (c) 1995
7 ; Pasquale J. Villani
8 ; All Rights Reserved
9 ;
10 ; This file is part of DOS-C.
11 ;
12 ; DOS-C is free software; you can redistribute it and/or
13 ; modify it under the terms of the GNU General Public License
14 ; as published by the Free Software Foundation; either version
15 ; 2, or (at your option) any later version.
16 ;
17 ; DOS-C is distributed in the hope that it will be useful, but
18 ; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
20 ; the GNU General Public License for more details.
21 ;
22 ; You should have received a copy of the GNU General Public
23 ; License along with DOS-C; see the file COPYING. If not,
24 ; write to the Free Software Foundation, 675 Mass Ave,
25 ; Cambridge, MA 02139, USA.
26 ;
27 ; $Logfile: C:/dos-c/src/kernel/asmsupt.asv $
28 ;
29 ; $Header: C:/dos-c/src/kernel/asmsupt.asv 1.3 03 Jan 1998 8:36:44 patv $
30 ;
31 ; $Log: C:/dos-c/src/kernel/asmsupt.asv $
32 ;
33 ; Rev 1.3 03 Jan 1998 8:36:44 patv
34 ; Converted data area to SDA format
35 ;
36 ; Rev 1.2 29 May 1996 21:03:38 patv
37 ; bug fixes for v0.91a
38 ;
39 ; Rev 1.1 01 Sep 1995 17:54:26 patv
40 ; First GPL release.
41 ;
42 ; Rev 1.0 05 Jul 1995 11:38:42 patv
43 ; Initial revision.
44 ;
45
46
47 0000 _TEXT segment byte public 'CODE'
48 DGROUP group _DATA,_BSS,_BSSEND ; small model
49 assume cs:_TEXT,ds:DGROUP,ss:DGROUP
50 0000 _TEXT ends
51
52 0000 _DATA segment word public 'DATA'
53 0000 _DATA ends
54
55 0000 _BSS segment word public 'BSS'
Turbo Assembler Version 3.1 04/11/13 12:54:49 Page 2
ASMSUPT.ASM
56 0000 _BSS ends
57
58 0000 _BSSEND segment byte public 'STACK'
59 0000 _BSSEND ends
60
61
62
63 0000 _TEXT segment byte public 'CODE'
64 ;
65 ; VOID bcopy(s, d, n)
66 ; REG BYTE *s, *d;
67 ; REG COUNT n;
68 ;
69 ;
70 assume cs:_TEXT
71 public _bcopy
72 0000 _bcopy proc near
73 0000 55 push bp ; Standard C entry
74 0001 8B EC mov bp,sp
75 0003 56 push si
76 0004 57 push di
77 0005 06 push es
78
79 ; Get the repitition count, n
80 0006 8B 4E 08 mov cx,[bp+8]
81 0009 0B C9 or cx,cx
82 000B 74 0D jz short bcopy_exit
83
84 ; Set both ds and es to same segment (for near copy)
85 000D 8C D8 mov ax,ds
86 000F 8E C0 mov es,ax
87
88 ; Get the source pointer, ss
89 0011 8B 76 04 mov si,[bp+4]
90
91 ; and the destination pointer, d
92 0014 8B 7E 06 mov di,[bp+6]
93
94 ; Set direction to autoincrement
95 0017 FC cld
96
97 ; And do the built-in byte copy
98 0018 F3> A4 rep movsb
99
100 ; Finally do a C exit to return
101 001A 07 bcopy_exit: pop es
102 001B 5F pop di
103 001C 5E pop si
104 001D 5D pop bp
105 001E C3 ret
106 001F _bcopy endp
107
108
109 ;
110 ; VOID fbcopy(s, d, n)
Turbo Assembler Version 3.1 04/11/13 12:54:49 Page 3
ASMSUPT.ASM
111 ;
112 ; REG VOID FAR *s, FAR *d;
113 ; REG COUNT n;
114 assume cs:_TEXT
115 public _fbcopy
116 001F _fbcopy proc near
117 001F 55 push bp ; Standard C entry
118 0020 8B EC mov bp,sp
119 0022 56 push si
120 0023 57 push di
121
122 ; Save ds, since we won't necessarily be within our
123 ; small/tiny environment
124 0024 1E push ds
125 0025 06 push es
126
127 ; Get the repititon count, n
128 0026 8B 4E 0C mov cx,[bp+12]
129 0029 0B C9 or cx,cx
130 002B 74 09 jz short fbcopy_exit
131
132 ; Get the far source pointer, s
133 002D C5 76 04 lds si,DWORD PTR [bp+4]
134
135 ; Get the far destination pointer d
136 0030 C4 7E 08 les di,DWORD PTR [bp+8]
137
138 ; Set direction to autoincrement
139 0033 FC cld
140
141 ; And do the built-in byte copy
142 0034 F3> A4 rep movsb
143
144 ; recover ds
145 0036 07 fbcopy_exit: pop es
146 0037 1F pop ds
147
148 ; Do a standard C exit and return
149 0038 5F pop di
150 0039 5E pop si
151 003A 5D pop bp
152 003B C3 ret
153 003C _fbcopy endp
154 003C _TEXT ENDS
155 end
Turbo Assembler Version 3.1 04/11/13 12:54:49 Page 4
Symbol Table
Symbol Name Type Value
??DATE Text "04/11/13"
??FILENAME Text "ASMSUPT "
??TIME Text "12:54:49"
??VERSION Number 030A
@CPU Text 0101H
@CURSEG Text _TEXT
@FILENAME Text ASMSUPT
@WORDSIZE Text 2
BCOPY_EXIT Near _TEXT:001A
FBCOPY_EXIT Near _TEXT:0036
STANDALONE Text 1
_BCOPY (_bcopy) Near _TEXT:0000
_FBCOPY (_fbcopy) Near _TEXT:001F
Groups & Segments Bit Size Align Combine Class
DGROUP Group
_BSS 16 0000 Word Public BSS
_BSSEND 16 0000 Byte Public STACK
_DATA 16 0000 Word Public DATA
_TEXT 16 003C Byte Public CODE
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?