Skip to content

Commit

Permalink
Added Cowgol Disk Image
Browse files Browse the repository at this point in the history
- Credit and thanks to Ladislau Szilagyi.

Co-Authored-By: ladislau szilagyi <87603175+laci1953@users.noreply.github.com>
  • Loading branch information
wwarthen and Laci1953 committed Feb 10, 2024
1 parent 074f2cf commit e18014a
Show file tree
Hide file tree
Showing 46 changed files with 1,451 additions and 8 deletions.
1 change: 1 addition & 0 deletions Doc/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Version 3.5
- WBW: Added console takeover at boot loader prompt
- L?N: Fixed Propeller font vertical line character to align properly
- L?S: EF9345 video display controller driver
- WBW: Added Cowgol disk image based on the work of Ladislau Szilagyi

Version 3.4
-----------
Expand Down
Binary file modified Doc/RomWBW Applications.pdf
Binary file not shown.
Binary file modified Doc/RomWBW Disk Catalog.pdf
Binary file not shown.
Binary file modified Doc/RomWBW Errata.pdf
Binary file not shown.
Binary file modified Doc/RomWBW ROM Applications.pdf
Binary file not shown.
Binary file modified Doc/RomWBW System Guide.pdf
Binary file not shown.
Binary file modified Doc/RomWBW User Guide.pdf
Binary file not shown.
8 changes: 7 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**RomWBW ReadMe** \
Version 3.5 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
07 Feb 2024
10 Feb 2024

# Overview

Expand Down Expand Up @@ -223,6 +223,12 @@ let me know if I missed you!

- Bill Shen has contributed boot loaders for several of his systems.

- Laszlo Szolnoki has contributed an EF9345 video display controller
driver.

- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol
that leverages RomWBW memory banking.

Contributions of all kinds to RomWBW are very welcome.

# Licensing
Expand Down
8 changes: 7 additions & 1 deletion ReadMe.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com)
07 Feb 2024
10 Feb 2024



Expand Down Expand Up @@ -224,6 +224,12 @@ let me know if I missed you!

- Bill Shen has contributed boot loaders for several of his systems.

- Laszlo Szolnoki has contributed an EF9345 video display controller
driver.

- Ladislau Szilagyi has contributed an enhanced version of CP/M Cowgol
that leverages RomWBW memory banking.

Contributions of all kinds to RomWBW are very welcome.


Expand Down
6 changes: 6 additions & 0 deletions Source/Doc/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ please let me know if I missed you!
* Bill Shen has contributed boot loaders for several of his
systems.

* Laszlo Szolnoki has contributed an EF9345 video display
controller driver.

* Ladislau Szilagyi has contributed an enhanced version of
CP/M Cowgol that leverages RomWBW memory banking.

Contributions of all kinds to RomWBW are very welcome.

# Licensing
Expand Down
6 changes: 6 additions & 0 deletions Source/Doc/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4017,6 +4017,12 @@ please let me know if I missed you!
* Bill Shen has contributed boot loaders for several of his
systems.

* Laszlo Szolnoki has contributed an EF9345 video display
controller driver.

* Ladislau Szilagyi has contributed an enhanced version of
CP/M Cowgol that leverages RomWBW memory banking.

Contributions of all kinds to RomWBW are very welcome.

# Licensing
Expand Down
4 changes: 4 additions & 0 deletions Source/Images/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ call BuildDisk.cmd tpascal hd wbw_fd144 || exit /b
call BuildDisk.cmd bascomp hd wbw_fd144 || exit /b
call BuildDisk.cmd fortran hd wbw_fd144 || exit /b
call BuildDisk.cmd games hd wbw_fd144 || exit /b
call BuildDisk.cmd cowgol hd wbw_fd144 || exit /b


echo.
echo Building Hard Disk Images (512 directory entry format)...
Expand All @@ -42,6 +44,7 @@ call BuildDisk.cmd tpascal hd wbw_hd512 || exit /b
call BuildDisk.cmd bascomp hd wbw_hd512 || exit /b
call BuildDisk.cmd fortran hd wbw_hd512 || exit /b
call BuildDisk.cmd games hd wbw_hd512 || exit /b
call BuildDisk.cmd cowgol hd wbw_hd512 || exit /b

echo.
echo Building Combo Disk (512 directory entry format) Image...
Expand All @@ -65,6 +68,7 @@ call BuildDisk.cmd tpascal hd wbw_hd1k || exit /b
call BuildDisk.cmd bascomp hd wbw_hd1k || exit /b
call BuildDisk.cmd fortran hd wbw_hd1k || exit /b
call BuildDisk.cmd games hd wbw_hd1k || exit /b
call BuildDisk.cmd cowgol hd wbw_hd1k || exit /b

