我正在尝试通过我拥有的.ASM文件生成一个完整的.COM(DOS应用程序)文件。但在生成文件时,我收到“未定义的符号错误”。以下是我得到的错误:
Undefined symbol 'RND_INIT' in module TPE-GEN.ASM
Undefined symbol 'RND_GET' in module TPE-GEN.ASM
Undefined symbol 'CRYPT' in module TPE-GEN.ASM
另外,我提供了我用来生成.COM文件的原始(.asm)文件。任何帮助将不胜感激。我不是汇编语言专家,因为我正在努力了解它。
;----------------------------------------------------------------------------
; TPE-GEN - This program generates 50 TPE encrypted test files
;
; This source can be compiled with MASM 5.0 or TASM 2.01
; (and perhaps others too, but this is not tested.)
;----------------------------------------------------------------------------
.model tiny
.RADIX 16
.code
extrn crypt:near ;external routines in engine
extrn rnd_get:near
extrn rnd_init:near
org 0100
begin: call rnd_init ;init. random number generator
mov dx,offset starttxt ;print message
mov ah,09
int 21
mov cx,50d ;repeat 50 times
lop: push cx
mov ah,3C ;create a new file
mov dx,offset filename
mov cx,0020
int 21
xchg ax,bx
push ds
push es
push bx
mov ax,cs ;input parameters for engine
mov ds,ax
add ax,0400
mov es,ax ;ES = DS + 400h
xor si,si ;code will be right after decr.
mov dx,offset hello ;this will be encrtypted
mov cx,100d ;length of code to encrypt
mov bp,0100 ;decryptor will start at 100h
call rnd_get ;AX register will be random
call crypt ;call the engine
pop bx ;write crypted file
mov ah,40
int 21
mov ah,3E ;close the file
int 21
pop es
pop ds
mov di,offset filename ;adjust name for next file
mov bx,7 ; (increment number)
incnum: inc byte ptr ds:[bx+di]
cmp byte ptr ds:[bx+di],'9'
jbe numok
mov byte ptr ds:[bx+di],'0'
dec bx
jnz incnum
numok: pop cx ;do it again...
loop lop
exit: int 20
;----------------------------------------------------------------------------
; Text and data
;----------------------------------------------------------------------------
starttxt db 'TPE-GEN - Generates 50 TPE encrypted test files.'
db 0Dh, 0Ah, '$'
filename db '00000000.COM',0
;----------------------------------------------------------------------------
; The small test file that will be encrypted
;----------------------------------------------------------------------------
hello: call next ;get relative offset
next: pop dx
add dx,10d ;find begin of message
mov ah,09 ;print message
int 21
int 20
db 'Hello, world!', 0Dh, 0A, '$'
db (100d) dup (90)
end begin
是否可以通过TLINK将目标文件(.obj)链接到另一个目标文件,如果是,可以怎么做?
@Jester:我提供了更多文件。请在下面找到相关链接(保管箱链接):
由于 Plasma33