Title: WHYP -- An Extensible Language
1WHYP-- An Extensible Language
2WHYP--An Extensible Language
- A Closer Look at WHYP
- Defining New WHYP Words
- Variables
- Constants
- EEPROM
3A Closer Look at WHYP
4WHYP--An Extensible Language
- A Closer Look at WHYP
- Defining New WHYP Words
- Variables
- Constants
- EEPROM
5Colon Definitions
ltnamegt --- --- --- ---
squared ( n -- n2 ) DUP 16 4104 JSR
DUP 16 4337 JSR 3D RTS
6(No Transcript)
7WHYP12.CFG
8SEE 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
9Single Stepping
ok
5 step squared
squared
DUP
S1 5
R0
DUP
S2 5 5
R0
S1 19
R0
Exit single step
ok
. 25 ok
10Single 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
11Loading WHYP words from a file
square.whp
12Loading WHYP words from a file
13CR and ."
bar ( -- ) \ print a bar CR ." "
post ( -- ) \ print a post CR ." " CR ."
" CR ." "
14CR and ."
C ( -- ) \ print a C bar post bar cr
E ( -- ) \ print an E bar post bar post
bar cr
15WHYP--An Extensible Language
- A Closer Look at WHYP
- Defining New WHYP Words
- Variables
- Constants
- EEPROM
16Variables
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
17Variables
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.
18Fetch and Store
19Examples 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
2068HC12 code for !, _at_, C!, and C_at_
21Plus-store
1 my.name !
2268HC12 code for 2!, and 2_at_
23System Variables SP0, RP0
24Arrays
VARIABLE my.array 8 VALLOT
my.array 3 2 _at_ .
will print the value of my.array3
25Arrays
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 !
26WHYP--An Extensible Language
- A Closer Look at WHYP
- Defining New WHYP Words
- Variables
- Constants
- EEPROM
27Constants
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.
28Examples of using CONSTANTs
29Tables
CREATE table
30HEX CREATE table 5 , 8 , 23 ,
31Example of creating a table
32HEX CREATE table 5 C, 8 C, 23 C,
33EEPROM
- MC68HC812A4
- 4 Kbytes of EEPROM
- 1000 - 1FFF
- MC68HC912B32
- 768 bytes of EEPROM
- 0D00 - 0FFF
34EEPROM Initial Position Register
35MC68HC812A4 EEPROMBlock Protect Register
36MC68HC912B32 EEPROMBlock Protect Register
In WHYP12 CLR EEPROT
37The EEPROM Control Register
38Erasing an EEPROM Byte
39Delay 10 Milliseconds
40Erase Entire EEPROM
41Program an EEPROM Byte
42(No Transcript)
43Examples of using EEPROMmemory access words
44(No Transcript)
45square.hed
46whyp12.cfg
47(No Transcript)
48(No Transcript)
49(No Transcript)