14d0 INCLUDE SCREEN.INC EXTRN PZTimerOn:far, PZTimerOff:far, PZTimerReport:far DOSSEG .MODEL SMALL .386 .STACK .DATA buffer db 10 dup(?) memwrd dw 7 prompt db 'Enter choice:',13,10,13,10 db '(1) Clean loop',13,10 db '(2) mul dx',13,10 db '(3) cmp dx,imm',13,10 db '(4) cmp mem,imm',13,10 db '(5) mov dx,mem',13,10 db '(6) mov dx,reg',13,10 db '(7) shl dx,5',13,10 db '(8) shl dx,1',13,10 db '(9) add dx,imm',13,10 db '(A) add dx,mem',13,10 db '(B) inc dx',13,10 db '(C) inc mem',13,10 db '(D) screen byte write',13,10 db '(E) screen word write',13,10 db '(F) screen dword write',13,10 db '(G) in al,21h',13,10 db 13,10 db '(Q) Quit',13,10,13,10 db '$' .CODE .STARTUP mainlp: cls mov ah,9 mov dx,offset prompt int 21h mov ah,00h int 16h cmp al,'1' jz l_1 cmp al,'2' jz l_2 cmp al,'3' jz l_3 cmp al,'4' jz l_4 cmp al,'5' jz l_5 cmp al,'6' jz l_6 cmp al,'7' jz l_7 cmp al,'8' jz l_8 cmp al,'9' jz l_9 cmp al,'a' jz l_a cmp al,'b' jz l_b cmp al,'c' jz l_c cmp al,'d' jz l_d cmp al,'e' jz l_e cmp al,'f' jz l_f cmp al,'g' jz l_g cmp al,'q' jz quit jmp mainlp l_1: call cleanloop jmp mainlp l_2: call mul_dx jmp mainlp l_3: call cmp_dx_imm jmp mainlp l_4: call cmp_mem_imm jmp mainlp l_5: call mov_dx_mem jmp mainlp l_6: call mov_dx_reg jmp mainlp l_7: call shl_dx_5 jmp mainlp l_8: call shl_dx_1 jmp mainlp l_9: call add_dx_imm jmp mainlp l_a: call add_dx_mem jmp mainlp l_b: call inc_dx jmp mainlp l_c: call inc_mem jmp mainlp l_d: call screen_byte_write jmp mainlp l_e: call screen_word_write jmp mainlp l_f: call screen_dword_write jmp mainlp l_g: call inport jmp mainlp quit PROC mov ax,4c00h int 21h quit ENDP EVEN cleanloop PROC call PZTimerOn mov cx,8000h lp1: loop lp1 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret cleanloop ENDP mul_dx PROC call PZTimerOn mov cx,8000h lp2: mul dx loop lp2 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret mul_dx ENDP cmp_dx_imm PROC call PZTimerOn mov cx,8000h lp3: cmp dx,8 loop lp3 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret cmp_dx_imm ENDP cmp_mem_imm PROC call PZTimerOn mov cx,8000h lp4: cmp memwrd,8 loop lp4 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret cmp_mem_imm ENDP mov_dx_mem PROC call PZTimerOn mov cx,8000h lp5: mov dx,memwrd loop lp5 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret mov_dx_mem ENDP mov_dx_reg PROC call PZTimerOn mov cx,8000h lp6: mov dx,bx loop lp6 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret mov_dx_reg ENDP shl_dx_5 PROC call PZTimerOn mov cx,8000h lp7: shl dx,5 loop lp7 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret shl_dx_5 ENDP shl_dx_1 PROC call PZTimerOn mov cx,8000h lp8: shl dx,1 loop lp8 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret shl_dx_1 ENDP add_dx_imm PROC call PZTimerOn mov cx,8000h lp9: add dx,7 loop lp9 call PZTimerOff call PZTimerReport mov ah,00 int 16h ret add_dx_imm ENDP add_dx_mem PROC call PZTimerOn mov cx,8000h lpa: add dx,memwrd loop lpa call PZTimerOff call PZTimerReport mov ah,00 int 16h ret add_dx_mem ENDP inc_dx PROC call PZTimerOn mov cx,8000h lpb: inc dx loop lpb call PZTimerOff call PZTimerReport mov ah,00 int 16h ret inc_dx ENDP inc_mem PROC call PZTimerOn mov cx,8000h lpc: inc memwrd loop lpc call PZTimerOff call PZTimerReport mov ah,00 int 16h ret inc_mem ENDP screen_byte_write PROC mov ah,00h mov al,13h ; mcga 320x200x256 int 10h mov dx,0a000h mov es,dx call PZTimerOn mov cx,8000h lpd: mov byte ptr es:[0],0eh loop lpd call PZTimerOff call PZTimerReport mov ah,00 int 16h mov ah,00h mov al,3 int 10h ret screen_byte_write ENDP screen_word_write PROC mov ah,00h mov al,13h ; mcga 320x200x256 int 10h mov dx,0a000h mov es,dx call PZTimerOn mov cx,8000h lpe: mov word ptr es:[0],0e0eh loop lpe call PZTimerOff call PZTimerReport mov ah,00 int 16h mov ah,00h mov al,3 int 10h ret screen_word_write ENDP screen_dword_write PROC mov ah,00h mov al,13h ; mcga 320x200x256 int 10h mov dx,0a000h mov es,dx call PZTimerOn mov cx,8000h lpf: mov dword ptr es:[0],0e0e0e0eh loop lpf call PZTimerOff call PZTimerReport mov ah,00 int 16h mov ah,00h mov al,3 int 10h ret screen_dword_write ENDP inport PROC call PZTimerOn mov cx,8000h lpg: in al,21h loop lpg call PZTimerOff call PZTimerReport mov ah,00 int 16h ret inport ENDP END . 0