为什么我这个代码会出现五十几个错误。。请大神帮我看看程序什么问题
本帖最后由 雨の印记 于 2012-2-24 13:09 编辑贴出我的代码:
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov ax,0
mov es,ax
mov di,200H
mov si,offset do7ch
mov cx,offset do7chend-offset do7ch
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:,200H
mov word ptr es:,0
mov ax,4c00H
int 21H
do7ch:
push ax
push bx
push cx
push dx
push si
push es
mov si,0
;计算偏移地址
mov ax,0b800H
mov es,ax
dec dh
dec dl
add dl,dl
mov al,160
mul dh
mov dh,0
add ax,dx
;bx存储偏移地址
mov bx,ax
;字符串写入显示内存
mov ch,0
do7ch_s:
push cx
mov cl,
jcxz do7ch_ok
pop cx
mov al,
mov es:,al
mov es:,cl
inc si
add bx,2
jmp do7ch_s
do7ch_ok:
pop cx
pop es
pop si
pop dx
pop cx
pop bx
pop ax
iret
do7chend:
nop
code ends
end start
贴出一部分错误:
7ch-3.ASM(1): error A2009: Symbol not defined: CODE
7ch-3.ASM(2): error A2024: Segment parameters are changed
7ch-3.ASM(3): error A2086: Data emitted with no segment
7ch-3.ASM(4): error A2086: Data emitted with no segment
7ch-3.ASM(5): error A2086: Data emitted with no segment
7ch-3.ASM(6): error A2086: Data emitted with no segment
7ch-3.ASM(7): warning A4031: Operand types must match
7ch-3.ASM(8): warning A4031: Operand types must match
7ch-3.ASM(9): error A2086: Data emitted with no segment
7ch-3.ASM(10): error A2086: Data emitted with no segment
7ch-3.ASM(11): error A2086: Data emitted with no segment
7ch-3.ASM(12): error A2086: Data emitted with no segment
7ch-3.ASM(13): error A2086: Data emitted with no segment
7ch-3.ASM(14): error A2086: Data emitted with no segment
7ch-3.ASM(15): error A2086: Data emitted with no segment
7ch-3.ASM(16): error A2086: Data emitted with no segment
7ch-3.ASM(18): error A2024: Segment parameters are changed
编译链接时没有错误,由于部分命令我还没学,收藏起来,待后研究 风剑河 发表于 2012-2-22 14:19 static/image/common/back.gif
编译链接时没有错误,由于部分命令我还没学,收藏起来,待后研究
你编译连接没错误??!! 我编译错了五十几个额。。。郁闷 试试分开来,先masm然后再link,其中涉及到link和masm之间的联系的问题,某个帖中有位大哥解释了下,我忘了是具体怎么回事了,有了解的高手请帮忙解惑 风剑河 发表于 2012-2-22 17:17 static/image/common/back.gif
试试分开来,先masm然后再link,其中涉及到link和masm之间的联系的问题,某个帖中有位大哥解释了下,我忘了 ...
我就是先masm在link的,masm后就出现五十几个错误.. 本帖最后由 莫名其妙 于 2012-2-23 10:14 编辑
我是新手才看到第11章 后面的中断什么的还木有看!~
mov ax,cs这里不能用CS我这里错误是 1.asm(1) : error A2008:: cs
然后我加了个 datasegment
data ends
mov ax,data
编译通过了
根据你给的错误信息翻译是
7ch-3.ASM(1): error A2009: Symbol not defined: CODE未定义的象征:代码
7ch-3.ASM(2): error A2024: Segment parameters are changed 段参数变化
7ch-3.ASM(3): error A2086: Data emitted with no segment 没有数据发出区段 (是不是意思你要定一个data数据段 )
7ch-3.ASM(4): error A2086: Data emitted with no segment
7ch-3.ASM(5): error A2086: Data emitted with no segment
7ch-3.ASM(6): error A2086: Data emitted with no segment
7ch-3.ASM(7): warning A4031: Operand types must match操作数的类型必须匹配
7ch-3.ASM(8): warning A4031: Operand types must match操作数的类型必须匹配
7ch-3.ASM(9): error A2086: Data emitted with no segment 没有数据发出区段 (是不是意思你要定一个data数据段 )
7ch-3.ASM(10): error A2086: Data emitted with no segment
7ch-3.ASM(11): error A2086: Data emitted with no segment
7ch-3.ASM(12): error A2086: Data emitted with no segment
7ch-3.ASM(13): error A2086: Data emitted with no segment
7ch-3.ASM(14): error A2086: Data emitted with no segment
7ch-3.ASM(15): error A2086: Data emitted with no segment
7ch-3.ASM(16): error A2086: Data emitted with no segment
7ch-3.ASM(18): error A2024: Segment parameters are changed
7ch-3.ASM(2): error A2024: Segment parameters are changed
7ch-3.ASM(3): error A2086: Data emitted with no segment
7ch-3.ASM(4): error A2086: Data emitted with no segment
7ch-3.ASM(5): error A2086: Data emitted with no segment
7ch-3.ASM(6): error A2086: Data emitted with no segment
7ch-3.ASM(7): warning A4031: Operand types must match
7ch-3.ASM(8): warning A4031: Operand types must match
7ch-3.ASM(9): error A2086: Data emitted with no segment
7ch-3.ASM(10): error A2086: Data emitted with no segment
7ch-3.ASM(11): error A2086: Data emitted with no segment
7ch-3.ASM(12): error A2086: Data emitted with no segment
7ch-3.ASM(13): error A2086: Data emitted with no segment
7ch-3.ASM(14): error A2086: Data emitted with no segment
7ch-3.ASM(15): error A2086: Data emitted with no segment
7ch-3.ASM(16): error A2086: Data emitted with no segment
7ch-3.ASM(18): error A2024: Segment parameters are changed
莫名其妙 发表于 2012-2-23 09:01 static/image/common/back.gif
我是新手才看到第11章 后面的中断什么的还木有看!~
mov ax,cs这里不能用CS我这里错误是 1.asm(1) :...
虽然你说的不是很对,但还是要谢谢你哈 雨の印记 发表于 2012-2-24 13:05 static/image/common/back.gif
虽然你说的不是很对,但还是要谢谢你哈
共同学习共同进步 写的很不错,谢谢分享 写的很不错,谢谢分享 试试分开来,先masm然后再link
页:
[1]