<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Simplified_Instructional_Computer</id>
	<title>Simplified Instructional Computer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Simplified_Instructional_Computer"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Simplified_Instructional_Computer&amp;action=history"/>
	<updated>2026-07-30T16:44:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Simplified_Instructional_Computer&amp;diff=345841&amp;oldid=prev</id>
		<title>imported&gt;Wesleyneo: /* Emulating the SIC System */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Simplified_Instructional_Computer&amp;diff=345841&amp;oldid=prev"/>
		<updated>2025-11-19T08:47:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Emulating the SIC System&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Educational hypothetical computer}}&lt;br /&gt;
&amp;lt;!-- Deleted image removed: [[Image:SystemSoftwareBook.jpg|thumb|right|110px|System Software]] --&amp;gt;&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Simplified Instructional Computer&amp;#039;&amp;#039;&amp;#039; (abbreviated SIC) is a hypothetical [[computer]] system introduced in &amp;#039;&amp;#039;System Software: An Introduction to Systems Programming&amp;#039;&amp;#039;, by Leland Beck. Due to the fact that most modern microprocessors include subtle, complex functions for the purposes of efficiency, it can be difficult to learn [[systems programming]] using a real-world system. The Simplified Instructional Computer solves this by abstracting away these complex behaviors in favor of an architecture that is clear and accessible for those wanting to learn systems programming.&lt;br /&gt;
&lt;br /&gt;
== SIC Architecture ==&lt;br /&gt;
The SIC machine has basic addressing, storing most memory addresses in hexadecimal integer format. Similar to most modern computing systems, the SIC architecture stores all data in binary and uses the [[two&amp;#039;s complement]] to represent negative values at the machine level. Memory storage in SIC consists of 8-bit bytes, and all memory addresses in SIC are byte addresses. Any three consecutive bytes form a 24-bit &amp;#039;word&amp;#039; value, addressed by the location of the lowest numbered byte in the word value. Numeric values are stored as word values, and character values use the 8-bit [[ASCII]] system. The SIC machine does not support floating-point hardware and has at most 32,768 bytes of memory. There is also a more complicated machine built on top of SIC called the Simplified Instruction Computer with Extra Equipment (SIC/XE). The XE expansion of SIC adds a 48-bit floating point [[data type]], an additional memory [[addressing mode]], and extra memory (1 megabyte instead of 32,768 bytes) to the original machine. All SIC assembly code is upwards compatible with SIC/XE.&lt;br /&gt;
&lt;br /&gt;
SIC machines have several registers, each 24 bits long and having both a numeric and character representation:&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;A (0)&amp;#039;&amp;#039;&amp;#039;: Used for basic arithmetic operations; known as the accumulator register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;X (1)&amp;#039;&amp;#039;&amp;#039;: Stores and calculates addresses; known as the index register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;L (2)&amp;#039;&amp;#039;&amp;#039;: Used for jumping to specific memory addresses and storing return addresses; known as the linkage register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;PC (8)&amp;#039;&amp;#039;&amp;#039;: Contains the address of the next instruction to execute; known as the [[program counter]] register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;SW (9)&amp;#039;&amp;#039;&amp;#039;: Contains a variety of information, such as carry or overflow flags; known as the status word register.&lt;br /&gt;
&lt;br /&gt;
In addition to the standard SIC registers, there are also four additional general-purpose registers specific to the SIC/XE machine:&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;B (3)&amp;#039;&amp;#039;&amp;#039;: Used for addressing; known as the base register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;S (4)&amp;#039;&amp;#039;&amp;#039;: No special use, general purpose register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;T (5)&amp;#039;&amp;#039;&amp;#039;: No special use, general purpose register.&lt;br /&gt;
:* &amp;#039;&amp;#039;&amp;#039;F (6)&amp;#039;&amp;#039;&amp;#039;: Floating point accumulator register (This register is 48-bits instead of 24).&lt;br /&gt;
&lt;br /&gt;
These five/nine registers allow the SIC or SIC/XE machine to perform most simple tasks in a customized assembly language. In the System Software book, this is used with a theoretical series of operation codes to aid in understanding the assemblers and linker-loaders required for the execution of [[assembly language]] code.&lt;br /&gt;
&lt;br /&gt;
==Addressing Modes for SIC and SIC/XE==&lt;br /&gt;
The Simplified Instruction Computer has three instruction formats, and the Extra Equipment add-on includes a fourth. The instruction formats provide a model for memory and data management. Each format has a different representation in memory:&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Format 1&amp;#039;&amp;#039;&amp;#039;: Consists of 8 bits of allocated memory to store instructions.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Format 2&amp;#039;&amp;#039;&amp;#039;: Consists of 16 bits of allocated memory to store 8 bits of instructions and two 4-bits segments to store operands.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Format 3&amp;#039;&amp;#039;&amp;#039;: Consists of 6 bits to store an instruction, 6 bits of flag values, and 12 bits of displacement.&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;Format 4&amp;#039;&amp;#039;&amp;#039;: Only valid on SIC/XE machines, consists of the same elements as format 3, but instead of a 12-bit displacement, stores a 20-bit address.&lt;br /&gt;
&lt;br /&gt;
Both format 3 and format 4 have six-bit flag values in them, consisting of the following flag bits:&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;n&amp;#039;&amp;#039;&amp;#039;: Indirect addressing flag&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;i&amp;#039;&amp;#039;&amp;#039;: Immediate addressing flag&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;x&amp;#039;&amp;#039;&amp;#039;: Indexed addressing flag&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;b&amp;#039;&amp;#039;&amp;#039;: Base address-relative flag&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;p&amp;#039;&amp;#039;&amp;#039;: Program counter-relative flag&lt;br /&gt;
:*&amp;#039;&amp;#039;&amp;#039;e&amp;#039;&amp;#039;&amp;#039;: Format 4 instruction flag&lt;br /&gt;
&lt;br /&gt;
==Addressing Modes for SIC/XE==&lt;br /&gt;
* Rule 1:&lt;br /&gt;
*: e = 0 : format 3&lt;br /&gt;
*: e = 1 : format 4&lt;br /&gt;
** format 3:&lt;br /&gt;
**: b = 1, p = 0    (base relative)&lt;br /&gt;
**: b = 0, p = 1    (pc relative)&lt;br /&gt;
**: b = 0, p = 0    (direct addressing)&lt;br /&gt;
** format 4:&lt;br /&gt;
**: b = 0, p = 0    (direct addressing)&lt;br /&gt;
**: x = 1    (index)&lt;br /&gt;
**: i = 1, n = 0    (immediate)&lt;br /&gt;
**: i = 0, n = 1    (indirect)&lt;br /&gt;
**: i = 0, n = 0    (SIC)&lt;br /&gt;
**: i = 1, n = 1    (SIC/XE for SIC compatible)&lt;br /&gt;
* Rule 2:&lt;br /&gt;
*: i = 0, n =0	(SIC)&lt;br /&gt;
*: b, p, e is part of the address.&lt;br /&gt;
&lt;br /&gt;
== SIC Assembly Syntax ==&lt;br /&gt;
SIC uses a special assembly language with its own operation codes that hold the hex values needed to assemble and execute programs. A sample program is provided below to get an idea of what a SIC program might look like. In the code below, there are three columns. The first column represents a forwarded symbol that will store its location in memory. The second column denotes either a SIC instruction (opcode) or a constant value (BYTE or WORD). The third column takes the symbol value obtained by going through the first column and uses it to run the operation specified in the second column. This process creates an object code, and all the object codes are put into an [[object file]] to be run by the SIC machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
       COPY   START  1000&lt;br /&gt;
       FIRST  STL    RETADR&lt;br /&gt;
       CLOOP  JSUB   RDREC&lt;br /&gt;
              LDA    LENGTH&lt;br /&gt;
              COMP   ZERO&lt;br /&gt;
              JEQ    ENDFIL&lt;br /&gt;
              JSUB   WRREC&lt;br /&gt;
              J      CLOOP&lt;br /&gt;
       ENDFIL LDA    EOF&lt;br /&gt;
              STA    BUFFER&lt;br /&gt;
              LDA    THREE&lt;br /&gt;
              STA    LENGTH&lt;br /&gt;
              JSUB   WRREC&lt;br /&gt;
              LDL    RETADR&lt;br /&gt;
              RSUB&lt;br /&gt;
       EOF    BYTE   C&amp;#039;EOF&amp;#039;&lt;br /&gt;
       THREE  WORD   3&lt;br /&gt;
       ZERO   WORD   0&lt;br /&gt;
       RETADR RESW   1&lt;br /&gt;
       LENGTH RESW   1&lt;br /&gt;
       BUFFER RESB   4096&lt;br /&gt;
       .&lt;br /&gt;
       .      SUBROUTINE TO READ RECORD INTO BUFFER&lt;br /&gt;
       .&lt;br /&gt;
       RDREC  LDX    ZERO&lt;br /&gt;
              LDA    ZERO&lt;br /&gt;
       RLOOP  TD     INPUT&lt;br /&gt;
              JEQ    RLOOP&lt;br /&gt;
              RD     INPUT&lt;br /&gt;
              COMP   ZERO&lt;br /&gt;
              JEQ    EXIT&lt;br /&gt;
              STCH   BUFFER,X&lt;br /&gt;
              TIX    MAXLEN&lt;br /&gt;
              JLT    RLOOP&lt;br /&gt;
       EXIT   STX    LENGTH&lt;br /&gt;
              RSUB&lt;br /&gt;
       INPUT  BYTE   X&amp;#039;F1&amp;#039;&lt;br /&gt;
       MAXLEN WORD   4096&lt;br /&gt;
       .&lt;br /&gt;
       .      SUBROUTINE TO WRITE RECORD FROM BUFFER&lt;br /&gt;
       .&lt;br /&gt;
       WRREC  LDX    ZERO&lt;br /&gt;
       WLOOP  TD     OUTPUT&lt;br /&gt;
              JEQ    WLOOP&lt;br /&gt;
              LDCH   BUFFER,X&lt;br /&gt;
              WD     OUTPUT&lt;br /&gt;
              TIX    LENGTH&lt;br /&gt;
              JLT    WLOOP&lt;br /&gt;
              RSUB&lt;br /&gt;
       OUTPUT BYTE   X&amp;#039;06&amp;#039;&lt;br /&gt;
              END    FIRST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/CODE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were to assemble this program, you would get the object code depicted below. The beginning of each line consists of a record type and hex values for memory locations. For example, the top line is an &amp;#039;H&amp;#039; record, the first 6 hex digits signify its relative starting location, and the last 6 hex digits represent the program&amp;#039;s size. The lines throughout are similar, with each &amp;#039;T&amp;#039; record consisting of 6 hex digits to signify that line&amp;#039;s starting location, 2 hex digits to indicate the size (in bytes) of the line, and the object codes that were created during the assembly process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
       HCOPY 00100000107A&lt;br /&gt;
       T0010001E1410334820390010362810303010154820613C100300102A0C103900102D&lt;br /&gt;
       T00101E150C10364820610810334C0000454F46000003000000&lt;br /&gt;
       T0020391E041030001030E0205D30203FD8205D2810303020575490392C205E38203F&lt;br /&gt;
       T0020571C1010364C0000F1001000041030E02079302064509039DC20792C1036&lt;br /&gt;
       T002073073820644C000006&lt;br /&gt;
       E001000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/CODE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sample program==&lt;br /&gt;
Given below is a program illustrating data movement in SIC.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;LDA FIVE&amp;lt;br&amp;gt;&lt;br /&gt;
STA ALPHA&amp;lt;br&amp;gt;&lt;br /&gt;
LDCH CHARZ&amp;lt;br&amp;gt;&lt;br /&gt;
STCH C1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
ALPHA RESW 1&amp;lt;br&amp;gt;&lt;br /&gt;
FIVE WORD 5&amp;lt;br&amp;gt;&lt;br /&gt;
CHARZ BYTE C&amp;#039;Z&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
C1 RESB 1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Emulating the SIC System ==&lt;br /&gt;
Since the SIC and SIC/XE machines are not real machines, the task of actually constructing a SIC emulator is often part of coursework in a systems programming class. The purpose of SIC is to teach introductory-level systems programmers or collegiate students how to write and assemble code below higher-level languages like C and C++. With that being said, there are some sources of SIC-emulating programs across the web, however infrequent they may be.&lt;br /&gt;
:*An assembler and a simulator written by the author, Leland in Pascal is available at https://archive.org/details/sicsim&lt;br /&gt;
:*SIC/XE Simulator And Assembler downloadable at https://sites.google.com/site/sarimohsultan/Projects/sic-xe-simulator-and-assembler {{dead link|date=April 2023}}&lt;br /&gt;
:*SIC Emulator, Assembler and some example programs written for SIC downloadable at https://sourceforge.net/projects/sicvm/&lt;br /&gt;
:*SicTools - virtual machine, simulator, assembler and linker for the SIC/XE computer available at https://jurem.github.io/SicTools/&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Computer]]&lt;br /&gt;
* {{SDlink|MIX (abstract machine)|MIX}}&lt;br /&gt;
* [[System software]]&lt;br /&gt;
* [[Assembly language]]&lt;br /&gt;
* [[Processor register]]&lt;br /&gt;
* [[Virtual machine]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;br /&gt;
* {{Citation |last=Beck |first=Leland |authorlink=Leland L. Beck |title=System Software: An Introduction to Systems Programming |year=1996 |edition=3 |publisher=Addison-Wesley |isbn=0-201-42300-6 |url-access=registration |url=https://archive.org/details/systemsoftwarein00beck }}&lt;br /&gt;
* Information of SIC and SIC/XE systems: https://web.archive.org/web/20121114101742/http://www-rohan.sdsu.edu/~stremler/2003_CS530/SicArchitecture.html&lt;br /&gt;
* List of SIC and SIC/XE instructions: http://teaching.yfolajimi.com/uploads/3/5/6/9/3569427/_sp04.ppt&lt;br /&gt;
* Brief memory addressing information: http://www.unf.edu/~cwinton/html/cop3601/s10/class.notes/basic4-SICfmts.pdf&lt;br /&gt;
* SIC/XE Mode Addressing: http://uhost.rmutp.ac.th/wanapun.w/--j--/ch2-2.pdf{{dead link|date=May 2018 |bot=InternetArchiveBot |fix-attempted=yes }}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://sourceforge.net/projects/sicvm/ SICvm] A Virtual Machine based on a Simplified Instructional Computer (SIC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Educational abstract machines]]&lt;br /&gt;
[[Category:Computer science education]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Wesleyneo</name></author>
	</entry>
</feed>