首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 汇编语言 >

一个关于orgw,该怎么解决

2013-01-05 
一个关于orgwassume cs:codesgcodesg segmentmov ax,csmov ds,axmov si,offset int7chmov ax,0mov es,axmo

一个关于orgw
assume cs:codesg
codesg segment
mov ax,cs
mov ds,ax
mov si,offset int7ch
mov ax,0
mov es,ax
mov di,200h
mov cx,offset int7chend-offset int7ch
cld
rep movsb
mov word ptr es:[7ch*4],200h
mov word ptr es:[7ch*4+2],0
mov ah,2
mov al,3
int 7ch
mov ah,4ch
int 21h

org 200h                ;我对org不是很理解,前面的代码中不是把下面的代码复制到0:200处了吗,为什么还要                
                         ;加一个org 200h
int7ch:
jmp short set
table dw qingping,qjs,bjs,sgyh
set:
push bx
cmp ah,3
ja sret
mov bl,ah
mov bh,0
add bx,bx
call word ptr table[bx]
sret:
pop bx
iret
.....后面还有几段子程序
[解决办法]
如果没有 org200h 语句,你看下最后的复制到 0:200 初代码中 call word ptr table[bx] 成了什么,和有 org200h 语句的对比下,看到区别了没?org 语句就是保证后续的内容和运行时在内存中的偏址一致,以保证对其中标号的直接引用的地址的正确。

热点排行