Compare commits
2 Commits
8bea9d6120
...
0b5fd0d84e
Author | SHA1 | Date |
---|---|---|
Juhani Krekelä | 0b5fd0d84e | |
Juhani Krekelä | 3f5d4ebd16 |
17
hello.asm
17
hello.asm
|
@ -88,9 +88,17 @@ process_event:
|
|||
jne .not_open_file
|
||||
call event_open_file
|
||||
jmp .end
|
||||
.not_opend_file:
|
||||
.not_open_file:
|
||||
|
||||
.end:
|
||||
cmp byte [exiting], 0
|
||||
je .not_exiting
|
||||
; Once we have deallocated our own memory, we may not call any
|
||||
; external functions that might allocate. Safest place to do the
|
||||
; deallocation is just before returning control to our caller
|
||||
call deallocate_own_memory
|
||||
.not_exiting:
|
||||
|
||||
pop es
|
||||
pop ds
|
||||
pop bp
|
||||
|
@ -289,10 +297,7 @@ event_click:
|
|||
jne .not_close
|
||||
.close:
|
||||
call unhook_self_from_window_chain
|
||||
; Nothing can call into us again after we unhook
|
||||
; the window, so deallocate the memory we have
|
||||
; reserved
|
||||
call deallocate_own_memory
|
||||
mov byte [exiting], 1
|
||||
; We don't need to call request_redraw here, since
|
||||
; it will be called unconditionally above
|
||||
jmp .title_bar_end
|
||||
|
@ -672,6 +677,8 @@ request_redraw:
|
|||
; Variables
|
||||
; ------------------------------------------------------------------
|
||||
|
||||
exiting db 0
|
||||
|
||||
window_title db 'Hello'
|
||||
.end:
|
||||
WINDOW_TITLE_LEN equ window_title.end - window_title
|
||||
|
|
17
memory.asm
17
memory.asm
|
@ -76,9 +76,17 @@ process_event:
|
|||
jne .not_open_file
|
||||
call event_open_file
|
||||
jmp .end
|
||||
.not_opend_file:
|
||||
.not_open_file:
|
||||
|
||||
.end:
|
||||
cmp byte [exiting], 0
|
||||
je .not_exiting
|
||||
; Once we have deallocated our own memory, we may not call any
|
||||
; external functions that might allocate. Safest place to do the
|
||||
; deallocation is just before returning control to our caller
|
||||
call deallocate_own_memory
|
||||
.not_exiting:
|
||||
|
||||
pop es
|
||||
pop ds
|
||||
pop bp
|
||||
|
@ -273,10 +281,7 @@ event_click:
|
|||
jne .not_close
|
||||
.close:
|
||||
call unhook_self_from_window_chain
|
||||
; Nothing can call into us again after we unhook
|
||||
; the window, so deallocate the memory we have
|
||||
; reserved
|
||||
call deallocate_own_memory
|
||||
mov byte [exiting], 1
|
||||
; We don't need to call request_redraw here, since
|
||||
; it will be called unconditionally above
|
||||
jmp .title_bar_end
|
||||
|
@ -554,6 +559,8 @@ request_redraw:
|
|||
; Variables
|
||||
; ------------------------------------------------------------------
|
||||
|
||||
exiting db 0
|
||||
|
||||
window_next dw 0xffff
|
||||
window_x dw 65
|
||||
window_y dw 3
|
||||
|
|
Loading…
Reference in New Issue