Download presentation
Presentation is loading. Please wait.
1
Business Programming I
Fall – 2000 By Jim Payne
2
Jim Payne - University of Tulsa
Babbage to Billy-O Between 1833 and the mid-1940’s, there were very few new developments in the field of programming languages. We did see a major contribution to the future of computing with the development of the keypunch machine and punch cards by Herman Hollerith in the 1880’s. Lecture 02 Jim Payne - University of Tulsa
3
Jim Payne - University of Tulsa
Tabulating Machine Link to biography of Herman Hollerith Lecture 02 Jim Payne - University of Tulsa
4
Links: Early History of Computers
Virginia Tech – History of Computing Virtual Museum of the United Kingdom Smithsonian Museum - Computers Check out these sites to learn more about the Turing Machine, the ABC machine, the ENIAC, and then in 1951, the UNIVAC. All of these machines were either hard wired for each instruction or began the use of assembler language instructions. Lecture 02 Jim Payne - University of Tulsa
5
Jim Payne - University of Tulsa
Assembler Language In the slides that follow, I will be using an “assembler like” computer programming language named BILLY-O. The language was developed at Iowa State University and then used by Dr. Roger Wainwright – TU, for several years in the early 1980’s to support the teaching of programming concepts and to help students understand at least the basics of what actually happens inside the computer. My thanks to Dr. Wainwright for supporting its continued use some twenty years later. Lecture 02 Jim Payne - University of Tulsa
6
Instructions: I/O & Memory Movement
INP Input OUT Output LDA Load Accumulator STA Store Accumulator LDC Load a Constant ADC Add a Constant Lecture 02 Jim Payne - University of Tulsa
7
Instructions: Arithmetic Operators
ADD Add to Accumulator SUB Subtract from Accumulator MPY Multiply Accumulator DIV Divide Accumulator Lecture 02 Jim Payne - University of Tulsa
8
Instructions: Branching Commands
BRU Branch Unconditionally BPA Branch + Accumulator BNA Branch - Accumulator BZA Branch Zero Accumulator Lecture 02 Jim Payne - University of Tulsa
9
Instructions: Data and Ending
HLT End of Procedure NUM Initializing Variables END Last Instruction Lecture 02 Jim Payne - University of Tulsa
10
BILLY-O LANGUAGE Complete Instruction Set
INP OUT LDA STA LDC ADC ADD SUB MPY DIV BRU BPA BNA BZA HLT NUM END Lecture 02 Jim Payne - University of Tulsa
11
INP Memory ADC LDC LDA OUT BRU BPA BNA BZA Accumulator STA
ADD SUB MPY DIV Accumulator STA Arithmetic Logic Unit
12
Problem: Input 2 numbers, A & B. Compute C = A * B. Then Output C.
Answer: C = 30 Lecture 02 Jim Payne - University of Tulsa
13
FLOWCHART OF PROBLEM START INP A INP B LDA A MPY B STA C C = A * B OUT C STOP
14
1 2 3 4 5 6 7 8 9 I N P A B L D M Y S T C O U H E
15
INP Arithmetic Logic Unit Accumulator Memory OUT ADC LDC LDA STA BRU
ADD SUB MPY DIV STA BRU BPA BNA BZA 5,6 A B C INP A INP B LDA A MPY B STA C OUT C HLT END 5 6 30 30 5 30
16
Jim Payne - University of Tulsa
Problem: Input a series of exam scores between 0 and 100 until a trip value of 999 is entered. Then print out the number of scores processed, the average exam score, and the number of students that passed the exam (score of 60 or better). Lecture 02 Jim Payne - University of Tulsa
17
Introduction of Bertha’s DP World
Typewriter Calculator Paper & Pencil IN OUT
18
How Would Bertha Do This?
Pick Up from the in basket a series of exam scores between 0 and 100 until a trip value of 999 is encountered. Then type up a report that provides the number of scores processed, the average exam score, and the number of students that passed the exam (score of 60 or better). Then put the typed report in the out basket. Lecture 02 Jim Payne - University of Tulsa
19
STEPS: (In Pseudocode Form)
Bertha Method Sum of Scores Counter of Scores Counter of Passing IN Basket 70 80 100 40 10 999 STEPS: (In Pseudocode Form) Pick up a card from the in basket. If score = 999, do what? Else do what? NOT EQUAL 999: Add score to Sum of Scores, Add 1 to Counter of Scores. If score >= 60, Add 1 to Counter of Passing. Then go read next score. EQUAL 999: Compute Average Score = Sum of Scores / Counter of Scores. Print out report answers. Quit Processing
20
Variable Naming SCR = Individual Score SOS = Sum of Scores
COS = Counter of Scores COP = Counter of Passing AVG = Average Score = SOS / COS
21
Pseudocode Revised Flowchart of Logic Input a value for SCR
Start Stop Input a value for SCR If SCR = 999 Compute AVG = SOS / COS Print Results and Quit Else Compute SOS = SOS + SCR Compute COS = COS + 1 If SCR >= 60 Compute COP = COP + 1 EndIf Endif Go to Top of Program
22
Billy-O Program TOP INP SCR LDA SCR ADC -999 BZA MID LDA SOS ADD SCR
STA SOS LDA COS ADC 1 STA COS ADC -60 BNA TOP LDA COP STA COP BRU TOP MID LDA SOS DIV COS STA AVG OUT AVG OUT COS OUT COP HLT SOS NUM 0 COS NUM 0 COP NUM 0 END
23
Billy-O Program IN Basket 70 80 100 40 10 999 TOP INP SCR LDA SCR
ADC -999 BZA MID LDA SOS ADD SCR STA SOS LDA COS ADC 1 STA COS ADC -60 BNA TOP LDA COP STA COP BRU TOP MID LDA SOS DIV COS STA AVG OUT AVG OUT COS OUT COP HLT SOS NUM 0 COS NUM 0 COP NUM 0 END IN Basket 70 80 100 40 10 999
24
Jim Payne - University of Tulsa
Go TU !!! Lecture 02 Jim Payne - University of Tulsa
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.