Assembly 相对跳转超出范围0020h字节

Assembly 相对跳转超出范围0020h字节,assembly,dos,tasm,x86-16,Assembly,Dos,Tasm,X86 16,我一直在尝试为“shell”编写一个基本的com文件。 我能够在NASM中组装相同的代码,只需稍加修改 但是,此代码不会在TASM中汇编! 我会遇到这样的错误:相对跳出范围 我在谷歌上查了一下,想了解一下跳跃的情况。然而,我找不到太多,除了把这个跳跃分成相对较短的跳跃的想法。 有没有更整洁的选择 代码如下: .model tiny CR equ 13d LF equ 10d TAB equ 09d .data prompt db CR,LF,"Input : ",0 tab_

我一直在尝试为“shell”编写一个基本的com文件。 我能够在NASM中组装相同的代码,只需稍加修改

但是,此代码不会在TASM中汇编! 我会遇到这样的错误:相对跳出范围 我在谷歌上查了一下,想了解一下跳跃的情况。然而,我找不到太多,除了把这个跳跃分成相对较短的跳跃的想法。 有没有更整洁的选择

代码如下:

.model tiny

CR  equ 13d
LF  equ 10d
TAB equ 09d

.data

prompt      db CR,LF,"Input : ",0
tab_max     db 7 dup('_'),0
input       db 128 dup(0)   ; Input Buffer Of 80 Bytes
str_ver     db CR,LF,CR,LF,CR,"        ",\
           "Version : 1.0",CR,LF,0
str_help    db CR,LF,CR,LF,CR,"        ",\
           "Type VER For Version !!!",\
           CR,LF,CR,"        ",\
           "Type CLS To Clear Screen !!!",\
           CR,LF,CR,"        ",\
           "Type HELP To Display This Message !!!",\
           CR,LF,0
str_welcome db "Welcome To My Operating System !!!",0
str_default db CR,LF,CR,LF,CR,"        ",\
           "Invalid Command !!!",\
           CR,LF,CR,"        ",\
           "Type HELP To Display Help !!!",\
           CR,LF,0
cmd_ver     db "VER",0
cmd_help    db "HELP",0
cmd_cls     db "CLS",0

.code

org 100h

main proc near
xor ax,ax       ; Select Video Mode Function
mov al, 03h     ; Select 80x25 (8 Pages) Text Mode
int 10h     ; Call  Interrupt
mov dh, 0h      ; Row
mov dl, 0h      ; Column
call    goto_xy
mov cx, 30h
lea si, [str_welcome]
call    put_str

Begin0:
    lea     si, [prompt]        ; Display Prompt
    mov cx, 0ah         ; Max Length=10
    call    put_str
    call    beep
    lea     si, [input]
    call    null_str        ; Recycle The Input Buffer
    mov cx, 60h         ; Max Length=64
    call    get_str         ; Read User Input
    call    del_whitespace      ; Do Away With Leading And Trailing Space Characters
    call    str_to_upper        ; Convert To Uppercase
    call    chk_internal        ; Cross-Check In Internal Commands
    jmp Begin0          ; Loop Forever
endp

null_str proc near
    push    si      ; Save SI
    push    cx      ; Save CX
    push    ax      ; Save AX
    xor ax, ax
    call    str_len     ; Move Length Of String In CX
.more0:
    cmp cx, 0       ; Is It Zero-Length ?
    jz  .finish0    ; If So Do Away With
    mov [si], ax    ; Null A Character In Input Buffer
    dec cx      ; Decrement Counter
    inc si      ; Advance SI
    jmp .more0      ; Loop On Until First 0
.finish0:
    pop ax      ; Retrieve AX
    pop cx      ; Retrieve BX
    pop si      ; Retrieve SI
    ret         ; Return
endp

del_whitespace proc near
    push    si      ; Save SI
    push    di      ; Save DI
    push    dx      ; Save DX
    push    cx      ; Save CX
    push    bx      ; Save BX
    push    ax      ; Save AX
    xor ax, ax
    xor bx, bx
    xor cx, cx
    xor dx, dx
    mov di, si
    dec si      ; SI=SI-1
