Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 485
Line 58... Line 58...
58
 
58
 
59
 
-
 
60
 
59
 
61
 
-
 
62
use32
60
 
63
 
61
 
64
     org     0x0
62
use32
65
 
63
 org	0x0
66
     db      'MENUET00'      ; 8 byte id
64
 db	'MENUET01'    ; header
67
     dd      38              ; required os
65
 dd	0x01	      ; header version
68
     dd      STARTAPP        ; program start
66
 dd	STARTAPP      ; entry point
Line 69... Line 67...
69
     dd      I_END           ; program image size
67
 dd	I_END	      ; image size
70
     dd      0x100000        ; required amount of memory
68
 dd	I_END+0x10000 ; required memory
71
        ; esp = 0x7FFF0
69
 dd	I_END+0x10000 ; esp
Line 72... Line 70...
72
     dd      0x00000000      ; reserved=no extended header
70
 dd	0x0 , 0x0     ; I_Param , I_Path
73
 
71
 
Line 85... Line 83...
85
 
83
 
Line 86... Line 84...
86
    ; Get the com port & IRQ to use from the kernel stack config option
84
    ; Get the com port & IRQ to use from the kernel stack config option
87
 
85
 
88
    mov   eax, 52                 ; Stack Interface
86
    mov   eax, 52                 ; Stack Interface
89
    mov   ebx, 0     ; read configuration word
87
    mov   ebx, 0     ; read configuration word
90
    int   0x40
88
    mcall
91
    mov  ecx, eax
89
    mov  ecx, eax
92
    shr  ecx, 16     ; get the port address
90
    shr  ecx, 16     ; get the port address
93
    mov  [comport], ecx
91
    mov  [comport], ecx
Line 107... Line 105...
107
    mov     eax, welcomep
105
    mov     eax, welcomep
108
    mov     [prompt], eax               ; set up prompt to display
106
    mov     [prompt], eax               ; set up prompt to display
109
    mov     al, [welcomep_len]
107
    mov     al, [welcomep_len]
110
    mov     [prompt_len], al
108
    mov     [prompt_len], al
Line -... Line 109...
-
 
109
 
111
 
110
red:
Line 112... Line -...
112
    call    draw_window                 ; at first, draw the window
-
 
113
 
111
    call    draw_window                 ; at first, draw the window
114
 
112
 
115
apploop:
113
apploop:
116
    mov     eax, 23                     ; wait here for event
114
    mov     eax, 23                     ; wait here for event
Line 117... Line 115...
117
    mov     ebx, 20
115
    mov     ebx, 20
118
    int     0x40
116
    mcall
119
 
117
 
120
    cmp     eax, 1                      ; redraw request ?
118
    cmp     eax, 1                      ; redraw request ?
Line 127... Line 125...
127
    add     ebx, 16
125
    add     ebx, 16
128
    cmp     eax, ebx
126
    cmp     eax, ebx
129
    je      flush_input                 ; Dont want serial data yet
127
    je      flush_input                 ; Dont want serial data yet
130
    jmp     apploop
128
    jmp     apploop
Line 131... Line -...
131
 
-
 
132
red:                                    ; redraw
-
 
133
    call    draw_window
-
 
134
    jmp     apploop
-
 
135
 
129
 
136
key:                                    ; key - ignore
130
key:                                    ; key - ignore
137
    mov     eax, 2                      ; just read it
131
    mov     eax, 2                      ; just read it
138
    int     0x40
132
    mcall
Line 139... Line 133...
139
    jmp     apploop
133
    jmp     apploop
140
 
134
 
141
button:                                 ; button
135
button:                                 ; button
Line 142... Line 136...
142
    mov     eax, 17                     ; get id
136
    mov     eax, 17                     ; get id
143
    int     0x40
137
    mcall
Line 144... Line 138...
144
 
138
 
Line 150... Line 144...
150
    mov     edx, 1000                   ; Allow sendwait 10s
144
    mov     edx, 1000                   ; Allow sendwait 10s
151
    call    sendwait
145
    call    sendwait
Line 152... Line 146...
152
 
146
 
Line 153... Line 147...
153
    call    disable_port
147
    call    disable_port
154
 
148
 
155
    mov     eax, -1                     ; close this program
149
    or      eax, -1                     ; close this program
Line 156... Line 150...
156
    int     0x40
150
    mcall
157
    jmp     apploop
151
    jmp     apploop
158
 
152
 
Line 171... Line 165...
171
 
165
 
172
    ; Data received, so get it, and throw it away at this point
166
    ; Data received, so get it, and throw it away at this point
173
flush_input:
167
flush_input:
174
    mov  eax,42
168
    mov  eax,42
175
    mov  ebx, [comirq]
169
    mov  ebx, [comirq]
Line 176... Line 170...
176
    int  0x40
170
    mcall
177
 
171
 
178
    mov  eax,11                     ; This will return 0 most of the time
