assembly 8086 cursor placement

南笙酒味 提交于 2019-12-01 18:38:55
Jose Manuel Abarca Rodríguez

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

Example :

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.

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!