注册 登录
编程论坛 汇编论坛

总是报错 未定义,求指教。

小洛dai 发布于 2012-01-04 17:35, 575 次点击
总是会出现未定义的错误
stack           segment
                db      256 dup(?)
stack           ends
code            segment
move_face       proc    far
                assume  cs:code,ss:stack
start:          push    ds
                sub     ax,ax
                push    ax
                mov     ah,15
                int     10h
                mov     ah,0
                mov     al,1
                int     10h
                mov     cx,1
                mov     dx,0
                sti
move_cursor:    mov     ah,2
                int     10h
                mov     al,1
                mov     ah,10
                int     10h
                call    delay
                sub     al,al
                mov     ah,10
                int     10h
                inc     dh
                inc     dl
                cmp     dh,25h
                jne     move_cursor
                ret
move_face       endp
delay           proc
                push    bx
                push    cx
                push    dx
                mov     ah,0
                int     1ah
                add     dx,9
                mov     bx,dx
redo:           int     1ah
                cmp     dx,bx
                jne     redo
                pop     dx
                pop     cx
                pop     bx
                ret
delay           endp
code            ends
                end     start
2 回复
#2
zaixuexi2012-01-05 13:29
程序代码:
stack           segment
                db      256 dup(?)      ;uint16_t task_stack[128];
stack           ends
code            segment
move_face       proc    far
                assume  cs:code,ss:stack
start:         
        push    ds
                sub     ax,ax
                push    ax
                mov     ah,15
                int     10h             ;uint8_t mode = get_videomode();/*pseudo-code*/
                mov     ah,0
                mov     al,1
                int     10h             ;set_videomode(MODE1);#define MODE1 (1)/*pseudo-code*/
                mov     cx,1
                mov     dx,0            ;uint8_t row = 0; uint8_t col = 0;
                sti                     ;enable_interrupt();
move_cursor:
        mov     ah,2
                int     10h             ;set_cursor(row, col);
                mov     al,1
                mov     ah,10           ;putchar(0x01);
                int     10h
                call    delay           ;delay();
                sub     al,al
                mov     ah,10
                int     10h             ;putchar(0x00);
                inc     dh
                inc     dl              ;row++;col++;
                cmp     dh,25h
                jne     move_cursor     ;if (row != 0x25) goto move_cursor;
                ret
move_face       endp
delay           proc
                push    bx
                push    cx
                push    dx
                mov     ah,0
                int     1ah             ;uint32_t _t = getsystick();
                add     dx,9
                mov     bx,dx           ;uint16_t low_t = LODWORD(_t) + 9;
redo:         
                int     1ah             ;_t = getsystick();
                cmp     dx,bx
                jne     redo            ;if (low_t != LODWORD(_t)) goto redo;
                pop     dx
                pop     cx
                pop     bx
                ret
delay           endp
code            ends
                end     start
#3
zaixuexi2012-01-05 13:30
没出现你所描述的问题
1