172
    mov  eax,11                     ; This will return 0 most of the time
179
    int  0x40
173
    mcall
180
    mov     ebx, [comirq]
174
    mov     ebx, [comirq]
181
    add     ebx, 16
175
    add     ebx, 16
182
    cmp     eax, ebx
176
    cmp     eax, ebx
Line 198... Line 192...
198
    mov     [prompt_len], al
192
    mov     [prompt_len], al
199
    call    draw_window
193
    call    draw_window
Line 200... Line 194...
200
 
194
 
201
    mov     eax, 23
195
    mov     eax, 23
202
    mov     ebx, 100
196
    mov     ebx, 100
Line 203... Line 197...
203
    int     0x40                        ; wait for 1s to display message
197
    mcall                        ; wait for 1s to display message
Line 204... Line 198...
204
 
198
 
Line 223... Line 217...
223
    call    settimer
217
    call    settimer
Line 224... Line 218...
224
 
218
 
Line 225... Line 219...
225
PPPLoop:
219
PPPLoop:
226
 
220
 
227
    mov     eax, 11                 ; check event
221
    mov     eax, 11                 ; check event
228
    int     0x40
222
    mcall
229
    cmp     eax, 3
223
    cmp     eax, 3
230
    jne     PPPLred
224
    jne     PPPLred
231
        ; button pressed
225
        ; button pressed
Line 232... Line 226...
232
    mov     eax, 17                     ; get id
226
    mov     eax, 17                     ; get id
233
    int     0x40
227
    mcall
234
 
228
 
Line 244... Line 238...
244
    mov     edx, 1000                   ; Allow sendwait 10s
238
    mov     edx, 1000                   ; Allow sendwait 10s
245
    call    sendwait
239
    call    sendwait
Line 246... Line 240...
246
 
240
 
247
    call    disable_port
241
    call    disable_port
248
    mov     eax, -1                     ; close this program
242
    mov     eax, -1                     ; close this program
249
    int     0x40
243
    mcall
Line 250... Line 244...
250
    jmp     PPPLoop
244
    jmp     PPPLoop
251
 
245
 
252
PPPLred:
246
PPPLred:
Line 265... Line 259...
265
 
259
 
Line 266... Line 260...
266
    ; we have data in the rx buffer, get it
260
    ; we have data in the rx buffer, get it
267
 
261
 
268
    mov     eax, 42
262
    mov     eax, 42
Line 269... Line 263...
269
    mov     ebx, [comirq]      ; ecx will return 0 =data read, 1 =no data
263
    mov     ebx, [comirq]      ; ecx will return 0 =data read, 1 =no data
Line 270... Line 264...
270
    int     0x40               ; or 2 =not irq owner
264
    mcall               ; or 2 =not irq owner
271
 
265
 
Line 424... Line 418...
424
 
418
 
425
wait_txd2:
419
wait_txd2:
426
    mov     eax,43
420
    mov     eax,43
427
    mov     ecx, [comport]
421
    mov     ecx, [comport]
428
    add     ecx, 0x80000000 + 5
422
    add     ecx, 0x80000000 + 5
429
    int     0x40
423
    mcall
430
    and     bl, 0x40
424
    and     bl, 0x40
431
    cmp     bl, 0
425
    cmp     bl, 0
Line 432... Line 426...
432
    jz      wait_txd2                  ; loop until free
426
    jz      wait_txd2                  ; loop until free
Line 438... Line 432...
438
 
432
 
Line 439... Line 433...
439
    inc     dword [txbytes]
433
    inc     dword [txbytes]
440
 
434
 
441
    mov     ecx, [comport]
435
    mov     ecx, [comport]
Line 442... Line 436...
442
    mov     eax, 43
436
    mov     eax, 43
443
    int     0x40
437
    mcall
444
 
438
 
445
ppp_003:
439
ppp_003:
Line 696... Line 690...
696
    mov     cl, [addr3]
690
    mov     cl, [addr3]
697
    shl     ecx, 8
691
    shl     ecx, 8
698
    mov     cl, [addr2]
692
    mov     cl, [addr2]
699
    shl     ecx, 8
693
    shl     ecx, 8
700
    mov     cl, [addr1]
694
    mov     cl, [addr1]
701
    int     0x40                       ; Set the stacks IP address
695
    mcall                       ; Set the stacks IP address
Line 702... Line 696...
702
 
696
 
Line 703... Line 697...
703
    popa
697
    popa
704
 
698
 
Line 733... Line 727...
733
;;
727
;;
734
    mov     eax, 52
728
    mov     eax, 52
735
    mov     ebx, 6
729
    mov     ebx, 6
736
    mov     edx, 1500   ; this should be exact amount
730
    mov     edx, 1500   ; this should be exact amount
737
    mov     esi, rx_str + 4
731
    mov     esi, rx_str + 4
738
    int     0x40