.loop00:
    inc si      ; Go On Incrementing Source String Index
    xor dx, dx
    mov dx, [si]
    xor dh, dh
    cmp dl, 00h     ; Is String Finished ?
    jz  .chomp00
    cmp dl, 20h     ; Is It A Space
    jz  .loop00     ; Go On Eating Spaces
    cmp dl, TAB     ; Is It A TAB
    jz  .loop00     ; Go On Eating TABS
    push    si      ; First Non-Whitespace Character Index In String
    inc cx      ; Number Of Tokens In String
.loop01:
    inc si      ; Increment SI
    mov dx, [si]
    xor dh, dh
    cmp dx, 00h     ; Is String Finished ?
    jz  .chomp00    ; Cut Out Useful Part
    cmp dx, 20h     ; Check For Space
    jz  .loop00
    cmp dx, TAB     ; Check For TAB
    jnz .loop01     ; Read On Until Next TAB
    jz  .loop00
.chomp00:
    cmp cx, 00h     ; Null Input
    jz  .over01     ; Return Then
    dec cx      ; Otherwise Decrement Number Of Tokens
    pop si      ; Start Of Finishing Token
    mov ax, si      ; Save It, Just In Case It Becomes Also The Start Of The First Token
.bypass:
    inc si      ; Increment String Index
    mov dx, [si]
    xor dh, dh
    cmp dx, 00h     ; Has String Ended?
    jz  .loop002
    cmp dx, 20h
    jz  .loop002
    cmp dx, TAB
    jnz .bypass     ; Bypass All Characters In Token Until First Whitespace
.loop002:
    mov bx, si      ; Found End
    cmp cx, 00h     ; Is There Only One Token?
    jz  .inst00     ; Then Start Of Finishing Token=Start Of Opening Token
.loop02:
    dec cx
    pop ax      ; Move Start Of Previous Token In AX
    cmp cx, 00h     ; All Tokens Finished?
    jz  .inst00
    jnz .loop02     ; Loop Over
.inst00:
    mov si, ax      ; Set SI To Start
.loop03:
    cmp si, bx      ; All Characters In Token Processed ?
    jz  .over00     ; Done, Return
    mov dx, [si]
    mov [di], dx    ; Otherwise Overwrite Input String
    inc si      ; Increment User Token Input Index
    inc di      ; Increment Processed Token Input Index
    jmp .loop03     ; Loop Over

.over00:
    xor dx, dx
    mov [di], dx    ; NULL-Terminate Processed Token
.over01:
    pop ax      ; Retrieve AX
    pop bx      ; Retrieve BX
    pop cx      ; Retrieve CX
    pop dx      ; Retrieve DX
    pop di      ; Retrieve DI
    pop si      ; Retrieve SI
    ret         ; Return
endp

clr_scr proc near
push    ax      ; Save AX
push    bx      ; Save BX
push    cx      ; Save CX
push    dx      ; Save DX
xor dx, dx      ; Cursor At Top-Left
call    goto_xy
mov ah, 6       ; Scroll Up Whole Screen
mov al, 0       ; Text Color : White
mov bh, 7       ; Background : Black
xor cx, cx      ; Top-left
mov dh, 24      ; Bottom-Most
mov dl, 79      ; Right-Most
int 10h
pop dx      ; Retrieve DX
pop cx      ; Retrieve CX
pop bx      ; Retrieve BX
pop ax      ; Retrieve AX
ret
endp

chk_internal proc near
    push    si          ; Save SI       
    push    cx          ; Save CX
cmd_ver_lb:
    lea di, [cmd_ver]       ; VER Command
    call    cmp_str         ; Compare User Input
    jnc .do_ver         ; Execute Command If Matched
cmd_help_lb:
    lea di, [cmd_help]      ; HELP Command
    call    cmp_str         ; Compare User Input
    jnc .do_help        ; Execute Command If Matched