if exist ..\BPBIOS\bp*.rel call BuildDisk.cmd bp hd wbw_hd1k ..\zsdos\zsys_wbw.sys || exit /b

Expand Down
9 changes: 5 additions & 4 deletions Source/Images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ FDIMGS = fd144_cpm22.img fd144_zsdos.img fd144_nzcom.img \
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img \
fd144_z80asm.img fd144_aztecc.img fd144_hitechc.img \
fd144_bascomp.img fd144_fortran.img fd144_games.img \
fd144_tpascal.img
fd144_tpascal.img fd144_cowgol.img
HD512IMGS = hd512_cpm22.img hd512_zsdos.img hd512_nzcom.img \
hd512_cpm3.img hd512_zpm3.img hd512_ws4.img
HD512XIMGS = hd512_z80asm.img hd512_aztecc.img hd512_hitechc.img \
hd512_bascomp.img hd512_fortran.img hd512_games.img \
hd512_tpascal.img hd512_dos65.img hd512_qpm.img hd512_blank.img
# HDIMGS += hd512_bp.img
hd512_tpascal.img hd512_dos65.img hd512_qpm.img \
hd512_cowgol.img hd512_blank.img
HD1KIMGS = hd1k_cpm22.img hd1k_zsdos.img hd1k_nzcom.img \
hd1k_cpm3.img hd1k_zpm3.img hd1k_ws4.img
HD1KXIMGS = hd1k_z80asm.img hd1k_aztecc.img hd1k_hitechc.img \
hd1k_bascomp.img hd1k_fortran.img hd1k_games.img \
hd1k_tpascal.img hd1k_qpm.img hd1k_blank.img
hd1k_tpascal.img hd1k_qpm.img \
hd1k_cowgol.img hd1k_blank.img
HD1KXIMGS += hd1k_bp.img

HD512PREFIX =
Expand Down
45 changes: 45 additions & 0 deletions Source/Images/d_cowgol/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
===== Cowgol 2.0 for CP/M =====

This disk contains the Cowgol 2.0 compiler and related tools.
These files were provided by Ladislau Szilagyi and were sourced
from his GitHub repository at https://github.com/Laci1953/Cowgol_on_CP_M.

The COWFE program included here is the RomWBW-specific version that
is tailored to RomWBW memory management.

The primary distribution site for Cowgol 2.0 is at
https://github.com/davidgiven/cowgol.

The Hi-Tech C compiler components were sourced from the updated
version by Tony Nicholson at https://github.com/agn453/HI-TECH-Z80-C.
However, the CPP.COM component was sourced from Ladislau Szilagyi's
enhanced Hi-Tech C at https://github.com/Laci1953/HiTech-C-compiler-enhanced.

Note that only the minimum required Hi-Tech C compiler components
are provided. Additional components from Hi-Tech C may be required
depending on your needs.

There are two example Cowgol applications included:

- HEXDUMP is a simple hex dump utility and is purely a Cowgol
application (no assembler or C components). The command
line to build the application is:

COWGOL HEXDUMP.COW

- DYNMSORT demonstrates a sort algorithm and is composed of
Cowgol, C, and assembler components. The command line to
build the application is:

COWGOL -LC DYNMSORT.COW MERGES.C RAND.AS

There are also SUBMIT files provided to build the example
applications which can be used as follows:

SUBMIT HEXDUMP
SUBMIT DYNMSORT

-- WBW 12:38 PM 2/10/2024



Binary file added Source/Images/d_cowgol/u0/$EXEC.COM
Binary file not shown.
48 changes: 48 additions & 0 deletions Source/Images/d_cowgol/u0/ARGV.COH
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var argv_pointer: [uint8];

sub ArgvInit() is
argv_pointer := 0x81 as [uint8];
[argv_pointer + [0x80 as [uint8]] as intptr] := 0;
end sub;

# Returns null is there's no next argument.
sub ArgvNext(): (arg: [uint8]) is
# No more arguments?

if argv_pointer == (0 as [uint8]) then
arg := argv_pointer;
return;
end if;

# Skip leading whitespace.

var c: uint8;
loop
c := [argv_pointer];
if c != ' ' then
break;
end if;
argv_pointer := argv_pointer + 1;
end loop;

arg := argv_pointer;

# Skip to end of word and terminate.

loop
c := [argv_pointer];
if (c == ' ') or (c == '\n') or (c == 0) then
break;
end if;
argv_pointer := argv_pointer + 1;
end loop;
[argv_pointer] := 0;

if c == ' ' then
argv_pointer := argv_pointer + 1;
else
argv_pointer := 0 as [uint8];
end if;
end sub;


