WHYP -- An Extensible Language - PowerPoint PPT Presentation

About This Presentation
Title:

WHYP -- An Extensible Language

Description:

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell ... Erasing an EEPROM Byte ... Erase Entire EEPROM ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 50
Provided by: Richard6
Category:

less

Transcript and Presenter's Notes

Title: WHYP -- An Extensible Language


1
WHYP-- An Extensible Language
  • Chapter 4

2
WHYP--An Extensible Language
  • A Closer Look at WHYP
  • Defining New WHYP Words
  • Variables
  • Constants
  • EEPROM

3
A Closer Look at WHYP
4
WHYP--An Extensible Language
  • A Closer Look at WHYP
  • Defining New WHYP Words
  • Variables
  • Constants
  • EEPROM

5
Colon Definitions
ltnamegt --- --- --- ---
squared ( n -- n2 ) DUP 16 4104 JSR
DUP 16 4337 JSR 3D RTS
6
(No Transcript)
7
WHYP12.CFG
8
SEE and SHOW
see squared
squared
DUP
ok
show squared
squared
16 41 4
16 43 37 3D
ok
see cubed
cubed
DUP squared
ok
show cubed
cubed
16 41 4
16 50 0
16 43 37 3D
ok
9
Single Stepping
ok
5 step squared
squared
DUP
S1 5
R0
DUP
S2 5 5
R0

S1 19
R0
Exit single step
ok
. 25 ok
10
Single Stepping
ok
5 step cubed
cubed
DUP squared
S1 5
R0
DUP
S2 5 5
R0
squared
S2 5 19
R0

S1 7D
R0
Exit single step
ok
. 125 ok
11
Loading WHYP words from a file
square.whp
12
Loading WHYP words from a file
13
CR and ."
bar ( -- ) \ print a bar CR ." "
post ( -- ) \ print a post CR ." " CR ."
" CR ." "
14
CR and ."
C ( -- ) \ print a C bar post bar cr
E ( -- ) \ print an E bar post bar post
bar cr
15
WHYP--An Extensible Language
  • A Closer Look at WHYP
  • Defining New WHYP Words
  • Variables
  • Constants
  • EEPROM

16
Variables
VARIABLE my.name
Stores the following code at tdp. my.name
executes this code.
16 451E JSR (LIT) 0800 0800 3D RTS
my.name . 800 ok
17
Variables
Variables are stored in memory at address
vdp. The value of vdp can be changed by pressing
F8. VHERE puts the current value of vdp on the
data stack.
18
Fetch and Store
19
Examples of _at_ and !
C\WHYP\WHYP12gtwhyp12
Using WHYP12.HED
Communicating with COM1
68HC12 WHYP12 - Version 4.6
Press ltEscgt or type BYE to exit
ok
VARIABLE
my.name ok
hex ok
my.name . 800 ok
7
my.name ! ok
800 10 dump
0 1 2 3 4 5 6 7 8 9 A B C D
E F
0800 00 07 86 80 52 00 80 02 09 00 28 18 90 00
83 00 ..R . ( . .
ok
my.name _at_ . 7 ok
12 my.name c! ok
34 my.name 1 c! ok
800 10 dump
0 1 2 3 4 5 6 7 8 9 A B C D
E F
0800 12 34 86 80 52 00 80 02 09 00 28 18 90 00
83 00 4..R . ( . .
ok
my.name c_at_ . 12 ok
my.name 1 c_at_ . 34 ok
20
68HC12 code for !, _at_, C!, and C_at_
21
Plus-store
1 my.name !
22
68HC12 code for 2!, and 2_at_
23
System Variables SP0, RP0
24
Arrays
VARIABLE my.array 8 VALLOT
my.array 3 2 _at_ .
will print the value of my.array3
25
Arrays
VARIABLE my.array 8 VALLOT
my.array 3 2 _at_ .
A_at_ ( ix addr -- n ) SWAP 2 _at_ 3
my.array A_at_ .
will print the value of my.array3
Chap 13 3 my.array _at_ . 1234 3 my.array !
26
WHYP--An Extensible Language
  • A Closer Look at WHYP
  • Defining New WHYP Words
  • Variables
  • Constants
  • EEPROM

27
Constants
25 CONSTANT quarter
Stores the following code at tdp. quarter
executes this code.
16 451E JSR (LIT) 0019 0019 3D RTS
quarter .
will print the value 25 on the screen.
28
Examples of using CONSTANTs
29
Tables
CREATE table
30
HEX CREATE table 5 , 8 , 23 ,
31
Example of creating a table
32
HEX CREATE table 5 C, 8 C, 23 C,
33
EEPROM
  • MC68HC812A4
  • 4 Kbytes of EEPROM
  • 1000 - 1FFF
  • MC68HC912B32
  • 768 bytes of EEPROM
  • 0D00 - 0FFF

34
EEPROM Initial Position Register
35
MC68HC812A4 EEPROMBlock Protect Register
36
MC68HC912B32 EEPROMBlock Protect Register
In WHYP12 CLR EEPROT
37
The EEPROM Control Register
38
Erasing an EEPROM Byte
39
Delay 10 Milliseconds
40
Erase Entire EEPROM
41
Program an EEPROM Byte
42
(No Transcript)
43
Examples of using EEPROMmemory access words
44
(No Transcript)
45
square.hed
46
whyp12.cfg
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com