cmd_cls_lb:
    lea di, [cmd_cls]       ; CLS Command
    call    cmp_str         ; Compare User Input
    jnc .do_cls         ; Execute Command If Matched
default_lb:
    lea si, [str_default]   ; Default Error Message
    mov cx, 60h         ; Max Length 60Hex Characters
    call    put_str
    jmp .clean0         ; Return
.do_ver:
    lea si, [str_ver]       ; String For VER
    mov cx, 40h         ; Max Length 40Hex Characters
    call    put_str
    jmp .clean0         ; Return
.do_help:
    lea si, [str_help]      ; String For HELP
    mov cx, 80h         ; Max Length 80Hex Characters
    call    put_str
    jmp .clean0         ; Return
.do_cls:
    call    clr_scr         ; Call Clear Screen Function
    jmp .clean0         ; Return
.clean0:
    pop cx          ; Retrieve CX
    pop si          ; Retrieve SI
    ret             ; Return
endp

get_xy proc near
push    ax      ; Save AX
xor ax, ax
mov ah, 03h     ; Select Put Cursor Function
int 10h     ; Call Interrupt
pop ax      ; Retrieve AX
ret
endp

goto_xy proc near
push    ax      ; Save AX
push    bx      ; Save BX
push    cx      ; Save CX
push    dx      ; Save DX
xor ax, ax
xor cx, cx
mov ah, 02h     ; Select Put Cursor Function
mov bh, 00h     ; Select Page (0-7)
int 10h     ; Call Interrupt
pop dx      ; Retrieve DX
pop cx      ; Retrieve CX
pop bx      ; Retrieve BX
pop ax      ; Retrieve AX
ret
endp

cmp_str proc near

    push    si              ; Save SI
    push    di              ; Save DI
    push    ax              ; Save AX
    push    bx              ; Save BX
    push    cx              ; Save CX
    clc                 ; Default : Clear Carry
    call    str_len             ; String Length Of SI
    mov ax, cx              ; Copy String-Length Of SI In AX
    push    si              ; Save SI
    mov bx, di
    mov si, bx              ; Move DI to SI
    call    str_len             ; String Length Of DI
    mov bx, cx              ; Copy String-Length Of DI In BX
    pop si              ; Retrieve Back SI
    cmp ax, bx              ; Check If String Lengths Are Equal
    jnz .nosame             ; Not Same
    Loop0:
        mov al, [si]    ; Load Next Character From SI to AL
        mov bl, [di]    ; Load Next Character From DI to BL
        cmp al, bl      ; Compare Two Characters
        jnz .nosame     ; Not Same
        or  al, al      ; Check If AL=0
        jz  Loop0Done   ; AL=0? Then Return
        inc si      ; Increment SI
        inc di      ; Increment DI
        jmp Loop0
    .nosame :
        stc         ; Set Carry Flag
    Loop0Done:
        pop cx      ; Retrieve CX
        pop bx      ; Retrieve BX
        pop ax      ; Retrieve AX
        pop di      ; Retrieve DI
        pop si      ; Retrieve SI
        ret
endp


put_str proc near

    push    si          ; Save SI
    push    ax          ; Save AX
    push    cx          ; Save CX
    Print:
        cmp cx, 0h      ; Check If CX=0
        jz  PrintDone   ; Don't Bother Printing Further
        lodsb           ; Load Next Character From SI to AL
        or  al, al      ; Check If AL=0
        jz  PrintDone   ; AL=0? Then Return
        call    put_chr     ; Else Go On To Print Character
        dec cx      ; Decrement Counter
        jmp Print
    PrintDone:
        pop cx      ; Retrieve CX
        pop ax      ; Retrieve AX
        pop si      ; Retrieve SI
        ret
endp