732
    mcall
Line 739... Line 733...
739
 
733
 
740
    ; Debugging output to debug board
734
    ; Debugging output to debug board
741
    pusha
735
    pusha
742
    mov     esi, RX_IP
736
    mov     esi, RX_IP
Line 881... Line 875...
881
    jne     ppp_013
875
    jne     ppp_013
Line 882... Line 876...
882
 
876
 
883
    ; 10ms Delay suggested by Ville
877
    ; 10ms Delay suggested by Ville
884
    mov     eax,23     ; over here
878
    mov     eax,23     ; over here
885
    mov     ebx,1
879
    mov     ebx,1
Line 886... Line 880...
886
    int     0x40
880
    mcall
887
 
881
 
Line 900... Line 894...
900
ppp_012a:
894
ppp_012a:
Line 901... Line 895...
901
 
895
 
902
    mov     eax, 52
896
    mov     eax, 52
903
    mov     ebx, 8
897
    mov     ebx, 8
904
    mov     esi, ip_buff
898
    mov     esi, ip_buff
Line 905... Line 899...
905
    int     0x40
899
    mcall
906
 
900
 
Line 907... Line 901...
907
    cmp     eax, 0
901
    cmp     eax, 0
Line 1223... Line 1217...
1223
 
1217
 
1224
    mov      ecx, 0x2f8
1218
    mov      ecx, 0x2f8
1225
    and      ecx, 0xFF0
1219
    and      ecx, 0xFF0
1226
    mov      edx, ecx
1220
    mov      edx, ecx
1227
    or       edx, 0x00F
1221
    or       edx, 0x00F
1228
    int      0x40
1222
    mcall
Line 1229... Line 1223...
1229
end if
1223
end if
1230
 
1224
 
1231
    mov      eax, 45                 ; free irq 4
1225
    mov      eax, 45                 ; free irq 4
1232
    mov      ebx, 1
1226
    mov      ebx, 1
Line 1233... Line 1227...
1233
    mov      ecx, [comirq]
1227
    mov      ecx, [comirq]
1234
    int      0x40
1228
    mcall
Line 1235... Line 1229...
1235
 
1229
 
1236
    mov      eax, 46                 ; free port area
1230
    mov      eax, 46                 ; free port area
1237
    mov      ebx, 1
1231
    mov      ebx, 1
1238
 
1232
 
1239
    mov      ecx, [comport]
1233
    mov      ecx, [comport]
1240
    and      ecx, 0xFF0
1234
    and      ecx, 0xFF0
Line 1241... Line 1235...
1241
    mov      edx, ecx
1235
    mov      edx, ecx
Line 1261... Line 1255...
1261
    mov      ebx, 0
1255
    mov      ebx, 0
1262
    mov      ecx, 0x2f8
1256
    mov      ecx, 0x2f8
1263
    and      ecx, 0xFF0
1257
    and      ecx, 0xFF0
1264
    mov      edx, ecx
1258
    mov      edx, ecx
1265
    or       edx, 0x00F
1259
    or       edx, 0x00F
1266
    int      0x40                     ; reseve port memory to this process
1260
    mcall                     ; reseve port memory to this process
Line 1267... Line 1261...
1267
 
1261
 
1268
    mov      eax, 45                  ; reserve irq 3
1262
    mov      eax, 45                  ; reserve irq 3
1269
    mov      ebx, 0
1263
    mov      ebx, 0
1270
    mov      ecx, 3
1264
    mov      ecx, 3
Line 1271... Line 1265...
1271
    int      0x40
1265
    mcall
1272
 
1266
 
1273
 
1267
 
1274
    mov      ecx, 0x2f8             ; data format register
1268
    mov      ecx, 0x2f8             ; data format register
1275
    add      ecx, 3
1269
    add      ecx, 3
Line 1276... Line 1270...
1276
    mov      bl, 0x80               ; enable access to divisor latch
1270
    mov      bl, 0x80               ; enable access to divisor latch
1277
    mov      eax, 43                ; send data to device - com port setup
1271
    mov      eax, 43                ; send data to device - com port setup
1278
    int      0x40
1272
    mcall
1279
 
1273
 
1280
    mov      ecx, 0x2f8          ; interrupt enable register
1274
    mov      ecx, 0x2f8          ; interrupt enable register
Line 1281... Line 1275...
1281
    inc      ecx
1275
    inc      ecx
1282
    mov      bl, 0                    ; No interruts enabled
1276
    mov      bl, 0                    ; No interruts enabled
1283
    mov      eax, 43                  ; send data to device (modem)
1277
    mov      eax, 43                  ; send data to device (modem)
1284
    int      0x40
1278
    mcall
Line 1285... Line 1279...
1285
 
1279
 
1286
    mov      ecx, 0x2f8                 ; Divisor latch LSB
1280
    mov      ecx, 0x2f8                 ; Divisor latch LSB
