Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Simplified Instructional Computer
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== SIC Assembly Syntax == 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. <CODE><pre> COPY START 1000 FIRST STL RETADR CLOOP JSUB RDREC LDA LENGTH COMP ZERO JEQ ENDFIL JSUB WRREC J CLOOP ENDFIL LDA EOF STA BUFFER LDA THREE STA LENGTH JSUB WRREC LDL RETADR RSUB EOF BYTE C'EOF' THREE WORD 3 ZERO WORD 0 RETADR RESW 1 LENGTH RESW 1 BUFFER RESB 4096 . . SUBROUTINE TO READ RECORD INTO BUFFER . RDREC LDX ZERO LDA ZERO RLOOP TD INPUT JEQ RLOOP RD INPUT COMP ZERO JEQ EXIT STCH BUFFER,X TIX MAXLEN JLT RLOOP EXIT STX LENGTH RSUB INPUT BYTE X'F1' MAXLEN WORD 4096 . . SUBROUTINE TO WRITE RECORD FROM BUFFER . WRREC LDX ZERO WLOOP TD OUTPUT JEQ WLOOP LDCH BUFFER,X WD OUTPUT TIX LENGTH JLT WLOOP RSUB OUTPUT BYTE X'06' END FIRST </pre></CODE> 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 'H' record, the first 6 hex digits signify its relative starting location, and the last 6 hex digits represent the program's size. The lines throughout are similar, with each 'T' record consisting of 6 hex digits to signify that line'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. <CODE><pre> HCOPY 00100000107A T0010001E1410334820390010362810303010154820613C100300102A0C103900102D T00101E150C10364820610810334C0000454F46000003000000 T0020391E041030001030E0205D30203FD8205D2810303020575490392C205E38203F T0020571C1010364C0000F1001000041030E02079302064509039DC20792C1036 T002073073820644C000006 E001000 </pre></CODE>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)