【问题标题】:Framing the screen with character用角色构图屏幕
【发布时间】:2014-11-29 10:55:57
【问题描述】:

我想填充屏幕的边缘(80*25 分辨率,但主要问题是我无法写入最后一行)所以它就像 80*24 的分辨率我构图 我还有一些其他问题。我会将这些添加到 cmets 中:

    Code    Segment
    assume CS:Code, DS:Data, SS:Stack

Start:
    mov    ax, Code
    mov    DS, AX


    ;>>>>>>>>>>>>>>>>
    ;*              $
    ;*              $   
    ;*              $ 24 line
    ;<<<<<<<<<<<<<<<< 25 line

;But what i get is

    ;****************
    ;*              $
    ;*              $   
    ;*              $ 23 line
    ;<<<<<<<<<<<<<<<< 24 line

;If i try to use 24 iteration in the second cyclus(Line1) i get:

    ;>>>>>>>>>>>>>>>>
    ;*              $
    ;*              $   
    ;*              $
    ;*              < 24 line
    ;<<<<<<<<<<<<<<<  25 line



    mov ax,03h
    int 10h
    xor dx,dx

    xor dx,dx
    push dx

    mov cx,80
Line:   
    pop dx
    xor bx,bx
    mov ah,02h
    int 10h

    inc dl
    push dx

    mov dl,'>'
    mov ah,02h
    int 21h
loop Line


pop dx
dec dl
inc dh
push dx

    mov cx,23
Line1:   
    pop dx
    xor bx,bx
    mov ah,02h
    int 10h

    inc dh
    push dx

    mov dl,'$'
    mov ah,02h
    int 21h
loop Line1

 pop dx
 dec dh   
 push dx

     mov cx,80
Line3:   
    pop dx
    xor bx,bx
    mov ah,02h
    int 10h

    dec dl
    push dx

    mov dl,'<'
    mov ah,02h
    int 21h
loop Line3


;Hier the DX register is crashed somehow and i need to set it manually
;Do you know why?

 pop dx
 mov dh,22
 mov dl,0
 ;dec dh   
 ;dec dl

 push dx

     mov cx,22
Line4:   
    pop dx
    xor bx,bx
    mov ah,02h
    int 10h

    dec dh
    push dx

    mov dl,']'
    mov ah,02h
    int 21h
loop Line4



    xor ax,ax
    int 16h




ProgramEnd:
    mov ax,4c00h
    int 21h   
    pop bx

Code    Ends

Data    Segment

Data    Ends

Stack    Segment

Stack    Ends
    End    Start

【问题讨论】:

    标签: assembly x86 dos masm


    【解决方案1】:

    循环后,堆栈上的DX 内容为下一个位置。

    1) 删除dec dh 之前的Line3。 “下一个”行就是正确的行。

    2) Line4 之前的“下一个”列是“从 00 离开”= FF。将那里的dec dl 更改为inc dl,您可以取消手动调整。

    3) int 21h / ah = 02h 打印字符移动光标。如果光标离开窗口(右下角),它将被滚动。使用不移动光标的功能。所以改变

    mov dl,'<'
    mov ah,02h
    int 21h
    

    mov ah, 09h
    mov bx, 7
    mov al, '<'
    int 10h
    

    【讨论】:

    • 它工作正常,我使用 ah,09h 命令,因此不再干扰光标位置。对不起,我不能投票:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多