flat assembler
Message board for the users of flat assembler.
Index
> Main > combining a nibble and 3 bits |
Author |
|
revolution 25 Sep 2009, 14:16
What terminal emulation is your console set to?
|
|||
25 Sep 2009, 14:16 |
|
fpga 25 Sep 2009, 14:30
I'm running terminator under #! linux a minimalist debian derivative
terminator is set to emulate xterm according to it's profile Is that what you want? |
|||
25 Sep 2009, 14:30 |
|
revolution 25 Sep 2009, 14:36
It was supposed to be a hint so that once you know what terminal emulation you are using then you can look up the spec of terminal escape codes to see if what you want to do is possible/easy.
Here, I googled it for you: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html |
|||
25 Sep 2009, 14:36 |
|
fpga 25 Sep 2009, 15:06
On the link you provided there is "P s = 44 → Set background color to Blue"
ie "[44m" It was a bit too subtle for me because I've already printed with a blue background and a red foreground ("[31m") so I know they both work. I haven't managed to print the two at the same time cos I don't know how to put them both in the same byte ie "[31m" in the low nibble "[44m" in the next 3 bytes and 0 in the highest highest byte (blinking off) This is assuming that eg "[31m" represents a single byte. I have no idea whether these symbols have some special meaning eg you can specify "[1;31m" to make it brighter What sort of syntax is this? If I could get the stuff into a single byte as I have read you should do I'd try db ESC, the_byte_with_both_sequences_in db "some text", 0xa in the program Hope this clarifies where I've got to. |
|||
25 Sep 2009, 15:06 |
|
fpga 25 Sep 2009, 19:32
The asm program that I've been struggling with sends to stdout so I've been playing around with c++ which I'm more familiar with.
Code: #include "iostream" using namespace std; int main(){ cout << "\x1b[31m\x1b[41mTesting\n"; //red on red cout << "\x1b[31m\x1b[42mTesting\n"; //red on green cout << "\x1b[0m"; //go back to default return 0; } The above works fine other than allowing me to specify x & y which the asm code does. Last edited by fpga on 25 Sep 2009, 19:57; edited 1 time in total |
|||
25 Sep 2009, 19:32 |
|
fpga 25 Sep 2009, 19:45
Translating this to asm we get
Code: message: db ESC, "[31m", ESC, "[42m" db "Programming linux is easy", 0xa ;0xa null termination char? db ESC, "[0m" which works. Thanks for the prompt revolution. The above c++ code was a mod of some other code I saw whilst googling xterm.h and .c following your question. |
|||
25 Sep 2009, 19:45 |
|
Borsuc 26 Sep 2009, 18:28
0x0A is newline. 0x0D is carriage return. Under Windows (not linux) you would have 0x0D, 0x0A for each newline. Linux uses only 0x0A per newline.
|
|||
26 Sep 2009, 18:28 |
|
fpga 28 Sep 2009, 18:49
Thx for that!
|
|||
28 Sep 2009, 18:49 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.