一个简单的汇编程序,怎么总是报错?
assume cs:code,ss:stack,ds:datadata segment db 0,2,4,7,8,9 db '// :: 'data endsstack segment db 0,0,0,0,0,0,0,0,0,0,0,0stack endscode segmentstart: mov ax,stack mov ss,ax mov sp,0ch mov ax,data mov ds,ax mov si,0 mov cx,6 mov ah,0 s1:mov al,[si] ;取时间函数 out 70h,al in al,71h push ax inc si ;debug 调试到si==3时就出问题了,提示NIVDM CPU遇到无效的指令,将push ax指令注释掉则正常 loop s1 mov bp,sp ;sp = 0 call charToAscii ;显示 mov ax,0b800h mov es,ax mov ax,ss mov ds,ax mov si,0 mov di,0a0h*12+4*2 mov cx,12 rep movsb mov ax,4c00h int 21h charToAscii: push bp push cx s2:mov ah,0 mov bh,0 mov al,ss:[bp+1] add al,30h mov cl,4 shr byte ptr ss:[bp+1],cl mov bl,ss:[bp+1] add bl,30h mov ss:[bp],ax mov ss:[bp+1],bx add bp,2 pop cx loop s2 ret code endsend start