Intel l2ICE User Manual page 62

Integrated instrumentation and in-circuit emulation system
Table of Contents

Advertisement

63 2
CALL write(@text.string, text.cnt):
64 2
value = 0;
65 2
not_done = TRUE;
DO WHILE not_done;
66 2
67 3
char = read;
IF (char > = '0 ') AND (char < = '9 ') THEN
68 3
DO;
69 3
70 4
value = value + char - 'O';
71 4
value = value /10;
72 4
END:
ELSE
73 3
not_done = false;
74 2
END;
75 2
RETURN value;
76 2 END geUnput;
77 1 begin;:
7« 1
DO;
7Q 2
CALL write (@lf_cr, 2);
o
60
pair* - ?et incutspaid_Jext);
81
2
purchased = get_input(@purchased__text);
82 2
CALL write (@lf__cr, 2);
83 2
change = paid - purchased;
84 2
dollars = change/100;
85 2
coins = change MOD 100;
86 2
quarters = coins/25;
87 2
coins = coins MOD 25;
88 2
dimes = coins/10;
89 2
coins = coins MOD 10;
90 2
nickels = coins/5;
91
2
pennies = coins MOD 5;
92 2
IF paid < purchased THEN
93 2
CALL write(@('NO CHEATING!'), 12);
94 2
ELSE
CALL payment;
95 2
END;
96
1
HALT;
1 END;
97
2-20
/*
Translate the ASCII hex character to the decimal value
/ *
Flag
/*
Keyboard entry can
/ *
be 0 through 9
/*
BUG value
=
value* 10
BUG
=
value
+
char- 0'
/ *
Mainline
/ *
Get amount paid
/ *
and purchase price
/ *
/ *
Figure change
How many dollars?
/ *
Are there coins?
/ *
How many quarters
/ *
etc.
/*
Guide to the PICE™ System Tutorial
* /
* /
* /
* /
* /
* /
* /
* /
* /
* /
* /
* /
* /
* /

Advertisement

Table of Contents
loading

Table of Contents