1287
    mov      bl, BAUDRATE             ; set baud rate
1281
    mov      bl, BAUDRATE             ; set baud rate
1288
    mov      eax, 43                  ; send data to device (modem)
1282
    mov      eax, 43                  ; send data to device (modem)
1289
    int      0x40
1283
    mcall
Line 1290... Line 1284...
1290
 
1284
 
1291
    mov      ecx, 0x2f8             ; Data format register
1285
    mov      ecx, 0x2f8             ; Data format register
1292
    add      ecx, 3
1286
    add      ecx, 3
1293
    mov      bl, 3                    ; 8 data bits
1287
    mov      bl, 3                    ; 8 data bits
1294
    mov      eax, 43                  ; send data to device (modem)
1288
    mov      eax, 43                  ; send data to device (modem)
1295
    int      0x40
1289
    mcall
Line 1296... Line 1290...
1296
 
1290
 
1297
    mov      ecx, 0x2f8        ; Modem control register
1291
    mov      ecx, 0x2f8        ; Modem control register
1298
    add      ecx, 4                ; ** bl must be 0x0b for modem to dial!
1292
    add      ecx, 4                ; ** bl must be 0x0b for modem to dial!
1299
    mov      bl, 0x0b              ; 0x08 -> out2 enabled. No handshaking.
1293
    mov      bl, 0x0b              ; 0x08 -> out2 enabled. No handshaking.
1300
       ; 0xb ->  out2 enabled, RTS/DTR enabled
1294
       ; 0xb ->  out2 enabled, RTS/DTR enabled
Line 1301... Line 1295...
1301
    mov      eax, 43               ; send data to device (modem)
1295
    mov      eax, 43               ; send data to device (modem)
Line 1302... Line 1296...
1302
    int      0x40
1296
    mcall
1303
 
1297
 
1304
;    mov      ecx, 0x2f8        ; interrupt enable register
1298
;    mov      ecx, 0x2f8        ; interrupt enable register
1305
;    inc      ecx
1299
;    inc      ecx
1306
;    mov      bl, 1                 ; rx data interrupt enabled, othrs not
1300
;    mov      bl, 1                 ; rx data interrupt enabled, othrs not
1307
;    mov      eax, 43               ; send data to device (modem)
1301
;    mov      eax, 43               ; send data to device (modem)
1308
;    int      0x40
1302
;    mcall
Line 1309... Line 1303...
1309
 
1303
 
1310
end if
1304
end if
1311
 
1305
 
1312
    mov      eax, 46
1306
    mov      eax, 46
Line 1313... Line 1307...
1313
    mov      ebx, 0
1307
    mov      ebx, 0
1314
    mov      ecx, [comport]
1308
    mov      ecx, [comport]
1315
    and      ecx, 0xFF0
1309
    and      ecx, 0xFF0
1316
    mov      edx, ecx
1310
    mov      edx, ecx
Line 1317... Line 1311...
1317
    or       edx, 0x00F
1311
    or       edx, 0x00F
1318
    int      0x40                     ; reseve port memory to this process
1312
    mcall                     ; reseve port memory to this process
1319
 
1313
 
1320
    mov      eax, 45                  ; reserve irq 4
1314
    mov      eax, 45                  ; reserve irq 4
1321
    mov      ebx, 0
1315
    mov      ebx, 0
Line 1322... Line 1316...
1322
    mov      ecx, [comirq]
1316
    mov      ecx, [comirq]
1323
    int      0x40
1317
    mcall
1324
 
1318
 
1325
    mov      eax, 44                  ; setup irq table
1319
    mov      eax, 44                  ; setup irq table
1326
    mov      ebx, irqtable
1320
    mov      ebx, irqtable
Line 1327... Line 1321...
1327
    mov      ecx, [comirq]
1321
    mov      ecx, [comirq]
1328
    int      0x40
1322
    mcall
1329
 
1323
 
1330
    mov      ecx, [comport]             ; data format register
1324
    mov      ecx, [comport]             ; data format register
Line 1331... Line 1325...
1331
    add      ecx, 3
1325
    add      ecx, 3
1332
    mov      bl, 0x80               ; enable access to divisor latch
1326
    mov      bl, 0x80               ; enable access to divisor latch
1333
    mov      eax, 43                ; send data to device - com port setup
1327
    mov      eax, 43                ; send data to device - com port setup
1334
    int      0x40
1328
    mcall
1335
 
1329
 
Line 1336... Line 1330...
1336
    mov      ecx, [comport]          ; interrupt enable register
1330
    mov      ecx, [comport]          ; interrupt enable register
1337
    inc      ecx
1331
    inc      ecx
1338
    mov      bl, 0                    ; No interruts enabled
1332
    mov      bl, 0                    ; No interruts enabled
1339
    mov      eax, 43                  ; send data to device (modem)
1333
    mov      eax, 43                  ; send data to device (modem)
