【发布时间】:2017-05-21 20:08:58
【问题描述】:
我尝试使用 DOS 的字符集制作一个简单的 TUI,但是当我编写字符时它们非常分开:
我尝试了几种文本模式都没有成功。 (我用这个页面作为参考:http://www.ctyme.com/intr/rb-0069.htm)
我使用 DOSBOX 和 NASM。
pd:如果我的问题还不清楚
这是我的代码:
[bits 16]
org 0x100
segment .text
global main
main:
; Ajustamos el modo de video
mov ah,00h
mov al,04h ; I tried with 01h,03h
int 10h
; Dibujamos el campo de juego
call draw_ui
; Terminamos la apliacion
mov ah,00h
int 21h
draw_ui:
mov ah,02h ; Posicionamos el cursor
mov dh,6 ; en la esquina superior
mov dl,17 ; izquierda del campo de
mov bh,0x0
int 10h ; juego.
mov ah,02h ; Imprimimos el caracter
mov dl,0xc9 ; correspondiente a la
int 21h ; esquina del campo
mov bl,6
call draw_top_ui
mov ah,03
int 10h
mov ah,02h
inc dl
mov bh,0x0
int 10h
mov ah,02h
mov dl,0xbb
int 21h
ret
draw_top_ui:
mov ah,03 ; Obtenemos la posicon
int 10h ; del cursor
mov ah,02h ; Movemos el cursor una
inc dl ; columna a la derecha
mov bh,0x0
int 10h
mov ah,02h ; Imprimimos el caracter
mov dl,0xcd ; de la parte superiro
int 21h ; del campo de juego
dec bl ; hacemos esto 6 veces
jnz draw_top_ui
ret
【问题讨论】:
-
您能否提供一个示例来说明您正在尝试做的事情以及到目前为止您已经尝试过的事情?
-
@zbw 已经完成了
-
您需要显示用于生成此代码的实际汇编代码。那就是我们可以帮助你!
-
@SepRoland 准备就绪
标签: assembly nasm x86-16 dosbox