CH6 - 1 Programming the Basic Computer Computer...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Programming the Basic Computer Computer Organization Chapter 6 Programming the Basic Computer 2 Programming the Basic Computer Computer Organization PROGRAMMING THE BASIC COMPUTER Introduction Machine Language Assembly Language Assembler Program Loops Programming Arithmetic and Logic Operations Subroutines Input-Output Programming 3 Programming the Basic Computer Computer Organization 6.1. INTRODUCTION Symbol Hexa code Description Those concerned with computer architecture should have a knowledge of both hardware and software because the two branches influence each other. m: effective address M: memory word (operand) found at m Introduction AND 0 or 8 AND M to AC ADD 1 or 9 Add M to AC, carry to E LDA 2 or A Load AC from M STA 3 or B Store AC in M BUN 4 or C Branch unconditionally to m BSA 5 or D Save return address in m and branch to m+1 ISZ 6 or E Increment M and skip if zero CLA 7800 Clear AC CLE 7400 Clear E CMA 7200 Complement AC CME 7100 Complement E CIR 7080 Circulate right E and AC CIL 7040 Circulate left E and AC INC 7020 Increment AC, carry to E SPA 7010 Skip if AC is positive SNA 7008 Skip if AC is negative SZA 7004 Skip if AC is zero SZE 7002 Skip if E is zero HLT 7001 Halt computer INP F800 Input information and clear flag OUT F400 Output information and clear flag SKI F200 Skip if input flag is on SKO F100 Skip if output flag is on ION F080 Turn interrupt on IOF F040 Turn interrupt off Instruction Set of the Basic Computer 4 Programming the Basic Computer Computer Organization 6.2. MACHINE LANGUAGE Program: is a list of instructions or statements for directing the computer to perform a required data processing task Various types of programming languages- Hierarchy of programming languages • Machine-language- Binary code- Octal or hexadecimal code • Assembly-language (Assembler)- Symbolic code • High-level language (Compiler) Machine Language 5 Programming the Basic Computer Computer Organization COMPARISON OF PROGRAMMING LANGUAGES Machine Language Add two numbers in C/C++ Int A,B,C; Cin >> A; Cin >> B; C = A + B; ORG /Origin of program is location 0 LDA A /Load operand from location A ADD B /Add operand from location B STA C /Store sum in location C HLT /Halt computer A, DEC 83 /Decimal operand B, DEC-23 /Decimal operand C, DEC /Sum stored in location C END /End of symbolic program • Assembly-Language Program 000 LDA 004 Load 1st operand into AC 001 ADD 005 Add 2nd operand to AC 002 STA 006 Store sum in location 006 003 HLT Halt computer 004 0053 1st operand 005 FFE9 2nd operand (negative) 006 0000 Store sum here • Program with Symbolic OP-Code 000 2004 001 1005 002 3006 003 7001 004 0053 005 FFE9 006 0000 • Hex program 6 Programming the Basic Computer Computer Organization COMPARISON OF PROGRAMMING LANGUAGES Machine Language 000 LDA 004 Load 1st operand into AC 001 ADD 005 Add 2nd operand to AC 002 STA 006 Store sum in location 006 003 HLT Halt computer 004 0053 1st operand 005 FFE9 2nd operand (negative) 006 0000 Store sum here...
View Full Document

This note was uploaded on 04/15/2011 for the course CS 284 taught by Professor Jamess. during the Spring '10 term at Jordan University of Science & Tech.

Page1 / 28

CH6 - 1 Programming the Basic Computer Computer...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online