1340
    int      0x40
1334
    mcall
1341
 
1335
 
Line 1342... Line 1336...
1342
    mov      ecx, [comport]                 ; Divisor latch LSB
1336
    mov      ecx, [comport]                 ; Divisor latch LSB
1343
    mov      bl, BAUDRATE             ; set baud rate
1337
    mov      bl, BAUDRATE             ; set baud rate
1344
    mov      eax, 43                  ; send data to device (modem)
1338
    mov      eax, 43                  ; send data to device (modem)
1345
    int      0x40
1339
    mcall
1346
 
1340
 
Line 1347... Line 1341...
1347
    mov      ecx, [comport]             ; Data format register
1341
    mov      ecx, [comport]             ; Data format register
1348
    add      ecx, 3
1342
    add      ecx, 3
1349
    mov      bl, 3                    ; 8 data bits
1343
    mov      bl, 3                    ; 8 data bits
1350
    mov      eax, 43                  ; send data to device (modem)
1344
    mov      eax, 43                  ; send data to device (modem)
1351
    int      0x40
1345
    mcall
1352
 
1346
 
1353
    mov      ecx, [comport]        ; Modem control register
1347
    mov      ecx, [comport]        ; Modem control register
Line 1354... Line 1348...
1354
    add      ecx, 4                ; ** bl must be 0x0b for modem to dial!
1348
    add      ecx, 4                ; ** bl must be 0x0b for modem to dial!
1355
    mov      bl, 0x0b              ; 0x08 -> out2 enabled. No handshaking.
1349
    mov      bl, 0x0b              ; 0x08 -> out2 enabled. No handshaking.
Line 1384... Line 1378...
1384
;       Normal window definition and text layout for application
1378
;       Normal window definition and text layout for application
1385
;**************************************************************************
1379
;**************************************************************************
1386
draw_window:
1380
draw_window:
1387
    mov      eax, 12                 ; function 12:tell os about windowdraw
1381
    mov      eax, 12                 ; function 12:tell os about windowdraw
1388
    mov      ebx, 1                  ; 1, start of draw
1382
    mov      ebx, 1                  ; 1, start of draw
1389
    int      0x40
1383
    mcall
1390
         ; DRAW WINDOW
1384
         ; DRAW WINDOW
1391
    mov      eax, 0                  ; function 0 : define and draw window
1385
    mov      eax, 0                  ; function 0 : define and draw window
1392
    mov      ebx, 100*65536+250      ; [x start] *65536 + [x size]
1386
    mov      ebx, 100*65536+250      ; [x start] *65536 + [x size]
1393
    mov      ecx, 100*65536+150      ; [y start] *65536 + [y size]
1387
    mov      ecx, 100*65536+150      ; [y start] *65536 + [y size]
1394
    mov      edx,0x03224466            ; color of work area RRGGBB
1388
    mov      edx,0x13224466          ; color of work area RRGGBB
1395
    mov      esi,0x00334455            ; color of grab bar  RRGGBB
-
 
1396
    mov      edi,0x00ddeeff            ; color of frames    RRGGBB
1389
    mov      edi,title               ; color of frames    RRGGBB
1397
    int      0x40
1390
    mcall
1398
         ; WINDOW LABEL
-
 
1399
    mov      eax, 4                  ; function 4 : write text to window
-
 
1400
    mov      ebx, 8*65536+8          ; [x start] *65536 + [y start]
-
 
1401
    mov      ecx, 0x00ffffff         ; color of text RRGGBB
-
 
1402
    mov      edx, labelt             ; pointer to text beginning
-
 
1403
    mov      esi, labellen-labelt    ; text length
-
 
1404
    int      0x40
-
 
-
 
1391
 
1405
       ; DIAL BUTTON
1392
       ; DIAL BUTTON
1406
    mov      eax, 8                  ; function 8 : define and draw button
1393
    mov      eax, 8                  ; function 8 : define and draw button
1407
    mov      ebx, (50)*65536+40      ; [x start] *65536 + [x size]
1394
    mov      ebx, (50)*65536+40      ; [x start] *65536 + [x size]
1408
    mov      ecx, 130*65536+12       ; [y start] *65536 + [y size]
1395
    mov      ecx, 130*65536+12       ; [y start] *65536 + [y size]
1409
    mov      edx, 2                  ; button id
1396
    mov      edx, 2                  ; button id
1410
    mov      esi, 0x5599cc           ; button color RRGGBB
1397
    mov      esi, 0x5599cc           ; button color RRGGBB
1411
    int      0x40
1398
    mcall
Line 1412... Line 1399...
1412
 
1399
 
1413
    mov      ebx, 55*65536+133       ; Draw button text
1400
    mov      ebx, 55*65536+133       ; Draw button text
1414
    mov      ecx, 0x00FFFFFF
1401
    mov      ecx, 0x00FFFFFF
