1. pcc12c

There have been some postings , about PCC12c.* , here's further info'
 and how I'm using this to gain familiarity with the C language ; ANSI
 version.


 Here are the details about pcc12c.* .

 EU>I agree - I find the PCC (Personal C Compiler) by Mark DeSmet for
 EU>DOS useful for learning as well.  The download is only 173k !  If
 EU>interested you can search this site
 EU>http://www.rescript.fsnet.co.uk/windoc/pcc12c.htm


   I use a QuickBasic , similar to Qbasic , routines to simulate a batch
 file ; as used in DOS or Euphoria.
   This is close enough to Euphoria , for someone to construct the
  equivalent ; with the appropriate instructions for finding PCC12c
  on your disk , if necessary.
   My present reference text is Teach yourself C , by Herbert.Schildt ,
  second edition , [ ANSI version ]. There's some variation between
  ANSI C and the K&R C that PCC12c implements.

   The *.c files generated have the prefix ex_          .


'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
'
'
'                           PCC redirection code.
'
'                            Personal C Compiler.
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
'
DECLARE SUB Pcc ()
DECLARE SUB Pcd ()
DECLARE SUB boxes (level AS INTEGER, room AS INTEGER, down AS INTEGER, along

 AS INTEGER)
DECLARE SUB try () ' not really required.
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

'
DIM SHARED st(1 TO 8) AS STRING

SHELL "c:\dos\kat.bat"     ' a *.bat that changes defaualt screen colour.
'SHELL "c:\dos\kit.bat"    ' resets colour.
SCREEN 0
CLS
COLOR 15, 1
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

'
'                  directory where PCC resides.
SHELL "cd c:\lang\ctest"

'          list of *.c files in this directory , most recent at top.
SHELL "dir ex*.c /Ogrin > exlist.txt"

'                           display list.
SHELL "c:\edit\edit.exe c:\lang\ctest\exlist.txt"

'             select a previous *.c file , or use a new file name.
Pcd
'try   '  try example ex_5_4a.*   ,  residual code.h








SUB boxes (level AS INTEGER, room AS INTEGER, down AS INTEGER, along AS INTE

GER)
'                                    box
FOR i = 1 TO down
  FOR j = 1 TO along + 2
   LOCATE level + i, room + j
   PRINT " ";
  NEXT j
NEXT i

LOCATE level, room
PRINT " É";
FOR j = 1 TO along
LOCATE level, room + j + 1
PRINT "Í";
NEXT j
PRINT "» ";

FOR i = 1 TO down
LOCATE i + level, room
PRINT " º ";
LOCATE i + level, room + along + 1
PRINT " º ";
NEXT i

LOCATE level + down, room
PRINT " È";
FOR j = 1 TO along
LOCATE level + down, room + j + 1
PRINT "Í";
NEXT j
PRINT "¼ ";
'

END SUB





SUB Pcc

DIM cmd AS STRING
DIM str AS STRING
'
k$ = ""
COLOR 12, 1
LOCATE 2, 4: PRINT " Press Esc key to exit ";
k$ = ""
FOR j = 1 TO 20
k$ = ""
NEXT j
WHILE k$ = ""
k$ = INKEY$
WEND
IF k$ = CHR$(27) THEN EXIT SUB
CLS
COLOR 14, 1
CALL boxes(1, 1, 6, 76)
COLOR 15, 1: LOCATE 4, 5: PRINT "Enter source file name "; : INPUT cmd
'
FOR i = 1 TO 2000
'-------------------------------------
COLOR 12, 1
LOCATE 2, 4: PRINT " Press Esc key to exit ";
k$ = ""
FOR j = 1 TO 20
k$ = ""
NEXT j
WHILE k$ = ""
k$ = INKEY$
WEND
IF k$ = CHR$(27) THEN EXIT FOR
CLS
'-------------------------------------
'COLOR 14, 1
'CALL boxes(1, 1, 6, 76)
'COLOR 15, 1
'LOCATE 4, 5: PRINT "Enter source file name "; : INPUT cmd