Binary file added Source/Images/d_cowgol/u0/CGEN.COM
Binary file not shown.
27 changes: 27 additions & 0 deletions Source/Images/d_cowgol/u0/COMMFILE.COH
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sub FCBPutString(fcb: [FCB], s: [uint8]) is
loop
var c := [s];
if c == 0 then
break;
end if;
FCBPutChar(fcb, c);
s := @next s;
end loop;
end sub;

sub FCBGetBlock(fcb: [FCB], buffer: [uint8], length: intptr) is
while length != 0 loop;
[buffer] := FCBGetChar(fcb);
buffer := buffer + 1;
length := length - 1;
end loop;
end sub;

sub FCBPutBlock(fcb: [FCB], buffer: [uint8], length: intptr) is
while length != 0 loop;
FCBPutChar(fcb, [buffer]);
buffer := buffer + 1;
length := length - 1;
end loop;
end sub;

150 changes: 150 additions & 0 deletions Source/Images/d_cowgol/u0/COMMON.COH
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
sub print(ptr: [uint8]) is
loop
var c := [ptr];
if c == 0 then
return;
end if;
print_char(c);
ptr := ptr + 1;
end loop;
end sub;

sub print_nl() is
print_char('\n');
end sub;

sub UIToA(value: uint32, base: uint8, buffer: [uint8]): (ptr: [uint8]) is
ptr := buffer;
loop
var rem := value % (base as uint32);
value := value / (base as uint32);
if rem < 10 then
rem := rem + '0';
else
rem := rem + ('a' - 10);
end if;
[ptr] := rem as uint8;
ptr := @next ptr;

if value == 0 then
break;
end if;
end loop;

var s1 := buffer;
var s2 := @prev ptr;
while s2 > s1 loop
var c := [s1];
[s1] := [s2];
[s2] := c;
s1 := @next s1;
s2 := @prev s2;
end loop;

[ptr] := 0;
end sub;

sub IToA(value: int32, base: uint8, buffer: [uint8]): (ptr: [uint8]) is
if value < 0 then
[buffer] := '-';
buffer := @next buffer;
value := -value;
end if;
ptr := UIToA(value as uint32, base, buffer);
end sub;

sub print_i32(value: uint32) is
var buffer: uint8[12];
var pe := UIToA(value, 10, &buffer[0]);
print(&buffer[0]);
end sub;

sub print_i16(value: uint16) is
print_i32(value as uint32);
end sub;

sub print_i8(value: uint8) is
print_i32(value as uint32);
end sub;

sub print_hex_i8(value: uint8) is
var i: uint8 := 2;
loop
var digit := value >> 4;
if digit < 10 then
digit := digit + '0';
else
digit := digit + ('a' - 10);
end if;
print_char(digit);
value := value << 4;
i := i - 1;
if i == 0 then
break;
end if;
end loop;
end sub;

sub print_hex_i16(value: uint16) is
print_hex_i8((value >> 8) as uint8);
print_hex_i8(value as uint8);
end sub;

sub print_hex_i32(value: uint32) is
print_hex_i8((value >> 24) as uint8);
print_hex_i8((value >> 16) as uint8);
print_hex_i8((value >> 8) as uint8);
print_hex_i8(value as uint8);
end sub;

sub AToI(buffer: [uint8]): (result: int32, ptr: [uint8]) is
var negative: uint8 := 0;
var base: uint8 := 10;
ptr := buffer;
result := 0;

var c := [ptr];
if (c == '-') then
negative := 1;
ptr := ptr + 1;
c := [ptr];
end if;
if (c == '0') then
case [ptr+1] is
when 'x': base := 16;
when 'o': base := 8;
when 'b': base := 2;
when 'd': base := 10;

when else: ptr := ptr - 2;
end case;
ptr := ptr + 2;
c := [ptr];
end if;

loop
if c >= 'a' then
c := c - 'a' + 10;
elseif c >= 'A' then
c := c - 'A' + 10;
else
c := c - '0';
end if;
if c >= (base as uint8) then
break;
end if;
result := (result * base as int32) + (c as int32);

ptr := ptr + 1;
c := [ptr];
end loop;

if negative != 0 then
result := -result;
end if;
end sub;

sub MemZero(ptr: [uint8], size: intptr) is
MemSet(ptr, 0, size);
end sub;

Binary file added Source/Images/d_cowgol/u0/COWBE.COM
Binary file not shown.
Binary file added Source/Images/d_cowgol/u0/COWFE.COM
Binary file not shown.
Binary file added Source/Images/d_cowgol/u0/COWFIX.COM
Binary file not shown.
Loading

0 comments on commit e18014a

Please sign in to comment.