put_chr proc near

        push    ax      ; Save AX
        cmp al, TAB     ; Check For Tab Character
        jnz no_tab      ; Skip Tab Processing
        push    si
        lea si, [tab_max]   ; Tab String Of Spaces (7)
        push    cx
        mov cx, 07d
        call    put_str     ; Print Out Tab Characters
        pop cx
        pop si
        jmp key_tab     ; Don't Print ASCII 09d (TAB)
    no_tab:
        mov ah, 0eh     ; Select Print Character Function
        int 10h     ; Print Character
    key_tab:
        pop ax      ; Retrieve AX
        ret
endp

get_ch proc near

    ReadLoop1:
        mov     ah, 0       ; Read Key Opcode
                int     16h
                cmp     al, 0       ; ALT, SHIFT, CTRL etc
                jz      ReadLoop1       ;If so, don't echo this keystroke
                ;call   put_chr
        ret
endp

get_chr proc near

    ReadLoop2:
        mov     ah, 0       ; Read Key Opcode
                int     16h
                cmp     al, 0       ; ALT, SHIFT, CTRL etc
                jz      ReadLoop2       ; If So, Don't Echo This Keystroke
                call    put_chr     ; Echo Character
        ret
endp

get_str proc near

        push    si          ; Save SI
        push    ax          ; Save AX
        push    bx          ; Save BX
        push    cx          ; Save CX
        mov bx, si          ; Copy Initial Address
    Count0:
        call    get_ch
        cmp al, 08d
        jz  .bksp
        cmp al, 13d
        jz  Count0Done
        cmp cx, 0h
        jz  Count0
        jmp .next
    .bksp:
        cmp bx, si          ; Is It The First Key ?
        jz  Count0          ; Go Back Then

        push    ax          ; Save AX
        dec si          ; Reduce One Character
        inc cx          ; Free Up Deleted Character
        cmp [si], TAB       ; Is It A TAB ?
        jz  .is_tab

        push    bx
        push    cx
        push    dx
        xor bx, bx          ; Select Video Page 0
        call    get_xy          ; Read Cursor Position In DX
        cmp dl, 0h          ; Is It The First Column ?
        jz  .f_col00
        mov al, 08h         ; Print Backspace
        call    put_chr
        mov al, 20h         ; Print Space
        call    put_chr
        mov al, 08h         ; Print Backspace
        call    put_chr
        jmp .n_col00
    .f_col00:
        dec dh          ; Go To Previous Line
                        ; Assumes DH>0
        mov dl, 79d         ; Max Numbers Of Columns
        call    goto_xy         ; Place Cursor
        mov al, 20h         ; Print Space
        call    put_chr
        mov dl, 79d         ; Max Numbers Of Columns
        call    goto_xy         ; Place Cursor
    .n_col00:
        pop dx
        pop cx
        pop bx
        jmp .not_tab

    .is_tab:
        push    cx
        mov cx, 07d
    .loop_tab:

        push    bx
        push    cx
        push    dx
        xor bx, bx          ; Select Video Page 0
        call    get_xy          ; Read Cursor Position In DX
        cmp dl, 0h          ; Is It The First Column ?
        jz  .f_col01
        mov al, 08h         ; Print Backspace
        call    put_chr
        mov al, 20h         ; Print Space
        call    put_chr
        mov al, 08h         ; Print Backspace
        call    put_chr
        jmp .n_col01
    .f_col01:
        dec dh          ; Go To Previous Line
                        ; Assumes DH>0
        mov dl, 79d         ; Max Numbers Of Columns
        call    goto_xy         ; Place Cursor
        mov al, 20h         ; Print Space
        call    put_chr
        mov dl, 79d         ; Max Numbers Of Columns
        call    goto_xy         ; Place Cursor
    .n_col01:
        pop dx
        pop cx
        pop bx

        dec cx
        cmp cx, 0
        jnz .loop_tab
        pop cx
    .not_tab:
        xor ax, ax
        mov [si], ax        ; Reset Deleted Character To 0

        pop ax
        jmp Count0
    .next:
        cmp cx, 0h          ; Is Buffer Already Full ?
        jz  Count0          ; Go Back And Wait For BKSP or ENTER
        dec cx          ; Decrement Max String Length
        call    put_chr
        mov [si], al
        inc si          ; Increment SI
        jmp Count0
    Count0Done:
        pop cx          ; Retrieve CX
        pop bx          ; Retrieve BX
        pop ax          ; Retrieve AX
        pop si          ; Retrieve SI
        ret
