C compiler for the IBM 1130

49 views
Skip to first unread message

Bob Flanders

unread,
May 23, 2024, 12:40:14 AMMay 23
to IBM1130
A long time ago, I attempted to create a C compiler for the 1130 starting from Small C.

It has a K&R C format where you define variables between the function declaration and the body of that function. It ran as a cross-compiler. Run it on the desktop and assemble the output on the 1130.

It kind of runs. 

Meaning, you can compile a C program, get 1130 assembler and throw it into the simulator, and it will assemble and run the program.

But it has been a while, and the stupid compiler doesn't work on an x64 system. I downloaded Windows 10x32 and it works like a champ (in a vm.)

So the good news is it does work, but it needs a lot more work.

If anyone is interested, shout out .. or aske me in discord https://discord.gg/NTkrNWHG

Regards,
Bob

Peter Diehr

unread,
May 23, 2024, 4:47:28 PMMay 23
to ibm...@googlegroups.com
Bob:

It's probably the memory model; we had endless troubles porting working C code from MS Dos to MS Dos when the memory model changed for the IBM PC.  We basically had to rewrite all of the engineering code in order to take advantage of any of the additional memory.

It may be easier to start with a more modern, or improved implementation of Tiny C.

This was at the Ford Scientific Laboratory, for work on the Vehicle Data Acquisition System/Research Console, VDAS/RCON. 

Best regards, Peter Diehr

--
NEW! IBM1130 discord channel: https://discord.gg/NTkrNWHG
---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ibm1130/fa208a12-def4-45c9-9ac1-d45ebc7eeaacn%40googlegroups.com.

Bob Flanders

unread,
May 23, 2024, 4:49:52 PMMay 23
to IBM1130
Sorry ... new Discord link: https://discord.gg/4KrCNSBS

Regards,
Bob

Bob Flanders

unread,
May 23, 2024, 4:52:18 PMMay 23
to ibm...@googlegroups.com
I completely agree .. but

I remember spending a lot of hours getting this compiler to produce running code. Having to go back makes my head hurt. :D



Bob Flanders

unread,
May 23, 2024, 5:00:54 PMMay 23
to IBM1130
Figured out how to have a non-expiring link:  https://discord.gg/nrFEMt48mE

Claudio Vincenzi - GMail

unread,
May 27, 2024, 5:05:19 PMMay 27
to ibm...@googlegroups.com, Bob Flanders, Carl Claunch, Peter Diehr, Kym Farnik, Alex D
Hi guys

a C compiler for the IBM-1130 would be such a very interesting and exciting challenge. 

Does anyone have any documentation about the IBM-1130 Core Memory organization when DMS is in charge of it ?
In the manuals I see many descriptions and diagrams about how DMS is organized on DISK space and DUP file formats, but was not able to find anything 
(except some data about DISKx subroutines loading address and size) about how DMS uses the core space. 
Probably I did not look in the right places.

I would appreciate any hint or link!

Thanks in advance
prof. Claudio Vincenzi






--
Claudio Vincenzi

John Pierce

unread,
May 27, 2024, 7:57:38 PMMay 27
to ibm...@googlegroups.com
It's pretty simple...   The resident part of DM2 occupies the first 510(?) words, the rest is available for application.  The top of the core space is used as Common by Fortran, addressed as 7FFF and down regardless of the actual memory size.

NEW! IBM1130 discord channel: https://discord.gg/nrFEMt48mE

---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.

Peter Sawyer

unread,
May 27, 2024, 10:15:32 PMMay 27
to ibm...@googlegroups.com

Yes, 510 (/01FE) words for the monitor when DISKZ is in use. The other two disk routines use more. The Fortran compiler loads in the top of core, ending at /7FFF or whatever is the actual high address, and uses the space below it (above DISKZ) for working storage.

Bob Flanders

unread,
May 28, 2024, 8:08:43 PMMay 28
to IBM1130
https://drive.google.com/file/d/12eTRsKQO6sSpEyc-Bjs05AVZxLKy8bJi/view?usp=sharing

Here's the link to the Small C 1130 related projects in a zip files. The "project" is not very organized, but here is a bit of documentation.

First, this only will run on a 32-bit Windows OS. It fails miserably on a 64 bit.

Overview

Years ago, I found a complete C compiler that can compile itself. I modified it to emit IBM 1130 assembler. It is not intended to create an IBM 1130 executable, but rather to create an assembler program you can compile in the emulator.

So, the process would be:
  • Run Small C (x86) to compile Small C 1130.
    • Do this to work on the Small C 1130 compiler.
  • Run Small C 1130 to compile a C program targeting the 1130
  • Run an 1130 job to assemble the target program.

There are two main directories:

SmallC

