组件8086光标放置 [英] assembly 8086 cursor placement

查看:125
本文介绍了组件8086光标放置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将光标放置在"paper:"之后,等待输入ENTER,然后将其放置在"author(s):"之后.这两个句子都是已定义的已打印变量.

I want to place the cursor after the "paper:" wait until an ENTER is given and then place it after "author(s):". both sentences are defined variables that are printed.

    insert db "******* Insert new paper *******",0,0Ah,0Ah,0Ah, 0Dh, "$"  
    inserttitle db "  Title of paper:      ",0Dh,0Ah,0Ah, "  Name of author(s):     ",0Dh ,"$"
    mainext db ,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,"     <<Main>>              <<Next>>","$"

 INSERT NEW PAPER

newpaper proc

    call clrscr

    mov dx, offset insert
    call printf

    mov dx, offset inserttitle
    call printf

    mov dx, offset mainext
    call printf

    call w8click   
    ret

newpaper endp

推荐答案

调用下一个proc来定位光标:

Call next proc to position cursor :

;INPUT : DL=X, DH=Y.
set_cursor proc
      mov  ah, 2                  ;◄■■ SERVICE TO SET CURSOR POSITION.
      mov  bh, 0                  ;◄■■ VIDEO PAGE.
      int  10h                    ;◄■■ BIOS SERVICES.
      RET
set_cursor endp

示例:

call clrscr

mov  dx, offset inserttitle ;◄■■ "  Title of paper:      "
call printf

mov  dl, 18                 ;◄■■ SCREEN COLUMN 18 (X).
mov  dh, 2                  ;◄■■ SCREEN ROW 2 (Y).
call set_cursor             ;◄■■ SET CURSOR POSITION.

在上一个示例中,光标将跳到"paper:"之后.

In previous example cursor will jump to after "paper: ".

:另外两个处理程序cursor_oncursor_off,用于显示和隐藏光标:

Edit : two more procs, cursor_on and cursor_off, to show and hide cursor:

cursor_on proc
   mov  ah, 1
   mov  cx, 4          ;◄■■ BIG CURSOR.
   int  10h
   ret
cursor_on endp


cursor_off proc
   mov  ah, 1
   mov  cx, 20h        ;◄■■ NO CURSOR.
   int  10h
   ret
cursor_off endp

这篇关于组件8086光标放置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