2014-02-25 18:34:48 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Color scheme
|
|
|
|
|
2019-08-22 18:38:09 +02:00
|
|
|
BLACK_ON_WHITE = 0
|
|
|
|
MOVIEOS = 1
|
|
|
|
WHITE_ON_BLACK = 2
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Font
|
|
|
|
|
2019-09-05 14:05:58 +02:00
|
|
|
FONT equ 1 ; 0 to 3
|
2019-08-24 18:48:24 +02:00
|
|
|
FONT_MULTIPLIER equ 1 ; 1 to 8
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; GUI elements size and position
|
|
|
|
|
|
|
|
TEXT_Y_CLEARANCE = 1 ; in pixels
|
|
|
|
|
|
|
|
DATA_WIDTH = 80 ; in characters
|
|
|
|
DATA_X_POS = 12 ; in pixels
|
|
|
|
|
|
|
|
TITLE_X_POS = 30 ; in pixels
|
|
|
|
TITLE_Y_POS = 8 ; in pixels
|
|
|
|
|
|
|
|
DUMP_HEIGHT = 6 ; in text lines
|
|
|
|
MIN_DISASM_HEIGHT = 18 ; in text lines
|
|
|
|
MSG_HEIGHT = 14 ; in text lines
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
if (FONT eq 0)
|
|
|
|
FONT_X_SIZE = 6*FONT_MULTIPLIER
|
|
|
|
else
|
|
|
|
FONT_X_SIZE = 8*FONT_MULTIPLIER
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (FONT eq 0)
|
|
|
|
FONT_Y_SIZE = 9*FONT_MULTIPLIER
|
|
|
|
else
|
|
|
|
FONT_Y_SIZE = 16*FONT_MULTIPLIER
|
|
|
|
end if
|
|
|
|
|
|
|
|
TITLE_Y_SIZE = (FONT_Y_SIZE + TEXT_Y_CLEARANCE)
|
|
|
|
DUMP_Y_POS = (TITLE_Y_POS + TITLE_Y_SIZE)
|
|
|
|
DUMP_Y_SIZE = (DUMP_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE))
|
|
|
|
DISASM_Y_POS = (DUMP_Y_POS + DUMP_Y_SIZE + 4)
|
|
|
|
|
|
|
|
MSG_WIDTH = DATA_WIDTH
|
|
|
|
MSG_X_POS = DATA_X_POS
|
|
|
|
MSG_X_SIZE = MSG_WIDTH*FONT_X_SIZE
|
|
|
|
MSG_Y_SIZE = MSG_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE)
|
|
|
|
|
|
|
|
CMD_WIDTH = DATA_WIDTH
|
|
|
|
CMD_X_POS = DATA_X_POS
|
|
|
|
CMD_Y_SIZE = (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
|
|
|
|
|
|
|
REGISTERS_Y_POS = DUMP_Y_POS
|
|
|
|
REGISTERS_X_SIZE = (22+2)*(FONT_X_SIZE) ; 22 characters + 2 spacing
|
|
|
|
|
|
|
|
wnd_x_size = (DATA_X_POS + MSG_X_SIZE + DATA_X_POS + REGISTERS_X_SIZE + 3) + 10
|
|
|
|
wnd_y_size = (((DISASM_Y_POS + (MIN_DISASM_HEIGHT*(FONT_Y_SIZE + TEXT_Y_CLEARANCE)) + 4) + MSG_Y_SIZE + 4) + CMD_Y_SIZE + DATA_X_POS)
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
; format - 0xRRGGBB
|
|
|
|
if COLOR_THEME eq MOVIEOS
|
|
|
|
|
|
|
|
COLOR_BG_NORMAL = 0x1d272f
|
|
|
|
COLOR_BG_BREAKPOINT = 0x0000aa
|
|
|
|
COLOR_BG_SELECTED = 0xec9300
|
|
|
|
COLOR_LINE = 0x00b9a0
|
|
|
|
COLOR_TXT_NORMAL = 0xffffff
|
|
|
|
COLOR_TXT_INACTIVE = 0x8f7948
|
|
|
|
COLOR_TXT_CHANGED = 0xec9300
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_LABEL = 0x22b14c
|
2014-02-25 18:34:48 +01:00
|
|
|
COLOR_TXT_SELECTED = 0x1d272f
|
2014-04-24 13:42:27 +02:00
|
|
|
COLOR_TXT_HEX = 0xec9300
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_BREAKPOINT = 0xec9300
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
else if COLOR_THEME eq WHITE_ON_BLACK
|
|
|
|
|
|
|
|
COLOR_BG_NORMAL = 0x101010 ; dark grey
|
|
|
|
COLOR_BG_BREAKPOINT = 0xFF0000 ; red
|
|
|
|
COLOR_BG_SELECTED = 0x0000FF ; blue
|
|
|
|
COLOR_LINE = 0xFFFFFF ; white
|
|
|
|
COLOR_TXT_NORMAL = 0xFFFFFF ; white
|
|
|
|
COLOR_TXT_INACTIVE = 0x808080 ; grey
|
|
|
|
COLOR_TXT_CHANGED = 0x00AA00 ; green
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_LABEL = COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
COLOR_TXT_SELECTED = 0xFFFFFF ; white
|
2014-04-24 13:42:27 +02:00
|
|
|
COLOR_TXT_HEX = COLOR_TXT_NORMAL
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_BREAKPOINT = COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
else ; BLACK ON WHITE
|
|
|
|
|
|
|
|
COLOR_BG_NORMAL = 0xffffff ; white
|
|
|
|
COLOR_BG_BREAKPOINT = 0xFF0000 ; red
|
|
|
|
COLOR_BG_SELECTED = 0x0000FF ; blue
|
|
|
|
COLOR_LINE = 0x000000 ; black
|
|
|
|
COLOR_TXT_NORMAL = 0x000000 ; black
|
|
|
|
COLOR_TXT_INACTIVE = 0x808080 ; grey
|
|
|
|
COLOR_TXT_CHANGED = 0x00AA00 ; green
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_LABEL = COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
COLOR_TXT_SELECTED = 0xFFFFFF ; white
|
2014-04-24 13:42:27 +02:00
|
|
|
COLOR_TXT_HEX = COLOR_TXT_NORMAL
|
2014-04-23 21:59:17 +02:00
|
|
|
COLOR_TXT_BREAKPOINT = COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
end if
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
struc fpcvt
|
|
|
|
{
|
|
|
|
.str_buf rb 32
|
|
|
|
.cvt_buf rb 16
|
|
|
|
.bcd_man rb 10
|
|
|
|
.bcd_exp rb 10
|
|
|
|
.exp rd 1
|
|
|
|
.digits rq 1
|
|
|
|
.sizeof:
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Entry point
|
|
|
|
|
|
|
|
; TODO: split all gui part in independent function, move entry point into mtdbg.asm
|
|
|
|
|
|
|
|
start:
|
2014-04-24 14:23:56 +02:00
|
|
|
; initialize process heap
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 68, 11
|
2014-04-27 13:58:27 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
call init_cmd_hist_buffer
|
|
|
|
|
2014-04-27 13:58:27 +02:00
|
|
|
push eax
|
|
|
|
fstcw word [esp]
|
2014-04-28 13:26:30 +02:00
|
|
|
pop eax
|
|
|
|
and ax, not (3 shl 10)
|
|
|
|
or ax, 1 shl 10 ; set round-to-minus infinity mode
|
|
|
|
push eax
|
2014-04-27 13:58:27 +02:00
|
|
|
fldcw word [esp]
|
|
|
|
pop eax
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edi, messages
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ecx, MSG_WIDTH*MSG_HEIGHT
|
2014-02-25 18:34:48 +01:00
|
|
|
mov al, ' '
|
|
|
|
rep stosb
|
|
|
|
xor eax, eax
|
|
|
|
mov [messages_pos], eax
|
|
|
|
mov [cmdline_len], eax
|
|
|
|
mov [cmdline_pos], eax
|
|
|
|
mov edi, needzerostart
|
|
|
|
mov ecx, (needzeroend-needzerostart+3)/4
|
|
|
|
rep stosd
|
|
|
|
mov esi, begin_str
|
|
|
|
call put_message_nodraw
|
2014-04-24 14:23:56 +02:00
|
|
|
; set event mask - default events and debugging events
|
2019-08-24 18:48:24 +02:00
|
|
|
mcall 40, EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_DEBUG
|
2014-04-24 14:23:56 +02:00
|
|
|
; set debug messages buffer
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ecx, dbgbufsize
|
|
|
|
mov dword [ecx], 256
|
|
|
|
xor ebx, ebx
|
|
|
|
mov [ecx+4], ebx
|
|
|
|
mov al, 69
|
|
|
|
mcall
|
|
|
|
mov esi, i_param
|
|
|
|
call get_arg.skip_spaces
|
|
|
|
test al, al
|
|
|
|
jz dodraw
|
|
|
|
push esi
|
|
|
|
call draw_window
|
|
|
|
pop esi
|
|
|
|
call OnLoadInit
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
dodraw:
|
|
|
|
call draw_window
|
|
|
|
|
|
|
|
waitevent:
|
|
|
|
mcall 10
|
|
|
|
cmp al, 9
|
|
|
|
jz debugmsg
|
|
|
|
dec eax
|
|
|
|
jz dodraw
|
|
|
|
dec eax
|
|
|
|
jz keypressed
|
|
|
|
dec eax
|
|
|
|
jnz waitevent
|
2014-05-01 16:23:42 +02:00
|
|
|
;button pressed
|
|
|
|
mcall 17
|
|
|
|
test al, al
|
|
|
|
jnz waitevent
|
|
|
|
movzx eax, ah
|
|
|
|
jmp dword [.jmp_table+eax*4]
|
|
|
|
|
|
|
|
.close:
|
|
|
|
mcall -1
|
|
|
|
.mmx:
|
|
|
|
movzx edx, [fpu_mode]
|
|
|
|
xor dl, 1
|
|
|
|
mov [fpu_mode], dl
|
|
|
|
push edx
|
|
|
|
jnz .fpu
|
|
|
|
call draw_mmx_regs
|
|
|
|
jmp .draw_label
|
|
|
|
.fpu:
|
|
|
|
call draw_fpu_regs
|
|
|
|
.draw_label:
|
|
|
|
pop edx
|
|
|
|
mov edx, [btn2_tab+edx*4]
|
|
|
|
mov edi, COLOR_BG_NORMAL
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-05-01 16:23:42 +02:00
|
|
|
mov esi, 7
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 4*10000h+REGISTERS_Y_POS
|
2014-05-01 16:23:42 +02:00
|
|
|
mcall 4
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
align 4
|
|
|
|
.jmp_table:
|
|
|
|
dd waitevent
|
|
|
|
dd .close
|
|
|
|
dd .mmx
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
; TODO: split in more independent function
|
|
|
|
keypressed:
|
|
|
|
mov al, 2
|
|
|
|
mcall
|
|
|
|
shr eax, 8
|
|
|
|
cmp al, 8
|
|
|
|
jz .backspace
|
|
|
|
cmp al, 0xB0
|
|
|
|
jz .left
|
|
|
|
cmp al, 0xB3
|
|
|
|
jz .right
|
|
|
|
cmp al, 0x0D
|
|
|
|
jz .enter
|
|
|
|
cmp al, 0xB6
|
|
|
|
jz .del
|
|
|
|
cmp al, 0xB4
|
|
|
|
jz .home
|
|
|
|
cmp al, 0xB5
|
|
|
|
jz .end
|
|
|
|
cmp al, 0xB1
|
|
|
|
jz .down
|
|
|
|
cmp al, 0xB2
|
2014-02-25 20:24:30 +01:00
|
|
|
jz .up
|
|
|
|
cmp ah, 0x41
|
|
|
|
jz F7
|
|
|
|
cmp ah, 0x42
|
|
|
|
jz F8
|
2021-02-12 19:08:07 +01:00
|
|
|
mov [cmd_hist_buffer.tmp_line_flag], 0
|
2019-08-24 18:48:24 +02:00
|
|
|
cmp [cmdline_len], CMD_WIDTH
|
2014-02-25 18:34:48 +01:00
|
|
|
jae waitevent
|
|
|
|
push eax
|
|
|
|
call clear_cmdline_end
|
|
|
|
pop eax
|
|
|
|
mov edi, cmdline
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
add edi, ecx
|
|
|
|
lea esi, [edi-1]
|
|
|
|
sub ecx, [cmdline_pos]
|
|
|
|
std
|
|
|
|
rep movsb
|
|
|
|
cld
|
|
|
|
stosb
|
|
|
|
inc [cmdline_len]
|
|
|
|
call draw_cmdline_end
|
|
|
|
inc [cmdline_pos]
|
|
|
|
call draw_cursor
|
2021-02-12 19:08:07 +01:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.backspace:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov [cmd_hist_buffer.tmp_line_flag], 0
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [cmdline_pos], 0
|
|
|
|
jz waitevent
|
|
|
|
dec [cmdline_pos]
|
|
|
|
|
|
|
|
.delchar:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov [cmd_hist_buffer.tmp_line_flag], 0
|
2014-02-25 18:34:48 +01:00
|
|
|
call clear_cmdline_end
|
|
|
|
mov edi, [cmdline_pos]
|
|
|
|
dec [cmdline_len]
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
sub ecx, edi
|
|
|
|
add edi, cmdline
|
|
|
|
lea esi, [edi+1]
|
|
|
|
rep movsb
|
|
|
|
call draw_cmdline_end
|
|
|
|
call draw_cursor
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.del:
|
|
|
|
mov eax, [cmdline_pos]
|
|
|
|
cmp eax, [cmdline_len]
|
|
|
|
jae waitevent
|
|
|
|
jmp .delchar
|
|
|
|
|
|
|
|
.left:
|
|
|
|
cmp [cmdline_pos], 0
|
|
|
|
jz waitevent
|
|
|
|
call hide_cursor
|
|
|
|
dec [cmdline_pos]
|
|
|
|
call draw_cursor
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.right:
|
|
|
|
mov eax, [cmdline_pos]
|
|
|
|
cmp eax, [cmdline_len]
|
|
|
|
jae waitevent
|
|
|
|
call hide_cursor
|
|
|
|
inc [cmdline_pos]
|
|
|
|
call draw_cursor
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.home:
|
|
|
|
call hide_cursor
|
|
|
|
and [cmdline_pos], 0
|
|
|
|
call draw_cursor
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.end:
|
|
|
|
call hide_cursor
|
|
|
|
mov eax, [cmdline_len]
|
|
|
|
mov [cmdline_pos], eax
|
|
|
|
call draw_cursor
|
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
.up:
|
|
|
|
xor edx, edx
|
|
|
|
jmp .hist
|
|
|
|
|
|
|
|
.down:
|
|
|
|
xor edx, edx
|
|
|
|
inc edx
|
|
|
|
|
|
|
|
.hist:
|
|
|
|
cmp [cmd_hist_buffer.tmp_line_flag], 1
|
|
|
|
je @f
|
|
|
|
mov eax, cmdline
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
mov byte [eax + ecx], 0
|
|
|
|
call add_cmd_hist_tmp_line
|
|
|
|
|
|
|
|
@@:
|
|
|
|
test edx, edx
|
|
|
|
jnz .hist.next
|
|
|
|
cmp [cmd_hist_buffer.n_flag], 0
|
|
|
|
jne @f
|
|
|
|
call get_cmd_hist_line
|
|
|
|
inc [cmd_hist_buffer.n_flag]
|
|
|
|
jmp .hist.cp_line
|
|
|
|
|
|
|
|
@@:
|
|
|
|
call prev_cmd_hist_line
|
|
|
|
jc waitevent
|
|
|
|
call get_cmd_hist_line
|
|
|
|
inc [cmd_hist_buffer.n_flag]
|
|
|
|
jmp .hist.cp_line
|
|
|
|
|
|
|
|
.hist.next:
|
|
|
|
cmp [cmd_hist_buffer.n_flag], 0
|
|
|
|
je waitevent
|
|
|
|
|
|
|
|
call next_cmd_hist_line
|
|
|
|
call get_cmd_hist_line
|
|
|
|
jnc .hist.cp_line
|
|
|
|
call get_cmd_hist_tmp_line
|
|
|
|
mov [cmd_hist_buffer.tmp_line_flag], 0
|
|
|
|
mov [cmd_hist_buffer.n_flag], 0
|
|
|
|
|
|
|
|
.hist.cp_line:
|
|
|
|
|
|
|
|
mov esi, eax
|
|
|
|
mov edi, cmdline
|
|
|
|
xor ecx, ecx
|
|
|
|
|
|
|
|
@@:
|
|
|
|
inc ecx
|
|
|
|
lodsb
|
|
|
|
stosb
|
|
|
|
test al, al
|
|
|
|
jnz @b
|
|
|
|
|
|
|
|
dec ecx
|
|
|
|
mov [cmdline_pos], 0
|
|
|
|
call clear_cmdline_end
|
|
|
|
mov [cmdline_len], ecx
|
|
|
|
mov [cmdline_pos], ecx
|
|
|
|
call draw_cmdline
|
|
|
|
call draw_cursor
|
|
|
|
|
|
|
|
jmp waitevent
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; We also trying to execute previous command, if empty command_line
|
2014-02-25 18:34:48 +01:00
|
|
|
.enter:
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
test ecx, ecx
|
|
|
|
jnz .exec_cur
|
|
|
|
mov cl, byte [cmdline_prev]
|
|
|
|
cmp cl, 0
|
|
|
|
jz waitevent
|
|
|
|
|
|
|
|
.exec_prev:
|
|
|
|
mov esi, cmdline_prev
|
|
|
|
jmp .exec
|
|
|
|
|
|
|
|
.exec_cur:
|
|
|
|
mov esi, cmdline
|
|
|
|
|
|
|
|
.exec:
|
|
|
|
mov byte [esi+ecx], 0
|
2021-02-12 19:08:07 +01:00
|
|
|
|
|
|
|
mov eax, esi
|
|
|
|
call add_cmd_hist_line
|
|
|
|
mov [cmd_hist_buffer.n_flag], 0
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
and [cmdline_pos], 0
|
|
|
|
push esi
|
|
|
|
call clear_cmdline_end
|
|
|
|
call draw_cursor
|
|
|
|
pop esi
|
|
|
|
and [cmdline_len], 0
|
2014-04-24 14:23:56 +02:00
|
|
|
; skip leading spaces
|
2014-02-25 18:34:48 +01:00
|
|
|
call get_arg.skip_spaces
|
|
|
|
cmp al, 0
|
|
|
|
jz waitevent
|
2014-04-24 14:23:56 +02:00
|
|
|
; now esi points to command
|
2014-02-25 18:34:48 +01:00
|
|
|
push esi
|
|
|
|
mov esi, prompt
|
|
|
|
call put_message_nodraw
|
|
|
|
pop esi
|
|
|
|
push esi
|
|
|
|
call put_message_nodraw
|
|
|
|
|
|
|
|
; TODO: add meaningful name
|
|
|
|
z1:
|
|
|
|
mov esi, newline
|
|
|
|
call put_message
|
|
|
|
pop esi
|
|
|
|
push esi
|
|
|
|
call get_arg
|
|
|
|
mov [curarg], esi
|
|
|
|
pop edi
|
|
|
|
mov esi, commands
|
|
|
|
call find_cmd
|
|
|
|
mov eax, aUnknownCommand
|
|
|
|
jc .x11
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; check command requirements
|
|
|
|
; flags field:
|
|
|
|
; &1: command may be called without parameters
|
|
|
|
; &2: command may be called with parameters
|
|
|
|
; &4: command may be called without loaded program
|
|
|
|
; &8: command may be called with loaded program
|
2014-02-25 18:34:48 +01:00
|
|
|
mov eax, [esi+8]
|
|
|
|
mov ecx, [curarg]
|
|
|
|
cmp byte [ecx], 0
|
|
|
|
jz .noargs
|
|
|
|
test byte [esi+16], 2
|
|
|
|
jz .x11
|
|
|
|
jmp @f
|
|
|
|
|
|
|
|
.noargs:
|
|
|
|
test byte [esi+16], 1
|
|
|
|
jz .x11
|
|
|
|
|
|
|
|
@@:
|
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .nodebuggee
|
|
|
|
mov eax, aAlreadyLoaded
|
|
|
|
test byte [esi+16], 8
|
|
|
|
jz .x11
|
|
|
|
jmp .x9
|
|
|
|
|
|
|
|
.nodebuggee:
|
|
|
|
mov eax, need_debuggee
|
|
|
|
test byte [esi+16], 4
|
|
|
|
jnz .x9
|
|
|
|
|
|
|
|
.x11:
|
|
|
|
xchg esi, eax
|
|
|
|
call put_message
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; store cmdline for repeating
|
2014-02-25 18:34:48 +01:00
|
|
|
.x10:
|
|
|
|
mov esi, cmdline
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
|
|
|
|
@@:
|
|
|
|
cmp ecx, 0
|
|
|
|
jle .we
|
|
|
|
mov al, [esi + ecx]
|
|
|
|
mov [cmdline_prev + ecx], al
|
|
|
|
dec ecx
|
|
|
|
jmp @b
|
|
|
|
|
|
|
|
.we:
|
|
|
|
mov [cmdline_len], 0
|
|
|
|
jmp waitevent
|
|
|
|
|
|
|
|
.x9:
|
|
|
|
call dword [esi+4]
|
|
|
|
jmp .x10
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Cmdline handling
|
|
|
|
|
|
|
|
clear_cmdline_end:
|
2021-02-12 19:08:07 +01:00
|
|
|
pusha
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ebx, [cmdline_pos]
|
|
|
|
mov ecx, [cmdline_len]
|
|
|
|
sub ecx, ebx
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, FONT_X_SIZE
|
|
|
|
imul ecx, FONT_X_SIZE
|
2014-02-25 18:34:48 +01:00
|
|
|
inc ecx
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, CMD_X_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ebx, 16
|
|
|
|
or ebx, ecx
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
mov cx, CMD_Y_SIZE
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_BG_NORMAL
|
|
|
|
; draw container rectangle/box for cmdline
|
|
|
|
mcall 13
|
2021-02-12 19:08:07 +01:00
|
|
|
|
|
|
|
popa
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
draw_cmdline:
|
|
|
|
xor ebx, ebx
|
|
|
|
jmp @f
|
|
|
|
|
|
|
|
; TODO: make it local
|
|
|
|
draw_cmdline_end:
|
|
|
|
mov ebx, [cmdline_pos]
|
|
|
|
|
|
|
|
@@:
|
|
|
|
mov esi, [cmdline_len]
|
|
|
|
sub esi, ebx
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
lea edx, [cmdline+ebx]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, FONT_X_SIZE
|
|
|
|
add ebx, CMD_X_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ebx, 16
|
2014-04-28 00:13:37 +02:00
|
|
|
mov bx, word[cmdline_y_pos_dd+4]
|
|
|
|
inc bx
|
2014-04-24 14:23:56 +02:00
|
|
|
; draw a text string in the window
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 4
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Working with messages
|
|
|
|
; in: esi->ASCIIZ message
|
|
|
|
put_message_nodraw:
|
|
|
|
mov edx, [messages_pos]
|
|
|
|
|
|
|
|
.m:
|
|
|
|
lea edi, [messages+edx]
|
|
|
|
|
|
|
|
.l:
|
|
|
|
lodsb
|
|
|
|
cmp al, 0
|
|
|
|
jz .done
|
|
|
|
call test_scroll
|
|
|
|
cmp al, 10
|
|
|
|
jz .newline
|
|
|
|
cmp al, '%'
|
|
|
|
jnz @f
|
|
|
|
cmp dword [esp], z1
|
|
|
|
jnz .format
|
|
|
|
|
|
|
|
@@:
|
|
|
|
stosb
|
|
|
|
inc edx
|
|
|
|
jmp .l
|
|
|
|
|
|
|
|
.newline:
|
|
|
|
push edx
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ecx, MSG_WIDTH
|
2014-02-25 18:34:48 +01:00
|
|
|
xor eax, eax
|
|
|
|
xchg eax, edx
|
|
|
|
div ecx
|
|
|
|
xchg eax, edx
|
|
|
|
pop edx
|
|
|
|
test eax, eax
|
|
|
|
jz .m
|
|
|
|
sub edx, eax
|
|
|
|
add edx, ecx
|
|
|
|
jmp .m
|
|
|
|
|
|
|
|
.done:
|
|
|
|
mov [messages_pos], edx
|
|
|
|
ret
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; at this moment all format specs must be %<digit>X
|
2014-02-25 18:34:48 +01:00
|
|
|
.format:
|
|
|
|
lodsb ; get <digit>
|
|
|
|
sub al, '0'
|
|
|
|
movzx ecx, al
|
|
|
|
lodsb
|
|
|
|
pop eax
|
|
|
|
pop ebp
|
|
|
|
push eax
|
2014-04-24 14:23:56 +02:00
|
|
|
; write number in ebp with ecx digits
|
2014-02-25 18:34:48 +01:00
|
|
|
dec ecx
|
|
|
|
shl ecx, 2
|
|
|
|
|
|
|
|
.writenibble:
|
|
|
|
push ecx
|
|
|
|
call test_scroll
|
|
|
|
pop ecx
|
|
|
|
mov eax, ebp
|
|
|
|
shr eax, cl
|
|
|
|
and al, 0xF
|
|
|
|
cmp al, 10
|
|
|
|
sbb al, 69h
|
|
|
|
das
|
|
|
|
stosb
|
|
|
|
inc edx
|
|
|
|
sub ecx, 4
|
|
|
|
jns .writenibble
|
|
|
|
jmp .l
|
|
|
|
|
|
|
|
test_scroll:
|
2019-08-24 18:48:24 +02:00
|
|
|
cmp edx, MSG_WIDTH*MSG_HEIGHT
|
2014-02-25 18:34:48 +01:00
|
|
|
jnz .ret
|
|
|
|
push esi
|
|
|
|
mov edi, messages
|
2019-08-24 18:48:24 +02:00
|
|
|
lea esi, [edi+MSG_WIDTH]
|
|
|
|
mov ecx, (MSG_HEIGHT-1)*MSG_WIDTH/4
|
2014-02-25 18:34:48 +01:00
|
|
|
rep movsd
|
|
|
|
push eax
|
|
|
|
mov al, ' '
|
|
|
|
push edi
|
2019-08-24 18:48:24 +02:00
|
|
|
push MSG_WIDTH
|
2014-02-25 18:34:48 +01:00
|
|
|
pop ecx
|
|
|
|
sub edx, ecx
|
|
|
|
rep stosb
|
|
|
|
pop edi
|
|
|
|
pop eax
|
|
|
|
pop esi
|
|
|
|
|
|
|
|
.ret:
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
put_message:
|
|
|
|
call put_message_nodraw
|
|
|
|
|
|
|
|
draw_messages:
|
2014-04-24 14:23:56 +02:00
|
|
|
; draw container rectangle/box
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, MSG_X_POS shl 16
|
2014-04-28 00:13:37 +02:00
|
|
|
add ebx, [messages_x_size_dd+4]
|
|
|
|
mov ecx, [messages_y_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
mov cx, MSG_Y_SIZE
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 13, , , COLOR_BG_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, messages
|
2019-08-24 18:48:24 +02:00
|
|
|
push MSG_WIDTH
|
2014-02-25 18:34:48 +01:00
|
|
|
pop esi
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, MSG_X_POS*10000h
|
2014-04-28 00:13:37 +02:00
|
|
|
mov bx, word[messages_y_pos_dd+4]
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
@@:
|
|
|
|
; display text string in the window
|
|
|
|
mcall 4
|
|
|
|
add edx, esi
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
|
|
|
|
cmp edx, messages+MSG_WIDTH*MSG_HEIGHT
|
2014-02-25 18:34:48 +01:00
|
|
|
jb @b
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Show/hide cursor in command line
|
|
|
|
|
|
|
|
; TODO: make it cursor.draw and cursor.hide ???
|
|
|
|
draw_cursor:
|
2021-02-12 19:08:07 +01:00
|
|
|
pusha
|
|
|
|
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add cx, CMD_Y_SIZE-1
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ebx, [cmdline_pos]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, FONT_X_SIZE
|
|
|
|
add ebx, CMD_X_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, ebx
|
|
|
|
shl ebx, 16
|
|
|
|
or ebx, edx
|
2021-02-12 19:08:07 +01:00
|
|
|
mov edx, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2014-04-24 13:42:27 +02:00
|
|
|
; draw line
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 38
|
2021-02-12 19:08:07 +01:00
|
|
|
|
|
|
|
popa
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
hide_cursor:
|
|
|
|
mov ebx, [cmdline_pos]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, FONT_X_SIZE
|
|
|
|
add ebx, CMD_X_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ebx, 16
|
|
|
|
inc ebx
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
mov cx, CMD_Y_SIZE
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_BG_NORMAL
|
|
|
|
; draw container rectangle/box
|
|
|
|
mcall 13
|
|
|
|
mov ebx, [cmdline_pos]
|
|
|
|
cmp ebx, [cmdline_len]
|
|
|
|
jae .ret
|
|
|
|
; setting up text color scheme and attributes
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
lea edx, [cmdline+ebx]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, FONT_X_SIZE
|
|
|
|
add ebx, CMD_X_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ebx, 16
|
2014-04-28 00:13:37 +02:00
|
|
|
mov bx, word[cmdline_y_pos_dd+4]
|
|
|
|
inc bx
|
2014-02-25 18:34:48 +01:00
|
|
|
push 1
|
|
|
|
pop esi
|
|
|
|
; draw text string in the window
|
|
|
|
mcall 4
|
|
|
|
|
|
|
|
.ret:
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw program window title
|
|
|
|
|
|
|
|
; FIXME: something wrong here
|
|
|
|
redraw_title:
|
|
|
|
; draw container rectangle/box
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, TITLE_X_POS*10000h+DATA_X_POS-TITLE_X_POS
|
|
|
|
mcall 13, , TITLE_Y_POS*10000h+TITLE_Y_SIZE, COLOR_BG_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
draw_title:
|
2019-08-24 18:48:24 +02:00
|
|
|
mcall 38, (DATA_X_POS-2)*10000h+TITLE_X_POS-5, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10001h, COLOR_LINE
|
2014-02-25 18:34:48 +01:00
|
|
|
push NoPrgLoaded_len
|
|
|
|
pop esi
|
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz @f
|
|
|
|
mov esi, [prgname_len]
|
|
|
|
|
|
|
|
@@:
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, esi, FONT_X_SIZE
|
|
|
|
add ebx, TITLE_X_POS+4
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ebx, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
mov bx, DATA_X_POS-10-5-FONT_X_SIZE*7
|
2014-04-28 00:13:37 +02:00
|
|
|
add bx, word[data_x_size_dd+4]
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz @f
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_X_SIZE
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
@@:
|
|
|
|
; draw line with COLOR_LINE (in edx)
|
|
|
|
mcall
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS-10+4)*0x10000 + DATA_X_POS+2
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw line with COLOR_LINE (in edx)
|
|
|
|
mcall
|
|
|
|
mov al, 4
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, TITLE_X_POS*10000h+TITLE_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
; setting up text color scheme and attributes
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, NoPrgLoaded_str
|
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz @f
|
|
|
|
mov edx, [prgname_ptr]
|
|
|
|
|
|
|
|
@@:
|
|
|
|
; draw text string in the window
|
|
|
|
mcall
|
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .nodebuggee
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS-10-FONT_X_SIZE*7)*10000h + TITLE_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, aRunning
|
|
|
|
push 7
|
|
|
|
pop esi
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz @f
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, aPaused
|
|
|
|
dec esi
|
|
|
|
|
|
|
|
@@:
|
|
|
|
; draw line with COLOR_LINE (in edx) in one case
|
2021-02-12 19:08:07 +01:00
|
|
|
; and draw text string with color (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL (in ecx) in another
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
|
|
|
ret
|
|
|
|
|
|
|
|
.nodebuggee:
|
|
|
|
mov al, 38
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS-10-FONT_X_SIZE*7-5)*0x10000 + DATA_X_POS+2
|
|
|
|
mov ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_LINE
|
|
|
|
jmp @b
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;;;;;;;;;;;;;;;;;; REGISTERS PANEL ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display common register content
|
|
|
|
|
|
|
|
; TODO: add format support (e.g. numerical value, or address offset/pointer)
|
|
|
|
|
|
|
|
; in: esi->value, edx->string, ecx = string length, ebx = coord
|
|
|
|
draw_register:
|
2014-04-27 22:55:11 +02:00
|
|
|
push esi
|
2014-02-25 18:34:48 +01:00
|
|
|
push edx
|
|
|
|
push ecx
|
2014-04-27 22:55:11 +02:00
|
|
|
push ebp
|
|
|
|
|
|
|
|
mov ebp, ecx
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-04-27 23:04:27 +02:00
|
|
|
mov eax, [esi]
|
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .cd
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz .cd
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-04-27 22:55:11 +02:00
|
|
|
cmp eax, dword [esi+oldcontext-context]
|
|
|
|
je .cd
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
|
2014-04-27 22:55:11 +02:00
|
|
|
.cd:
|
|
|
|
push eax ;store reg value
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-27 22:55:11 +02:00
|
|
|
mov esi, ebp
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a text string in the window
|
|
|
|
mcall 4
|
2014-04-27 22:55:11 +02:00
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
imul esi, FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
lea edx, [ebx+esi]
|
|
|
|
mov esi, ecx
|
|
|
|
pop ecx
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a number in the window
|
2014-04-27 22:55:11 +02:00
|
|
|
rol ecx, 16
|
|
|
|
mcall 47, 0x00040100
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-27 22:55:11 +02:00
|
|
|
shr ecx, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, (4*FONT_X_SIZE+3) shl 16
|
2014-04-27 22:55:11 +02:00
|
|
|
mcall 47
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-27 22:55:11 +02:00
|
|
|
pop ebp
|
2014-02-25 18:34:48 +01:00
|
|
|
pop ecx
|
|
|
|
pop edx
|
2014-04-27 22:55:11 +02:00
|
|
|
pop esi
|
2014-02-25 18:34:48 +01:00
|
|
|
add edx, ecx
|
|
|
|
ret
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
|
|
|
|
; in: edi=cvt buffer, st0 = value
|
|
|
|
|
|
|
|
;align 4
|
|
|
|
;fp2str:
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-26 22:38:36 +02:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display FPU register (ST0 - ST7) content
|
|
|
|
;
|
2014-04-27 22:55:11 +02:00
|
|
|
; in: ebp->index, ebx = coord
|
|
|
|
|
2014-04-26 22:38:36 +02:00
|
|
|
draw_fpu_register_2:
|
|
|
|
|
|
|
|
.str_buf equ esp
|
2014-04-30 13:45:59 +02:00
|
|
|
.cvt_buf equ .str_buf+32
|
|
|
|
.bcd_man equ .cvt_buf+16
|
|
|
|
.bcd_exp equ .bcd_man+10
|
|
|
|
.exp equ .bcd_exp+10
|
2014-04-28 21:52:21 +02:00
|
|
|
.tmp equ .exp+4
|
2014-04-30 13:45:59 +02:00
|
|
|
.lcl_end equ .tmp+4
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
sub esp, 32+16+10+10+4+4
|
2014-04-27 13:16:25 +02:00
|
|
|
|
|
|
|
mov edi, .str_buf
|
2014-04-30 13:45:59 +02:00
|
|
|
shl ebp, 16
|
|
|
|
lea eax, ['ST0:'+ebp]
|
|
|
|
stosd
|
|
|
|
mov eax, 0x20202020
|
|
|
|
stosd
|
2014-04-27 13:16:25 +02:00
|
|
|
stosd
|
|
|
|
stosd
|
|
|
|
stosd
|
|
|
|
stosd
|
|
|
|
|
|
|
|
movzx eax, word [_fsw]
|
|
|
|
shr eax, 11
|
|
|
|
add eax, ebp
|
2014-04-30 13:45:59 +02:00
|
|
|
shr ebp, 12
|
2014-04-27 13:16:25 +02:00
|
|
|
and eax, 7
|
|
|
|
bt dword [_ftw], eax
|
2014-05-13 22:04:58 +02:00
|
|
|
jc .exam
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov dword [.str_buf+8],' emp'
|
|
|
|
mov word [.str_buf+8+4],'ty'
|
2014-04-27 13:16:25 +02:00
|
|
|
jmp .display
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
.exam:
|
|
|
|
fld tword [_st0+ebp]
|
|
|
|
fxam
|
|
|
|
fstsw ax
|
|
|
|
fstp st1
|
|
|
|
sahf
|
|
|
|
|
|
|
|
jz .c3
|
|
|
|
jp .c2
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
;C0 leaf
|
|
|
|
jc .nan
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
; C3 = 0 C2 = 0 C0 = 0 - invalid
|
2014-04-30 13:45:59 +02:00
|
|
|
mov dword [.str_buf+6], ' inv'
|
|
|
|
mov dword [.str_buf+6+4], 'alid'
|
2014-04-27 13:16:25 +02:00
|
|
|
jmp .display
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
; C3 = 0 C2 = 0 C0 = 1 - Not a Number
|
|
|
|
.nan:
|
|
|
|
mov dword [.str_buf+10], ' NaN'
|
|
|
|
jmp .display
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
;C2 leaf - valid or infinity
|
|
|
|
|
|
|
|
.c2:
|
|
|
|
; C3 = 0 C2 = 1 C0 = 0 - valid number
|
|
|
|
|
|
|
|
jnc .decode
|
|
|
|
|
|
|
|
; C3 = 0 C2 = 1 C0 = 1 - Infinty
|
|
|
|
|
|
|
|
;check sign flag
|
|
|
|
test ah, 0x02
|
|
|
|
jnz @F
|
|
|
|
mov dword [.str_buf+10], '+Inf'
|
|
|
|
jmp .display
|
|
|
|
@@:
|
|
|
|
mov dword [.str_buf+10], '-Inf'
|
|
|
|
jmp .display
|
|
|
|
|
|
|
|
.c3:
|
|
|
|
jp .denormal
|
|
|
|
jc .empty
|
|
|
|
|
|
|
|
; C3 = 1 C2 = 1 C0 = 0 - Zero
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov dword [.str_buf+10], ' 0.0'
|
2014-04-27 13:16:25 +02:00
|
|
|
jmp .display
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
.empty:
|
|
|
|
mov dword [.str_buf+8],' emp'
|
|
|
|
mov word [.str_buf+8+4],'ty'
|
|
|
|
jmp .display
|
|
|
|
|
|
|
|
; C3 = 1 C2 = 1 C0 = 0 - Denormal number
|
|
|
|
|
|
|
|
.denormal:
|
|
|
|
test ah, 0x02
|
|
|
|
jnz @F
|
|
|
|
|
|
|
|
mov dword [.str_buf+6], '+den'
|
|
|
|
mov dword [.str_buf+6+4], 'orm '
|
|
|
|
jmp .display
|
|
|
|
@@:
|
|
|
|
mov dword [.str_buf+6], '-den'
|
|
|
|
mov dword [.str_buf+6+4], 'orm '
|
|
|
|
jmp .display
|
|
|
|
|
2014-04-27 13:16:25 +02:00
|
|
|
.decode:
|
2014-04-30 13:45:59 +02:00
|
|
|
fld tword [_st0+ebp]
|
2014-04-26 22:38:36 +02:00
|
|
|
fabs
|
2014-04-28 21:52:21 +02:00
|
|
|
fld st0
|
|
|
|
fldlg2
|
|
|
|
fld st1
|
2014-04-26 22:38:36 +02:00
|
|
|
fyl2x
|
|
|
|
frndint
|
2014-04-28 21:52:21 +02:00
|
|
|
fist dword [.exp]
|
2014-04-26 22:38:36 +02:00
|
|
|
fld st0
|
|
|
|
fbstp tword [.bcd_exp]
|
2014-04-28 21:52:21 +02:00
|
|
|
|
2014-04-26 22:38:36 +02:00
|
|
|
fldl2t
|
|
|
|
fmulp
|
|
|
|
fld st0
|
|
|
|
frndint
|
|
|
|
fxch
|
|
|
|
fsub st,st1
|
|
|
|
|
|
|
|
f2xm1
|
|
|
|
fld1
|
|
|
|
faddp
|
|
|
|
fscale
|
|
|
|
fstp st1
|
|
|
|
fdivp
|
2014-04-28 21:52:21 +02:00
|
|
|
|
|
|
|
fist dword [.tmp]
|
|
|
|
cmp dword [.tmp], 10
|
|
|
|
jae .fixup
|
|
|
|
|
|
|
|
fstp st1
|
|
|
|
jmp .done
|
|
|
|
|
|
|
|
.fixup:
|
|
|
|
fstp st0
|
|
|
|
|
|
|
|
inc dword [.exp]
|
|
|
|
fild dword [.exp]
|
|
|
|
fld st0
|
2014-04-30 13:45:59 +02:00
|
|
|
fbstp tword [.bcd_exp]
|
2014-04-28 21:52:21 +02:00
|
|
|
|
|
|
|
fldl2t
|
|
|
|
fmulp
|
|
|
|
fld st0
|
|
|
|
frndint
|
|
|
|
fxch
|
2014-04-30 13:45:59 +02:00
|
|
|
fsub st,st1
|
2014-04-28 21:52:21 +02:00
|
|
|
|
|
|
|
f2xm1
|
|
|
|
fld1
|
|
|
|
faddp
|
|
|
|
fscale
|
2014-04-30 13:45:59 +02:00
|
|
|
fstp st1
|
2014-04-28 21:52:21 +02:00
|
|
|
fdivp
|
|
|
|
.done:
|
2014-04-30 13:45:59 +02:00
|
|
|
fimul dword [n_digits]
|
2014-04-26 22:38:36 +02:00
|
|
|
fbstp tword [.bcd_man]
|
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
lea edi, [.cvt_buf]
|
|
|
|
mov edx, dword [.bcd_man]
|
|
|
|
mov ecx, 8
|
2014-04-26 22:38:36 +02:00
|
|
|
@@:
|
2014-04-30 13:45:59 +02:00
|
|
|
xor eax, eax
|
|
|
|
shld eax, edx, 4
|
2014-04-26 22:38:36 +02:00
|
|
|
stosb
|
2014-04-30 13:45:59 +02:00
|
|
|
shl edx, 4
|
|
|
|
loop @B
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
lea esi, [.cvt_buf+7]
|
|
|
|
lea edi, [.str_buf+13]
|
|
|
|
mov ecx, 7
|
|
|
|
mov ah, 0x30
|
|
|
|
std
|
|
|
|
.skip_z:
|
|
|
|
lodsb
|
|
|
|
test al, al
|
|
|
|
jnz .body
|
|
|
|
loop .skip_z
|
|
|
|
.body:
|
|
|
|
add al, ah
|
2014-04-26 22:38:36 +02:00
|
|
|
stosb
|
2014-04-30 13:45:59 +02:00
|
|
|
lodsb
|
|
|
|
jcxz .point
|
|
|
|
loop .body
|
|
|
|
.point:
|
|
|
|
dec edi
|
|
|
|
add al, ah
|
|
|
|
mov ah, '.'
|
2014-04-26 22:38:36 +02:00
|
|
|
stosw
|
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
bt word [_st0+ebp+8], 15
|
|
|
|
jnc .m_sign
|
2014-04-26 22:38:36 +02:00
|
|
|
mov al, '-'
|
2014-04-30 13:45:59 +02:00
|
|
|
mov [edi+1], al
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
.m_sign:
|
|
|
|
cld
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov dx, word [.bcd_exp]
|
|
|
|
test dx, dx
|
|
|
|
jz .display
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
lea edi, [.str_buf+15]
|
|
|
|
mov ax, 'E '
|
|
|
|
cmp byte [.bcd_exp+9], 0x80
|
|
|
|
jne .w_e_sign
|
|
|
|
mov ax, 'E-'
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
.w_e_sign:
|
|
|
|
stosw
|
2014-04-27 13:16:25 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov ecx, 4
|
|
|
|
.skip_lz:
|
|
|
|
xor eax, eax
|
2019-08-24 18:48:24 +02:00
|
|
|
shld ax, dx, 4
|
2014-04-30 13:45:59 +02:00
|
|
|
shl dx, 4
|
|
|
|
test al, al
|
|
|
|
jnz .w_exp
|
|
|
|
loop .skip_lz
|
|
|
|
.w_exp:
|
2019-08-24 18:48:24 +02:00
|
|
|
add al, 0x30
|
2014-04-26 22:38:36 +02:00
|
|
|
stosb
|
2014-04-30 13:45:59 +02:00
|
|
|
xor eax, eax
|
2019-08-24 18:48:24 +02:00
|
|
|
shld ax, dx, 4
|
2014-04-30 13:45:59 +02:00
|
|
|
shl dx,4
|
|
|
|
loop .w_exp
|
2014-04-27 13:16:25 +02:00
|
|
|
|
|
|
|
.display:
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-04-26 22:38:36 +02:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .do_label
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz .do_label
|
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov eax, dword [_st0+ebp]
|
|
|
|
cmp eax, dword [_st0+(oldcontext-context)+ebp]
|
2014-04-26 22:38:36 +02:00
|
|
|
jne .scol
|
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov eax, dword [_st0+ebp+4]
|
|
|
|
cmp eax, dword [_st0+(oldcontext-context)+ebp+4]
|
2014-04-26 22:38:36 +02:00
|
|
|
jne .scol
|
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
mov ax, word [_st0+ebp+8]
|
|
|
|
cmp ax, word [_st0+(oldcontext-context)+ebp+8]
|
2014-04-26 22:38:36 +02:00
|
|
|
je .do_label
|
|
|
|
|
|
|
|
.scol:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
|
2014-04-26 22:38:36 +02:00
|
|
|
|
|
|
|
.do_label:
|
|
|
|
; draw a text string in the window
|
2014-05-01 16:23:42 +02:00
|
|
|
mov esi, 23
|
2014-04-26 22:38:36 +02:00
|
|
|
mov edx, .str_buf
|
2014-04-30 13:45:59 +02:00
|
|
|
mov edi, COLOR_BG_NORMAL
|
2019-08-24 18:48:24 +02:00
|
|
|
mcall 4
|
2014-04-26 22:38:36 +02:00
|
|
|
|
2014-04-30 13:45:59 +02:00
|
|
|
shr ebp, 4
|
|
|
|
add esp, 32+16+10+10+4+4
|
2014-04-26 22:38:36 +02:00
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Show FPU MMX register content
|
|
|
|
;
|
2014-04-27 22:55:11 +02:00
|
|
|
; in: ebp index, ebx = coord
|
|
|
|
|
|
|
|
draw_mmx_register_2:
|
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
sub esp, 24
|
|
|
|
lea edi, [esp+4]
|
|
|
|
|
2014-04-27 22:55:11 +02:00
|
|
|
shl ebp, 4
|
2014-05-01 16:23:42 +02:00
|
|
|
mov eax, ebp
|
|
|
|
shl eax, 16-4
|
|
|
|
add eax, 'MM0:'
|
|
|
|
mov [esp], eax
|
|
|
|
|
|
|
|
mov edx, dword [_mm0+ebp+4]
|
|
|
|
call .hex_2_str
|
|
|
|
mov al, ' '
|
|
|
|
stosb
|
|
|
|
call .hex_2_str
|
|
|
|
mov al, ' '
|
|
|
|
stosb
|
|
|
|
|
|
|
|
mov edx, dword [_mm0+ebp]
|
|
|
|
call .hex_2_str
|
|
|
|
mov al, ' '
|
|
|
|
stosb
|
|
|
|
call .hex_2_str
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .cd
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz .cd
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-27 22:55:11 +02:00
|
|
|
mov eax, dword [_mm0+ebp]
|
|
|
|
cmp eax, dword [_mm0+(oldcontext-context)+ebp]
|
|
|
|
jne .scol
|
|
|
|
|
|
|
|
mov eax, dword [_mm0+ebp+4]
|
|
|
|
cmp eax, dword [_mm0+(oldcontext-context)+ebp+4]
|
|
|
|
je .cd
|
|
|
|
|
|
|
|
.scol:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
|
2014-04-27 22:55:11 +02:00
|
|
|
.cd:
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a text string in the window
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
mov esi, 23
|
2014-04-27 22:55:11 +02:00
|
|
|
mov edx, esp
|
|
|
|
mov edi, COLOR_BG_NORMAL
|
2019-08-24 18:48:24 +02:00
|
|
|
mcall 4
|
2014-05-01 16:23:42 +02:00
|
|
|
shr ebp, 4
|
|
|
|
add esp, 24
|
|
|
|
ret
|
2014-04-27 22:55:11 +02:00
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
align 4
|
|
|
|
.hex_2_str:
|
|
|
|
mov ecx, 4
|
|
|
|
@@:
|
|
|
|
xor eax, eax
|
|
|
|
shld eax, edx, 4
|
|
|
|
aaa
|
|
|
|
adc al, 0x30
|
|
|
|
aad 16
|
|
|
|
shl edx, 4
|
|
|
|
stosb
|
|
|
|
loop @B
|
|
|
|
ret
|
2014-04-27 22:55:11 +02:00
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
align 4
|
|
|
|
draw_fpu_regs:
|
|
|
|
push ebp
|
|
|
|
push 8
|
|
|
|
xor ebp, ebp
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
|
2014-05-01 16:23:42 +02:00
|
|
|
.draw_regs:
|
|
|
|
call draw_fpu_register_2
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
|
2014-05-01 16:23:42 +02:00
|
|
|
inc ebp
|
|
|
|
dec dword [esp]
|
|
|
|
jnz .draw_regs
|
|
|
|
pop eax ;restore stack
|
|
|
|
pop ebp
|
|
|
|
ret
|
2014-04-27 22:55:11 +02:00
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
align 4
|
|
|
|
draw_mmx_regs:
|
|
|
|
push ebp
|
|
|
|
push 8
|
|
|
|
xor ebp, ebp
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
|
2014-05-01 16:23:42 +02:00
|
|
|
.draw_regs:
|
|
|
|
call draw_mmx_register_2
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
|
2014-05-01 16:23:42 +02:00
|
|
|
inc ebp
|
|
|
|
dec dword [esp]
|
|
|
|
jnz .draw_regs
|
|
|
|
pop eax
|
|
|
|
pop ebp
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
2014-05-13 22:04:58 +02:00
|
|
|
align 4
|
|
|
|
draw_sse_regs:
|
|
|
|
push ebp
|
|
|
|
push 8
|
|
|
|
xor ebp, ebp
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+14*(TEXT_Y_CLEARANCE+FONT_Y_SIZE)
|
2014-05-13 22:04:58 +02:00
|
|
|
.draw_regs:
|
|
|
|
; call draw_sse_register
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_Y_SIZE+TEXT_Y_CLEARANCE
|
2014-05-13 22:04:58 +02:00
|
|
|
inc ebp
|
|
|
|
dec dword [esp]
|
|
|
|
jnz .draw_regs
|
|
|
|
pop eax
|
|
|
|
pop ebp
|
|
|
|
ret
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
; TODO add AVX registers
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display contents of EFLAGS register
|
|
|
|
draw_flag:
|
|
|
|
movzx edi, byte [edx+7]
|
|
|
|
bt [_eflags], edi
|
|
|
|
jc .on
|
|
|
|
or byte [edx], 20h
|
|
|
|
jmp .onoff
|
|
|
|
|
|
|
|
.on:
|
|
|
|
and byte [edx], not 20h
|
|
|
|
|
|
|
|
.onoff:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .doit
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz .doit
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
bt [_eflags], edi
|
|
|
|
lahf
|
|
|
|
bt dword [_eflags + oldcontext - context], edi
|
|
|
|
rcl ah, 1
|
|
|
|
test ah, 3
|
|
|
|
jp .doit
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_CHANGED or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
.doit:
|
|
|
|
mov ah, 0
|
|
|
|
mov edi, COLOR_BG_NORMAL
|
|
|
|
; draw a text string in the window in one case
|
|
|
|
; and a number in another
|
|
|
|
; color scheme same as for previously called function (was in ecx)
|
|
|
|
mcall
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw registers frame title
|
|
|
|
|
|
|
|
; Also show current register set (common + MMX, SSE or AVX)
|
|
|
|
draw_reg_title:
|
|
|
|
mov edi, COLOR_BG_NORMAL
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
mov esi, 7
|
|
|
|
cmp [reg_mode], REG_MODE_CPU
|
|
|
|
jz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
@@:
|
2014-05-01 16:23:42 +02:00
|
|
|
movzx edx, [fpu_mode]
|
|
|
|
mov edx, [btn2_tab+edx*4]
|
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a text string in the window
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 4*10000h+REGISTERS_Y_POS
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 4
|
2014-04-24 13:42:27 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [reg_mode], REG_MODE_SSE
|
|
|
|
jz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
@@:
|
|
|
|
mov edx, aSSE
|
|
|
|
; draw a text string in the window
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (7*FONT_X_SIZE+4)*10000h+REGISTERS_Y_POS
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 4
|
2014-04-24 13:42:27 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [reg_mode], REG_MODE_AVX
|
|
|
|
jz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
@@:
|
|
|
|
mov edx, aAVX
|
|
|
|
; draw a text string in the window
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (14*FONT_X_SIZE+4)*10000h+REGISTERS_Y_POS
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 4
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display common registers set + MMX + FPU
|
|
|
|
|
|
|
|
draw_main_registers:
|
2014-04-24 13:42:27 +02:00
|
|
|
; TODO: add support for FPU ST0-ST7 registers
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edi, COLOR_BG_NORMAL
|
|
|
|
mov esi, _eax
|
|
|
|
push 4
|
|
|
|
pop ecx
|
|
|
|
mov edx, regs_strs
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+2*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+3*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _ebx-_eax
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+4*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _ecx-_ebx
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+5*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _edx-_ecx
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+6*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _esi-_edx
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+7*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _edi-_esi
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+8*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _ebp-_edi
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+9*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _esp-_ebp
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+10*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
add esi, _eip-_esp
|
|
|
|
call draw_register
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*10000h+REGISTERS_Y_POS+11*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-04-25 22:05:44 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mov cl, 7
|
|
|
|
add esi, _eflags-_eip
|
|
|
|
call draw_register
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
cmp [fpu_mode], 1
|
|
|
|
je .fpu
|
|
|
|
call draw_mmx_regs
|
|
|
|
jmp @f
|
2019-08-24 18:48:24 +02:00
|
|
|
.fpu:
|
2014-05-01 16:23:42 +02:00
|
|
|
call draw_fpu_regs
|
2019-08-24 18:48:24 +02:00
|
|
|
@@:
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (0 and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz @f
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, (0 and 11b) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
@@:
|
|
|
|
mov edx, aColon
|
|
|
|
xor esi, esi
|
|
|
|
inc esi
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 10*10000h+REGISTERS_Y_POS+12*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 4
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, flags
|
|
|
|
|
|
|
|
@@:
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
call draw_flag
|
|
|
|
inc edx
|
|
|
|
cmp dl, flags_bits and 0xFF
|
|
|
|
jnz @b
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw SSE registers set
|
|
|
|
|
|
|
|
draw_sse_registers:
|
2014-04-24 13:42:27 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw AVX registers set
|
|
|
|
|
|
|
|
draw_avx_registers:
|
2014-04-24 13:42:27 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw all registers sets
|
|
|
|
draw_registers:
|
2014-04-24 13:42:27 +02:00
|
|
|
|
|
|
|
; draw container rectangle/box with COLOR_BG_NORMAL
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (-1)*10000h+(REGISTERS_X_SIZE+2)
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [registers_y_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, ((TITLE_Y_POS+(FONT_Y_SIZE/2))+1)*10000h+2
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 13, , , COLOR_BG_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
call draw_reg_title
|
2014-04-24 13:42:27 +02:00
|
|
|
|
|
|
|
.redraw:
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [reg_mode], REG_MODE_CPU
|
|
|
|
jnz @f
|
|
|
|
call draw_main_registers
|
|
|
|
ret
|
|
|
|
|
|
|
|
@@:
|
|
|
|
cmp [reg_mode], REG_MODE_SSE
|
|
|
|
jnz @f
|
|
|
|
call draw_sse_registers
|
|
|
|
ret
|
|
|
|
|
|
|
|
@@:
|
|
|
|
call draw_avx_registers
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display memory dump
|
|
|
|
|
|
|
|
draw_dump:
|
|
|
|
; draw container rectangle/box in the window
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, DATA_X_POS*10000h
|
|
|
|
mcall 13, , DUMP_Y_POS*10000h+DUMP_Y_SIZE, COLOR_BG_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
.redraw:
|
2014-04-24 13:42:27 +02:00
|
|
|
; addresses
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ebx, 80100h
|
2019-08-24 18:48:24 +02:00
|
|
|
mov edx, DATA_X_POS*10000h + DUMP_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ecx, [dumppos]
|
|
|
|
mov edi, COLOR_BG_NORMAL
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_INACTIVE or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz @f
|
|
|
|
cmp [bSuspended], 0
|
|
|
|
jz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
@@:
|
2014-04-24 13:42:27 +02:00
|
|
|
; draw a number in the window
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 47
|
|
|
|
add ecx, 10h
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, FONT_Y_SIZE + TEXT_Y_CLEARANCE
|
|
|
|
cmp dl, DUMP_Y_POS + DUMP_Y_SIZE
|
2014-02-25 18:34:48 +01:00
|
|
|
jb @b
|
2014-04-24 13:42:27 +02:00
|
|
|
; hex dump of data
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ecx, dumpdata
|
|
|
|
push ecx
|
|
|
|
xor ebx, ebx
|
2019-08-24 18:48:24 +02:00
|
|
|
mov edx, (DATA_X_POS+12*FONT_X_SIZE)*10000h + DUMP_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
cmp [dumpread], ebx
|
|
|
|
jz .hexdumpdone1
|
|
|
|
|
|
|
|
.hexdumploop1:
|
|
|
|
push ebx
|
|
|
|
mov ebx, 20101h
|
2014-04-24 13:42:27 +02:00
|
|
|
; draw a number in the window
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
|
|
|
pop ebx
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, 3*FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
inc ecx
|
|
|
|
inc ebx
|
|
|
|
test bl, 15
|
|
|
|
jz .16
|
|
|
|
test bl, 7
|
|
|
|
jnz @f
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, 2*FONT_X_SIZE*10000h - (FONT_Y_SIZE+TEXT_Y_CLEARANCE) + FONT_X_SIZE*(3*10h+2)*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
.16:
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE) - FONT_X_SIZE*(3*10h+2)*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
@@:
|
|
|
|
cmp ebx, [dumpread]
|
|
|
|
jb .hexdumploop1
|
|
|
|
|
|
|
|
.hexdumpdone1:
|
|
|
|
mov al, 4
|
|
|
|
; copy color value from esi to ecx
|
|
|
|
; to draw text string with 'mcall 4'
|
|
|
|
mov ecx, esi
|
|
|
|
xchg ebx, edx
|
|
|
|
push 2
|
|
|
|
pop esi
|
|
|
|
|
|
|
|
.hexdumploop2:
|
2019-08-24 18:48:24 +02:00
|
|
|
cmp edx, DUMP_HEIGHT*10h
|
2014-02-25 18:34:48 +01:00
|
|
|
jae .hexdumpdone2
|
|
|
|
push edx
|
|
|
|
mov edx, aQuests
|
|
|
|
; draw text string with color in ecx, copied from esi
|
|
|
|
mcall
|
|
|
|
pop edx
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 3*FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
inc edx
|
|
|
|
test dl, 15
|
|
|
|
jz .16x
|
|
|
|
test dl, 7
|
|
|
|
jnz .hexdumploop2
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, 2*FONT_X_SIZE*10000h - (FONT_Y_SIZE+TEXT_Y_CLEARANCE) + FONT_X_SIZE*(3*10h+2)*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
.16x:
|
|
|
|
add ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE) - FONT_X_SIZE*(3*10h+2)*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
jmp .hexdumploop2
|
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
.hexdumpdone2:
|
2014-02-25 18:34:48 +01:00
|
|
|
dec esi
|
2014-04-24 14:23:56 +02:00
|
|
|
; colon, minus signs
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, (DATA_X_POS+8*FONT_X_SIZE)*10000h + DUMP_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, aColon
|
|
|
|
|
|
|
|
@@:
|
|
|
|
mcall
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
|
|
|
cmp bl, DUMP_Y_POS+DUMP_HEIGHT*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
jb @b
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, (DATA_X_POS+(12+3*8)*FONT_X_SIZE)*10000h + DUMP_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, aMinus
|
|
|
|
|
|
|
|
@@:
|
|
|
|
mcall
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
|
|
|
cmp bl, DUMP_Y_POS+DUMP_HEIGHT*(FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
jb @b
|
2014-04-24 14:23:56 +02:00
|
|
|
; ASCII data
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, (DATA_X_POS+(12+3*10h+2+2)*FONT_X_SIZE)*10000h + DUMP_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
pop edx
|
2019-08-24 18:48:24 +02:00
|
|
|
push DUMP_HEIGHT*10h
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
.asciiloop:
|
|
|
|
push edx
|
|
|
|
cmp byte [edx], 20h
|
|
|
|
jae @f
|
|
|
|
mov edx, aPoint
|
|
|
|
|
|
|
|
@@:
|
|
|
|
; draw a text string in the window, color in ecx
|
|
|
|
mcall
|
|
|
|
pop edx
|
|
|
|
inc edx
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, FONT_X_SIZE*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
dec dword [esp]
|
|
|
|
jz .asciidone
|
|
|
|
test byte [esp], 15
|
|
|
|
jnz .asciiloop
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE) - FONT_X_SIZE*10h*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
jmp .asciiloop
|
|
|
|
|
|
|
|
.asciidone:
|
|
|
|
pop ecx
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Display disassembled code
|
|
|
|
|
|
|
|
draw_disasm:
|
|
|
|
|
|
|
|
mov eax, [disasm_start_pos]
|
|
|
|
mov [disasm_cur_pos], eax
|
|
|
|
and [disasm_cur_str], 0
|
|
|
|
|
|
|
|
.loop:
|
|
|
|
mov eax, [disasm_cur_pos]
|
|
|
|
call find_symbol
|
|
|
|
jc .nosymb
|
|
|
|
mov ebx, [disasm_cur_str]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
push ebx
|
2019-08-24 18:48:24 +02:00
|
|
|
lea ecx, [ebx+DISASM_Y_POS-1]
|
2014-02-25 18:34:48 +01:00
|
|
|
shl ecx, 16
|
2021-02-12 19:08:07 +01:00
|
|
|
mov cl, FONT_Y_SIZE+TEXT_Y_CLEARANCE
|
2014-02-25 18:34:48 +01:00
|
|
|
; setting up background color for disassembled text
|
|
|
|
mov edx, COLOR_BG_NORMAL
|
|
|
|
; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white)
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, DATA_X_POS*10000h
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 13
|
2014-02-25 18:34:48 +01:00
|
|
|
pop ebx
|
|
|
|
; copy color value from edx (COLOR_BG_NORMAL)
|
|
|
|
mov edi, edx
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS+FONT_X_SIZE*2)*10000h+DISASM_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, esi
|
|
|
|
|
|
|
|
@@:
|
|
|
|
lodsb
|
|
|
|
test al, al
|
|
|
|
jnz @b
|
|
|
|
mov byte [esi-1], ':'
|
|
|
|
sub esi, edx
|
|
|
|
; normal color
|
|
|
|
; was 0x40000000
|
2021-02-12 19:08:07 +01:00
|
|
|
mov ecx, ((FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_LABEL or 0x40000000)
|
2014-02-25 18:34:48 +01:00
|
|
|
mov al, 4
|
|
|
|
; draw a text string in the window with color COLOR_TXT_NORMAL in ecx
|
|
|
|
mcall
|
|
|
|
mov byte [esi+edx-1], 0
|
2021-02-12 19:08:07 +01:00
|
|
|
; lea esi, [esi*3]
|
|
|
|
; movzx ecx, bx
|
|
|
|
; shr ebx, 16
|
|
|
|
; lea ebx, [ebx+esi*2]
|
|
|
|
; shl ecx, 16
|
|
|
|
; mov cl, 10
|
|
|
|
; imul ebx, 10001h
|
|
|
|
; sub bx, DATA_X_POS
|
|
|
|
; sub bx, word[data_x_size_dd+4]
|
|
|
|
; neg bx
|
|
|
|
; mov al, 13
|
|
|
|
; copy color value from edi
|
|
|
|
; mov edx, edi
|
|
|
|
; draw container rectangle/box for disassembled text, color in edx
|
|
|
|
; mcall
|
2014-02-25 18:34:48 +01:00
|
|
|
inc [disasm_cur_str]
|
2014-04-28 00:13:37 +02:00
|
|
|
mov eax, [disasm_height_dd]
|
|
|
|
cmp [disasm_cur_str], eax
|
2014-02-25 18:34:48 +01:00
|
|
|
jae .loopend
|
|
|
|
|
|
|
|
.nosymb:
|
|
|
|
push [disasm_cur_pos]
|
|
|
|
call disasm_instr
|
|
|
|
pop ebp
|
|
|
|
jc .loopend
|
|
|
|
mov edx, COLOR_BG_NORMAL
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_NORMAL
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, DATA_X_POS*10000h
|
2014-04-28 00:13:37 +02:00
|
|
|
add ebx, [data_x_size_dd+4]
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ecx, [disasm_cur_str]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)*10000h
|
|
|
|
add ecx, (DISASM_Y_POS-1)*10000h + (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
mov eax, ebp
|
|
|
|
pushad
|
|
|
|
call find_enabled_breakpoint
|
|
|
|
popad
|
2014-04-23 21:59:17 +02:00
|
|
|
jnz .nobp
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_BG_BREAKPOINT
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_BREAKPOINT
|
2014-04-23 21:59:17 +02:00
|
|
|
.nobp:
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
mov eax, [_eip]
|
|
|
|
cmp eax, ebp
|
2014-04-23 21:59:17 +02:00
|
|
|
jnz .notcurrent
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_BG_SELECTED
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_SELECTED
|
2014-04-23 21:59:17 +02:00
|
|
|
.notcurrent:
|
|
|
|
push esi ; Save color value for disassembled text
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
; draw container rectangle/box for disassembled text
|
|
|
|
; color in edx
|
|
|
|
mcall 13
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, [disasm_cur_str]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul edx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
|
|
|
add edx, DATA_X_POS*10000h + DISASM_Y_POS
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a number in the window, color in esi
|
|
|
|
mcall 47, 80100h, ebp
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
lea ebx, [edx+8*FONT_X_SIZE*10000h]
|
2014-04-23 21:59:17 +02:00
|
|
|
mov ecx, esi ; text color
|
2014-02-25 18:34:48 +01:00
|
|
|
push 2
|
|
|
|
pop esi
|
|
|
|
mov edx, aColon
|
2014-04-23 21:59:17 +02:00
|
|
|
; draw the colon
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 4
|
|
|
|
push 9
|
|
|
|
pop edi
|
2019-08-24 18:48:24 +02:00
|
|
|
lea edx, [ebx+2*FONT_X_SIZE*10000h]
|
2014-02-25 18:34:48 +01:00
|
|
|
mov ecx, ebp
|
|
|
|
sub ecx, [disasm_start_pos]
|
|
|
|
add ecx, disasm_buffer
|
|
|
|
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_HEX
|
2014-04-23 21:59:17 +02:00
|
|
|
mov eax, [_eip]
|
|
|
|
cmp eax, ebp
|
|
|
|
jnz @f
|
2021-02-12 19:08:07 +01:00
|
|
|
mov esi, (FONT) shl 28 or ((FONT_MULTIPLIER - 1) and 111b) shl 24 or COLOR_TXT_SELECTED
|
2014-04-23 21:59:17 +02:00
|
|
|
@@:
|
2014-02-25 18:34:48 +01:00
|
|
|
.drawhex:
|
|
|
|
; draw a number in the window, color in esi
|
|
|
|
mcall 47, 20101h
|
2019-08-24 18:48:24 +02:00
|
|
|
add edx, FONT_X_SIZE*3*10000h
|
2014-02-25 18:34:48 +01:00
|
|
|
inc ecx
|
|
|
|
inc ebp
|
|
|
|
cmp ebp, [disasm_cur_pos]
|
|
|
|
jae .hexdone
|
|
|
|
dec edi
|
|
|
|
jnz .drawhex
|
|
|
|
push esi
|
|
|
|
mov esi, [disasm_cur_pos]
|
|
|
|
dec esi
|
|
|
|
cmp esi, ebp
|
|
|
|
pop esi
|
|
|
|
jbe .drawhex
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2019-08-24 18:48:24 +02:00
|
|
|
lea ebx, [edx-FONT_X_SIZE*10000h]
|
2014-02-25 18:34:48 +01:00
|
|
|
; copy color value from esi
|
|
|
|
mov ecx, esi
|
|
|
|
push 3
|
|
|
|
pop esi
|
|
|
|
mov edx, aDots
|
|
|
|
; draw a text string in the window, color in ecx
|
|
|
|
mcall 4
|
|
|
|
|
|
|
|
.hexdone:
|
2014-04-23 21:59:17 +02:00
|
|
|
pop esi
|
2014-02-25 18:34:48 +01:00
|
|
|
xor eax, eax
|
|
|
|
mov edi, disasm_string
|
|
|
|
mov edx, edi
|
|
|
|
or ecx, -1
|
|
|
|
repnz scasb
|
|
|
|
not ecx
|
|
|
|
dec ecx
|
|
|
|
xchg ecx, esi
|
|
|
|
mov ebx, [disasm_cur_str]
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ebx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
|
|
|
add ebx, (DATA_X_POS+FONT_X_SIZE*40)*10000h+DISASM_Y_POS
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
; draw a text string in the window, color in ecx
|
|
|
|
mcall 4
|
|
|
|
inc [disasm_cur_str]
|
2014-04-28 00:13:37 +02:00
|
|
|
mov eax, [disasm_height_dd]
|
|
|
|
cmp [disasm_cur_str], eax
|
2014-02-25 18:34:48 +01:00
|
|
|
jb .loop
|
|
|
|
|
|
|
|
.loopend:
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [disasm_height_dd]
|
2014-02-25 18:34:48 +01:00
|
|
|
sub ecx, [disasm_cur_str]
|
|
|
|
jz @f
|
2019-08-24 18:48:24 +02:00
|
|
|
imul ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-02-25 18:34:48 +01:00
|
|
|
inc ecx
|
2019-08-24 18:48:24 +02:00
|
|
|
mov eax, DISASM_Y_POS
|
2014-04-28 00:13:37 +02:00
|
|
|
add eax, [disasm_y_size_dd+4]
|
2014-02-25 18:34:48 +01:00
|
|
|
sub eax, ecx
|
|
|
|
shl eax, 16
|
|
|
|
add ecx, eax
|
2014-04-24 14:23:56 +02:00
|
|
|
; Draw filled rectangle
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, DATA_X_POS*10000h
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall 13, , , COLOR_BG_NORMAL
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
@@:
|
|
|
|
ret
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
; TODO: cleanup of this function, make some global labels local
|
|
|
|
update_disasm_eip:
|
|
|
|
; test if instruction at eip is showed
|
2014-12-01 12:25:43 +01:00
|
|
|
mov ecx, [disasm_height_dd]
|
2014-02-25 18:34:48 +01:00
|
|
|
mov eax, [disasm_start_pos]
|
|
|
|
mov [disasm_cur_pos], eax
|
|
|
|
|
|
|
|
.l:
|
|
|
|
mov eax, [disasm_cur_pos]
|
|
|
|
call find_symbol
|
|
|
|
jc @f
|
|
|
|
dec ecx
|
|
|
|
jz .m
|
|
|
|
|
|
|
|
@@:
|
|
|
|
cmp [_eip], eax
|
2014-04-24 14:23:56 +02:00
|
|
|
jz draw_disasm
|
2014-02-25 18:34:48 +01:00
|
|
|
push ecx
|
|
|
|
call disasm_instr
|
|
|
|
pop ecx
|
|
|
|
jc .m
|
|
|
|
loop .l
|
|
|
|
|
|
|
|
.m:
|
|
|
|
|
|
|
|
update_disasm_eip_force:
|
|
|
|
mov eax, [_eip]
|
|
|
|
mov [disasm_start_pos], eax
|
|
|
|
|
|
|
|
update_disasm:
|
|
|
|
cmp [debuggee_pid], 0
|
|
|
|
jz .no
|
2014-04-24 14:23:56 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 69, 6, [debuggee_pid], 256, [disasm_start_pos], disasm_buffer
|
|
|
|
cmp eax, -1
|
|
|
|
jnz @f
|
|
|
|
mov esi, read_mem_err
|
|
|
|
call put_message
|
|
|
|
|
|
|
|
.no:
|
|
|
|
xor eax, eax
|
|
|
|
|
|
|
|
@@:
|
|
|
|
mov [disasm_buf_size], eax
|
|
|
|
call restore_from_breaks
|
2014-04-24 14:23:56 +02:00
|
|
|
jmp draw_disasm
|
2014-02-25 18:34:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Draw main window
|
|
|
|
|
|
|
|
draw_window:
|
2014-04-24 14:23:56 +02:00
|
|
|
; start window redraw
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 12, 1
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; define window
|
2015-08-09 14:21:01 +02:00
|
|
|
mcall 0, wnd_x_size+10, wnd_y_size+30, (COLOR_BG_NORMAL or 0x33000000), ,caption_str
|
2014-04-28 00:13:37 +02:00
|
|
|
|
|
|
|
; Get actual window size
|
|
|
|
mcall 9, thread_info, -1
|
|
|
|
|
|
|
|
; Check if window is rolled up
|
|
|
|
test [thread_info.wnd_state], 100b
|
|
|
|
jnz .done
|
|
|
|
|
|
|
|
; Check if window isnt smaller then permisseable
|
|
|
|
mov eax, [thread_info.box.width] ; window xsize
|
|
|
|
mov ebx, [thread_info.box.height] ; ysize
|
|
|
|
mov edx, [thread_info.client_box.width] ; work area xsize
|
|
|
|
mov esi, [thread_info.client_box.height] ; ysize
|
|
|
|
sub eax, edx
|
|
|
|
sub ebx, esi
|
|
|
|
|
|
|
|
cmp edx, wnd_x_size
|
|
|
|
jae .x_ok
|
|
|
|
mov edx, wnd_x_size
|
|
|
|
.x_ok:
|
|
|
|
add edx, eax
|
|
|
|
|
|
|
|
cmp esi, wnd_y_size
|
|
|
|
jae .y_ok
|
|
|
|
mov esi, wnd_y_size
|
|
|
|
.y_ok:
|
|
|
|
add esi, ebx
|
|
|
|
mcall 67, -1, -1 ; set the new sizes
|
|
|
|
|
|
|
|
; (re)calculate coordinates of GUI elements
|
|
|
|
mov eax, [thread_info.client_box.width]
|
2019-08-24 18:48:24 +02:00
|
|
|
sub eax, DATA_X_POS + DATA_X_POS + REGISTERS_X_SIZE+3
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [data_x_size_dd+4], eax
|
|
|
|
mov [messages_x_size_dd+4], eax
|
|
|
|
shl eax, 16
|
|
|
|
mov [data_x_size_dd], eax
|
|
|
|
mov [messages_x_size_dd], eax
|
|
|
|
shr eax, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
add eax, DATA_X_POS + 4
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [registers_x_pos_dd+4], eax
|
|
|
|
shl eax, 16
|
|
|
|
mov [registers_x_pos_dd], eax
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-28 00:13:37 +02:00
|
|
|
mov eax, [thread_info.client_box.height]
|
2019-08-24 18:48:24 +02:00
|
|
|
sub eax, CMD_Y_SIZE + DATA_X_POS
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [cmdline_y_pos_dd+4], eax
|
2014-02-25 18:34:48 +01:00
|
|
|
shl eax, 16
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [cmdline_y_pos_dd], eax
|
|
|
|
shr eax, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
sub eax, MSG_Y_SIZE + 4
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [messages_y_pos_dd+4], eax
|
|
|
|
shl eax, 16
|
|
|
|
mov [messages_y_pos_dd], eax
|
|
|
|
shr eax, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
sub eax, DISASM_Y_POS + 4
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [disasm_y_size_dd+4], eax
|
|
|
|
shl eax, 16
|
|
|
|
mov [disasm_y_size_dd], eax
|
|
|
|
shr eax, 16
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ecx, (FONT_Y_SIZE+TEXT_Y_CLEARANCE)
|
2014-04-28 00:13:37 +02:00
|
|
|
xor edx, edx
|
|
|
|
div ecx
|
|
|
|
mov [disasm_height_dd], eax
|
|
|
|
|
|
|
|
mov eax, [thread_info.client_box.height]
|
2019-08-24 18:48:24 +02:00
|
|
|
sub eax, DATA_X_POS + TITLE_Y_POS+(FONT_Y_SIZE/2)+2
|
2014-04-28 00:13:37 +02:00
|
|
|
mov [registers_y_size_dd+4], eax
|
|
|
|
shl eax, 16
|
|
|
|
mov [registers_y_size_dd], eax
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; messages frame
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [messages_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (MSG_X_POS-2)*10000h + (MSG_X_POS+2)
|
2014-02-25 18:34:48 +01:00
|
|
|
push ebx
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [messages_y_pos_dd+2]
|
|
|
|
add ecx, -2*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_LINE
|
|
|
|
mcall 38
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, (MSG_Y_SIZE+2+2)*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, (MSG_X_POS-2)*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
push ebx
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [messages_y_pos_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, (-2*10000h) + (MSG_Y_SIZE+2)
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [messages_x_size_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (MSG_X_POS+2)*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
push ebx
|
|
|
|
mcall
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; command line frame
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, (-2*10000h) + (CMD_Y_SIZE+2)
|
2014-02-25 18:34:48 +01:00
|
|
|
pop ebx
|
|
|
|
mcall
|
|
|
|
pop ebx
|
|
|
|
mcall
|
|
|
|
pop ebx
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, (CMD_Y_SIZE+2)*10001h
|
2014-04-28 00:13:37 +02:00
|
|
|
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [cmdline_y_pos_dd+2]
|
|
|
|
add ecx, (-2*10001h)
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; registers frame
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (-2) shl 16 + (REGISTERS_X_SIZE+3)
|
|
|
|
mov ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2)) shl 16 + 1
|
2014-04-28 00:13:37 +02:00
|
|
|
mov edx, COLOR_LINE
|
|
|
|
mcall 13 ; top
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, ((-2)+(REGISTERS_X_SIZE+3)) shl 16 + 1
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [registers_y_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2)) shl 16 + (+3+1)
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall ; right
|
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (-2) shl 16 + (REGISTERS_X_SIZE+3+1)
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ecx, [registers_y_size_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ecx, ((TITLE_Y_POS+(FONT_Y_SIZE/2))+4) shl 16 + 1
|
2014-04-28 00:13:37 +02:00
|
|
|
mcall ; bottom
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; messages
|
2014-02-25 18:34:48 +01:00
|
|
|
call draw_messages
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; command line & cursor
|
2014-02-25 18:34:48 +01:00
|
|
|
call draw_cmdline
|
|
|
|
call draw_cursor
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; title & registers & dump & disasm
|
2019-08-24 18:48:24 +02:00
|
|
|
mov ebx, (DATA_X_POS-2)*10001h
|
|
|
|
mov ecx, (TITLE_Y_POS+(FONT_Y_SIZE/2))*10000h + (-2)
|
2014-04-28 00:13:37 +02:00
|
|
|
add ecx, [messages_y_pos_dd+4]
|
2014-02-25 18:34:48 +01:00
|
|
|
mov edx, COLOR_LINE
|
|
|
|
mcall 38
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+2]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS+2)*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
2014-04-28 00:13:37 +02:00
|
|
|
mov ebx, [data_x_size_dd+4]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (DATA_X_POS-2)*10000h + (DATA_X_POS+2)
|
|
|
|
mov ecx, (DISASM_Y_POS-4)*10001h
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall
|
|
|
|
|
2014-05-01 16:23:42 +02:00
|
|
|
mov ebx, [registers_x_pos_dd]
|
2019-08-24 18:48:24 +02:00
|
|
|
add ebx, (-1) shl 16 + REGISTERS_X_SIZE + 1
|
|
|
|
mov ecx, (REGISTERS_Y_POS - 2) shl 16 + FONT_Y_SIZE + TEXT_Y_CLEARANCE
|
|
|
|
mov edx, (1 shl 30) + 2
|
2014-05-01 16:23:42 +02:00
|
|
|
mov esi, 0x00808080
|
|
|
|
mcall 8
|
|
|
|
|
|
|
|
|
2014-04-24 14:23:56 +02:00
|
|
|
; redraw whole window again
|
2014-02-25 18:34:48 +01:00
|
|
|
call redraw_title
|
|
|
|
call draw_registers
|
|
|
|
call draw_dump
|
2014-04-24 14:23:56 +02:00
|
|
|
call draw_disasm
|
2014-02-25 18:34:48 +01:00
|
|
|
|
2014-04-28 00:13:37 +02:00
|
|
|
|
|
|
|
.done:
|
2014-04-24 14:23:56 +02:00
|
|
|
; end of window redraw
|
2014-02-25 18:34:48 +01:00
|
|
|
mcall 12, 2
|
|
|
|
ret
|
|
|
|
|
|
|
|
; vim: ft=fasm tabstop=4
|