1415
    mov      edx, button1_text
1402
    mov      edx, button1_text
1416
    xor      eax, eax
1403
    xor      eax, eax
1417
    mov      al,  [button1_text_len]
1404
    mov      al,  [button1_text_len]
1418
    mov      esi, eax
1405
    mov      esi, eax
1419
    mov      eax, 4
1406
    mov      eax, 4
1420
    int      0x40
1407
    mcall
1421
      ; DISCONNECT BUTTON
1408
      ; DISCONNECT BUTTON
1422
    mov      eax, 8                  ; function 8 : define and draw button
1409
    mov      eax, 8                  ; function 8 : define and draw button
1423
    mov      ebx, (150)*65536+65     ; [x start] *65536 + [x size]
1410
    mov      ebx, (150)*65536+65     ; [x start] *65536 + [x size]
1424
    mov      ecx, 130*65536+12       ; [y start] *65536 + [y size]
1411
    mov      ecx, 130*65536+12       ; [y start] *65536 + [y size]
1425
    mov      edx, 3                  ; button id
1412
    mov      edx, 3                  ; button id
1426
    mov      esi, 0x5599cc           ; button color RRGGBB
1413
    mov      esi, 0x5599cc           ; button color RRGGBB
Line 1427... Line 1414...
1427
    int      0x40
1414
    mcall
1428
 
1415
 
1429
    mov      ebx, 155*65536+133      ; Draw button text
1416
    mov      ebx, 155*65536+133      ; Draw button text
1430
    mov      ecx, 0x00FFFFFF
1417
    mov      ecx, 0x00FFFFFF
1431
    mov      edx, button3_text
1418
    mov      edx, button3_text
1432
    xor      eax, eax
1419
    xor      eax, eax
1433
    mov      al,  [button3_text_len]
1420
    mov      al,  [button3_text_len]
1434
    mov      esi, eax
1421
    mov      esi, eax
Line 1435... Line 1422...
1435
    mov      eax, 4
1422
    mov      eax, 4
1436
    int      0x40
1423
    mcall
1437
 
1424
 
1438
    mov      ebx, 5*65536+40         ; draw info text with function 4
1425
    mov      ebx, 5*65536+40         ; draw info text with function 4
1439
    mov      ecx, 0x00FFFFFF
1426
    mov      ecx, 0x00FFFFFF
1440
    mov      edx, [prompt]
1427
    mov      edx, [prompt]
1441
    xor      eax, eax
1428
    xor      eax, eax
1442
    mov      al,  [prompt_len]
1429
    mov      al,  [prompt_len]
Line 1443... Line 1430...
1443
    mov      esi, eax
1430
    mov      esi, eax
1444
    mov      eax, 4
1431
    mov      eax, 4
1445
    int      0x40
1432
    mcall
1446
 
1433
 
1447
    ; Draw IP address
1434
    ; Draw IP address
1448
    mov      edx, 10*65536+60
1435
    mov      edx, 10*65536+60
1449
    mov      esi, 0x00FFFFFF
1436
    mov      esi, 0x00FFFFFF
1450
    mov      ebx, 0x00030000
1437
    mov      ebx, 0x00030000
1451
    movzx    ecx, byte [addr1]
1438
    movzx    ecx, byte [addr1]
1452
    mov      eax, 47
1439
    mov      eax, 47
1453
    int      0x40
1440
    mcall
1454
    mov      edx, 31*65536+60
1441
    mov      edx, 31*65536+60
1455
    mov      esi, 0x00FFFFFF
1442
    mov      esi, 0x00FFFFFF
1456
    mov      ebx, 0x00030000
1443
    mov      ebx, 0x00030000
1457
    movzx    ecx, byte [addr2]
1444
    movzx    ecx, byte [addr2]
1458
    mov      eax, 47
1445
    mov      eax, 47
1459
    int      0x40
1446
    mcall
1460
    mov      edx, 52*65536+60
1447
    mov      edx, 52*65536+60
1461
    mov      esi, 0x00FFFFFF
1448
    mov      esi, 0x00FFFFFF
1462
    mov      ebx, 0x00030000
1449
    mov      ebx, 0x00030000
1463
    movzx    ecx, byte [addr3]
1450
    movzx    ecx, byte [addr3]
1464
    mov      eax, 47
1451
    mov      eax, 47
1465
    int      0x40
1452
    mcall
1466
    mov      edx, 73*65536+60
1453
    mov      edx, 73*65536+60
1467
    mov      esi, 0x00FFFFFF
1454
    mov      esi, 0x00FFFFFF
Line 1468... Line 1455...
1468
    mov      ebx, 0x00030000
1455
    mov      ebx, 0x00030000
1469
    movzx    ecx, byte [addr4]
1456
    movzx    ecx, byte [addr4]
1470
    mov      eax, 47
1457
    mov      eax, 47
1471
    int      0x40