endp

str_len proc near
        push    ax      ; Save AX
        push    si      ; Save SI
        xor cx, cx      ; Initialize Counter
    Count:
        lodsb           ; Load Next Character From SI to AL
        or  al, al      ; Check If AL=0
        jz  CountDone   ; AL=0? Then Return
        inc cx
        jmp Count
    CountDone:
        pop si      ; Retrieve SI
        pop ax      ; Retrieve AX
        ret
endp

chr_to_upper proc near

        push    bx      ; Save BX
        push    cx      ; Save CX
        push    ax      ; Save AX
        mov bl, al
        mov al, 'a'
        cmp bl, al      ; Is Character < 'a'
        jl  .notlc          ; Other
        mov al, 'z'
        cmp     bl, al      ; Is Character > 'z'
        jg  .notlc          ; Other
        mov al, 20h
        sub bl, al      ; Convert to Uppercase
        xchg    al, bl      ; Exchange AL and BL
        jmp .lc     ; Lowercase Processed
    .notlc:
        pop ax      ; Retrieve AX
        jmp .clear1
    .lc:
        pop cx      ; Waste AX
    .clear1:
        pop cx      ; Retrieve CX
        pop bx      ; Retrieve BX
        ret
endp

chr_to_lower proc near

        push    bx      ; Save BX
        push    cx      ; Save CX
        push    ax      ; Save AX
        mov bl, al
        mov al, 'A'
        cmp bl, al      ; Is Character < 'A'
        jl  .notuc          ; Other
        mov al, 'Z'
        cmp     bl, al      ; Is Character > 'Z'
        jg  .notuc          ; Other
        mov al, 20h
        add bl, al      ; Convert to Lowercase
        xchg    al, bl      ; Exchange AL and BL
        jmp .uc     ; Uppercase Processed
    .notuc:
        pop ax      ; Retrieve AX
        jmp .clear2
    .uc:
        pop cx      ; Waste AX
    .clear2:
        pop cx      ; Retrieve CX
        pop bx      ; Retrieve BX
        ret

endp

str_to_upper proc near

        push    si          ; Save SI
        push    ax          ; Save AX
    Count1:
        mov al, [si]
        cmp al, 0h          ; Check If AL=0
        jz  Count1Done      ; AL=0? Then Return
        mov al, 'a'
        cmp [si], al        ; Is Character < 'a'
        jl  .Other1         ; Other
        mov al, 'z'
        cmp     [si], al        ; Is Character > 'z'
        jg  .Other1         ; Other
        mov al, 20h
        sub [si], al        ; Convert to Uppercase
    .Other1:
        inc si          ; Increment SI
        jmp Count1
    Count1Done:
        pop ax          ; Retrieve AX
        pop si          ; Retrieve SI
        ret
endp

str_to_lower proc near

        push    si          ; Save SI
        push    ax          ; Save AX
    Count2:
        mov al, [si]
        or  al, al          ; Check If AL=0
        jz  Count2Done      ; AL=0? Then Return
        mov al, 'A'
        cmp [si], al        ; Is Character < 'A'
        jl  .Other2         ; Other
        mov al, 'Z'
        cmp     [si], al        ; Is Character > 'Z'
        jg  .Other2         ; Other
        mov al, 20h
        add [si], al        ; Convert to Lowercase
    .Other2:
        inc si          ; Increment SI
        jmp Count2
    Count2Done:
        pop ax          ; Retrieve AX
        pop si          ; Retrieve SI
        ret
endp

sound proc near
    push    ax
    push    cx
    mov cx, ax          ; Temporarily Save Note Value
    mov al, 182
    out 43h, al
    mov ax, cx          ; Set up frequency
    out 42h, al
    mov al, ah
    out 42h, al
    in  al, 61h         ; Switch PC speaker on
    or  al, 03h
    out 61h, al
    pop cx
    pop ax
    ret
