Showing posts with label cp/m. Show all posts
Showing posts with label cp/m. Show all posts

Tuesday, February 25, 2020

CP/M on a Sinclair ZX Spectrum

After the Nostalgia Nerd reviewed the Sinclair ZX Spectrum on Youtube I reminded myself today that I always wanted to run CP/M on it. THere it is. I got - again - stuck in ED's insert mode. Just felt like 1982. :-D

Sunday, September 2, 2018

CP/M, the first operating system

The operating system CP/M

CP/M, the acronym for Control Program/Monitor or Microcomputer, is an operating system created in the year 1974 by Gary Kildall, founder of Digital Research. It is used on 8-bit Amstrad CPC and Amstrad PCW, Commodore 128, TRS-80, Osborne 1, BBC Micro, ZX Spectrum. It also found use on PCs, including the standard Amstrad PC-1512 in addition to MS-DOS and GEM.

For the Apple II, Microsoft created in 1980 the Z-80 Soft Card expansion card that allowed the use of the operating system of Digital Research. Early versions of MS-DOS were largely inspired, if not copied by CP/M.

Organization of memory

The memory of a computer under CP/M is divided into four parts:

  • BIOS: The Basic Input Output System for serial peripherals. It handles peripherals, floppy disks, monitor printers, etc. Usually, the BIOS occupies the "high" part of the memory.
  • BDOS: The basic disk operating system primitives. It contains the operating system. Usually, the BDOS is under the BIOS.
  • CCP (console command processor): Usually, the CCP is under the BDOS. This part of the CP/M corresponds to the user interface.
  • TPA (transient program area): This part of the memory starts at 100 (hexadecimal address). It is intended for user programs.

The different types of files

CP/M system stores files on floppy disks according to a specific logical organization, which has not been taken over by MS-DOS and can fill the disks. CP/M can also handle hard disks. In fact, as the BIOS is open, as clearly described in the documentation that Digital Research provided with some of its software, so it is possible to adapt any particular CP/M system to any available mass memory and devices available. Some computers running CP/M were originally sold with hard drives. Altos is one example.

Each file has a name and an extension.

  • ASM: assembler source file
  • PRN: assembler listing file
  • HEX: Machine language presented as a series of hexadecimal octets in Intel format
  • BAS: BASIC source file
  • INT: intermediate basic file
  • COM: command file, memory dump file, starting at address 100 hexadecimal under CP/M. Executable files always have the extension .COM
  • SUB: a file with a sequence of commands to be processed in batch mode by the command SUBMIT.
  • BAK: backup file is often used by word processing programs
  • $$$: temporary file, used for example by SUBMIT
  • LBR: archive file

Different orders of CP/M

CP/M commands can be internal or external, as was subsequently the case with MS-DOS. For the user under CP/M there is no difference between launching an internal command, such as DIR as *. * or an External like STAT as *. *. Or any other program.

Under CP/M, the shortest program needs only one byte, which returns to the System. On the other hand, it must be saved as an executable file using a .com extension, whose minimum size is one sector with a 128 bytes minimum.

The external commands of the CP/M or MP/M called programs of the same name which had the extension .COM or .PRL (only in the case of MP/M). Additional information: the MP/M was similar to CP/M but with a multi-user functionality.

Wednesday, June 6, 2018

Zilog Z80 CPU

The Zilog Z80 is an 8-bit microprocessor designed and manufactured by Zilog. One of the peculiarities of this processor is the coupling of some 8-bit registers to a 16-bit register. This with a 16-bit address bus allows for much faster processing of data than with a conventional 8-bit processor.

This processor was marketed for the first time in July 1976. In the early 1980s it was very popular in the design of 8-bit computers such as Radio Shack TRS-80, Sinclair ZX80, ZX81, ZX Spectrum, MSX standard, Amstrad CPC, PC-88 and later in embedded systems. With the MOS 6502 family, it dominated the 8-bit micro computer market from the late 1970s to the mid-1980s and was still used in then new Amstrad computers until 1995.

The Z80 was designed to be compatible with the Intel 8080, so the majority of the code for 8080 could work without much modification on the Z80. The CP/M operating system was designed around Intel 8080 based systems and could also work without modification on Z80 based systems.Z80 based systems were generally more powerful and had more features than systems based on 8080 CPUs. Some versions of CP/M applications only existed in a Z80 version.

History and overview

Z80 CPU DIP by DamicatzThe Z80 came into being when Federico Faggin, after working on the 8080, left Intel at the end of 1974 to found Zilog together with Ralph Ungermann to put the Z80 on the market in July of 1976. It was designed to be binary compatible with the Intel 8080 so that most of the 8080 code, including the CP/M operating system, works without modification on it. The Z80 quickly took over share from the 8080 on the market, and became one of the most popular 8-bit processors. Perhaps one of the keys to Z80's success was the integrated refresh of DRAM, and other features that allowed systems to be built with fewer chips. For the first NMOS generation, the maximum clock rate increased gradually. First at 2.5 MHz, then by the well known 4 MHz (Z80a), up to 6 (Z80b) and 8 MHz (Z80h). A CMOS version was developed with frequency limits ranging from 4 MHz to 20 MHz and some versions were sold until the 2000s. The CMOS version also has a low power sleep mode, with processor state retention. The Z180 and eZ80, fully compatible derivatives, have specifications for up to  50 MHz.

Use in systems

The Z80 CPU saw uses including in Texas Instruments calculators, SEGA Master System, GameBoy, and Game Gear video game consoles. Some more powerful consoles with other central processors like the Neo Geo or the Mega Drive with its Motorola 68000, used the Z80 as an addon processor to handle sound or system I/O.