Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String asm8086关于打印字符串_String_Assembly - Fatal编程技术网

String asm8086关于打印字符串

String asm8086关于打印字符串,string,assembly,String,Assembly,您好,在我的代码中,我想在屏幕上打印一个带有以下中断的特定字符串 lea dx, pkey mov ah, 9 int 21h 然后我想打印另一个字符串,但我想让仿真器删除前一个字符串。 例如,如果我想打印: "Hello and welcome" "Press here to continue" 然后我想打印: "Hello and welcome" "Press here to continue" 我希望屏幕上没有其他字符串。谢谢你的帮助 Mchlsn,您需要的是清除第一个字符串和

您好,在我的代码中,我想在屏幕上打印一个带有以下中断的特定字符串

lea dx, pkey
mov ah, 9
int 21h
然后我想打印另一个字符串,但我想让仿真器删除前一个字符串。 例如,如果我想打印:

"Hello and welcome"
"Press here to continue"
然后我想打印:

"Hello and welcome"
"Press here to continue"

我希望屏幕上没有其他字符串。谢谢你的帮助

Mchlsn,您需要的是清除第一个字符串和第二个字符串之间的屏幕。使用8086这将是代码,复制并粘贴到汇编程序编译器中,我使用了EMU8086:

.stack 100h
.data
hello db 'Hello and welcome$'
press db 'Press here to continue$'
.code          
;INITIALIZE DATA SEGMENT.
  mov  ax,@data
  mov  ds,ax

  lea dx, hello ;DISPLAY FIRST STRING.
  mov ah, 9
  int 21h

  call wait_for_key
  call clear_screen

  lea dx, press ;DISPLAY SECOND STRING.
  mov ah, 9
  int 21h

  call wait_for_key

;FINISH THE PROGRAM PROPERLY.
  mov  ax,4c00h
  int  21h           

proc wait_for_key
  mov  ah,7
  int  21h
  ret
endp

proc clear_screen
  mov  ah,0
  mov  al,7
  int  10H
  ret
endp
希望能有帮助


顺便说一下,在过程清除屏幕中,如果值al=7给您带来任何问题,您可以尝试从0到7的其他数字。

听起来您想要的东西很多。;)您是否尝试过可以共享的解决方案?你到底被困在哪里?@Louger我真的不知道怎么说得更准确:/I我只需要在打印其他内容时屏幕上没有其他字符串。清除屏幕的机制取决于你的输出系统。这里没有足够的信息来猜测您可能需要做什么。@HoboSapiens您所说的输出系统是什么意思?如果我的答案对您有所帮助,您可以将其标记为正确的一个或对其进行投票(或两者都投票!)。您的解决方案似乎有效。al=3使它对我有效,而不是al=7。非常感谢你。