This has the code for the original source code for Small C. You don't really need it, just the executable for running Small C.

SmallC1130

This contains the source code for the 1130 compiler. The 1130 C compiler can be compiled with the CCC.bat script.

There's a directory Test\Current that has a batch job that contains "CC1130.bat".  This job:
  • Saves the current directory and changes to the SmallC1130 directory
  • Builds the Small C 1130 compiler
  • Changes back to Test\Current
  • Copies the Small C 1130 compiler to the Test\Current Directory
  • Builds the program Test1.c (Ultimately prints "HELLO WORLD" on the console printer.
    • When it asks for Definition Files [nul.def], just hit enter.
If you want to try a compile of the program, you can use the IBM1130 setup in the TestCompiler directory.

Of particular importance is the file StartC.bat. This code is copied to the front of the compiled program output and sets up the environment for the compiled program to run.

It's not well organized, but this should get you started.

Regards,
Bob

Claudio Vincenzi - GMail

unread,
May 28, 2024, 9:54:53 PMMay 28
to Peter Diehr, John P. Doty, Peter Sawyer, ibm...@googlegroups.com
Hey Guys, good night!

Thanks for all the replies.Good to have the answer from the experts.

I managed to find the reference book and I am reading it now.

Honestly, I did not know about IBM1130 Bork's book until you referenced it here!
I am very impressed with the author's writing: he has a contemporary style - I could not tell I am reading a technical computing book from the 60's.
Well, to some extent, yes. That's a comprehensive text spanning through many aspects of the system.

Page 21

We have referred several times to the monitor, a set of programs stored on the computer disk to handle the bookkeeping aspects of running jobs. 
The concept is relatively new; the first monitor systems were devised around 1960. Executive and operating systems are other common names.

This paragraph caught my attention and made me think about the long road operating systems have traveled until today: DMS is approaching 60yrs, Unix is 55yrs.
Three to four generations have already lived with their existence now.

Again
Thank you all for the help!
att
Claudio

On Mon, May 27, 2024 at 7:40 PM Peter Diehr <pdi...@gmail.com> wrote:
Bork's book, "Using the IBM 1130" goes over the core memory layout.

But basically, the monitor system ends with the load address for the chosen disk routine, then add its length (including any buffers) to get the load address for your program.

For most purposes, you can just get the address where programs will be loaded - this is the beginning of free memory, which is not otherwise managed by the DM2.

You can confirm these details from Bork's book.  Essentially, all of the addresses are static, given a choice of disk routines.


Best regards, Peter Diehr


--
Claudio Vincenzi

Peter Diehr

unread,
May 29, 2024, 7:56:55 AMMay 29
to c.vin...@gmail.com, j...@noqsi.com, peter....@sympatico.ca, ibm...@googlegroups.com

Glad to help!  I got my copy of Bork in the summer of 1969.  I used it a lot from then until 1972. It set on my large bookshelf until 2012, when we sold the big house. Then I sold my copy, along with most of my library.

Best regards, Peter Diehr

br...@quarterbyte.com

unread,
May 29, 2024, 12:15:25 PMMay 29
to ibm...@googlegroups.com, c.vin...@gmail.com, j...@noqsi.com, peter....@sympatico.ca
Wow, I guess you first got borked at a tender young age, then. I didn't know about Bork until around 2000. I was a Joan Kirby Hughes fan though back in the 70s though.

Oh how sad. Back in our peak ibm1130.org days, back in the early 2000s, I'd tried to find her, to send her a note and tell her there was this weird little band of 1130 enthusiasts, many of whom had read her book(s) back when. It appears that she passed away in 2013, and her full name was Laura Joan Kirby Hughes, which may be why I didn't find her then. She lived near the Bay Area too, in Pacific Grove (Monterey, CA).

brian


NEW! IBM1130 discord channel: https://discord.gg/nrFEMt48mE

---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.

Claudio Vincenzi - GMail

unread,
May 29, 2024, 12:17:12 PMMay 29
to br...@quarterbyte.com, ibm...@googlegroups.com, John P. Doty, Peter Sawyer

Nick Seidenman

unread,
May 29, 2024, 7:17:50 PMMay 29
to ibm...@googlegroups.com, br...@quarterbyte.com, John P. Doty, Peter Sawyer
This made for a blast from the past.
 
The first computer class I took (HS, mid-70s) was run in conjunction with keypunch class taught as part of typing class.  We were to write our programs on these forms and the keypunch trainees were to create the decks.

Long story short, we ended up having to punch our own decks.  "A" for effort, though.

Peter Diehr

unread,
May 29, 2024, 7:35:18 PMMay 29
to ibm...@googlegroups.com
We picked up some COBOL coding pads at a garage sale in Ann Arbor, in the '90s.  Our kids used them for art projects, etc.  One of them asked me if I ever used them - I recall my answer: "No, when I programmed in COBOL I punched my own cards. Much faster, and more accurate!"

I'd taken typing in high school, and am a fair typist even today.  Another obsolete life skill!

Best regards, Peter Diehr

Message has been deleted

Paul Anagnostopoulos

unread,
May 30, 2024, 8:39:50 AMMay 30
to IBM1130
Somehow I also just learned of the Bork book now. How can that be? I knew about Hughes and just bought a copy on eBay for my library.

~~ Paul

Claudio Vincenzi - GMail

unread,
Jun 4, 2024, 8:45:58 PMJun 4
to ibm...@googlegroups.com
Hi Bob, hi guys.

This is not C-compiler related, but made me very happy:

// JOB    0021

LOG DRIVE   CART SPEC   CART AVAIL  PHY DRIVE
  0000        0021        0021        0000

V2 M12   ACTUAL 32K  CONFIG 32K

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PAGE   1    COB02JOB

// JOB                                            COB02JOB

LOG DRIVE   CART SPEC   CART AVAIL  PHY DRIVE
  0000        0021        0021        0000

V2 M12   ACTUAL 32K  CONFIG 32K

// * COBOL PROGRAM COB02


// COBOL
** COBOL PROGRAM COB02
*LIST
*1132
*1442

OPTIONS-LIST,EJCT,NOXREF,NODMAP,NOPMAP,NOSTNO,NODUMP,NOSUPX,NOKP26,NOSUBR,1442,1132

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PAGE   2    COB02JOB     COBOL PROGRAM COB02


STNO - A...B... C O B O L   S O U R C E   S T A T E M E N T S ..........  IDENTFCN  PAGLIN

   1   IDENTIFICATION DIVISION.
   2     PROGRAM-ID. COB02.
   3     AUTHOR.     CLAUDIO R DE VINCENZI.
   4     INSTALLATION.  1130 SIMULATOR V4-3-5.
   5     DATE-WRITTEN.  MAY, 2024.
         DATE-COMPILED. MAY, 2024.

   6     REMARKS.    FIRST COBOL PROGRAM IN YEARS.

   7   ENVIRONMENT DIVISION.
   8     CONFIGURATION SECTION.
   9      SOURCE-COMPUTER. IBM-1130.
  10      OBJECT-COMPUTER. IBM-1130.
  11      SPECIAL-NAMES.   DECIMAL-POINT IS COMMA.

  12     INPUT-OUTPUT  SECTION.
  13      FILE-CONTROL.

  14   DATA DIVISION.

  15    FILE SECTION.

  16    WORKING-STORAGE SECTION.
  17     77 NUM1       PIC 9(4).
  18     77 NUM2       PIC 9(4).
  19     77 TOTAL      PIC 9(7).
  20     77 ZNUM1      PIC ZZZ9.
  21     77 ZNUM2      PIC ZZZ9.
  22     77 ZTOTAL     PIC Z(6)9.

  23   PROCEDURE DIVISION.
  24     BEGIN.
  25        DISPLAY 'PROGRAM COB02' UPON CONSOLE.
  26        DISPLAY 'ENTER TWO NUMBERS, FOUR DIGITS EACH.' UPON CONSOLE.
  27        DISPLAY 'IF BOTH ARE ZERO, I QUIT' UPON CONSOLE.
  28          DISPLAY 'NUM1=' UPON CONSOLE.
  29        ACCEPT NUM1 FROM CONSOLE.
  30        MOVE   NUM1 TO ZNUM1.
  31          DISPLAY 'NUM2=' UPON CONSOLE.
  32        ACCEPT NUM2 FROM CONSOLE.
  33        MOVE   NUM2 TO ZNUM2.
  34     SHOWNUMS.
  35          DISPLAY 'NUM1=' ZNUM1 UPON CONSOLE.
  36          DISPLAY 'NUM2=' ZNUM2 UPON CONSOLE.
  37     TESTNUMS.
  38          IF NUM1 = ZERO AND NUM2 = ZERO GO TO ENDPROGR.
  40     CALCS.
  41        MOVE ZERO TO TOTAL.
  42        COMPUTE TOTAL = NUM1 + NUM2.
  43        MOVE TOTAL TO ZTOTAL.
  44          DISPLAY 'NUM1+NUM2=' ZTOTAL UPON CONSOLE.
  45        SUBTRACT NUM1 FROM NUM2 GIVING TOTAL.
  46        MOVE TOTAL TO ZTOTAL.
  47          DISPLAY 'NUM2-NUM1=' ZTOTAL UPON CONSOLE.
  48        MULTIPLY NUM1 BY NUM2 GIVING TOTAL.
  49        MOVE TOTAL TO ZTOTAL.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PAGE   3    COB02JOB     COBOL PROGRAM COB02


STNO - A...B... C O B O L   S O U R C E   S T A T E M E N T S ..........  IDENTFCN  PAGLIN

  50          DISPLAY 'NUM1*NUM2=' ZTOTAL UPON CONSOLE.
  51        DIVIDE NUM1 BY NUM2 GIVING TOTAL.
  52        MOVE TOTAL TO ZTOTAL.
  53          DISPLAY 'NUM1/NUM2=' ZTOTAL UPON CONSOLE.
  54        GO TO BEGIN.
  55     ENDPROGR.
  56        DISPLAY 'BYE FOLKS.' UPON CONSOLE.
  57        STOP RUN.
/*

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

PAGE   4    COB02JOB     COBOL PROGRAM COB02

                                     D I A G N O S T I C S

STNO   ERR LVL  TEXT

   5   156  C   ITEM IN STATEMENT NOT VALID DIVISION SECTION OR PARAGRAPH NAME -- IGNORED
  13   161  W   EMPTY PARAGRAPH

  NO E LEVEL MESSAGES            1 C LEVEL MESSAGE             1 W LEVEL MESSAGE


PROGRAM-SIZE = TALLY + FILE SECTION + W-S SECTION + CONSTANTS + TEMP-LOCNS + PROCEDURES + ARITH-STACK
     442         2           0              30         144          36           206          24

END OF COBOL COMPILATION

// DUP

*DELETE         UA  COB02
CART ID 0021   DB ADDR  217F   DB CNT   0014

*STORE      WS  UA  COB02
CART ID 0021   DB ADDR  217F   DB CNT   0019

// XEQ COB02
program cob02
enter two numbers, four digits each.
if both are zero, i quit
num1=
   4
num2=
   7
num1=   4
num2=   7
num1+num2=     11
num2-num1=      3
num1*num2=     28
num1/num2=      0
program cob02
enter two numbers, four digits each.
if both are zero, i quit
num1=
  33
num2=
  11
num1=  33
num2=  11
num1+num2=     44
num2-num1=     22
num1*num2=    363
num1/num2=      3
program cob02
enter two numbers, four digits each.
if both are zero, i quit
num1=
   0
num2=
   0
num1=   0
num2=   0
bye folks.
[Tue Jun 04 21:27:20 2024] sim>


  Claudio


--
NEW! IBM1130 discord channel: https://discord.gg/nrFEMt48mE
---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.


--
Claudio Vincenzi

Bob Flanders

unread,
Jun 4, 2024, 8:52:18 PMJun 4
to ibm...@googlegroups.com

Cool!


--
IBM1130 discord channel: https://discord.gg/nrFEMt48mE
---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.

Peter Diehr

unread,
Jun 4, 2024, 8:55:09 PMJun 4
to ibm...@googlegroups.com

Yeah!  It worked!

Best regards, Peter Diehr


On Tue, Jun 4, 2024, 20:45 Claudio Vincenzi - GMail <c.vin...@gmail.com> wrote:
--
IBM1130 discord channel: https://discord.gg/nrFEMt48mE
---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.

Bob Flanders

unread,
Jun 4, 2024, 8:58:54 PMJun 4
to ibm...@googlegroups.com

COBOL ... The other C compiler. 😜


Claudio Vincenzi - GMail

unread,
Jun 4, 2024, 9:17:59 PMJun 4
to ibm...@googlegroups.com
Yes - something to think about :D

Walter T. Mosscrop

unread,
Jun 4, 2024, 10:35:13 PMJun 4
to ibm...@googlegroups.com
For many years I have been trying to get a 2315 disk image with the IBM COBOL compiler. The image needs to support the 2501 and 1403 instead of the 1132 and 1442 listed here. The hangup has been that the COBOL compiler was a "program product" and thus copyrighted.

But I cannot believe that IBM would care about software for a system it hasn't sold for over 50 years, especially for hobbyist use.

A few years ago I wrote to IBM trying to get permission, but (of course) nothing happened.

I need the 2501/1403 image because my Parallax Propeller based emulator does not support the 1132/1442. When you have only 32K bytes of RAM something has to give :)

Thanks,

Walter Mosscrop

--
IBM1130 discord channel: https://discord.gg/nrFEMt48mE
---
You received this message because you are subscribed to the Google Groups "IBM1130" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibm1130+u...@googlegroups.com.

Bob Flanders

unread,
Jun 4, 2024, 11:06:10 PMJun 4
to ibm...@googlegroups.com
See if you can connect with Connor Krukosky at the VIntage Computer Federation. He works for IBM and may be able to help you connect with the corporate librarian.

Regards,
Bob

Reply all
Reply to author
Forward
0 new messages