[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a GS run Linux?



On Mar 30, 6:27 pm, Tristan Mumford <xtristan.xmumf...@xgmail.xcom>
wrote:
> TheWDCtoolchain would seem a better option apart from needing to write
> IIgs specific libraries. I say this because it's apparently an
> implementation of ANSI C.
> I downloaded their trial versions but haven't tried them yet.

Hiya.. I downloaded them, and checked out the 65816 C compiler.

BTW, after downloading all the files they showed, some came up bogus
-
that is, the file that was supposed to have the "Standard Libraries"
had a copy of the Assembler EXE in it.  Strange, I'll have to check
again (and fill out that form!)

In the README.TXT file, I saw this:

    LIMITATIONS
    ===========

    The following limitations have been placed on the evaluation
edition:

    Compiler:

    1) Will not accept the -a compile to assembly list option.
    2) Limited to 250 lines of C code (including header include
files).
    3) The optimizer is not included, so -s is not available.

UMMMM... I made a SAMPLE.C program like this:

  int main()
  {
	int i;
	i = 1;
	i = i + 32;
	i = i % 11;
      return(i);
  }

and the -A option *DID* work, producing this SAMPLE.ASM file:

;:ts=8
R0	equ	1
R1	equ	5
R2	equ	9
R3	equ	13
	code
	xdef	__main
	func
__main:
	longa	on
	longi	on
	tsc
	sec
	sbc	#L2
	tcs
	phd
	tcd
i_1	set	0
	lda	#$1
	sta	<L3+i_1
	clc
	lda	#$20
	adc	<L3+i_1
	sta	<L3+i_1
	lda	<L3+i_1
	ldx	#<$b
	xref	__~mod
	jsr	__~mod
	sta	<L3+i_1
	lda	<L3+i_1
L4:
	tay
	pld
	tsc
	clc
	adc	#L2
	tcs
	tya
	rts
L2	equ	2
L3	equ	1
	ends
	efunc
	end

Notice that the "mod" function must be in the library..
I'll play around with it more tonight when I have time,
and see what happens when I hit that 250 line limit.

It's a darn shame that the compiler toolset costs $2750
and comes with a hardware dongle...  good grief..

// CHRIS

Here's another SAMPLE.C:

/* Example 2 */

int main()
{
	int s;
	s = sum(100);
	return(s);
}

int sum1(int c)
{
	int s = 0;
	int i = 0;

	for(i = 1; i <= c; i++)
	{
		s += i;
	}
	return(s);
}


and here's the SAMPLE.ASM produced:

;:ts=8
R0	equ	1
R1	equ	5
R2	equ	9
R3	equ	13
	code
	xdef	__main
	func
__main:
	longa	on
	longi	on
	tsc
	sec
	sbc	#L2
	tcs
	phd
	tcd
s_1	set	0
	pea	#<$64
	jsr	__sum
	sta	<L3+s_1
	lda	<L3+s_1
L4:
	tay
	pld
	tsc
	clc
	adc	#L2
	tcs
	tya
	rts
L2	equ	2
L3	equ	1
	ends
	efunc
	code
	xdef	__sum1
	func
__sum1:
	longa	on
	longi	on
	tsc
	sec
	sbc	#L5
	tcs
	phd
	tcd
c_0	set	3
s_1	set	0
i_1	set	2
	stz	<L6+s_1
	lda	#$1
	sta	<L6+i_1
	brl	L10002
L10001:
	inc	<L6+i_1
L10002:
	sec
	lda	<L5+c_0
	sbc	<L6+i_1
	bvs	L7
	eor	#$8000
L7:
	bmi	L8
	brl	L10003
L8:
	clc
	lda	<L6+s_1
	adc	<L6+i_1
	sta	<L6+s_1
	brl	L10001
L10003:
	lda	<L6+s_1
L9:
	tay
	lda	<L5+1
	sta	<L5+1+2
	pld
	tsc
	clc
	adc	#L5+2
	tcs
	tya
	rts
L5	equ	4
L6	equ	1
	ends
	efunc
	xref	__sum
	end