1458
    mcall
1472
 
1459
 
1473
    ; Status byte
1460
    ; Status byte
1474
    mov      edx, 100*65536+60
1461
    mov      edx, 100*65536+60
Line 1475... Line 1462...
1475
    mov      esi, 0x00FFFFFF
1462
    mov      esi, 0x00FFFFFF
1476
    mov      ebx, 0x00010000
1463
    mov      ebx, 0x00010000
1477
    movzx    ecx, byte [state]
1464
    movzx    ecx, byte [state]
1478
    mov      eax, 47
1465
    mov      eax, 47
1479
    int      0x40
1466
    mcall
1480
 
1467
 
1481
    ; bytes sent / received
1468
    ; bytes sent / received
Line 1482... Line 1469...
1482
    mov      eax, 4                  ; function 4 : write text to window
1469
    mov      eax, 4                  ; function 4 : write text to window
1483
    mov      ebx, 10*65536+80          ; [x start] *65536 + [y start]
1470
    mov      ebx, 10*65536+80          ; [x start] *65536 + [y start]
1484
    mov      ecx, 0x00ffffff         ; color of text RRGGBB
1471
    mov      ecx, 0x00ffffff         ; color of text RRGGBB
1485
    mov      edx, txmsg              ; pointer to text beginning
1472
    mov      edx, txmsg              ; pointer to text beginning
1486
    mov      esi, txmsglen-txmsg    ; text length
1473
    mov      esi, txmsglen-txmsg    ; text length
1487
    int      0x40
1474
    mcall
Line 1488... Line 1475...
1488
 
1475
 
Line 1489... Line 1476...
1489
    mov      eax, 4                  ; function 4 : write text to window
1476
    mov      eax, 4                  ; function 4 : write text to window
1490
    mov      ebx, 10*65536+100          ; [x start] *65536 + [y start]
1477
    mov      ebx, 10*65536+100          ; [x start] *65536 + [y start]
1491
    mov      ecx, 0x00ffffff         ; color of text RRGGBB
1478
    mov      ecx, 0x00ffffff         ; color of text RRGGBB
Line 1492... Line 1479...
1492
    mov      edx, rxmsg              ; pointer to text beginning
1479
    mov      edx, rxmsg              ; pointer to text beginning
Line 1493... Line 1480...
1493
    mov      esi, rxmsglen-rxmsg    ; text length
1480
    mov      esi, rxmsglen-rxmsg    ; text length
1494
    int      0x40
1481
    mcall
1495
 
1482
 
1496
    call    draw_window_limited
1483
    call    draw_window_limited
1497
 
1484
 
1498
    mov      eax, 12                 ; end of redraw
-
 
1499
    mov      ebx, 2
1485
    mov      eax, 12                 ; end of redraw
1500
    int      0x40
-
 
1501
 
1486
    mov      ebx, 2
1502
    ret
-
 
1503
 
1487
    mcall
Line 1504... Line 1488...
1504
 
1488
 
1505
 
1489
    ret
1506
draw_window_limited:
1490
 
1507
    mov     eax,13
1491
 
1508
    mov     ebx,80*65536+10*6
1492
 
1509
    mov     ecx,80*65536+10
1493
draw_window_limited:
Line 1510... Line 1494...
1510
    mov     edx,0x03224466
1494
    mov     eax,13
1511
    int     0x40
1495
    mov     ebx,80*65536+10*6
1512
    mov     eax,13
1496
    mov     ecx,80*65536+10
1513
    mov     ebx,80*65536+10*6
1497
    mov     edx,0x03224466
1514
    mov     ecx,100*65536+10
1498
    mcall
1515
    mov     edx,0x03224466
1499
    mov     ecx,100*65536+10
1516
    int     0x40
1500
    mcall
Line 1517... Line 1501...
1517
 
1501
 
1518
    mov     ebx, 0x000A0000
1502
    mov     ebx, 0x000A0000
Line 1543... Line 1527...
1543
;****************************************************************************
1527
;****************************************************************************
1544
settimer:
1528
settimer:
1545
    push    eax
1529
    push    eax
1546
    mov     eax, 26
1530
    mov     eax, 26
1547
    mov     ebx, 9
1531
    mov     ebx, 9
1548
    int     0x40        ; get 100th second counter
1532
    mcall        ; get 100th second counter
1549
    pop     ebx
1533
    pop     ebx
1550
    sub     eax, ebx    ; This could have some funny side effecs if PPP
1534
    sub     eax, ebx    ; This could have some funny side effecs if PPP
1551
   ; called within ebx seconds of startup
1535
   ; called within ebx seconds of startup
1552
    mov     [timerValue], eax
1536
    mov     [timerValue], eax
1553
    ret
1537
    ret
Line 1564... Line 1548...
1564
;
1548
;
1565
;****************************************************************************
1549
;****************************************************************************
1566
gettimer:
1550
gettimer:
1567
    mov     eax, 26
