29,32c29,32 < xref LinkerDB ; Base of data segment < xref RESLEN ; Length of data+bss segment < xref RESBASE ; Base offset of data+bss segment < xref NEWDATAL ; Number of longs in data --- > xref _LinkerDB ; Base of data segment > xref _RESLEN ; Length of data+bss segment > xref _RESBASE ; Base offset of data+bss segment > xref _NEWDATAL ; Number of longs in data 41a42,43 > ULONG pl_SEGLIST > ULONG pl_FLAGS 44,46d45 < ULONG pl_SEGLIST < UBYTE pl_FLAGS < UBYTE pl_pad 57c56 < xref MemCleanup ; Free all allocated memory --- > ; xref _MemCleanup ; Free all allocated memory 59,72c58,71 < xref initialise ; Initialise the interpreter < xref terminate ; Terminate the interpreter < xref intstring ; Interpret a string or file < xref signalint ; Signal an interrupt < xref signalfpe ; Signal a floating point error < xref error ; Error < xref vmalloc ; Allocate VM space < xref vmxptr ; Convert VM reference to pointer < xref setdevice ; Change device page < xref errstr ; Return error name string < < xdef callextfunc ; Call external function < xdef flushpage ; Flush the page to the screen < xdef copypage ; Copy the page to the output --- > xref @initialise ; Initialise the interpreter > xref @terminate ; Terminate the interpreter > xref @intstring ; Interpret a string or file > xref @signalint ; Signal an interrupt > xref @signalfpe ; Signal a floating point error > xref @error ; Error > xref @vmalloc ; Allocate VM space > xref @vmxptr ; Convert VM reference to pointer > xref @setdevice ; Change device page > xref @errstr ; Return error name string > > xdef @callextfunc ; Call external function > xdef @flushpage ; Flush the page to the screen > xdef @copypage ; Copy the page to the output 159,160c158,159 < lea dosname(pc),a1 < moveq #0,D0 --- > lea dosname(pc),a1 > moveq #0,D0 162,163c161,162 < move.l d0,pl_DOSBASE(A5) < bne.s in1 --- > move.l d0,pl_DOSBASE(A5) > bne.s in1 177,179c176,178 < sub.l #RESBASE,a0 < and.w attnflags(a0),d0 ; Check for FPU (68881/68020 ...) < cmp.w attnflags(a0),d0 --- > sub.l #_RESBASE,a0 > and.w _attnflags(a0),d0 ; Check for FPU (68881/68020 ...) > cmp.w _attnflags(a0),d0 191c190 < getdb: lea LinkerDB,a0 ; Original data segment --- > getdb: lea _LinkerDB,a0 ; Original data segment 254c253 < move.l #RESLEN,d0 ; Length of data segment --- > move.l #_RESLEN,d0 ; Length of data segment 261,262c260,261 < sub.l #RESBASE,a0 < move.l #NEWDATAL,d1 ; Number of longs (<64K!) --- > sub.l #_RESBASE,a0 > move.l #_NEWDATAL,d1 ; Number of longs 266c265,266 < ca2: dbf d1,ca1 --- > ca2: subq #1,d1 > bpl.s ca1 268c268 < move.l (a0)+,d1 ; Number of relocs (<64K!) --- > move.l (a0)+,d1 ; Number of relocs 274c274,275 < ca4: dbf d1,ca3 --- > ca4: subq.l #1,d1 > bpl.s ca3 277,279c278,280 < add.l #RESBASE,a4 < move.l pl_EXECBASE(a5),SysBase(a4) < move.l pl_DOSBASE(a5),DOSBase(a4) --- > add.l #_RESBASE,a4 > move.l pl_EXECBASE(a5),_SysBase(a4) > move.l pl_DOSBASE(a5),_DOSBase(a4) 281c282 < move.l pr_CurrentDir(a3),curdir(a4) --- > move.l pr_CurrentDir(a3),_curdir(a4) 283,285c284,285 < move.l a2,-(sp) ; parm < jsr initialise(pc) ; Call initialisation routine < addq.l #4,sp --- > move.l a2,a0 ; parm > jsr @initialise(pc) ; Call initialisation routine 291c291 < sub.l #RESBASE,a4 ; Return base of new segment --- > sub.l #_RESBASE,a4 ; Return base of new segment 308c308 < add.l #RESBASE,a4 --- > add.l #_RESBASE,a4 311,314c311,314 < jsr terminate(pc) ; Call termination routine < jsr MemCleanup(pc) ; Cleanup leftover memory < move.l #RESLEN,d0 ; Length of data segment < move.l SysBase(a4),a6 --- > jsr @terminate(pc) ; Call termination routine > jsr _MemCleanup(pc) ; Cleanup leftover memory > move.l #_RESLEN,d0 ; Length of data segment > move.l _SysBase(a4),a6 316c316 < sub.l #RESBASE,a1 --- > sub.l #_RESBASE,a1 332c332 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 334,340c334,337 < add.l #RESBASE,a4 < move.l d1,-(sp) ; Flags < move.l d0,-(sp) ; Length < move.l a1,-(sp) ; String < jsr intstring(pc) ; Call interpreter < add.w #12,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > move.l a1,a0 ; String > jsr @intstring(pc) ; Call interpreter > movem.l (sp)+,a4/a6 352c349 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 354,358c351,353 < add.l #RESBASE,a4 < move.l d0,-(sp) ; flag < jsr signalint(pc) ; Signal interupt < addq.l #4,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > jsr @signalint(pc) ; Signal interupt > movem.l (sp)+,a4/a6 370c365 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 372,374c367,369 < add.l #RESBASE,a4 < jsr signalfpe(pc) ; Signal floating point error < ; move.l (sp)+,a4 ; No return --- > add.l #_RESBASE,a4 > jsr @signalfpe(pc) ; Signal floating point error > ; movem.l (sp)+,a4/a6 ; No return 386c381 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 388,392c383,385 < add.l #RESBASE,a4 < move.l d0,-(sp) < jsr error(pc) ; Call error routine < ; addq.l #4,sp ; No return < ; move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > jsr @error(pc) ; Call error routine > ; movem.l (sp)+,a4/a6 404c397 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 406,410c399,401 < add.l #RESBASE,a4 < move.l d0,-(sp) < jsr vmalloc(pc) ; Allocae VM space < addq.l #4,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > jsr @vmalloc(pc) ; Allocae VM space > movem.l (sp)+,a4/a6 422c413 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 424,428c415,417 < add.l #RESBASE,a4 < move.l d0,-(sp) < jsr vmxptr(pc) ; Convert VM reference to pointer < addq.l #4,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > jsr @vmxptr(pc) ; Convert VM reference to pointer > movem.l (sp)+,a4/a6 440c429 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 442,446c431,434 < add.l #RESBASE,a4 < move.l a1,-(sp) < jsr setdevice(pc) ; Change device page < addq.l #4,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > move.l a1,a0 > jsr @setdevice(pc) ; Change device page > movem.l (sp)+,a4/a6 458c446 < move.l a4,-(sp) --- > movem.l a4/a6,-(sp) 460,464c448,450 < add.l #RESBASE,a4 < move.l d0,-(sp) < jsr errstr(pc) ; Return error name string < addq.l #4,sp < move.l (sp)+,a4 --- > add.l #_RESBASE,a4 > jsr @errstr(pc) ; Return error name string > movem.l (sp)+,a4/a6 479,482c465,468 < callextfunc: < move.l 4(sp),a0 ; Function < move.l 8(sp),a1 ; Parameters array < move.l 12(sp),d0 ; Number of parameters --- > @callextfunc: > ; move.l 4(sp),a0 ; Function > ; move.l 8(sp),a1 ; Parameters array > ; move.l 12(sp),d0 ; Number of parameters 506,507c492,494 < flushpage: < move.l flushfunc(a4),d0 ; Get the function --- > @flushpage: > move.l d0,a0 > move.l _flushfunc(a4),d0 ; Get the function 509a497 > move.l a0,d0 511,514c499,502 < sub.l #RESBASE,a0 < move.l userdata(a4),a1 ; User data pointer (a1 = udata) < move.l 8(sp),d0 ; y1 < move.l 12(sp),d1 ; y2 --- > sub.l #_RESBASE,a0 > move.l _userdata(a4),a1 ; User data pointer (a1 = udata) > ; move.l 8(sp),d0 ; y1 > ; move.l 12(sp),d1 ; y2 525,526c513,514 < copypage: < move.l copyfunc(a4),d0 ; Get the function --- > @copypage: > move.l _copyfunc(a4),d1 ; Get the function 528c516 < move.l d0,-(sp) ; Push function --- > move.l d1,-(sp) ; Push function 530,532c518,520 < sub.l #RESBASE,a0 < move.l userdata(a4),a1 ; User data pointer (a1 = udata) < move.l 8(sp),d0 ; num --- > sub.l #_RESBASE,a0 > move.l _userdata(a4),a1 ; User data pointer (a1 = udata) > ; move.l 8(sp),d0 ; num 536a525,583 > ; For SAS/C 6.1 > ; > ;*************************************************************************** > _MemCleanup: > MOVEM.L D6-D7/A3/A5-A7,-(A7) > MOVEA.L __MemHeap(A4),A5 > BRA.B 2$ > 1$: > MOVEA.L (A5),A3 > MOVEQ #$14,D0 > ADD.L 0004(A5),D0 > MOVEA.L A5,A1 > MOVEA.L 0004,A6 > JSR _LVOFreeMem(A6) > MOVEA.L A3,A5 > 2$: > MOVE.L A5,D0 > BNE.B 1$ > CLR.L __MemHeap(A4) > MOVEM.L (A7)+,D6-D7/A3/A5-A7 > RTS > > xdef ___setjmp > xdef @__setjmp > > ___setjmp: > MOVEA.L 0004(A7),A0 > @__setjmp: > MOVEM.L D1-D7/A1-A7,0004(A0) > MOVE.L 0000(A7),0000(A0) > MOVEA.L 0004,A1 > BTST #0004,$0129(A1) > BEQ.B 1$ > FMOVEM.X FP0-FP7,$003C(A0) > 1$: > MOVEQ #00,D0 > RTS > > xdef _longjmp > xdef @longjmp > > _longjmp: > MOVE.L 0008(A7),D0 > MOVEA.L 0004(A7),A0 > @longjmp: > TST.L D0 > BNE.B 1$ > ADDQ.L #1,D0 > 1$: > MOVEA.L 0004,A1 > BTST #0004,$0129(A1) > BEQ.B 2$ > FMOVEM.X $003C(A0),FP0-FP7 > 2$: > MOVEM.L 0004(A0),D1-D7/A1-A7 > MOVE.L (A0),(A7) > RTS > ;*************************************************************************** > ; 543c590 < xref attnflags ; Required machine flags (68881/68020...) --- > xref _attnflags ; Required machine flags (68881/68020...) 547c594,620 < xref DOSBase ; DOS library base --- > xref _DOSBase ; DOS library base > > xref _userdata ; User data pointer > xref _flushfunc ; Flush page function > xref _copyfunc ; Copy page function > > xref __MemHeap > > xdef _SysBase > xdef _curdir > xdef __oserr > xdef __OSERR > xdef __FPERR > xdef __ONBREAK > > xdef ___closefunc > xdef ___ufbs3 > > > _SysBase: ds.b 4 ; Exec library base > _curdir: ds.b 4 ; Current directory > __oserr equ * > __OSERR: ds.b 4 ; Operating system error number > __FPERR: ds.b 4 ; Floating point error number > __ONBREAK: ds.b 4 ; Break trap routine > > ___closefunc: ds.b 4 ; SAS/C 6.1 for exit(). Only to keep open happy! 549,566c622 < xref userdata ; User data pointer < xref flushfunc ; Flush page function < xref copyfunc ; Copy page function < < xdef SysBase < xdef curdir < xdef _oserr < xdef _OSERR < xdef _FPERR < xdef _ONBREAK < < < SysBase: ds.b 4 ; Exec library base < curdir: ds.b 4 ; Current directory < _oserr equ * < _OSERR: ds.b 4 ; Operating system error number < _FPERR: ds.b 4 ; Floating point error number < _ONBREAK: ds.b 4 ; Break trap routine --- > ___ufbs3: ds.b 3*16 ; SAS/C 6.1 Fake I/O handles!