endp

delay proc near
os_pause:
    push    ax
    cmp ax, 0
    je  .time_up        ; If delay = 0 then bail out

    mov cx, 0
    mov [.counter_var], cx  ; Zero the counter variable

    mov bx, ax
    mov ax, 0
    mov al, 1           ; 1 * 55ms = 55mS
    mul bx          ; Multiply by number of 55ms chunks required 
    mov [.orig_req_delay], ax   ; Save it

    mov ah, 0
    int 1Ah             ; Get tick count    

    mov [.prev_tick_count], dx  ; Save it for later comparison

.checkloop:
    mov ah,0
    int 1Ah             ; Get tick count again

    cmp [.prev_tick_count], dx  ; Compare with previous tick count

    jne .up_date            ; If it's changed check it          
    jmp .checkloop          ; Otherwise wait some more

.time_up:
    pop ax
    ret

.up_date:
    mov ax, [.counter_var]      ; Inc counter_var
    inc ax
    mov [.counter_var], ax

    cmp ax, [.orig_req_delay]   ; Is counter_var = required delay?
    jge .time_up            ; Yes, so bail out

    mov [.prev_tick_count], dx  ; No, so update .prev_tick_count 

    jmp .checkloop          ; And go wait some more


.orig_req_delay     dw  0
.counter_var        dw  0
.prev_tick_count    dw  0

endp

mute proc near
    push    ax
    in al, 61h
    and al, 0FCh
    out 61h, al
    pop ax
    ret
endp

beep proc near
    push    ax
    mov ax, 560d    ; Sound Tone
    call    sound
    xor ax, ax
    mov ax, 02h     ; 110 milliseconds
    call    delay
    call    mute
    pop ax
    ret
endp

