flat assembler
Message board for the users of flat assembler.
Index
> Linux > How to reset terminal cursor position |
Author |
|
uu 20 Jul 2024, 22:57
I use ANSI escape code:
Code: format ELF executable 3 segment readable executable entry $ mov eax, 4 mov ebx, 1 mov ecx, cls mov edx, len int 0x80 mov eax, 1 int 0x80 cls db 27,'[H',27,'[JI am here!' len = $ - cls You can remove "I am here", it is used here to show that the cursor is at top-left corner. |
|||
20 Jul 2024, 22:57 |
|
burrows 21 Jul 2024, 00:01
Quote:
Thank you for your example, but it's important that the program doesn't depend on things like ANSI escape codes to do it's job. I'm trying to directly target the terminal emulator's cursor and reset its position, like with a specific syscall or BIOS interrupt. Maybe this would be easier to make on DOS. |
|||
21 Jul 2024, 00:01 |
|
revolution 21 Jul 2024, 03:29
In Linux there is no syscall to control a terminal. You will need to talk to the terminal directly with IOCTL calls. This is the hard route, and it is less compatible with the terminals.
It is no doubt vastly easier, and more compatible, to use ANSI code in Linux. It is how it is built. Also: BIOS interrupt isn't possible in Linux. Linux runs in protected mode. |
|||
21 Jul 2024, 03:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.