|
chrise
初级用户
 
积分 88
发帖 32
注册 2010-3-27
状态 离线
|
『楼 主』:
汇编语言编译器使用2
使用 LLM 解释/回答一下
题目是把buff1中的数据传到buff2
源程序如下:
DSEG SEGMENT
buff1 db 0,1,2,3,4,5,6,7,8,9,
db 11,12,13,14,15,16,17,18,19,20
buff2 db 20 dup(?)
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
MAIN PROC FAR ;主程序入口
mov ax, dseg
mov ds, ax
mov ax,eseg
mov es, ax
mov cx,20
lea si,buff1
lea di,buff2
cycle:mov al,
mov ,al
inc si
inc di
loop cycle
mov ax, 4c00h ;程序结束,返回到操作系统系统
int 21h
MAIN ENDP
CSEG ENDS
END MAIN
编译后
出现如下错误
Unable to open input file: transformdata.asm高手指教一下
The title is to transfer the data in buff1 to buff2. The source program is as follows:
DSEG SEGMENT
buff1 db 0,1,2,3,4,5,6,7,8,9,
db 11,12,13,14,15,16,17,18,19,20
buff2 db 20 dup(?)
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
MAIN PROC FAR ;Main program entry
mov ax, dseg
mov ds, ax
mov ax,eseg
mov es, ax
mov cx,20
lea si,buff1
lea di,buff2
cycle:mov al,
mov ,al
inc si
inc di
loop cycle
mov ax, 4c00h ;Program ends, return to the operating system
int 21h
MAIN ENDP
CSEG ENDS
END MAIN
After compilation
The following error occurs
Unable to open input file: transformdata.asmExperts, please give guidance
|
|
2010-4-6 21:33 |
|
|
070
高级用户
    苏醒的沉睡者
积分 659
发帖 217
注册 2003-2-15 来自 福建
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
英文意思为,无法打开输入文件:transformdata.asm
The English means: Cannot open input file: transformdata.asm
|

好久没碰Dos,手都生了,赶紧回来练练.嘿嘿 |
|
2010-4-7 11:59 |
|
|
070
高级用户
    苏醒的沉睡者
积分 659
发帖 217
注册 2003-2-15 来自 福建
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
我用masm 5.0来编译了一下,提示是a.asm(2): warning A4101: Missing data; zero assumed
还有代码的第18行。。mov ax,eseg中的eseg在哪里?
I used MASM 5.0 to compile, and it prompted a.asm(2): warning A4101: Missing data; zero assumed
And where is eseg in the 18th line of the code.. mov ax,eseg?
|

好久没碰Dos,手都生了,赶紧回来练练.嘿嘿 |
|
2010-4-7 12:17 |
|
|
chrise
初级用户
 
积分 88
发帖 32
注册 2010-3-27
状态 离线
|
『第 4 楼』:
再请教一下
使用 LLM 解释/回答一下
buff1 db 0,1,2,3,4,5,6,7,8,9,
db 11,12,13,14,15,16,17,18,19,20
这种格式对吗?我这样写是因为书上是这样的,还有输表格的时候,书上也是这样写的,是不是一些版本的masm不支持啊?
Is this format correct? I wrote it like this because it's like that in the book, and when entering tables, it's also written like that in the book. Is it that some versions of MASM don't support it?
|
|
2010-4-7 20:56 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
如3楼所指错误有2,相应地,buff1行末的逗号去除,改eseg为dseg。
“无法打开输入文件:transformdata.asm”说明你的源程序文件名应该不是transformdata.asm,即将它重命名为transformdata.asm,即可。
As pointed out by building 3, there are 2 errors. Correspondingly, remove the comma at the end of line buff1 and change eseg to dseg. "Cannot open input file: transformdata.asm" indicates that the filename of your source program should not be transformdata.asm, that is, rename it to transformdata.asm, and it will be okay.
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2010-4-8 09:12 |
|
|
070
高级用户
    苏醒的沉睡者
积分 659
发帖 217
注册 2003-2-15 来自 福建
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
原来那个错误是末尾的 ,问题啊。。。。
这个没注意。。
The original error was at the end, the problem... I didn't notice this.
|

好久没碰Dos,手都生了,赶紧回来练练.嘿嘿 |
|
2010-4-8 12:12 |
|
|
chrise
初级用户
 
积分 88
发帖 32
注册 2010-3-27
状态 离线
|
|
2010-4-8 21:46 |
|
|
heikebx
新手上路

积分 10
发帖 5
注册 2010-4-14
状态 离线
|
|
2010-4-20 20:50 |
|
|
chrise
初级用户
 
积分 88
发帖 32
注册 2010-3-27
状态 离线
|
|
2010-4-24 22:02 |
|
|
070
高级用户
    苏醒的沉睡者
积分 659
发帖 217
注册 2003-2-15 来自 福建
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
chrise,最近怎么没有新问题啊。。。不大习惯了。。
chrise, why are there no new questions recently... I'm not used to it.
|

好久没碰Dos,手都生了,赶紧回来练练.嘿嘿 |
|
2010-4-25 11:27 |
|
|
netwinxp
高级用户
   
积分 741
发帖 366
注册 2007-7-25
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
酱紫写会不会好一点呢?而且改动下数据也不容易出问题。
DSEG SEGMENT
buff1 db 0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20
datalen equ $-buff1;要常用伪指令来使程序更容易修改。
buff2 db datalen dup(?)
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG,ds:DSEG
MAIN PROC FAR;主程序入口
mov ax,seg DSEG
mov ds,ax
mov es,ax
cld
mov si,offset buff1
mov di,offset buff2
mov cx,datalen
rep movsb;串COPY操作在软件中频繁使用,所以循环体越小越好。
mov ax,4c00h;程序结束,返回到操作系统系统
int 21h
MAIN ENDP
CSEG ENDS
END MAIN
Last edited by netwinxp on 2010-7-6 at 19:39 ]
Will it be better to write like this? Moreover, it is not easy to have problems when modifying the data.
DSEG SEGMENT
buff1 db 0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20
datalen equ $-buff1; It is better to use common pseudo-instructions to make the program easier to modify.
buff2 db datalen dup(?)
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG,ds:DSEG
MAIN PROC FAR; Main program entry
mov ax,seg DSEG
mov ds,ax
mov es,ax
cld
mov si,offset buff1
mov di,offset buff2
mov cx,datalen
rep movsb; String COPY operation is frequently used in software, so the smaller the loop body, the better.
mov ax,4c00h; Program ends and returns to the operating system
int 21h
MAIN ENDP
CSEG ENDS
END MAIN
Last edited by netwinxp on 2010-7-6 at 19:39 ]
|
|
2010-6-30 16:01 |
|
|