2016-11-10 22:26:46 +03:00
|
|
|
|
format PE console 0.8
|
2008-07-27 18:25:33 +04:00
|
|
|
|
include 'proc32.inc'
|
2016-11-10 22:26:46 +03:00
|
|
|
|
include '../../../../import.inc'
|
2008-07-27 18:25:33 +04:00
|
|
|
|
|
|
|
|
|
start:
|
2016-11-10 22:26:46 +03:00
|
|
|
|
invoke con_set_title, caption
|
2008-07-27 18:25:33 +04:00
|
|
|
|
; C-equivalent of the following code:
|
|
|
|
|
; for (ebx=0;ebx<0x100;ebx++)
|
|
|
|
|
; {
|
|
|
|
|
; con_printf(t1,ebx);
|
|
|
|
|
; eax = con_set_flags(ebx);
|
|
|
|
|
; con_write_asciiz(text);
|
|
|
|
|
; con_set_flags(eax);
|
|
|
|
|
; }
|
|
|
|
|
; N.B. For efficiency result of first con_set_flags is not saved
|
|
|
|
|
; in register, but is pushed beforehand to the stack
|
|
|
|
|
; for second con_set_flags.
|
|
|
|
|
; Note that such code cannot be generated by stdcall macros.
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
@@:
|
|
|
|
|
push ebx
|
|
|
|
|
push t1
|
|
|
|
|
call [con_printf]
|
|
|
|
|
add esp, 8
|
|
|
|
|
push ebx
|
|
|
|
|
call [con_set_flags]
|
|
|
|
|
push eax
|
|
|
|
|
push text
|
|
|
|
|
call [con_write_asciiz]
|
|
|
|
|
call [con_set_flags]
|
|
|
|
|
inc bl
|
|
|
|
|
jnz @b
|
|
|
|
|
push text2
|
|
|
|
|
call [con_write_asciiz]
|
|
|
|
|
push 0
|
|
|
|
|
call [con_exit]
|
|
|
|
|
exit:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
align 4
|
2016-11-10 22:26:46 +03:00
|
|
|
|
data import
|
|
|
|
|
library console, 'console.dll'
|
|
|
|
|
import console, \
|
|
|
|
|
con_set_title, 'con_set_title', \
|
|
|
|
|
con_write_asciiz, 'con_write_asciiz', \
|
|
|
|
|
con_printf, 'con_printf', \
|
|
|
|
|
con_set_flags, 'con_set_flags', \
|
|
|
|
|
con_exit, 'con_exit'
|
|
|
|
|
end data
|
2008-07-27 18:25:33 +04:00
|
|
|
|
|
|
|
|
|
caption db 'Console test - colors',0
|
|
|
|
|
t1 db '<27><><EFBFBD><EFBFBD> 0x%02X: ',0
|
|
|
|
|
text db '<27><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC> ⥪<><E2A5AA><EFBFBD>.',10,0
|
|
|
|
|
text2 db 27,'[7m<37> <20><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
db 27,'[1;36;41mEsc'
|
|
|
|
|
db 27,'[7m-<2D><><EFBFBD><E1ABA5><EFBFBD><EFBFBD>⥫쭮<E2A5AB>⥩.',10,0
|