SHELL "cd c:\lang\ctest"
str = "c:\edit\edit.exe c:\lang\ctest\" + cmd + ".c"
SHELL str
COLOR 14, 1
CALL boxes(1, 1, 6, 76)
COLOR 15, 1
LOCATE 4, 4: PRINT " Source file name is "; cmd + ".c";
LOCATE 8, 4': COLOR 15, 1: PRINT " ";
SHELL "cd c:\lang\ctest"
str = "pcc " + cmd + ".c"
SHELL str
str = "pccl " + cmd + ".o"
SHELL str
COLOR 15, 1: PRINT SPACE$(81);
str = cmd + ".exe"
SHELL str
NEXT i
COLOR 15, 1: CLS : LOCATE 1, 5: PRINT " Finished session ";
'SHELL "c:\dos\kit.bat"
'SLEEP

END SUB




SUB Pcd

DIM cmd AS STRING
DIM str AS STRING
DIM strg AS STRING

'-------------------------------------------------------------------------
FOR k = 1 TO 2000
'
CLS
COLOR 14, 1
CALL boxes(1, 1, 6, 76)
COLOR 15, 1: LOCATE 4, 5: PRINT "Enter source file name "; : INPUT cmd
str = "c:\lang\ctest\" + "ex_" + cmd + ".c"
strg = "copy " + str + " d:\"
SHELL strg
str = "d:\" + "ex_" + cmd + ".c"
'CLS
'
'---------------------------------------------------------------------
FOR i = 1 TO 2000
'-------------------------------------
'CLS
COLOR 14, 1
CALL boxes(1, 1, 6, 76)
COLOR 15, 1: LOCATE 4, 4: PRINT " Source file name is "; str;
LOCATE 8, 4': COLOR 15, 1: PRINT " ";
COLOR 12, 1: LOCATE 2, 4: PRINT " Press Esc key to end editing/compiling ";
k$ = ""
FOR j = 1 TO 20
k$ = ""
NEXT j
'
WHILE k$ = ""
k$ = INKEY$
WEND
IF k$ = CHR$(27) THEN EXIT FOR
CLS
'---------------------------------------------------------------------
strg = "c:\edit\edit.exe " + str
SHELL strg
SHELL "d:"
LOCATE 8, 3
strg = "pcc " + str
SHELL strg
strg = "pccl " + "d:\" + "ex_" + cmd + ".o"
SHELL strg
COLOR 15, 1: PRINT SPACE$(81);
strg = "d:\" + "ex_" + cmd + ".exe"
SHELL strg
SHELL "c:"

NEXT i

'---------------------------------------------------------------------

SHELL "d:"
str = "d:\" + "ex_" + cmd + ".c"
strg = "copy " + str + " c:\lang\ctest"
SHELL strg

str = "d:\" + "ex_" + cmd + ".c"
strg = "del " + str
SHELL strg

str = "d:\" + "ex_" + cmd + ".o"
strg = "del " + str
SHELL strg

str = "d:\" + "ex_" + cmd + ".exe"
strg = "del " + str
SHELL strg

'---------------------------------------------------------------------

SHELL "c:"
'SHELL "cd "

CLS
COLOR 12, 1: LOCATE 2, 4: PRINT " Press Esc key to exit session ";
'
k$ = ""
FOR j = 1 TO 20
k$ = ""
NEXT j
'
WHILE k$ = ""
k$ = INKEY$
WEND
IF k$ = CHR$(27) THEN EXIT SUB
'---------------------------------------------------------------------
NEXT k

SHELL "cd "

COLOR 15, 1: CLS : LOCATE 1, 5: PRINT " Finished session ";
'SHELL "c:\dos\kit.bat"

END SUB

SUB try

DIM cmd  AS STRING
DIM str  AS STRING
DIM strg AS STRING

CLS
SLEEP

cmd = "ex_5_4a"

str = "c:\lang\ctest\" + cmd + ".c"
strg = "copy " + str + " d:\"
SHELL strg
SLEEP

'SHELL "d:"
str = "d:\" + cmd + ".c"
strg = "copy " + str + " c:\lang\ctest"
SHELL strg


END SUB


rem                           kat.bat
 [1;15m


rem                            kit.bat
 [0m



Net-Tamer V 1.11 - Test Drive

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu