我有一个非常短的汇编TASM程序:
IDEAL
MODEL small
STACK 100h
DATASEG
;creating all the messages
opening_message db 10, 'This is an encryption program.', 10, 'This program allows you to encrypt a message into giberish,', 10, 'send it to a friend, who can then decrypt it back into text$'
CODESEG
start:
mov ax, @data
mov ds, ax
; --------------------------
; Your code here
; --------------------------
;We clear the screen of dosbox
mov ax, 13h
int 10h
mov ax, 2
int 10h
;print opening message
lea dx, [opening_message]
mov ah, 9
int 21h
exit:
mov ax, 4c00h
int 21h
END start当我尝试在DOSBOX(最新版本,64位)中运行程序时,字符串中的换行符(10)是以一个巨大的偏移量打印出来的。见图

有人能帮忙吗?谢谢P.S.这个程序在香草dosbox上运行得很好
发布于 2021-05-23 21:34:33
DOSBox遵循DOS规则,要求回车(13)和linefeed (10)输出换行符。
您的代码只使用linefeed,因此文本只删除一行。
opening_message db 13, 10, 'This is an encryption program.'
db 13, 10, 'This program allows you to encrypt a message into giberish,'
db 13, 10, 'send it to a friend, who can then decrypt it back into text', 13, 10, '$';我们清除dosbox,13h int 10hmovax,2int10h的屏幕。
为什么首先设置图形屏幕13h (320x200),然后设置文本屏幕02h (80x25)?注意,通常80x25文本屏幕是从使用模式号03h设置的。
https://stackoverflow.com/questions/67664524
复制相似问题