; 浜様様様様様様様様様様様様様様様様様様様様様様様様融 ; PEEK ; A├皰 閧 跪皀. ; 藩様様様様様様様様様様様様様様様様様様様様様様様様夕 ; ; Copyright (c) 1990 by Gurtjak D. ( Donetsk, USSR ) ; All right reserved. ; main segment para public; assume cs:main,ds:main org 100h start: jmp Install HEX db '0123456789ABCDEF' System db 16 ; hex/char, char = 64, hex= 16 Vseg dw 0b800h SaveCur dd ? ; 筮爼 Ж罔 窶甌 VPage db 0 ; ム ※え 痰肓 RunFlag db 0 ; =1 - 瓱 Alt-Alt-Alt OfsDos dw 0 ; \___むメ 筰 SegDos dw 0 ; / CurSeg dw 0 ; \___オ竕┤ むメ CurOfs dw 0 ; / CountPress db 0 ; 腑砒┴ 皋/皴竅┤ Alt VMode db 0 ; ┐ギ 爛Θ crpos db 1 ; Ж罔 窶甌 flag db 0 ; =1 ┃罔├罔 牀├▲ぅ Displ db 01fh ; =1f - 罌モ. =07 - 腑p.覃 strs db 82 dup (0) ; 矗 CurStr db 1 CurPos db 1 Mode db 0 ; =0 - View ; =1 - Edit ModeOut db 0 ; =0 - 瓱〓 ぎ 牀. 皰÷. ; =1 - --------//-------- 皰÷. SaveSeg dw 0 SaveOfs dw 0 ;栩栩栩栩栩栩栩栩栩栩栩栩栩 INT 08h 栩栩栩栩栩栩栩栩栩栩栩栩栩栩 Int08h PROC NEAR pushf db 9ah ; call oldvector ofs08 dw 0 seg08 dw 0 ; 蹍▲瑙ガ 痰矣 爛キ皀.讚痰 pushf push ax push bx push cx push dx push ds push es push cs pop ds cmp runflag,0 je No_call cmp flag,1 je No_call sti mov es,segdos ; es:bx -> byte DOS status mov bx,ofsdos cmp byte ptr es:[bx],0 jne No_call mov flag,1 sti call Work ; `腮 爛Θ mov flag,0 no_call: pop es pop ds pop dx pop cx pop bx pop ax popf iret Int08h ENDP ;栩栩栩栩栩栩栩栩栩栩栩栩栩栩 INT 28h 栩栩栩栩栩栩栩栩栩栩栩栩栩栩 Int28h PROC NEAR pushf cmp cs:flag,1 je old28h cmp cs:runflag,1 je Ok28 Old28h: popf db 0eah ; jump oldvector Ofs28 dw 0 Seg28 dw 0 Ok28: push ds push es push ax push bx push cx push dx push cs pop ds mov flag,1 sti call Work mov flag,0 pop dx pop cx pop bx pop ax pop es pop ds jmp short old28h Int28h ENDP ;栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩栩 Int09h PROC FAR pushf push ax push ds push es push cs pop ds in al,60h push ax pushf ; call oldvector db 9ah OfsOld dw 0 SegOld dw 0 pop ax mov ah,al and ah,7fh cmp RunFlag,1 je OldVec cmp ah,56 ; alt jne Oldvec test al,80h je PressKey test CountPress,1 je Oldvec inc CountPress jmp short return PressKey: test countpress,1 jne pp1 inc CountPress pp1: cmp CountPress,5 jne Return mov CountPress,0 jmp short Init Oldvec: mov CountPress,0 RETURN: STI pop es pop ds pop ax popf iret INIT: mov runflag,1 jmp short return Int09h ENDP ;樛樛樛樛樛樛樛樛樛 く牀 樛樛樛樛樛樛樛樛樛 Viewer PROC NEAR ; 蹍甃矗 閧 ; 痰→ 筮爼 窶甌 mov cx,0607h mov ah,1 int 10h ; `腑 罔 ; 襤 諷 call OUTPUT ; 襤 爬痺 蹣 ; 窶甌 Ж罔 crpos, 3- 痰牀 mov bh,Vpage mov ah,2 mov dh,2 mov dl,crpos int 10h ; Step5: ; 皀┘ ※荐 call WaitKey push ax Step7: mov dl,system xor dh,dh ; ; ; cmp al,0 je ExtView jmp short NoExt extview: ; 瘉爛襯 る tUp: cmp ah,72 ; Up jne tDn sub CurOfs,dx jmp short St5 tDn: cmp ah,80 ; Down jne tPgUp add CurOfs,dx jmp short St4 tPgUp: cmp ah,73 ; PgUp jne tPgDn mov al,dl mov ah,21 mul ah sub CurOfs,ax St5: jmp short St4 tPgDn: cmp ah,81 ; PgDn jne tLeft mov al,dl mov ah,21 mul ah add CurOfs,ax jmp short St4 tLeft: cmp ah,75 ; Left jne tRight mov al,crpos ; 1 2 3 4 6 7 8 9 dec al cmp al,0 jne Nl0 mov al,1 Nl0: cmp al,5 jne nl5 mov al,4 nl5: mov crpos,al jmp short st4 tRight: cmp ah,77 ; Right jne St4 mov al,crpos inc al cmp al,10 jne nr10 mov al,9 nr10: cmp al,5 jne nr5 mov al,6 nr5: mov crpos,al jmp short St4 NOExt: cmp al,'Z' jbe OkSize sub al,'a'-'A' OkSize: cmp al,'F' ja St4 cmp al,'A' jb TNumbers call Number ; ▲ぅ 16- 罔籥 jmp short St4 TNumbers: cmp al,'0' jb St4 cmp al,'9' ja St4 call Number St4: pop ax ret Viewer ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Editor PROC NEAR ; イ皋牀┘ 痰肓 ; 痰→ 筮爼 窶甌 mov cx,0107h mov ah,1 int 10h ; 襤 諷 call OUTPUT ; 襤 爬痺 蹣 mov di,offset strs mov al,CurStr inc al mov Str0,al mov al,curpos cmp System,64 je S64 ; HEX Editor mov ah,al shl al,1 add al,ah add al,9 cmp ah,8 jbe ss33 add al,2 ss33: mov CurCr,al mov BegCol,al inc al mov EndCol,al mov Atrr,1 call Cursor mov al,0ffh call Edit push ax push ax mov si,offset strs lodsb call ChNum mov cl,4 shl al,cl mov dl,al lodsb call ChNum or dl,al mov al,dl jmp short recd S64: ; Char. editor add al,12 mov CurCr,al mov BegCol,al mov EndCol,al mov Atrr,0 mov al,0ffh call Edit push ax push ax cmp al,0 je MovePn mov si,offset strs lodsb Recd: push ax mov al,CurStr dec al mul byte ptr System mov bl,CurPos dec bl add al,bl adc ah,0 mov di,CurOfs add di,ax pop ax mov es,CurSeg stosb ; ムガラキ┘ 礫皀ォ MovePn: mov al,CurPos mov cl,CurCr cmp cl,EndCol jbe cc10 cmp al,System jne cc11 mov al,0 inc CurStr cc11: inc al jmp short cc20 cc10: cmp cl,BegCol jae cc21 cmp al,1 jne cc13 mov al,System dec CurStr inc al cc13: dec al cc20: mov CurPos,al cc21: mov cl,curstr pop ax cmp al,0 jne cc4 cmp ah,72 jne cctd dec cl jmp short cc4 cctd: cmp ah,80 jne cc4 inc cl cc4: cmp cl,0 jne cc3 mov cl,22 cc3: cmp cl,23 jne cc5 mov cl,1 cc5: mov CurStr,cl pop ax ret Editor ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 FirstSeg dw 50h LastSeg dw 0 LastStr db 0 FirstMCB dw 0 SizeMCB dw 0 Parent dw 0 LastBl dw 0 McbTit db ' むメ Кム ぅユ ゛ ' db ' ムュ腑襯 爛琺 ',0 Tcl db 7,8,10,15,34,0 DOS db 'DOS',0 ROM db 'ROM ゛',0 Env db 'Env',0 BIOS db 'ROM BIOS',0 VdpEGA db 'EGA video',0 Vdp db 'Text video',0 Free db '〓`ぅ',0 Vect db 'Int. Vectors',0 Vars db 'BIOS Variable',0 Unc db '????',0 nambl db ' ゛ 閧',0 lenbl db '┃ ゛ ( )',0 ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Info PROC NEAR ; 筮p罔 皀竕ガ ゛ mov cx,0428h call BlueBar mov dx,0a17h mov si,offset nambl call BlueOutstr inc dh mov si,offset Zbeg call outstr inc dh mov si,offset Zend call outstr inc dh mov si,offset lenbl call outstr mov ax,CurOfs mov cl,4 shr ax,cl add ax,CurSeg mov LastSeg,ax call Explore push cs pop es mov dx,0a2dh mov al,Displ call OutStr mov ax,LastSeg mov dx,0b2dh call OutHex xor ax,ax mov dx,0b32h call OutHex mov ax,LastSeg add ax,SizeMCB dec ax mov dx,0c2dh call OutHex mov ax,0fh mov dx,0c32h call OutHex mov di,offset strs mov ax,3ah stosw mov si,offset strs mov dx,0b31h mov al,Displ push si call OutStr pop si mov dx,0c31h call OutStr mov dx,16 mov ax,SizeMCB mul dx mov cx,0d2dh call OutDec call WaitKey ret Info ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 MapTable PROC NEAR ; МpΕ┘ p硅 閧 mov ah,1 mov ch,20h int 10h mov si,offset Tcl mov dx,100h call OfsVideo mov dl,Displ mov dh,0 call OutLine mov si,offset McbTit add di,160 push di push si mov dx,200h mov al,Displ call OutStr mov si,offset Tcl mov dx,300h call OfsVideo mov dl,Displ mov dh,2 call OutLine pop si pop di mov cx,20 mcb1: add di,160 push si push di mcb3: lodsb cmp al,0 je mcb4 cmp al,'' je Mcb2 cmp al,'' je Mcb2 mov al,' ' mcb2: stosb mov al,Displ stosb jmp short mcb3 mcb4: pop di pop si loop mcb1 mov dx,1800h call OfsVideo mov si,offset Tcl mov dl,Displ mov dh,1 call OutLine ret MapTable ENDP Explore PROC NEAR ; LastSeg - 瓮キ - 諷ぅ ゛ ; si - ━ ゛. Parent - 牀え皀. SizeMCB - Кム ゛. () mov Parent,0 mov ax,FirstMCB Sub ax,LastSeg jbe NoDOS cmp LastSeg,40h jae NoVectors mov LastSeg,0 mov si,offset Vect mov SizeMCB,40h ret NoVectors: cmp LastSeg,50h jae tdos mov LastSeg,40h mov si,offset Vars mov SizeMCB,10h ret tdos: mov LastSeg,50h mov si,offset Dos mov SizeMCB,ax ret NoDOS: mov si,offset Unc cmp LastSeg,0A000h jae NoRAM ; 牀┘ 瓷 MCB mov dx,FirstMCB ex1: mov es,dx xor bx,bx mov cx,es:[bx+1] mov Parent,cx mov cx,es:[bx+3] add cx,dx cmp LastSeg,dx jb ex2 cmp LastSeg,cx jbe ex3 ex2: mov dx,cx cmp byte ptr es:[bx],'Z' je ex18 inc dx jmp short ex1 ex3: mov cx,es:[bx+3] mov SizeMCB,cx inc dx mov LastSeg,dx cmp byte ptr es:[bx],'Z' jne short OkEx mov si,offset free jmp short noEn1 ex18: mov ax,0a000h sub ax,LastSeg mov SizeMCB,ax ; LastSeg,Parent,SizeMCB ぅ. 爛ぅ錺 - 艪 轤. Okex: mov es,lastseg xor bx,bx cmp word ptr es:[bx],20cdh jne NoProgram ; КΝ 牀 push es mov dx,es:[bx+2ch] ; 瓮キ Environment mov es,dx call TestEnvironment pop es jc NoProgram ret NoProgram: ; ム閧 - 牀 call TestEnvironment jc NoEn1 mov si,offset env noEn1: ret NoRAM: xor ax,ax mov es,ax cmp LastSeg,0c000h jae NoVideo cmp LastSeg,0b000h jae NoEGAV egavideo: mov LastSeg,0a000h mov SizeMCB,1000h cmp byte ptr es:[463h],0b4h je NoColor add SizeMCB,800h NoColor: cmp byte ptr es:[487h],0 je NoEn1 mov si,offset VdpEGA jmp short NoEn1 NoEGAV: cmp LastSeg,0b800h jae OkTxt cmp byte ptr es:[463h],0d4h je egavideo OkTxt: cmp byte ptr es:[463h],0b4h je exe1 mov SizeMCB,800h mov si,offset Vdp jmp short ExE1 NoVideo: cmp LastSeg,0f800h jb RomScan mov lastseg,0f800h mov SizeMCB,800h mov si,offset BIOS exe1: jmp short ExE RomScan: xor bp,bp mov ax,0c000h mov LastBl,ax rs1: mov es,ax cmp ax,0f800h jne ex95 or bp,bp jne ex97 jmp short exe ex95: cmp word ptr es:[0],055aah je blrm cmp word ptr es:[0],0aa55h jne NoPZU BlRm: cmp LastSeg,ax jb ex97 or bp,bp je Noflag ex97: mov bx,lastBl sub ax,bx mov SizeMCB,ax mov LastSeg,bx jmp short exe NoFlag: mov bl,es:[2] xor bh,bh mov cl,5 shl bx,cl mov cx,ax add cx,bx mov LastBl,cx cmp LastSeg,cx jb OKROM add ax,bx jmp short rs1 NoPZU: cmp LastSeg,ax ja ex99 mov bp,1 ex99: add ax,80h jmp short rs1 OKROM: mov LastSeg,ax mov SizeMCB,bx mov si,offset ROM ExE: ret Explore ENDP TestEnvironment PROC NEAR xor di,di mov cx,500 cld ten1: jcxz l000 xor al,al repne scasb scasb jne ten1 nop mov bx,di cmp word ptr es:[bx+3],5c3ah je Envir l000: stc ret Envir: add di,5 mov bx,di push ds push es pop ds push cs pop es mov si,bx en2: mov di,offset strs en1: lodsb stosb cmp al,0 je en3 cmp al,'\' je en2 jmp short en1 en3: mov si,offset strs clc pop ds ret TestEnvironment ENDP Cnt db 0 Interrupts Proc near ; ッ爛ぅ錺 爛琺, ムュ. 瓮キ LastSeg か┃ SizeMCB ; ョモ 痰牀 LastStr Ж罔 48. 甄 腮甄 > 12 ; - 甄イ竡薀 痰牀. mov cx,LastSeg mov dx,cx add dx,SizeMCB jne nolst dec dx nolst: xor ax,ax mov es,ax mov Cnt,0 mov bx,0 int1: mov ax,es:[bx] shr ax,1 shr ax,1 shr ax,1 shr ax,1 add ax,es:[bx+2] or ax,ax je NoInt cmp ax,cx jb NoInt cmp ax,dx ja NoInt push bx shr bx,1 shr bx,1 mov al,bl inc Cnt cmp Cnt,1 jne NoCur push ax push dx mov ah,2 mov bh,VPage mov dl,46 mov dh,LastStr int 10h pop dx pop ax NoCur: mov ah,al push ax call ByteFormat1 mov ah,0eh int 10h pop ax call ByteFormat2 mov ah,0eh int 10h mov ax,0e20h int 10h pop bx cmp Cnt,11 jne NoInt mov Cnt,0 inc LastStr cmp LastStr,24 jae trt NoInt: add bx,4 cmp bh,4 jne int1 trt: ret Interrupts endp ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 SFseg dw 0 fm db 0 MCB PROC NEAR ; p 閧 mov ax,0 mov FirstSeg,ax mcb10: mov ax,FirstSeg mov LastSeg,ax mov fm,0 call MapTable mov LastStr,4 NoLast: call Explore ; LastSeg - 瓮キ - 諷ぅ ゛ ; si - ━ ゛. Parent - 牀え皀. SizeMCB - Кム ゛. () mov ax,LastSeg cmp ax,FirstSeg jne mc30 mov fm,1 jmp short mc40 mc30: cmp fm,1 jne mc40 mov SFSeg,ax mov fm,0 mc40: mov dh,LastStr mov al,1fh mov dl,30 call OutStr mov ax,LastSeg push ds pop es mov dl,3 mov ax,LastSeg call OutHex mov dl,21 mov ax,Parent call OutHex mov ax,SizeMCB mov dX,16 mul dx mov ch,LastStr mov cl,10 call OutDec ; 襤 dx,ax Ж罔 11 痰牀 LastStr call Interrupts mov ax,SizeMCB add LastSeg,ax inc LastStr cmp LastSeg,0 je emem cmp LastStr,24 jb NoLast emem: call WaitKey cmp al,0 jne mcb11 cmp ah,80 jne mcb12 cmp FirstSeg,0f800h je mcb12 mov ax,SFSeg mov FirstSeg,ax mcb12: jmp mcb10 mcb11: ret MCB ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 OutHex PROC NEAR ; 襤 腮甄 ax Ж罔 Dh,DL push dx mov di,offset strs call WordFormat mov al,0 stosb pop dx mov si,offset strs mov al,Displ call OutStr ret OutHex ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 OutDec PROC NEAR ; 襤 腮甄 dx,ax Ж罔 cl,ch push cx mov bx,10 mov di,offset strs + 6 std mov byte ptr es:[di],0 dec di od1: div bx push ax push bx mov bx,dx add bx,offset Hex mov al,[bx] stosb pop bx pop ax xor dx,dx or ax,ax jne od1 cld inc di mov si,di pop dx mov al,Displ call OutStr ret OutDec ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 NoCalc db '讓祀閧 閧 ぅ',0 CALC PROC NEAR ; 襷 讓祀閧p ; 祗罔 ax=8fcch di=0 (int 2fh ) -> es:di - far call むメ 讓祀閧 mov ax,8fcch xor di,di int 2fh or di,di jne Ycalc mov cl,30 mov si,offset NoCalc call ErrorStr ret Ycalc: mov OfCl,di mov SgCl,es mov cx,1000 yc1: loop yc1 db 9ah ; call far ptr OfCl dw 0 SgCl dw 0 ret CALC ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 PressF3 PROC NEAR mov al,64+16 sub al,System mov System,al mov CurPos,1 mov CurStr,1 ret PressF3 ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 PressF5 PROC NEAR mov al,1 sub al,Mode mov Mode,al ret PressF5 ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 PressF4 PROC NEAR mov al,1 sub al,ModeOut mov ModeOut,al ret PressF4 ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 FKeyTable dw Help ; F1 dw SaveFile ; F2 dw PressF3 ; F3 dw PressF4 ; F4 dw PressF5 ; F5 dw Info ; F6 dw Search ; F7 dw MCB ; F8 dw CALC ; F9 ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Work PROC NEAR ; 甅↓ 痰 ┃罔├罔 pushf push es push ds push ax push bx push cx push dx push si push di push bp mov ax,3509h int 21h mov cs:SaveSeg,es mov cs:SaveOfs,bx mov ax,2509h mov dx,cs:OfsOld mov ds,cs:SegOld int 21h push cs pop ds mov ax,40h mov es,ax mov Vseg,0b800h mov al,es:[49h] ; ┐ギ爛Θ mov VMode,al mov Displ,1fh and al,7fh cmp al,7 ja EGAMode jne V_Page mov Vseg,0b000h mov Displ,07h V_Page: cmp al,3 ja EGAMode mov dx,es:63h ; むメ ┐ギ 珥 mov al,12 out dx,al inc dx in al,dx mov ah,al dec dx mov al,13 out dx,al inc dx in al,dx mov cl,4 mov dx,2 mul dx shr ax,cl add VSeg,ax shr ax,cl shr ax,cl mov VPage,al ; 諛甄錺 ※ぅ 痰聶 ; video RAM -> Video push cs pop es push ds mov ds,Vseg Xor si,si mov di,offset Video mov cx,80*25 rep movsw pop ds ; 縲. 爐. 筮爼 窶甌 mov ah,3 mov bh,VPage int 10h mov word ptr SaveCur,dx mov word ptr SaveCur+2,cx jmp short Step44 EGAMode: mov ax,3 int 10h Step44: mov Mode,0 mov CrPos,1 mov ah,52h int 21h mov ax,es:[bx-2] mov FirstMCB,ax Step4: cmp mode,1 jne View call Editor jmp short ll1 View: call Viewer ll1: cmp al,0 jne No_Extend ; 瘉爛襯 る sub ah,59 jb Step4 cmp ah,8 ja Step4 mov bl,ah xor bh,bh shl bx,1 call word ptr FKeyTable[bx] jmp short Step4 No_Extend: cmp al,27 ; Esc jne Step4 cmp VMode,4 jae Step10 ; restore cursor mov ah,2 mov bh,Vpage mov dx,word ptr SaveCur int 10h mov ah,1 mov cx,word ptr SaveCur+2 int 10h cmp VMode,4 ja Step10 mov cx,80*25 mov es,Vseg xor di,di mov si,offset Video rep movsw ; 瘁←│ガ 蹣 jmp short the_end Step10: mov ah,0 mov al,VMode int 10h the_end: mov ax,2509h mov dx,SaveOfs mov ds,cs:SaveSeg int 21h mov cs:runflag,0 pop bp pop di pop si pop dx pop cx pop bx pop ax pop ds pop es popf ret Work ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ChNum PROC NEAR ; ムア 瓱〓讚 瓱 腮甄 爼讚竡 ; Chr(al) -> Ord(chr) cmp al,'9' jbe cc1 sub al,'A'-'9'-1 cc1: sub al,'0' ret ChNum ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ; Number PROC NEAR ; 爛Θ 牀甃矗 罔籥 - ├キ碎 むメ mov bh,0 mov dx,0fff0h mov cl,crpos call ChNum cmp crpos,4 ja CorOfs CorSeg: mov bl,al sub cl,4 neg cl shl cl,1 shl cl,1 shl bx,cl rol dx,cl mov cx,CurSeg and cx,dx or cx,bx mov CurSeg,cx jmp short ce1 CorOfs: mov bl,al sub cl,9 neg cl shl cl,1 shl cl,1 shl bx,cl rol dx,cl mov cx,CurOfs and cx,dx or cx,bx mov CurOfs,cx Ce1: mov al,crpos cmp al,9 je nr11 inc al nr11: cmp al,5 jne nr51 mov al,6 nr51: mov crpos,al ret Number ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Hst1 db 'F1',0,' Help',0 Hst2 db 'F2',0,' 瘡 ┼ 竅 閧 ',0 Hst3 db 'F3',0,' ムオ鈑キ┘ HEX / ASCII',0 Hst4 db 'F4',0,' ムオ鈑キ┘ 爛Θ 襤 瓱〓',0 Hst5 db 'F5',0,' 蹍甃矗 / 爛皋牀┘',0 Hst6 db 'F6',0,' 筮爼罔 皀竕ガ ゛',0 Hst7 db 'F7',0,' 瓷 痰牀',0 Hst8 db 'F8',0,' 珥 閧',0 Hst9 db 'F9',0,' 讓祀閧 ( 甎讌礇矚 CALC.COM )',0 HelpStr PROC NEAR ; 襤 痰牀 Help 蹣 xor bl,bl hstt1: push dx mov al,Displ and al,1eh push dx call OutStr pop dx add dl,3 mov al,Displ call OutStr inc bl pop dx inc dh cmp bl,9 jb hstt1 ret HelpStr ENDP Help PROC NEAR ; 襤 Help 蹣 mov cx,0b30h call BlueBar mov dx,712h mov si,offset Hst1 call HelpStr call WaitKey ret Help ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ZBeg db '讚覃 むメ ',0 ZEnd db 'ョ覃 むメ ',0 ZFile db ' ',0 EFile db '荐! 瓱',0 WFile db 'ぎΔ皀 礬痰 !',0 EndOfs dw 0FFFFh BegOfs dw 0 File db 'dump.txt',0,15 dup (0) FileMode db 0 ; 0 - 瓠牀 ; 1 - 瓠牀 閧 Fms1 db ' 瘡 ',0 Fms2 db ' 瘡 閧 ',0 SaveWindow PROC NEAR ; М÷Ε┘ キ 爛Θ 瓱 mov cx,0520h call BlueBar mov al,Displ and al,1eh mov si,offset Fms1 cmp FileMode,0 je Sw12 mov si,offset Fms2 Sw12: mov dx,091ch call OutStr mov si,offset ZFile mov dx,0a19h ; dh - strs. dl - col. call BlueOutStr mov dx,0a25h mov al,Displ mov si,offset File call OutStr mov si,offset ZBeg mov dx,0c19h call BlueOutStr push cs pop es mov di,offset strs mov ax,CurSeg call WordFormat mov al,':' stosb mov ax,BegOfs call WordFormat mov al,0 stosb mov dx,0c2ah mov si,offset strs mov al,Displ call OutStr mov si,offset ZEnd mov dx,0d19h call BlueOutStr mov di,offset strs mov ax,CurSeg call WordFormat mov al,':' stosb mov ax,EndOfs call WordFormat mov al,0 stosb mov dx,0d2ah mov si,offset strs mov al,Displ call OutStr ret SaveWindow ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 SaveFile PROC NEAR ; ┃┘ mov bx,CurOfs mov BegOfs,bx mov al,System mov ah,21 mul ah add bx,ax mov EndOfs,bx UFile: mov str0,10 SF1: call SaveWindow cmp str0,9 je TFMode cmp str0,10 je TFile cmp str0,12 jne T1end jmp TBeg t1end: jmp Tend sf123: cmp al,27 ; esc jne sf456 jmp ExitSave sf456: cmp al,13 ; enter jne sf1 sf223: jmp Ok_Save UtFile: mov CurCr,1dh mov str0,9 TFMode: call Cursor call WaitKey cmp al,0 jne tfm1 cmp ah,72 je UEnd cmp ah,80 je UFile tfm1: cmp al,27 jne sf112 jmp ExitSave sf112: cmp al,13 je Sf223 mov al,1 sub al,FileMode mov FileMode,al jmp short sf123 TFile: mov di,offset file mov begcol,25h mov endcol,35h mov AtrStr,0 call EditString cmp al,0 jne sf123 cmp ah,80 je UBeg cmp ah,72 je UTfile jmp sf1 ; UEnd: mov str0,13 mov CurCr,2fh jmp short tend UBeg: mov str0,12 mov CurCr,2fh tbeg: call EditWord mov BegOfs,dx cmp al,0 jne sf90 cmp ah,72 jne sf91 jmp UFile sf91: cmp ah,80 jne sf90 jmp UEnd sf90: jmp sf123 ; tend: call EditWord mov EndOfs,dx cmp al,0 jne sf90 te11: cmp ah,72 jne sf81 jmp UBeg sf81: cmp ah,80 jne sf80 jmp UtFile sf80: jmp short sf90 ExitSave: ret Ok_Save: mov ah,3ch mov dx,offset File mov cx,20h int 21h jc ErrorSave mov bx,ax call WaitMessage cmp FileMode,1 je MemorySave mov dx,BegOfs sf3: push dx call Memory mov dx,offset strs mov cx,82 mov ah,40h int 21h pop dx cmp ax,cx jne Error1Save add dl,System adc dh,0 jc Close cmp dx,EndOfs jbe sf3 jmp short Close MemorySave: push ds mov ds,CurSeg mov dx,cs:BegOfs mov cx,cs:EndOfs sub cx,dx mov ah,40h int 21h cmp ax,cx jne Error1Save pop ds Close: mov ah,3eh int 21h jmp short EXSV EXSV: ret error1Save: mov ah,3eh int 21h ErrorSave: call SaveWindow mov cl,13 mov si,offset EFile call ErrorStr ret SaveFile ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 WaitMessage PROC NEAR mov cx,0118h mov dx,0a1ah cmp Displ,1fh jne wmmono mov al,4fh jmp short DrWm wmmono: mov al,70h drwm: call Bar mov dx,0b1ch mov si,offset WFile mov al,0ceh call OutStr ret WaitMessage ENDP EditWord PROC NEAR ; イ皋牀┘ 甄 mov di,offset strs mov BegCol,2fh mov EndCol,32h mov Atrr,1 Ew2: mov al,0ffh call Edit push ax mov cl,CurCr cmp cl,EndCol jbe ew1 mov cl,EndCol jmp short NewCol ew1: cmp cl,BegCol jae Tran mov cl,BegCol NewCol: mov CurCr,cl pop ax jmp short Ew2 Tran: mov si,offset strs call Transl pop ax ret EditWord ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ; Transl PROC NEAR ; ムア 甄 ├ 痰牀 si 爛痰 dx xor dx,dx mov bl,4 mov cl,4 ew6: lodsb call ChNum shl dx,cl or dl,al dec bl jnz ew6 ret Transl ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ESearch db '矗 ぅ',0 WSearch db 'Μ皀 遏竡 ※蓊',0 HStr db 'Hex',0 AStr db 'ASCII',0 TSR db '矗 か 瓷',0 TWS db 'ぅ 瓷碎',0 BegSeg dw 0 EndSeg dw 0 LenStr db 0 SStr db 16 dup (0) SearchWindow PROC NEAR ; М÷Ε┘ キ 爛Θ 瓷 mov cx,0637h mov dx,080bh mov al,displ and al,1eh push ax call Bar ; 痰牀 8, . 11 ; か┃ - 55, 諱 - 6 pop ax mov si,offset Tsr mov dx,090eh call OutStr mov si,offset Hstr mov dx,0a0eh ; dh - str. dl - col. call BlueOutStr push cs pop es mov di,offset strs mov si,offset SStr mov dl,LenStr srw1: cmp dl,0 je srw3 lodsb push ax mov bl,al xor bh,bh mov cl,4 shr bl,cl mov al,Hex[bx] stosb pop bx xor bh,bh and bl,0fh mov al,Hex[bx] stosb mov al,' ' stosb dec dl jmp short srw1 srw3: mov al,0 stosb mov si,offset strs mov dx,0a14h mov al,displ call OutStr mov si,offset Astr mov dx,0b0eh call BlueOutStr mov si,offset SStr mov dx,0b14h call OfsVideo mov cl,LenStr xor ch,ch srw33: jcxz srw43 lodsb stosb mov al,displ stosb dec cx jmp short srw33 srw43: mov al,Displ and al,1eh mov si,offset TWS mov dx,0c0eh call OutStr mov si,offset ZBeg mov dx,0d0eh call BlueOutStr push cs pop es mov di,offset strs mov ax,BegSeg call WordFormat mov al,':' stosb mov ax,BegOfs call WordFormat mov al,0 stosb mov dx,0d1fh mov si,offset strs mov al,displ call OutStr mov si,offset ZEnd mov dx,0e0eh call BlueOutStr mov di,offset strs mov ax,EndSeg call WordFormat mov al,':' stosb mov ax,EndOfs call WordFormat mov al,0 stosb mov dx,0e1fh mov si,offset strs mov al,displ call OutStr ret SearchWindow ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 CrPs db 0 ; ム 爛皋牀┬ Search PROC NEAR ; 瓷 痰牀 閧 mov ax,curseg mov begseg,ax mov endseg,ax mov ax,curofs inc ax mov begofs,ax mov endofs,0ffffh UASCII: mov str0,11 jmp short s1 UHexS: mov str0,10 mov CrPs,0 jmp short s1 UBP: mov str0,13 mov CurCr,1fh jmp short s1 UEP: mov str0,14 mov CurCr,1fh s1: call SearchWindow call Cursor mov al,Str0 cmp al,10 je THex cmp al,11 je TASCII cmp al,13 je TBP jmp short TEP SimpleText: cmp al,27 jne Up12 jmp ExitSearch Up12: cmp al,13 jne s1 jmp OkSearch jmp short s1 TASCII: mov di,offset SStr mov begcol,14h mov endcol,22h mov AtrStr,1 call EditString cmp al,0 jne SimpleText cmp ah,80 je UBp cmp ah,72 je UHEXS s11: jmp s1 TBP: call EditPointer mov BegSeg,dx mov BegOfs,bx cmp al,0 jne SimpleText cmp ah,80 jne Up2 jmp UEp Up2: cmp ah,72 jne s11 jmp UASCII TEP: call EditPointer mov EndSeg,dx mov EndOfs,bx cmp al,0 jne SimpleText cmp ah,80 jne Up1 jmp UHexS up1: cmp ah,72 jne s11 jmp UBP ; Thex: mov al,CrPs mov ah,3 mul ah add al,14h mov CurCr,al mov BegCol,al inc al mov EndCol,al mov di,offset strs mov Atrr,1 mov al,0ffh push di call Edit pop si push ax cmp al,0 je sr65 cmp al,8 jne sr66 mov al,LenStr cmp al,0 je sr67 dec al mov LenStr,al mov CrPs,al sr67: pop ax jmp s1 sr66: mov dl,LenStr cmp dl,CrPs ja sr65 cmp dl,15 jae sr65 inc dl mov LenStr,dl sr65: mov dl,0 mov cx,2 srl1: lodsb cmp al,' ' jne Sr123 mov al,'0' Sr123: call ChNum shl dl,1 shl dl,1 shl dl,1 shl dl,1 or dl,al loop srl1 mov di,offset SStr mov al,CrPs cbw add di,ax mov al,dl stosb mov al,CurCr cmp al,EndCol jbe sr45 mov al,LenStr cmp CrPs,al je sr45 inc CrPs sr45: pop ax cmp al,0 je InpN jmp SimpleText InpN: mov dl,CrPs cmp ah,80 jne Up10 jmp UASCII up10: cmp ah,72 jne up110 jmp UEp up110: cmp ah,71 jne up112 mov dl,0 jmp short s12 up112: cmp ah,79 jne up113 mov dl,LenStr jmp short s12 up113: cmp ah,75 jne s12 cmp dl,0 je s12 dec dl jmp short s12 s12: mov CrPs,dl jmp s1 ExitSearch: ret OkSearch: cmp LenStr,0 je ExitSearch ; 踳÷М┘ むメ ※ x000:xxxx mov dx,BegSeg mov ax,BegOfs call Convert mov BegSeg,dx mov BegOfs,ax mov dx,EndSeg mov ax,EndOfs call Convert mov EndSeg,dx mov EndOfs,ax call WaitMessage push es mov es,BegSeg mov di,BegOfs lsr1: mov ax,es cmp ax,EndSeg ; ja NoSr jne NoEndS cmp di,EndOfs ja NoSr NoEndS: xor ch,ch push di mov cl,LenStr mov si,offset SStr rep cmpsb je YSr pop di sr13: add di,1 jnc lsr1 mov ax,es xor di,di add ah,10h mov es,ax jnc short lsr1 Nosr: pop es call SearchWindow mov cl,11h mov si,offset ESearch call ErrorStr ret YSr: pop di push di push es push cx mov ax,es mov cl,4 shr di,cl add ax,di mov LastSeg,ax call Explore cmp word ptr ds:[si],'EP' pop cx pop es pop di je Sr13 mov CurOfs,di mov CurSeg,es call OUTPUT mov bh,VPage mov dh,2 mov dl,CrPos mov ah,2 int 10h mov dx,020ch call OfsVideo cmp System,64 jne V16 V64: add di,2 mov cl,LenStr jmp short Otm V16: mov al,LenStr mov cl,al mov ah,3 mul ah cmp cl,8 jbe v160 add al,2 v160: mov cl,al Otm: xor ch,ch mov al,1eh vl1: inc di stosb loop vl1 pop es mov cl,15h mov si,offset WSearch call ErrorStr ret Search ENDP ; ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Convert PROC NEAR ; 踳÷М┘ Dx:Ax x000:0000 瓮. むメ mov bx,dx and dx,0F000h sub bx,dx mov cl,4 shl bx,cl add ax,bx jnc cnv1 cmp dh,0F0h jne cnv2 mov dh,0e0h mov ax,0ffffh cnv2: add dh,10h cnv1: ret Convert ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 EditPointer PROC NEAR ; イ皋牀┘ "ィキ":"ラキ┘" ; 痰牀 Str0, Ж罔 1fh - 27h ; Бモ DX - 瓮キ ; BX - 甃ラキ┘ ; ax - 瓱〓 mov CurCr,24h mov BegCol,24h mov EndCol,27h mov Atrr,1 mov al,'+' mov di,offset strs+5 call Edit ep11: mov CurCr,1fh ep14: mov BegCol,1fh mov EndCol,22h Ep2: mov di,offset strs mov al,BegCol cbw add di,ax sub di,1fh mov al,0ffh call Edit mov cl,CurCr cmp cl,EndCol jbe ep3 cmp BegCol,1fh je ep12 mov CurCr,27h jmp short ep2 ep12: mov CurCr,24h mov BegCol,24h mov EndCol,27h jmp short ep2 ep3: cmp cl,BegCol jae Tran1 cmp BegCol,1fh jne ep13 mov CurCr,1fh jmp short ep2 ep13: mov CurCr,22h jmp short ep14 Tran1: push ax mov si,offset strs call Transl push dx inc si call Transl mov bx,dx pop dx pop ax ret EditPointer ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ; Cursor PROC NEAR ; 痰→ 窶甌 痰牀 STR0, Ж罔 CURCR push ax push bx push dx mov bh,vpage mov dh,str0 mov dl,curcr mov ah,2 int 10h pop dx pop bx pop ax ret CURSOR ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 CurCr db 0 BegCol db 0 EndCol db 0 str0 db 0 Atrr db 0 Edit PROC NEAR ; イ皋牀┘ 皀痰 蹣. ; ax - 硅 瓱〓 ; メ 0ffh - 牀瓱碎 瓱〓 ; ds:di - むメ 痰牀 ; BegCol - 讚 Ж罔 ; EndCol - ョ Ж罔 ; str0 - 痰牀 蹣 ; Atrr - =0 - ≡ 瓱〓, ; =1 - 16- 瓱〓 ; 痰※碎 CurStr,CurCr 窶甌 礒竡 Ж罔 痰牀. ; 諷ぅ : 痰牀 - キ ; ax - 瓱〓, 皰牀 ° 諷. mov bp,di push ax mov dh,str0 mov dl,BegCol call OfsVideo push ds push es pop ds push cs pop es mov si,di mov cl,cs:EndCol sub cl,cs:BegCol inc cl mov di,bp ed7: lodsb stosb lodsb dec cl jnz ed7 mov al,0 stosb pop ds pop ax jmp short Rchar rc1: call Cursor call WaitKey Rchar: cmp al,0ffh je rc1 mov di,bp mov dl,CurCr sub dl,BegCol xor dh,dh add di,dx cmp al,0 je extc cmp al,' ' jb WriteSt cmp Atrr,0 je AllChar cmp al,'Z' jbe rc2 sub al,'a'-'A' rc2: cmp al,'0' jb writest cmp al,'F' ja writest cmp al,'9' jbe AllChar cmp al,'A' jb WriteSt AllChar: stosb mov bh,VPage mov cx,1 mov bl,displ mov ah,9 int 10h StRight: mov cl,curcr inc cl mov curcr,cl cmp cl,endcol ja writest jmp short rc1 extc: cmp ah,75 jne trg1 mov cl,curcr dec cl mov curcr,cl cmp cl,begcol jb writest jmp rc1 trg1: cmp ah,77 je stright writest: push ax push cs pop es mov di,bp mov dl,EndCol sub dl,BegCol inc dl xor dh,dh add di,dx mov al,0 stosb pop ax ret Edit ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 AtrStr db 0 EditString PROC NEAR ; イ皋牀┘ 痰牀 蹣. ; ds:di - むメ 痰牀 ; BegCol - 讚 Ж罔 ; EndCol - ョ Ж罔 ; str0 - 痰牀 蹣 ; AtrStr - =0 - 痰牀 腮モ瘴 0 ; =1 - か┃ 痰牀 LenStr ; 諷ぅ : 痰牀 - キ ; ax - 瓱〓, 皰牀 ° 諷. mov bp,di mov cl,0 mov si,di cmp AtrStr,0 je es1 mov cl,LenStr jmp short es23 es1: lodsb inc cl cmp al,0 jne es1 dec cl es23: add cl,BegCol mov CurCr,cl es2: call Cursor call WaitKey es5: push ax cmp al,0 je es3 cmp al,8 je es7 cmp al,' ' jb es3 es7: mov di,bp mov dl,CurCr sub dl,BegCol xor dh,dh add di,dx cmp al,8 je es66 cmp AtrStr,0 je es6 cmp LenStr,14 ja es6 inc LenStr jmp short es6 es66: cmp di,bp je es3 dec di mov al,0 cmp AtrStr,0 je es6 dec LenStr es6: mov cx,di sub cx,bp add cl,BegCol cmp cl,EndCol ja es3 stosb mov al,0 stosb push es mov dl,BegCol mov dh,Str0 call OfsVideo mov si,bp es4: lodsb cmp al,0 je es33 stosb mov al,displ stosb jmp short es4 es33: pop es es3: pop ax ret EditString ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 OutStr PROC NEAR ; 襤 痰牀 蹣 ; dh,dl - 痰牀, ; ds:si - ASCIIZ 痰牀; al - 矜爬< push es push di push ax call OfsVideo mov ah,al os1: lodsb cmp al,0 je exitout stosb mov al,ah stosb jmp short os1 exitout: pop ax pop di pop es ret OutStr ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 StrF db '頻使麓蒙' ; ━〓 籥ォ ゛肓 OutLine PROC NEAR ; 爬甌碎 ▲璢銕/└銕 痰牀 ゛肓 ; ds:si - むメ ゛肓 <閹┤ ( . 0 ) ; es:di - むメ ※ぅ閧 ; dl - 矜爬<硅 ; dh - 0 - Up, 1 - Down , 2 -Middle push ax push bx push cx push dx push si mov bx,offset StrF cmp dh,0 je OkLine add bx,3 cmp dh,1 je OkLine add bx,3 OkLine: mov al,[bx] stosb mov al,dl stosb lp1: lodsb cbw or ax,ax je EndLine mov cx,ax lp2: mov al,'' stosb mov al,dl stosb loop lp2 mov al,[bx+1] stosb mov al,dl stosb jmp short lp1 EndLine: sub di,2 mov al,[bx+2] stosb inc di pop si pop dx pop cx pop bx pop ax ret OutLine ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 OfsVideo PROC NEAR ; dh/dl - 痰牀/痰. - es:di <- むメ ※ぅ閧. mov es,Vseg push ax mov al,dh mov ah,160 mul ah add al,dl adc ah,0 add al,dl adc ah,0 mov di,ax pop ax ret OfsVideo ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Fr dw 0 Bar PROC NEAR ; 痺モ 荐爬 cl, 諱皰 ch Ж罔 dl,dh 矗─竄 al push cx push dx push di push si push es call OfsVideo mov dl,ch ; dl - 腮甄 痰牀 xor ch,ch ; cx - 腮甄 痰≧ push dx mov Fr,cx mov si,offset Fr mov dl,al mov dh,0 push di call OutLine pop di mov ah,al pop dx b1: add di,160 push di mov al,'' stosw mov al,' ' push cx rep stosw pop cx mov al,'' stosw inc di mov al,7 stosb pop di dec DL jnz b1 add di,160 mov dh,1 mov dl,ah push di call OutLine inc di mov al,7 stosb pop di add di,160 mov al,7 add di,2 add cx,2 b11: inc di stosb loop b11 ; 痰→ 筮爼 窶甌 mov cx,0607h mov ah,1 int 10h pop es pop si pop di pop dx pop cx ret Bar ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 Mstr db ' F1 : Help ' db ' < PEEK POKE RESIDENT > ' Str1 db 9,51,16,0 ; ゛ Hex 爛Θ Str2 db 9,68,0 ; ゛ Char 爛Θ OUTPUT PROC NEAR ; 襤 閧 mov es,Vseg xor di,di mov si,offset MStr mov cx,80 lo1: movsb mov al,displ and al,1eh stosb loop lo1 mov si,offset Str1 cmp System,16 je OkOut mov si,offset Str2 OkOut: push si mov dl,displ mov dh,0 call OutLine mov cx,22 mov dx,CurOfs lo3: push cx call Memory mov si,offset strs mov cx,80 lo2: movsb mov al,displ stosb loop lo2 pop cx mov al,System xor ah,ah add dx,ax loop lo3 pop si mov dl,displ mov dh,1 call OutLine ret OUTPUT ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 WordFormat PROC NEAR ; 踳÷М┘ ax -> 痰牀 ( es:di ) push cx push dx mov bp,4 mov cx,16 std add di,3 push di w1: xor dx,dx div cx mov bx,dx add bx,offset Hex push ax mov al,cs:[bx] stosb pop ax dec bp jnz w1 pop di cld inc di pop dx pop cx ret WordFormat ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ByteFormat1 PROC NEAR xor bh,bh shr al,1 shr al,1 shr al,1 shr al,1 mov bl,al add bx,offset Hex mov al,cs:[bx] ret ByteFormat1 ENDP ByteFormat2 PROC NEAR xor bh,bh and ah,0fh mov bl,ah add bx,offset Hex mov al,cs:[bx] ret ByteFormat2 ENDP Memory PROC NEAR ; 襪 痰牀 むメ CurSeg:dx 痰牀 strs ; 甄 ModeOut = 0, 瓱〓 ぎ < 32 皰÷鈞瘴 push ds push es push dx push bx push cx push si push di push cs pop es mov si,dx mov ds,cs:CurSeg mov di,offset strs mov al,'' stosb mov ax,ds call WordFormat mov al,':' stosb mov ax,si call WordFormat mov ax,' ' stosw mov cl,cs:System xor ch,ch cmp cs:System,16 je S0 jmp short CharForm S0: push cx push si mov dl,2 lm1: mov cx,8 lm2: lodsb mov ah,al call ByteFormat1 stosb call ByteFormat2 stosb mov al,' ' stosb loop lm2 mov ax,' ' stosw dec dl jne lm1 dec di dec di mov al,'' stosb pop si pop cx lm11: lodsb cmp cs:ModeOut,0 jne OkChar cmp al,' ' jae OkChar mov al,'.' OkChar: stosb loop lm11 mov al,'' stosb jmp short end_mem CharForm: mov al,' ' stosb lm12: lodsb cmp cs:ModeOut,0 jne OkChar1 cmp al,' ' jae OkChar1 mov al,'.' OkChar1: stosb loop lm12 mov al,' ' stosb mov ah,'' stosw end_mem: mov ax,0a0dh stosw pop di pop si pop cx pop bx pop dx pop es pop ds ret Memory ENDP ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 WaitKey PROC NEAR ; ヲ┐┘ ※荐. al - code/0 ; ah - scancode/extcode cli push es push bx mov ax,40h mov es,ax sti Zf: mov ax,es:1ah ; head cmp ax,es:1ch ; tail je Zf mov bx,ax mov ax,es:[bx] cli inc bx inc bx cmp bx,es:82h jne k5 mov bx,es:80h k5: mov es:1ah,bx sti cmp al,'' jne No_Ext cmp ah,53 jbe No_Ext mov al,0 No_Ext: or bx,bx pop bx pop es ret WaitKey ENDP BlueBar PROC NEAR mov dl,79 sub dl,cl shr dl,1 mov dh,24 sub dh,ch shr dh,1 dec dh dec dl mov al,Displ and al,1eh call BAR ret BlueBar ENDP BlueOutStr PROC NEAR mov al,Displ and al,1bh call OutStr ret BlueOutStr ENDP ErrorStr PROC NEAR add cl,4 mov ch,1 mov dh,10 mov dl,79 sub dl,cl shr dl,1 dec dl mov al,4fh cmp Displ,1fh je ersc mov al,70h ersc: push dx push si push ax call Bar pop ax pop si pop dx inc dh add dl,3 and al,4eh call OutStr call WaitKey ret ErrorStr ENDP Video equ $ ; ェム※珮モ瘴 か ※ぅ<筌 ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 ;樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛樛 install: push cs pop ds mov runflag,0 mov flag,0 mov ah,34h int 21h mov segdos,es mov ofsdos,bx mov ax,3509h int 21h mov SegOld,es mov OfsOld,bx mov ax,2509h mov dx,offset Int09h int 21h mov ax,3508h int 21h mov Seg08,es mov Ofs08,bx mov ax,2508h mov dx,offset Int08h int 21h mov ax,3528h int 21h mov Seg28,es mov Ofs28,bx mov ax,2528h mov dx,offset Int28h int 21h mov ah,9 mov dx,offset titl int 21h lea dx,Install add dx,25*160 int 27h titl db 13,10 db ' < PEEK POKE RESIDENT >' ,13,10,10 db ' ≒ 窶硼 .. ( ユ ) ム瓱 1.0 18.05.90' ,13,10 db ' 罔├罔 皋 Alt-Alt-Alt' ,13,10 db '$' main ENDS END START