2006-01-03 10:43:31 +01:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;
|
|
|
|
|
; TERMINAL
|
2007-02-08 10:50:45 +01:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
use32
|
2007-02-08 10:50:45 +01:00
|
|
|
|
org 0x0
|
|
|
|
|
db 'MENUET01' ; header
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; entry point
|
|
|
|
|
dd I_END ; image size
|
|
|
|
|
dd I_END+0x10000 ; required memory
|
|
|
|
|
dd I_END+0x10000 ; esp
|
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Path
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
include 'lang.inc'
|
2007-05-10 15:48:35 +02:00
|
|
|
|
include '..\..\..\macros.inc'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
START: ; start of execution
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
call draw_window
|
|
|
|
|
|
|
|
|
|
call set_variables
|
|
|
|
|
|
|
|
|
|
still:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
mov eax,23 ; wait here for event
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,20
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
|
je red
|
|
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
|
je key
|
|
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
|
je button
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,16+4
|
2007-02-08 10:50:45 +01:00
|
|
|
|
je read_input
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
read_input:
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mcall 42,4,text+120*80
|
|
|
|
|
test eax, eax
|
|
|
|
|
jle still
|
|
|
|
|
|
|
|
|
|
read_input_loop:
|
|
|
|
|
mov bl,[ecx]
|
|
|
|
|
inc ecx
|
|
|
|
|
push eax ecx
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,27 ; ESCAPE COMMAND
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_esc
|
|
|
|
|
call esc_command
|
|
|
|
|
jmp newdata
|
|
|
|
|
no_esc:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,13 ; BEGINNING OF LINE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne nobol
|
|
|
|
|
mov ecx,[pos]
|
|
|
|
|
add ecx,1
|
|
|
|
|
boll1:
|
|
|
|
|
sub ecx,1
|
|
|
|
|
mov eax,ecx
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ebx,80
|
|
|
|
|
div ebx
|
|
|
|
|
cmp edx,0
|
|
|
|
|
jne boll1
|
|
|
|
|
mov [pos],ecx
|
|
|
|
|
jmp newdata
|
|
|
|
|
nobol:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,10 ; LINE DOWN
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne nolf
|
|
|
|
|
addx1:
|
|
|
|
|
add [pos],dword 1
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ecx,80
|
|
|
|
|
div ecx
|
|
|
|
|
cmp edx,0
|
|
|
|
|
jnz addx1
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
jmp cm1
|
|
|
|
|
nolf:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,8 ; BACKSPACE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne nobasp
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
dec eax
|
|
|
|
|
mov [pos],eax
|
|
|
|
|
mov [eax+text],byte 32
|
|
|
|
|
mov [eax+text+60*80],byte 0
|
|
|
|
|
jmp newdata
|
|
|
|
|
nobasp:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,15 ; CHARACTER
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jbe newdata
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
call draw_data
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
add eax,1
|
|
|
|
|
cm1:
|
|
|
|
|
mov ebx,[scroll+4]
|
|
|
|
|
imul ebx,80
|
|
|
|
|
cmp eax,ebx
|
2007-02-08 10:50:45 +01:00
|
|
|
|
jb noeaxz
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov esi,text+80
|
|
|
|
|
mov edi,text
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
mov esi,text+80+60*80
|
|
|
|
|
mov edi,text+60*80
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
mov eax,ebx
|
|
|
|
|
sub eax,80
|
|
|
|
|
noeaxz:
|
|
|
|
|
mov [pos],eax
|
|
|
|
|
newdata:
|
2009-11-05 21:27:56 +01:00
|
|
|
|
pop ecx eax
|
|
|
|
|
dec eax
|
|
|
|
|
jnz read_input_loop
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_text
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
red: ; REDRAW WINDOW
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window
|
|
|
|
|
jmp still
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
key: ; KEY
|
|
|
|
|
mov eax,2 ; send to modem
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
shr eax,8
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp eax,178 ; ARROW KEYS
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne noaup
|
|
|
|
|
mov al,'A'
|
|
|
|
|
call arrow
|
|
|
|
|
jmp still
|
|
|
|
|
noaup:
|
|
|
|
|
cmp eax,177
|
|
|
|
|
jne noadown
|
|
|
|
|
mov al,'B'
|
|
|
|
|
call arrow
|
|
|
|
|
jmp still
|
|
|
|
|
noadown:
|
|
|
|
|
cmp eax,179
|
|
|
|
|
jne noaright
|
|
|
|
|
mov al,'C'
|
|
|
|
|
call arrow
|
|
|
|
|
jmp still
|
|
|
|
|
noaright:
|
|
|
|
|
cmp eax,176
|
|
|
|
|
jne noaleft
|
|
|
|
|
mov al,'D'
|
|
|
|
|
call arrow
|
|
|
|
|
jmp still
|
|
|
|
|
noaleft:
|
|
|
|
|
modem_out:
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
button: ; BUTTON
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,17
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp ah,1 ; CLOSE PROGRAM
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne noclose
|
2007-02-08 10:50:45 +01:00
|
|
|
|
mov eax,45 ; FREE IRQ
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,1
|
|
|
|
|
mov ecx,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,46
|
|
|
|
|
mov ebx,1
|
|
|
|
|
mov ecx,0x3f0
|
|
|
|
|
mov edx,0x3ff
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
|
|
|
|
or eax,-1
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
noclose:
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrow:
|
|
|
|
|
|
|
|
|
|
push eax
|
|
|
|
|
mov al,27
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,'['
|
|
|
|
|
call to_modem
|
|
|
|
|
pop eax
|
|
|
|
|
call to_modem
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
to_modem:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,5
|
|
|
|
|
mov ebx,5
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_data:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
cmp bl,0xe4 ; <20>
|
|
|
|
|
jne noe4
|
|
|
|
|
mov bl,0xc1
|
|
|
|
|
noe4:
|
|
|
|
|
cmp bl,0xc4 ; <20>
|
|
|
|
|
jne noc4
|
|
|
|
|
mov bl,0xc9
|
|
|
|
|
noc4:
|
|
|
|
|
mov [eax+text],bl
|
|
|
|
|
mov bl,byte [attribute]
|
|
|
|
|
mov [eax+text+60*80],bl
|
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
irqtable:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
dd 0x3f8 + 0x01000000 ; read port 0x3f8, byte
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_variables:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,46
|
|
|
|
|
mov ebx,0
|
|
|
|
|
mov ecx,0x3f0
|
|
|
|
|
mov edx,0x3ff
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
mov eax,45 ; reserve irq 4
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,0
|
|
|
|
|
mov ecx,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov eax,44
|
|
|
|
|
mov ebx,irqtable
|
|
|
|
|
mov ecx,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
; jmp noportint
|
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+3
|
|
|
|
|
mov al,0x80
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+1
|
|
|
|
|
mov al,0
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+0
|
|
|
|
|
mov al,0x30 / 16
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+3
|
|
|
|
|
mov al,3
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+4
|
|
|
|
|
mov al,0xB
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2009-11-05 21:27:56 +01:00
|
|
|
|
mov dx,0x3f8+1
|
|
|
|
|
mov al,1
|
|
|
|
|
out dx,al
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
noportint:
|
|
|
|
|
|
|
|
|
|
mov eax,40
|
|
|
|
|
mov ebx,0000000000010000b shl 16 + 111b
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,12
|
|
|
|
|
mov ebx,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
mov eax,0 ; DRAW WINDOW
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,100*65536+491
|
|
|
|
|
mov ecx,100*65536+270
|
2007-02-08 10:50:45 +01:00
|
|
|
|
mov edx,0x13000000
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mov edi,title
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov edi,text+80*30
|
|
|
|
|
mov ecx,80*30 /4
|
|
|
|
|
cld
|
|
|
|
|
rep stosd
|
|
|
|
|
|
|
|
|
|
call draw_text
|
|
|
|
|
|
|
|
|
|
mov eax,12
|
|
|
|
|
mov ebx,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bgc dd 0x000000
|
|
|
|
|
dd 0x000000
|
|
|
|
|
dd 0x00ff00
|
|
|
|
|
dd 0x0000ff
|
|
|
|
|
dd 0x005500
|
|
|
|
|
dd 0xff00ff
|
|
|
|
|
dd 0x00ffff
|
|
|
|
|
dd 0x770077
|
|
|
|
|
|
|
|
|
|
tc dd 0xffffff
|
|
|
|
|
dd 0xff00ff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
dd 0xffffff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_text:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov esi,text
|
|
|
|
|
mov eax,0
|
|
|
|
|
mov ebx,0
|
|
|
|
|
newletter:
|
|
|
|
|
mov cl,[esi]
|
|
|
|
|
mov dl,[esi+60*80]
|
|
|
|
|
cmp cl,[esi+30*80]
|
|
|
|
|
jne yesletter
|
|
|
|
|
cmp dl,[esi+90*80]
|
|
|
|
|
jne yesletter
|
|
|
|
|
jmp noletter
|
|
|
|
|
yesletter:
|
|
|
|
|
mov [esi+30*80],cl
|
|
|
|
|
mov [esi+90*80],dl
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
and edx,0xff
|
|
|
|
|
shl edx,2
|
|
|
|
|
add edx,bgc
|
|
|
|
|
mov edx,[edx]
|
|
|
|
|
mov ecx,ebx
|
|
|
|
|
add ecx,26
|
|
|
|
|
shl ecx,16
|
|
|
|
|
mov cx,9
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
add ebx,6
|
|
|
|
|
shl ebx,16
|
|
|
|
|
mov bx,6
|
|
|
|
|
mov eax,13
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
and edx,0xff
|
|
|
|
|
shl edx,2
|
|
|
|
|
add edx,tc
|
|
|
|
|
mov ecx,[edx]
|
|
|
|
|
push bx
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
add ebx,6
|
|
|
|
|
shl ebx,16
|
|
|
|
|
pop bx
|
|
|
|
|
add bx,26
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov edx,esi
|
|
|
|
|
mov esi,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
noletter:
|
|
|
|
|
|
|
|
|
|
add esi,1
|
|
|
|
|
add eax,6
|
|
|
|
|
cmp eax,80*6
|
2007-02-08 10:50:45 +01:00
|
|
|
|
jb newletter
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,0
|
|
|
|
|
add ebx,10
|
|
|
|
|
cmp ebx,24*10
|
2007-02-08 10:50:45 +01:00
|
|
|
|
jb newletter
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
esc_command:
|
|
|
|
|
|
|
|
|
|
mov eax,32
|
|
|
|
|
mov edi,esccmd
|
|
|
|
|
mov ecx,10
|
|
|
|
|
cld
|
|
|
|
|
rep stosb
|
|
|
|
|
mov edi,esccmd
|
|
|
|
|
newescc:
|
|
|
|
|
mov eax,42
|
|
|
|
|
mov ebx,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ecx,0
|
|
|
|
|
je escok
|
|
|
|
|
mov eax,5
|
|
|
|
|
mov ebx,1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp newescc
|
|
|
|
|
escok:
|
|
|
|
|
mov [edi],bl
|
|
|
|
|
add edi,1
|
|
|
|
|
cmp edi,esccmd+20
|
|
|
|
|
je dontunderstand
|
|
|
|
|
mov esi,escend
|
|
|
|
|
nec:
|
|
|
|
|
cmp bl,[esi]
|
|
|
|
|
jz com_ok
|
|
|
|
|
add esi,1
|
|
|
|
|
cmp [esi],byte 0
|
|
|
|
|
je newescc
|
|
|
|
|
jmp nec
|
|
|
|
|
com_ok:
|
|
|
|
|
|
|
|
|
|
call get_numbers
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'H' ; SET CURSOR POSITION
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_cursor_position
|
|
|
|
|
cmp [escnumbers],0
|
|
|
|
|
jne ncp1
|
|
|
|
|
mov [pos],dword 0
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
ncp1:
|
|
|
|
|
mov eax,[escnumbers]
|
|
|
|
|
dec eax
|
|
|
|
|
imul eax,80
|
|
|
|
|
add eax,[escnumbers+4]
|
|
|
|
|
dec eax
|
|
|
|
|
mov [pos],eax
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_cursor_position:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'K' ; ERASE LINE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_erase_end_of_line
|
|
|
|
|
cmp [escnumbers],0
|
|
|
|
|
jne no_end_line
|
|
|
|
|
mov ecx,[pos]
|
|
|
|
|
eeol:
|
|
|
|
|
mov [ecx+text],byte ' '
|
|
|
|
|
mov [ecx+text+60*80],byte 0
|
|
|
|
|
add ecx,1
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov eax,ecx
|
|
|
|
|
mov ebx,80
|
|
|
|
|
div ebx
|
|
|
|
|
cmp edx,0
|
|
|
|
|
jne eeol
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_end_line:
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp [escnumbers],1 ; BEGINNING OF LINE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_beg_line
|
|
|
|
|
mov ecx,[pos]
|
|
|
|
|
ebol:
|
|
|
|
|
mov [ecx+text],byte ' '
|
|
|
|
|
mov [ecx+text+60*80],byte 0
|
|
|
|
|
sub ecx,1
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov eax,ecx
|
|
|
|
|
mov ebx,80
|
|
|
|
|
div ebx
|
|
|
|
|
cmp edx,0
|
|
|
|
|
jne ebol
|
|
|
|
|
mov [pos],ecx
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_beg_line:
|
|
|
|
|
no_erase_end_of_line:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'J' ; ERASE TO END OF SCREEN
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_erase_to_end_of_screen
|
|
|
|
|
cmp [escnumbers],dword 0
|
|
|
|
|
jne no_erase_to_end_of_screen
|
|
|
|
|
mov ecx,[pos]
|
|
|
|
|
eteos:
|
|
|
|
|
mov [ecx+text],byte ' '
|
|
|
|
|
mov [ecx+text+60*80],byte 0
|
|
|
|
|
add ecx,1
|
|
|
|
|
cmp ecx,80*24+1
|
|
|
|
|
jb eteos
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_erase_to_end_of_screen:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'r' ; SET SCROLL REGION
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_scroll_region
|
|
|
|
|
mov eax,[escnumbers]
|
|
|
|
|
dec eax
|
|
|
|
|
mov [scroll+0],eax
|
|
|
|
|
mov eax,[escnumbers+4]
|
|
|
|
|
mov [scroll+4],eax
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_scroll_region:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'A' ; CURSOR UP
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_cursor_up
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
sub eax,80
|
|
|
|
|
mov [pos],eax
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_cursor_up:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'C' ; CURSOR LEFT
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_cursor_left
|
|
|
|
|
mov eax,[pos]
|
|
|
|
|
mov ebx,[escnumbers]
|
|
|
|
|
sub eax,ebx
|
|
|
|
|
mov [pos],eax
|
|
|
|
|
call cmd_done
|
|
|
|
|
no_cursor_left:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'m' ; CHARACTER ATTRIBUTE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_char_attribute
|
|
|
|
|
mov eax,[escnumbers]
|
|
|
|
|
mov [attribute],eax
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_char_attribute:
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
cmp bl,'Z' ; TERMINAL TYPE
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne no_terminal_type
|
|
|
|
|
mov al,27
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,'?'
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,'1'
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,';'
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,'0'
|
|
|
|
|
call to_modem
|
|
|
|
|
mov al,'c'
|
|
|
|
|
call to_modem
|
|
|
|
|
jmp cmd_done
|
|
|
|
|
no_terminal_type:
|
|
|
|
|
|
|
|
|
|
dontunderstand:
|
|
|
|
|
|
|
|
|
|
cmd_done:
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_numbers:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,13
|
|
|
|
|
mov ebx,250*65536+100
|
|
|
|
|
mov ecx,8*65536+8
|
|
|
|
|
mov edx,0x000000
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov eax,[escnumbers]
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ebx,10
|
|
|
|
|
div ebx
|
|
|
|
|
add eax,48
|
|
|
|
|
add edx,48
|
|
|
|
|
mov byte [numtext+0],al
|
|
|
|
|
mov byte [numtext+1],dl
|
|
|
|
|
|
|
|
|
|
mov eax,[escnumbers+4]
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mov ebx,10
|
|
|
|
|
div ebx
|
|
|
|
|
add eax,48
|
|
|
|
|
add edx,48
|
|
|
|
|
mov [numtext+3],al
|
|
|
|
|
mov [numtext+4],dl
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,250*65536+8
|
|
|
|
|
mov ecx,0xffffff
|
|
|
|
|
mov edx,numtext
|
|
|
|
|
mov esi,10
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
draw_event:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov eax,13
|
|
|
|
|
mov ebx,150*65536+100
|
|
|
|
|
mov ecx,8*65536+8
|
|
|
|
|
mov edx,0xffffff
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov ebx,150*65536+8
|
|
|
|
|
mov ecx,0x000000
|
|
|
|
|
mov edx,esccmd
|
|
|
|
|
mov esi,20
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_numbers:
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
mov [escnumbers+0],0
|
|
|
|
|
mov [escnumbers+4],0
|
|
|
|
|
mov [escnumbers+8],0
|
|
|
|
|
mov ecx,esccmd
|
|
|
|
|
cmp [ecx+1],byte '0'
|
|
|
|
|
jb gn_over
|
|
|
|
|
cmp [ecx+1],byte '9'
|
|
|
|
|
jg gn_over
|
|
|
|
|
mov edi,escnumbers
|
|
|
|
|
gn_new:
|
|
|
|
|
add ecx,1
|
|
|
|
|
movzx eax,byte [ecx]
|
|
|
|
|
sub eax,48
|
|
|
|
|
add ecx,1
|
|
|
|
|
cmp [ecx],byte '0'
|
|
|
|
|
jb gnl1
|
|
|
|
|
cmp [ecx],byte '9'
|
|
|
|
|
jg gnl1
|
|
|
|
|
mov ebx,10
|
|
|
|
|
xor edx,edx
|
|
|
|
|
mul ebx
|
|
|
|
|
movzx ebx,byte[ecx]
|
|
|
|
|
add eax,ebx
|
|
|
|
|
sub eax,48
|
|
|
|
|
add ecx,1
|
|
|
|
|
gnl1:
|
|
|
|
|
mov [edi],eax
|
|
|
|
|
add edi,4
|
|
|
|
|
cmp [ecx],byte ';'
|
|
|
|
|
je gn_new
|
|
|
|
|
gn_over:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; DATA AREA
|
|
|
|
|
|
|
|
|
|
|
2007-02-08 10:50:45 +01:00
|
|
|
|
pos dd 80*10
|
|
|
|
|
irc_data dd 0x0
|
|
|
|
|
print db 0x0
|
|
|
|
|
attribute dd 0
|
|
|
|
|
scroll dd 1
|
|
|
|
|
dd 24
|
|
|
|
|
numtext db ' '
|
|
|
|
|
esccmd dd 0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
|
|
|
escend db 'ZrhlABCDHfDME=>NmKJgincoyq',0
|
|
|
|
|
escnumbers dd 0,0,0,0,0
|
|
|
|
|
wcolor dd 0x000000
|
2007-05-10 15:48:35 +02:00
|
|
|
|
title db 'TERMINAL FOR MODEM IN COM1 0.03',0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
text:
|
|
|
|
|
db ' '
|
|
|
|
|
db ' '
|
|
|
|
|
db '*** A TELNET APPLICATION FOR HAYES COMPATIBLE MODEMS IN COM1 '
|
|
|
|
|
db ' '
|
|
|
|
|
db '*** USE HAYES COMMANDS TO CONNECT TO A SERVER '
|
|
|
|
|
db ' '
|
|
|
|
|
db '*** ATDT (PHONENUMBER) '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' '
|
|
|
|
|
|
|
|
|
|
I_END:
|