Intel l2ICE User Manual page 60

Integrated instrumentation and in-circuit emulation system
Table of Contents

Advertisement

char BYTE;
5 2
char = INPUT(in_port);
6 2
IF char = ODH THEN
7 2
CALL write (@lf_cr, 1);
8 2
CALL write (@char, 1);
RETURN char;
9 2
10 2
END read;
11 2 write: PROCEDURE (text__ptr, text_cnt);
DECLARE
12 2
text_ptr POINTER,
text_„cnt WORD,
text_BASED text_ptr (1) BYTE,
i WORD;
13 2
DO i = 0 TO text_cnt -1;
OUTPUT(out_port) = text(i);
14 3
15 3
END;
16 2 END write;
17 1 write_decimal: PROCEDURE (value);
18 2
DECLARE
value WORD,
i WORD,
digit_stack(5) BYTE,
stk__top WORD;
19 2
stk__top = 5;
20 2
DO WHILE value > 0;
21
3
digit_stack(stk_top := stk__top-1) - value MOD 10;
22 3
value = value/10;
23 3
END;
24 2
DO i = stk__top TO 5;
25 3
CALL convert_decimaL_digit(digit_stack(i));
26 3
END;
27 2 END write_decimal;
1 convert_decimal_digit: PROCEDURE (decimal_digit); ./*
28
29 2
DECLARE
decimal_digit BYTE,
ascii_digit BYTE;
30 2
ascii_digit = decimaLdigit + 'O';
31
2
CALL write(@ascii_digit, 1);
32 2 END convert_decimal_digit;
33 1 print_coin: PROCEDURE (text_ptr, value);
34 2
DECLARE
text_ptr POINTER,
value WORD,
2-18
/* time; also writes an input byte to
/* an output port
/* Write text_cnt characters */
/* at text_ptr to output port
/*
Store digits in
stack-like array
/*
/*
0..4
/*
BUG 5 should be 4
To ASCII
/* Character '0 ' is 30H
/* Formats writing of change
/* Tells where
/* Tells what
Guide to the PICE™ System Tutorial
*/
*/
*/
* /
* /
,
* /
* /
* /
* /
* /
* /
* /

Advertisement

Table of Contents
loading

Table of Contents