end main
.modeltimy
CR equ 13d
低频等10d
表equ 09d
.数据
提示db CR,LF,“输入:”,0
制表符最大分贝7重复,0
输入db 128 dup(0);80字节的输入缓冲区
str_ver db CR,LF,CR,LF,CR,“\
“版本:1.0”,CR,LF,0
str_help db CR,LF,CR,LF,CR,“\
“为版本键入版本!!!”\
CR,LF,CR,“\
“键入CLS以清除屏幕!!!”\
CR,LF,CR,“\
“键入帮助以显示此消息!!!”\
CR,LF,0
str_welcome db“欢迎使用我的操作系统!!!”,0
str_默认数据库CR,LF,CR,LF,CR,“\
“无效命令!!!”\
CR,LF,CR,“\
“键入帮助以显示帮助!!!”\
CR,LF,0
cmd_ver db“ver”,0
cmd_help db“help”,0
cmd_cls db“cls”,0
.代码
组织100小时
主进程近
异或ax,ax;选择视频模式功能
mov al,03h;选择80x25(8页)文本模式
int 10h;呼叫中断
mov-dh,0h;一行
mov-dl,0h;纵队
打电话给goto_xy
mov cx,30小时
李斯,[欢迎光临]
呼叫put_str
从0开始:
lea si,[提示];显示提示
mov-cx,0ah;最大长度=10
呼叫put_str
呼叫嘟嘟声
lea si[输入]
调用null_str;回收输入缓冲区
mov-cx,60h;最大长度=64
调用get_str;读取用户输入
调用delu空格;去掉前导和尾随空格字符
把str_叫到上;转换成大写
呼叫chk_内部;内部命令中的交叉检查
jmp开始于0;永远循环
endp
空\u str proc near
推硅;保存SI
推送cx;保存CX
推斧;节省开支
xor ax,ax
呼叫stru_len;移动CX中字符串的长度
.0:
cmp-cx,0;是零长度吗?
jz.finish0;如果是这样的话,就废除它
mov[si],ax;输入缓冲区中的字符为空
12月cx日;减量计数器
国际公司;高级SI
jmp.more0;循环直到第一个0
.finish0:
爆裂斧;取回斧头
流行性感冒;检索BX
波普司;检索SI
ret;返回
endp
del_空格程序近
推硅;保存SI
推挤di;拯救DI
推送dx;保存DX
推送cx;保存CX
推bx;保存BX
推斧;节省开支
xor ax,ax
异或bx,bx
异或
异或dx,dx
莫夫迪
dec si;SI=SI-1
.00:
国际公司;继续递增源字符串索引
异或dx,dx
mov-dx[si]
异或dh,dh
cmp-dl,00h;串好了吗?
jz.chomp00
cmp-dl,20h;这是一个空间吗
jz.loop00;继续吃饭
cmp-dl,TAB;是帐单吗
jz.loop00;继续吃标签
推硅;字符串中的第一个非空白字符索引
cx公司;字符串中的令牌数
.01:
国际公司;增量SI
mov-dx[si]
异或dh,dh
cmp-dx,00h;串好了吗?
jz.chomp00;切掉有用的部分
cmp-dx,20h;检查空间
jz.loop00
cmp-dx,TAB;检查标签
jnz.loop01;继续读到下一页
jz.loop00
.chomp00:
cmp-cx,00h;空输入
jz.over01;然后返回
12月cx日;否则,减少令牌的数量
波普司;完成令牌的开始
mov-ax,si;保存它,以防它也成为第一个令牌的开始
.旁路:
国际公司;增量字符串索引
mov-dx[si]
异或dh,dh
cmp-dx,00h;绳子断了吗?
jz.loop002
cmp-dx,20h
jz.loop002
cmp dx,选项卡
旁路;绕过令牌中的所有字符,直到第一个空格
.002:
mov-bx,si;收尾
cmp-cx,00h;只有一个代币吗?
jz.inst00;然后,结束标记的开始=开始开始标记
.02:
十二月十二日
爆裂斧;移动AX中上一个令牌的开始位置
cmp-cx,00h;所有代币都用完了吗?
jz.inst00
jnz.loop02;绕圈子
.inst00:
mov-si,ax;将SI设置为开始
.03:
cmp-si,bx;是否已处理令牌中的所有字符?
jz.00多;完成,返回
mov-dx[si]
mov[di],dx;否则将覆盖输入字符串
国际公司;增量用户令牌输入索引
国际公司;增量处理令牌输入索引
jmp.03;绕圈子
.00多人:
异或dx,dx
mov[di],dx;空终止已处理令牌
.01岁以上:
爆裂斧;取回斧头
波普bx;检索BX
流行性感冒;检索CX
pop-dx;检索DX
波普迪;检索DI
波普司;检索SI
ret;返回
endp
clr_scr程序近
推斧;节省开支
推bx;保存BX
推送cx;保存CX
推送dx;保存DX
异或dx,dx;光标位于左上角
打电话给goto_xy
mov-ah,6;向上滚动整个屏幕
mov-al,0;文本颜色:白色
mov-bh,7;背景:黑色
异或cx,cx;左上角
mov-dh,24;最底层
mov-dl,79;正确的
int 10h
pop-dx;检索DX
流行性感冒;检索CX
波普bx;检索BX
爆裂斧;取回斧头
ret
endp
chk_内部程序近
推硅;保存SI
推送cx;保存CX
cmd_ver_lb:
lea di,[cmd_ver];VER命令
调用cmp_str;比较
Count0Done:
    pop cx          ; Retrieve CX
    pop bx          ; Retrieve BX
    pop ax          ; Retrieve AX
    pop si          ; Retrieve SI
    ret

.bksp:
.next:
    cmp cx, 0h          ; Is Buffer Already Full ?
    jz  .Count0inter        ; Go Back And Wait For BKSP or ENTER
    dec cx          ; Decrement Max String Length
    call    put_chr
    mov [si], al
    inc si          ; Increment SI
.Count0inter:
    jmp Count0
    cmp byte ptr [si], TAB      ; Is It A TAB ?
     jnz .skip
     jmp Count0Done
.skip: