flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > what takes so long? |
Author |
|
Matrix 02 Dec 2004, 02:37
after i re write it without
Code: k_up= $48e0 k_down=$50e0 k_esc= $011b k_enter=$1c0d and every macro, it complies just fine, and runs immediately Code: org 256 push es push $b800 pop es mainloop: mov bx,$0505 mov cx,7 .drawmenu: push cx movzx edx,cx dec edx movzx eax,byte [mainmenu_choicepointer] mov ch,$3 cmp ax,dx jne .no_highlight mov ch,$12 .no_highlight: mov si,[menuelements_pointer_array+2*edx] push bx call writestring80x25 ; DS:SI = address of string bl=x bh=y ch=color , 0 terminated string ! pop bx inc bh pop cx loop .drawmenu call breadkey ;returns: AH = BIOS scan code AL = ASCII character note: enhanced cmp ax,$1c0d ;cmp ax,k_enter jne .not_enter movzx ebx,byte [mainmenu_choicepointer] call word [menuelements_pointer_array_procedure_pointers+2*ebx] jmp mainloop .not_enter: cmp ax,$48e0 ;cmp ax,k_up jne .not_up cmp byte [mainmenu_choicepointer],6 jae .notinc inc byte [mainmenu_choicepointer] .notinc: jmp mainloop .not_up: cmp ax,$50e0 ;cmp ax,k_down jne .not_down cmp byte [mainmenu_choicepointer],0 jz .notdec dec byte [mainmenu_choicepointer] .notdec: jmp mainloop .not_down: cmp ax,$011b ;cmp ax,k_esc jne mainloop ; jmp mainloop push ax exit_proc: pop ax pop es int 20h mainmenu_choicepointer: db 6 menuelements_pointer_array_procedure_pointers: dw exit_proc,spdtest,_lock,chiperase,program,erase_program,erase_program_lock menuelements_pointer_array: dw .m01,.m02,.m03,.m04,.m05,.m06,.m07 .m01: db 'EXIT',0 .m02: db 'Communication Speed Test',0 .m03: db 'Lock',0 .m04: db 'Chip Erase',0 .m05: db 'Program',0 .m06: db 'Erase & Program Only',0 .m07: db 'Erase & Program , then Lock',0 writestring80x25: ; DS:SI = address of string bl=x bh=y ch=color , 0 terminated string ! xor ax,ax xchg al,bh mov di,ax shl di,2 add di,ax shl di,4 add di,bx shl di,1 .again: mov ah,ch lodsb or al,al jz .ext2 stosw jmp .again .ext2: ret bwritestring: ; Writes a 0 terminated string to screen ( string is at ds:si ) push ax bx mov bx,7 ; use video page 0, normal white mov ah,$e localloop: lodsb or al,al jnz next_char pop bx ax ret next_char: int 10h jmp localloop breadkey: ;returns: AH = BIOS scan code AL = ASCII character note: enhanced mov ah,$10 int $16 ret spdtest: call display_currentproc ret _lock: call display_currentproc ret chiperase: call display_currentproc ret program: call display_currentproc ret erase_program: call display_currentproc ret erase_program_lock: call display_currentproc ret display_currentproc: movzx ebx,byte [mainmenu_choicepointer] mov si, [menuelements_pointer_array+2*ebx] call bwritestring call breadkey ret its an interesting problem isn't it? |
|||
02 Dec 2004, 02:37 |
|
Matrix 02 Dec 2004, 16:59
i have found the source of the problem:
Grisoft AVG Executable/Heuristic checker hangs on for ~5 seconds while Flat assembler generating code, and also hangs on my menu code for a while upon executing, and for some reason, the version with macros is more suspicious? so hangs up more time. |
|||
02 Dec 2004, 16:59 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.