summaryrefslogtreecommitdiff
path: root/v4.0/src/DEV/SMARTDRV/OLI.CMP
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/DEV/SMARTDRV/OLI.CMP')
-rw-r--r--v4.0/src/DEV/SMARTDRV/OLI.CMP464
1 files changed, 464 insertions, 0 deletions
diff --git a/v4.0/src/DEV/SMARTDRV/OLI.CMP b/v4.0/src/DEV/SMARTDRV/OLI.CMP
new file mode 100644
index 0000000..8a9a767
--- /dev/null
+++ b/v4.0/src/DEV/SMARTDRV/OLI.CMP
@@ -0,0 +1,464 @@
1CMP V2.13 Copyright (C) 1984, 1985 by White Heron Corporation
2 All rights reserved
3
4 old: smartdrv.asm (on the left) Note: < marks old lines.
5 new: a:smartdrv.asm (on the right) > marks new lines.
6
7===============================================================================
8
96<; Will use IBM extended memory on PC-AT or
107<; use Above Board on PC, XT, or AT
118<;
129<;
1310<; device = SMARTDRV.sys [bbbb] [/a]
14
15 ----> changed to the following:
16
176>;; Will use IBM extended memory on PC-AT or
187>;; use Above Board on PC, XT, or AT, and
198>;; use extended, expanded, or upper extended memory on AT&T 6300 PLUS
209>;
2110>;
2211>;; device = SMARTDRV.sys [bbbb] [/a] [/u]
23
24===============================================================================
25
2640<;
27
28 ----> changed to the following:
29
3041>;; /u Specifies that upper extended memory will be used
3142>;; on the AT&T 6300 PLUS. Upper extended memory
3243>;; is the memory beginning at FA0000. It is used
3344>;; to hold the UNIX kernel when the machine is running
3445>;; Simul-Task. However, when operating as a pure
3546>;; MS-DOS machine, this 384K of memory is available
3647>;; for SMARTDRIVE.
3748>;; Note that it is an error to specify this switch
3849>;; if the machine is not a 6300 PLUS.
39
40===============================================================================
41
42102>;; ?.?? 7/24/87 WSH Added 6300 PLUS support. This code is marked by
43103>;; the use of double semi-colons to make it easy to
44104>;; find.
45
46 ----> inserted before the following old file line:
47
4893<
49
50===============================================================================
51
52125>
53126>;; In order to address memory above 1 MB on the AT&T 6300 PLUS, it is
54127>;; necessary to use the special OS-MERGE hardware to activate lines
55128>;; A20 to A23. However, these lines can be disabled only by resetting
56129>;; the processor. The return address offset and segment can be found
57130>;; at 40:a2, noted here as RealLoc1.
58131>;;
59132>BiosSeg segment at 40h ;; Used to locate 6300 PLUS reset address
60133> org 00a2h
61134>RealLoc1 dd 0
62135>BiosSeg ends
63
64 ----> inserted before the following old file line:
65
66113<
67
68===============================================================================
69
70147>;; The /U configuration using upper extended memory on the
71148>;; 6300 PLUS is a special case of the type 1 configuration.
72
73 ----> inserted before the following old file line:
74
75124<;
76
77===============================================================================
78
79327>;; The internal name of the device driver has been changed from SMARTDRV
80328>;; to SMARTAAR to avoid DOS name conflicts with files named SMARTDRV.*
81329>;;
82
83 ----> inserted before the following old file line:
84
85302<INT13DEV LABEL WORD
86
87===============================================================================
88
89307< DB "SMARTDRV" ;Name of device
90
91 ----> changed to the following:
92
93335> DB "SMARTAAR" ;Name of device
94
95===============================================================================
96
97387>;; Data peculiar to AT&T 6300 PLUS.
98388>
99389>S5_FLAG DB 0 ;; If set, computer is a 6300 PLUS
100
101 ----> inserted before the following old file line:
102
103359<
104
105===============================================================================
106
1073074>;; NOTE: The value at BASE_ADDR is patched during initialization when
1083075>;; loading a RAMDrive into upper extended memory on a PLUS
1093076>;;
110
111 ----> inserted before the following old file line:
112
1133043<BASE_ADDR LABEL DWORD ; 24 bit address of start of this RAMDRV
114
115===============================================================================
116
1173190< MOV AH,0DFH
118
119 ----> changed to the following:
120
1213224>
1223225>;;
1233226>;; Enable address line 20 on the PC AT or activate A20-A23 on the 6300 PLUS.
1243227>;; The former can be done by placing 0dfh in AH and activating the keyboard
1253228>;; processor. On the PLUS, 90h goes in AL and the port at 03f20h is written.
1263229>;; So the combined value of 0df90h can be used for both machines with
1273230>;; appropriate coding of the called routine A20.
1283231>;;
1293232>
1303233>;; MOV AH,0DFH
1313234> mov ax,0df90h ;; set up for PLUS or AT
132
133===============================================================================
134
1353248< MOV AH,0DDH
1363249< CALL A20 ; Disable address line 20
137
138 ----> changed to the following:
139
1403292>
1413293>;;
1423294>;; Reset of line A20 on the PC AT requires writing 0ddh to the keyboard
1433295>;; processor. On the PLUS, the appropriate value is 00.
1443296>;;
1453297>
1463298>;; MOV AH,0DDH
1473299> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS
1483300> CALL A20 ; Disable address line 20
149
150===============================================================================
151
1523331>;; CS override needed on S5_FLAG to avoid phase errors on
1533332>;; forward declaration of this variable.
1543333> cmp cs:[S5_FLAG],0 ;; test for 6300 PLUS
1553334> jnz A20S5 ;; yes, do this code
156
157 ----> inserted before the following old file line:
158
1593280< CLI
160
161===============================================================================
162
1633376>
1643377>;;* A20S5 - Address enable/disable routine for the 6300 PLUS.
1653378>;;
1663379>;; This routine enables lines A20-A23 on the PLUS by writing
1673380>;; to port 03f20h. Bit 7 turns the lines on, and bit 4 sets
1683381>;; the power-up bit. To disable the lines, the processor
1693382>;; must be reset. This is done by saving the world and
1703383>;; jumping to the ROM 80286 reset code. Since the power-up bit
1713384>;; is set, the data segment is set to the BiosSeg at 40h
1723385>;; and a jump is then made to the address at RealLoc1.
1733386>;; At RealLoc1, one can find the CS:IP where the code
1743387>;; is to continue.
1753388>;;
1763389>;; Uses ax, flags.
1773390>;; Returns with zero flag set.
1783391>;;
1793392>A20S5:
1803393> cli
1813394> or al,al ;; if zero, then resetting processor
1823395> jnz A20S5Next
1833396> call RSet ;; must return with entry value of ax
1843397>A20S5Next:
1853398> push dx ;; set/reset port
1863399> mov dx,3f20h
1873400> out dx,al
1883401> pop dx
1893402> xor al,al
1903403> STI
1913404> RET
1923405>
1933406>;;* a20S5BOOT - This code bypasses the processor reset on a reboot
1943407>;; of the 6300 PLUS. Otherwise the machine hangs.
1953408>a20s5BOOT: ;; use this code before reboot
1963409> cli
1973410> jmp short a20s5next
1983411>
1993412>OldStackSeg dw 0 ;; used during PLUS processor reset
2003413> ;; to save the stack segment
2013414>
2023415>;;* Rset - Reset the 80286 in order to turn off the address lines
2033416>;; on the 6300 PLUS. Only way to do this on the
2043417>;; current hardware. The processor itself can be
2053418>;; reset by reading or writing prot 03f00h
2063419>;;
2073420>;; Uses flags.
2083421>;;
2093422>RSet:
2103423> pusha ;; save world
2113424> push ds ;; save segments
2123425> push es
2133426> mov ax,BiosSeg ;; point to the bios segment
2143427> mov ds,ax ;; ds -> 40h
2153428>assume ds:BiosSeg
2163429> push word ptr [RealLoc1] ;; save what might have been here
2173430> push word ptr [RealLoc1+2]
2183431> mov word ptr [RealLoc1],cs:[offset ReturnBack] ;; load our return address
2193432> mov word ptr [RealLoc1+2],cs
2203433>assume ds:nothing
2213434> mov [OldStackSeg],ss ;; save the stack segment, too
2223435> mov dx,03f00h ;; reset the processor
2233436> in ax,dx
2243437> nop
2253438> nop
2263439> nop
2273440> cli
2283441> hlt ;; should never get here
2293442>ReturnBack:
2303443> mov ss,[OldStackSeg] ;; start the recovery
2313444>assume ds:BiosSeg
2323445> pop word ptr [RealLoc1+2]
2333446> pop word ptr [RealLoc1]
2343447> pop es
2353448> pop ds
2363449> popa
2373450> ret
238
239 ----> inserted before the following old file line:
240
2413321<
242
243===============================================================================
244
2453530<; out any dirty tracks take a LONG time, so long that we loose
246
247 ----> changed to the following:
248
2493660>; out any dirty tracks take a LONG time, so long that we lose
250
251===============================================================================
252
2533652< ; Reset INT 1C vector to trun cache off
254
255 ----> changed to the following:
256
2573782> ; Reset INT 1C vector to turn cache off
258
259===============================================================================
260
2613732< MOV AH,0DFH
262
263 ----> changed to the following:
264
2653862>;; MOV AH,0DFH
2663863> mov ax,0df90h ;; set up for PLUS or AT
267
268===============================================================================
269
2703775< MOV AH,0DDH ; Disable adress line 20
2713776< CALL A20
272
273 ----> changed to the following:
274
2753906>;; MOV AH,0DDH ; Disable adress line 20
2763907> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS
2773908> cmp [S5_FLAG],0
2783909> jz OFF20A
2793910> call a20s5boot ;; Don't reset the processor on PLUS, this time
2803911> jmp short off20b
2813912>off20a:
2823913> CALL A20
2833914>off20b:
284
285===============================================================================
286
2874078>
2884079>U_SWITCH db 0 ;; upper extended memory requested on 6300 PLUS
289
290 ----> inserted before the following old file line:
291
2923940<
293
294===============================================================================
295
2964274>
2974275>;;
2984276>;; 2.5 Check here for 6300 PLUS machine. First look for Olivetti copyright,
2994277>;; and if found, check id byte at f000:fffd.
3004278>;;
3014279>
3024280> push es ;; Olivetti Machine?
3034281> mov ax,0fc00h ;; Look for 'OL' at fc00:50
3044282> mov es,ax
3054283> cmp es:[0050h],'LO'
3064284> jnz notS5 ;; not found
3074285> mov ax,0f000h
3084286> mov es,ax
3094287> cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus
3104288> jnz notS5
3114289> dec [S5_FLAG] ;; yep, set flag
3124290>notS5:
3134291> pop es
3144292>
315
316 ----> inserted before the following old file line:
317
3184134<;
319
320===============================================================================
321
3224411>;; Added for /u switch
3234412> cmp al,'u' ;; Look for U switch for PLUS
3244413> jnz A_TEST
3254414> cmp [S5_FLAG],0 ;; No good unless PLUS
3264415> jz bad_parm
3274416> TEST [GOTSWITCH],SWITCH_A ;; Already have switch A ?
3284417> JNZ BAD_PARM
3294418> cmp [U_SWITCH],0
3304419> jne bad_parm
3314420> dec [U_SWITCH]
3324421> jmp scan_loop
3334422>A_TEST:
3344423>;;
335
336 ----> inserted before the following old file line:
337
3384252< CMP AL,"a"
339
340===============================================================================
341
3424435>;; added for /u switch
3434436> cmp [U_SWITCH],0
3444437> jne bad_parm
3454438>;;
346
347 ----> inserted before the following old file line:
348
3494263< OR [GOTSWITCH],SWITCH_A
350
351===============================================================================
352
3534847>;; Note: When using upper extended memory on the PLUS, the value
3544848>;; at BASE_RESET + 2 is patched to FA during initialization.
3554849>;;
356
357 ----> inserted before the following old file line:
358
3594671<BASE_RESET LABEL DWORD ; RESMEM driver must patch this value
360
361===============================================================================
362
3635312> cmp U_SWITCH,0 ;; don't do this for at&t 6300 plus
3645313> jnz ret005
365
366 ----> inserted before the following old file line:
367
3685133< PUSH AX
369
370===============================================================================
371
3725394>
3735395>;; If upper extended memory is used on the PLUS, it is necessary to
3745396>;; patch the values of base_reset and base_addr to get the addressing right.
3755397>;;
3765398> cmp [U_SWITCH],0 ;; patch the code for /U option
3775399> jz AT001A
3785400> mov ax,00fah
3795401> mov word ptr [base_reset+2],ax ;; patching upper address
3805402> mov word ptr [base_addr+2],ax ;; to FA from 10
3815403>AT001A:
3825404>
383
384 ----> inserted before the following old file line:
385
3865213< MOV AX,8800H
387
388===============================================================================
389
3905214< INT 15H ; Get extended memory size
391
392 ----> changed to the following:
393
3945406> INT 15H ; Get extended memory size
395
396===============================================================================
397
3985410>
3995411>;; If running on a 6300 PLUS, it is necessary to subtract any upper extended
4005412>;; memory from the value obtained by int 15 to determine the correct memory
4015413>;; available for a type /E RAMDrive. If loading a /U RAMDrive, it is necessary
4025414>;; to find out if there IS any upper extended memory.
4035415>
4045416> cmp [U_SWITCH],0 ;; did we ask for upper extended memory
4055417> jz olstuff ;; no
4065418> call UpperMemCheck ;; yes, see if anything there
4075419> jc ERR_RET ;; no, quit
4085420> mov ax,384 ;; yes, but max allowed is 384K
4095421> jmp short at001b
4105422>olstuff:
4115423> cmp [S5_FLAG],0 ;; if not 6300 PLUS, go on
4125424> jz at001b
4135425> call UpperMemCheck ;; yes, see if 384K is there
4145426> jc at001b ;; no, so int 15h is right
4155427> sub ax,384 ;; yes, subtract 384K
4165428>AT001B:
4175429>
418
419 ----> inserted before the following old file line:
420
4215218< MOV DX,OFFSET ERRMSG2
422
423===============================================================================
424
4255466>
4265467>;;* UpperMemCheck - Called by 6300 PLUS to verify existence of
4275468>;; upper extended memory of 384K at FA0000h
4285469>;;
4295470>;; Returns carry set if no upper extended memory.
4305471>;;
4315472>;; This routine is called only by a 6300 PLUS, and
4325473>;; it reads the hardware switch DSW2 to do the job.
4335474>;;
4345475>UpperMemCheck:
4355476> push ax
4365477> in al,66h
4375478> and al,00001111b
4385479> cmp al,00001011b
4395480> pop ax
4405481> jnz nomem
4415482> clc
4425483> ret
4435484>nomem:
4445485> stc
4455486> ret
446
447 ----> inserted before the following old file line:
448
4495254<
450
451===============================================================================
452
4536301>s5flagmsg db " = S5 flag",13,10,"$"
4546302>U_msg db " = U Switch", 13,10,'$'
455
456 ----> inserted before the following old file line:
457
4586068<ENDIF
459
460===============================================================================
461
46228 discrepancies.
463 File smartdrv.asm has 6075 lines.
464 File a:smartdrv.asm has 6310 lines.