1551
    mov     eax, 26
1568
    mov     ebx, 9
1552
    mov     ebx, 9
1569
    int     0x40        ; get 100th second counter
1553
    mcall        ; get 100th second counter
Line 1570... Line 1554...
1570
 
1554
 
1571
    sub     eax, [timerValue]
1555
    sub     eax, [timerValue]
Line 1622... Line 1606...
1622
 
1606
 
1623
sw_000:
1607
sw_000:
Line 1624... Line 1608...
1624
    ; any data from modem?
1608
    ; any data from modem?
1625
 
1609
 
1626
    mov     eax,11                     ; This will return 0 most of the time
1610
    mov     eax,11                     ; This will return 0 most of the time
1627
    int     0x40
1611
    mcall
1628
    mov     ecx, eax
1612
    mov     ecx, eax
Line 1658... Line 1642...
1658
 
1642
 
1659
    push    edx
1643
    push    edx
1660
    push    eax
1644
    push    eax
1661
    mov     eax,42
1645
    mov     eax,42
1662
    mov     ebx, [comirq]
1646
    mov     ebx, [comirq]
1663
    int     0x40
1647
    mcall
1664
    pop     eax
1648
    pop     eax
Line 1665... Line 1649...
1665
    pop     edx
1649
    pop     edx
Line 1783... Line 1767...
1783
    ; Test for tx ready.
1767
    ; Test for tx ready.
1784
    ; OR, wait then send
1768
    ; OR, wait then send
1785
    push    edi
1769
    push    edi
1786
    mov     eax, 5
1770
    mov     eax, 5
1787
    mov     ebx, 1
1771
    mov     ebx, 1
1788
    int     0x40        ; 10ms delay
1772
    mcall        ; 10ms delay
1789
    pop     edi
1773
    pop     edi
Line 1790... Line 1774...
1790
 
1774
 
1791
    ; send the character
1775
    ; send the character
1792
    pop     eax
1776
    pop     eax
Line 1793... Line 1777...
1793
    mov     bl, [edi + eax]
1777
    mov     bl, [edi + eax]
1794
 
1778
 
1795
    mov     ecx, [comport]
1779
    mov     ecx, [comport]
1796
    inc     eax
1780
    inc     eax
1797
    push    eax
1781
    push    eax
Line 1798... Line 1782...
1798
    mov     eax, 43
1782
    mov     eax, 43
1799
    int     0x40
1783
    mcall
Line 1800... Line 1784...
1800
 
1784
 
Line 1879... Line 1863...
1879
    push    ecx
1863
    push    ecx
Line 1880... Line 1864...
1880
 
1864
 
1881
wait_txd2t:
1865
wait_txd2t:
1882
    mov     eax,43
1866
    mov     eax,43
1883
    mov     ecx,0x80000000 + 0x2f8 + 5
1867
    mov     ecx,0x80000000 + 0x2f8 + 5
1884
    int     0x40
1868
    mcall
1885
    and     bl, 0x40
1869
    and     bl, 0x40
1886
    cmp     bl, 0
1870
    cmp     bl, 0
Line 1887... Line 1871...
1887
    jz      wait_txd2t                  ; loop until free
1871
    jz      wait_txd2t                  ; loop until free
Line 1891... Line 1875...
1891
 
1875
 
Line 1892... Line 1876...
1892
    ; send the character
1876
    ; send the character
1893
 
1877
 
1894
    mov     ecx, 0x2f8
1878
    mov     ecx, 0x2f8
1895
    mov     eax, 43
1879
    mov     eax, 43
Line 1896... Line 1880...
1896
    int     0x40
1880
    mcall
1897
    ret
1881
    ret
Line 1922... Line 1906...
1922
    popa
1906
    popa
1923
end if
1907
end if
1924
    mov     eax,63
1908
    mov     eax,63
1925
    mov     ebx, 1
1909
    mov     ebx, 1
1926
    push    esi
1910
    push    esi
1927
    int 0x40
1911
    mcall
1928
    pop     esi
1912
    pop     esi
1929
    inc     esi
1913
    inc     esi
1930
    jmp     debug_print_string
1914
    jmp     debug_print_string
Line 2157... Line 2141...
2157
; Pointer to prompt shown to user
2141
; Pointer to prompt shown to user
2158
prompt              dd  0
2142
prompt              dd  0
2159
prompt_len          db  0
2143
prompt_len          db  0
Line 2160... Line 2144...
2160
 
2144
 
2161
; Application Title
2145
; Application Title
2162
labelt              db  'PPP Dialer'
-
 
Line 2163... Line 2146...
2163
labellen:
2146
title               db  'PPP Dialer',0
2164
 
2147
 
2165
txmsg:              db  'Tx bytes :'
2148
txmsg:              db  'Tx bytes :'
2166
txmsglen:
2149
txmsglen: