home *** CD-ROM | disk | FTP | other *** search
- */* Just a simple test program for the Small C compiler */
-
- *******************************************************************
- * SMALL-C Compiler V2.0.2 Feb 15 1987
- * Copyright 1982 J. E. Hendrix
- * Modified by Motorola for 68HC11
- * Modified by HCS to compile Compiler with Turbo-C 1.5
- * Compiler compiled on: Jul 04 1988, 12:30:19
- *
- * 68HC11 Cross-Compile done on: 07/13/1991 16:41:54
- *
- *******************************************************************
- *
- *
- *main()
- cc1 equ *
- main equ *
- *{
- * int i,j;
- *
- * for(i = 0; i < 10; i++){
- pshx
- pshx
- ldd #2
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- pshb
- psha
- ldd #0
- pulx
- std 0,x
- cc5 equ *
- ldd #2
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pshb
- psha
- ldd #10
- pulx
- jsr cclt
- cmpd #0
- bne *+5
- jmp cc4
- jmp cc6
- cc3 equ *
- ldd #2
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- pshb
- psha
- pulx
- xgdx
- ldd 0,x
- addd #1
- std 0,x
- subd #1
- jmp cc5
- cc6 equ *
- *
- * j = i * i;
- ldd #0
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- pshb
- psha
- ldd #4
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pshb
- psha
- ldd #6
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pulx
- jsr ccmult
- pulx
- std 0,x
- * outp(j);
- ldd #0
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pshb
- psha
- jsr outp
- pulx
- * }
- jmp cc3
- cc4 equ *
- *}
- pulx
- pulx
- rts
- *
- *outp(i)
- outp equ *
- *int i;
- *{
- * char * portaddr;
- *
- * portaddr = 1024; /* memory mapped port */
- pshx
- ldd #0
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- pshb
- psha
- ldd #1024
- pulx
- std 0,x
- *
- * *(portaddr) = i;
- ldd #0
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pshb
- psha
- ldd #6
- tsx
- pshx
- tsx
- addd 0,x
- pulx
- xgdx
- ldd 0,x
- pulx
- stab 0,x
- *}
- pulx
- rts
- *
-