From: Nick Downing Date: Mon, 30 Nov 2015 15:35:45 +0000 (+1100) Subject: 20030512 release X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7ba874332aa01d702943857bad3f7f3c5e49f144;p=uzi.git 20030512 release --- diff --git a/bin/a.sh b/bin/a.sh deleted file mode 100644 index fac355b1..00000000 --- a/bin/a.sh +++ /dev/null @@ -1 +0,0 @@ -cp std-chs /dev/lcd0 diff --git a/bin/appinst.bat b/bin/appinst.bat new file mode 100644 index 00000000..09788264 --- /dev/null +++ b/bin/appinst.bat @@ -0,0 +1,2 @@ +ucp < appinst.ucp +copy uzidisk.dat e:\ diff --git a/bin/appinst.sh b/bin/appinst.sh new file mode 100644 index 00000000..4c6d489a --- /dev/null +++ b/bin/appinst.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +echo "" +echo "Installing application program" +echo "" + +rm -f /wnd/*.scr +cp -v /usr/boot/inst/wnd/*.scr /wnd + +rm -f /bin/grlogin /bin/test +cp -v /usr/boot/inst/bin/grlogin /usr/boot/inst/bin/test /bin +align -v /bin/grlogin /bin/test + +echo "" +echo "Finished installing application" +echo "" + diff --git a/bin/appinst.ucp b/bin/appinst.ucp new file mode 100644 index 00000000..d875517b --- /dev/null +++ b/bin/appinst.ucp @@ -0,0 +1,29 @@ +root b: +cd /boot +mkdir inst +get appinst.sh +chmod 755 appinst.sh +cd /boot/inst +mkdir bin +mkdir wnd +cd /boot/inst/bin +bget banked\grlogin grlogin +chmod 755 grlogin +bget banked\test test +chmod 755 test +cd /boot/inst/wnd +bget data\logn.scr logn.scr +chmod 644 logn.scr +bget data\0000.scr 0000.scr +chmod 644 0000.scr +bget data\0001.scr 0001.scr +chmod 644 0001.scr +bget data\0002.scr 0002.scr +chmod 644 0002.scr +bget data\0003.scr 0003.scr +chmod 644 0003.scr +bget data\0004.scr 0004.scr +chmod 644 0004.scr +bget data\kass.scr kass.scr +chmod 644 kass.scr +exit diff --git a/bin/b.sh b/bin/b.sh deleted file mode 100644 index 33ea9a3f..00000000 --- a/bin/b.sh +++ /dev/null @@ -1 +0,0 @@ -cp ned-chs /dev/lcd1 diff --git a/bin/banked/cat b/bin/banked/cat index 86a3fa22..b94c628d 100644 Binary files a/bin/banked/cat and b/bin/banked/cat differ diff --git a/bin/banked/diff b/bin/banked/diff index 11ee6f51..acf0b6e5 100644 Binary files a/bin/banked/diff and b/bin/banked/diff differ diff --git a/bin/banked/ed b/bin/banked/ed index 93cbad33..79387c49 100644 Binary files a/bin/banked/ed and b/bin/banked/ed differ diff --git a/bin/banked/fsck b/bin/banked/fsck new file mode 100644 index 00000000..ee200282 Binary files /dev/null and b/bin/banked/fsck differ diff --git a/bin/banked/grlogin b/bin/banked/grlogin new file mode 100644 index 00000000..b235271a Binary files /dev/null and b/bin/banked/grlogin differ diff --git a/bin/banked/init b/bin/banked/init index 2bfcaf32..36be34ce 100644 Binary files a/bin/banked/init and b/bin/banked/init differ diff --git a/bin/banked/ls b/bin/banked/ls index b8c22b33..026709f8 100644 Binary files a/bin/banked/ls and b/bin/banked/ls differ diff --git a/bin/banked/mkdir b/bin/banked/mkdir index 07061239..6e7b9cc8 100644 Binary files a/bin/banked/mkdir and b/bin/banked/mkdir differ diff --git a/bin/banked/mkfs b/bin/banked/mkfs new file mode 100644 index 00000000..2deb3d6a Binary files /dev/null and b/bin/banked/mkfs differ diff --git a/bin/banked/msh b/bin/banked/msh index 794803df..116e9021 100644 Binary files a/bin/banked/msh and b/bin/banked/msh differ diff --git a/bin/banked/setclock b/bin/banked/setclock index eff169f0..ffcef943 100644 Binary files a/bin/banked/setclock and b/bin/banked/setclock differ diff --git a/bin/banked/test b/bin/banked/test index 1ef475c6..d91eab5a 100644 Binary files a/bin/banked/test and b/bin/banked/test differ diff --git a/bin/banked/tr b/bin/banked/tr index 08a15846..b7215245 100644 Binary files a/bin/banked/tr and b/bin/banked/tr differ diff --git a/bin/banked/wnd b/bin/banked/wnd new file mode 100644 index 00000000..3114f729 Binary files /dev/null and b/bin/banked/wnd differ diff --git a/bin/boot.bin b/bin/boot.bin index 003e3976..a3876036 100644 Binary files a/bin/boot.bin and b/bin/boot.bin differ diff --git a/bin/checksum b/bin/checksum index e8bc3d32..26858fb8 100644 Binary files a/bin/checksum and b/bin/checksum differ diff --git a/bin/checksum.dat b/bin/checksum.dat new file mode 100644 index 00000000..172cee84 --- /dev/null +++ b/bin/checksum.dat @@ -0,0 +1,2 @@ +C A:KERNEL.BIN +C A:BOOT.BIN diff --git a/bin/data/0000.scr b/bin/data/0000.scr new file mode 100644 index 00000000..850c7208 Binary files /dev/null and b/bin/data/0000.scr differ diff --git a/bin/data/0001.scr b/bin/data/0001.scr new file mode 100644 index 00000000..a5348309 Binary files /dev/null and b/bin/data/0001.scr differ diff --git a/bin/data/0002.scr b/bin/data/0002.scr new file mode 100644 index 00000000..389139b4 Binary files /dev/null and b/bin/data/0002.scr differ diff --git a/bin/data/0003.scr b/bin/data/0003.scr new file mode 100644 index 00000000..749c1d97 Binary files /dev/null and b/bin/data/0003.scr differ diff --git a/bin/data/0004.scr b/bin/data/0004.scr new file mode 100644 index 00000000..238ad7bf Binary files /dev/null and b/bin/data/0004.scr differ diff --git a/bin/data/kass.scr b/bin/data/kass.scr new file mode 100644 index 00000000..2977e7d6 Binary files /dev/null and b/bin/data/kass.scr differ diff --git a/bin/data/logn.scr b/bin/data/logn.scr new file mode 100644 index 00000000..089f16f7 Binary files /dev/null and b/bin/data/logn.scr differ diff --git a/bin/font/lcd0.cmd b/bin/font/lcd0.cmd new file mode 100644 index 00000000..b01407f1 Binary files /dev/null and b/bin/font/lcd0.cmd differ diff --git a/bin/font/lcd1.cmd b/bin/font/lcd1.cmd new file mode 100644 index 00000000..5e9496d8 Binary files /dev/null and b/bin/font/lcd1.cmd differ diff --git a/bin/fstab.txt b/bin/fstab.txt new file mode 100644 index 00000000..de99268e --- /dev/null +++ b/bin/fstab.txt @@ -0,0 +1,2 @@ +/dev/hd0 / rw +/dev/hd1 /usr rw diff --git a/bin/group.txt b/bin/group.txt index a0038f77..4c18bd12 100644 --- a/bin/group.txt +++ b/bin/group.txt @@ -1,4 +1,5 @@ root::0:root bin::1:bin tty::6:tty -users::100:users +operator::100:Operators +manager::101:Managers diff --git a/bin/inittab.txt b/bin/inittab.txt index b2991151..57df377c 100644 --- a/bin/inittab.txt +++ b/bin/inittab.txt @@ -1,4 +1,6 @@ -# Hytech initialisation table to format the RAM filesystem +# Hytech initialisation table for running system -/boot/mkramfs.sh +@/etc/rc.d/rc.sysinit +@/etc/rc.d/rc.runonce +/bin/grlogin diff --git a/bin/kernel.bin b/bin/kernel.bin index b670a1c0..0b4c166f 100644 Binary files a/bin/kernel.bin and b/bin/kernel.bin differ diff --git a/bin/large/cat b/bin/large/cat index e1f60193..5eb63c12 100644 Binary files a/bin/large/cat and b/bin/large/cat differ diff --git a/bin/large/diff b/bin/large/diff index fb4c31ed..a0ea185b 100644 Binary files a/bin/large/diff and b/bin/large/diff differ diff --git a/bin/large/ed b/bin/large/ed index e35fe2c6..ad8f9af1 100644 Binary files a/bin/large/ed and b/bin/large/ed differ diff --git a/bin/large/init b/bin/large/init index 1b47e847..650ab5cf 100644 Binary files a/bin/large/init and b/bin/large/init differ diff --git a/bin/large/ls b/bin/large/ls index e22d1b12..5a8b4810 100644 Binary files a/bin/large/ls and b/bin/large/ls differ diff --git a/bin/large/mkdir b/bin/large/mkdir index f78e869f..98bb0418 100644 Binary files a/bin/large/mkdir and b/bin/large/mkdir differ diff --git a/bin/large/mkfs b/bin/large/mkfs index dbe86c95..9c4ebdff 100644 Binary files a/bin/large/mkfs and b/bin/large/mkfs differ diff --git a/bin/large/setclock b/bin/large/setclock index 6523833a..07abc157 100644 Binary files a/bin/large/setclock and b/bin/large/setclock differ diff --git a/bin/large/tr b/bin/large/tr index 35d2fdb6..b5e71100 100644 Binary files a/bin/large/tr and b/bin/large/tr differ diff --git a/bin/large/wnd b/bin/large/wnd new file mode 100644 index 00000000..74de59cf Binary files /dev/null and b/bin/large/wnd differ diff --git a/bin/man/cat1/basename.0 b/bin/man/cat1/basename.0 index 5bb79434..9ea11097 100644 --- a/bin/man/cat1/basename.0 +++ b/bin/man/cat1/basename.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/cal.0 b/bin/man/cat1/cal.0 index f884eb94..3dd533a8 100644 --- a/bin/man/cat1/cal.0 +++ b/bin/man/cat1/cal.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/cat.0 b/bin/man/cat1/cat.0 index 5d1b6dee..7cda2c4f 100644 --- a/bin/man/cat1/cat.0 +++ b/bin/man/cat1/cat.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/chmod.0 b/bin/man/cat1/chmod.0 index 4d728d5e..f0656d6c 100644 --- a/bin/man/cat1/chmod.0 +++ b/bin/man/cat1/chmod.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ SEE ALSO -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/chown.0 b/bin/man/cat1/chown.0 index 6a89b858..173ef79e 100644 --- a/bin/man/cat1/chown.0 +++ b/bin/man/cat1/chown.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/cmp.0 b/bin/man/cat1/cmp.0 index 3987acec..55aa388a 100644 --- a/bin/man/cat1/cmp.0 +++ b/bin/man/cat1/cmp.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/cp.0 b/bin/man/cat1/cp.0 index 0c3d61b4..70c39fff 100644 --- a/bin/man/cat1/cp.0 +++ b/bin/man/cat1/cp.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/date.0 b/bin/man/cat1/date.0 index 05af6e19..a765b0aa 100644 --- a/bin/man/cat1/date.0 +++ b/bin/man/cat1/date.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/dd.0 b/bin/man/cat1/dd.0 index 77834342..58f1ec15 100644 --- a/bin/man/cat1/dd.0 +++ b/bin/man/cat1/dd.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/diff.0 b/bin/man/cat1/diff.0 index fea1fafa..9ae67624 100644 --- a/bin/man/cat1/diff.0 +++ b/bin/man/cat1/diff.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/du.0 b/bin/man/cat1/du.0 index 8d257ef1..3c11fbd7 100644 --- a/bin/man/cat1/du.0 +++ b/bin/man/cat1/du.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/echo.0 b/bin/man/cat1/echo.0 index 1a85add2..3a70b009 100644 --- a/bin/man/cat1/echo.0 +++ b/bin/man/cat1/echo.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/ed.0 b/bin/man/cat1/ed.0 index 054482e6..821e29f9 100644 --- a/bin/man/cat1/ed.0 +++ b/bin/man/cat1/ed.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 3 +Printed 9/5/2003 3 @@ -258,7 +258,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 4 +Printed 9/5/2003 4 @@ -324,7 +324,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 5 +Printed 9/5/2003 5 @@ -390,7 +390,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 6 +Printed 9/5/2003 6 @@ -456,7 +456,7 @@ ED(1) UNIX Programmer's Manual ED(1) -Printed 6/3/2003 7 +Printed 9/5/2003 7 @@ -522,7 +522,7 @@ BUGS -Printed 6/3/2003 8 +Printed 9/5/2003 8 diff --git a/bin/man/cat1/expr.0 b/bin/man/cat1/expr.0 index 13e8a884..5234d8eb 100644 --- a/bin/man/cat1/expr.0 +++ b/bin/man/cat1/expr.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ DIAGNOSTICS -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/file.0 b/bin/man/cat1/file.0 index 002f8cd7..4e891118 100644 --- a/bin/man/cat1/file.0 +++ b/bin/man/cat1/file.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/find.0 b/bin/man/cat1/find.0 index 09e7b7c0..865a51b4 100644 --- a/bin/man/cat1/find.0 +++ b/bin/man/cat1/find.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/grep.0 b/bin/man/cat1/grep.0 index ea514ea3..c90824d1 100644 --- a/bin/man/cat1/grep.0 +++ b/bin/man/cat1/grep.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ SEE ALSO -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ BUGS -Printed 6/3/2003 3 +Printed 9/5/2003 3 diff --git a/bin/man/cat1/kill.0 b/bin/man/cat1/kill.0 index 29f5c582..3ea65200 100644 --- a/bin/man/cat1/kill.0 +++ b/bin/man/cat1/kill.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/ln.0 b/bin/man/cat1/ln.0 index eedb68f5..3551d8ce 100644 --- a/bin/man/cat1/ln.0 +++ b/bin/man/cat1/ln.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/login.0 b/bin/man/cat1/login.0 index aa8f1c8b..44f4d68c 100644 --- a/bin/man/cat1/login.0 +++ b/bin/man/cat1/login.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/ls.0 b/bin/man/cat1/ls.0 index 1d98ae3d..d86ef474 100644 --- a/bin/man/cat1/ls.0 +++ b/bin/man/cat1/ls.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ FILES -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/man.0 b/bin/man/cat1/man.0 index 42045991..9b8caec6 100644 --- a/bin/man/cat1/man.0 +++ b/bin/man/cat1/man.0 @@ -60,7 +60,7 @@ FILES -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/mkdir.0 b/bin/man/cat1/mkdir.0 index ecb8da86..c39e0335 100644 --- a/bin/man/cat1/mkdir.0 +++ b/bin/man/cat1/mkdir.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/mv.0 b/bin/man/cat1/mv.0 index 4130d6ad..ddfa6fc6 100644 --- a/bin/man/cat1/mv.0 +++ b/bin/man/cat1/mv.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/od.0 b/bin/man/cat1/od.0 index f28a1e89..97fe4496 100644 --- a/bin/man/cat1/od.0 +++ b/bin/man/cat1/od.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/passwd.0 b/bin/man/cat1/passwd.0 index b70f6cf5..6aa7cd42 100644 --- a/bin/man/cat1/passwd.0 +++ b/bin/man/cat1/passwd.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/pr.0 b/bin/man/cat1/pr.0 index bd1d4c3e..2bb99c68 100644 --- a/bin/man/cat1/pr.0 +++ b/bin/man/cat1/pr.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/ps.0 b/bin/man/cat1/ps.0 index e292a54d..fdaa3a5e 100644 --- a/bin/man/cat1/ps.0 +++ b/bin/man/cat1/ps.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 PDP11 1 +Printed 9/5/2003 PDP11 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 PDP11 2 +Printed 9/5/2003 PDP11 2 diff --git a/bin/man/cat1/pwd.0 b/bin/man/cat1/pwd.0 index ef4ab117..ad43a124 100644 --- a/bin/man/cat1/pwd.0 +++ b/bin/man/cat1/pwd.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/rm.0 b/bin/man/cat1/rm.0 index 7e33367f..c6d39260 100644 --- a/bin/man/cat1/rm.0 +++ b/bin/man/cat1/rm.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/roff.0 b/bin/man/cat1/roff.0 index 9b68a8b8..597d35c4 100644 --- a/bin/man/cat1/roff.0 +++ b/bin/man/cat1/roff.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ Request Break Initial Meaning -Printed 6/3/2003 3 +Printed 9/5/2003 3 @@ -258,7 +258,7 @@ ROFF(1) UNIX Programmer's Manual ROFF(1) -Printed 6/3/2003 4 +Printed 9/5/2003 4 diff --git a/bin/man/cat1/sh.0 b/bin/man/cat1/sh.0 index 12bbcdc5..98b494e3 100644 --- a/bin/man/cat1/sh.0 +++ b/bin/man/cat1/sh.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ SH(1) UNIX Programmer's Manual SH(1) -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ SH(1) UNIX Programmer's Manual SH(1) -Printed 6/3/2003 3 +Printed 9/5/2003 3 @@ -258,7 +258,7 @@ SEE ALSO -Printed 6/3/2003 4 +Printed 9/5/2003 4 diff --git a/bin/man/cat1/sort.0 b/bin/man/cat1/sort.0 index 44706214..bd636aaa 100644 --- a/bin/man/cat1/sort.0 +++ b/bin/man/cat1/sort.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ DIAGNOSTICS -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ BUGS -Printed 6/3/2003 3 +Printed 9/5/2003 3 diff --git a/bin/man/cat1/split.0 b/bin/man/cat1/split.0 index 22617442..dad3dd5c 100644 --- a/bin/man/cat1/split.0 +++ b/bin/man/cat1/split.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/su.0 b/bin/man/cat1/su.0 index 04ff02bb..b4cd3611 100644 --- a/bin/man/cat1/su.0 +++ b/bin/man/cat1/su.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/sum.0 b/bin/man/cat1/sum.0 index 75ea18fa..469ffd26 100644 --- a/bin/man/cat1/sum.0 +++ b/bin/man/cat1/sum.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/tail.0 b/bin/man/cat1/tail.0 index fbe0ab4a..9d8d33c9 100644 --- a/bin/man/cat1/tail.0 +++ b/bin/man/cat1/tail.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/tar.0 b/bin/man/cat1/tar.0 index 9309448e..c9b3a8e8 100644 --- a/bin/man/cat1/tar.0 +++ b/bin/man/cat1/tar.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ BUGS -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ TAR(1) UNIX Programmer's Manual TAR(1) -Printed 6/3/2003 3 +Printed 9/5/2003 3 diff --git a/bin/man/cat1/tee.0 b/bin/man/cat1/tee.0 index c00dab46..9dc59079 100644 --- a/bin/man/cat1/tee.0 +++ b/bin/man/cat1/tee.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/test.0 b/bin/man/cat1/test.0 index 1f39f6c7..0d25938c 100644 --- a/bin/man/cat1/test.0 +++ b/bin/man/cat1/test.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ SEE ALSO -Printed 6/3/2003 2 +Printed 9/5/2003 2 diff --git a/bin/man/cat1/time.0 b/bin/man/cat1/time.0 index 88c965b3..7d67e7b4 100644 --- a/bin/man/cat1/time.0 +++ b/bin/man/cat1/time.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/touch.0 b/bin/man/cat1/touch.0 index 63482903..8ce8cf51 100644 --- a/bin/man/cat1/touch.0 +++ b/bin/man/cat1/touch.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/tr.0 b/bin/man/cat1/tr.0 index 6a8db54c..ea7c3602 100644 --- a/bin/man/cat1/tr.0 +++ b/bin/man/cat1/tr.0 @@ -60,7 +60,7 @@ BUGS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/troff.0 b/bin/man/cat1/troff.0 index caa82c92..d5c042a3 100644 --- a/bin/man/cat1/troff.0 +++ b/bin/man/cat1/troff.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 @@ -126,7 +126,7 @@ SEE ALSO -Printed 6/3/2003 2 +Printed 9/5/2003 2 @@ -192,7 +192,7 @@ TROFF(1) UNIX Programmer's Manual TROFF(1) -Printed 6/3/2003 3 +Printed 9/5/2003 3 diff --git a/bin/man/cat1/true.0 b/bin/man/cat1/true.0 index ce58e060..a2cd6952 100644 --- a/bin/man/cat1/true.0 +++ b/bin/man/cat1/true.0 @@ -60,7 +60,7 @@ DIAGNOSTICS -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/uniq.0 b/bin/man/cat1/uniq.0 index 93c9b44b..580a879b 100644 --- a/bin/man/cat1/uniq.0 +++ b/bin/man/cat1/uniq.0 @@ -60,7 +60,7 @@ SEE ALSO -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/man/cat1/wc.0 b/bin/man/cat1/wc.0 index 26587f52..2c78c89f 100644 --- a/bin/man/cat1/wc.0 +++ b/bin/man/cat1/wc.0 @@ -60,7 +60,7 @@ DESCRIPTION -Printed 6/3/2003 1 +Printed 9/5/2003 1 diff --git a/bin/mkboot.bat b/bin/mkboot.bat new file mode 100644 index 00000000..a5ae3c22 --- /dev/null +++ b/bin/mkboot.bat @@ -0,0 +1,18 @@ +del uzidisk.dat +touch uzidisk.dat +@if errorlevel 1 goto failure +mkfs -l -q -v -y uzidisk.dat 1536 30 +@if errorlevel 1 goto failure +ucp < mkboot.ucp +@if errorlevel 1 goto failure +fsck -y uzidisk.dat +@if errorlevel 1 goto failure + +gzip --best < uzidisk.dat > uzboot.gz + +@echo SUCCESS +@goto done +:failure +@echo FAILURE +:done + diff --git a/bin/mkboot.ucp b/bin/mkboot.ucp new file mode 100644 index 00000000..f8c52ec1 --- /dev/null +++ b/bin/mkboot.ucp @@ -0,0 +1,130 @@ +root b: +cd / +mkdir bin +mkdir boot +mkdir dev +mkdir etc +mkdir home +mkdir lib +mkdir mnt +mkdir root +mkdir tmp +mkdir usr +mkdir var +cd /bin +bget banked\align align +chmod 755 align +align align +bget banked\cat cat +chmod 755 cat +align cat +bget banked\chgrp chgrp +chmod 755 chgrp +align chgrp +bget banked\chmod chmod +chmod 755 chmod +align chmod +bget banked\chown chown +chmod 755 chown +align chown +bget banked\cp cp +chmod 755 cp +align cp +bget banked\echo echo +chmod 755 echo +align echo +bget banked\fsck fsck +chmod 755 fsck +align fsck +bget banked\init init +chmod 755 init +align init +sln cp ln +bget banked\login login +chmod 755 login +align login +bget banked\ls ls +chmod 755 ls +align ls +bget banked\mkdir mkdir +chmod 755 mkdir +align mkdir +bget banked\more more +chmod 755 more +align more +bget banked\mount mount +chmod 755 mount +align mount +bget banked\msh msh +chmod 755 msh +align msh +sln cp mv +bget banked\reboot reboot +chmod 755 reboot +align reboot +sln cp rm +bget banked\rmdir rmdir +chmod 755 rmdir +align rmdir +sln msh sh +bget banked\ualign ualign +chmod 755 ualign +align ualign +bget banked\umount umount +chmod 755 umount +align umount +cd /boot +bget kernel.bin +align kernel.bin +cd /dev +umask 000 +mknod hd0 60666 0 0 +mknod hd1 60666 0 1 +mknod null 20666 1 0 +mknod zero 20666 2 0 +mknod kmem 20666 3 0 +mknod tty 20666 4 0 +mknod tty0 20666 4 1 +mknod tty1 20666 4 2 +mknod tty2 20666 4 3 +mknod tty3 20666 4 4 +mknod scale 20666 4 5 +mknod lcd0 20666 4 6 +mknod lcd1 20666 4 7 +mknod lpr0 20666 4 9 +umask 022 +sln tty0 cognitive +sln tty1 barcode +sln tty1 console +sln tty2 atmodem +sln tty3 apilan +sln lpr0 printer +cd /etc +get group.txt group +get passwd.txt passwd +get mtab.txt mtab +get fstab.txt fstab +get inittab.txt inittab +get profile.sh profile +mkdir rc.d +cd /etc/rc.d +get sysinit.rc rc.sysinit +chmod 755 rc.sysinit +get runonce.rc rc.runonce +chmod 755 rc.runonce +cd /home +mkdir downingn +chown 60 downingn +chgrp 100 downingn +mkdir morsinkj +chown 70 morsinkj +chgrp 100 morsinkj +mkdir buijsr +chown 80 buijsr +chgrp 100 buijsr +mkdir 90 +chown 11 90 +chgrp 101 90 +cd /lib +get liberror.txt +exit diff --git a/bin/mkramfs.sh b/bin/mkramfs.sh index 6d037695..f8e4ce23 100644 --- a/bin/mkramfs.sh +++ b/bin/mkramfs.sh @@ -5,9 +5,7 @@ cd /boot/skel mkfs -l -q -v -y /dev/hd0 1536 30 mount /dev/hd0 /mnt cp -r -v * /mnt -align -s -v /mnt/bin/* -cp -v /boot/kernel.bin /mnt/boot -align -v /mnt/boot/kernel.bin +align -s -v /mnt/bin/* /mnt/boot/kernel.bin umount /dev/hd0 reboot diff --git a/bin/mtab.txt b/bin/mtab.txt index de99268e..070565f9 100644 --- a/bin/mtab.txt +++ b/bin/mtab.txt @@ -1,2 +1 @@ /dev/hd0 / rw -/dev/hd1 /usr rw diff --git a/bin/n.bat b/bin/n.bat index 3d1b1373..e49fa4f4 100644 --- a/bin/n.bat +++ b/bin/n.bat @@ -1,15 +1,33 @@ +@rem the following should not be done here - call it manually when necessary +@rem call mkboot.bat + +@rem the following should be uncommented to use the new style bootstrap 'bomb' +copy/b uzboot.ldr + uzboot.gz uzboot.bin + +@rem the following should be uncommented to use the old style bootstrap script +@rem copy kernel.bin uzboot.bin + +md \nlddl +copy checksum.dat \nlddl +copy checksum.dat \nlddl\crc.dat +copy boot.bin \nlddl +copy uzboot.bin \nlddl\kernel.bin +set country=NLD +del \nlddl\checksum +crc +copy \nlddl\checksum . + del uzidisk.dat touch uzidisk.dat @if errorlevel 1 goto failure -rem mkfs -b -f -q -v -y uzidisk.dat 8192 163 -rem mkfs -l -f -q -v -y uzidisk.dat 8192 163 mkfs -f -q -v -y uzidisk.dat 8192 163 @if errorlevel 1 goto failure ucp < n.ucp @if errorlevel 1 goto failure fsck -y uzidisk.dat @if errorlevel 1 goto failure -copy uzidisk.dat e:\ +call appinst.bat +@rem copy uzidisk.dat e:\ @echo SUCCESS @goto done diff --git a/bin/n.ucp b/bin/n.ucp index 64650e74..213a1d2c 100644 --- a/bin/n.ucp +++ b/bin/n.ucp @@ -215,7 +215,11 @@ chmod 755 yes cd /boot get mkramfs.sh chmod 755 mkramfs.sh -bget kernel.bin +get newkrnl.sh +chmod 755 newkrnl.sh +get runonce.sh +chmod 755 runonce.sh +bget uzboot.bin kernel.bin bget boot.bin bget checksum ln checksum crc @@ -245,6 +249,10 @@ bget banked\chown chown chmod 755 chown bget banked\cp cp chmod 755 cp +bget banked\echo echo +chmod 755 echo +bget banked\fsck fsck +chmod 755 fsck bget banked\init init chmod 755 init sln cp ln @@ -272,23 +280,24 @@ chmod 755 ualign bget banked\umount umount chmod 755 umount cd /boot/skel/boot -get newkrnl.sh -chmod 755 newkrnl.sh +bget kernel.bin cd /boot/skel/dev +umask 000 mknod hd0 60666 0 0 mknod hd1 60666 0 1 -mknod null 20644 1 0 -mknod zero 20644 2 0 -mknod kmem 20644 3 0 -mknod tty 20644 4 0 -mknod tty0 20644 4 1 -mknod tty1 20644 4 2 -mknod tty2 20644 4 3 -mknod tty3 20644 4 4 -mknod scale 20644 4 5 -mknod lcd0 20644 4 6 -mknod lcd1 20644 4 7 -mknod lpr0 20644 4 9 +mknod null 20666 1 0 +mknod zero 20666 2 0 +mknod kmem 20666 3 0 +mknod tty 20666 4 0 +mknod tty0 20666 4 1 +mknod tty1 20666 4 2 +mknod tty2 20666 4 3 +mknod tty3 20666 4 4 +mknod scale 20666 4 5 +mknod lcd0 20666 4 6 +mknod lcd1 20666 4 7 +mknod lpr0 20666 4 9 +umask 022 sln tty0 cognitive sln tty1 barcode sln tty1 console @@ -297,25 +306,49 @@ sln tty3 apilan sln lpr0 printer cd /boot/skel/etc get group.txt group -get mtab.txt mtab get passwd.txt passwd +get mtab.txt mtab +get fstab.txt fstab +get inittab.txt inittab +get profile.sh profile +mkdir rc.d +cd /boot/skel/etc/rc.d +get sysinit.rc rc.sysinit +chmod 755 rc.sysinit +get runonce.rc rc.runonce +chmod 755 rc.runonce +cd /boot/skel/home +mkdir downingn +chown 60 downingn +chgrp 100 downingn +mkdir morsinkj +chown 70 morsinkj +chgrp 100 morsinkj +mkdir buijsr +chown 80 buijsr +chgrp 100 buijsr +mkdir 90 +chown 11 90 +chgrp 101 90 cd /boot/skel/lib get liberror.txt cd /dev +umask 000 mknod hd0 60666 0 0 mknod hd1 60666 0 1 -mknod null 20644 1 0 -mknod zero 20644 2 0 -mknod kmem 20644 3 0 -mknod tty 20644 4 0 -mknod tty0 20644 4 1 -mknod tty1 20644 4 2 -mknod tty2 20644 4 3 -mknod tty3 20644 4 4 -mknod scale 20644 4 5 -mknod lcd0 20644 4 6 -mknod lcd1 20644 4 7 -mknod lpr0 20644 4 9 +mknod null 20666 1 0 +mknod zero 20666 2 0 +mknod kmem 20666 3 0 +mknod tty 20666 4 0 +mknod tty0 20666 4 1 +mknod tty1 20666 4 2 +mknod tty2 20666 4 3 +mknod tty3 20666 4 4 +mknod scale 20666 4 5 +mknod lcd0 20666 4 6 +mknod lcd1 20666 4 7 +mknod lpr0 20666 4 9 +umask 022 sln tty0 cognitive sln tty1 barcode sln tty1 console @@ -324,13 +357,19 @@ sln tty3 apilan sln lpr0 printer cd /etc get group.txt group -get inittab.txt inittab get passwd.txt passwd +get xmtab.txt mtab +get xfstab.txt fstab +get xinittab.txt inittab cd /lib get liberror.txt get fortune.dat +mkdir font mkdir term mkdir tmac +cd /lib/font +bget font\lcd0.cmd lcd0.cmd +bget font\lcd1.cmd lcd1.cmd cd /lib/term bget term\tab37 tab37 cd /lib/tmac diff --git a/bin/newkrnl.sh b/bin/newkrnl.sh index af07773c..03dd4cb8 100644 --- a/bin/newkrnl.sh +++ b/bin/newkrnl.sh @@ -1,10 +1,8 @@ #!/bin/sh -# fixme: must be <= 256 bytes cd /boot -cp -v /usr/boot/kernel.bin kernel.tmp +cp -v /usr/boot/skel/boot/kernel.bin kernel.tmp align -v kernel.tmp mv -v kernel.tmp kernel.bin -cp -v /usr/boot/boot.bin /dev/hd0 reboot diff --git a/bin/padding.dat b/bin/padding.dat new file mode 100644 index 00000000..73f6f6e4 --- /dev/null +++ b/bin/padding.dat @@ -0,0 +1 @@ +ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª \ No newline at end of file diff --git a/bin/passwd.txt b/bin/passwd.txt index 44938c47..fd1accf6 100644 --- a/bin/passwd.txt +++ b/bin/passwd.txt @@ -1,2 +1,6 @@ root::0:0::/root: bin:!:1:1::/bin: +downingn:LbnMHnQ.K1gpi:60:100:Downing, Nicholas:/home/downingn:/bin/test +morsinkj:TbKUmao1jtbos:70:100:Morsink, Joost:/home/morsinkj:/bin/test +buijsr:0bkPMVw/Z4/sh:80:100:Buijs, Rob:/home/buijsr:/bin/test +90:IccdKbe10jjDC:11:101:Surname Firstname:/home/90:/bin/test diff --git a/bin/profile.sh b/bin/profile.sh new file mode 100644 index 00000000..f6858681 --- /dev/null +++ b/bin/profile.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +PS1='\u@\h:\w\# ' + +umask 022 + diff --git a/bin/runonce.rc b/bin/runonce.rc new file mode 100644 index 00000000..baa3cc1e --- /dev/null +++ b/bin/runonce.rc @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "/etc/rc.d/rc.runonce" +rm -v /etc/rc.d/rc.runonce +exec /usr/boot/runonce.sh + diff --git a/bin/runonce.sh b/bin/runonce.sh new file mode 100644 index 00000000..73906a5c --- /dev/null +++ b/bin/runonce.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +echo "" +echo "Installing LCD character sets" +echo "" + +cp -v /usr/lib/font/lcd0.cmd /dev/lcd0 +cp -v /usr/lib/font/lcd1.cmd /dev/lcd1 + +umask 022 +mkdir /wnd +exec /usr/boot/appinst.sh + diff --git a/bin/sysinit.rc b/bin/sysinit.rc new file mode 100644 index 00000000..06beea1c --- /dev/null +++ b/bin/sysinit.rc @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "/etc/rc.d/rc.sysinit" +fsck -y /dev/hd0 + diff --git a/bin/uzboot.bin b/bin/uzboot.bin new file mode 100644 index 00000000..4a3da4bb Binary files /dev/null and b/bin/uzboot.bin differ diff --git a/bin/uzboot.gz b/bin/uzboot.gz new file mode 100644 index 00000000..d98900b2 Binary files /dev/null and b/bin/uzboot.gz differ diff --git a/bin/uzboot.ldr b/bin/uzboot.ldr new file mode 100644 index 00000000..0447abf4 Binary files /dev/null and b/bin/uzboot.ldr differ diff --git a/bin/uzidisk.dat b/bin/uzidisk.dat index 4f291729..096a2192 100644 Binary files a/bin/uzidisk.dat and b/bin/uzidisk.dat differ diff --git a/bin/x.sh b/bin/x.sh deleted file mode 100644 index 07748085..00000000 --- a/bin/x.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/bin/xfstab.txt b/bin/xfstab.txt new file mode 100644 index 00000000..21be366e --- /dev/null +++ b/bin/xfstab.txt @@ -0,0 +1 @@ +/dev/hd1 / rw diff --git a/bin/xinittab.txt b/bin/xinittab.txt new file mode 100644 index 00000000..b2991151 --- /dev/null +++ b/bin/xinittab.txt @@ -0,0 +1,4 @@ +# Hytech initialisation table to format the RAM filesystem + +/boot/mkramfs.sh + diff --git a/bin/xmtab.txt b/bin/xmtab.txt new file mode 100644 index 00000000..21be366e --- /dev/null +++ b/bin/xmtab.txt @@ -0,0 +1 @@ +/dev/hd1 / rw diff --git a/doc/EXECPATH.TXT b/doc/EXECPATH.TXT new file mode 100644 index 00000000..0815f68d --- /dev/null +++ b/doc/EXECPATH.TXT @@ -0,0 +1,3 @@ +General block diagram +Want a summary for the execution path from clear memory to running +With module names, function names, source file names, variable names diff --git a/doc/gui/Gui driver.doc b/doc/gui/Gui driver.doc new file mode 100644 index 00000000..3e36ef1e Binary files /dev/null and b/doc/gui/Gui driver.doc differ diff --git a/doc/gui/Software design.doc b/doc/gui/Software design.doc new file mode 100644 index 00000000..1c86efa5 Binary files /dev/null and b/doc/gui/Software design.doc differ diff --git a/doc/gui/scr file format.doc b/doc/gui/scr file format.doc new file mode 100644 index 00000000..d48abea0 Binary files /dev/null and b/doc/gui/scr file format.doc differ diff --git a/doc/rfc/rfc1700.txt b/doc/rfc/rfc1700.txt new file mode 100644 index 00000000..1d1c0ab4 --- /dev/null +++ b/doc/rfc/rfc1700.txt @@ -0,0 +1,12884 @@ + + + + + +Network Working Group J. Reynolds +Request for Comments: 1700 J. Postel +STD: 2 ISI +Obsoletes RFCs: 1340, 1060, 1010, 990, 960, October 1994 +943, 923, 900, 870, 820, 790, 776, 770, +762, 758,755, 750, 739, 604, 503, 433, 349 +Obsoletes IENs: 127, 117, 93 +Category: Standards Track + + + ASSIGNED NUMBERS + +Status of this Memo + + This memo is a status report on the parameters (i.e., numbers and + keywords) used in protocols in the Internet community. Distribution + of this memo is unlimited. + +OVERVIEW + +This RFC is a snapshot of the ongoing process of the assignment of +protocol parameters for the Internet protocol suite. To make the +current information readily available the assignments are kept up-to- +date in a set of online text files. This RFC has been assembled by +catinating these files together with a minimum of formatting "glue". +The authors appologize for the somewhat rougher formatting and style +than is typical of most RFCs. + +We expect that various readers will notice specific items that should be +corrected. Please send any specific corrections via email to +. + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 1] + +RFC 1700 Assigned Numbers October 1994 + + +INTRODUCTION + +The files in this directory document the currently assigned values for +several series of numbers used in network protocol implementations. + + ftp://ftp.isi.edu/in-notes/iana/assignments + +The Internet Assigned Numbers Authority (IANA) is the central +coordinator for the assignment of unique parameter values for Internet +protocols. The IANA is chartered by the Internet Society (ISOC) and +the Federal Network Council (FNC) to act as the clearinghouse to +assign and coordinate the use of numerous Internet protocol +parameters. + +The Internet protocol suite, as defined by the Internet Engineering +Task Force (IETF) and its steering group (the IESG), contains numerous +parameters, such as internet addresses, domain names, autonomous +system numbers (used in some routing protocols), protocol numbers, +port numbers, management information base object identifiers, +including private enterprise numbers, and many others. + +The common use of the Internet protocols by the Internet community +requires that the particular values used in these parameter fields be +assigned uniquely. It is the task of the IANA to make those unique +assignments as requested and to maintain a registry of the currently +assigned values. + +Requests for parameter assignments (protocols, ports, etc.) should be +sent to . + +Requests for SNMP network management private enterprise number +assignments should be sent to . + +The IANA is located at and operated by the Information Sciences +Institute (ISI) of the University of Southern California (USC). + +If you are developing a protocol or application that will require the +use of a link, socket, port, protocol, etc., please contact the IANA +to receive a number assignment. + + Joyce K. Reynolds + Internet Assigned Numbers Authority + USC - Information Sciences Institute + 4676 Admiralty Way + Marina del Rey, California 90292-6695 + + Electronic mail: IANA@ISI.EDU + Phone: +1 310-822-1511 + + + +Reynolds & Postel [Page 2] + +RFC 1700 Assigned Numbers October 1994 + + +Most of the protocols are documented in the RFC series of notes. Some +of the items listed are undocumented. Further information on +protocols can be found in the memo, "Internet Official Protocol +Standards" (STD 1). + +Data Notations + +The convention in the documentation of Internet Protocols is to +express numbers in decimal and to picture data in "big-endian" order +[COHEN]. That is, fields are described left to right, with the most +significant octet on the left and the least significant octet on the +right. + +The order of transmission of the header and data described in this +document is resolved to the octet level. Whenever a diagram shows a +group of octets, the order of transmission of those octets is the +normal order in which they are read in English. For example, in the +following diagram the octets are transmitted in the order they are +numbered. + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 1 | 2 | 3 | 4 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 5 | 6 | 7 | 8 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 9 | 10 | 11 | 12 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Transmission Order of Bytes + +Whenever an octet represents a numeric quantity the left most bit in the +diagram is the high order or most significant bit. That is, the bit +labeled 0 is the most significant bit. For example, the following +diagram represents the value 170 (decimal). + + + 0 1 2 3 4 5 6 7 + +-+-+-+-+-+-+-+-+ + |1 0 1 0 1 0 1 0| + +-+-+-+-+-+-+-+-+ + + Significance of Bits + +Similarly, whenever a multi-octet field represents a numeric quantity +the left most bit of the whole field is the most significant bit. When + + + +Reynolds & Postel [Page 3] + +RFC 1700 Assigned Numbers October 1994 + + +a multi-octet quantity is transmitted the most significant octet is +transmitted first. + +Special Addresses + +There are five classes of IP addresses: Class A through Class E. Of +these, Classes A, B, and C are used for unicast addresses, Class D is +used for multicast addresses, and Class E addresses are reserved for +future use. + +With the advent of classless addressing [CIDR1, CIDR2], the +network-number part of an address may be of any length, and the whole +notion of address classes becomes less important. + +There are certain special cases for IP addresses. These special cases +can be concisely summarized using the earlier notation for an IP +address: + + IP-address ::= { , } + + or + + IP-address ::= { , , + } + +if we also use the notation "-1" to mean the field contains all 1 +bits. Some common special cases are as follows: + + (a) {0, 0} + + This host on this network. Can only be used as a source + address (see note later). + + (b) {0, } + + Specified host on this network. Can only be used as a + source address. + + (c) { -1, -1} + + Limited broadcast. Can only be used as a destination + address, and a datagram with this address must never be + forwarded outside the (sub-)net of the source. + + (d) {, -1} + + Directed broadcast to specified network. Can only be used + as a destination address. + + + +Reynolds & Postel [Page 4] + +RFC 1700 Assigned Numbers October 1994 + + + (e) {, , -1} + + Directed broadcast to specified subnet. Can only be used as + a destination address. + + (f) {, -1, -1} + + Directed broadcast to all subnets of specified subnetted + network. Can only be used as a destination address. + + (g) {127, } + + Internal host loopback address. Should never appear outside + a host. + + +REFERENCES + +[COHEN] Cohen, D., "On Holy Wars and a Plea for Peace", IEEE Computer + Magazine, October 1981. + +[CIDR1] Fuller, V., T. Li, J. Yu, and K. Varadhan, "Classless + Inter-Domain Routing (CIDR): an Address Assignment and + Aggregation Strategy", RFC 1519, September 1993. + +[CIDR2] Rekhter, Y., and T. Li, "An Architecture for IP Address + Allocation with CIDR", RFC 1518, September 1993. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/introduction + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 5] + +RFC 1700 Assigned Numbers October 1994 + + +VERSION NUMBERS + +In the Internet Protocol (IP) [RFC791] there is a field to identify +the version of the internetwork general protocol. This field is 4 +bits in size. + +Assigned Internet Version Numbers + +Decimal Keyword Version References +------- ------- ------- ---------- + 0 Reserved [JBP] + 1-3 Unassigned [JBP] + 4 IP Internet Protocol [RFC791,JBP] + 5 ST ST Datagram Mode [RFC1190,JWF] + 6 SIP Simple Internet Protocol [RH6] + 7 TP/IX TP/IX: The Next Internet [RXU] + 8 PIP The P Internet Protocol [PXF] + 9 TUBA TUBA [RXC] +10-14 Unassigned [JBP] + 15 Reserved [JBP] + +REFERENCES + +[RFC791] Postel, J., ed., "Internet Protocol - DARPA Internet Program + Protocol Specification", STD 5, RFC 791, USC/Information + Sciences Institute, September 1981. + +[RFC1190] Topolcic, C., Editor, "Experimental Internet Stream + Protocol, Version 2 (ST-II)", RFC 1190, CIP Working Group, + October 1990. + +PEOPLE + +[JPB] Jon Postel + +[JWF] Jim Forgie + +[RH6] Robert Hinden + +[RXU] Robert Ullmann + +[PXF] Paul Francis + +[RXC] Ross Callon + +[] + + + + + +Reynolds & Postel [Page 6] + +RFC 1700 Assigned Numbers October 1994 + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/version-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 7] + +RFC 1700 Assigned Numbers October 1994 + + +PROTOCOL NUMBERS + + +In the Internet Protocol (IP) [DDN], [RFC791] there is a field, called +Protocol, to identify the next level protocol. This is an 8 bit +field. + + +Assigned Internet Protocol Numbers + +Decimal Keyword Protocol References +------- ------- -------- ---------- + 0 Reserved [JBP] + 1 ICMP Internet Control Message [RFC792,JBP] + 2 IGMP Internet Group Management [RFC1112,JBP] + 3 GGP Gateway-to-Gateway [RFC823,MB] + 4 IP IP in IP (encasulation) [JBP] + 5 ST Stream [RFC1190,IEN119,JWF] + 6 TCP Transmission Control [RFC793,JBP] + 7 UCL UCL [PK] + 8 EGP Exterior Gateway Protocol [RFC888,DLM1] + 9 IGP any private interior gateway [JBP] + 10 BBN-RCC-MON BBN RCC Monitoring [SGC] + 11 NVP-II Network Voice Protocol [RFC741,SC3] + 12 PUP PUP [PUP,XEROX] + 13 ARGUS ARGUS [RWS4] + 14 EMCON EMCON [BN7] + 15 XNET Cross Net Debugger [IEN158,JFH2] + 16 CHAOS Chaos [NC3] + 17 UDP User Datagram [RFC768,JBP] + 18 MUX Multiplexing [IEN90,JBP] + 19 DCN-MEAS DCN Measurement Subsystems [DLM1] + 20 HMP Host Monitoring [RFC869,RH6] + 21 PRM Packet Radio Measurement [ZSU] + 22 XNS-IDP XEROX NS IDP [ETHERNET,XEROX] + 23 TRUNK-1 Trunk-1 [BWB6] + 24 TRUNK-2 Trunk-2 [BWB6] + 25 LEAF-1 Leaf-1 [BWB6] + 26 LEAF-2 Leaf-2 [BWB6] + 27 RDP Reliable Data Protocol [RFC908,RH6] + 28 IRTP Internet Reliable Transaction [RFC938,TXM] + 29 ISO-TP4 ISO Transport Protocol Class 4 [RFC905,RC77] + 30 NETBLT Bulk Data Transfer Protocol [RFC969,DDC1] + 31 MFE-NSP MFE Network Services Protocol [MFENET,BCH2] + 32 MERIT-INP MERIT Internodal Protocol [HWB] + 33 SEP Sequential Exchange Protocol [JC120] + 34 3PC Third Party Connect Protocol [SAF3] + 35 IDPR Inter-Domain Policy Routing Protocol [MXS1] + + + +Reynolds & Postel [Page 8] + +RFC 1700 Assigned Numbers October 1994 + + + 36 XTP XTP [GXC] + 37 DDP Datagram Delivery Protocol [WXC] + 38 IDPR-CMTP IDPR Control Message Transport Proto [MXS1] + 39 TP++ TP++ Transport Protocol [DXF] + 40 IL IL Transport Protocol [DXP2] + 41 SIP Simple Internet Protocol [SXD] + 42 SDRP Source Demand Routing Protocol [DXE1] + 43 SIP-SR SIP Source Route [SXD] + 44 SIP-FRAG SIP Fragment [SXD] + 45 IDRP Inter-Domain Routing Protocol [Sue Hares] + 46 RSVP Reservation Protocol [Bob Braden] + 47 GRE General Routing Encapsulation [Tony Li] + 48 MHRP Mobile Host Routing Protocol[David Johnson] + 49 BNA BNA [Gary Salamon] + 50 SIPP-ESP SIPP Encap Security Payload [Steve Deering] + 51 SIPP-AH SIPP Authentication Header [Steve Deering] + 52 I-NLSP Integrated Net Layer Security TUBA [GLENN] + 53 SWIPE IP with Encryption [JI6] + 54 NHRP NBMA Next Hop Resolution Protocol + 55-60 Unassigned [JBP] + 61 any host internal protocol [JBP] + 62 CFTP CFTP [CFTP,HCF2] + 63 any local network [JBP] + 64 SAT-EXPAK SATNET and Backroom EXPAK [SHB] + 65 KRYPTOLAN Kryptolan [PXL1] + 66 RVD MIT Remote Virtual Disk Protocol [MBG] + 67 IPPC Internet Pluribus Packet Core [SHB] + 68 any distributed file system [JBP] + 69 SAT-MON SATNET Monitoring [SHB] + 70 VISA VISA Protocol [GXT1] + 71 IPCV Internet Packet Core Utility [SHB] + 72 CPNX Computer Protocol Network Executive [DXM2] + 73 CPHB Computer Protocol Heart Beat [DXM2] + 74 WSN Wang Span Network [VXD] + 75 PVP Packet Video Protocol [SC3] + 76 BR-SAT-MON Backroom SATNET Monitoring [SHB] + 77 SUN-ND SUN ND PROTOCOL-Temporary [WM3] + 78 WB-MON WIDEBAND Monitoring [SHB] + 79 WB-EXPAK WIDEBAND EXPAK [SHB] + 80 ISO-IP ISO Internet Protocol [MTR] + 81 VMTP VMTP [DRC3] + 82 SECURE-VMTP SECURE-VMTP [DRC3] + 83 VINES VINES [BXH] + 84 TTP TTP [JXS] + 85 NSFNET-IGP NSFNET-IGP [HWB] + 86 DGP Dissimilar Gateway Protocol [DGP,ML109] + 87 TCF TCF [GAL5] + 88 IGRP IGRP [CISCO,GXS] + + + +Reynolds & Postel [Page 9] + +RFC 1700 Assigned Numbers October 1994 + + + 89 OSPFIGP OSPFIGP [RFC1583,JTM4] + 90 Sprite-RPC Sprite RPC Protocol [SPRITE,BXW] + 91 LARP Locus Address Resolution Protocol [BXH] + 92 MTP Multicast Transport Protocol [SXA] + 93 AX.25 AX.25 Frames [BK29] + 94 IPIP IP-within-IP Encapsulation Protocol [JI6] + 95 MICP Mobile Internetworking Control Pro. [JI6] + 96 SCC-SP Semaphore Communications Sec. Pro. [HXH] + 97 ETHERIP Ethernet-within-IP Encapsulation [RXH1] + 98 ENCAP Encapsulation Header [RFC1241,RXB3] + 99 any private encryption scheme [JBP] + 100 GMTP GMTP [RXB5] +101-254 Unassigned [JBP] + 255 Reserved [JBP] + + +REFERENCES + +[CFTP] Forsdick, H., "CFTP", Network Message, Bolt Beranek and + Newman, January 1982. + +[CISCO] Cisco Systems, "Gateway Server Reference Manual", Manual + Revision B, January 10, 1988. + +[DDN] Feinler, E., Editor, "DDN Protocol Handbook", Network + Information Center, SRI International, December 1985. + +[DGP] M/A-COM Government Systems, "Dissimilar Gateway Protocol + Specification, Draft Version", Contract no. CS901145, + November 16, 1987. + +[ETHERNET] "The Ethernet, A Local Area Network: Data Link Layer and + Physical Layer Specification", AA-K759B-TK, Digital + Equipment Corporation, Maynard, MA. Also as: "The + Ethernet - A Local Area Network", Version 1.0, Digital + Equipment Corporation, Intel Corporation, Xerox + Corporation, September 1980. And: "The Ethernet, A Local + Area Network: Data Link Layer and Physical Layer + Specifications", Digital, Intel and Xerox, November 1982. + And: XEROX, "The Ethernet, A Local Area Network: Data Link + Layer and Physical Layer Specification", X3T51/80-50, + Xerox Corporation, Stamford, CT., October 1980. + +[IEN90] Cohen, D. and J. Postel, "Multiplexing Protocol", IEN 90, + USC/Information Sciences Institute, May 1979. + +[IEN119] Forgie, J., "ST - A Proposed Internet Stream Protocol", + IEN 119, MIT Lincoln Laboratory, September 1979. + + + +Reynolds & Postel [Page 10] + +RFC 1700 Assigned Numbers October 1994 + + +[IEN158] Haverty, J., "XNET Formats for Internet Protocol Version 4", + IEN 158, October 1980. + +[MFENET] Shuttleworth, B., "A Documentary of MFENet, a National + Computer Network", UCRL-52317, Lawrence Livermore Labs, + Livermore, California, June 1977. + +[PUP] Boggs, D., J. Shoch, E. Taft, and R. Metcalfe, "PUP: An + Internetwork Architecture", XEROX Palo Alto Research Center, + CSL-79-10, July 1979; also in IEEE Transactions on + Communication, Volume COM-28, Number 4, April 1980. + +[SPRITE] Welch, B., "The Sprite Remote Procedure Call System", + Technical Report, UCB/Computer Science Dept., 86/302, + University of California at Berkeley, June 1986. + +[RFC741] Cohen, D., "Specifications for the Network Voice Protocol", + RFC 741, ISI/RR 7539, USC/Information Sciences Institute, + March 1976. + +[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, + USC/Information Sciences Institute, August 1980. + +[RFC791] Postel, J., "Internet Protocol - DARPA Internet Program + Protocol Specification", STD 5, RFC 791, DARPA, September + 1981. + +[RFC792] Postel, J., "Internet Control Message Protocol - DARPA + Internet Program Protocol Specification", STD 5, RFC 792, + USC/Information Sciences Institute, September 1981. + +[RFC793] Postel, J., "Transmission Control Protocol - DARPA + Internet Program Protocol Specification", STD 7, RFC 793, + USC/Information Sciences Institute, September 1981. + +[RFC823] Hinden, R., and A. Sheltzer, "The DARPA Internet Gateway", + RFC 823, BBN, September 1982. + +[RFC869] Hinden, R., "A Host Monitoring Protocol", RFC 869, + Bolt Beranek and Newman, December 1983. + +[RFC888] Seamonson, L., and E. Rosen, "STUB" Exterior Gateway + Protocol", RFC 888, BBN Communications Corporation, + January 1984. + +[RFC905] International Standards Organization, "ISO Transport Protocol + Specification - ISO DP 8073", RFC 905, April 1984. + + + + +Reynolds & Postel [Page 11] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC908] Velten, D., R. Hinden, and J. Sax, "Reliable Data Protocol", + RFC 908, BBN Communications Corporation, July 1984. + +[RFC938] Miller, T., "Internet Reliable Transaction Protocol", RFC 938, + ACC, February 1985. + +[RFC969] Clark, D., M. Lambert, and L. Zhang, "NETBLT: A Bulk Data + Transfer Protocol", RFC 969, MIT Laboratory for Computer + Science, December 1985. + +[RFC1112] Deering, S., "Host Extensions for IP Multicasting", + STD 5, RFC 1112, Stanford University, August 1989. + +[RFC1190] Topolcic, C., Editor, "Experimental Internet Stream + Protocol, Version 2 (ST-II)", RFC 1190, CIP Working Group, + October 1990. + +[RFC1241] Woodburn, W., and D. Mills, " A Scheme for an Internet + Encapsulation Protocol: Version 1", RFC 1241, SAIC, + University of Delaware, July 1991. + +[RFC1583] Moy, J., "The OSPF Specification", RFC 1583, Proteon, + March 1994. + + +PEOPLE + +[BCH2] Barry Howard + +[BK29] Brian Kantor + +[BN7] + +[BWB6] Barry Boehm + +[BXH] Brian Horn <---none---> + +[BXW] Bruce Willins <---none---> + +[DDC1] David Clark + +[DLM1] David Mills + +[DRC3] Dave Cheriton + +[DXE1] Deborah Estrin + +[DXF] Dirk Fromhein + + + +Reynolds & Postel [Page 12] + +RFC 1700 Assigned Numbers October 1994 + + +[DXM2] David Mittnacht <---none---> + +[DXP2] Dave Presotto + +[GAL5] Guillermo A. Loyola + +[GLENN] K. Robert Glenn + +[GXC] Greg Chesson + +[GXS] Guenther Schreiner + +[GXT1] Gene Tsudik + +[HCF2] Harry Forsdick + +[HWB] Hans-Werner Braun + +[HXH] Howard Hart + +[JBP] Jon Postel + +[JC120] + +[JFH2] Jack Haverty + +[JI6] John Ioannidis + +[JTM4] John Moy + +[JWF] Jim Forgie + +[JXS] Jim Stevens + +[KATZ] Dave Katz + +[MB] Mike Brescia + +[MBG] Michael Greenwald + +[ML109] Mike Little + +[MTR] Marshall T. Rose + +[MXS1] Martha Steenstrup + + + + +Reynolds & Postel [Page 13] + +RFC 1700 Assigned Numbers October 1994 + + +[NC3] J. Noel Chiappa + +[PK] Peter Kirstein + +[PXL1] Paul Liu <---none---> + +[RH6] Robert Hinden + +[RTB3] Bob Braden + +[RC77] + +[RWS4] Robert W. Scheifler + +[RXB3] Robert Woodburn + +[RXH1] Russ Housley + +[SAF3] Stuart A. Friedberg + +[SC3] Steve Casner + +[SHB] Steven Blumenthal + +[Sue Hares] Sue Hares + +[SXA] Susie Armstrong + +[SXD] Steve Deering + +[Tony Li] Tony Li + +[TXM] Trudy Miller + +[VXD] Victor Dafoulas <---none---> + +[WM3] William Melohn + +[WXC] Wesley Craig + +[ZSU] Zaw-Sing Su + + +[] + + + + + +Reynolds & Postel [Page 14] + +RFC 1700 Assigned Numbers October 1994 + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/protocol-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 15] + +RFC 1700 Assigned Numbers October 1994 + + + +WELL KNOWN PORT NUMBERS + +The Well Known Ports are controlled and assigned by the IANA and on +most systems can only be used by system (or root) processes or by +programs executed by privileged users. + +Ports are used in the TCP [RFC793] to name the ends of logical +connections which carry long term conversations. For the purpose of +providing services to unknown callers, a service contact port is +defined. This list specifies the port used by the server process as +its contact port. The contact port is sometimes called the +"well-known port". + +To the extent possible, these same port assignments are used with the +UDP [RFC768]. + +The assigned ports use a small portion of the possible port numbers. +For many years the assigned ports were in the range 0-255. Recently, +the range for assigned ports managed by the IANA has been expanded to +the range 0-1023. + +Port Assignments: + +Keyword Decimal Description References +------- ------- ----------- ---------- + 0/tcp Reserved + 0/udp Reserved +# Jon Postel +tcpmux 1/tcp TCP Port Service Multiplexer +tcpmux 1/udp TCP Port Service Multiplexer +# Mark Lottor +compressnet 2/tcp Management Utility +compressnet 2/udp Management Utility +compressnet 3/tcp Compression Process +compressnet 3/udp Compression Process +# Bernie Volz +# 4/tcp Unassigned +# 4/udp Unassigned +rje 5/tcp Remote Job Entry +rje 5/udp Remote Job Entry +# Jon Postel +# 6/tcp Unassigned +# 6/udp Unassigned +echo 7/tcp Echo +echo 7/udp Echo +# Jon Postel +# 8/tcp Unassigned + + + +Reynolds & Postel [Page 16] + +RFC 1700 Assigned Numbers October 1994 + + +# 8/udp Unassigned +discard 9/tcp Discard +discard 9/udp Discard +# Jon Postel +# 10/tcp Unassigned +# 10/udp Unassigned +systat 11/tcp Active Users +systat 11/udp Active Users +# Jon Postel +# 12/tcp Unassigned +# 12/udp Unassigned +daytime 13/tcp Daytime +daytime 13/udp Daytime +# Jon Postel +# 14/tcp Unassigned +# 14/udp Unassigned +# 15/tcp Unassigned [was netstat] +# 15/udp Unassigned +# 16/tcp Unassigned +# 16/udp Unassigned +qotd 17/tcp Quote of the Day +qotd 17/udp Quote of the Day +# Jon Postel +msp 18/tcp Message Send Protocol +msp 18/udp Message Send Protocol +# Rina Nethaniel <---none---> +chargen 19/tcp Character Generator +chargen 19/udp Character Generator +ftp-data 20/tcp File Transfer [Default Data] +ftp-data 20/udp File Transfer [Default Data] +ftp 21/tcp File Transfer [Control] +ftp 21/udp File Transfer [Control] +# Jon Postel +# 22/tcp Unassigned +# 22/udp Unassigned +telnet 23/tcp Telnet +telnet 23/udp Telnet +# Jon Postel + 24/tcp any private mail system + 24/udp any private mail system +# Rick Adam +smtp 25/tcp Simple Mail Transfer +smtp 25/udp Simple Mail Transfer +# Jon Postel +# 26/tcp Unassigned +# 26/udp Unassigned +nsw-fe 27/tcp NSW User System FE +nsw-fe 27/udp NSW User System FE + + + +Reynolds & Postel [Page 17] + +RFC 1700 Assigned Numbers October 1994 + + +# Robert Thomas +# 28/tcp Unassigned +# 28/udp Unassigned +msg-icp 29/tcp MSG ICP +msg-icp 29/udp MSG ICP +# Robert Thomas +# 30/tcp Unassigned +# 30/udp Unassigned +msg-auth 31/tcp MSG Authentication +msg-auth 31/udp MSG Authentication +# Robert Thomas +# 32/tcp Unassigned +# 32/udp Unassigned +dsp 33/tcp Display Support Protocol +dsp 33/udp Display Support Protocol +# Ed Cain +# 34/tcp Unassigned +# 34/udp Unassigned + 35/tcp any private printer server + 35/udp any private printer server +# Jon Postel +# 36/tcp Unassigned +# 36/udp Unassigned +time 37/tcp Time +time 37/udp Time +# Jon Postel +rap 38/tcp Route Access Protocol +rap 38/udp Route Access Protocol +# Robert Ullmann +rlp 39/tcp Resource Location Protocol +rlp 39/udp Resource Location Protocol +# Mike Accetta +# 40/tcp Unassigned +# 40/udp Unassigned +graphics 41/tcp Graphics +graphics 41/udp Graphics +nameserver 42/tcp Host Name Server +nameserver 42/udp Host Name Server +nicname 43/tcp Who Is +nicname 43/udp Who Is +mpm-flags 44/tcp MPM FLAGS Protocol +mpm-flags 44/udp MPM FLAGS Protocol +mpm 45/tcp Message Processing Module [recv] +mpm 45/udp Message Processing Module [recv] +mpm-snd 46/tcp MPM [default send] +mpm-snd 46/udp MPM [default send] +# Jon Postel +ni-ftp 47/tcp NI FTP + + + +Reynolds & Postel [Page 18] + +RFC 1700 Assigned Numbers October 1994 + + +ni-ftp 47/udp NI FTP +# Steve Kille +auditd 48/tcp Digital Audit Daemon +auditd 48/udp Digital Audit Daemon +# Larry Scott +login 49/tcp Login Host Protocol +login 49/udp Login Host Protocol +# Pieter Ditmars +re-mail-ck 50/tcp Remote Mail Checking Protocol +re-mail-ck 50/udp Remote Mail Checking Protocol +# Steve Dorner +la-maint 51/tcp IMP Logical Address Maintenance +la-maint 51/udp IMP Logical Address Maintenance +# Andy Malis +xns-time 52/tcp XNS Time Protocol +xns-time 52/udp XNS Time Protocol +# Susie Armstrong +domain 53/tcp Domain Name Server +domain 53/udp Domain Name Server +# Paul Mockapetris +xns-ch 54/tcp XNS Clearinghouse +xns-ch 54/udp XNS Clearinghouse +# Susie Armstrong +isi-gl 55/tcp ISI Graphics Language +isi-gl 55/udp ISI Graphics Language +xns-auth 56/tcp XNS Authentication +xns-auth 56/udp XNS Authentication +# Susie Armstrong + 57/tcp any private terminal access + 57/udp any private terminal access +# Jon Postel +xns-mail 58/tcp XNS Mail +xns-mail 58/udp XNS Mail +# Susie Armstrong + 59/tcp any private file service + 59/udp any private file service +# Jon Postel + 60/tcp Unassigned + 60/udp Unassigned +ni-mail 61/tcp NI MAIL +ni-mail 61/udp NI MAIL +# Steve Kille +acas 62/tcp ACA Services +acas 62/udp ACA Services +# E. Wald +# 63/tcp Unassigned +# 63/udp Unassigned +covia 64/tcp Communications Integrator (CI) + + + +Reynolds & Postel [Page 19] + +RFC 1700 Assigned Numbers October 1994 + + +covia 64/udp Communications Integrator (CI) +# "Tundra" Tim Daneliuk +# +tacacs-ds 65/tcp TACACS-Database Service +tacacs-ds 65/udp TACACS-Database Service +# Kathy Huber +sql*net 66/tcp Oracle SQL*NET +sql*net 66/udp Oracle SQL*NET +# Jack Haverty +bootps 67/tcp Bootstrap Protocol Server +bootps 67/udp Bootstrap Protocol Server +bootpc 68/tcp Bootstrap Protocol Client +bootpc 68/udp Bootstrap Protocol Client +# Bill Croft +tftp 69/tcp Trivial File Transfer +tftp 69/udp Trivial File Transfer +# David Clark +gopher 70/tcp Gopher +gopher 70/udp Gopher +# Mark McCahill +netrjs-1 71/tcp Remote Job Service +netrjs-1 71/udp Remote Job Service +netrjs-2 72/tcp Remote Job Service +netrjs-2 72/udp Remote Job Service +netrjs-3 73/tcp Remote Job Service +netrjs-3 73/udp Remote Job Service +netrjs-4 74/tcp Remote Job Service +netrjs-4 74/udp Remote Job Service +# Bob Braden + 75/tcp any private dial out service + 75/udp any private dial out service +# Jon Postel +deos 76/tcp Distributed External Object Store +deos 76/udp Distributed External Object Store +# Robert Ullmann + 77/tcp any private RJE service + 77/udp any private RJE service +# Jon Postel +vettcp 78/tcp vettcp +vettcp 78/udp vettcp +# Christopher Leong +finger 79/tcp Finger +finger 79/udp Finger +# David Zimmerman +www-http 80/tcp World Wide Web HTTP +www-http 80/udp World Wide Web HTTP +# Tim Berners-Lee +hosts2-ns 81/tcp HOSTS2 Name Server + + + +Reynolds & Postel [Page 20] + +RFC 1700 Assigned Numbers October 1994 + + +hosts2-ns 81/udp HOSTS2 Name Server +# Earl Killian +xfer 82/tcp XFER Utility +xfer 82/udp XFER Utility +# Thomas M. Smith +mit-ml-dev 83/tcp MIT ML Device +mit-ml-dev 83/udp MIT ML Device +# David Reed <--none---> +ctf 84/tcp Common Trace Facility +ctf 84/udp Common Trace Facility +# Hugh Thomas +mit-ml-dev 85/tcp MIT ML Device +mit-ml-dev 85/udp MIT ML Device +# David Reed <--none---> +mfcobol 86/tcp Micro Focus Cobol +mfcobol 86/udp Micro Focus Cobol +# Simon Edwards <--none---> + 87/tcp any private terminal link + 87/udp any private terminal link +# Jon Postel +kerberos 88/tcp Kerberos +kerberos 88/udp Kerberos +# B. Clifford Neuman +su-mit-tg 89/tcp SU/MIT Telnet Gateway +su-mit-tg 89/udp SU/MIT Telnet Gateway +# Mark Crispin +dnsix 90/tcp DNSIX Securit Attribute Token Map +dnsix 90/udp DNSIX Securit Attribute Token Map +# Charles Watt +mit-dov 91/tcp MIT Dover Spooler +mit-dov 91/udp MIT Dover Spooler +# Eliot Moss +npp 92/tcp Network Printing Protocol +npp 92/udp Network Printing Protocol +# Louis Mamakos +dcp 93/tcp Device Control Protocol +dcp 93/udp Device Control Protocol +# Daniel Tappan +objcall 94/tcp Tivoli Object Dispatcher +objcall 94/udp Tivoli Object Dispatcher +# Tom Bereiter <--none---> +supdup 95/tcp SUPDUP +supdup 95/udp SUPDUP +# Mark Crispin +dixie 96/tcp DIXIE Protocol Specification +dixie 96/udp DIXIE Protocol Specification +# Tim Howes +swift-rvf 97/tcp Swift Remote Vitural File Protocol + + + +Reynolds & Postel [Page 21] + +RFC 1700 Assigned Numbers October 1994 + + +swift-rvf 97/udp Swift Remote Vitural File Protocol +# Maurice R. Turcotte +# +tacnews 98/tcp TAC News +tacnews 98/udp TAC News +# Jon Postel +metagram 99/tcp Metagram Relay +metagram 99/udp Metagram Relay +# Geoff Goodfellow +newacct 100/tcp [unauthorized use] +hostname 101/tcp NIC Host Name Server +hostname 101/udp NIC Host Name Server +# Jon Postel +iso-tsap 102/tcp ISO-TSAP +iso-tsap 102/udp ISO-TSAP +# Marshall Rose +gppitnp 103/tcp Genesis Point-to-Point Trans Net +gppitnp 103/udp Genesis Point-to-Point Trans Net +acr-nema 104/tcp ACR-NEMA Digital Imag. & Comm. 300 +acr-nema 104/udp ACR-NEMA Digital Imag. & Comm. 300 +# Patrick McNamee <--none---> +csnet-ns 105/tcp Mailbox Name Nameserver +csnet-ns 105/udp Mailbox Name Nameserver +# Marvin Solomon +3com-tsmux 106/tcp 3COM-TSMUX +3com-tsmux 106/udp 3COM-TSMUX +# Jeremy Siegel +rtelnet 107/tcp Remote Telnet Service +rtelnet 107/udp Remote Telnet Service +# Jon Postel +snagas 108/tcp SNA Gateway Access Server +snagas 108/udp SNA Gateway Access Server +# Kevin Murphy +pop2 109/tcp Post Office Protocol - Version 2 +pop2 109/udp Post Office Protocol - Version 2 +# Joyce K. Reynolds +pop3 110/tcp Post Office Protocol - Version 3 +pop3 110/udp Post Office Protocol - Version 3 +# Marshall Rose +sunrpc 111/tcp SUN Remote Procedure Call +sunrpc 111/udp SUN Remote Procedure Call +# Chuck McManis +mcidas 112/tcp McIDAS Data Transmission Protocol +mcidas 112/udp McIDAS Data Transmission Protocol +# Glenn Davis +auth 113/tcp Authentication Service +auth 113/udp Authentication Service +# Mike St. Johns + + + +Reynolds & Postel [Page 22] + +RFC 1700 Assigned Numbers October 1994 + + +audionews 114/tcp Audio News Multicast +audionews 114/udp Audio News Multicast +# Martin Forssen +sftp 115/tcp Simple File Transfer Protocol +sftp 115/udp Simple File Transfer Protocol +# Mark Lottor +ansanotify 116/tcp ANSA REX Notify +ansanotify 116/udp ANSA REX Notify +# Nicola J. Howarth +uucp-path 117/tcp UUCP Path Service +uucp-path 117/udp UUCP Path Service +sqlserv 118/tcp SQL Services +sqlserv 118/udp SQL Services +# Larry Barnes +nntp 119/tcp Network News Transfer Protocol +nntp 119/udp Network News Transfer Protocol +# Phil Lapsley +cfdptkt 120/tcp CFDPTKT +cfdptkt 120/udp CFDPTKT +# John Ioannidis +erpc 121/tcp Encore Expedited Remote Pro.Call +erpc 121/udp Encore Expedited Remote Pro.Call +# Jack O'Neil <---none---> +smakynet 122/tcp SMAKYNET +smakynet 122/udp SMAKYNET +# Mike O'Dowd +ntp 123/tcp Network Time Protocol +ntp 123/udp Network Time Protocol +# Dave Mills +ansatrader 124/tcp ANSA REX Trader +ansatrader 124/udp ANSA REX Trader +# Nicola J. Howarth +locus-map 125/tcp Locus PC-Interface Net Map Ser +locus-map 125/udp Locus PC-Interface Net Map Ser +# Eric Peterson +unitary 126/tcp Unisys Unitary Login +unitary 126/udp Unisys Unitary Login +# +locus-con 127/tcp Locus PC-Interface Conn Server +locus-con 127/udp Locus PC-Interface Conn Server +# Eric Peterson +gss-xlicen 128/tcp GSS X License Verification +gss-xlicen 128/udp GSS X License Verification +# John Light +pwdgen 129/tcp Password Generator Protocol +pwdgen 129/udp Password Generator Protocol +# Frank J. Wacho +cisco-fna 130/tcp cisco FNATIVE + + + +Reynolds & Postel [Page 23] + +RFC 1700 Assigned Numbers October 1994 + + +cisco-fna 130/udp cisco FNATIVE +cisco-tna 131/tcp cisco TNATIVE +cisco-tna 131/udp cisco TNATIVE +cisco-sys 132/tcp cisco SYSMAINT +cisco-sys 132/udp cisco SYSMAINT +statsrv 133/tcp Statistics Service +statsrv 133/udp Statistics Service +# Dave Mills +ingres-net 134/tcp INGRES-NET Service +ingres-net 134/udp INGRES-NET Service +# Mike Berrow <---none---> +loc-srv 135/tcp Location Service +loc-srv 135/udp Location Service +# Joe Pato +profile 136/tcp PROFILE Naming System +profile 136/udp PROFILE Naming System +# Larry Peterson +netbios-ns 137/tcp NETBIOS Name Service +netbios-ns 137/udp NETBIOS Name Service +netbios-dgm 138/tcp NETBIOS Datagram Service +netbios-dgm 138/udp NETBIOS Datagram Service +netbios-ssn 139/tcp NETBIOS Session Service +netbios-ssn 139/udp NETBIOS Session Service +# Jon Postel +emfis-data 140/tcp EMFIS Data Service +emfis-data 140/udp EMFIS Data Service +emfis-cntl 141/tcp EMFIS Control Service +emfis-cntl 141/udp EMFIS Control Service +# Gerd Beling +bl-idm 142/tcp Britton-Lee IDM +bl-idm 142/udp Britton-Lee IDM +# Susie Snitzer <---none---> +imap2 143/tcp Interim Mail Access Protocol v2 +imap2 143/udp Interim Mail Access Protocol v2 +# Mark Crispin +news 144/tcp NewS +news 144/udp NewS +# James Gosling +uaac 145/tcp UAAC Protocol +uaac 145/udp UAAC Protocol +# David A. Gomberg +iso-tp0 146/tcp ISO-IP0 +iso-tp0 146/udp ISO-IP0 +iso-ip 147/tcp ISO-IP +iso-ip 147/udp ISO-IP +# Marshall Rose +cronus 148/tcp CRONUS-SUPPORT +cronus 148/udp CRONUS-SUPPORT + + + +Reynolds & Postel [Page 24] + +RFC 1700 Assigned Numbers October 1994 + + +# Jeffrey Buffun +aed-512 149/tcp AED 512 Emulation Service +aed-512 149/udp AED 512 Emulation Service +# Albert G. Broscius +sql-net 150/tcp SQL-NET +sql-net 150/udp SQL-NET +# Martin Picard <<---none---> +hems 151/tcp HEMS +hems 151/udp HEMS +# Christopher Tengi +bftp 152/tcp Background File Transfer Program +bftp 152/udp Background File Transfer Program +# Annette DeSchon +sgmp 153/tcp SGMP +sgmp 153/udp SGMP +# Marty Schoffstahl +netsc-prod 154/tcp NETSC +netsc-prod 154/udp NETSC +netsc-dev 155/tcp NETSC +netsc-dev 155/udp NETSC +# Sergio Heker +sqlsrv 156/tcp SQL Service +sqlsrv 156/udp SQL Service +# Craig Rogers +knet-cmp 157/tcp KNET/VM Command/Message Protocol +knet-cmp 157/udp KNET/VM Command/Message Protocol +# Gary S. Malkin +pcmail-srv 158/tcp PCMail Server +pcmail-srv 158/udp PCMail Server +# Mark L. Lambert +nss-routing 159/tcp NSS-Routing +nss-routing 159/udp NSS-Routing +# Yakov Rekhter +sgmp-traps 160/tcp SGMP-TRAPS +sgmp-traps 160/udp SGMP-TRAPS +# Marty Schoffstahl +snmp 161/tcp SNMP +snmp 161/udp SNMP +snmptrap 162/tcp SNMPTRAP +snmptrap 162/udp SNMPTRAP +# Marshall Rose +cmip-man 163/tcp CMIP/TCP Manager +cmip-man 163/udp CMIP/TCP Manager +cmip-agent 164/tcp CMIP/TCP Agent +smip-agent 164/udp CMIP/TCP Agent +# Amatzia Ben-Artzi <---none---> +xns-courier 165/tcp Xerox +xns-courier 165/udp Xerox + + + +Reynolds & Postel [Page 25] + +RFC 1700 Assigned Numbers October 1994 + + +# Susie Armstrong +s-net 166/tcp Sirius Systems +s-net 166/udp Sirius Systems +# Brian Lloyd <---none---> +namp 167/tcp NAMP +namp 167/udp NAMP +# Marty Schoffstahl +rsvd 168/tcp RSVD +rsvd 168/udp RSVD +# Neil Todd +send 169/tcp SEND +send 169/udp SEND +# William D. Wisner +print-srv 170/tcp Network PostScript +print-srv 170/udp Network PostScript +# Brian Reid +multiplex 171/tcp Network Innovations Multiplex +multiplex 171/udp Network Innovations Multiplex +cl/1 172/tcp Network Innovations CL/1 +cl/1 172/udp Network Innovations CL/1 +# Kevin DeVault <<---none---> +xyplex-mux 173/tcp Xyplex +xyplex-mux 173/udp Xyplex +# Bob Stewart +mailq 174/tcp MAILQ +mailq 174/udp MAILQ +# Rayan Zachariassen +vmnet 175/tcp VMNET +vmnet 175/udp VMNET +# Christopher Tengi +genrad-mux 176/tcp GENRAD-MUX +genrad-mux 176/udp GENRAD-MUX +# Ron Thornton +xdmcp 177/tcp X Display Manager Control Protocol +xdmcp 177/udp X Display Manager Control Protocol +# Robert W. Scheifler +nextstep 178/tcp NextStep Window Server +NextStep 178/udp NextStep Window Server +# Leo Hourvitz +bgp 179/tcp Border Gateway Protocol +bgp 179/udp Border Gateway Protocol +# Kirk Lougheed +ris 180/tcp Intergraph +ris 180/udp Intergraph +# Dave Buehmann +unify 181/tcp Unify +unify 181/udp Unify +# Vinod Singh <--none---> + + + +Reynolds & Postel [Page 26] + +RFC 1700 Assigned Numbers October 1994 + + +audit 182/tcp Unisys Audit SITP +audit 182/udp Unisys Audit SITP +# Gil Greenbaum +ocbinder 183/tcp OCBinder +ocbinder 183/udp OCBinder +ocserver 184/tcp OCServer +ocserver 184/udp OCServer +# Jerrilynn Okamura <--none---> +remote-kis 185/tcp Remote-KIS +remote-kis 185/udp Remote-KIS +kis 186/tcp KIS Protocol +kis 186/udp KIS Protocol +# Ralph Droms +aci 187/tcp Application Communication Interface +aci 187/udp Application Communication Interface +# Rick Carlos +mumps 188/tcp Plus Five's MUMPS +mumps 188/udp Plus Five's MUMPS +# Hokey Stenn +qft 189/tcp Queued File Transport +qft 189/udp Queued File Transport +# Wayne Schroeder +gacp 190/tcp Gateway Access Control Protocol +cacp 190/udp Gateway Access Control Protocol +# C. Philip Wood +prospero 191/tcp Prospero Directory Service +prospero 191/udp Prospero Directory Service +# B. Clifford Neuman +osu-nms 192/tcp OSU Network Monitoring System +osu-nms 192/udp OSU Network Monitoring System +# Doug Karl +srmp 193/tcp Spider Remote Monitoring Protocol +srmp 193/udp Spider Remote Monitoring Protocol +# Ted J. Socolofsky +irc 194/tcp Internet Relay Chat Protocol +irc 194/udp Internet Relay Chat Protocol +# Jarkko Oikarinen +dn6-nlm-aud 195/tcp DNSIX Network Level Module Audit +dn6-nlm-aud 195/udp DNSIX Network Level Module Audit +dn6-smm-red 196/tcp DNSIX Session Mgt Module Audit Redir +dn6-smm-red 196/udp DNSIX Session Mgt Module Audit Redir +# Lawrence Lebahn +dls 197/tcp Directory Location Service +dls 197/udp Directory Location Service +dls-mon 198/tcp Directory Location Service Monitor +dls-mon 198/udp Directory Location Service Monitor +# Scott Bellew +smux 199/tcp SMUX + + + +Reynolds & Postel [Page 27] + +RFC 1700 Assigned Numbers October 1994 + + +smux 199/udp SMUX +# Marshall Rose +src 200/tcp IBM System Resource Controller +src 200/udp IBM System Resource Controller +# Gerald McBrearty <---none---> +at-rtmp 201/tcp AppleTalk Routing Maintenance +at-rtmp 201/udp AppleTalk Routing Maintenance +at-nbp 202/tcp AppleTalk Name Binding +at-nbp 202/udp AppleTalk Name Binding +at-3 203/tcp AppleTalk Unused +at-3 203/udp AppleTalk Unused +at-echo 204/tcp AppleTalk Echo +at-echo 204/udp AppleTalk Echo +at-5 205/tcp AppleTalk Unused +at-5 205/udp AppleTalk Unused +at-zis 206/tcp AppleTalk Zone Information +at-zis 206/udp AppleTalk Zone Information +at-7 207/tcp AppleTalk Unused +at-7 207/udp AppleTalk Unused +at-8 208/tcp AppleTalk Unused +at-8 208/udp AppleTalk Unused +# Rob Chandhok +tam 209/tcp Trivial Authenticated Mail Protocol +tam 209/udp Trivial Authenticated Mail Protocol +# Dan Bernstein +z39.50 210/tcp ANSI Z39.50 +z39.50 210/udp ANSI Z39.50 +# Mark Needleman +# +914c/g 211/tcp Texas Instruments 914C/G Terminal +914c/g 211/udp Texas Instruments 914C/G Terminal +# Bill Harrell <---none---> +anet 212/tcp ATEXSSTR +anet 212/udp ATEXSSTR +# Jim Taylor +ipx 213/tcp IPX +ipx 213/udp IPX +# Don Provan +vmpwscs 214/tcp VM PWSCS +vmpwscs 214/udp VM PWSCS +# Dan Shia +softpc 215/tcp Insignia Solutions +softpc 215/udp Insignia Solutions +# Martyn Thomas <---none---> +atls 216/tcp Access Technology License Server +atls 216/udp Access Technology License Server +# Larry DeLuca +dbase 217/tcp dBASE Unix + + + +Reynolds & Postel [Page 28] + +RFC 1700 Assigned Numbers October 1994 + + +dbase 217/udp dBASE Unix +# Don Gibson +# +mpp 218/tcp Netix Message Posting Protocol +mpp 218/udp Netix Message Posting Protocol +# Shannon Yeh +uarps 219/tcp Unisys ARPs +uarps 219/udp Unisys ARPs +# Ashok Marwaha <---none---> +imap3 220/tcp Interactive Mail Access Protocol v3 +imap3 220/udp Interactive Mail Access Protocol v3 +# James Rice +fln-spx 221/tcp Berkeley rlogind with SPX auth +fln-spx 221/udp Berkeley rlogind with SPX auth +rsh-spx 222/tcp Berkeley rshd with SPX auth +rsh-spx 222/udp Berkeley rshd with SPX auth +cdc 223/tcp Certificate Distribution Center +cdc 223/udp Certificate Distribution Center +# Kannan Alagappan +# 224-241 Reserved +# Jon Postel +# 242/tcp Unassigned +# 242/udp Unassigned +sur-meas 243/tcp Survey Measurement +sur-meas 243/udp Survey Measurement +# Dave Clark +# 244/tcp Unassigned +# 244/udp Unassigned +link 245/tcp LINK +link 245/udp LINK +dsp3270 246/tcp Display Systems Protocol +dsp3270 246/udp Display Systems Protocol +# Weldon J. Showalter +# 247-255 Reserved +# Jon Postel +# 256-343 Unassigned +pdap 344/tcp Prospero Data Access Protocol +pdap 344/udp Prospero Data Access Protocol +# B. Clifford Neuman +pawserv 345/tcp Perf Analysis Workbench +pawserv 345/udp Perf Analysis Workbench +zserv 346/tcp Zebra server +zserv 346/udp Zebra server +fatserv 347/tcp Fatmen Server +fatserv 347/udp Fatmen Server +csi-sgwp 348/tcp Cabletron Management Protocol +csi-sgwp 348/udp Cabletron Management Protocol +# 349-370 Unassigned + + + +Reynolds & Postel [Page 29] + +RFC 1700 Assigned Numbers October 1994 + + +clearcase 371/tcp Clearcase +clearcase 371/udp Clearcase +# Dave LeBlang +ulistserv 372/tcp Unix Listserv +ulistserv 372/udp Unix Listserv +# Anastasios Kotsikonas +legent-1 373/tcp Legent Corporation +legent-1 373/udp Legent Corporation +legent-2 374/tcp Legent Corporation +legent-2 374/udp Legent Corporation +# Keith Boyce <---none---> +hassle 375/tcp Hassle +hassle 375/udp Hassle +# Reinhard Doelz +nip 376/tcp Amiga Envoy Network Inquiry Proto +nip 376/udp Amiga Envoy Network Inquiry Proto +# Kenneth Dyke +tnETOS 377/tcp NEC Corporation +tnETOS 377/udp NEC Corporation +dsETOS 378/tcp NEC Corporation +dsETOS 378/udp NEC Corporation +# Tomoo Fujita +is99c 379/tcp TIA/EIA/IS-99 modem client +is99c 379/udp TIA/EIA/IS-99 modem client +is99s 380/tcp TIA/EIA/IS-99 modem server +is99s 380/udp TIA/EIA/IS-99 modem server +# Frank Quick +hp-collector 381/tcp hp performance data collector +hp-collector 381/udp hp performance data collector +hp-managed-node 382/tcp hp performance data managed node +hp-managed-node 382/udp hp performance data managed node +hp-alarm-mgr 383/tcp hp performance data alarm manager +hp-alarm-mgr 383/udp hp performance data alarm manager +# Frank Blakely +arns 384/tcp A Remote Network Server System +arns 384/udp A Remote Network Server System +# David Hornsby +ibm-app 385/tcp IBM Application +ibm-app 385/tcp IBM Application +# Lisa Tomita <---none---> +asa 386/tcp ASA Message Router Object Def. +asa 386/udp ASA Message Router Object Def. +# Steve Laitinen +aurp 387/tcp Appletalk Update-Based Routing Pro. +aurp 387/udp Appletalk Update-Based Routing Pro. +# Chris Ranch +unidata-ldm 388/tcp Unidata LDM Version 4 +unidata-ldm 388/udp Unidata LDM Version 4 + + + +Reynolds & Postel [Page 30] + +RFC 1700 Assigned Numbers October 1994 + + +# Glenn Davis +ldap 389/tcp Lightweight Directory Access Protocol +ldap 389/udp Lightweight Directory Access Protocol +# Tim Howes +uis 390/tcp UIS +uis 390/udp UIS +# Ed Barron <---none---> +synotics-relay 391/tcp SynOptics SNMP Relay Port +synotics-relay 391/udp SynOptics SNMP Relay Port +synotics-broker 392/tcp SynOptics Port Broker Port +synotics-broker 392/udp SynOptics Port Broker Port +# Illan Raab +dis 393/tcp Data Interpretation System +dis 393/udp Data Interpretation System +# Paul Stevens +embl-ndt 394/tcp EMBL Nucleic Data Transfer +embl-ndt 394/udp EMBL Nucleic Data Transfer +# Peter Gad +netcp 395/tcp NETscout Control Protocol +netcp 395/udp NETscout Control Protocol +# Anil Singhal <---none---> +netware-ip 396/tcp Novell Netware over IP +netware-ip 396/udp Novell Netware over IP +mptn 397/tcp Multi Protocol Trans. Net. +mptn 397/udp Multi Protocol Trans. Net. +# Soumitra Sarkar +kryptolan 398/tcp Kryptolan +kryptolan 398/udp Kryptolan +# Peter de Laval +# 399/tcp Unassigned +# 399/udp Unassigned +work-sol 400/tcp Workstation Solutions +work-sol 400/udp Workstation Solutions +# Jim Ward +ups 401/tcp Uninterruptible Power Supply +ups 401/udp Uninterruptible Power Supply +# Guenther Seybold +genie 402/tcp Genie Protocol +genie 402/udp Genie Protocol +# Mark Hankin <---none---> +decap 403/tcp decap +decap 403/udp decap +nced 404/tcp nced +nced 404/udp nced +ncld 405/tcp ncld +ncld 405/udp ncld +# Richard Jones <---none---> +imsp 406/tcp Interactive Mail Support Protocol + + + +Reynolds & Postel [Page 31] + +RFC 1700 Assigned Numbers October 1994 + + +imsp 406/udp Interactive Mail Support Protocol +# John Myers +timbuktu 407/tcp Timbuktu +timbuktu 407/udp Timbuktu +# Marc Epard +prm-sm 408/tcp Prospero Resource Manager Sys. Man. +prm-sm 408/udp Prospero Resource Manager Sys. Man. +prm-nm 409/tcp Prospero Resource Manager Node Man. +prm-nm 409/udp Prospero Resource Manager Node Man. +# B. Clifford Neuman +decladebug 410/tcp DECLadebug Remote Debug Protocol +decladebug 410/udp DECLadebug Remote Debug Protocol +# Anthony Berent +rmt 411/tcp Remote MT Protocol +rmt 411/udp Remote MT Protocol +# Peter Eriksson +synoptics-trap 412/tcp Trap Convention Port +synoptics-trap 412/udp Trap Convention Port +# Illan Raab +smsp 413/tcp SMSP +smsp 413/udp SMSP +infoseek 414/tcp InfoSeek +infoseek 414/udp InfoSeek +# Steve Kirsch +bnet 415/tcp BNet +bnet 415/udp BNet +# Jim Mertz +silverplatter 416/tcp Silverplatter +silverplatter 416/udp Silverplatter +# Peter Ciuffetti +onmux 417/tcp Onmux +onmux 417/udp Onmux +# Stephen Hanna +hyper-g 418/tcp Hyper-G +hyper-g 418/udp Hyper-G +# Frank Kappe +ariel1 419/tcp Ariel +ariel1 419/udp Ariel +# Jonathan Lavigne +smpte 420/tcp SMPTE +smpte 420/udp SMPTE +# Si Becker <71362.22@CompuServe.COM> +ariel2 421/tcp Ariel +ariel2 421/udp Ariel +ariel3 422/tcp Ariel +ariel3 422/udp Ariel +# Jonathan Lavigne +opc-job-start 423/tcp IBM Operations Planning and Control Start + + + +Reynolds & Postel [Page 32] + +RFC 1700 Assigned Numbers October 1994 + + +opc-job-start 423/udp IBM Operations Planning and Control Start +opc-job-track 424/tcp IBM Operations Planning and Control Track +opc-job-track 424/udp IBM Operations Planning and Control Track +# Conny Larsson +icad-el 425/tcp ICAD +icad-el 425/udp ICAD +# Larry Stone +smartsdp 426/tcp smartsdp +smartsdp 426/udp smartsdp +# Alexander Dupuy +svrloc 427/tcp Server Location +svrloc 427/udp Server Location +# +ocs_cmu 428/tcp OCS_CMU +ocs_cmu 428/udp OCS_CMU +ocs_amu 429/tcp OCS_AMU +ocs_amu 429/udp OCS_AMU +# Florence Wyman +utmpsd 430/tcp UTMPSD +utmpsd 430/udp UTMPSD +utmpcd 431/tcp UTMPCD +utmpcd 431/udp UTMPCD +iasd 432/tcp IASD +iasd 432/udp IASD +# Nir Baroz +nnsp 433/tcp NNSP +nnsp 433/udp NNSP +# Rob Robertson +mobileip-agent 434/tcp MobileIP-Agent +mobileip-agent 434/udp MobileIP-Agent +mobilip-mn 435/tcp MobilIP-MN +mobilip-mn 435/udp MobilIP-MN +# Kannan Alagappan +dna-cml 436/tcp DNA-CML +dna-cml 436/udp DNA-CML +# Dan Flowers +comscm 437/tcp comscm +comscm 437/udp comscm +# Jim Teague +dsfgw 438/tcp dsfgw +dsfgw 438/udp dsfgw +# Andy McKeen +dasp 439/tcp dasp Thomas Obermair +dasp 439/udp dasp tommy@inlab.m.eunet.de +# Thomas Obermair +sgcp 440/tcp sgcp +sgcp 440/udp sgcp +# Marshall Rose + + + +Reynolds & Postel [Page 33] + +RFC 1700 Assigned Numbers October 1994 + + +decvms-sysmgt 441/tcp decvms-sysmgt +decvms-sysmgt 441/udp decvms-sysmgt +# Lee Barton +cvc_hostd 442/tcp cvc_hostd +cvc_hostd 442/udp cvc_hostd +# Bill Davidson +https 443/tcp https MCom +https 443/udp https MCom +# Kipp E.B. Hickman +snpp 444/tcp Simple Network Paging Protocol +snpp 444/udp Simple Network Paging Protocol +# [RFC1568] +microsoft-ds 445/tcp Microsoft-DS +microsoft-ds 445/udp Microsoft-DS +# Arnold Miller +ddm-rdb 446/tcp DDM-RDB +ddm-rdb 446/udp DDM-RDB +ddm-dfm 447/tcp DDM-RFM +ddm-dfm 447/udp DDM-RFM +ddm-byte 448/tcp DDM-BYTE +ddm-byte 448/udp DDM-BYTE +# Jan David Fisher +as-servermap 449/tcp AS Server Mapper +as-servermap 449/udp AS Server Mapper +# Barbara Foss +tserver 450/tcp TServer +tserver 450/udp TServer +# Harvey S. Schultz +# 451-511 Unassigned +exec 512/tcp remote process execution; +# authentication performed using +# passwords and UNIX loppgin names +biff 512/udp used by mail system to notify users +# of new mail received; currently +# receives messages only from +# processes on the same machine +login 513/tcp remote login a la telnet; +# automatic authentication performed +# based on priviledged port numbers +# and distributed data bases which +# identify "authentication domains" +who 513/udp maintains data bases showing who's +# logged in to machines on a local +# net and the load average of the +# machine +cmd 514/tcp like exec, but automatic +# authentication is performed as for +# login server + + + +Reynolds & Postel [Page 34] + +RFC 1700 Assigned Numbers October 1994 + + +syslog 514/udp +printer 515/tcp spooler +printer 515/udp spooler +# 516/tcp Unassigned +# 516/udp Unassigned +talk 517/tcp like tenex link, but across +# machine - unfortunately, doesn't +# use link protocol (this is actually +# just a rendezvous port from which a +# tcp connection is established) +talk 517/udp like tenex link, but across +# machine - unfortunately, doesn't +# use link protocol (this is actually +# just a rendezvous port from which a + tcp connection is established) +ntalk 518/tcp +ntalk 518/udp +utime 519/tcp unixtime +utime 519/udp unixtime +efs 520/tcp extended file name server +router 520/udp local routing process (on site); +# uses variant of Xerox NS routing +# information protocol +# 521-524 Unassigned +timed 525/tcp timeserver +timed 525/udp timeserver +tempo 526/tcp newdate +tempo 526/udp newdate +# 527-529 Unassigned +courier 530/tcp rpc +courier 530/udp rpc +conference 531/tcp chat +conference 531/udp chat +netnews 532/tcp readnews +netnews 532/udp readnews +netwall 533/tcp for emergency broadcasts +netwall 533/udp for emergency broadcasts +# 534-538 Unassigned +apertus-ldp 539/tcp Apertus Technologies Load Determination +apertus-ldp 539/udp Apertus Technologies Load Determination +uucp 540/tcp uucpd +uucp 540/udp uucpd +uucp-rlogin 541/tcp uucp-rlogin Stuart Lynne +uucp-rlogin 541/udp uucp-rlogin sl@wimsey.com +# 542/tcp Unassigned +# 542/udp Unassigned +klogin 543/tcp +klogin 543/udp + + + +Reynolds & Postel [Page 35] + +RFC 1700 Assigned Numbers October 1994 + + +kshell 544/tcp krcmd +kshell 544/udp krcmd +# 545-549 Unassigned +new-rwho 550/tcp new-who +new-rwho 550/udp new-who +# 551-555 Unassigned +dsf 555/tcp +dsf 555/udp +remotefs 556/tcp rfs server +remotefs 556/udp rfs server +# 557-559 Unassigned +rmonitor 560/tcp rmonitord +rmonitor 560/udp rmonitord +monitor 561/tcp +monitor 561/udp +chshell 562/tcp chcmd +chshell 562/udp chcmd +# 563/tcp Unassigned +# 563/udp Unassigned +9pfs 564/tcp plan 9 file service +9pfs 564/udp plan 9 file service +whoami 565/tcp whoami +whoami 565/udp whoami +# 566-569 Unassigned +meter 570/tcp demon +meter 570/udp demon +meter 571/tcp udemon +meter 571/udp udemon +# 572-599 Unassigned +ipcserver 600/tcp Sun IPC server +ipcserver 600/udp Sun IPC server +nqs 607/tcp nqs +nqs 607/udp nqs +urm 606/tcp Cray Unified Resource Manager +urm 606/udp Cray Unified Resource Manager +# Bill Schiefelbein +sift-uft 608/tcp Sender-Initiated/Unsolicited File Transfer +sift-uft 608/udp Sender-Initiated/Unsolicited File Transfer +# Rick Troth +npmp-trap 609/tcp npmp-trap +npmp-trap 609/udp npmp-trap +npmp-local 610/tcp npmp-local +npmp-local 610/udp npmp-local +npmp-gui 611/tcp npmp-gui +npmp-gui 611/udp npmp-gui +# John Barnes +ginad 634/tcp ginad +ginad 634/udp ginad + + + +Reynolds & Postel [Page 36] + +RFC 1700 Assigned Numbers October 1994 + + +# Mark Crother +mdqs 666/tcp +mdqs 666/udp +doom 666/tcp doom Id Software +doom 666/tcp doom Id Software +# +elcsd 704/tcp errlog copy/server daemon +elcsd 704/udp errlog copy/server daemon + +entrustmanager 709/tcp EntrustManager +entrustmanager 709/udp EntrustManager +# Peter Whittaker +netviewdm1 729/tcp IBM NetView DM/6000 Server/Client +netviewdm1 729/udp IBM NetView DM/6000 Server/Client +netviewdm2 730/tcp IBM NetView DM/6000 send/tcp +netviewdm2 730/udp IBM NetView DM/6000 send/tcp +netviewdm3 731/tcp IBM NetView DM/6000 receive/tcp +netviewdm3 731/udp IBM NetView DM/6000 receive/tcp +# Philippe Binet (phbinet@vnet.IBM.COM) +netgw 741/tcp netGW +netgw 741/udp netGW +netrcs 742/tcp Network based Rev. Cont. Sys. +netrcs 742/udp Network based Rev. Cont. Sys. +# Gordon C. Galligher +flexlm 744/tcp Flexible License Manager +flexlm 744/udp Flexible License Manager +# Matt Christiano +# +fujitsu-dev 747/tcp Fujitsu Device Control +fujitsu-dev 747/udp Fujitsu Device Control +ris-cm 748/tcp Russell Info Sci Calendar Manager +ris-cm 748/udp Russell Info Sci Calendar Manager +kerberos-adm 749/tcp kerberos administration +kerberos-adm 749/udp kerberos administration +rfile 750/tcp +loadav 750/udp +pump 751/tcp +pump 751/udp +qrh 752/tcp +qrh 752/udp +rrh 753/tcp +rrh 753/udp +tell 754/tcp send +tell 754/udp send +nlogin 758/tcp +nlogin 758/udp +con 759/tcp +con 759/udp + + + +Reynolds & Postel [Page 37] + +RFC 1700 Assigned Numbers October 1994 + + +ns 760/tcp +ns 760/udp +rxe 761/tcp +rxe 761/udp +quotad 762/tcp +quotad 762/udp +cycleserv 763/tcp +cycleserv 763/udp +omserv 764/tcp +omserv 764/udp +webster 765/tcp +webster 765/udp +phonebook 767/tcp phone +phonebook 767/udp phone +vid 769/tcp +vid 769/udp +cadlock 770/tcp +cadlock 770/udp +rtip 771/tcp +rtip 771/udp +cycleserv2 772/tcp +cycleserv2 772/udp +submit 773/tcp +notify 773/udp +rpasswd 774/tcp +acmaint_dbd 774/udp +entomb 775/tcp +acmaint_transd 775/udp +wpages 776/tcp +wpages 776/udp +wpgs 780/tcp +wpgs 780/udp +concert 786/tcp Concert +concert 786/udp Concert +# Josyula R. Rao +mdbs_daemon 800/tcp +mdbs_daemon 800/udp +device 801/tcp +device 801/udp +xtreelic 996/tcp Central Point Software +xtreelic 996/udp Central Point Software +# Dale Cabell +maitrd 997/tcp +maitrd 997/udp +busboy 998/tcp +puparp 998/udp +garcon 999/tcp +applix 999/udp Applix ac + + + +Reynolds & Postel [Page 38] + +RFC 1700 Assigned Numbers October 1994 + + +puprouter 999/tcp +puprouter 999/udp +cadlock 1000/tcp +ock 1000/udp + 1023/tcp Reserved + 1024/udp Reserved +# IANA + + + +REGISTERED PORT NUMBERS + +The Registered Ports are not controlled by the IANA and on most +systems can be used by ordinary user processes or programs executed by +ordinary users. + +Ports are used in the TCP [RFC793] to name the ends of logical +connections which carry long term conversations. For the purpose of +providing services to unknown callers, a service contact port is +defined. This list specifies the port used by the server process as +its contact port. While the IANA can not control uses of these ports +it does register or list uses of these ports as a convienence to the +community. + +To the extent possible, these same port assignments are used with the +UDP [RFC768]. + +The Registered Ports are in the range 1024-65535. + +Port Assignments: + +Keyword Decimal Description References +------- ------- ----------- ---------- + 1024/tcp Reserved + 1024/udp Reserved +# IANA +blackjack 1025/tcp network blackjack +blackjack 1025/udp network blackjack +iad1 1030/tcp BBN IAD +iad1 1030/udp BBN IAD +iad2 1031/tcp BBN IAD +iad2 1031/udp BBN IAD +iad3 1032/tcp BBN IAD +iad3 1032/udp BBN IAD +# Andy Malis +instl_boots 1067/tcp Installation Bootstrap Proto. Serv. +instl_boots 1067/udp Installation Bootstrap Proto. Serv. +instl_bootc 1068/tcp Installation Bootstrap Proto. Cli. + + + +Reynolds & Postel [Page 39] + +RFC 1700 Assigned Numbers October 1994 + + +instl_bootc 1068/udp Installation Bootstrap Proto. Cli. +# David Arko < +socks 1080/tcp Socks +socks 1080/udp Socks +# Ying-Da Lee +nerv 1222/tcp SNI R&D network +nerv 1222/udp SNI R&D network +# Martin Freiss +hermes 1248/tcp +hermes 1248/udp +alta-ana-lm 1346/tcp Alta Analytics License Manager +alta-ana-lm 1346/udp Alta Analytics License Manager +bbn-mmc 1347/tcp multi media conferencing +bbn-mmc 1347/udp multi media conferencing +bbn-mmx 1348/tcp multi media conferencing +bbn-mmx 1348/udp multi media conferencing +sbook 1349/tcp Registration Network Protocol +sbook 1349/udp Registration Network Protocol +editbench 1350/tcp Registration Network Protocol +editbench 1350/udp Registration Network Protocol +# Simson L. Garfinkel +equationbuilder 1351/tcp Digital Tool Works (MIT) +equationbuilder 1351/udp Digital Tool Works (MIT) +# Terrence J. Talbot +lotusnote 1352/tcp Lotus Note +lotusnote 1352/udp Lotus Note +# Greg Pflaum +relief 1353/tcp Relief Consulting +relief 1353/udp Relief Consulting +# John Feiler +rightbrain 1354/tcp RightBrain Software +rightbrain 1354/udp RightBrain Software +# Glenn Reid +intuitive edge 1355/tcp Intuitive Edge +intuitive edge 1355/udp Intuitive Edge +# Montgomery Zukowski +# +cuillamartin 1356/tcp CuillaMartin Company +cuillamartin 1356/udp CuillaMartin Company +pegboard 1357/tcp Electronic PegBoard +pegboard 1357/udp Electronic PegBoard + + + +Reynolds & Postel [Page 40] + +RFC 1700 Assigned Numbers October 1994 + + +# Chris Cuilla +# +connlcli 1358/tcp CONNLCLI +connlcli 1358/udp CONNLCLI +ftsrv 1359/tcp FTSRV +ftsrv 1359/udp FTSRV +# Ines Homem de Melo +mimer 1360/tcp MIMER +mimer 1360/udp MIMER +# Per Schroeder +linx 1361/tcp LinX +linx 1361/udp LinX +# Steffen Schilke <---none---> +timeflies 1362/tcp TimeFlies +timeflies 1362/udp TimeFlies +# Doug Kent +ndm-requester 1363/tcp Network DataMover Requester +ndm-requester 1363/udp Network DataMover Requester +ndm-server 1364/tcp Network DataMover Server +ndm-server 1364/udp Network DataMover Server +# Toshio Watanabe +# +adapt-sna 1365/tcp Network Software Associates +adapt-sna 1365/udp Network Software Associates +# Jeffery Chiao <714-768-401> +netware-csp 1366/tcp Novell NetWare Comm Service Platform +netware-csp 1366/udp Novell NetWare Comm Service Platform +# Laurie Lindsey +dcs 1367/tcp DCS +dcs 1367/udp DCS +# Stefan Siebert +screencast 1368/tcp ScreenCast +screencast 1368/udp ScreenCast +# Bill Tschumy +gv-us 1369/tcp GlobalView to Unix Shell +gv-us 1369/udp GlobalView to Unix Shell +us-gv 1370/tcp Unix Shell to GlobalView +us-gv 1370/udp Unix Shell to GlobalView +# Makoto Mita +fc-cli 1371/tcp Fujitsu Config Protocol +fc-cli 1371/udp Fujitsu Config Protocol +fc-ser 1372/tcp Fujitsu Config Protocol +fc-ser 1372/udp Fujitsu Config Protocol +# Ryuichi Horie +chromagrafx 1373/tcp Chromagrafx +chromagrafx 1373/udp Chromagrafx +# Mike Barthelemy +molly 1374/tcp EPI Software Systems + + + +Reynolds & Postel [Page 41] + +RFC 1700 Assigned Numbers October 1994 + + +molly 1374/udp EPI Software Systems +# Jim Vlcek +bytex 1375/tcp Bytex +bytex 1375/udp Bytex +# Mary Ann Burt +ibm-pps 1376/tcp IBM Person to Person Software +ibm-pps 1376/udp IBM Person to Person Software +# Simon Phipps +cichlid 1377/tcp Cichlid License Manager +cichlid 1377/udp Cichlid License Manager +# Andy Burgess +elan 1378/tcp Elan License Manager +elan 1378/udp Elan License Manager +# Ken Greer +dbreporter 1379/tcp Integrity Solutions +dbreporter 1379/udp Integrity Solutions +# Tim Dawson +telesis-licman 1380/tcp Telesis Network License Manager +telesis-licman 1380/udp Telesis Network License Manager +# Karl Schendel, Jr. +apple-licman 1381/tcp Apple Network License Manager +apple-licman 1381/udp Apple Network License Manager +# Earl Wallace +udt_os 1382/tcp +udt_os 1382/udp +gwha 1383/tcp GW Hannaway Network License Manager +gwha 1383/udp GW Hannaway Network License Manager +# J. Gabriel Foster +os-licman 1384/tcp Objective Solutions License Manager +os-licman 1384/udp Objective Solutions License Manager +# Donald Cornwell +atex_elmd 1385/tcp Atex Publishing License Manager +atex_elmd 1385/udp Atex Publishing License Manager +# Brett Sorenson +checksum 1386/tcp CheckSum License Manager +checksum 1386/udp CheckSum License Manager +# Andreas Glocker +cadsi-lm 1387/tcp Computer Aided Design Software Inc LM +cadsi-lm 1387/udp Computer Aided Design Software Inc LM +# Sulistio Muljadi +objective-dbc 1388/tcp Objective Solutions DataBase Cache +objective-dbc 1388/udp Objective Solutions DataBase Cache +# Donald Cornwell +iclpv-dm 1389/tcp Document Manager +iclpv-dm 1389/udp Document Manager +iclpv-sc 1390/tcp Storage Controller +iclpv-sc 1390/udp Storage Controller +iclpv-sas 1391/tcp Storage Access Server + + + +Reynolds & Postel [Page 42] + +RFC 1700 Assigned Numbers October 1994 + + +iclpv-sas 1391/udp Storage Access Server +iclpv-pm 1392/tcp Print Manager +iclpv-pm 1392/udp Print Manager +iclpv-nls 1393/tcp Network Log Server +iclpv-nls 1393/udp Network Log Server +iclpv-nlc 1394/tcp Network Log Client +iclpv-nlc 1394/udp Network Log Client +iclpv-wsm 1395/tcp PC Workstation Manager software +iclpv-wsm 1395/udp PC Workstation Manager software +# A.P. Hobson +dvl-activemail 1396/tcp DVL Active Mail +dvl-activemail 1396/udp DVL Active Mail +audio-activmail 1397/tcp Audio Active Mail +audio-activmail 1397/udp Audio Active Mail +video-activmail 1398/tcp Video Active Mail +video-activmail 1398/udp Video Active Mail +# Ehud Shapiro +cadkey-licman 1399/tcp Cadkey License Manager +cadkey-licman 1399/udp Cadkey License Manager +cadkey-tablet 1400/tcp Cadkey Tablet Daemon +cadkey-tablet 1400/udp Cadkey Tablet Daemon +# Joe McCollough +goldleaf-licman 1401/tcp Goldleaf License Manager +goldleaf-licman 1401/udp Goldleaf License Manager +# John Fox <---none---> +prm-sm-np 1402/tcp Prospero Resource Manager +prm-sm-np 1402/udp Prospero Resource Manager +prm-nm-np 1403/tcp Prospero Resource Manager +prm-nm-np 1403/udp Prospero Resource Manager +# B. Clifford Neuman +igi-lm 1404/tcp Infinite Graphics License Manager +igi-lm 1404/udp Infinite Graphics License Manager +ibm-res 1405/tcp IBM Remote Execution Starter +ibm-res 1405/udp IBM Remote Execution Starter +netlabs-lm 1406/tcp NetLabs License Manager +netlabs-lm 1406/udp NetLabs License Manager +dbsa-lm 1407/tcp DBSA License Manager +dbsa-lm 1407/udp DBSA License Manager +# Scott Shattuck +sophia-lm 1408/tcp Sophia License Manager +sophia-lm 1408/udp Sophia License Manager +# Eric Brown +here-lm 1409/tcp Here License Manager +here-lm 1409/udp Here License Manager +# David Ison +hiq 1410/tcp HiQ License Manager +hiq 1410/udp HiQ License Manager +# Rick Pugh + + + +Reynolds & Postel [Page 43] + +RFC 1700 Assigned Numbers October 1994 + + +af 1411/tcp AudioFile +af 1411/udp AudioFile +# Jim Gettys +innosys 1412/tcp InnoSys +innosys 1412/udp InnoSys +innosys-acl 1413/tcp Innosys-ACL +innosys-acl 1413/udp Innosys-ACL +# Eric Welch <--none---> +ibm-mqseries 1414/tcp IBM MQSeries +ibm-mqseries 1414/udp IBM MQSeries +# Roger Meli +dbstar 1415/tcp DBStar +dbstar 1415/udp DBStar +# Jeffrey Millman +novell-lu6.2 1416/tcp Novell LU6.2 +novell-lu6.2 1416/udp Novell LU6.2 +# Peter Liu <--none---> +timbuktu-srv1 1417/tcp Timbuktu Service 1 Port +timbuktu-srv1 1417/tcp Timbuktu Service 1 Port +timbuktu-srv2 1418/tcp Timbuktu Service 2 Port +timbuktu-srv2 1418/udp Timbuktu Service 2 Port +timbuktu-srv3 1419/tcp Timbuktu Service 3 Port +timbuktu-srv3 1419/udp Timbuktu Service 3 Port +timbuktu-srv4 1420/tcp Timbuktu Service 4 Port +timbuktu-srv4 1420/udp Timbuktu Service 4 Port +# Marc Epard +gandalf-lm 1421/tcp Gandalf License Manager +gandalf-lm 1421/udp Gandalf License Manager +# gilmer@gandalf.ca +autodesk-lm 1422/tcp Autodesk License Manager +autodesk-lm 1422/udp Autodesk License Manager +# David Ko +essbase 1423/tcp Essbase Arbor Software +essbase 1423/udp Essbase Arbor Software +hybrid 1424/tcp Hybrid Encryption Protocol +hybrid 1424/udp Hybrid Encryption Protocol +# Howard Hart +zion-lm 1425/tcp Zion Software License Manager +zion-lm 1425/udp Zion Software License Manager +# David Ferrero +sas-1 1426/tcp Satellite-data Acquisition System 1 +sas-1 1426/udp Satellite-data Acquisition System 1 +# Bill Taylor +mloadd 1427/tcp mloadd monitoring tool +mloadd 1427/udp mloadd monitoring tool +# Bob Braden +informatik-lm 1428/tcp Informatik License Manager +informatik-lm 1428/udp Informatik License Manager + + + +Reynolds & Postel [Page 44] + +RFC 1700 Assigned Numbers October 1994 + + +# Harald Schlangmann +# +nms 1429/tcp Hypercom NMS +nms 1429/udp Hypercom NMS +tpdu 1430/tcp Hypercom TPDU +tpdu 1430/udp Hypercom TPDU +# Noor Chowdhury +rgtp 1431/tcp Reverse Gosip Transport +rgtp 1431/udp Reverse Gosip Transport +# +blueberry-lm 1432/tcp Blueberry Software License Manager +blueberry-lm 1432/udp Blueberry Software License Manager +# Steve Beigel +ms-sql-s 1433/tcp Microsoft-SQL-Server +ms-sql-s 1433/udp Microsoft-SQL-Server +ms-sql-m 1434/tcp Microsoft-SQL-Monitor +ms-sql-m 1434/udp Microsoft-SQL-Monitor +# Peter Hussey +ibm-cics 1435/tcp IBM CISC +ibm-cics 1435/udp IBM CISC +# Geoff Meacock +sas-2 1436/tcp Satellite-data Acquisition System 2 +sas-2 1436/udp Satellite-data Acquisition System 2 +# Bill Taylor +tabula 1437/tcp Tabula +tabula 1437/udp Tabula +# Marcelo Einhorn +# +eicon-server 1438/tcp Eicon Security Agent/Server +eicon-server 1438/udp Eicon Security Agent/Server +eicon-x25 1439/tcp Eicon X25/SNA Gateway +eicon-x25 1439/udp Eicon X25/SNA Gateway +eicon-slp 1440/tcp Eicon Service Location Protocol +eicon-slp 1440/udp Eicon Service Location Protocol +# Pat Calhoun +cadis-1 1441/tcp Cadis License Management +cadis-1 1441/udp Cadis License Management +cadis-2 1442/tcp Cadis License Management +cadis-2 1442/udp Cadis License Management +# Todd Wichers +ies-lm 1443/tcp Integrated Engineering Software +ies-lm 1443/udp Integrated Engineering Software +# David Tong +marcam-lm 1444/tcp Marcam License Management +marcam-lm 1444/udp Marcam License Management +# Therese Hunt +proxima-lm 1445/tcp Proxima License Manager +proxima-lm 1445/udp Proxima License Manager + + + +Reynolds & Postel [Page 45] + +RFC 1700 Assigned Numbers October 1994 + + +ora-lm 1446/tcp Optical Research Associates License Manager +ora-lm 1446/udp Optical Research Associates License Manager +apri-lm 1447/tcp Applied Parallel Research LM +apri-lm 1447/udp Applied Parallel Research LM +# Jim Dillon +oc-lm 1448/tcp OpenConnect License Manager +oc-lm 1448/udp OpenConnect License Manager +# Sue Barnhill +peport 1449/tcp PEport +peport 1449/udp PEport +# Qentin Neill +dwf 1450/tcp Tandem Distributed Workbench Facility +dwf 1450/udp Tandem Distributed Workbench Facility +# Mike Bert +infoman 1451/tcp IBM Information Management +infoman 1451/udp IBM Information Management +# Karen Burns <---none---> +gtegsc-lm 1452/tcp GTE Government Systems License Man +gtegsc-lm 1452/udp GTE Government Systems License Man +# Mike Gregory +genie-lm 1453/tcp Genie License Manager +genie-lm 1453/udp Genie License Manager +# Paul Applegate +interhdl_elmd 1454/tcp interHDL License Manager +interhdl_elmd 1454/tcp interHDL License Manager +# Eli Sternheim eli@interhdl.com +esl-lm 1455/tcp ESL License Manager +esl-lm 1455/udp ESL License Manager +# Abel Chou +dca 1456/tcp DCA +dca 1456/udp DCA +# Jeff Garbers +valisys-lm 1457/tcp Valisys License Manager +valisys-lm 1457/udp Valisys License Manager +# Leslie Lincoln +nrcabq-lm 1458/tcp Nichols Research Corp. +nrcabq-lm 1458/udp Nichols Research Corp. +# Howard Cole +proshare1 1459/tcp Proshare Notebook Application +proshare1 1459/udp Proshare Notebook Application +proshare2 1460/tcp Proshare Notebook Application +proshare2 1460/udp Proshare Notebook Application +# Robin Kar +ibm_wrless_lan 1461/tcp IBM Wireless LAN +ibm_wrless_lan 1461/udp IBM Wireless LAN +# +world-lm 1462/tcp World License Manager +world-lm 1462/udp World License Manager + + + +Reynolds & Postel [Page 46] + +RFC 1700 Assigned Numbers October 1994 + + +# Michael S Amirault +nucleus 1463/tcp Nucleus +nucleus 1463/udp Nucleus +# Venky Nagar +msl_lmd 1464/tcp MSL License Manager +msl_lmd 1464/udp MSL License Manager +# Matt Timmermans +pipes 1465/tcp Pipes Platform +pipes 1465/udp Pipes Platform mfarlin@peerlogic.com +# Mark Farlin +oceansoft-lm 1466/tcp Ocean Software License Manager +oceansoft-lm 1466/udp Ocean Software License Manager +# Randy Leonard +csdmbase 1467/tcp CSDMBASE +csdmbase 1467/udp CSDMBASE +csdm 1468/tcp CSDM +csdm 1468/udp CSDM +# Robert Stabl +aal-lm 1469/tcp Active Analysis Limited License Manager +aal-lm 1469/udp Active Analysis Limited License Manager +# David Snocken +44 (71)437-7009 +uaiact 1470/tcp Universal Analytics +uaiact 1470/udp Universal Analytics +# Mark R. Ludwig +csdmbase 1471/tcp csdmbase +csdmbase 1471/udp csdmbase +csdm 1472/tcp csdm +csdm 1472/udp csdm +# Robert Stabl +openmath 1473/tcp OpenMath +openmath 1473/udp OpenMath +# Garth Mayville +telefinder 1474/tcp Telefinder +telefinder 1474/udp Telefinder +# Jim White +taligent-lm 1475/tcp Taligent License Manager +taligent-lm 1475/udp Taligent License Manager +# Mark Sapsford +clvm-cfg 1476/tcp clvm-cfg +clvm-cfg 1476/udp clvm-cfg +# Eric Soderberg +ms-sna-server 1477/tcp ms-sna-server +ms-sna-server 1477/udp ms-sna-server +ms-sna-base 1478/tcp ms-sna-base +ms-sna-base 1478/udp ms-sna-base +# Gordon Mangione +dberegister 1479/tcp dberegister +dberegister 1479/udp dberegister + + + +Reynolds & Postel [Page 47] + +RFC 1700 Assigned Numbers October 1994 + + +# Brian Griswold +pacerforum 1480/tcp PacerForum +pacerforum 1480/udp PacerForum +# Peter Caswell +airs 1481/tcp AIRS +airs 1481/udp AIRS +# Bruce Wilson, 905-771-6161 +miteksys-lm 1482/tcp Miteksys License Manager +miteksys-lm 1482/udp Miteksys License Manager +# Shane McRoberts +afs 1483/tcp AFS License Manager +afs 1483/udp AFS License Manager +# Michael R. Pizolato +confluent 1484/tcp Confluent License Manager +confluent 1484/udp Confluent License Manager +# James Greenfiel +lansource 1485/tcp LANSource +lansource 1485/udp LANSource +# Doug Scott +nms_topo_serv 1486/tcp nms_topo_serv +nms_topo_serv 1486/udp nms_topo_serv +# Sylvia Siu +localinfosrvr 1487/tcp LocalInfoSrvr +localinfosrvr 1487/udp LocalInfoSrvr +# Brian Matthews +docstor 1488/tcp DocStor +docstor 1488/udp DocStor +# Brian Spears +dmdocbroker 1489/tcp dmdocbroker +dmdocbroker 1489/udp dmdocbroker +# Razmik Abnous +insitu-conf 1490/tcp insitu-conf +insitu-conf 1490/udp insitu-conf +# Paul Blacknell +anynetgateway 1491/tcp anynetgateway +anynetgateway 1491/udp anynetgateway +# Dan Poirier +stone-design-1 1492/tcp stone-design-1 +stone-design-1 1492/udp stone-design-1 +# Andrew Stone +netmap_lm 1493/tcp netmap_lm +netmap_lm 1493/udp netmap_lm +# Phillip Magson +ica 1494/tcp ica +ica 1494/udp ica +# John Richardson, Citrix Systems +cvc 1495/tcp cvc +cvc 1495/udp cvc + + + +Reynolds & Postel [Page 48] + +RFC 1700 Assigned Numbers October 1994 + + +# Bill Davidson +liberty-lm 1496/tcp liberty-lm +liberty-lm 1496/udp liberty-lm +# Jim Rogers +rfx-lm 1497/tcp rfx-lm +rfx-lm 1497/udp rfx-lm +# Bill Bishop +watcom-sql 1498/tcp Watcom-SQL +watcom-sql 1498/udp Watcom-SQL +# Rog Skubowius +fhc 1499/tcp Federico Heinz Consultora +fhc 1499/udp Federico Heinz Consultora +# Federico Heinz +vlsi-lm 1500/tcp VLSI License Manager +vlsi-lm 1500/udp VLSI License Manager +# Shue-Lin Kuo +sas-3 1501/tcp Satellite-data Acquisition System 3 +sas-3 1501/udp Satellite-data Acquisition System 3 +# Bill Taylor +shivadiscovery 1502/tcp Shiva +shivadiscovery 1502/udp Shiva +# Jonathan Wenocur +imtc-mcs 1503/tcp Databeam +imtc-mcs 1503/udp Databeam +# Jim Johnstone +evb-elm 1504/tcp EVB Software Engineering License Manager +evb-elm 1504/udp EVB Software Engineering License Manager +# B.G. Mahesh < mahesh@sett.com> +funkproxy 1505/tcp Funk Software, Inc. +funkproxy 1505/udp Funk Software, Inc. +# Robert D. Vincent +# 1506-1523 Unassigned +ingreslock 1524/tcp ingres +ingreslock 1524/udp ingres +orasrv 1525/tcp oracle +orasrv 1525/udp oracle +prospero-np 1525/tcp Prospero Directory Service non-priv +prospero-np 1525/udp Prospero Directory Service non-priv +pdap-np 1526/tcp Prospero Data Access Prot non-priv +pdap-np 1526/udp Prospero Data Access Prot non-priv +# B. Clifford Neuman +tlisrv 1527/tcp oracle +tlisrv 1527/udp oracle +coauthor 1529/tcp oracle +coauthor 1529/udp oracle +issd 1600/tcp +issd 1600/udp +nkd 1650/tcp + + + +Reynolds & Postel [Page 49] + +RFC 1700 Assigned Numbers October 1994 + + +nkd 1650/udp +proshareaudio 1651/tcp proshare conf audio +proshareaudio 1651/udp proshare conf audio +prosharevideo 1652/tcp proshare conf video +prosharevideo 1652/udp proshare conf video +prosharedata 1653/tcp proshare conf data +prosharedata 1653/udp proshare conf data +prosharerequest 1654/tcp proshare conf request +prosharerequest 1654/udp proshare conf request +prosharenotify 1655/tcp proshare conf notify +prosharenotify 1655/udp proshare conf notify +# +netview-aix-1 1661/tcp netview-aix-1 +netview-aix-1 1661/udp netview-aix-1 +netview-aix-2 1662/tcp netview-aix-2 +netview-aix-2 1662/udp netview-aix-2 +netview-aix-3 1663/tcp netview-aix-3 +netview-aix-3 1663/udp netview-aix-3 +netview-aix-4 1664/tcp netview-aix-4 +netview-aix-4 1664/udp netview-aix-4 +netview-aix-5 1665/tcp netview-aix-5 +netview-aix-5 1665/udp netview-aix-5 +netview-aix-6 1666/tcp netview-aix-6 +netview-aix-6 1666/udp netview-aix-6 +# Martha Crisson +licensedaemon 1986/tcp cisco license management +licensedaemon 1986/udp cisco license management +tr-rsrb-p1 1987/tcp cisco RSRB Priority 1 port +tr-rsrb-p1 1987/udp cisco RSRB Priority 1 port +tr-rsrb-p2 1988/tcp cisco RSRB Priority 2 port +tr-rsrb-p2 1988/udp cisco RSRB Priority 2 port +tr-rsrb-p3 1989/tcp cisco RSRB Priority 3 port +tr-rsrb-p3 1989/udp cisco RSRB Priority 3 port +#PROBLEMS!=================================================== +mshnet 1989/tcp MHSnet system +mshnet 1989/udp MHSnet system +# Bob Kummerfeld +#PROBLEMS!=================================================== +stun-p1 1990/tcp cisco STUN Priority 1 port +stun-p1 1990/udp cisco STUN Priority 1 port +stun-p2 1991/tcp cisco STUN Priority 2 port +stun-p2 1991/udp cisco STUN Priority 2 port +stun-p3 1992/tcp cisco STUN Priority 3 port +stun-p3 1992/udp cisco STUN Priority 3 port +#PROBLEMS!=================================================== +ipsendmsg 1992/tcp IPsendmsg +ipsendmsg 1992/udp IPsendmsg +# Bob Kummerfeld + + + +Reynolds & Postel [Page 50] + +RFC 1700 Assigned Numbers October 1994 + + +#PROBLEMS!=================================================== +snmp-tcp-port 1993/tcp cisco SNMP TCP port +snmp-tcp-port 1993/udp cisco SNMP TCP port +stun-port 1994/tcp cisco serial tunnel port +stun-port 1994/udp cisco serial tunnel port +perf-port 1995/tcp cisco perf port +perf-port 1995/udp cisco perf port +tr-rsrb-port 1996/tcp cisco Remote SRB port +tr-rsrb-port 1996/udp cisco Remote SRB port +gdp-port 1997/tcp cisco Gateway Discovery Protocol +gdp-port 1997/udp cisco Gateway Discovery Protocol +x25-svc-port 1998/tcp cisco X.25 service (XOT) +x25-svc-port 1998/udp cisco X.25 service (XOT) +tcp-id-port 1999/tcp cisco identification port +tcp-id-port 1999/udp cisco identification port +callbook 2000/tcp +callbook 2000/udp +dc 2001/tcp +wizard 2001/udp curry +globe 2002/tcp +globe 2002/udp +mailbox 2004/tcp +emce 2004/udp CCWS mm conf +berknet 2005/tcp +oracle 2005/udp +invokator 2006/tcp +raid-cc 2006/udp raid +dectalk 2007/tcp +raid-am 2007/udp +conf 2008/tcp +terminaldb 2008/udp +news 2009/tcp +whosockami 2009/udp +search 2010/tcp +pipe_server 2010/udp +raid-cc 2011/tcp raid +servserv 2011/udp +ttyinfo 2012/tcp +raid-ac 2012/udp +raid-am 2013/tcp +raid-cd 2013/udp +troff 2014/tcp +raid-sf 2014/udp +cypress 2015/tcp +raid-cs 2015/udp +bootserver 2016/tcp +bootserver 2016/udp +cypress-stat 2017/tcp + + + +Reynolds & Postel [Page 51] + +RFC 1700 Assigned Numbers October 1994 + + +bootclient 2017/udp +terminaldb 2018/tcp +rellpack 2018/udp +whosockami 2019/tcp +about 2019/udp +xinupageserver 2020/tcp +xinupageserver 2020/udp +servexec 2021/tcp +xinuexpansion1 2021/udp +down 2022/tcp +xinuexpansion2 2022/udp +xinuexpansion3 2023/tcp +xinuexpansion3 2023/udp +xinuexpansion4 2024/tcp +xinuexpansion4 2024/udp +ellpack 2025/tcp +xribs 2025/udp +scrabble 2026/tcp +scrabble 2026/udp +shadowserver 2027/tcp +shadowserver 2027/udp +submitserver 2028/tcp +submitserver 2028/udp +device2 2030/tcp +device2 2030/udp +blackboard 2032/tcp +blackboard 2032/udp +glogger 2033/tcp +glogger 2033/udp +scoremgr 2034/tcp +scoremgr 2034/udp +imsldoc 2035/tcp +imsldoc 2035/udp +objectmanager 2038/tcp +objectmanager 2038/udp +lam 2040/tcp +lam 2040/udp +interbase 2041/tcp +interbase 2041/udp +isis 2042/tcp +isis 2042/udp +isis-bcast 2043/tcp +isis-bcast 2043/udp +rimsl 2044/tcp +rimsl 2044/udp +cdfunc 2045/tcp +cdfunc 2045/udp +sdfunc 2046/tcp + + + +Reynolds & Postel [Page 52] + +RFC 1700 Assigned Numbers October 1994 + + +sdfunc 2046/udp +dls 2047/tcp +dls 2047/udp +dls-monitor 2048/tcp +dls-monitor 2048/udp +shilp 2049/tcp +shilp 2049/udp +dlsrpn 2065/tcp Data Link Switch Read Port Number +dlsrpn 2065/udp Data Link Switch Read Port Number +dlswpn 2067/tcp Data Link Switch Write Port Number +dlswpn 2067/udp Data Link Switch Write Port Number +ats 2201/tcp Advanced Training System Program +ats 2201/udp Advanced Training System Program +rtsserv 2500/tcp Resource Tracking system server +rtsserv 2500/udp Resource Tracking system server +rtsclient 2501/tcp Resource Tracking system client +rtsclient 2501/udp Resource Tracking system client +# Aubrey Turner +# +hp-3000-telnet 2564/tcp HP 3000 NS/VT block mode telnet +www-dev 2784/tcp world wide web - development +www-dev 2784/udp world wide web - development +NSWS 3049/tcp +NSWS 3049/udp +ccmail 3264/tcp cc:mail/lotus +ccmail 3264/udp cc:mail/lotus +dec-notes 3333/tcp DEC Notes +dec-notes 3333/udp DEC Notes +# Kim Moraros +mapper-nodemgr 3984/tcp MAPPER network node manager +mapper-nodemgr 3984/udp MAPPER network node manager +mapper-mapethd 3985/tcp MAPPER TCP/IP server +mapper-mapethd 3985/udp MAPPER TCP/IP server +mapper-ws_ethd 3986/tcp MAPPER workstation server +mapper-ws_ethd 3986/udp MAPPER workstation server +# John C. Horton +bmap 3421/tcp Bull Apprise portmapper +bmap 3421/udp Bull Apprise portmapper +# Jeremy Gilbert +udt_os 3900/tcp Unidata UDT OS +udt_os 3900/udp Unidata UDT OS +# James Powell +nuts_dem 4132/tcp NUTS Daemon +nuts_dem 4132/udp NUTS Daemon +nuts_bootp 4133/tcp NUTS Bootp Server +nuts_bootp 4133/udp NUTS Bootp Server +# Martin Freiss +unicall 4343/tcp UNICALL + + + +Reynolds & Postel [Page 53] + +RFC 1700 Assigned Numbers October 1994 + + +unicall 4343/udp UNICALL +# James Powell +krb524 4444/tcp KRB524 +krb524 4444/udp KRB524 +# B. Clifford Neuman +rfa 4672/tcp remote file access server +rfa 4672/udp remote file access server +commplex-main 5000/tcp +commplex-main 5000/udp +commplex-link 5001/tcp +commplex-link 5001/udp +rfe 5002/tcp radio free ethernet +rfe 5002/udp radio free ethernet +telelpathstart 5010/tcp TelepathStart +telelpathstart 5010/udp TelepathStart +telelpathattack 5011/tcp TelepathAttack +telelpathattack 5011/udp TelepathAttack +# Helmuth Breitenfellner +mmcc 5050/tcp multimedia conference control tool +mmcc 5050/udp multimedia conference control tool +rmonitor_secure 5145/tcp +rmonitor_secure 5145/udp +aol 5190/tcp America-Online +aol 5190/udp America-Online +# Marty Lyons +padl2sim 5236/tcp +padl2sim 5236/udp +hacl-hb 5300/tcp # HA cluster heartbeat +hacl-hb 5300/udp # HA cluster heartbeat +hacl-gs 5301/tcp # HA cluster general services +hacl-gs 5301/udp # HA cluster general services +hacl-cfg 5302/tcp # HA cluster configuration +hacl-cfg 5302/udp # HA cluster configuration +hacl-probe 5303/tcp # HA cluster probing +hacl-probe 5303/udp # HA cluster probing +hacl-local 5304/tcp +hacl-local 5304/udp +hacl-test 5305/tcp +hacl-test 5305/udp +# Eric Soderberg +x11 6000-6063/tcp X Window System +x11 6000-6063/udp X Window System +# Stephen Gildea +sub-process 6111/tcp HP SoftBench Sub-Process Control +sub-process 6111/udp HP SoftBench Sub-Process Control +meta-corp 6141/tcp Meta Corporation License Manager +meta-corp 6141/udp Meta Corporation License Manager +# Osamu Masuda <--none---> + + + +Reynolds & Postel [Page 54] + +RFC 1700 Assigned Numbers October 1994 + + +aspentec-lm 6142/tcp Aspen Technology License Manager +aspentec-lm 6142/udp Aspen Technology License Manager +# Kevin Massey +watershed-lm 6143/tcp Watershed License Manager +watershed-lm 6143/udp Watershed License Manager +# David Ferrero +statsci1-lm 6144/tcp StatSci License Manager - 1 +statsci1-lm 6144/udp StatSci License Manager - 1 +statsci2-lm 6145/tcp StatSci License Manager - 2 +statsci2-lm 6145/udp StatSci License Manager - 2 +# Scott Blachowicz +lonewolf-lm 6146/tcp Lone Wolf Systems License Manager +lonewolf-lm 6146/udp Lone Wolf Systems License Manager +# Dan Klein +montage-lm 6147/tcp Montage License Manager +montage-lm 6147/udp Montage License Manager +# Michael Ubell +xdsxdm 6558/udp +xdsxdm 6558/tcp +afs3-fileserver 7000/tcp file server itself +afs3-fileserver 7000/udp file server itself +afs3-callback 7001/tcp callbacks to cache managers +afs3-callback 7001/udp callbacks to cache managers +afs3-prserver 7002/tcp users & groups database +afs3-prserver 7002/udp users & groups database +afs3-vlserver 7003/tcp volume location database +afs3-vlserver 7003/udp volume location database +afs3-kaserver 7004/tcp AFS/Kerberos authentication service +afs3-kaserver 7004/udp AFS/Kerberos authentication service +afs3-volser 7005/tcp volume managment server +afs3-volser 7005/udp volume managment server +afs3-errors 7006/tcp error interpretation service +afs3-errors 7006/udp error interpretation service +afs3-bos 7007/tcp basic overseer process +afs3-bos 7007/udp basic overseer process +afs3-update 7008/tcp server-to-server updater +afs3-update 7008/udp server-to-server updater +afs3-rmtsys 7009/tcp remote cache manager service +afs3-rmtsys 7009/udp remote cache manager service +ups-onlinet 7010/tcp onlinet uninterruptable power supplies +ups-onlinet 7010/udp onlinet uninterruptable power supplies +# Brian Hammill +font-service 7100/tcp X Font Service +font-service 7100/udp X Font Service +# Stephen Gildea +fodms 7200/tcp FODMS FLIP +fodms 7200/udp FODMS FLIP +# David Anthony + + + +Reynolds & Postel [Page 55] + +RFC 1700 Assigned Numbers October 1994 + + +man 9535/tcp +man 9535/udp +isode-dua 17007/tcp +isode-dua 17007/udp + +REFERENCES + +[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, + USC/Information Sciences Institute, August 1980. + +[RFC793] Postel, J., ed., "Transmission Control Protocol - DARPA + Internet Program Protocol Specification", STD 7, RFC 793, + USC/Information Sciences Institute, September 1981. + + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 56] + +RFC 1700 Assigned Numbers October 1994 + + +INTERNET MULTICAST ADDRESSES + +Host Extensions for IP Multicasting [RFC1112] specifies the +extensions required of a host implementation of the Internet Protocol +(IP) to support multicasting. Current addresses are listed below. + +224.0.0.0 Base Address (Reserved) [RFC1112,JBP] +224.0.0.1 All Systems on this Subnet [RFC1112,JBP] +224.0.0.2 All Routers on this Subnet [JBP] +224.0.0.3 Unassigned [JBP] +224.0.0.4 DVMRP Routers [RFC1075,JBP] +224.0.0.5 OSPFIGP OSPFIGP All Routers [RFC1583,JXM1] +224.0.0.6 OSPFIGP OSPFIGP Designated Routers [RFC1583,JXM1] +224.0.0.7 ST Routers [RFC1190,KS14] +224.0.0.8 ST Hosts [RFC1190,KS14] +224.0.0.9 RIP2 Routers [GSM11] +224.0.0.10 IGRP Routers [Dino Farinacci] +224.0.0.11 Mobile-Agents [Bill Simpson] +224.0.0.12-224.0.0.255 Unassigned [JBP] + +224.0.1.0 VMTP Managers Group [RFC1045,DRC3] +224.0.1.1 NTP Network Time Protocol [RFC1119,DLM1] +224.0.1.2 SGI-Dogfight [AXC] +224.0.1.3 Rwhod [SXD] +224.0.1.4 VNP [DRC3] +224.0.1.5 Artificial Horizons - Aviator [BXF] +224.0.1.6 NSS - Name Service Server [BXS2] +224.0.1.7 AUDIONEWS - Audio News Multicast [MXF2] +224.0.1.8 SUN NIS+ Information Service [CXM3] +224.0.1.9 MTP Multicast Transport Protocol [SXA] +224.0.1.10 IETF-1-LOW-AUDIO [SC3] +224.0.1.11 IETF-1-AUDIO [SC3] +224.0.1.12 IETF-1-VIDEO [SC3] +224.0.1.13 IETF-2-LOW-AUDIO [SC3] +224.0.1.14 IETF-2-AUDIO [SC3] +224.0.1.15 IETF-2-VIDEO [SC3] +224.0.1.16 MUSIC-SERVICE [Guido van Rossum] +224.0.1.17 SEANET-TELEMETRY [Andrew Maffei] +224.0.1.18 SEANET-IMAGE [Andrew Maffei] +224.0.1.19 MLOADD [Braden] +224.0.1.20 any private experiment [JBP] +224.0.1.21 DVMRP on MOSPF [John Moy] +224.0.1.22 SVRLOC +224.0.1.23 XINGTV +224.0.1.24 microsoft-ds +224.0.1.25 nbc-pro +224.0.1.26 nbc-pfn +224.0.1.27-224.0.1.255 Unassigned [JBP] + + + +Reynolds & Postel [Page 57] + +RFC 1700 Assigned Numbers October 1994 + + +224.0.2.1 "rwho" Group (BSD) (unofficial) [JBP] +224.0.2.2 SUN RPC PMAPPROC_CALLIT [BXE1] + +224.0.3.000-224.0.3.255 RFE Generic Service [DXS3] +224.0.4.000-224.0.4.255 RFE Individual Conferences [DXS3] +224.0.5.000-224.0.5.127 CDPD Groups [Bob Brenner] +224.0.5.128-224.0.5.255 Unassigned [IANA] +224.0.6.000-224.0.6.127 Cornell ISIS Project [Tim Clark] +224.0.6.128-224.0.6.255 Unassigned [IANA] + +224.1.0.0-224.1.255.255 ST Multicast Groups [RFC1190,KS14] +224.2.0.0-224.2.255.255 Multimedia Conference Calls [SC3] + +224.252.0.0-224.255.255.255 DIS transient groups [Joel Snyder] + +232.0.0.0-232.255.255.255 VMTP transient groups [RFC1045,DRC3] + +These addresses are listed in the Domain Name Service under MCAST.NET +and 224.IN-ADDR.ARPA. + +Note that when used on an Ethernet or IEEE 802 network, the 23 +low-order bits of the IP Multicast address are placed in the low-order +23 bits of the Ethernet or IEEE 802 net multicast address +1.0.94.0.0.0. See the next section on "IANA ETHERNET ADDRESS BLOCK". + +REFERENCES + +[RFC1045] Cheriton, D., "VMTP: Versatile Message Transaction + Protocol Specification", RFC 1045, Stanford University, + February 1988. + +[RFC1075] Waitzman, D., C. Partridge, and S. Deering "Distance Vector + Multicast Routing Protocol", RFC-1075, BBN STC, Stanford + University, November 1988. + +[RFC1112] Deering, S., "Host Extensions for IP Multicasting", + STD 5, RFC 1112, Stanford University, August 1989. + +[RFC1119] Mills, D., "Network Time Protocol (Version 1), Specification + and Implementation", STD 12, RFC 1119, University of + Delaware, July 1988. + +[RFC1190] Topolcic, C., Editor, "Experimental Internet Stream + Protocol, Version 2 (ST-II)", RFC 1190, CIP Working Group, + October 1990. + +[RFC1583] Moy, J., "The OSPF Specification", RFC 1583, Proteon, + March 1994. + + + +Reynolds & Postel [Page 58] + +RFC 1700 Assigned Numbers October 1994 + + +PEOPLE + + + +[AXC] Andrew Cherenson + +[Bob Brenner] + + + +[Braden] Bob Braden + +[BXF] Bruce Factor + +[BXS2] Bill Schilit + +[CXM3] Chuck McManis + +[Tim Clark] + +[DLM1] David Mills + +[DRC3] Dave Cheriton + +[DXS3] Daniel Steinber + +[Dino Farinacci] + +[GSM11] Gary S. Malkin + + + +[IANA] IANA + +[JBP] Jon Postel + +[JXM1] Jim Miner + +[KS14] + +[Andrew Maffei] + +[John Moy] John Moy + +[MXF2] Martin Forssen + + + + +Reynolds & Postel [Page 59] + +RFC 1700 Assigned Numbers October 1994 + + +[Guido van Rossum] + +[SC3] Steve Casner + +[Joel Snyder] + +[SXA] Susie Armstrong + +[SXD] Steve Deering + + + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/multicast-addresses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 60] + +RFC 1700 Assigned Numbers October 1994 + + +SUN RPC NUMBERS + + +To obtain SUN Remote Procedure Call (RPC) numbers send an e-mail +request to "rpc@sun.com". + +The RPC port management service ('portmap' in SunOS versions less than +5.0 and 'rpcbind' in SunOS versions greater than 5.0) "registers" the +IP port number that is allocated to a particular service when that +service is created. It does not allocate ports on behalf of those +services. + +For an exact specification of the semantics refer to the source code +of svcudp_create() and svctcp_create() in the archives. In short +however is that these interfaces, and svc_tli_create their Transport +Independent RPC equivalent, take either a user specified port number +or RPC_ANY (-1) which effectively means "I don't care." In the "I +don't care" case the create code simply calls socket(2) or t_open(3n) +which allocates an IP port based on the rules: + + if euid of the requesting process is 0 (i.e., root) + allocate the next available port number in the + reserved port range. + else + allocate the next available port in the non-reserved + range. + +Port numbers count up sequentially. + +Can a port that is "assigned" can be used when the assignee's service +is not present? Say port 501 is assigned to the "jeans" service. On +a machine that does not have the "jeans" service, nor has any clients +that might be expecting to use it, is port 501 available for other +uses? Any dynamic allocation process, like the portmapper, that +chooses the next unused port might allocate port 501 dynamically to a +process that asked for a "I don't care" port. So any dynamic +allocation scheme may pick an unused port that happened to correspond +to a port number that had been "assigned" but was currently unused. + +While it might be desirable, it is impossible to guarantee that any +unused port, even though officially assigned to a service, is not +picked by a dynamic allocator since such an assignment might occur +long after the delivery of the system into a site that doesn't watch +for the latest list. + +There is the restriction that only "superuser" on BSD derived systems +such as SunOS can bind to a port number that is less than 1024. So +programs have used this information in the past to identify whether or + + + +Reynolds & Postel [Page 61] + +RFC 1700 Assigned Numbers October 1994 + + +not the service they were talking to was started by the superuser on +the remote system. Making this assumption is dangerous because not +all system enforce this restriction. + +Sun RPC services use ports that are currently unused. If someone +noted that an RPC service was using port 781, it would be just as +happy using port 891, or 951. The service doesn't care what port it +gets, remote clients will query the portmapper to ask it what port +number was assigned to the service when it was started. The key is +that the port was not currently in use. The only port that ONC/RPC +must have is 111 its assigned port for the portmap service. + +The most common complaint comes when people put a new service on their +system. When they configure their systems they put the new service +configuration commands at the end of their system startup scripts. +During startup, several network services may be started. Those +services that are ONC/RPC based just pick the next available port, +those that have pre-assigned ports bind to their pre-assigned port. +Clearly the correct sequence is to have all services that need a +particular port to be started first (or if they are "latent" services +that are started by inetd, to have inetd started). Finally, the RPC +services should be started as they will be assigned unused ports. (In +the BSD networking code (which we use) the algorithm for picking +ports is in the file in_pcb.c, function in_pcbbind().) + +Services should be started in this order: + + a) Services that will "run" continuously and have an assigned + port. Note that this includes rpcbind (nee portmap) that has + port 111 assigned to it. + + b) inetd - which will automatically create sockets for those + services that have reserved ports but only run on demand + (like finger) + + c) RPC services - which will automatically pick unused ports and + maximize efficiency of the "IP Port" namespace. + +The include file /usr/include/netinet/in.h defines a constant +IPPORT_RESERVED to be 1024. The relevant text is: + + /* + * Ports < IPPORT_RESERVED are reserved for + * privileged processes (e.g. root). + * Ports > IPPORT_USERRESERVED are reserved + * for servers, not necessarily privileged. + */ + #define IPPORT_RESERVED 1024 + + + +Reynolds & Postel [Page 62] + +RFC 1700 Assigned Numbers October 1994 + + + #define IPPORT_USERRESERVED 5000 + +Portmap does not allocate ports, the kernel allocates ports. The code +that does this is part of nearly every UNIX system in the world (and +since the BSD code is 'free' it is often the same code). RPC services +ask the kernel to allocate them a port by calling the "bind()" system +call. The parameter they pass is "INADDR_ANY" which means "allocate +me any IP port you want". The kernel does that by looking at all of +the ports that are currently in use and picking one that is not +currently used. The number picked is either less that 1024 if the +process is privledged, or greater than 1024 if the process is not +privledged. After the kernel has allocated a port, the service +registers this allocation with portmap. The portmapper is merely a +registry of previously allocated ports. Note "allocated" here is +being used in the sense that they are used by an open socket, not +assigned a well known name. + +The role of /etc/services is to provide an idea to people who are +looking at network traffic as to where a packet may have originated +from or is headed to. For services like finger that have assigned +ports, they can just hard code the port they want into their +executable. (it isn't like it will change, and if they read it from +/etc/services and someone had mistyped the port number it won't +interoperate with clients anyway!) + +It is not practical to read the /etc/services file into the kernel to +prevent it from giving out port numbers that are "pre-assigned", nor +is it generally desirable since with the correct ordering of startup +it is completely unneccesary. + +Editors Note: This information was supplied by Chuck McManis of Sun. + +[] + + + + + + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/sun-rpc-numbers + + + + + + + + + + +Reynolds & Postel [Page 63] + +RFC 1700 Assigned Numbers October 1994 + + +IP OPTION NUMBERS + +The Internet Protocol (IP) has provision for optional header fields +identified by an option type field. Options 0 and 1 are exactly one +octet which is their type field. All other options have their one +octet type field, followed by a one octet length field, followed by +length-2 octets of option data. The option type field is sub-divided +into a one bit copied flag, a two bit class field, and a five bit +option number. These taken together form an eight bit value for the +option type field. IP options are commonly refered to by this value. + + +Copy Class Number Value Name Reference +---- ----- ------ ----- ------------------------------- --------- + 0 0 0 0 EOOL - End of Options List [RFC791,JBP] + 0 0 1 1 NOP - No Operation [RFC791,JBP] + 1 0 2 130 SEC - Security [RFC1108] + 1 0 3 131 LSR - Loose Source Route [RFC791,JBP] + 0 2 4 68 TS - Time Stamp [RFC791,JBP] + 1 0 5 133 E-SEC - Extended Security [RFC1108] + 1 0 6 134 CIPSO - Commercial Security [???] + 0 0 7 7 RR - Record Route [RFC791,JBP] + 1 0 8 136 SID - Stream ID [RFC791,JBP] + 1 0 9 137 SSR - Strict Source Route [RFC791,JBP] + 0 0 10 10 ZSU - Experimental Measurement [ZSu] + 0 0 11 11 MTUP - MTU Probe [RFC1191] + 0 0 12 12 MTUR - MTU Reply [RFC1191] + 1 2 13 205 FINN - Experimental Flow Control [Finn] + 1 0 14 142 VISA - Expermental Access Control [Estrin] + 0 0 15 15 ENCODE - ??? [VerSteeg] + 1 0 16 144 IMITD - IMI Traffic Descriptor [Lee] + 1 0 17 145 EIP - ??? [RFC1358] + 0 2 18 82 TR - Traceroute [RFC1393] + 1 0 19 147 ADDEXT - Address Extension [Ullmann IPv7] + + + +IP TIME TO LIVE PARAMETER + +The current recommended default time to live (TTL) for the +Internet Protocol (IP) [45,105] is 64. + + +IP TOS PARAMETERS + +This documents the default Type-of-Service values that are currently +recommended for the most important Internet protocols. + + + + +Reynolds & Postel [Page 64] + +RFC 1700 Assigned Numbers October 1994 + + +TOS Value Description Reference +--------- -------------------------- --------- + 0000 Default [RFC1349] + 0001 Minimize Monetary Cost [RFC1349] + 0010 Maximize Reliability [RFC1349] + 0100 Maximize Throughput [RFC1349] + 1000 Minimize Delay [RFC1349] + 1111 Maximize Security [RFC1455] + +The TOS value is used to indicate "better". Only one TOS value or +property can be requested in any one IP datagram. + +Generally, protocols which are involved in direct interaction with a +human should select low delay, while data transfers which may involve +large blocks of data are need high throughput. Finally, high reliability +is most important for datagram-based Internet management functions. + +Application protocols not included in these tables should be able to +make appropriate choice of low delay (8 decimal, 1000 binary) or high +throughput (4 decimal, 0100 binary). + +The following are recommended values for TOS: + + + ----- Type-of-Service Value ----- + +Protocol TOS Value + +TELNET (1) 1000 (minimize delay) + +FTP + Control 1000 (minimize delay) + Data (2) 0100 (maximize throughput) + +TFTP 1000 (minimize delay) + +SMTP (3) + Command phase 1000 (minimize delay) + DATA phase 0100 (maximize throughput) + +Domain Name Service + UDP Query 1000 (minimize delay) + TCP Query 0000 + Zone Transfer 0100 (maximize throughput) + +NNTP 0001 (minimize monetary cost) + +ICMP + + + +Reynolds & Postel [Page 65] + +RFC 1700 Assigned Numbers October 1994 + + + Errors 0000 + Requests 0000 (4) + Responses (4) + +Any IGP 0010 (maximize reliability) + +EGP 0000 + +SNMP 0010 (maximize reliability) + +BOOTP 0000 + +Notes: + +(1) Includes all interactive user protocols (e.g., rlogin). + +(2) Includes all bulk data transfer protocols (e.g., rcp). + +(3) If the implementation does not support changing the TOS +during the lifetime of the connection, then the +recommended TOS on opening the connection is the default +TOS (0000). + +(4) Although ICMP request messages are normally sent with +the default TOS, there are sometimes good reasons why they +would be sent with some other TOS value. An ICMP +response always uses the same TOS value as was used in the +corresponding ICMP request message. + +An application may (at the request of the user) substitute +0001 (minimize monetary cost) for any of the above values. + + +REFERENCES + +[RFC791] Postel, J., "Internet Protocol - DARPA Internet Program + Protocol Specification", STD 5, RFC 791, DARPA, September + 1981. + +[RFC1108] Kent, S., "U.S. Department of Defense Security Options for + the Internet Protocol", RFC 1108, BBN Communications, + November 1991. + +[RFC1191] Mogul, J., and S. Deering, "Path MTU Discovery", RFC 1191, + DECWRL, Stanford University, November 1990. + +[RFC1349] Almquist, P., "Type of Service in the Internet Protocol + Suite", RFC 1349, Consultant, July 1992. + + + +Reynolds & Postel [Page 66] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC1358] Chapin, L., Chair, "Charter of the Internet Architecture + Board (IAB)", RFC 1358, Internet Architecture Board, August + 1992. + +[RFC1393] Malkin, G., "Traceroute Using an IP Option", RFC 1393, + Xylogics, Inc., January 1993. + +[RFC1455] Eastlake, D., "Physical Link Security Type of Service", + RFC 1455, Digital Equipment Corporation, May 1993. + +[Ullmann IPv7] + + +PEOPLE + +[Estrin] Deborah Estrin + +[Finn] Greg Finn + +[JBP] Jon Postel + +[Ullmann] Robert Ullmann + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ip-parameters + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 67] + +RFC 1700 Assigned Numbers October 1994 + + +ICMP TYPE NUMBERS + +The Internet Control Message Protocol (ICMP) has many messages that +are identified by a "type" field. + +Type Name Reference +---- ------------------------- --------- + 0 Echo Reply [RFC792] + 1 Unassigned [JBP] + 2 Unassigned [JBP] + 3 Destination Unreachable [RFC792] + 4 Source Quench [RFC792] + 5 Redirect [RFC792] + 6 Alternate Host Address [JBP] + 7 Unassigned [JBP] + 8 Echo [RFC792] + 9 Router Advertisement [RFC1256] + 10 Router Selection [RFC1256] + 11 Time Exceeded [RFC792] + 12 Parameter Problem [RFC792] + 13 Timestamp [RFC792] + 14 Timestamp Reply [RFC792] + 15 Information Request [RFC792] + 16 Information Reply [RFC792] + 17 Address Mask Request [RFC950] + 18 Address Mask Reply [RFC950] + 19 Reserved (for Security) [Solo] + 20-29 Reserved (for Robustness Experiment) [ZSu] + 30 Traceroute [RFC1393] + 31 Datagram Conversion Error [RFC1475] + 32 Mobile Host Redirect [David Johnson] + 33 IPv6 Where-Are-You [Bill Simpson] + 34 IPv6 I-Am-Here [Bill Simpson] + 35 Mobile Registration Request [Bill Simpson] + 36 Mobile Registration Reply [Bill Simpson] + 37-255 Reserved [JBP] + +Many of these ICMP types have a "code" field. Here we list the types +again with their assigned code fields. + +Type Name Reference +---- ------------------------- --------- + 0 Echo Reply [RFC792] + + Codes + 0 No Code + + 1 Unassigned [JBP] + + + +Reynolds & Postel [Page 68] + +RFC 1700 Assigned Numbers October 1994 + + + 2 Unassigned [JBP] + + 3 Destination Unreachable [RFC792] + + Codes + 0 Net Unreachable + 1 Host Unreachable + 2 Protocol Unreachable + 3 Port Unreachable + 4 Fragmentation Needed and Don't Fragment was Set + 5 Source Route Failed + 6 Destination Network Unknown + 7 Destination Host Unknown + 8 Source Host Isolated + 9 Communication with Destination Network is + Administratively Prohibited + 10 Communication with Destination Host is + Administratively Prohibited + 11 Destination Network Unreachable for Type of Service + 12 Destination Host Unreachable for Type of Service + + 4 Source Quench [RFC792] + Codes + 0 No Code + + 5 Redirect [RFC792] + + Codes + 0 Redirect Datagram for the Network (or subnet) + 1 Redirect Datagram for the Host + 2 Redirect Datagram for the Type of Service and Network + 3 Redirect Datagram for the Type of Service and Host + + 6 Alternate Host Address [JBP] + + Codes + 0 Alternate Address for Host + + 7 Unassigned [JBP] + + 8 Echo [RFC792] + + Codes + 0 No Code + + 9 Router Advertisement [RFC1256] + + Codes + + + +Reynolds & Postel [Page 69] + +RFC 1700 Assigned Numbers October 1994 + + + 0 No Code + + 10 Router Selection [RFC1256] + + Codes + 0 No Code + + 11 Time Exceeded [RFC792] + + Codes + 0 Time to Live exceeded in Transit + 1 Fragment Reassembly Time Exceeded + + 12 Parameter Problem [RFC792] + + Codes + 0 Pointer indicates the error + 1 Missing a Required Option [RFC1108] + 2 Bad Length + + + 13 Timestamp [RFC792] + + Codes + 0 No Code + + 14 Timestamp Reply [RFC792] + + Codes + 0 No Code + + 15 Information Request [RFC792] + + Codes + 0 No Code + + 16 Information Reply [RFC792] + + Codes + 0 No Code + + 17 Address Mask Request [RFC950] + + Codes + 0 No Code + + 18 Address Mask Reply [RFC950] + + + + +Reynolds & Postel [Page 70] + +RFC 1700 Assigned Numbers October 1994 + + + Codes + 0 No Code + + 19 Reserved (for Security) [Solo] + + 20-29 Reserved (for Robustness Experiment) [ZSu] + + 30 Traceroute [RFC1393] + + 31 Datagram Conversion Error [RFC1475] + + 32 Mobile Host Redirect [David Johnson] + + 33 IPv6 Where-Are-You [Bill Simpson] + + 34 IPv6 I-Am-Here [Bill Simpson] + + 35 Mobile Registration Request [Bill Simpson] + + 36 Mobile Registration Reply [Bill Simpson] + +REFERENCES + +[RFC792] Postel, J., "Internet Control Message Protocol", STD 5, + RFC 792, USC/Information Sciences Institute, September 1981. + +[RFC950] Mogul, J., and J. Postel, "Internet Standard Subnetting + Procedure", STD 5, RFC 950, Stanford, USC/Information + Sciences Institute, August 1985. + +[RFC1108] Kent, S., "U.S. Department of Defense Security Options for + the Internet Protocol", RFC 1108, November 1991. + +[RFC1256] Deering, S., Editor, "ICMP Router Discovery Messages", RFC + 1256, Xerox PARC, September 1991. + +[RFC1393] Malkin, G., "Traceroute Using an IP Option", RFC 1393, + Xylogics, Inc., January 1993. + +[RFC1475] Ullmann, R., "TP/IX: The Next Internet", RFC 1475, Process + Software Corporation, June 1993. + + +PEOPLE + +[JBP] Jon Postel + +[David Johnson] + + + +Reynolds & Postel [Page 71] + +RFC 1700 Assigned Numbers October 1994 + + +[Bill Simpson] September, 1994. + +[Solo] + +[ZSu] Zaw-Sing Su + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/icmp-parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 72] + +RFC 1700 Assigned Numbers October 1994 + + +TCP OPTION NUMBERS + +The Transmission Control Protocol (TCP) has provision for optional +header fields identified by an option kind field. Options 0 and 1 are +exactly one octet which is their kind field. All other options have +their one octet kind field, followed by a one octet length field, +followed by length-2 octets of option data. + +Kind Length Meaning Reference +---- ------ ------------------------------- --------- + 0 - End of Option List [RFC793] + 1 - No-Operation [RFC793] + 2 4 Maximum Segment Lifetime [RFC793] + 3 3 WSOPT - Window Scale [RFC1323] + 4 2 SACK Permitted [RFC1072] + 5 N SACK [RFC1072] + 6 6 Echo (obsoleted by option 8) [RFC1072] + 7 6 Echo Reply (obsoleted by option 8)[RFC1072] + 8 10 TSOPT - Time Stamp Option [RFC1323] + 9 2 Partial Order Connection Permitted[RFC1693] + 10 5 Partial Order Service Profile [RFC1693] + 11 CC [Braden] + 12 CC.NEW [Braden] + 13 CC.ECHO [Braden] + 14 3 TCP Alternate Checksum Request [RFC1146] + 15 N TCP Alternate Checksum Data [RFC1146] + 16 Skeeter [Knowles] + 17 Bubba [Knowles] + 18 3 Trailer Checksum Option [Subbu & Monroe] + + +TCP ALTERNATE CHECKSUM NUMBERS + + +Number Description Reference +------- ------------------------------- ---------- + 0 TCP Checksum [RFC-1146] + 1 8-bit Fletchers's algorithm [RFC-1146] + 2 16-bit Fletchers's algorithm [RFC-1146] + 3 Redundant Checksum Avoidance [Kay] + + +REFERENCES + +[KAY] Kay, J. and Pasquale, J., "Measurement, Analysis, and + Improvement of UDP/IP Throughput for the DECstation 5000," + Proceedings of the Winter 1993 Usenix Conference, January 1993 + (available for anonymous FTP in + + + +Reynolds & Postel [Page 73] + +RFC 1700 Assigned Numbers October 1994 + + + ucsd.edu:/pub/csl/fastnet/fastnet.tar.Z). + +[RFC793] Postel, J., "Transmission Control Protocol - DARPA Internet + Program Protocol Specification", STD 7, RFC 793, DARPA, + September 1981. + +[RFC1323] Jacobson, V., Braden, R., and D. Borman, "TCP Extensions for + High Performance", RFC 1323, LBL, ISI, Cray Research, May + 1992. + +[RFC1072] Jacobson, V., and R. Braden, "TCP Extensions for Long-Delay + Paths", RFC 1072, LBL, ISI, October 1988. + +[RFC1693] ????? + +[RFC1146] Zweig, J., and C. Partridge, "TCP Alternate Checksum + Options", RFC 1146, UIUC, BBN, March 1990. + +PEOPLE + +[Braden] Bob Braden + +[Knowles] Stev Knowles + +[Kay] J. Kay + +[Subbu & Monroe] + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/tcp-parameters + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 74] + +RFC 1700 Assigned Numbers October 1994 + + +TELNET OPTIONS + +The Telnet Protocol has a number of options that may be negotiated. +These options are listed here. "Internet Official Protocol Standards" +(STD 1) provides more detailed information. + +Options Name References +------- ----------------------- ---------- + 0 Binary Transmission [RFC856,JBP] + 1 Echo [RFC857,JBP] + 2 Reconnection [NIC50005,JBP] + 3 Suppress Go Ahead [RFC858,JBP] + 4 Approx Message Size Negotiation [ETHERNET,JBP] + 5 Status [RFC859,JBP] + 6 Timing Mark [RFC860,JBP] + 7 Remote Controlled Trans and Echo [RFC726,JBP] + 8 Output Line Width [NIC50005,JBP] + 9 Output Page Size [NIC50005,JBP] + 10 Output Carriage-Return Disposition [RFC652,JBP] + 11 Output Horizontal Tab Stops [RFC653,JBP] + 12 Output Horizontal Tab Disposition [RFC654,JBP] + 13 Output Formfeed Disposition [RFC655,JBP] + 14 Output Vertical Tabstops [RFC656,JBP] + 15 Output Vertical Tab Disposition [RFC657,JBP] + 16 Output Linefeed Disposition [RFC657,JBP] + 17 Extended ASCII [RFC698,JBP] + 18 Logout [RFC727,MRC] + 19 Byte Macro [RFC735,JBP] + 20 Data Entry Terminal [RFC1043,RFC732,JBP] + 22 SUPDUP [RFC736,RFC734,MRC] + 22 SUPDUP Output [RFC749,MRC] + 23 Send Location [RFC779,EAK1] + 24 Terminal Type [RFC1091,MS56] + 25 End of Record [RFC885,JBP] + 26 TACACS User Identification [RFC927,BA4] + 27 Output Marking [RFC933,SXS] + 28 Terminal Location Number [RFC946,RN6] + 29 Telnet 3270 Regime [RFC1041,JXR] + 30 X.3 PAD [RFC1053,SL70] + 31 Negotiate About Window Size [RFC1073,DW183] + 32 Terminal Speed [RFC1079,CLH3] + 33 Remote Flow Control [RFC1372,CLH3] + 34 Linemode [RFC1184,DB14] + 35 X Display Location [RFC1096,GM23] + 36 Environment Option [RFC1408,DB14] + 37 Authentication Option [RFC1409,DB14] + 38 Encryption Option [DB14] + 39 New Environment Option [RFC1572,DB14] + + + +Reynolds & Postel [Page 75] + +RFC 1700 Assigned Numbers October 1994 + + + 40 TN3270E [RFC1647] + 255 Extended-Options-List [RFC861,JBP] + +Telnet Authentication Types + +In [RFC1409], a list of authentication types is introduced. Additions +to the list are registerd by the IANA and documented here. + +Type Description Reference + 0 NULL [RFC1409] + 1 KERBEROS_V4 [RFC1409] + 2 KERBEROS_V5 [RFC1409] + 3 SPX [RFC1409] + 4-5 Unassigned + 6 RSA [RFC1409] + 7-9 Unassigned + 10 LOKI [RFC1409] + 11 SSA [Schoch] + +REFERENCES + +[ETHERNET] "The Ethernet, A Local Area Network: Data Link Layer and + Physical Layer Specification", AA-K759B-TK, Digital + Equipment Corporation, Maynard, MA. Also as: "The + Ethernet - A Local Area Network", Version 1.0, Digital + Equipment Corporation, Intel Corporation, Xerox + Corporation, September 1980. And: "The Ethernet, A Local + Area Network: Data Link Layer and Physical Layer + Specifications", Digital, Intel and Xerox, November 1982. + And: XEROX, "The Ethernet, A Local Area Network: Data Link + Layer and Physical Layer Specification", X3T51/80-50, Xerox + Corporation, Stamford, CT., October 1980. + +[NIC50005] DDN Protocol Handbook, "Telnet Reconnection Option", + "Telnet Output Line Width Option", "Telnet Output Page Size + Option", NIC 50005, December 1985. + +[RFC652] Crocker, D., "Telnet Output Carriage-Return Disposition + Option", RFC 652, UCLA-NMC, October 1974. + +[RFC653] Crocker, D., "Telnet Output Horizontal Tabstops Option", + RFC 653, UCLA-NMC, October 1974. + +[RFC654] Crocker, D., "Telnet Output Horizontal Tab Disposition + Option", RFC 654, UCLA-NMC, October 1974. + +[RFC655] Crocker, D., "Telnet Output Formfeed Disposition Option", + RFC 655, UCLA-NMC, October 1974. + + + +Reynolds & Postel [Page 76] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC656] Crocker, D., "Telnet Output Vertical Tabstops Option", + RFC 656, UCLA-NMC, October 1974. + +[RFC657] Crocker, D., "Telnet Output Vertical Tab Disposition Option", + RFC 657, UCLA-NMC, October 1974. + +[RFC658] Crocker, D., "Telnet Output Linefeed Disposition", RFC 658, + UCLA-NMC, October 1974. + +[RFC698] Tovar, "Telnet Extended ASCII Option", RFC 698, Stanford + University-AI, July 1975. + +[RFC726] Postel, J. and D. Crocker, "Remote Controlled Transmission + and Echoing Telnet Option", RFC 726, SRI-ARC, UC Irvine, + March 1977. + +[RFC727] Crispin, M., "Telnet Logout Option", RFC 727, Stanford + University-AI, April 1977. + +[RFC734] Crispin, M., "SUPDUP Protocol", RFC 734, Stanford, + October 1977. + +[RFC735] Crocker, D. and R. Gumpertz, "Revised Telnet Byte Marco + Option", RFC 735, Rand, CMU, November 1977. + +[RFC736] Crispin, M., "Telnet SUPDUP Option", Stanford University-AI, + RFC 736, Stanford, October 1977. + +[RFC749] Greenberg, B., "Telnet SUPDUP-OUTPUT Option", RFC 749, + MIT-Multics, September 1978. + +[RFC779] Killian, E., "Telnet Send-Location Option", RFC 779, + LLL, April 1981. + +[RFC856] Postel, J. and J. Reynolds, "Telnet Binary Transmission", + STD 27, RFC 856, USC/Information Sciences Institute, May + 1983. + +[RFC857] Postel, J. and J. Reynolds, "Telnet Echo Option", STD 28, RFC + 857, USC/Information Sciences Institute, May 1983. + +[RFC858] Postel, J. and J. Reynolds, "Telnet Suppress Go Ahead + Option", STD 29, RFC 858, USC/Information Sciences Institute, + May 1983. + +[RFC859] Postel, J. and J. Reynolds, "Telnet Status Option", STD 30, + RFC 859, USC/Information Sciences Institute, May 1983. + + + + +Reynolds & Postel [Page 77] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC860] Postel, J. and J. Reynolds, "Telnet Timing Mark Option", + STD 31, RFC 860, USC/Information Sciences Institute, May + 1983. + +[RFC861] Postel, J. and J. Reynolds, "Telnet Extended Options - List + Option", STD 32, RFC 861, USC/Information Sciences Institute, + May 1983. + +[RFC885] Postel, J., "Telnet End of Record Option", RFC 885, + USC/Information Sciences Institute, December 1983. + +[RFC927] Anderson, B., "TACACS User Identification Telnet Option", + RFC 927, BBN, December 1984. + +[RFC933] Silverman, S., "Output Marking Telnet Option", RFC 933, + MITRE, January 1985. + +[RFC946] Nedved, R., "Telnet Terminal Location Number Option", + RFC 946, Carnegie-Mellon University, May 1985. + +[RDC1041] Rekhter, J., "Telnet 3270 Regime Option", RFC 1041, + IBM, January 1988. + +[RFC1043] Yasuda, A., and T. Thompson, "TELNET Data Entry Terminal + Option DODIIS Implementation", RFC 1043, DIA, February 1988. + +[RFC1053] Levy, S., and T. Jacobson, "Telnet X.3 PAD Option", + RFC 1053, Minnesota Supercomputer Center, April 1988. + +[RFC1073] Waitzman, D., "Telnet Window Size Option", RFC 1073, + BBN STC, October, 1988. + +[RFC1079] Hedrick, C., "Telnet Terminal Speed Option", RFC 1079, + Rutgers University, December 1988. + +[RFC1091] VanBokkelen, J., "Telnet Terminal Type Option", + RFC 1091, FTP Software, Inc., February 1989. + +[RFC1096] Marcy, G., "Telnet X Display Location Option", RFC 1096, + Carnegie Mellon University, March 1989. + +[RFC1184] Borman, D., Editor, "Telnet Linemode Option", + RFC 1184, Cray Research, Inc., October 1990. + +[RFC1372] Hedrick, C., and D. Borman, "Telnet Remote Flow Control + Option", RFC 1372, Rutgers University, Cray Research, Inc., + October 1992. + + + + +Reynolds & Postel [Page 78] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC1408] Borman, D., Editor, "Telnet Environment Option", RFC 1408, + Cray Research, Inc., January 1993. + +[RFC1409] Borman, D., Editor, "Telnet Authentication Option", RFC + 1409, Cray Research, Inc., January 1993. + +[RFC1572] Alexander, S., Editor, "Telnet Environment Option", RFC1572, + Lachman Technology, Inc., January 1994. + +[RFC1647] Kelly, B., "TN3270 Enhancements", RFC1647, Auburn + University, July 1994. + + +PEOPLE + +[BA4] Brian Anderson + +[CLH3] Charles Hedrick + +[DB14] Dave Borman + +[DW183] David Waitzman + +[EAK4] Earl Kill + +[GM23] Glenn Marcy + +[JBP] Jon Postel + +[MRC] Mark Crispin + +[MS56] Marvin Solomon + +[RN6] Rudy Nedved + +[Schoch] Steven Schoch + +[SL70] Stuart Levy + +[SXS] Steve Silverman + +[YXR] Yakov Rekhter + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/telnet-options + + + + +Reynolds & Postel [Page 79] + +RFC 1700 Assigned Numbers October 1994 + + +DOMAIN NAME SYSTEM PARAMETERS + +The Internet Domain Naming System (DOMAIN) includes several +parameters. These are documented in [RFC1034] and [RFC1035]. The +CLASS parameter is listed here. The per CLASS parameters are defined +in separate RFCs as indicated. + +Domain System Parameters: + +Decimal Name References +-------- ---- ---------- + 0 Reserved [PM1] + 1 Internet (IN) [RFC1034,PM1] + 2 Unassigned [PM1] + 3 Chaos (CH) [PM1] + 4 Hessoid (HS) [PM1] + 5-65534 Unassigned [PM1] + 65535 Reserved [PM1] + +In the Internet (IN) class the following TYPEs and QTYPEs are defined: + +TYPE value and meaning + +A 1 a host address [RFC1035] +NS 2 an authoritative name server [RFC1035] +MD 3 a mail destination (Obsolete - use MX) [RFC1035] +MF 4 a mail forwarder (Obsolete - use MX) [RFC1035] +CNAME 5 the canonical name for an alias [RFC1035] +SOA 6 marks the start of a zone of authority [RFC1035] +MB 7 a mailbox domain name (EXPERIMENTAL) [RFC1035] +MG 8 a mail group member (EXPERIMENTAL) [RFC1035] +MR 9 a mail rename domain name (EXPERIMENTAL)[RFC1035] +NULL 10 a null RR (EXPERIMENTAL) [RFC1035] +WKS 11 a well known service description [RFC1035] +PTR 12 a domain name pointer [RFC1035] +HINFO 13 host information [RFC1035] +MINFO 14 mailbox or mail list information [RFC1035] +MX 15 mail exchange [RFC1035] +TXT 16 text strings [RFC1035] + +RP 17 for Responsible Person [RFC1183] +AFSDB 18 for AFS Data Base location [RFC1183] +X25 19 for X.25 PSDN address [RFC1183] +ISDN 20 for ISDN address [RFC1183] +RT 21 for Route Through [RFC1183] + +NSAP 22 for NSAP address, NSAP style A record [RFC1348] +NSAP-PTR 23 for domain name pointer, NSAP style [RFC1348] + + + +Reynolds & Postel [Page 80] + +RFC 1700 Assigned Numbers October 1994 + + +SIG 24 for security signature [Donald Eastlake] +KEY 25 for security key [Donald Eastlake] + +PX 26 X.400 mail mapping information [RFC1664] + +GPOS 27 Geographical Position [Craig Farrell] + +AAAA 28 IP6 Address [Susan Thomson] + +AXFR 252 transfer of an entire zone [RFC1035] +MAILB 253 mailbox-related RRs (MB, MG or MR) [RFC1035] +MAILA 254 mail agent RRs (Obsolete - see MX) [RFC1035] +* 255 A request for all records [RFC1035] + + +REFERENCES + +[RFC1034] Mockapetris, P., "Domain Names - Concepts and + Facilities", STD 13, RFC 1034, USC/Information Sciences + Institute, November 1987. + +[RFC1035] Mockapetris, P., "Domain Names - Implementation and + Specification", STD 13, RFC 1035, USC/Information Sciences + Institute, November 1987. + +[RFC1183] Everhart, C., Mamakos, L., Ullmann, R., and P. Mockapetris, + Editors, "New DNS RR Definitions", RFC 1183, Transarc, + University of Maryland, Prime Computer, USC/Information + Sciences Institute, October 1990. + +[RFC1348] Manning, B., "DNS NSAP RRs", RFC 1348, Rice University, + July 1992. + +[RFC1664] Allocchio, C., Bonito, A., Cole, B., Giordano, S., and R. + Hagens, "Using the Internet DNS to Distribute RFC1327 Mail + Address Mapping Tables", GARR-Italy, Cisco Systems Inc., + Centro Svizzero Calcolo Scientifico, Advanced Network & + Services, August 1994. + + +PEOPLE + +[Susan Thomson] Susan Thomson + +[PM1] Paul Mockapetris + +[Donald Eastlake] Donald E. Eastlake, III + + + + +Reynolds & Postel [Page 81] + +RFC 1700 Assigned Numbers October 1994 + + +[Craig Farrell] + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/dns-parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 82] + +RFC 1700 Assigned Numbers October 1994 + + +MAIL ENCODING HEADER FIELD KEYWORDS + + +[RFC1505] specifies an initial list of keywords for the experimental +encoding header field (EHF-MAIL), and provides that additional +keywords may be registered with the IANA. + + +Keyword Description Reference +_______ ___________ ____________ + +EDIFACT EDIFACT format [RFC1505] +EDI-X12 EDI X12 format [ANSI-X12] +EVFU FORTRAN format [RFC1505] +FS File System format [RFC1505] +Hex Hex binary format [RFC1505] +LZJU90 LZJU90 format [RFC1505] +LZW LZW format [RFC1505] +Message Encapsulated Message [RFC822] +PEM, PEM-Clear Privacy Enhanced Mail [RFC1421] +PGP Pretty Good Privacy [RFC1505] +Postscript Postscript format [POSTSCRIPT] +Shar Shell Archive format [RFC1505] +Signature Signature [RFC1505] +Tar Tar format [RFC1505] +Text Text [IS-10646] +uuencode uuencode format [RFC1505] +URL external URL-reference [RFC1505] + + + +MAIL ENCRYPTION TYPES + + +[RFC822] specifies that Encryption Types for mail may be assigned. +There are currently no RFC 822 encryption types assigned. Please use +instead the Mail Privacy procedures defined in [RFC1421, RFC1422, +RFC1423]. + + +ESMTP MAIL KEYWORDS + + +[RFC1651] specifies that extension to SMTP can be identified with +keywords. + + +Keywords Description Reference + + + +Reynolds & Postel [Page 83] + +RFC 1700 Assigned Numbers October 1994 + + +------------ -------------------------------- --------- +SEND Send as mail [RFC821] +SOML Send as mail or terminal [RFC821] +SAML Send as mail and terminal [RFC821] +EXPN Expand the mailing list [RFC821] +HELP Supply helpful information [RFC821] +TURN Turn the operation around [RFC821] +8BITMIME Use 8-bit data [RFC1652] +SIZE Message size declaration [RFC1653] +VERB Verbose [Eric Allman] +ONEX One message transaction only [Eric Allman] + + + +MAIL EXTENSION TYPES + + +The Simple Mail Transfer Protocol [RFC821] specifies a set of +commands or services for mail transfer. A general procedure for +extending the set of services is defined in [RFC1651]. The set of +service extensions is listed here. + + +Service Ext EHLO Keyword Parameters Verb Reference +----------- ------------ ---------- ---------- --------- +Send SEND none SEND [RFC821] +Send or Mail SOML none SOML [RFC821] +Send and Mail SAML none SAML [RFC821] +Expand EXPN none EXPN [RFC821] +Help HELP none HELP [RFC821] +Turn TURN none TURN [RFC821] +8 Bit MIME 8BITMIME none none [RFC1652] +Size SIZE number none [RFC1653] + + + +MAIL SYSTEM NAMES + + +In some places, an identification of other mail systems is used. + +One of these is in "The COSINE and Internet X.500 Schema" (section +9.3.18) [RFC1274]. The mail system names listed here are used as the +legal values in that schema under the "otherMailbox" attribute +"mailboxType" type (which must be a PrintableString). + +Another place is in "Mapping between X.400(1988) / ISO 10021 and RFC +822" (section 4.2.2) [RFC1327]. The names listed here are used as + + + +Reynolds & Postel [Page 84] + +RFC 1700 Assigned Numbers October 1994 + + +the legal values in that schema under the "std-or-address" attribute +"registered-dd-type" type (which must be a "key-string"). + +Note that key-string = . + + +Mail System Name Description Reference +---------------- ------------------------------- --------- +mcimail MCI Mail + + + +MAIL TRANSMISSION TYPES + + +The Simple Mail Transfer Protocol [RFC821] and the Standard for the +Format of ARPA Internet Text Messages [RFC822] specify that a set of +"Received" lines will be prepended to the headers of electronic mail +messages as they are transported through the Internet. These received +line may optionally include either or both a "via" phrase and/or a +"with" phrase. The legal values for the phrases are listed here. The +via phrase is intended to indicate the link or physical medium over +which the message was transferred. The with phrase is intended to +indicate the protocol or logical process that was used to transfer the +message. + + +VIA link types Description Reference +-------------- ---------------------------- --------- +UUCP Unix-to-Unix Copy Program [???] + + +WITH protocol types Description Reference +------------------- ---------------------------- --------- +SMTP Simple Mail Transfer Protocol [RFC821] +ESMTP SMTP with Service Extensions [RFC1651] + + +REFERENCES + + +[ANSI-X12] + +[POSTSCRIPT] Adobe Systems Inc., "PostScript Langpuage Reference +Manual", 2nd Edition, 2nd Printing, January 1991. + +[IS-10646] + + + + +Reynolds & Postel [Page 85] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, + USC/Information Sciences Institute, August 1982. + +[RFC822] Crocker, D., "Standard for the Format of ARPA-Internet Text + Messages", STD 11, RFC 822, UDEL, August 1982. + +[RFC1274] Barker, P., and S. Kille, "The COSINE and Internet X.500 + Schema", RFC 1274, University College London, November 1991. + +[RFC1327] Hardcastle-Kille, S., "Mapping between X.400(1988) / ISO + 10021 and RFC 822", RFC 1327, University College London, + May 1992. + +[RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic + Mail: Part I: Message Encipherment and Authentication + Procedures", RFC 1421, IAB IRTF PSRG, IETF PEM WG, + February 1993. + +[RFC1422] Kent, S., "Privacy Enhancement for Internet + Electronic Mail: Part II -- Certificate-Based Key + Management", BBN, IAB IRTF PSRG, IETF PEM, February 1993. + +[RFC1423] Balenson, D., "Privacy Enhancement for Internet Electronic + Mail: Part III -- Algorithms, Modes, and Identifiers", + RFC 1423, TIS, IAB IRTF PSRG, IETF PEM WG, February 1993. + +[RFC1505] Costanzo, A., Robinson, D., and R. Ullmann, "Encoding Header + Field for Internet Messages", RFC 1505, AKC Consulting, + Computervision Corporation, August 1993. + +[RFC1651] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. + Crocker, "SMTP Service Extensions", RFC 1651, MCI, Innosoft, + Dover Beach Consulting, Inc., Network Management Associates, + Inc., Silicon Graphics, Inc., July 1994. + +[RFC1652] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. + Crocker, "SMTP Service Extension for 8bit-MIMEtransport", + RFC 1652, MCI, Innosoft, Dover Beach Consulting, Inc., + Network Management Associates, Inc., Silicon Graphics, Inc., + July 1994. + +[RFC1653] Klensin, J., Freed, N., and K. Moore, "SMTP Service + Extension for Message Size Declaration", RFC 1653, + MCI, Innosoft, University of Tennessee, July 1994. + + +PEOPLE + + + + +Reynolds & Postel [Page 86] + +RFC 1700 Assigned Numbers October 1994 + + +[Eric Allman] + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/mail-parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 87] + +RFC 1700 Assigned Numbers October 1994 + + +BOOTP AND DHCP PARAMETERS + +The Bootstrap Protocol (BOOTP) [RFC951] describes an IP/UDP +bootstrap protocol (BOOTP) which allows a diskless client machine to +discover its own IP address, the address of a server host, and the +name of a file to be loaded into memory and executed. The Dynamic +Host Configuration Protocol (DHCP) [RFC1531] provides a framework for +automatic configuration of IP hosts. The "DHCP Options and BOOTP +Vendor Information Extensions" [RFC1533] describes the additions to the +Bootstrap Protocol (BOOTP) which can also be used as options with the +Dynamic Host Configuration Protocol (DHCP). + +BOOTP Vendor Extensions and DHCP Options are listed below: + + + Tag Name Data Length Meaning + --- ---- ----------- ------- + 0 Pad 0 None + 1 Subnet Mask 4 Subnet Mask Value + 2 Time Offset 4 Time Offset in + Seconds from UTC + 3 Gateways N N/4 Gateway addresses + 4 Time Server N N/4 Timeserver addresses + 5 Name Server N N/4 IEN-116 Server addresses + 6 Domain Server N N/4 DNS Server addresses + 7 Log Server N N/4 Logging Server addresses + 8 Quotes Server N N/4 Quotes Server addresses + 9 LPR Server N N/4 Printer Server addresses + 10 Impress Server N N/4 Impress Server addresses + 11 RLP Server N N/4 RLP Server addresses + 12 Hostname N Hostname string + 13 Boot File Size 2 Size of boot file in 512 byte + chunks + 14 Merit Dump File Client to dump and name + the file to dump it to + 15 Domain Name N The DNS domain name of the + client + 16 Swap Server N Swap Server addeess + 17 Root Path N Path name for root disk + 18 Extension File N Path name for more BOOTP info + + 19 Forward On/Off 1 Enable/Disable IP Forwarding + 20 SrcRte On/Off 1 Enable/Disable Source Routing + 21 Policy Filter N Routing Policy Filters + 22 Max DG Assembly 2 Max Datagram Reassembly Size + 23 Default IP TTL 1 Default IP Time to Live + 24 MTU Timeout 4 Path MTU Aging Timeout + 25 MTU Plateau N Path MTU Plateau Table + + + +Reynolds & Postel [Page 88] + +RFC 1700 Assigned Numbers October 1994 + + + 26 MTU Interface 2 Interface MTU Size + 27 MTU Subnet 1 All Subnets are Local + 28 Broadcast Address 4 Broadcast Address + 29 Mask Discovery 1 Perform Mask Discovery + 30 Mask Supplier 1 Provide Mask to Others + 31 Router Discovery 1 Perform Router Discovery + 32 Router Request 4 Router Solicitation Address + 33 Static Route N Static Routing Table + 34 Trailers 1 Trailer Encapsulation + 35 ARP Timeout 4 ARP Cache Timeout + 36 Ethernet 1 Ethernet Encapsulation + 37 Default TCP TTL 1 Default TCP Time to Live + 38 Keepalive Time 4 TCP Keepalive Interval + 39 Keepalive Data 1 TCP Keepalive Garbage + 40 NIS Domain N NIS Domain Name + 41 NIS Servers N NIS Server Addresses + 42 NTP Servers N NTP Server Addresses + 43 Vendor Specific N Vendor Specific Information + 44 NETBIOS Name Srv N NETBIOS Name Servers + 45 NETBIOS Dist Srv N NETBIOS Datagram Distribution + 46 NETBIOS Note Type 1 NETBIOS Note Type + 47 NETBIOS Scope N NETBIOS Scope + 48 X Window Font N X Window Font Server + 49 X Window Manmager N X Window Display Manager + 50 Address Request 4 Requested IP Address + 51 Address Time 4 IP Address Lease Time + 52 Overload 1 Overloaf "sname" or "file" + 53 DHCP Msg Type 1 DHCP Message Type + 54 DHCP Server Id 4 DHCP Server Identification + 55 Parameter List N Parameter Request List + 56 DHCP Message N DHCP Error Message + 57 DHCP Max Msg Size 2 DHCP Maximum Message Size + 58 Renewal Time 4 DHCP Renewal (T1) Time + 59 Rebinding Time 4 DHCP Rebinding (T2) Time + 60 Class Id N Class Identifier + 61 Client Id N Client Identifier + 62 Netware/IP Domain N Netware/IP Domain Name + 63 Netware/IP Option N Netware/IP sub Options + + + 64-127 Unassigned + 128-154 Reserved + + 255 End 0 None + + +REFERENCES + + + + +Reynolds & Postel [Page 89] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC951] Croft, B., and J. Gilmore, "BOOTSTRAP Protocol (BOOTP)", + RFC-951, Stanford and SUN Microsytems, September 1985. + +[RFC1531] Droms, R., "Dynamic Host Configuration Protocol", Bucknell + University, October 1993. + +[RFC1533] Alexander, S., and R. Droms, "DHCP Options and BOOTP Vendor + Extensions", Lachman Technology, Inc., Bucknell University, + October 1993. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/bootp-and-dhcp- +parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 90] + +RFC 1700 Assigned Numbers October 1994 + + +ADDRESS FAMILY NUMBERS + +Several protocols deal with multiple address families. The 16-bit +assignments are listed here. + + +Number Description Reference +------ ---------------------------------------------------- --------- + 0 Reserved + 1 IP (IP version 4) + 2 IP6 (IP version 6) + 3 NSAP + 4 HDLC (8-bit multidrop) + 5 BBN 1822 + 6 802 (includes all 802 media plus Ethernet "canonical format") + 7 E.163 + 8 E.164 (SMDS, Frame Relay, ATM) + 9 F.69 (Telex) + 10 X.121 (X.25, Frame Relay) + 11 IPX + 12 Appletalk + 13 Decnet IV + 14 Banyan Vines + 65535 Reserved + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/address-family-numbers + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 91] + +RFC 1700 Assigned Numbers October 1994 + + +FOOBAR AF NUMBERS + + +In the FTP Operation Over Big Address Records (FOOBAR) Protocol +[RFC1639] there is a field, called "address family" or "af", to +identify the lower level protocol addresses in use. This is an 8 bit +field. The first 16 assignments (0-15) of the af value are exactly +the same as the IP Version number. The assignment for values 16-255 +are listed here. + +Assigned FOOBAR Address Families + +Decimal Keyword Address Family References +------- ------- -------------- ---------- + 16 IPX Novell IPX +17-254 Unassigned + 255 Reserved + + +REFERENCES + +[RFC1639] Piscitello, D., "FTP Operation Over Big Address Records + (FOOBAR)", Core Competence, Inc., June 1994. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/foobar-af-numbers + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 92] + +RFC 1700 Assigned Numbers October 1994 + + +DIRECTORY SYSTEM NAMES + + +In the representation of distinquished names (and possibly other +contexts) of the X.500 Directory system, several unique keywords may +be necessary. For example, in the string representation of +distinguished names [RFC1485]. + +Keyword Attribute (X.520 keys) +------- --------------------------------- + CN CommonName + L LocalityName + ST StateOrProvinceName + O OrganizationName + OU OrganizationalUnitName + C CountryName + + +REFERENCES + +[RFC1485] Hardcastle-Kille, S., "A String Representation of + Distinguished Names (OSI-DS 23 (v5))", RFC1485, ISODE + Consortium, July 1993. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/directory-system-names + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 93] + +RFC 1700 Assigned Numbers October 1994 + + +PUBLISHER IDENTIFICATION CODE + +The RFC "A Format for E-Mailing Bibliographic Records" [RFC1357] +establishs a "publisher-ID" code. The IANA registry of these codes is +listed here. + + +Code Publisher Reference +------ ------------------------------------------------------- --------- +DUMMY for testing only [RFC1357] +TEST for testing only [RFC1357] +ISI Information Sciences Institute [JBP] + of the University of Southern California +UMCS University of Manchester Computer Science Department [TXC] + + +REFERENCES + +[RFC1357] Cohen, D., Editor, "A Format for E-mailing Bibliographic + Records", RFC 1357, USC/Information Sciences Institute, + July 1992. + +PEOPLE + +[JBP] Jon Postel + +[TXC] Tim Clement + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/publisher-id + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 94] + +RFC 1700 Assigned Numbers October 1994 + + +OSPF AUTHENTICATION CODES + + +The Open Shotrest Path First (OSPF) protocols has a provision for +authentication, and the type of authentication can me indicated by a +code number. The following are the registered authentication codes. + + +Code Authentication Method Reference +---- --------------------- --------- + 0 No Authentication [RFC1583] + 1 Simple Password Authentication [RFC1583] +2-65535 Reserved + + +REFERENCES + +[RFC1583] Moy, J., "OSPF Version 2", RFC 1583, Proteon, Inc., March + 1994. + +[RFC1584] Moy, J., "Multicast Extensions to OSPF", RFC 1584, Proteon, + Inc., March 1994. + +[RFC1585] Moy, J., "MOSPF: Analysis and Experience", RFC 1585, + Proteon, Inc., March 1994. + +[RFC1586] deSouza, O., and M. Rodrigues, "Guidelines for Running OSPF + Over Frame Relay Networks", RFC 1586, AT&T Bell + Laboratories, March 1994. + +[RFC1587] Coltun, R., and V. Fuller, "The OSPF NSSA Option", RFC 1587, + RainbowBridge Communications, BARRNet, March 1994. + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ospf-authentication- +codes + + + + + + + + + + + + +Reynolds & Postel [Page 95] + +RFC 1700 Assigned Numbers October 1994 + + +MEDIA TYPES + + +[RFC1521] specifies that Content Types, Content Subtypes, Character +Sets, Access Types, and Conversion values for MIME mail will be +assigned and listed by the IANA. + + +Content Types and Subtypes +-------------------------- + +Type Subtype Description Reference +---- ------- ----------- --------- +text plain [RFC1521,NSB] + richtext [RFC1521,NSB] + tab-separated-values [Paul Lindner] + +multipart mixed [RFC1521,NSB] + alternative [RFC1521,NSB] + digest [RFC1521,NSB] + parallel [RFC1521,NSB] + appledouble [MacMime,Patrik Faltstrom] + header-set [Dave Crocker] + +message rfc822 [RFC1521,NSB] + partial [RFC1521,NSB] + external-body [RFC1521,NSB] + news [RFC 1036, Henry Spencer] + +application octet-stream [RFC1521,NSB] + postscript [RFC1521,NSB] + oda [RFC1521,NSB] + atomicmail [atomicmail,NSB] + andrew-inset [andrew-inset,NSB] + slate [slate,terry crowley] + wita [Wang Info Transfer,Larry Campbell] + dec-dx [Digital Doc Trans, Larry Campbell] + dca-rft [IBM Doc Content Arch, Larry Campbell] + activemessage [Ehud Shapiro] + rtf [Paul Lindner] + applefile [MacMime,Patrik Faltstrom] + mac-binhex40 [MacMime,Patrik Faltstrom] + news-message-id [RFC1036, Henry Spencer] + news-transmission [RFC1036, Henry Spencer] + wordperfect5.1 [Paul Lindner] + pdf [Paul Lindner] + zip [Paul Lindner] + macwriteii [Paul Lindner] + + + +Reynolds & Postel [Page 96] + +RFC 1700 Assigned Numbers October 1994 + + + msword [Paul Lindner] + remote-printing [RFC1486,MTR] + +image jpeg [RFC1521,NSB] + gif [RFC1521,NSB] + ief Image Exchange Format [RFC1314] + tiff Tag Image File Format [MTR] + +audio basic [RFC1521,NSB] + +video mpeg [RFC1521,NSB] + quicktime [Paul Lindner] + +The "media-types" directory contains a subdirectory for each content +type and each of those directories contains a file for each content +subtype. + + |-application- + |-audio------- + |-image------- + |-media-types-|-message----- + |-multipart--- + |-text-------- + |-video------- + + URL = ftp://ftp.isi.edu/in-notes/iana/assignments/media-types + + +Character Sets +-------------- + +All of the character sets listed the section on Character Sets are +registered for use with MIME as MIME Character Sets. The +correspondance between the few character sets listed in the MIME +specification [RFC1521] and the list in that section are: + +Type Description Reference +---- ----------- --------- +US-ASCII see ANSI_X3.4-1968 below [RFC1521,NSB] +ISO-8859-1 see ISO_8859-1:1987 below [RFC1521,NSB] +ISO-8859-2 see ISO_8859-2:1987 below [RFC1521,NSB] +ISO-8859-3 see ISO_8859-3:1988 below [RFC1521,NSB] +ISO-8859-4 see ISO_8859-4:1988 below [RFC1521,NSB] +ISO-8859-5 see ISO_8859-5:1988 below [RFC1521,NSB] +ISO-8859-6 see ISO_8859-6:1987 below [RFC1521,NSB] +ISO-8859-7 see ISO_8859-7:1987 below [RFC1521,NSB] +ISO-8859-8 see ISO_8859-8:1988 below [RFC1521,NSB] +ISO-8859-9 see ISO_8859-9:1989 below [RFC1521,NSB] + + + +Reynolds & Postel [Page 97] + +RFC 1700 Assigned Numbers October 1994 + + +Access Types +------------ + +Type Description Reference +---- ----------- --------- +FTP [RFC1521,NSB] +ANON-FTP [RFC1521,NSB] +TFTP [RFC1521,NSB] +AFS [RFC1521,NSB] +LOCAL-FILE [RFC1521,NSB] +MAIL-SERVER [RFC1521,NSB] + + + +Conversion Values +----------------- + +Conversion values or Content Transfer Encodings. + +Type Description Reference +---- ----------- --------- +7BIT [RFC1521,NSB] +8BIT [RFC1521,NSB] +BASE64 [RFC1521,NSB] +BINARY [RFC1521,NSB] +QUOTED-PRINTABLE [RFC1521,NSB] + + +MIME / X.400 MAPPING TABLES + +MIME to X.400 Table + + MIME content-type X.400 Body Part Reference + ----------------- ------------------ --------- + text/plain + charset=us-ascii ia5-text [RFC1494] + charset=iso-8859-x EBP - GeneralText [RFC1494] + text/richtext no mapping defined [RFC1494] + application/oda EBP - ODA [RFC1494] + application/octet-stream bilaterally-defined [RFC1494] + application/postscript EBP - mime-postscript-body [RFC1494] + image/g3fax g3-facsimile [RFC1494] + image/jpeg EBP - mime-jpeg-body [RFC1494] + image/gif EBP - mime-gif-body [RFC1494] + audio/basic no mapping defined [RFC1494] + video/mpeg no mapping defined [RFC1494] + + Abbreviation: EBP - Extended Body Part + + + +Reynolds & Postel [Page 98] + +RFC 1700 Assigned Numbers October 1994 + + +X.400 to MIME Table + + + Basic Body Parts + + X.400 Basic Body Part MIME content-type Reference + --------------------- -------------------- --------- + ia5-text text/plain;charset=us-ascii [RFC1494] + voice No Mapping Defined [RFC1494] + g3-facsimile image/g3fax [RFC1494] + g4-class1 no mapping defined [RFC1494] + teletex no mapping defined [RFC1494] + videotex no mapping defined [RFC1494] + encrypted no mapping defined [RFC1494] + bilaterally-defined application/octet-stream [RFC1494] + nationally-defined no mapping defined [RFC1494] + externally-defined See Extended Body Parts [RFC1494] + + X.400 Extended Body Part MIME content-type Reference + ------------------------- -------------------- --------- + GeneralText text/plain;charset=iso-8859-x[RFC1494] + ODA application/oda [RFC1494] + mime-postscript-body application/postscript [RFC1494] + mime-jpeg-body image/jpeg [RFC1494] + mime-gif-body image/gif [RFC1494] + +REFERENCES + +[MacMime] Work in Progress. + +[RFC1036] Horton, M., and R. Adams, "Standard for Interchange of + USENET Messages", RFC 1036, AT&T Bell Laboratories, + Center for Seismic Studies, December 1987. + +[RFC1494] Alvestrand, H., and S. Thompson, "Equivalences between 1988 + X.400 and RFC-822 Message Bodies", RFC 1494, SINTEF DELAB, + Soft*Switch, Inc., August 1993. + +[RFC1521] Borenstien, N., and N. Freed, "MIME (Multipurpose Internet + Mail Extensions) Part One: Mechanisms for Specifying and + Describing the Format of Internet Message Bodies", RFC 1521, + Bellcore, Innosoft, September 1993. + +PEOPLE + +[Larry Campbell] + +[Dave Crocker] Dave Crocker + + + +Reynolds & Postel [Page 99] + +RFC 1700 Assigned Numbers October 1994 + + +[Terry Crowley] + +[NSB] Nathaniel Borenstein + +[MTR] Marshall Rose + +[Paul Lindner] + +[PXF] Patrik Faltstrom + +[Ehud Shapiro] + +[Henry Spencer] + +[] + + + + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media- +types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 100] + +RFC 1700 Assigned Numbers October 1994 + + +CHARACTER SETS + +These are the official names for character sets that may be used in +the Internet and may be referred to in Internet documentation. These +names are expressed in ANSI_X3.4-1968 which is commonly called +US-ASCII or simply ASCII. The character set most commonly use in the +Internet and used especially in protocol standards is US-ASCII, this +is strongly encouraged. The use of the name US-ASCII is also +encouraged. + +The character set names may be up to 40 characters taken from the +printable characters of US-ASCII. However, no distinction is made +between use of upper and lower case letters. + + +Character Set Reference +------------- --------- + +Name: ANSI_X3.4-1968 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-6 +Alias: ANSI_X3.4-1986 +Alias: ISO_646.irv:1991 +Alias: ASCII +Alias: ISO646-US +Alias: US-ASCII +Alias: us +Alias: IBM367 +Alias: cp367 + +Name: ISO-10646-UCS-2 +Source: the 2-octet Basic Multilingual Plane, aka Unicode + this needs to specify network byte order: the standard + does not specify (it is a 16-bit integer space) + +Name: ISO-10646-UCS-4 +Source: the full code space. (same comment about byte order, + these are 31-bit numbers. + +Name: ISO-10646-UTF-1 +Source: Universal Transfer Format (1), this is the multibyte + encoding, that subsets ASCII-7. It does not have byte + ordering issues. + +Name: ISO_646.basic:1983 [RFC1345,KXS2] +Source: ECMA registry +Alias: ref + + + + +Reynolds & Postel [Page 101] + +RFC 1700 Assigned Numbers October 1994 + + +Name: INVARIANT [RFC1345,KXS2] + +Name: ISO_646.irv:1983 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-2 +Alias: irv + +Name: BS_4730 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-4 +Alias: ISO646-GB +Alias: gb +Alias: uk + +Name: NATS-SEFI [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-8-1 + +Name: NATS-SEFI-ADD [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-8-2 + +Name: NATS-DANO [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-9-1 + +Name: NATS-DANO-ADD [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-9-2 + +Name: SEN_850200_B [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-10 +Alias: FI +Alias: ISO646-FI +Alias: ISO646-SE +Alias: se + +Name: SEN_850200_C [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-11 +Alias: ISO646-SE2 +Alias: se2 + +Name: KS_C_5601-1987 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-149 +Alias: KS_C_5601-1989 + + + +Reynolds & Postel [Page 102] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: KSC_5601 +Alias: korean + +Name: ISO-2022-KR [RFC1557,Choi] +Source: RFC-1557 (see also KS_C_5601-1987) + +Name: EUC-KR [RFC1557,Choi] +Source: RFC-1557 (see also KS_C_5861-1992) + +Name: ISO-2022-JP [RFC1468,Murai] +Source: RFC-1468 + +Name: ISO-2022-JP-2 [RFC1554,Ohta] +Source: RFC-1554 + +Name: JIS_C6220-1969-jp [RFC1345,KXS2] +Source: ECMA registry +Alias: JIS_C6220-1969 +Alias: iso-ir-13 +Alias: katakana +Alias: x0201-7 + +Name: JIS_C6220-1969-ro [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-14 +Alias: jp +Alias: ISO646-JP + +Name: IT [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-15 +Alias: ISO646-IT + +Name: PT [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-16 +Alias: ISO646-PT + +Name: ES [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-17 +Alias: ISO646-ES + +Name: greek7-old [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-18 + +Name: latin-greek [RFC1345,KXS2] + + + +Reynolds & Postel [Page 103] + +RFC 1700 Assigned Numbers October 1994 + + +Source: ECMA registry +Alias: iso-ir-19 + +Name: DIN_66003 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-21 +Alias: de +Alias: ISO646-DE + +Name: NF_Z_62-010_(1973) [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-25 +Alias: ISO646-FR1 + +Name: Latin-greek-1 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-27 + +Name: ISO_5427 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-37 + +Name: JIS_C6226-1978 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-42 + +Name: BS_viewdata [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-47 + +Name: INIS [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-49 + +Name: INIS-8 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-50 + +Name: INIS-cyrillic [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-51 + +Name: ISO_5427:1981 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-54 + +Name: ISO_5428:1980 [RFC1345,KXS2] +Source: ECMA registry + + + +Reynolds & Postel [Page 104] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: iso-ir-55 + +Name: GB_1988-80 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-57 +Alias: cn +Alias: ISO646-CN + +Name: GB_2312-80 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-58 +Alias: chinese + +Name: NS_4551-1 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-60 +Alias: ISO646-NO +Alias: no + +Name: NS_4551-2 [RFC1345,KXS2] +Source: ECMA registry +Alias: ISO646-NO2 +Alias: iso-ir-61 +Alias: no2 + +Name: NF_Z_62-010 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-69 +Alias: ISO646-FR +Alias: fr + +Name: videotex-suppl [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-70 + +Name: PT2 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-84 +Alias: ISO646-PT2 + +Name: ES2 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-85 +Alias: ISO646-ES2 + +Name: MSZ_7795.3 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-86 + + + +Reynolds & Postel [Page 105] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: ISO646-HU +Alias: hu + +Name: JIS_C6226-1983 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-87 +Alias: x0208 +Alias: JIS_X0208-1983 + +Name: greek7 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-88 + +Name: ASMO_449 [RFC1345,KXS2] +Source: ECMA registry +Alias: ISO_9036 +Alias: arabic7 +Alias: iso-ir-89 + +Name: iso-ir-90 [RFC1345,KXS2] +Source: ECMA registry + +Name: JIS_C6229-1984-a [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-91 +Alias: jp-ocr-a + +Name: JIS_C6229-1984-b [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-92 +Alias: ISO646-JP-OCR-B +Alias: jp-ocr-b + +Name: JIS_C6229-1984-b-add [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-93 +Alias: jp-ocr-b-add + +Name: JIS_C6229-1984-hand [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-94 +Alias: jp-ocr-hand + +Name: JIS_C6229-1984-hand-add [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-95 +Alias: jp-ocr-hand-add + + + + +Reynolds & Postel [Page 106] + +RFC 1700 Assigned Numbers October 1994 + + +Name: JIS_C6229-1984-kana [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-96 + +Name: ISO_2033-1983 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-98 +Alias: e13b + +Name: ANSI_X3.110-1983 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-99 +Alias: CSA_T500-1983 +Alias: NAPLPS + +Name: ISO_8859-1:1987 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-100 +Alias: ISO_8859-1 +Alias: ISO-8859-1 +Alias: latin1 +Alias: l1 +Alias: IBM819 +Alias: CP819 + +Name: ISO_8859-2:1987 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-101 +Alias: ISO_8859-2 +Alias: ISO-8859-2 +Alias: latin2 +Alias: l2 + +Name: T.61-7bit [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-102 + +Name: T.61-8bit [RFC1345,KXS2] +Alias: T.61 +Source: ECMA registry +Alias: iso-ir-103 + +Name: ISO_8859-3:1988 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-109 +Alias: ISO_8859-3 +Alias: ISO-8859-3 +Alias: latin3 + + + +Reynolds & Postel [Page 107] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: l3 + +Name: ISO_8859-4:1988 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-110 +Alias: ISO_8859-4 +Alias: ISO-8859-4 +Alias: latin4 +Alias: l4 + +Name: ECMA-cyrillic [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-111 + +Name: CSA_Z243.4-1985-1 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-121 +Alias: ISO646-CA +Alias: csa7-1 +Alias: ca + +Name: CSA_Z243.4-1985-2 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-122 +Alias: ISO646-CA2 +Alias: csa7-2 + +Name: CSA_Z243.4-1985-gr [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-123 + +Name: ISO_8859-6:1987 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-127 +Alias: ISO_8859-6 +Alias: ISO-8859-6 +Alias: ECMA-114 +Alias: ASMO-708 +Alias: arabic + +Name: ISO_8859-6-E [RFC1556,IANA] +Source: RFC-1556 + +Name: ISO_8859-6-I [RFC1556,IANA] +Source: RFC-1556 + +Name: ISO_8859-7:1987 [RFC1345,KXS2] +Source: ECMA registry + + + +Reynolds & Postel [Page 108] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: iso-ir-126 +Alias: ISO_8859-7 +Alias: ISO-8859-7 +Alias: ELOT_928 +Alias: ECMA-118 +Alias: greek +Alias: greek8 + +Name: T.101-G2 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-128 + +Name: ISO_8859-8:1988 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-138 +Alias: ISO_8859-8 +Alias: ISO-8859-8 +Alias: hebrew + +Name: ISO_8859-8-E [RFC1556,Nussbacher] +Source: RFC-1556 + +Name: ISO_8859-8-I [RFC1556,Nussbacher] +Source: RFC-1556 + +Name: CSN_369103 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-139 + +Name: JUS_I.B1.002 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-141 +Alias: ISO646-YU +Alias: js +Alias: yu + +Name: ISO_6937-2-add [RFC1345,KXS2] +Source: ECMA registry and ISO 6937-2:1983 +Alias: iso-ir-142 + +Name: IEC_P27-1 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-143 + +Name: ISO_8859-5:1988 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-144 +Alias: ISO_8859-5 + + + +Reynolds & Postel [Page 109] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: ISO-8859-5 +Alias: cyrillic + +Name: JUS_I.B1.003-serb [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-146 +Alias: serbian + +Name: JUS_I.B1.003-mac [RFC1345,KXS2] +Source: ECMA registry +Alias: macedonian +Alias: iso-ir-147 + +Name: ISO_8859-9:1989 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-148 +Alias: ISO_8859-9 +Alias: ISO-8859-9 +Alias: latin5 +Alias: l5 + +Name: greek-ccitt [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-150 + +Name: NC_NC00-10:81 [RFC1345,KXS2] +Source: ECMA registry +Alias: cuba +Alias: iso-ir-151 +Alias: ISO646-CU + +Name: ISO_6937-2-25 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-152 + +Name: GOST_19768-74 [RFC1345,KXS2] +Source: ECMA registry +Alias: ST_SEV_358-88 +Alias: iso-ir-153 + +Name: ISO_8859-supp [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-154 +Alias: latin1-2-5 + +Name: ISO_10367-box [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-155 + + + +Reynolds & Postel [Page 110] + +RFC 1700 Assigned Numbers October 1994 + + +Name: latin6 [RFC1345,KXS2] +Source: ECMA registry +Alias: iso-ir-157 +Alias: l6 + +Name: latin-lap [RFC1345,KXS2] +Source: ECMA registry +Alias: lap +Alias: iso-ir-158 + +Name: JIS_X0212-1990 [RFC1345,KXS2] +Source: ECMA registry +Alias: x0212 +Alias: iso-ir-159 + +Name: DS_2089 [RFC1345,KXS2] +Source: Danish Standard, DS 2089, February 1974 +Alias: DS2089 +Alias: ISO646-DK +Alias: dk + +Name: us-dk [RFC1345,KXS2] + +Name: dk-us [RFC1345,KXS2] + +Name: JIS_X0201 [RFC1345,KXS2] +Alias: X0201 + +Name: KSC5636 [RFC1345,KXS2] +Alias: ISO646-KR + +Name: DEC-MCS [RFC1345,KXS2] +Source: VAX/VMS User's Manual, + Order Number: AI-Y517A-TE, April 1986. +Alias: dec + +Name: hp-roman8 [RFC1345,KXS2] +Source: LaserJet IIP Printer User's Manual, + HP part no 33471-90901, Hewlet-Packard, June 1989. +Alias: roman8 +Alias: r8 + +Name: macintosh [RFC1345,KXS2] +Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991 +Alias: mac + +Name: IBM037 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + + + +Reynolds & Postel [Page 111] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: cp037 +Alias: ebcdic-cp-us +Alias: ebcdic-cp-ca +Alias: ebcdic-cp-wt +Alias: ebcdic-cp-nl + +Name: IBM038 [RFC1345,KXS2] +Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 +Alias: EBCDIC-INT +Alias: cp038 + +Name: IBM273 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP273 + +Name: IBM274 [RFC1345,KXS2] +Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 +Alias: EBCDIC-BE +Alias: CP274 + +Name: IBM275 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: EBCDIC-BR +Alias: cp275 + +Name: IBM277 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: EBCDIC-CP-DK +Alias: EBCDIC-CP-NO + +Name: IBM278 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP278 +Alias: ebcdic-cp-fi +Alias: ebcdic-cp-se + +Name: IBM280 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP280 +Alias: ebcdic-cp-it + +Name: IBM281 [RFC1345,KXS2] +Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 +Alias: EBCDIC-JP-E +Alias: cp281 + +Name: IBM284 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + + + +Reynolds & Postel [Page 112] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: CP284 +Alias: ebcdic-cp-es + +Name: IBM285 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP285 +Alias: ebcdic-cp-gb + +Name: IBM290 [RFC1345,KXS2] +Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 +Alias: cp290 +Alias: EBCDIC-JP-kana + +Name: IBM297 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp297 +Alias: ebcdic-cp-fr + +Name: IBM420 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990, + IBM NLS RM p 11-11 +Alias: cp420 +Alias: ebcdic-cp-ar1 + +Name: IBM423 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp423 +Alias: ebcdic-cp-gr + +Name: IBM424 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp424 +Alias: ebcdic-cp-he + +Name: IBM437 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp437 +Alias: 437 + +Name: IBM500 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP500 +Alias: ebcdic-cp-be +Alias: ebcdic-cp-ch + +Name: IBM850 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp850 + + + +Reynolds & Postel [Page 113] + +RFC 1700 Assigned Numbers October 1994 + + +Alias: 850 + +Name: IBM851 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp851 +Alias: 851 + +Name: IBM852 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp852 +Alias: 852 + +Name: IBM855 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp855 +Alias: 855 + +Name: IBM857 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp857 +Alias: 857 + +Name: IBM860 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp860 +Alias: 860 + +Name: IBM861 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp861 +Alias: 861 +Alias: cp-is + +Name: IBM862 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp862 +Alias: 862 + +Name: IBM863 [RFC1345,KXS2] +Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 +Alias: cp863 +Alias: 863 + +Name: IBM864 [RFC1345,KXS2] +Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 +Alias: cp864 + +Name: IBM865 [RFC1345,KXS2] + + + +Reynolds & Postel [Page 114] + +RFC 1700 Assigned Numbers October 1994 + + +Source: IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987) +Alias: cp865 +Alias: 865 + +Name: IBM868 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP868 +Alias: cp-ar + +Name: IBM869 [RFC1345,KXS2] +Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 +Alias: cp869 +Alias: 869 +Alias: cp-gr + +Name: IBM870 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP870 +Alias: ebcdic-cp-roece +Alias: ebcdic-cp-yu + +Name: IBM871 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP871 +Alias: ebcdic-cp-is + +Name: IBM880 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp880 +Alias: EBCDIC-Cyrillic + +Name: IBM891 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp891 + +Name: IBM903 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp903 + +Name: IBM904 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: cp904 +Alias: 904 + +Name: IBM905 [RFC1345,KXS2] +Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 +Alias: CP905 +Alias: ebcdic-cp-tr + + + +Reynolds & Postel [Page 115] + +RFC 1700 Assigned Numbers October 1994 + + +Name: IBM918 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP918 +Alias: ebcdic-cp-ar2 + +Name: IBM1026 [RFC1345,KXS2] +Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 +Alias: CP1026 + +Name: EBCDIC-AT-DE [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-AT-DE-A [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-CA-FR [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-DK-NO [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-DK-NO-A [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-FI-SE [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-FI-SE-A [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-FR [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-IT [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-PT [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-ES [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-ES-A [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-ES-S [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + + + + +Reynolds & Postel [Page 116] + +RFC 1700 Assigned Numbers October 1994 + + +Name: EBCDIC-UK [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: EBCDIC-US [RFC1345,KXS2] +Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + +Name: UNKNOWN-8BIT [RFC1428] + +Name: MNEMONIC [RFC1345,KXS2] +Source: RFC 1345, also known as "mnemonic+ascii+38" + +Name: MNEM [RFC1345,KXS2] +Source: RFC 1345, also known as "mnemonic+ascii+8200" + +Name: VISCII [RFC1456] +Source: RFC 1456 + +Name: VIQR [RFC1456] +Source: RFC 1456 + +Name: KOI8-R [RFC1489] +Source: RFC 1489, based on GOST-19768-74, ISO-6937/8, + INIS-Cyrillic, ISO-5427. + +Name: UNICODE-1-1 [RFC1641] +Source: RFC 1641 + +Name: UNICODE-1-1-UTF-7 [RFC1642] +Source: RFC 1642 + +REFERENCES + +[RFC1345] Simonsen, K., "Character Mnemonics & Character Sets", + RFC 1345, Rationel Almen Planlaegning, Rationel Almen + Planlaegning, June 1992. + +[RFC1428] Vaudreuil, G., "Transition of Internet Mail from + Just-Send-8 to 8bit-SMTP/MIME", RFC1428, CNRI, February + 1993. + +[RFC1456] Vietnamese Standardization Working Group, "Conventions for + Encoding the Vietnamese Language VISCII: VIetnamese + Standard Code for Information Interchange VIQR: VIetnamese + Quoted-Readable Specification Revision 1.1", RFC 1456, May + 1993. + +[RFC1468] Murai, J., Crispin, M., and E. van der Poel, "Japanese + Character Encoding for Internet Messages", RFC 1468, + + + +Reynolds & Postel [Page 117] + +RFC 1700 Assigned Numbers October 1994 + + + Keio University, Panda Programming, June 1993. + +[RFC1489] Chernov, A., "Registration of a Cyrillic Character Set", + RFC1489, RELCOM Development Team, July 1993. + +[RFC1554] Ohta, M., and K. Handa, "ISO-2022-JP-2: Multilingual + Extension of ISO-2022-JP", RFC1554, Tokyo Institute of + Technology, ETL, December 1993. + +[RFC1556] Nussbacher, H., "Handling of Bi-directional Texts in MIME", + RFC1556, Israeli Inter-University, December 1993. + +[RFC1557] Choi, U., Chon, K., and H. Park, "Korean Character Encoding + for Internet Messages", KAIST, Solvit Chosun Media, + December 1993. + +[RFC1641] Goldsmith, D., and M. Davis, "Using Unicode with MIME", + RFC1641, Taligent, Inc., July 1994. + +[RFC1642] Goldsmith, D., and M. Davis, "UTF-7", RFC1642, Taligent, + Inc., July 1994. + +PEOPLE + +[KXS2] Keld Simonsen + +[Choi] Uhhyung Choi + +[Murai] Jun Murai + +[Ohta] Masataka Ohta + +[Nussbacher] Hank Nussbacher + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets + + + + + + + + + + + + +Reynolds & Postel [Page 118] + +RFC 1700 Assigned Numbers October 1994 + + +NETWORK MANAGEMENT PARAMETERS + +For the management of hosts and gateways on the Internet a data +structure for the information has been defined. This data structure +should be used with any of several possible management protocols, such +as the "Simple Network Management Protocol" (SNMP) [RFC1157], or the +"Common Management Information Protocol over TCP" (CMOT) [RFC1095]. + +The data structure is the "Structure and Indentification of Management +Information for TCP/IP-based Internets" (SMI) [RFC1155], and the +"Management Information Base for Network Management of TCP/IP-based +Internets" (MIB-II) [RFC1213]. + +The SMI includes the provision for panrameters or codes to indicate +experimental or private data structures. These parameter assignments +are listed here. + +The older "Simple Gateway Monitoring Protocol" (SGMP) [RFC1028] also +defined a data structure. The parameter assignments used with SGMP +are included here for historical completeness. + +The network management object identifiers are under the iso (1), org +(3), dod (6), internet (1), or 1.3.6.1, branch of the name space. + +The major branches are: + +1 iso +1.3 org +1.3.6 dod +1.3.6.1 internet +1.3.6.1.1 directory +1.3.6.1.2 mgmt +1.3.6.1.2.1 mib-2 +1.3.6.1.2.1.2.2.1.3 ifType +1.3.6.1.2.1.10 transmission +1.3.6.1.2.1.10.23 transmission.ppp +1.3.6.1.2.1.27 application +1.3.6.1.2.1.28 mta +1.3.6.1.3 experimental +1.3.6.1.4 private +1.3.6.1.4.1 enterprise +1.3.6.1.5 security +1.3.6.1.6 SNMPv2 +1.3.6.1.7 mail + +SMI Network Management Directory Codes: + +Prefix: iso.org.dod.internet.directory (1.3.6.1.1.) + + + +Reynolds & Postel [Page 119] + +RFC 1700 Assigned Numbers October 1994 + + +Decimal Name Description References +------- ---- ----------- ---------- + all Reserved Reserved for future use [IANA] + +SMI Network Management MGMT Codes: + +Prefix: iso.org.dod.internet.mgmt (1.3.6.1.2.) + +Decimal Name Description References +------- ---- ----------- ---------- + 0 Reserved [IANA] + 1 MIB [KZM] + +Prefix: iso.org.dod.internet.mgmt.mib-2 (1.3.6.1.2.1) + +Decimal Name Description References +------- ---- ----------- ---------- + 0 Reserved Reserved [IANA] + 1 system System [RFC1213,KZM] + 2 interfaces Interfaces [RFC1213,KZM] + 3 at Address Translation [RFC1213,KZM] + 4 ip Internet Protocol [RFC1213,KZM] + 5 icmp Internet Control Message [RFC1213,KZM] + 6 tcp Transmission Control Protocol[RFC1213,KZM] + 7 udp User Datagram Protocol [RFC1213,KZM] + 8 egp Exterior Gateway Protocol [RFC1213,KZM] + 9 cmot CMIP over TCP [RFC1213,KZM] + 10 transmission Transmission [RFC1213,KZM] + 11 snmp Simple Network Management [RFC1213,KZM] + 12 GenericIF Generic Interface Extensions +-- [RFC1229,RFC1239,KZM] + 13 Appletalk Appletalk Networking [RFC1243,SXW] + 14 ospf Open Shortest Path First [RFC1253,FB77] + 15 bgp Border Gateway Protocol [RFC1657] + 16 rmon Remote Network Monitoring [RFC1271,SXW] + 17 bridge Bridge Objects [RFC1286,EXD] + 18 DecnetP4 Decnet Phase 4 [RFC1559, Saperia] + 19 Character Character Streams [RFC1658] + 20 snmpParties SNMP Parties [RFC1353,KZM] + 21 snmpSecrets SNMP Secrets [RFC1353,KZM] + 22 snmpDot3RptrMgt [RFC1516] + 23 rip-2 Routing Information Protocol [RFC1389] + 24 ident Identification Protocol [RFC1414] + 25 host Host Resources [RFC1514] + 26 snmpDot3MauMgt 802.3 Medium Attachment Units [RFC1515] + 27 application Network Services Monitoring [RFC1565] + 28 mta Mail Monitoring [RFC1566] + 29 dsa X.500 Directory Monitoring [RFC1567] + + + +Reynolds & Postel [Page 120] + +RFC 1700 Assigned Numbers October 1994 + + + 30 IANAifType Interface Types [RFC1573] + 31 ifMIB Interface Types [RFC1573] + 32 dns Domain Name System [RFC1611] + 33 upsMIB Uninterruptible Power Supplies [RFC1628] + 34 sannauMIB SNA NAU MIB [RFC1665] + 35 etherMIB Ethernet-like generic objects [RFC1650] + 36 sipMIB SMDS inteface objects [RFC1694] + 37 atmMIB ATM objects [RFC1695] + 38 mdmMIB Dial-up modem objects [RFC1696] + 39 rdbmsMIB relational database objects [RFC1697] + +Prefix: iso.org.dod.internet.mgmt.mib-2.interface (1.3.6.1.2.1.2) + +(1.3.6.1.2.1.2.2.1.3) + +ifType definitions + +Decimal Name Description +------- ---- ----------- + 1 other none of the following [RFC1213] + 2 regular1822 BBN Report 1822 [RFC1213] + 3 hdh1822 BBN Report 1822 [RFC1213] + 4 ddn-x25 BBN Report 1822 [RFC1213] + 5 x25 X.25 [RFC1382] + 6 ethernet-csmacd [RFC1213] + 7 IEEE802.3 CSMACD--like Objects [RF1284,JXC] + 8 IEEE802.4 Token Bus-like Objects +-- [RFC1230,RFC1239,KZM] + 9 IEEE802.5 Token Ring-like Objects +-- [RFC1231,RFC1239,KZM] + 10 iso88026-man [RFC1213] + 11 starLan [RFC1213] + 12 proteon-10Mbit [RFC1213] + 13 proteon-80Mbit [RFC1213] + 14 hyperchannel [RFC1213] + 15 FDDI FDDI Objects [RFC1285,JDC20] + 16 lapb LAP B [RFC1381] + 17 sdlc [RFC1213] + 18 ds1 T1/E1 Carrier Objects [RFC1406] + 19 e1 obsolete + 20 basicISDN [RFC1213] + 21 primaryISDN [RFC1213] + 22 propPointToPointSerial [RFC1213] + 23 ppp Point-to-Point Protocol [RFC1471] + 24 softwareLoopback [RFC1213] + 25 eon [RFC1213] + 26 ethernet-3Mbit [RFC1213] + 27 nsip [RFC1213] + + + +Reynolds & Postel [Page 121] + +RFC 1700 Assigned Numbers October 1994 + + + 28 slip [RFC1213] + 29 ultra [RFC1213] + 30 ds3 DS3/E3 Interface Objects [RFC1407] + 31 sip SMDS Interface Objects [RFC1304,TXC] + 32 frame-relay Frame Relay Objects [RFC1315,CXB] + 33 RS-232 RS-232 Objects [RFC1659] + 34 Parallel Parallel Printer Objects [RFC1660] + 35 arcnet ARC network + 36 arcnet-plus ARC network plus + 37 atm ATM + 38 MIOX25 MIOX25 [RFC1461] + 39 SONET SONET or SDH + 40 x25ple X.25 packet level [RFC1382] + 41 iso88022llc 802.2 LLC + 42 localTalk + 43 smds-dxi SMDS DXI + 44 frameRelayService Frame Relay DCE + 45 v35 V.35 + 46 hssi HSSI + 47 hippi HIPPI + 48 modem generic modem + 49 aal5 AAL5 over ATM + 50 sonetPath + 51 sonetVT + 52 smds-icip SMDS Inter-Carrier Interface Protocol + 53 propVirtual proprietary vitural/internal interface + 54 propMultiLink proprietary multi-link multiplexing + 55 IEEE802.12 100BaseVG + 56 fibre-channel Fibre Channel + +Prefix: iso.org.dod.internet.mgmt.mib-2.transmission (1.3.6.1.2.1.10) + +Decimal Name Description +------- ---- ----------- + 5 x25 X.25 [RFC1382] + 7 IEEE802.3 CSMACD--like Objects [RFC1650] + 8 IEEE802.4 Token Bus-like Objects +-- [RFC1230,RFC1239,KZM] + 9 IEEE802.5 Token Ring-like Objects +-- [RFC1231,RFC1239,KZM] + 15 FDDI FDDI Objects [RFC1285,JDC20] + 16 lapb LAP B [RFC1381] + 18 ds1 T1 Carrier Objects [RFC1406] + 19 e1 E1 Carrier Objects [RFC1406] + 23 ppp Point-to-Point Protocol [RFC1471] + 30 ds3 DS3/E3 Interface Objects [RFC1407] + 31 sip SMDS Interface Objects [RFC1694] + 32 frame-relay Frame Relay Objects [RFC1315,CXB] + + + +Reynolds & Postel [Page 122] + +RFC 1700 Assigned Numbers October 1994 + + + 33 RS-232 RS-232 Objects [RFC1659] + 34 Parallel Parallel Printer Objects [RFC1660] + 35 arcnet ARC network + 36 arcnet-plus ARC network plus + 37 atm ATM + 38 MIOX25 MIOX25 [RFC1461] + 39 sonetMIB SONET MIB [RFC1595] + 44 frnetservMIB Frame Relay Service MIB for DCE [RFC1596] + +Prefix: iso.org.dod.internet.mgmt.mib-2.transmission (1.3.6.1.2.1.10) + +(1.3.6.1.2.1.10.23) + +Decimal Name Description References +------- ---- ----------- ---------- + 1 pppLcp ppp link control [RFC1471] + 2 pppSecurity ppp security [RFC1472] + 3 pppIp ppp IP network control [RFC1473] + 4 pppBridge ppp bridge networl control [RFC1474] + +Prefix: iso.org.dod.internet.mgmt.mib-2.application (1.3.6.1.2.1.27) + +(1.3.6.1.2.1.27.2.1.3) + + assocApplicationProtocol OBJECT-TYPE + SYNTAX OBJECT IDENTIFIER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "An identification of the protocol being used for the + application. For an OSI Application, this will be the + Application Context. For Internet applications, the IANA + maintains a registry of the OIDs which correspond to + well-known applications. If the application protocol is + not listed in the registry, an OID value of the form + {applTCPProtoID port} or {applUDProtoID port} are used for + TCP-based and UDP-based protocols, respectively. In either + case 'port' corresponds to the primary port number being + used by the protocol." + ::= {assocEntry 3} + +Decimal Name Description +------- ---- ----------- + 0 Reserved + +(1.3.6.1.2.1.27.3) + +(1.3.6.1.2.1.27.4) + + + +Reynolds & Postel [Page 123] + +RFC 1700 Assigned Numbers October 1994 + + + -- OIDs of the form {applTCPProtoID port} are intended to be used + -- for TCP-based protocols that don't have OIDs assigned by other + -- means. {applUDPProtoID port} serves the same purpose for + -- UDP-based protocols. In either case 'port' corresponds to + -- the primary port number being used by the protocol. For example, + -- assuming no other OID is assigned for SMTP, an OID of + -- {applTCPProtoID 25} could be used, since SMTP is a TCP-based + -- protocol that uses port 25 as its primary port. + +Prefix: iso.org.dod.internet.mgmt.mib-2.mta (1.3.6.1.2.1.28) + +(1.3.6.1.2.1.28.2.1.24) + + mtaGroupMailProtocol OBJECT-TYPE + SYNTAX OBJECT IDENTIFIER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "An identification of the protocol being used by this group. + For an group employing OSI protocols, this will be the + Application Context. For Internet applications, the IANA + maintains a registry of the OIDs which correspond to + well-known message transfer protocols. If the application + protocol is not listed in the registry, an OID value of the + form {applTCPProtoID port} or {applUDProtoID port} are used + for TCP-based and UDP-based protocols, respectively. In + either case 'port' corresponds to the primary port number + being used by the group. applTCPProtoID and applUDPProtoID + are defined in [5]." + ::= {mtaGroupEntry 24} + +Decimal Name Description +------- ---- ----------- + 0 Reserved + +SMI Network Management Experimental Codes: + +Prefix: iso.org.dod.internet.experimental (1.3.6.1.3.) + +Decimal Name Description References +------- ---- ----------- ---------- + 0 Reserved [JKR1] + 1 CLNS ISO CLNS Objects [GS2] + * 2 T1-Carrier T1 Carrier Objects [FB77] + * 3 IEEE802.3 Ethernet-like Objects [JXC] + * 4 IEEE802.5 Token Ring-like Objects [EXD] + * 5 DECNet-PHIV DECNet Phase IV [JXS2] + * 6 Interface Generic Interface Objects [KZM] + + + +Reynolds & Postel [Page 124] + +RFC 1700 Assigned Numbers October 1994 + + + * 7 IEEE802.4 Token Bus-like Objects [KZM] + * 8 FDDI FDDI Objects [JDC20] + 9 LANMGR-1 LAN Manager V1 Objects [JXG1] + 10 LANMGR-TRAPS LAN Manager Trap Objects [JXG1] + 11 Views SNMP View Objects [CXD] + 12 SNMP-AUTH SNMP Authentication Objects [KZM] + * 13 BGP Border Gateway Protocol [SW159] + * 14 Bridge Bridge MIB [FB77] + * 15 DS3 DS3 Interface Type [TXB] + * 16 SIP SMDS Interface Protocol [TXB] + * 17 Appletalk Appletalk Networking [SXW] + * 18 PPP PPP Objects [FJK2] + * 19 Character MIB Character MIB [BS221] + * 20 RS-232 MIB RS-232 MIB [BS221] + * 21 Parallel MIB Parallel MIB [BS221] + 22 atsign-proxy Proxy via Community [RXF] + * 23 OSPF OSPF MIB [FB77] + 24 Alert-Man Alert-Man [LS8] + 25 FDDI-Synoptics FDDI-Synoptics [DXP1] + * 26 Frame Relay Frame Relay MIB [CXB] + * 27 rmon Remote Network Management MIB [SXW] + 28 IDPR IDPR MIB [RAW44] + 29 HUBMIB IEEE 802.3 Hub MIB [DXM5] + 30 IPFWDTBLMIB IP Forwarding Table MIB [FB77] + 31 LATM MIB [TXB] + 32 SONET MIB [TXB] + 33 IDENT [MTR] + 34 MIME-MHS [MTR] + 35 MAUMIB IEEE 802.3 Mau MIB [DXM5] + 36 Host Resources Host Resources MIB [SXW] + 37 ISIS-MIB Integrated ISIS protocol MIB [CXG] + 38 Chassis Chassis MIB [JDC20] + 39 ups ups [JDC20] + 40 App-Mon Application Monitoring MIB [TXK] + 41 ATM UNI ATM [MXA1] + 42 FC Fibre Channel [JXC4] +* 43 DNS Domain Name Service [Rob Austein] + 44 X.25 X.25 MIB [Dean Throop] + 45 Frame Relay Serv. Frame Relay Service MIB [Tracy Cox] + 46 Madman-Applications [Ned Freed] + 47 Madman-MTA [Ned Freed] + 48 Madman-DSA [Ned Freed] + 49 Modem [Steve Waldbusser] + 50 SNA NAU [Deirdre Kostick] + 51 SDLC SDLC [Jeff Hilgeman] + 52 DNS Domain Name Service [Jon Saperia] + 53 network-objects IP info ix X.500 [Johannsen] + 54 printmib [Joel Gyllenskog] + + + +Reynolds & Postel [Page 125] + +RFC 1700 Assigned Numbers October 1994 + + + 55 rdbmsmib [Robert Purvey] + 56 sipMIB [Tracy Brown] + 57 stIImib ST-II protocol MIB [Hartmut Wittig] + 58 802.5 SSR MIB 802.5 Station Source Routing MIB [KZM] + + * = obsoleted + +SMI Private Codes: + +Prefix: iso.org.dod.internet.private (1.3.6.1.4) + +Decimal Name Description References +------- ---- ----------- ---------- + 0 Reserved [JKR1] + 1 enterprise private enterprises [JKR1] + +SMI Private Enterprise Codes: + +Prefix: iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) + +See the file "enterprise-numbers". + +SMI Security Codes: + +Prefix: iso.org.dod.internet.security (1.3.6.1.5) + +Decimal Name Description References +------- ---- ----------- ---------- + 0 Reserved [JKR1] + 1 kerberosV4 Kerberos version 4 objects [1,BCN] + 2 kerberosV5 Kerberos version 5 objects [2,BCN] + +SMI SNMPv2 Codes: + +Prefix: iso.org.dod.internet.snmpv2 (1.3.6.1.6) + +SMI mail Codes: + +Prefix: iso.org.dod.internet.mail (1.3.6.1.7) + + 1 mime-mhs + + +REFERENCES + +[1] Miller, S.P., B.C. Neuman, J.I. Schiller, and J.H. Saltzer, + "Project Athena Technical Plan Section E.2.1: Kerberos + Authentication and Authorization System", Project Athena, + + + +Reynolds & Postel [Page 126] + +RFC 1700 Assigned Numbers October 1994 + + + MIT, December 1987. + +[2] Kohl, J., and B.C. Neuman, "The Kerberos Network + Authentication Service (V5)" work in progress, September + 1992. + +[RFC1028] Davin, J., J. Case, M. Fedor, and M. Schoffstall, "A Simple + Gateway Monitoring Protocol", RFC 1028, Proteon, Inc., + University of Tennessee at Knoxville, Cornell University, + Rensselaer Polytechnic Institute, November 1987. + +[RFC1095] Warrier, U., and L. Besaw, "The Common Management + Information Services and Protocol over TCP/IP (CMOT)", + RFC 1095, Unisys Corp., Hewlett-Packard, April 1989. + +[RFC1155] Rose, M., and K. McCloghrie, "Structure and Identification + of Management Information for TCP/IP-based internets", + STD 16, RFC 1155, Performance Systems International, Hughes + LAN Systems, May 1990. + +[RFC1157] Case, J., M. Fedor, M. Schoffstall, and J. Davin, + "A Simple Network Management Protocol", STD 15, RFC 1157, + SNMP Research, Performance Systems International, + Performance Systems International, MIT Laboratory for + Computer Science, May 1990. + +[RFC1213] McCloghrie, K., and M. Rose, "Management Information Base + for Network Management of TCP/IP-based internets: MIB-II", + STD 17, RFC 1213, Hughes LAN Systems, Performance Systems + International, March 1991. + +[RFC1229] McCloghrie, K., Editor, "Extensions to the Generic-Interface + MIB", RFC 1229, Hughes LAN Systems, Inc., May 1991. + +[RFC1230] McCloghrie, K., and R. Fox, "IEEE 802.4 Token Bus MIB", + RFC 1230, Hughes LAN Systems, Inc., Synoptics, Inc., + May 1991. + +[RFC1231] McCloghrie, K., Fox, R., and E. Decker, "IEEE 802.5 Token + Ring MIB", RFC 1231, Hughes LAN Systems, Inc., Synoptics, + Inc., cisco Systems, Inc., May 1991. + +[RFC1239] Reynolds, J., "Reassignment of Experimental MIBs to + Standard MIBs", RFC 1239, USC/Information Sciences + Institute, ISI, June 1991. + +[RFC1243] Waldbusser, S., Editor, "AppleTalk Management Information + Base", RFC 1243, Carnegie Mellon University, July 1991. + + + +Reynolds & Postel [Page 127] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC1253] Baker, F., and R. Coltun, "OSPF Version 2 Management + Information Base", RFC 1253, ACC, Computer Science Center, + August 1991. + +[RFC1271] Waldbusser, S., "Remote Network Monitoring Management + Information Base", RFC 1271, Carnegie Mellon University, + November 1991. + +[RFC1284] Cook, J., Editor, "Definitions of Managed Objects + for the Ethernet-like Interface Types", RFC 1284, Chipcom + Corporation, December 1991. + +[RFC1285] Case, J., "FDDI Management Information Base", RFC 1285, + SNMP Research, Incorporated, January 1992. + +[RFC1286] Decker, E., Langille, P., Rijsinghani, A., and K. + McCloghrie, "Definitions of Managed Objects for Bridges", + RFC 1286, cisco Systems, Inc., DEC, Hughes LAN Systems, + Inc., December 1991. + +[RFC1304] Cox, T., and K. Tesnik, Editors, "Definitions of Managed + Objects for the SIP Interface Type", RFC 1304, Bell + Communications Research, February 1992. + +[RFC1315] Brown, C., Baker, F., and C. Carvalho, "Management + Information Base for Frame Relay DTEs", RFC 1315, Wellfleet + Communications, Inc., Advanced Computer Communications, + April 1992. + +[RFC1353] McCloghrie, K., Davin, J., and J. Galvin, "Definitions of + Managed Objects for Administration of SNMP Parties", + RFC 1353, Hughes LAN Systems, Inc., MIT Laboratory for + Computer Science, Trusted Information Systems, Inc., + July 1992. + +[RFC1381] Throop, D., and F. Baker, "SNMP MIB Extension for X.25 + LAPB", RFC 1381, Data General Corporation, Advanced Computer + Communications, November 1992. + +[RFC1382] Throop, D., Editor, "SNMP MIB Extension for the X.25 Packet + Layer", RFC 1382, Data General Corporation, November 1992. + +[RFC1389] Malkin, G., and F. Baker, "RIP Version 2 MIB Extension", RFC + 1389, Xylogics, Inc., Advanced Computer Communications, + January 1993. + +[RFC1406] Baker, F., and J. Watt, Editors, "Definitions of Managed + Objects for the DS1 and E1 Interface Types", RFC 1406, + + + +Reynolds & Postel [Page 128] + +RFC 1700 Assigned Numbers October 1994 + + + Advanced Computer Communications, Newbridge Networks + Corporation, January 1993. + +[RFC1407] Cox, T., and K. Tesink, "Definitions of Managed Objects + for the DS3/E3 Interface Type", RFC 1407, Bell + Communications Research, January 1993. + +[RFC1414] St. Johns, M., and M. Rose, "Identification MIB", RFC 1414, + US Department of Defense, Dover Beach Consulting, Inc., + February 1993. + +[RFC1461] Throop, D., "SNMP MIB extension for Multiprotocol + Interconnect over X.25", RFC 1461, Data General Corporation, + May 1993. + +[RFC1471] Kastenholz, F., "The Definitions of Managed Objects for + the Link Control Protocol of the Point-to-Point Protocol", + RFC 1471, FTP Software, Inc., June 1993. + +[RFC1472] Kastenholz, F., "The Definitions of Managed Objects for + the Security Protocols of the Point-to-Point Protocol", RFC + 1472, FTP Software, Inc., June 1993. + +[RFC1473] Kastenholz, F., "The Definitions of Managed Objects for + the IP Network Control Protocol of the Point-to-Point + Protocol", RFC 1473, FTP Software, Inc., June 1993. + +[RFC1474] Kastenholz, F., "The Definitions of Managed Objects for + the Bridge Network Control Protocol of the Point-to-Point + Protocol" RFC 1474, FTP Software, Inc., June 1993. + +[RFC1514] Grillo, P., and S. Waldbusser, "Host Resources MIB", RFC + 1514, Network Innovations, Intel Corporation, Carnegie + Mellon University, September 1993. + +[RFC1515] McMaster, D., McCloghrie, K., and S. Roberts, "Definitions + of Managed Objects for IEEE 802.3 Medium Attachment Units + (MAUs)", RFC 1515, SynOptics Communications, Inc., Hughes + LAN Systems, Inc., Farallon Computing, Inc., September 1993. + +[RFC1516] McMaster, D., and K. McCloghrie, "Definitions of Managed + Objects for IEEE 802.3 Repeater Devices", RFC 1516, + SynOptics Communications, Inc., Hughes LAN Systems, Inc., + September 1993. + +[RFC1559] Saperia, J., "DECnet Phase IV MIB Extensions", RFC 1559, + Digital Equipment Corporation, December 1993. + + + + +Reynolds & Postel [Page 129] + +RFC 1700 Assigned Numbers October 1994 + + +[RFC1565] Kille, S., WG Chair, and N. Freed, Editor, "Network Services + Monitoring MIB", RFC 1565, ISODE Consortium and Innosoft, + January 1994. + +[RFC1566] Kille, S., WG Chair, and N. Freed, Editor, "Mail Monitoring + MIB", RFC 1566, ISODE Consortium, Innosoft, January 1994. + +[RFC1567] Mansfield, G., and S. Kille, "X.500 Directory Monitoring + MIB", RFC 1567, AIC Systems Laboratory, ISODE Consortium, + January 1994. + +[RFC1573] McCloghrie, K., and F. Kastenholz, "Evolution of the + Interfaces Group of MIB-II", RFC 1573, Hughes LAN Systems, + FTP Software, January 1994. + +[RFC1595] Brown, T., and K. Tesink, Editors, "Definitions of Managed + Objects for the SONET/SDH Interface Type", RFC 1595, + Bell Communications Research, March 1994. + +[RFC1596] Brown, T., Editor, Definitions of Managed Objects for Frame + Relay Service", RFC 1596, Bell Communications Research, + March 1994. + +[RFC1611] Austein, R., and J. Saperia, "DNS Server MIB Extensions", + RFC 1611, Epilogue Technology Corporation, Digital Equipment + Corporation, May 1994. + +[RFC1628] Case, J., Editor, "UPS Management Information Base", RFC + 1628, SNMP Research, Incorporated, May 1994. + +[RFC1650] Kastenholz, F., "Definitions of Managed Objects for + the Ethernet-like Interface Types using SMIv2", RFC 1650, + FTP Software, Inc., August 1994. + +[RFC1657] Willis, S., Burruss, J., and J. Chu, Editor, "Definitions of + Managed Objects for the Fourth Version of the Border Gateway + Protocol (BGP-4) using SMIv2", RFC 1657, Wellfleet + Communications Inc., IBM Corp., July 1994. + +[RFC1658] Stewart, B., "Definitions of Managed Objects for Character + Stream Devices using SMIv2", RFC 1658, Xyplex, Inc., July + 1994. + +[RFC1659] Stewart, B., "Definitions of Managed Objects for RS-232-like + Hardware Devices using SMIv2", RFC 1659, Xyplex, Inc., July + 1994. + +[RFC1660] Stewart, B., "Definitions of Managed Objects for + + + +Reynolds & Postel [Page 130] + +RFC 1700 Assigned Numbers October 1994 + + + Parallel-printer-like Hardware Devices using SMIv2", RFC + 1660, Xyplex, Inc., July + 1994. + +[RFC1665] Kielczewski, Z., Kostick, D., and K. Shih, Editors, + "Definitions of Managed Objects for SNA NAUs using SMIv2", + RFC 1665, Eicon Technology Corporation, Bell Communications + Research, Novell, July 1994. + +[RFC1694] Brown, T., and K. Tesink, Editors, "Definitions of Managed + Objects for SMDS Interfaces using SMIv2", RFC 1694, Bell + Communications Research, August 1994. + +[RFC1695] Ahmed, M., and K. Tesink, Editors, "Definitions of Managed + Objects for ATM Management Version 8.0 using SMIv2", RFC + 1695, Bell Communications Research, August 1994. + +[RFC1696] Barnes, J., Brown, L., Royston, R., and S. Waldbusser, + "Modem Management Information Base (MIB) using SMIv2", RFC + 1696, Xylogics, Inc., Motorola, US Robotics, Inc., Carnegie + Mellon University, August 1994. + +[RFC1697] Brower, D., Editor, Purvy, B., RDBMSMIB Working Group Chair, + Daniel, A., Sinykin, M., and J. Smith, "Relational Database + Management System (RDBMS) Management Information Base (MIB) + using SMIv2", RFC 1697, The ASK Group, INGRES DBMS + Development, Oracle Corporation, Informix Software, Inc., + Oracle Corporation, August 1994. + +PEOPLE + +[Rob Austein] + +[BCN] B. Clifford Neuman + +[BS221] Bob Stewart + +[CXB] Caralyn Brown + +[CXD] Chuck Davin + +[CXG] Chris Gunner + +[Dean Throop] + +[DXM5] Donna McMaster + +[DXP1] David Perkins + + + +Reynolds & Postel [Page 131] + +RFC 1700 Assigned Numbers October 1994 + + +[EXD] Eric Decker + +[FB77] Fred Baker + +[FJK2] + +[GS2] Greg Satz + +[IANA] IANA + +[JDC20] Jeffrey Case + +[JKR1] Joyce K. Reynolds + +[JXC] John Cook + +[JXG1] Jim Greuel + +[JXS2] Jon Saperia + +[Jeff Hilgeman] + +[Johannsen] + +[KZM] Keith McCloghrie + +[LS8] Louis Steinberg + +[MXA1] Masuma Ahmed + +[MTR] Marshall Rose + +[RAW44] Robert A. Woodburn + +[JXC4] John Chu + +[Ned Freed] + +[Deirdre Kostick] + +[Joel Gyllenskog] Joel Gyllenskog + +[Robert Purvey] Robert Purvey + +[RXF] Richard Fox + +[Jon Saperia] Jon Saperia + + + + +Reynolds & Postel [Page 132] + +RFC 1700 Assigned Numbers October 1994 + + +[SW159] Steven Willis + +[SXW] Steve Waldbusser + +[TXB] Tracy Brown + +[TXK] Teemu Kurki + +[Hartmut Wittig] + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/smi-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 133] + +RFC 1700 Assigned Numbers October 1994 + + +PRIVATE ENTERPRISE NUMBERS + +SMI Network Management Private Enterprise Codes: + +Prefix: iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) + +This file is + + ftp://ftp.isi.edu/in-notes/iana/assignments/enterprise-numbers + +Decimal Name References +------- ---- ---------- + 0 Reserved Joyce K. Reynolds + 1 Proteon John A. Shriver + 2 IBM Vik Chandra + 3 CMU Steve Waldbusser + 4 Unix Keith Sklower + 5 ACC Art Berggreen + 6 TWG John Lunny (703) 847-4500 + 7 CAYMAN Beth Miaoulis beth@cayman.com + 8 PSI Marty Schoffstahl schoff@NISC.NYSER.NET + 9 cisco Greg Satz satz@CISCO.COM + 10 NSC Geof Stone geof@NETWORK.COM + 11 HP R. Dwight Schettler rds%hpcndm@HPLABS.HP.COM + 12 Epilogue Karl Auerbac karl@empirical.com + 13 U of Tennessee Jeffrey Case case@UTKUX1.UTK.EDU + 14 BBN Robert Hinden + 15 Xylogics, Inc. John R. LoVerso loverso@westford.ccur.com + 16 Timeplex Laura Bridge laura@uunet.UU.NET + 17 Canstar Sanand Patel sanand@HUB.TORONTO.EDU + 18 Wellfleet Caralyn Brown cbrown@wellfleet.com + 19 TRW Jay Frederking jayf@blackhole.ind.TRW.COM + 20 MIT Jon Rochlis jon@ATHENA.MIT.EDU + 21 EON Michael Waters ---none--- + 22 Spartacus Yoav Kluger ykluger@HAWK.ULOWELL.EDU + 23 Novell Steve Bostock steveb@novell.com + 24 Spider Systems Peter Reid peter@spider.co.uk + 25 NSFNET Hans-Werner Braun HWB@MCR.UMICH.EDU + 26 Hughes LAN Systems Keith McCloghrie KZM@HLS.COM + 27 Intergraph Guy Streeter guy@guy.bll.ingr.com + 28 Interlan Bruce Taber taber@europa.InterLan.COM + 29 Vitalink Communications + 30 Ulana Bill Anderson wda@MITRE-BEDFORD.ORG + 31 NSWC Stephen Northcutt SNORTHC@RELAY-NSWC.NAVY.MIL + 32 Santa Cruz Operation Keith Reynolds keithr@SCO.COM + 33 Xyplex Bob Stewart STEWART@XYPLEX.COM + 34 Cray Hunaid Engineer hunaid@OPUS.CRAY.COM + 35 Bell Northern Research Glenn Waters gwaters@BNR.CA + + + +Reynolds & Postel [Page 134] + +RFC 1700 Assigned Numbers October 1994 + + + 36 DEC Ron Bhanukitsiri rbhank@DECVAX.DEC.COM + 37 Touch Brad Benson ---none--- + 38 Network Research Corp. Bill Versteeg bvs@NCR.COM + 39 Baylor College of Medicine Stan Barber SOB@BCM.TMC.EDU + 40 NMFECC-LLNL Steven Hunter hunter@CCC.MFECC.LLNL.GOV + 41 SRI David Wolfe ctabka@TSCA.ISTC.SRI.COM + 42 Sun Microsystems Dennis Yaro yaro@SUN.COM + 43 3Com Jeremy Siegel jzs@NSD.3Com.COM + 44 CMC Dave Preston ---none--- + 45 SynOptics David Perkins dperkins@synoptics.com + 46 Cheyenne Software Reijane Huai sibal@CSD2.NYU.EDU + 47 Prime Computer Mike Spina WIZARD%enr.prime.com@RELAY.CS.NET + 48 MCNC/North Carolina Data Network Ken Whitfield ken@MCNC.ORG + 49 Chipcom John Cook cook@chipcom.com + 50 Optical Data Systems Josh Fielk ---none--- + 51 gated Jeffrey C. Honig jch@gated.cornell.edu + 52 Cabletron Systems Roger Dev ---none--- + 53 Apollo Computers Jeffrey Buffun jbuffum@APOLLO.COM + 54 DeskTalk Systems, Inc. David Kaufman ---none--- + 55 SSDS Ron Strich ---none--- + 56 Castle Rock Computing John Sancho ---none--- + 57 MIPS Computer Systems Charles Marker II marker@MIPS.COM + 58 TGV, Inc. Ken Adelman Adelman@TGV.COM + 59 Silicon Graphics, Inc. Ronald Jacoby rj@SGI.COM + 60 University of British Columbia Don McWilliam mcwillm@CC.UBC.CA + 61 Merit Bill Norton wbn@MERIT.EDU + 62 FiberCom Eric Rubin err@FIBERCOM.COM + 63 Apple Computer Inc Jim Hayes Hayes@APPLE.COM + 64 Gandalf Henry Kaijak ---none--- + 65 Dartmouth Philip Koch Philip.Koch@DARTMOUTH.EDU + 66 David Systems Kathryn de Graaf degraaf@davidsys.com + 67 Reuter Bob Zaniolo ---none--- + 68 Cornell Laurie Collinsworth ljc1@cornell.edu + 69 LMS L. Michael Sabo Sabo@DOCKMASTER.NCSC.MIL + 70 Locus Computing Corp. Arthur Salazar lcc.arthur@SEAS.UCLA.EDU + 71 NASA Steve Schoch SCHOCH@AMES.ARC.NASA.GOV + 72 Retix Alex Martin ---none--- + 73 Boeing Jerry Geisler ---none--- + 74 AT&T Rich Bantel rgb@mtung.att.com + 75 Ungermann-Bass Didier Moretti ---none--- + 76 Digital Analysis Corporation + Skip Koppenhaver stubby!skip@uunet.UU.NET + 77 LAN Manager Doug Karl KARL-D@OSU-20.IRCC.OHIO-STATE.EDU + 78 Netlabs Jonathan Biggar jon@netlabs.com + 79 ICL Jon Infante ---none--- + 80 Auspex Systems Brian A. Ehrmantraut bae@auspex.com + 81 Lannet Company Efrat Ramati ---none--- + 82 Network Computing Devices Dave Mackie lupine!djm@UUNET.UU.NET + + + +Reynolds & Postel [Page 135] + +RFC 1700 Assigned Numbers October 1994 + + + 83 Raycom Systems Bruce Willins ---none--- + 84 Pirelli Focom Ltd. Sam Lau ---none--- + 85 Datability Software Systems Larry Fischer lfischer@dss.com + 86 Network Application Technology Y.C. Wang ---none--- + 87 LINK (Lokales Informatik-Netz Karlsruhe) + Guenther Schreiner snmp-admin@ira.uka.de + 88 NYU Bill Russell russell@cmcl2.NYU.EDU + 89 RND Rina Nethaniel ---none--- + 90 InterCon Systems Corporation Amanda Walker AMANDA@INTERCON.COM + 91 Coral Network Corporation Jason Perreault jason@coral.com + 92 Webster Computer Corporation Robert R. Elz kre@munnari.oz.au + 93 Frontier Technologies Corporation + Prakash Ambegaonkar ---none--- + 94 Nokia Data Communications Douglas Egan ---none--- + 95 Allen-Bradely Company + Bill King abvax!calvin.icd.ab.com!wrk@uunet.UU.NET + 96 CERN + Jens T. Rasmussen jenst%cernvax.cern.ch@CUNYVM.CUNY.EDU + 97 Sigma Network Systems, Inc. + Ken Virgile signet!ken@xylogics.COM + 98 Emerging Technologies, Inc. + Dennis E. Baasch etinc!dennis@uu.psi.com + 99 SNMP Research Jeffrey Case case@UTKUX1.UTK.EDU + 100 Ohio State University + Shamim Ahmed ahmed@nisca.ircc.ohio-state.edu + 101 Ultra Network Technologies Julie Dmytryk + Julie_Dmytryk.MKT@usun.ultra.com + 102 Microcom Annmarie Freitas ---none--- + 103 Martin Marietta Astronautic Group David Rageth DAVE@MMC.COM + 104 Micro Technology Mike Erlinger mike@lexcel.com + 105 Process Software Corporation Bernie Volz VOLZ@PROCESS.COM + 106 Data General Corporation + Joanna Karwowska karwowska@dg-rtp.dg.com + 107 Bull Company Anthony Berent berent@rdgeng.enet.dec.com + 108 Emulex Corporation Jeff Freeman ---none--- + 109 Warwick University Computing Services + Israel Drori raanan@techunix.technion.ac.il + 110 Network General Corporation + James Davidson ngc!james@uunet.UU.NET + 111 Oracle John Hanley jhanley@oracle.com + 112 Control Data Corporation Nelluri L. Reddy reddy@uc.msc.umn.edu + 113 Hughes Aircraft Company Keith McCloghrie KZM@HLS.COM + 114 Synernetics, Inc. Jas Parmar jas@synnet.com + 115 Mitre Bede McCall bede@mitre.org + 116 Hitachi, Ltd. Hirotaka Usuda ---none--- + 117 Telebit Mark S. Lewis mlewis@telebit.com + 118 Salomon Technology Services Paul Maurer II ---none--- + 119 NEC Corporation Yoshiyuki Akiyama + + + +Reynolds & Postel [Page 136] + +RFC 1700 Assigned Numbers October 1994 + + + kddlab!ccs.mt.nec.co.jp!y-akiyam@uunet.uu.net + 120 Fibermux Michael Sung msung@ccrelay.fibermux.com + 121 FTP Software Inc. Stev Knowles stev@vax.ftp.com + 122 Sony Takashi Hagiwara Hagiwara@Sm.Sony.Co.Jp + 123 Newbridge Networks Corporation James Watt ---none--- + 124 Racal-Milgo Information Systems Maurice R. Turcotte + mailrus!uflorida!rm1!dnmrt%rmatl@uunet.UU.NET + 125 CR SYSTEMS Soren H. Sorensen ---none--- + 126 DSET Corporation Dan Shia dset!shia@uunet.UU.NET + 127 Computone Bill Versteeg bvs@NCR.COM + 128 Tektronix, Inc. Dennis Thomas dennist@tektronix.TEK.COM + 129 Interactive Systems Corporation + Steve Alexander stevea@i88.isc.com + 130 Banyan Systems Inc. + Deepak Taneja eepak=Taneja%Eng%Banyan@Thing.banyan.com + 131 Sintrom Datanet Limited + 132 Bell Canada Mark Fabbi markf@gpu.utcs.utoronto.ca + 133 Crosscomm Corporation Reuben Sivan crossc!rsivan@uunet.UU.NET + 134 Rice University Catherine Foulston cathyf@rice.edu + 135 T3Plus Networking, Inc. Harley Frazee harley@io.t3plus.com + 136 Concurrent Computer Corporation + John R. LoVerso loverso@westford.ccur.com + 137 Basser Paul O'Donnell paulod@cs.su.oz.au + 138 Luxcom + 139 Artel Jon Ziegler Ziegler@Artel.com + 140 Independence Technologies, Inc. (ITI) + Gerard Berthet gerard@indetech.com + 141 Frontier Software Development Narendra Popat ---none--- + 142 Digital Computer Limited Osamu Fujiki ---none--- + 143 Eyring, Inc. Ron Holt ron@Eyring.COM + 144 Case Communications Peter Kumik ---none--- + 145 Penril DataComm, Inc. Keith Hogan keith%penril@uunet.uu.net + 146 American Airlines Bill Keatley ---none--- + 147 Sequent Computer Systems Scott Hahn sdh@sequent.com + 148 Bellcore Kaj Tesink kaj@nvuxr.cc.bellcore.com + 149 Konkord Communications Ken Jones konkord!ksj@uunet.uu.net + 150 University of Washington + Christopher Wheeler cwheeler@cac.washignton.edu + 151 Develcon Sheri Mayhew zaphod!sherim@herald.usask.ca + 152 Solarix Systems Paul Afshar paul@solar1.portal.com + 153 Unifi Communications Corp. Yigal Hochberg yigal@unifi.com + 154 Roadnet Dale Shelton ---none--- + 155 Network Systems Corp. + Nadya K. El-Afandi nadya@khara.network.com + 156 ENE (European Network Engineering) Peter Cox ---none--- + 157 Dansk Data Elektronik A/S Per Bech Hansen pbh@dde.dk + 158 Morning Star Technologies Karl Fox karl@MorningStar.Com + 159 Dupont EOP Oscar Rodriguez ---none--- + + + +Reynolds & Postel [Page 137] + +RFC 1700 Assigned Numbers October 1994 + + + 160 Legato Systems, Inc. Jon Kepecs kepecs@Legato.COM + 161 Motorola SPS Vince Enriquez enriquez@sps.mot.com + 162 European Space Agency (ESA) + Eduardo EDUATO%ESOC.BITNET@CUNYVM.CUNY.EDU + 163 BIM Bernard Lemercier bl@sunbim.be + 164 Rad Data Communications Ltd. Oft Israel ---none--- + 165 Intellicom Paul Singh ---none--- + 166 Shiva Corporation Phil Budne phil@Shiva.COM + 167 Fujikura America Debbie Reed ---none--- + 168 Xlnt Designs INC (XDI) Mike Anello mike@xlnt.com + 169 Tandem Computers Rex Davis ---none--- + 170 BICC David A. Brown fzbicdb@uk.ac.ucl + 171 D-Link Systems, Inc. Henry P. Nagai ---none--- + 172 AMP, Inc. Rick Downs ---none--- + 173 Netlink Mauro Zallocco ---none--- + 174 C. Itoh Electronics Larry Davis ---none--- + 175 Sumitomo Electric Industries (SEI) + Kent Tsuno tsuno@sumitomo.com + 176 DHL Systems, Inc. + David B. Gurevich dgurevic@rhubarb.ssf-sys.dhl.com + 177 Network Equipment Technologies Mark Tom marktom@tom.net.com + 178 APTEC Computer Systems Larry Burton ssds!larryb@uunet.UU.NET + 179 Schneider & Koch & Co, Datensysteme GmbH Thomas Ruf tom@rsp.de + 180 Hill Air Force Base Russell G. Wilson rwilson@oodis01.af.mil + 181 ADC Kentrox Bruce Kropp ktxc8!bruce@uunet.UU.NET + 182 Japan Radio Co. Nagayuki Kojima nkojima@lab.nihonmusen.co.jp + 183 Versitron Matt Harris ---none--- + 184 Telecommunication Systems Hugh Lockhart ---none--- + 185 Interphase Gil Widdowson ---none--- + 186 Toshiba Corporation Mike Asagami toshiba@mothra.nts.uci.edu + 187 Clearpoint Research Corp. + 188 Ascom Andrew Smith andrew@hasler.ascom.ch + 189 Fujitsu America Chung Lam ---none--- + 190 NetCom Solutions, Inc. Dale Cabell---none--- + 191 NCR Cheryl Krupczak clefor@secola.columbia.ncr.com + 192 Dr. Materna GmbH Torsten Beyer tb@Materna.de + 193 Ericsson Business Communications Gunnar Nilsson ---none--- + 194 Metaphor Computer Systems Paul Rodwick ---none--- + 195 Patriot Partners Paul Rodwick ---none--- + 196 The Software Group Limited (TSG) + Ragnar Paulson tsgfred!ragnar@uunet.UU.NET + 197 Kalpana, Inc. Anil Bhavnani ---none--- + 198 University of Waterloo + R. J. White snmp-tech@watmath.waterloo.edu + 199 CCL/ITRI + Ming-Perng Chen N100CMP0%TWNITRI1.BITNET@CUNYVM.CUNY.EDU + 200 Coeur Postel Professor Kynikos Special Consultant + 201 Mitsubish Cable Industries, Ltd. Masahiko Hori ---none--- + + + +Reynolds & Postel [Page 138] + +RFC 1700 Assigned Numbers October 1994 + + + 202 SMC Lance Sprung ---none--- + 203 Crescendo Communication, Inc. Prem Jain prem@cres.com + 204 Goodall Software Engineering Doug Goodall goodall@crl.com + 205 Intecom Brad Parke ---none--- + 206 Victoria University of Wellington + Jonathan Stone jonathan@isor.vuw.ac.nz + 207 Allied Telesis, Inc. + Scott Holley SCOTT_CLINTON_HOLLEY@cup.portal.com + 208 Dowty Network Systems A/S Hartvig Ekner hj@dowtyns.dk + 209 Protools Glen Arp ---none--- + 210 Nippon Telegraph and Telephone Corp. + Toshiharu Sugawara sugawara%wink.ntt.jp@RELAY.CS.NET + 211 Fujitsu Limited Ippei Hayashi hayashi@sysrap.cs.fujitsu.co.jp + 212 Network Peripherals Inc. Creighton Chong cchong@fastnet.com + 213 Netronix, Inc. Jacques Roth ---none--- + 214 University of Wisconsin - Madison + Dave Windorski DAVID.WINDORSKI@MAIL.ADMIN.WISC.EDU + 215 NetWorth, Inc. Craig Scott ---none--- + 216 Tandberg Data A/S Harald Hoeg haho%huldra.uucp@nac.no + 217 Technically Elite Concepts, Inc. + Russell S. Dietz Russell_Dietz@Mcimail.com + 218 Labtam Australia Pty. Ltd. + Michael Podhorodecki michael@labtam.oz.au + 219 Republic Telcom Systems, Inc. + Steve Harris rtsc!harris@boulder.Colorado.edu + 220 ADI Systems, Inc. Paul Liu ---none--- + 221 Microwave Bypass Systems, Inc. Tad Artis ---none--- + 222 Pyramid Technology Corp. Richard Rein rein@pyramid.com + 223 Unisys_Corp Lawrence Brow ---none--- + 224 LANOPTICS LTD., Israel + Israel Drori raanan@techunix.technion.ac.il + 225 NKK Corporation J. Yoshida ---none--- + 226 MTrade UK Ltd. Peter Delchiappo ---none--- + 227 Acals Patrick Cheng pcheng@dill.ind.trw.com + 228 ASTEC, Inc. Hiroshi Fujii fujii@astec.co.jp + 229 Delmarva Power John K. Scoggin, Jr. scoggin@delmarva.com + 230 Telematics International, Inc. Kevin Smith ---none--- + 231 Siemens Nixdorf Informations Syteme AG + Gunther Kroenert ---none--- + 232 Compaq + 233 NetManage, Inc. William Dunn netmanage@cup.portal.com + 234 NCSU Computing Center David Joyner david@unity.ncsu.edu + 235 Empirical Tools and Technologies + Karl Auerbach karl@empirical.com + 236 Samsung Group Hong K. Paik paik@samsung.com + 237 Takaoka Electric Mfg. Co., Ltd. + Hidekazu Hagiwara hagiwara@takaoka.takaoka-electric.co.jp + 238 Netrix Systems Corporation Eldon S. Mast esm@netrix.com + + + +Reynolds & Postel [Page 139] + +RFC 1700 Assigned Numbers October 1994 + + + 239 WINDATA Bob Rosenbaum ---none--- + 240 RC International A/S Carl H. Dreyer chd@rci.dk + 241 Netexp Research Henk Boetzkes ---none--- + 242 Internode Systems Pty Ltd + Simon Hackett simon@ucs.adelaide.edu.au + 243 netCS Informationstechnik GmbH + Oliver Korfmacher okorf@bunt.netcs.com + 244 Lantronix Rich Lyman rich@alecto.gordian.com + 245 Avatar Consultants + Kory Hamzeh ames!avatar.com!kory@harvard.harvard.edu + 246 Furukawa Electoric Co. Ltd. + Shoji Fukutomi kddlab!polo.furukawa.co.jp!fuku@uunet.UU.NET + 247 AEG Electrcom R. Nurnberg ---none--- + 248 Richard Hirschmann GmbH & Co. + Heinz Nisi mia@intsun.rus.uni-stuttgart.de + 249 G2R Inc. Khalid Hireche ---none--- + 250 University of Michigan + Tim Howes Tim.Howes@terminator.cc.umich.edu + 251 Netcomm, Ltd. W.R. Maynard-Smith ---none--- + 252 Sable Technology Corporation Rodney Thayer ---none--- + 253 Xerox Edwards E. Reed ipcontact.cin_ops@xerox.com + 254 Conware Computer Consulting GmbH + Michael Sapich sapich@conware.de + 255 Compatible Systems Corp. John Gawf gawf@compatible.com + 256 Scitec Communications Systems Ltd. Stephen Lewis ---none--- + 257 Transarc Corporation Pat Barron Pat_Barron@TRANSARC.COM + 258 Matsushita Electric Industrial Co., Ltd. + Nob Mizuno mizuno@isl.mei.co.jp + 259 ACCTON Technology Don Rooney ---none--- + 260 Star-Tek, Inc. Carl Madison carl@startek.com + 261 Codenoll Tech. Corp. Dan Willie ---none--- + 262 Formation, Inc. Carl Marcinik ---none--- + 263 Seiko Instruments, Inc. (SII) Yasuyoshi Watanabe ---none--- + 264 RCE (Reseaux de Communication d'Entreprise S.A.) + Etienne Baudras-Chardigny ---none--- + 265 Xenocom, Inc. Sean Welch welch@raven.ulowell.edu + 266 KABELRHEYDT Hubert Theissen ---none--- + 267 Systech Computer Corporation + Brian Petry systech!bpetry@uunet.UU.NET + 268 Visual Brian O'Shea bos@visual.com + 269 SDD (Scandinavian Airlines Data Denmark A/S) + Per Futtrup ---none--- + 270 Zenith Electronics Corporation David Lin ---none--- + 271 TELECOM FINLAND Petri Jokela ---none--- + 272 BinTec Computersystems Marc Sheldon ms@BinTec.DE + 273 EUnet Germany Marc Sheldon ms@Germany.EU.net + 274 PictureTel Corporation Oliver Jones oj@pictel.com + 275 Michigan State University Lih-Er Wey WEYLE@msu.edu + + + +Reynolds & Postel [Page 140] + +RFC 1700 Assigned Numbers October 1994 + + + 276 GTE Telecom Incorporated Grant Gifford ---none--- + 277 Cascade Communications Corp. + Chikong Shue alpo!chi@uunet.uu.net + 278 Hitachi Cable, Ltd. Takahiro Asai ---none--- + 279 Olivetti Marco Framba framba@orc.olivetti.com + 280 Vitacom Corporation Parag Rastogi parag@cup.portal.com + 281 INMOS Graham Hudspith gwh@inmos.co.uk + 282 AIC Systems Laboratories Ltd. Glenn Mansfield glenn@aic.co.jp + 283 Cameo Communications, Inc. Alan Brind ---none--- + 284 Diab Data AB Mats Lindstrom mli@diab.se + 285 Olicom A/S Lars Povlsen krus@olicom.dk + 286 Digital-Kienzle Computersystems Hans Jurgen Dorr ---none--- + 287 CSELT(Centro Studi E Laboratori Telecomunicazioni) + Paolo Coppo coppo@cz8700.cselt.stet.it + 288 Electronic Data Systems Mark Holobach holobach@tis.eds.com + 289 McData Corporation Glenn Levitt gpl0363@mcmail.mcdata.com + 290 Harris Corporation David Rhein davidr@ssd.csd.harris.com + 291 Technology Dynamics, Inc. Chip Standifer TDYNAMICS@MCIMAIL.COM + 292 DATAHOUSE Information Systems Ltd. Kim Le ---none--- + 293 DSIR Network Group Tony van der Peet srghtvp@grv.dsir.govt.nz + 294 Texas Instruments Blair Sanders Blair_Sanders@mcimail.com + 295 PlainTree Systems Inc. Paul Chefurka chefurka@plntree.UUCP + 296 Hedemann Software Development + Stefan Hedemann 100015.2504@compuserve.com + 297 Fuji Xerox Co., Ltd. Hiroshi Kume + Kume%KSPB%Fuji_Xerox@tcpgw.netg.ksp.fujixerox.co.jp + 298 Asante Technology Hsiang Ming Ma ---none--- + 299 Stanford University + RL "Bob" Morgan morgan@jessica.stanford.edu + 300 Digital Link Jimmy Tu jimmy@dl.com + 301 Raylan Corporation Mark S. Lewis mlewis@telebit.com + 302 Datacraft Alan Lloyd alan@datacraft.oz + 303 Hughes Keith McCloghrie KZM@HLS.COM + 304 Farallon Computing, Inc. Steven Sweeney ---none--- + 305 GE Information Services Steve Bush sfb@ncoast.org + 306 Gambit Computer Communications Zohar Seigal ---none--- + 307 Livingston Enterprises, Inc. + Steve Willens steve@livingston.com + 308 Star Technologies Jim Miner miner@star.com + 309 Micronics Computers Inc. Darren Croke dc@micronics.com + 310 Basis, Inc. Heidi Stettner heidi@mtxinu.COM + 311 Microsoft John M. Ballard jballard@microsoft.com + 312 US West Advance Technologies + Donna Hopkins dmhopki@uswat.uswest.com + 313 University College London Shaw C. Chuang S.Chuang@cs.ucl.ac.uk + 314 Eastman Kodak Company W. James Colosky wjc@tornado.kodak.com + 315 Network Resources Corporation Kathy Weninger ---none--- + 316 Atlas Telecom Bruce Kropp ktxc8!bruce@uunet.UU.NET + + + +Reynolds & Postel [Page 141] + +RFC 1700 Assigned Numbers October 1994 + + + 317 Bridgeway Umberto Vizcaino ---none--- + 318 American Power Conversion Corp. + Peter C. Yoest apc!yoest@uunet.uu.net + 319 DOE Atmospheric Radiation Measurement Project + Paul Krystosek krystosk@eid.anl.gov + 320 VerSteeg CodeWorks Bill Versteeg bvs@NCR.COM + 321 Verilink Corp Bill Versteeg bvs@NCR.COM + 322 Sybus Corportation Mark T. Dauscher mdauscher@sybus.com + 323 Tekelec Bob Grady ---none--- + 324 NASA Ames Research Cente Nick Cuccia cuccia@nas.nasa.gov + 325 Simon Fraser University Robert Urquhart quipu@sfu.ca + 326 Fore Systems, Inc. Eric Cooper ecc@fore.com + 327 Centrum Communications, Inc. Vince Liu ---none--- + 328 NeXT Computer, Inc. + Lennart Lovstrand Lennart_Lovstrand@NeXT.COM + 329 Netcore, Inc. Skip Morton ---none--- + 330 Northwest Digital Systems Brian Dockter ---none--- + 331 Andrew Corporation Ted Tran ---none--- + 332 DigiBoard Dror Kessler dror@digibd.com + 333 Computer Network Technology Corp. Bob Meierhofer ---none--- + 334 Lotus Development Corp. Bill Flanagan bflanagan@lotus.com + 335 MICOM Communication Corporation + Donna Beatty SYSAD@prime.micom.com + 336 ASCII Corporation Toshiharu Ohno tony-o@ascii.co.jp + 337 PUREDATA Research Tony Baxter tony@puredata.com + 338 NTT DATA Yasuhiro Kohata kohata@rd.nttdata.jp + 339 Empros Systems International David Taylor dtaylor@ems.cdc.ca + 340 Kendall Square Research (KSR) Dave Hudson tdh@uunet.UU.NET + 341 Martin Marietta Energy Systems Gary Haney haneyg@ornl.gov + 342 Network Innovations Pete Grillo pl0143@mail.psi.net + 343 Intel Corporation Brady Orand borand@pcocd2.intel.com + 344 Proxar Ching-Fa Hwang cfh@proxar.com + 345 Epson Research Center Richard Schneider rschneid@epson.com + 346 Fibernet George Sandoval ---none--- + 347 Box Hill Systems Corporation Tim Jones tim@boxhill.com + 348 American Express Travel Related Services + Jeff Carton jcarton@amex-trs.com + 349 Compu-Shack Tomas Vocetka OPLER%CSEARN.bitnet@CUNYVM.CUNY.EDU + 350 Parallan Computer, Inc. Charles Dulin ---none--- + 351 Stratacom Clyde Iwamoto cki@strata.com + 352 Open Networks Engineering, Inc. Russ Blaesing rrb@one.com + 353 ATM Forum Keith McCloghrie KZM@HLS.COM + 354 SSD Management, Inc. Bill Rose ---none--- + 355 Automated Network Management, Inc. Carl Vanderbeek ---none-- + 356 Magnalink Communications Corporation + David E. Kaufman ---none--- + 357 TIL Systems, Ltd. Garry McCracken ---none--- + 358 Skyline Technology, Inc. Don Weir ---none--- + + + +Reynolds & Postel [Page 142] + +RFC 1700 Assigned Numbers October 1994 + + + 359 Nu-Mega Technologies, Inc. Dirk Smith ---none--- + 360 Morgan Stanley & Co. Inc. + Victor Kazdoba vsk@katana.is.morgan.com + 361 Integrated Business Network Michael Bell ---none--- + 362 L & N Technologies, Ltd. Steve Loring ---none--- + 363 Cincinnati Bell Information Systems, Inc. + Deron Meranda dmeranda@cbis.COM + 364 OSCOM International + Farhad Fozdar f_fozdar@fennel.cc.uwa.edu.au + 365 MICROGNOSIS Paul Andon pandon@micrognosis.co.uk + 366 Datapoint Corporation Lee Ziegenhals lcz@sat.datapoint.com + 367 RICOH Co. Ltd. + Toshio Watanabe watanabe@godzilla.rsc.spdd.ricoh.co.jp + 368 Axis Communications AB Martin Gren martin@axis.se + 369 Pacer Software Wayne Tackabury wft@pacersoft.com + 370 Axon Networks Inc. Robin Iddon axon@cix.clink.co.uk + 371 Brixton Systems, Inc. Peter S. Easton easton@brixton.com + 372 GSI Etienne Demailly etienne.demailly@gsi.fr + 373 Tatung Co., Ltd. + Chih-Yi Chen TCCISM1%TWNTTIT.BITNET@pucc.Princeton.EDU + 374 DIS Research LTD. Ray Compton rayc@command.com + 375 Quotron Systems, Inc. + Richard P. Stubbs richard@atd.quotron.com + 376 Dassault Electronique + Olivier J. Caleff caleff@dassault-elec.fr + 377 Corollary, Inc. James L. Gula gula@corollary.com + 378 SEEL, Ltd. Ken Ritchie ---none--- + 379 Lexcel Mike Erlinger mike@lexcel.com + 380 Sophisticated Technologies, Inc. + Bill Parducci 70262.1267@compuserve.com + 381 OST A. Pele ---none--- + 382 Megadata Pty Ltd. Andrew McRae andrew@megadata.mega.oz.au + 383 LLNL Livermore Computer Center + Dan Nessett nessett@ocfmail.ocf.llnl.gov + 384 Dynatech Communications Graham Welling s8000!gcw@uunet.uu.net + 385 Symplex Communications Corp. Cyrus Azar ---none--- + 386 Tribe Computer Works Ken Fujimoto fuji@tribe.com + 387 Taligent, Inc. Lorenzo Aguilar lorenzo@taligent.com + 388 Symbol Technologies, Inc. + John Kramer +1-408-369-2679 jkramer@psd.symbol.com + 389 Lancert Mark Hankin ---none--- + 390 Alantec Paul V. Fries pvf@alantec.com + 391 Ridgeback Solutions + Errol Ginsberg bacchus!zulu!errol@uu2.psi.com + 392 Metrix, Inc. D. Venkatrangan venkat@metrix.com + 393 Excutive Systems/XTree Company + Dale Cabell cabell@smtp.xtree.com + 394 NRL Communication Systems Branch + + + +Reynolds & Postel [Page 143] + +RFC 1700 Assigned Numbers October 1994 + + + R. K. Nair nair@itd.nrl.navy.mil + 395 I.D.E. Corporation Rob Spade ---none--- + 396 Matsushita Electric Works, Ltd. + Claude Huss claude@trc.mew.mei.co.jp + 397 MegaPAC Ian George ---none--- + 398 Pilkington Communication Systems Dave Atkinson ---none--- + 399 Hitachi Computer Products (America), Inc. + Masha Golosovker masha@hicomb.hi.com + 400 METEO FRANCE Remy Giraud Remy.Giraud@meteo.fr + 401 PRC Inc. Jim Noble noble_jim@prc.com + 402 Wal*Mart Stores, Inc. Mike Fitzgerel mlfitzg@wal-mart.com + 403 Nissin Electric Company, Ltd. Aki Komatsuzaki (408) 737-0274 + 404 Distributed Support Information Standard + Mike Migliano + 405 SMDS Interest Group (SIG) + Elysia C. Tan + 406 SolCom Systems Ltd. Hugh Evans 0506 873855 + 407 Bell Atlantic Colin deSa socrates!bm5ld15@bagout.BELL-ATL.COM + 408 Advanced Multiuser Technologies Corporation + 409 Mitsubishi Electric Corporation + Yoshitaka Ogawa + 410 C.O.L. Systems, Inc. Frank Castellucci (914) 277-4312 + 411 University of Auckland + Nevil Brownlee < n.brownlee@aukuni.ac.nz> + 412 Desktop Management Task Force (DMTF) + Dave Perkins + 413 Klever Computers, Inc. Tom Su 408-735-7723 kci@netcom.com + 414 Amdahl Corporation Steve Young sy@uts.admahl.com + 415 JTEC Pty, Ltd. Jan Bartel (02) 809 6933 + 416 Matra Communcation Hong-Loc Nguyen (33.1) 34.60.85.25 + 417 HAL Computer Systems Michael A. Petonic petonic@hal.com + 418 Lawrence Berkeley Laboratory Russ Wright wright@lbl.gov + 419 Dale Computer Corporation Dean Craven 1-800-336-7483 + 420 IPTC, Universitaet of Tuebingen + Andreas J. Haug + 421 Bytex Corporation + Mary Ann Burt + 422 Cogwheel, Inc. Brian Ellis bri@Cogwheel.COM + 423 Lanwan Technologies Thomas Liu (408) 986-8899 + 424 Thomas-Conrad Corporation Karen Boyd 512-836-1935 + 425 TxPort Bill VerSteeg bvs@ver.com + 426 Compex, Inc. Andrew Corlett BDA@ORION.OAC.UCI.EDU + 427 Evergreen Systems, Inc. Bill Grace (415) 897-8888 + 428 HNV, Inc. James R. Simons jrs@denver.ssds.COM + 429 U.S. Robotics, Inc. Chris Rozman chrisr@usr.com + 430 Canada Post Corporation Walter Brown +1 613 722-8843 + 431 Open Systems Solutions, Inc. David Ko davidk@ossi.com + 432 Toronto Stock Exchange Paul Kwan (416) 947-4284 + + + +Reynolds & Postel [Page 144] + +RFC 1700 Assigned Numbers October 1994 + + + 433 MamakosTransSys Consulting + Louis A. Mamakos louie@transsys.com + 434 EICON Vartan Narikian vartan@eicon.qc.ca + 435 Jupiter Systems Russell Leefer rml@jupiter.com + 436 SSTI Philip Calas (33) 61 44 19 51 + 437 Grand Junction Networks Randy Ryals randyr@grandjunction.com + 438 Anasazi, Inc. Chad Larson (chad@anasazi.com) + 439 Edward D. Jones and Company John Caruso (314) 851-3422 + 440 Amnet, Inc. Richard Mak mak@amnet.COM + 441 Chase Research Kevin Gage ---none--- + 442 PEER Networks Randy Presuhn randy@peer.com + 443 Gateway Communications, Inc. Ed Fudurich ---none--- + 444 Peregrine Systems Eric Olinger eric@peregrine.com + 445 Daewoo Telecom SeeYoung Oh oco@scorpio.dwt.co.kr + 446 Norwegian Telecom Research Paul Hoff paalh@brage.nta.no + 447 WilTel Anil Prasad anil_prasad@wiltel.com + 448 Ericsson-Camtec Satish Popat ---none--- + 449 Codex Thomas McGinty ---none--- + 450 Basis Heidi Stettner heidi@mtxinu.COM + 451 AGE Logic Syd Logan syd@age.com + 452 INDE Electronics Gordon Day gday@inde.ubc.ca + 453 ISODE Consortium Steve Kille S.Kille@isode.com + 454 J.I. Case Mike Oswald mike@helios.uwsp.edu + 455 Trillium Jeff Lawrence j_lawrence@trillium.com + 456 Bacchus Inc. Errol Ginsberg bacchus!zulu!errol@uu2.psi.com + 457 MCC Doug Rosenthal rosenthal@mcc.com + 458 Stratus Computer Dave Snay dks@sw.stratus.com + 459 Quotron Richard P. Stubbs richard@atd.quotron.com + 460 Beame & Whiteside Carl Beame beame@ns.bws.com + 461 Cellular Technical Services Greg Hummel ---none--- + 462 Shore Microsystems, Inc. Gordon Elam (309) 229-3009 + 463 Telecommunications Techniques Corp. Tom Nisbet nisbet@tt.com + 464 DNPAP (Technical University Delft) + Jan van Oorschot + 465 Plexcom, Inc. Bruce Miller (805) 522-3333 + 466 Tylink Stavros Mohlulis (508) 285-0033 + 467 Brookhaven National Laboratory + Dave Stampf drs@bach.ccd.bnl.gov + 468 Computer Communication Systems + Gerard Laborde + 469 Norand Corp. Rose Gorrell 319-269-3100 + 470 MUX-LAP Philippe Labrosse 514-735-2741 + 471 Premisys Communications, Inc + Mike MacFaden + 472 Bell South Telecommunications Johnny Walker 205-988-7105 + 473 J. Stainsbury PLC Steve Parker 44-71-921-7550 + 474 Ki Research Inc Toni Barckley 410-290-0355x220 + 475 Wandel and Goltermann Technologies + + + +Reynolds & Postel [Page 145] + +RFC 1700 Assigned Numbers October 1994 + + + David Walters 919-941-5730x4203 + 476 Emerson Computer Power + Roger Draper 714-457-3638 rdraper@cerf.net + 477 Network Software Associates Jeffery Chiao 714-768-4013 + 478 Procter and Gamble Peter Marshall 513-983-1100x5988 + 479 Meridian Technology Corporation + Kenneth B. Denson + 480 QMS, Inc. Bill Lott lott@imagen.com + 481 Network Express Tom Jarema 313-761-5051 ITOH@MSEN.COM + 482 LANcity Corporation Pam Yassini pam@lancity.com + 483 Dayna Communications, Inc. + Sanchaita Datta datta@signus.utah.edu + 484 kn-X Ltd. Sam Lau 44 943 467007 + 485 Sync Research, Inc. Alan Bartky (714) 588-2070 + 486 PremNet Ken Huang HuangK@rimail.interlan.com + 487 SIAC Peter Ripp (212) 383-9061 + 488 New York Stock Exchange Peter Ripp (212) 383-9061 + 489 American Stock Exchange Peter Ripp (212) 383-9061 + 490 FCR Software, Inc. Brad Parker brad@fcr.com + 491 National Medical Care, Inc. Robert Phelan (617) 466-9850 + 492 Dialogue Communication Systemes, S.A. + Klaus Handke +(49) 30 802 24 97 + 493 NorTele Bjorn Kvile +47 2 48 89 90 + 494 Madge Networks, Inc. + Duncan Greatwood dgreatwo@madge.mhs.compuserve.com + 495 Memotec Communications Graham Higgins ghiggins@teleglobe.com + 496 CTON Nick Hennenfent nicholas@cton.com + 497 Leap Technology, Inc. George Economou george@leap.com + 498 General DataComm, Inc. William Meltzer meltzer@gdc.com + 499 ACE Communications, Ltd. Danny On 972-3-570-1423 + 500 Automatic Data Processing (ADP) Alex Rosin (201) 714-3982 + 501 Programa SPRITEL Alberto Martinez + Martinez_Alberto_SPRITEL@euskom.spritel.es + 502 Adacom Aial Haorch 972-4-899-899 + 503 Metrodata Ltd Nick Brown 100022.767@compuserve.com + 504 Ellemtel Telecommunication Systems Laboratories + Richard G Bruvik Richard.Bruvik@eua.ericsson.se + 505 Arizona Public Service Duane Booher DBOOHER@APSC.COM + 506 NETWIZ, Ltd., Emanuel Wind eumzvir@techunix.technion.ac.il + 507 Science and Engineering Research Council (SERC) Paul Kummer + P.Kummer@daresbury.ac.uk + 508 The First Boston Corporation Kevin Chou + csfb1!dbadmin4!kchou@uunet.UU.NET + 509 Hadax Electronics Inc. Marian Kramarczyk + 73477.2731@compuserve.com + 510 VTKK Markku Lamminluoto lamminluoto@vtkes1.vtkk.fi + 511 North Hills Israel Ltd. Carmi Cohen carmi@north.hellnet.org + 512 TECSIEL R. Burlon sr@teculx.tecsiel.it + + + +Reynolds & Postel [Page 146] + +RFC 1700 Assigned Numbers October 1994 + + + 513 Bayerische Motoren Werke (BMW) AG Michael Connolly + mconnolly@net.bmw.de + 514 CNET Technologies Nelson Su 408-954-8000 + 515 MCI Kurt Robohm krobohm@mcimail.com + 516 Human Engineering AG (HEAG) Urs Brunner + ubrunner@clients.switch.ch + 517 FileNet Corporation Joe Raby raby@filenet.com + 518 NFT-Ericsson Kjetil Donasen +47 2 84 24 00 + 519 Dun & Bradstreet Vic Smagovic 908-464-2079 + 520 Intercomputer Communications Brian Kean 513-745-0500x244 + 521 Defense Intelligence Agency + Barry Atkinson DIA-DMS@DDN-CONUS.DDN.MIL + 522 Telesystems SLW Inc. Joe Magony 416-441-9966 + 523 APT Communications David Kloper 301-831-1182 + 524 Delta Airlines Jim Guy 404-715-2948 + 525 California Microwave Kevin Braun 408-720-6520 + 526 Avid Technology Inc Steve Olynyk 508-640-3328 + 527 Integro Advanced Computer Systems + Pascal Turbiez +33-20-08-00-40 + 528 RPTI Chris Shin 886-2-918-3006 + 529 Ascend Communications Inc. Marc Hyman 510-769-6001 + 530 Eden Computer Systems Inc. Louis Brando 305-591-7752 + 531 Kawasaki-Steel Corp + Tomoo Watanabe nrd@info.kawasaki-steel.co.jp + 532 Barclays Malcolm Houghton +44 202 671 212 + 533 B.U.G., Inc. Isao Tateishi tateishi@bug.co.jp + 534 Exide Electronics Brian Hammill hamill@dolphin.exide.com + 535 Superconducting Supercollider Lab. + Carl W. Kalbfleisch cwk@irrational.ssc.gov + 536 Triticom Jim Bales (612) 937-0772 + 537 Universal Instruments Corp. + Tom Dinnel BA06791%BINGVAXA.bitnet@CUNYVM.CUNY.EDU + 538 Information Resources, Inc. Jeff Gear jjg@infores.com + 539 Applied Innovation, Inc. Dean Dayton dean@aicorp.cmhnet.org + 540 Crypto AG Roland Luthi luthi@iis.ethz.ch + 541 Infinite Networks, Ltd. Sean Harding +44 923 710 277 + 542 Rabbit Software Bill Kwan kwan@rabbit.com + 543 Apertus Technologies Stuart Stanley stuarts@apertus.com + 544 Equinox Systems, Inc. Monty Norwood 1-800-275-3500 x293 + 545 Hayes Microcomputer Products + Chris Roussel hayes!hayes.com!croussel@uunet.UU.NET + 546 Empire Technologies Inc. Cheryl Krupczak cheryl@cc.gatech.edu + 547 Glaxochem, Ltd. Andy Wilson 0229 52261547 + 548 KPY Network Partners, Corp. + Gordon Vickers sccs@pizza.netcom.com + 549 Agent Technology, Inc. Ibi Dhilla idhilla@genesis.nred.ma.us + 550 Dornier GMBH Arens Heinrech 49-7545-8 ext 9337 + 551 Telxon Corporation Frank Ciotti frankc@teleng.telxon.com + + + +Reynolds & Postel [Page 147] + +RFC 1700 Assigned Numbers October 1994 + + + 552 Entergy Corporation Louis Cureau 504-364-7630 + 553 Garrett Communications Inc. Igor Khasin (408) 980-9752 + 554 Agile Networks, Inc. Dave Donegan ddonegan@agile.com + 555 Larscom Sameer Jayakar 415-969-7572 + 556 Stock Equipment Karl Klebenow 216-543-6000 + 557 ITT Corporation Kevin M. McCauley kmm@vaxf.acdnj.itt.com + 558 Universal Data Systems, Inc. + Howard Cunningham 70400.3671@compuserve.com + 559 Sonix Communications, Ltd. David Webster +44 285 641 651 + 560 Paul Freeman Associates, Inc. + Pete Wilson pwilson@world.std.com + 561 John S. Barnes, Corp. Michael Lynch 704-878-4107 + 562 Northern Telecom, Ltd. + Glenn Waters 613-763-3933 + 563 CAP Debris Patrick Preuss ppr@lfs.hamburg.cap-debris.de + 564 Telco Systems NAC Harry Hirani Harry@telco-nac.com + 565 Tosco Refining Co Fred Sanderson 510-602-4358 + 566 Russell Info Sys Atul Desai 714-362-4040 + 567 University of Salford Richard Letts R.J.Letts@salford.ac.uk + 568 NetQuest Corp. Jerry Jacobus netquest@tigger.jvnc.net + 569 Armon Networking Ltd. Yigal Jacoby yigal@armon.hellnet.org + 570 IA Corporation Didier Fort Didier.Fort@lia.com + 571 AU-System Communicaton AB Torbjorn Ryding 8-7267572 + 572 GoldStar Information & Communications, Ltd. + Soo N. Kim ksn@giconet.gsic.co.kr + 573 SECTRA AB Tommy Pedersen tcp@sectra.se + 574 ONEAC Corporation Bill Elliot ONEACWRE@AOL.COM + 575 Tree Technologies Michael Demjanenko (716) 688-4640 + 576 GTE Government Systems Henry Hernandez (617) 455-2942 + 577 Denmac Systems, Inc. Andy Denenberg (708) 291-7760 + 578 Interlink Computer Sciences, Inc. + Mike Mazurek mfm@interlink.com + 579 Bridge Information Systems, Inc. Stephen Harvey (314) 567-8482 + 580 Leeds and Northrup Australia (LNA) Nigel Cook nigelc@lna.oz.au + 581 BHA Computer David Hislop rob@bha.oz.au + 582 Newport Systems Solutions, Inc. + Pauline Chen paulinec@netcom.com + 583 Atrium Technologies Narender Reddy Vangati vnr@atrium.com + 584 ROBOTIKER Maribel Narganes maribel@teletek.es + 585 PeerLogic Inc. Ratinder Ahuja ratinder@peerlogic.com + 586 Digital Transmittion Systems Bill VerSteeg bvs@ver.com + 587 Far Point Communications Bill VerSteeg bvs@ver.com + 588 Xircom Bill VerSteeg bvs@ver.com + 589 Mead Data Central Stephanie Bowman steph@meaddata.com + 590 Royal Bank of Canada N. Lim (416) 348-5197 + 591 Advantis, Inc. Janet Brehm 813 878-4298 + 592 Chemical Banking Corp. Paul McDonnell pmcdonnl@world.std.com + 593 Eagle Technology Ted Haynes (408) 441-4043 + + + +Reynolds & Postel [Page 148] + +RFC 1700 Assigned Numbers October 1994 + + + 594 British Telecom Ray Smyth rsmyth@bfsec.bt.co.uk + 595 Radix BV P. Groenendaal project2@radix.nl + 596 TAINET Communication System Corp. + Joseph Chen +886-2-6583000 (R.O.C.) + 597 Comtek Services Inc. Steve Harris (703) 506-9556 + 598 Fair Issac Steve Pasadis apple.com!fico!sxp (415) 472-2211 + 599 AST Research Inc. Bob Beard bobb@ast.com + 600 Soft*Star s.r.l. Ing. Enrico Badella softstar@pol88a.polito.it + 601 Bancomm Joe Fontes jwf@bancomm.com + 602 Trusted Information Systems, Inc. + James M. Galvin galvin@tis.com + 603 Harris & Jeffries, Inc. Deepak Shahane hjinc@CERF.NET + 604 Axel Technology Corp. Henry Ngai (714) 455-1688 + 605 GN Navtel, Inc. Joe Magony 416-479-8090 + 606 CAP debis Patrick Preuss +49 40 527 28 366 + 607 Lachman Technology, Inc. Steve Alexander stevea@lachman.com + 608 Galcom Networking Ltd. + Zeev Greenblatt galnet@vax.trendline.co.il + 609 BAZIS M. van Luijt martin@bazis.nl + 610 SYNAPTEL Eric Remond remond@synaptel.fr + 611 Investment Management Services, Inc. + J. Laurens Troost rens@stimpys.imsi.com + 612 Taiwan Telecommunication Lab + Dennis Tseng LOUIS%TWNMOCTL.BITNET@pucc.Princeton.EDU + 613 Anagram Corporation Michael Demjanenko (716) 688-4640 + 614 Univel John Nunneley jnunnele@univel.com + 615 University of California, San Diego + Arthur Bierer abierer@ucsd.edu + 616 CompuServe Ed Isaacs, Brian Biggs SYSADM@csi.compuserve.com + 617 Telstra - OTC Australia + Peter Hanselmann peterhan@turin.research.otc.com.au + 618 Westinghouse Electric Corp. + Ananth Kupanna ananth@access.digex.com + 619 DGA Ltd. Tom L. Willis twillis@pintu.demon.co.uk + 620 Elegant Communications Inc. + Robert Story Robert.Story@Elegant.COM + 621 Experdata Claude Lubin clubin@expdat.gna.org + 622 Unisource Business Networks Sweden AB + Goran Sterner gsr@tip.net + 623 Molex, Inc. Steven Joffe molex@mcimail.com + 624 Quay Financial Software Mick Fleming mickf@quay.ie + 625 VMX Inc. Joga Ryali joga@vmxi.cerfnet.com + 626 Hypercom, Inc. Noor Chowdhury (602) 548-2113 + 627 University of Guelph Kent Percival Percival@CCS.UoGuelph.CA + 628 DIaLOGIKa Juergen Jungfleisch 0 68 97 9 35-0 + 629 NBASE Switch Communication + Sergiu Rotenstein 75250.1477@compuserve.com + 630 Anchor Datacomm B.V. Erik Snoek sdrierik@diamond.sara.nl + + + +Reynolds & Postel [Page 149] + +RFC 1700 Assigned Numbers October 1994 + + + 631 PACDATA John Reed johnr@hagar.pacdata.com + 632 University of Colorado Evi Nemeth evi@cs.colorado.edu + 633 Tricom Communications Limited + Robert Barrett 0005114429@mcimail.com + 634 Santix Software GmbH + Michael Santifaller santi%mozart@santix.guug.de + 635 FastComm Communications Corp. + Bill Flanagan 70632.1446@compuserve.com + 636 The Georgia Institute of Technology + Michael Mealling michael.mealling@oit.gatech.edu + 637 Alcatel Data Networks + Douglas E. Johnson doug.e.johnson@adn.sprint.com + 638 GTECH Brian Ruptash bar@gtech.com + 639 UNOCAL Corporation Peter Ho ho@unocal.com + 640 First Pacific Network Randy Hamilton 408-703-2763 + 641 Lexmark International Don Wright don@lexmark.com + 642 Qnix Computer Sang Weon, Yoo swyoo@qns.qnix.co.kr + 643 Jigsaw Software Concepts (Pty) Ltd. + Willem van Biljon wvb@itu2.sun.ac.za + 644 VIR, Inc. Mark Cotton (215) 364-7955 + 645 SFA Datacomm Inc. Don Lechthaler lech@world.std.com + 646 SEIKO Telecommunication Systems, Inc. + Lyn T. Robertson (503) 526-5638 + 647 Unified Management Andy Barnhouse (612) 561-4944 + 648 RADLINX Ltd. Ady Lifshes ady%rndi@uunet.uu.net + 649 Microplex Systems Ltd. Henry Lee hyl@microplex.com + 650 Objecta Elektronik & Data AB Johan Finnved jf@objecta.se + 651 Phoenix Microsystems Bill VerSteeg bvs@ver.com + 652 Distributed Systems International, Inc. + Ron Mackey rem@dsiinc.com + 653 Evolving Systems, Inc. Judith C. Bettinger judy@evolving.com + 654 SAT GmbH Walter Eichelburg 100063.74@compuserve.com + 655 CeLAN Technology, Inc. Mark Liu 886--35-772780 + 656 Landmark Systems Corp. + Steve Sonnenberg steves@socrates.umd.edu + 657 Netone Systems Co., Ltd. + YongKui Shao syk@new-news.netone.co.jp + 658 Loral Data Systems Jeff Price jprice@cps070.lds.loral.com + 659 Cellware Broadband Technology Michael Roth mike@cellware.de + 660 Mu-Systems Gaylord Miyata miyata@world.std.com + 661 IMC Networks Corp. Jerry Roby (714) 724-1070 + 662 Octel Communications Corp. Alan Newman (408) 321-5182 + 663 RIT Technologies LTD. Ghiora Drori drori@dcl.hellnet.org + 664 Adtran Jeff Wells 205-971-8000 + 665 PowerPlay Technologies, Inc. Ray Caruso rayman@csn.org + 666 Oki Electric Industry Co., Ltd. + Shigeru Urushibara uru@cs1.cs.oki.co.jp + 667 Specialix International Jeremy Rolls jeremyr@specialix.co.uk + + + +Reynolds & Postel [Page 150] + +RFC 1700 Assigned Numbers October 1994 + + + 668 INESC (Instituto de Engenharia de Sistemas e Computadores) + Pedro Ramalho Carlos prc@inesc.pt + 669 Globalnet Communications Real Barriere (514) 651-6164 + 670 Product Line Engineer SVEC Computer Corp. + Rich Huang msumgr@enya.cc.fcu.edu.tw + 671 Printer Systems Corp. Bill Babson bill@prsys.com + 672 Contec Micro Electronics USA David Sheih (408) 434-6767 + 673 Unix Integration Services Chris Howard chris@uis.com + 674 Dell Computer Corporation Steven Blair sblair@dell.com + 675 Whittaker Electronic Systems Michael McCune mccune@cerf.net + 676 QPSX Communications David Pascoe davidp@qpsx.oz.au + 677 Loral WDl Mike Aronson Mike_Aronson@msgate.wdl.loral.com + 678 Federal Express Corp. Randy Hale (901) 369-2152 + 679 E-COMMS Inc. Harvey Teale (206) 857-3399 + 680 Software Clearing House Tom Caris ca@sch.com + 681 Antlow Computers LTD. C. R. Bates 44-635-871829 + 682 Emcom Corp. Mike Swartz emcom@cerf.net + 683 Extended Systems, Inc. + Al Youngwerth alberty@tommy.extendsys.com + 684 Sola Electric Mike Paulsen (708) 439-2800 + 685 Esix Systems, Inc. Anthony Chung esix@esix.tony.com + 686 3M/MMM Chris Amley ccamley@mmm.com + 687 Cylink Corp. Ed Chou ed@cylink.com + 688 Znyx Advanced Systems Division, Inc. + Alan Deikman aland@netcom.com + 689 Texaco, Inc. Jeff Lin linj@Texaco.com + 690 McCaw Cellular Communication Corp. Tri Phan tri.phan@mccaw.com + 691 ASP Computer Product Inc. Elise Moss 71053.1066@compuserve.com + 692 HiPerformance Systems Mike Brien +27-11-806-1000 + 693 Regionales Rechenzentrum + Sibylle Schweizer unrz54@daphne.rrze.uni-erlangen.de + 694 SAP AG Dr. Uwe Hommel +49 62 27 34 0 + 695 ElectroSpace System Inc. + Dr. Joseph Cleveland e03353@esitx.esi.org + 696 ( Unassigned ) + 697 MultiPort Software Reuben Sivan 72302.3262@compuserve.com + 698 Combinet, Inc. Samir Sawhney samir@combinet.com + 699 TSCC Carl Wist carlw@tscc.com + 700 Teleos Communications Inc. Bill Nayavich wln@teleoscom.com + 701 Alta Research Amy Saperstein (305) 428-8535 + 702 Independence Blue Cross Bill Eshbach esh@ibx.com + 703 ADACOM Station Interconnectivity LTD. + Itay Kariv +9 72 48 99 89 9 + 704 MIROR Systems Frank Kloes +27 12 911 0003 + 705 Merlin Gerin Adam Stolinski (714) 557-1637 x249 + 706 Owen-Corning Fiberglas Tom Mann mann.td@ocf.compuserve.com + 707 Talking Networks Inc. Terry Braun tab@lwt.mtxinu.com + 708 Cubix Corporation Rebekah Marshall (702) 883-7611 + + + +Reynolds & Postel [Page 151] + +RFC 1700 Assigned Numbers October 1994 + + + 709 Formation Inc. Bob Millis bobm@formail.formation.com + 710 Lannair Ltd. Pablo Brenner pablo@lannet.com + 711 LightStream Corp. Chris Chiotasso chris@lightstream.com + 712 LANart Corp. Doron I. Gartner doron@lanart.com + 713 University of Stellenbosch Graham Phillips phil@cs.sun.ac.za + 714 Wyse Technology Bill Rainey bill@wyse.com + 715 DSC Communications Corp. Colm Bergin cbergin@cpdsc.com + 716 NetEc Thomas Krichel netec@uts.mcc.ac.uk + 717 Breltenbach Software Engineering Hilmar Tuneke +02 92 49 70 00 + 718 Victor Company of Japan,Limited + Atsushi Sakamoto 101176.2703@compuserve.com + 719 Japan Direx Corporation Teruo Tomiyama +81 3 3498 5050 + 720 NECSY Network Control Systems S.p.A. Piero Fiozzo fip@necsy.it + 721 ISDN Systems Corp. Jeff Milloy p00633@psilink.com + 722 Zero-One Technologies, LTD. Curt Chen + 88 62 56 52 32 33 + 723 Radix Technologies, Inc. Steve Giles giless@delphi.com + 724 National Institute of Standards and Technology + Jim West west@mgmt3.ncsl.nist.gov + 725 Digital Technology Inc. Chris Gianattasio gto@lanhawk.com + 726 Castelle Corp. Waiming Mok wmm@castelle.com + 727 Presticom Inc. Martin Dube 76270.2672@compuserve.com + 728 Showa Electric Wire & Cable Co., Ltd. + Robert O'Grady kfn@tanuki.twics.co.jp + 729 SpectraGraphics Jack Hinkle hinkle@spectra.com + 730 Connectware Inc. Rick Downs rxd4@acsysinc.com + 731 Wind River Systems Emily Hipp hipp@wrs.com + 732 RADWAY International Ltd. Doron Kolton 0005367977@mcimail.com + 733 System Management ARTS, Inc. Alexander Dupuy dupuy@smarts.com + 734 Persoft, Inc. Steven M. Entine entine@pervax.persoft.com + 735 Xnet Technology Inc. Esther Chung estchung@xnet-tech.com + 736 Unison-Tymlabs Dean Andrews ada@unison.com + 737 Micro-Matic Research Patrick Lemli 73677.2373@compuserve.com + 738 B.A.T.M. Advance Technologies + Nahum Killim bcrystal@actcom.co.il + 739 University of Copenhagen Kim H|glund shotokan@diku.dk + 740 Network Security Systems, Inc. + Carleton Smith rpitt@nic.cerf.net + 741 JNA Telecommunications Sean Cody seanc@jna.com.au + 742 Encore Computer Corporation Tony Shafer tshafer@encore.com + 743 Central Intelligent Agency Carol Jobusch 703 242-2485 + 744 ISC (GB) Limited Mike Townsend miket@cix.compulink.co.uk + 745 Digital Communication Associates Ravi Shankar shankarr@dca.com + 746 CyberMedia Inc. Unni Warrier unni@cs.ucla.edu + 747 Distributed Systems International, Inc. + Ron Mackey rem@dsiinc.com + 748 Peter Radig EDP-Consulting Peter Radig +49 69 9757 6100 + 749 Vicorp Interactive Systems Phil Romine phil@vis.com + 750 Inet Inc. Bennie Lopez brl@inetinc.com + + + +Reynolds & Postel [Page 152] + +RFC 1700 Assigned Numbers October 1994 + + + 751 Argonne National Laboratory Michael Shaffer mashaffer@anl.gov + 752 Tek Logix Peter Palsall 905 625-4121 + 753 North Western University Phil Draughon jpd@nwu.edu + 754 Astarte Fiber Networks James Garnett garnett@catbelly.com + 755 Diederich & Associates, Inc. + Douglas Capitano dlcapitano@delphi.com + 756 Florida Power Corporation Bob England rengland@fpc.com + 757 ASK/INGRES Howard Dernehl howard@ingres.com + 758 Open Network Enterprise Spada Stefano +39 39 245-8101 + 759 The Home Depot Keith Porter ktp01@homedepot.com + 760 Pan Dacom Telekommunikations Jens Andresen +49 40 644 09 71 + 761 NetTek Steve Kennedy steve@gbnet.com + 762 Karlnet Corp. Doug Kall kbridge@osu.edu + 763 Efficient Networks, Inc. Thirl Johnson (214) 991-3884 + 764 Fiberdata Jan Fernquist +46 828 8383 + 765 Lanser Emil Smilovici (514) 485-7104 + 766 Telebit Communications A/S Peder Chr. Norgaard pcn@tbit.dk + 767 HILAN GmbH Markus Pestinger markus@lahar.ka.sub.org + 768 Network Computing Inc. + Fredrik Noon fnoon@ncimail.mhs.compuserve.com + 769 Walgreens Company Denis Renaud (708) 818-4662 + 770 Internet Initiative Japan Inc. Toshiharu Ohno tony-o@iij.ad.jp + 771 GP van Niekerk Ondernemings + Gerrit van Niekerk gvanniek@dos-lan.cs.up.ac.za + 772 DSP & Telecoms Research Group + Patrick McGleenon p.mcgleenon@ee.queens-belfast.ac.uk + 773 Securities Industry Automation Corporation + Chiu Szeto cszeto@prism.poly.edu + 774 SYNaPTICS David Gray david@synaptics.ie + 775 Data Switch Corporation Joe Welfeld jwelfeld@dasw.com + 776 Telindus Distribution Karel Van den Bogaert kava@telindus.be + 777 MAXM Systems Corporation Gary Greathouse ggreathouse@maxm.com + 778 Fraunhofer Gesellschaft + Jan Gottschick jan.gottschick@isst.fhg.de + 779 EQS Business Services Ken Roberts kroberts@esq.com + 780 CNet Technology Inc. Repus Hsiung idps17@shts.seed.net.tw + 781 Datentechnik GmbH Thomas Pischinger +43 1 50100 266 + 782 Network Solutions Inc. Dave Putman davep@netsol.com + 783 Viaman Software Vikram Duvvoori info@viman.com + 784 Schweizerische Bankgesellschaft Zuerich + Roland Bernet Roland.Bernet@zh014.ubs.ubs.ch + 785 University of Twente - TIOS Aiko Pras pras@cs.utwente.nl + 786 Simplesoft Inc. Sudhir Pendse sudhir@netcom.com + 787 Stony Brook, Inc. Ken Packert p01006@psilink.com + 788 Unified Systems Solutions, Inc. + Steven Morgenthal smorgenthal@attmail.com + 789 Network Appliance Corporation + Varun Mehta varun@butch.netapp.com + + + +Reynolds & Postel [Page 153] + +RFC 1700 Assigned Numbers October 1994 + + + 790 Ornet Data Communication Technologies Ltd. + Haim Kurz haim@ornet.co.il + 791 Computer Associates International + Glenn Gianino giagl01@usildaca.cai.com + 792 Multipoint Network Inc. Michael Nguyen mike@multipoint.com + 793 NYNEX Science & Technology Lily Lau llau@nynexst.com + 794 Commercial Link Systems Wiljo Heinen wiljo@freeside.cls.de + 795 Adaptec Inc. Tom Battle tab@lwt.mtxinu.com + 796 Softswitch Charles Springer cjs@ssw.com + 797 Link Technologies, Inc. Roy Chu royc@wyse.com + 798 IIS Olry Rappaport iishaifa@attmail.com + 799 Mobile Solutions Inc. Dale Shelton dshelton@srg.srg.af.mil + 800 Xylan Corp. Burt Cyr burt@xylan.com + 801 Airtech Software Forge Limited + Callum Paterson tsf@cix.compulink.co.uk + 802 National Semiconductor Maurice Turcotte mturc@atlanta.nsc.com + 803 Video Lottery Technologies Angelo Lovisa ange@awd.cdc.com + 804 National Semiconductor Corp Waychi Doo wcd@berlioz.nsc.com + 805 Applications Management Corp + Terril (Terry) Steichen tjs@washington.ssds.com + 806 Travelers Insurance Company Eric Miner ustrv67v@ibmmail.com + 807 Taiwan International Standard Electronics Ltd. + B. J. Chen bjchen@taisel.com.tw + 808 US Patent and Trademark Office Rick Randall randall@uspto.gov + 809 Hynet, LTD. Amir Fuhrmann amf@teleop.co.il + 810 Aydin, Corp. Rick Veher (215) 657-8600 + 811 ADDTRON Technology Co., LTD. Tommy Tasi +8 86-2-4514507 + 812 Fannie Mae David King s4ujdk@fnma.com + 813 MultiNET Services Hubert Martens martens@multinet.de + 814 GECKO mbH Holger Dopp hdo@gecko.de + 815 Memorex Telex Mike Hill hill@raleng.mtc.com + 816 Advanced Communications Networks (ACN) SA + Antoine Boss +41 38 247434 + 817 Telekurs AG Jeremy Brookfield bkj@iris.F2.telekurs.ch + 818 Victron bv Jack Stiekema jack@victron.nl + 819 CF6 Company Francois Caron +331 4696 0060 + 820 Walker Richer and Quinn Inc. + Rebecca Higgins rebecca@elmer.wrq.com + 821 Saturn Systems Paul Parker paul_parker@parker.fac.cs.cmu.edu + 822 Mitsui Marine and Fire Insurance Co. LTD. + Kijuro Ikeda +813 5389 8111 + 823 Loop Telecommunication International, Inc. + Charng-Show Li +886 35 787 696 + 824 Telenex Corporation James Krug (609) 866-1100 + 825 Bus-Tech, Inc. Charlie Zhang chun@eecs.cory.berkley.edu + 826 ATRIE Fred B.R. Tuang cmp@fddi3.ccl.itri.org.tw + 827 Gallagher & Robertson A/S Arild Braathen arild@gar.no + 828 Networks Northwest, Inc. John J. Hansen jhansen@networksnw.com + + + +Reynolds & Postel [Page 154] + +RFC 1700 Assigned Numbers October 1994 + + + 829 Conner Peripherials Richard Boyd rboyd@mailserver.conner.com + 830 Elf Antar France P. Noblanc +33 1 47 44 45 46 + 831 Lloyd Internetworking Glenn McGregor glenn@lloyd.com + 832 Datatec Industries, Inc. Chris Wiener cwiener@datatec.com + 833 TAICOM Scott Tseng cmp@fddi3.ccl.itri.org.tw + 834 Brown's Operating System Services Ltd. + Alistair Bell alistair@ichthya.demon.co.uk + 835 MiLAN Technology Corp. Gopal Hegde gopal@milan.com + 836 NetEdge Systems, Inc. Dave Minnich Dave_Minnich@netedge.com + 837 NetFrame Systems George Mathew george_mathew@netframe.com + 838 Xedia Corporation Colin Kincaid colin%madway.uucp@dmc.com + 839 Pepsi Niraj Katwala niraj@netcom.com + 840 Tricord Systems, Inc. Mark Dillon mdillon@tricord.mn.org + 841 Proxim Inc. Russ Reynolds proxim@netcom.com + 842 Applications Plus, Inc. Joel Estes joele@hp827.applus.com + 843 Pacific Bell Aijaz Asif saasif@srv.PacBell.COM + 844 Supernet Sharon Barkai sharon@supernet.com + 845 TPS-Teleprocessing Systems Manfred Gorr gorr@tpscad.tps.de + 846 Technology Solutions Company Niraj Katwala niraj@netcom.com + 847 Computer Site Technologies Tim Hayes (805) 967-3494 + 848 NetPort Software John Bartas jbartas@sunlight.com + 849 Alon Systems Menachem Szus 70571.1350@compuserve.com + 850 Tripp Lite Lawren Markle 72170.460@compuserve.com + 851 NetComm Limited + Paul Ripamonti paulri@msmail.netcomm.pronet.com + 852 Precision Systems, Inc. (PSI) + Fred Griffin cheryl@empiretech.com + 853 Objective Systems Integrators Ed Reeder Ed.Reeder@osi.com + 854 Simpact Associates Inc. + Robert Patterson bpatterson@dcs.simpact.com + 855 Systems Enhancement Corporation + Steve Held 71165.2156@compuserve.com + 856 Information Integration, Inc. Gina Sun iiii@netcom.com + 857 CETREL S.C. Louis Reinard ssc-re@cetrel.lu + 858 ViaTech Development + Theodore J. Collins III ted.collins@vtdev.mn.org + 859 Olivetti North America Tom Purcell tomp@mail.spk.olivetti.com + 860 WILMA Nikolaus Schaller hns@ldv.e-technik.tu-muenchen.de + 861 ILX Systems Inc. Peter Mezey peterm@ilx.com + 862 Total Peripherals Inc. Mark Ustik (508) 393-1777 + 863 SunNetworks Consultant John Brady jbrady@fedeast.east.sun.com + 864 Arkhon Technologies, Inc. Joe Wang rkhon@nic.cerf.net + 865 Computer Sciences Corporation + George M. Dands dands@sed.csc.com + 866 Philips.TRT Thibault Muchery +33 14128 7000 + 867 Katron Technologies Inc. Robert Kao +88 627 991 064 + 868 Transition Engineering Inc. + Hemant Trivedi hemant@transition.com + + + +Reynolds & Postel [Page 155] + +RFC 1700 Assigned Numbers October 1994 + + + 869 Altos Engineering Applications, Inc. + Wes Weber or Dave Erhart altoseng@netcom.com + 870 Nicecom Ltd. Arik Ramon arik@nicecom.nice.com + 871 Fiskars/Deltec Carl Smith (619) 291-2973 + 872 AVM GmbH Andreas Stockmeier stocki@avm-berlin.de + 873 Comm Vision Richard Havens (408) 923 0301 x22 + 874 Institute for Information Industry + Peter Pan peterpan@pdd.iii.org.tw + 875 Legent Corporation Gary Strohm gstrohm@legent.com + 876 Network Automation Doug Jackson +64 6 285 1711 + 877 NetTech Marshall Sprague marshall@nettech.com + 878 Coman Data Communications Ltd. + Zvi Sasson coman@nms.cc.huji.ac.il + 879 Skattedirektoratet Karl Olav Wroldsen +47 2207 7162 + 880 Client-Server Technologies Timo Metsaportti timo@itf.fi + 881 Societe Internationale de Telecommunications Aeronautiques + Chuck Noren chuck.noren@es.atl.sita.int + 882 Maximum Strategy Inc. Paul Stolle pstolle@maxstrat.com + 883 Integrated Systems, Inc. Michael Zheng mz@isi.com + 884 E-Systems, Melpar Rick Silton rsilton@melpar.esys.com + 885 Reliance Comm/Tec Mark Scott 73422.1740@compuserve.com + 886 Summa Four Inc. Paul Nelson (603) 625-4050 + 887 J & L Information Systems Rex Jackson (818) 709-1778 + 888 Forest Computer Inc. Dave Black dave@forest.com + 889 Palindrome Corp. Jim Gast jgast@palindro.mhs.compuserve.com + 890 ZyXEL Communications Corp. Harry Chou howie@csie.nctu.edu.tw + 891 Network Managers (UK) Ltd, Mark D Dooley mark@netmgrs.co.uk + 892 Sensible Office Systems Inc. Pat Townsend (712) 276-0034 + 893 Informix Software Anthony Daniel anthony@informix.com + 894 Dynatek Communications Howard Linton (703) 490-7205 + 895 Versalynx Corp. Dave Fisler (619) 536-8023 + 896 Potomac Scheduling Communications Company + David Labovitz del@access.digex.net + 897 Sybase Inc. Dave Meldrum meldrum@sybase.com + 898 DiviCom Inc. Eyal Opher eyal@divi.com + 899 Datus elektronische Informationssysteme GmbH + Hubert Mertens marcus@datus.uucp + 900 Matrox Electronic Systems Limited + Marc-Andre Joyal marc-andre.joyal@matrox.com + 901 Digital Products, Inc. Ross Dreyer rdreyer@digprod.com + 902 Scitex Corp. Ltd. Yoav Chalfon yoav_h@ird.scitex.com + 903 RAD Vision Oleg Pogorelik radvis@vax.trendline.co.il + 904 Tran Network Systems Paul Winkeler paulw@revco.com + 905 Scorpion Logic Sean Harding +09 2324 5672 + 906 Inotech Inc. Eric Jacobs (703) 641-0469 + 907 Controlled Power Co. Yu Chin 76500,3160@compuserve.com + 908 Elsag Bailey Incorporate Derek McKearney mckearney@bailey.com + 909 J.P. Morgan Chung Szeto szeto_chung@jpmorgan.com + + + +Reynolds & Postel [Page 156] + +RFC 1700 Assigned Numbers October 1994 + + + 910 Clear Communications Corp. Kurt Hall khall@clear.com + 911 General Technology Inc. Perry Rockwell (407) 242-2733 + 912 Adax Inc. Jory Gessow jory@adax.com + 913 Mtel Technologies, Inc. Jon Robinson 552-3355@mcimail.com + 914 Underscore, Inc. Jeff Schnitzer jds@underscore.com + 915 SerComm Corp. Ben Lin +8 862-577-5400 + 916 Baxter Healthcare Corporation + Joseph Sturonas sturonaj@mpg.mcgawpark.baxter.com + 917 Tellus Technology Ron Cimorelli (510) 498-8500 + 918 Continuous Electron Beam Accelerator Facility + Paul Banta banta@cebaf.gov + 919 Canoga Perkins Margret Siska (818) 718-6300 + 920 R.I.S Technologies Fabrice Lacroix +33 7884 6400 + 921 INFONEX Corp. Kazuhiro Watanabe kazu@infonex.co.jp + 922 WordPerfect Corp. Douglas Eddy eddy@wordperfect.com + 923 NRaD Russ Carleton roccor@netcom.com + 924 Hong Kong Telecommunications Ltd. K. S. Luk +8 52 883 3183 + 925 Signature Systems Doug Goodall goodall@crl.com + 926 Alpha Technologies LTD. Guy Pothiboon (604) 430-8908 + 927 PairGain Technologies, Inc. Ken Huang kenh@pairgain.com + 928 Sonic Systems Sudhakar Ravi sudhakar@sonicsys.com + 929 Steinbrecher Corp. Kary Robertson krobertson@delphi.com + 930 Centillion Networks, Inc. Derek Pitcher derek@lanspd.com + 931 Network Communication Corp. + Tracy Clark ncc!central!tracyc@netcomm.attmail.com + 932 Sysnet A.S. Carstein Seeberg case@sysnet.no + 933 Telecommunication Systems Lab Gerald Maguire maguire@it.kth.se + 934 QMI Scott Brickner (410) 573-0013 + 935 Phoenixtec Power Co., LTD. An-Hsiang Tu +8 862 646 3311 + 936 Hirakawa Hewtech Corp. H. Ukaji lde02513@niftyserve.or.jp + 937 No Wires Needed B.V. Arnoud Zwemmer roana@cs.utwente.nl + 938 Primary Access Kerstin Lodman lodman@priacc.com + 939 Enterprises.FDSW Dag Framstad dag.framstad@fdsw.no + 940 Grabner & Kapfer GnbR Vinzenz Grabner zen@wsr.ac.att + 941 Nemesys Research Ltd. Michael Dixon mjd@nemesys.co.uk + 942 Pacific Communication Sciences, Inc. (PSCI) + Yvonne Kammer mib-contact@pcsi.com + 943 Level One Communications, Inc. + Moshe Kochinski moshek@level1.com + 944 Fast Track, Inc. Andrew H. Dimmick adimmick@world.std.com + 945 Andersen Consulting, OM/NI Practice + Greg Tilford p00919@psilink.com + 946 Bay Technologies Pty Ltd. Paul Simpson pauls@baytech.com.au + 947 Integrated Network Corp. Daniel Joffe wandan@integnet.com + 948 Epoch, Inc. David Haskell deh@epoch.com + 949 Wang Laboratories Inc. Pete Reilley pvr@wiis.wang.com + 950 Polaroid Corp. Sari Germanos sari@temerity.polaroid.com + 951 Sunrise Sierra Gerald Olson (510) 443-1133 + + + +Reynolds & Postel [Page 157] + +RFC 1700 Assigned Numbers October 1994 + + + 952 Silcon Group Bjarne Bonvang +45 75 54 22 55 + 953 Coastcom Donald Pickerel dpickere@netcom.com + 954 4th DIMENSION SOFTWARE LTD. + Thomas Segev/Ely Hofner autumn@zeus.datasrv.co.il + 955 SEIKO SYSTEMS Inc. Kiyoshi Ishida ishi@ssi.co.jp + 956 PERFORM Jean-Hugues Robert +33 42 27 29 32 + 957 TV/COM International Jean Tellier (619) 675-1376 + 958 Network Integration, Inc. + Scott C. Lemon slemon@nii.mhs.compuserve.com + 959 Sola Electric, A Unit of General Signal + Bruce Rhodes 72360,2436@compuserve.com + 960 Gradient Technologies, Inc. Geoff Charron geoff@gradient.com + 961 Tokyo Electric Co., Ltd. A. Akiyama +81 558 76 9606 + 962 Codonics, Inc. Joe Kulig jjk@codonics.com + 963 Delft Technical University Mark Schenk m.schenk@ced.tudelft.nl + 964 Carrier Access Corp. Roger Koenig tomquick@carrier.com + 965 eoncorp Barb Wilson wilsonb@eon.com + 966 Naval Undersea Warfare Center + Mark Lovelace lovelace@mp34.nl.nuwc.navy.mil + 967 AWA Limited Mike Williams +61 28 87 71 11 + 968 Distinct Corp. Tarcisio Pedrotti tarci@distinct.com + 969 National Technical University of Athens + Theodoros Karounos karounos@phgasos.ntua.gr + 970 BGS Systems, Inc. Amr Hafez amr@bgs.com + 971 McCaw Wireless Data Inc. Brian Bailey bbailey@airdata.com + 972 Bekaert Koen De Vleeschauwer kdv@bekaert.com + 973 Epic Data Inc. Vincent Lim vincent_lim@epic.wimsey.com + 974 Prodigy Services Co. Ed Ravin elr@wp.prodigy.com + 975 First Pacific Networks (FPN) Randy Hamilton randy@fpn.com + 976 Xylink Ltd. Bahman Rafatjoo 100117.665@compuserve.com + 977 Relia Technologies Corp. Fred Chen fredc@relia1.relia.com.tw + 978 Legacy Storage Systems Inc. + James Hayes james@lss-chq.mhs.compuserve.com + 979 Digicom, SPA Claudio Biotti +39 3312 0 0122 + 980 Ark Telecom Alan DeMars alan@arktel.com + 981 National Security Agency (NSA) + Cynthia Stewart maedeen@romulus.ncsc.mil + 982 Southwestern Bell Corporation + Brian Bearden bb8840@swuts.sbc.com + 983 Virtual Design Group, Inc. + Chip Standifer 70650.3316@compuserve.com + 984 Rhone Poulenc Olivier Pignault +33 1348 2 4053 + 985 Swiss Bank Corporation Neil Todd toddn@gb.swissbank.com + 986 ATEA N.V. Walter van Brussel p81710@banyan.atea.be + 987 Computer Communications Specialists, Inc. + Carolyn Zimmer cczimmer@crl.com + 988 Object Quest, Inc. Michael L. Kornegay mlk@bir.com + 989 DCL System International, Ltd. Gady Amit gady-a@dcl-see.co.il + + + +Reynolds & Postel [Page 158] + +RFC 1700 Assigned Numbers October 1994 + + + 990 SOLITON SYSTEMS K.K. Masayuki Yamai +81 33356 6091 + 991 U S Software Don Dunstan ussw@netcom.com + 992 Systems Research and Applications Corporation + Todd Herr herrt@smtplink.sra.com + 993 University of Florida Todd Hester todd@circa.ufl.edu + 994 Dantel, Inc. John Litster (209) 292-1111 + 995 Multi-Tech Systems, Inc. Dale Martenson (612) 785-3500 x519 + 996 Softlink Ltd. Moshe Leibovitch softlink@zeus.datasrv.co.il + 997 ProSum Christian Bucari +33.1.4590.6231 + 998 March Systems Consultancy, Ltd. + Ross Wakelin r.wakelin@march.co.uk + 999 Hong Technology, Inc. Walt Milnor brent@oceania.com + 1000 Internet Assigned Numbers Authority iana@isi.edu + 1001 PECO Energy Co. Rick Rioboli u002rdr@peco.com + 1002 United Parcel Service Steve Pollini nrd1sjp@nrd.ups.com + 1003 Storage Dimensions, Inc. Michael Torhan miketorh@xstor.com + 1004 ITV Technologies, Inc. Jacob Chen itv@netcom.com + 1005 TCPSI Victor San Jose Victor.Sanjose@sp1.y-net.es + 1006 Promptus Communications, Inc. Paul Fredette (401) 683-6100 + 1007 Norman Data Defense Systems + Kristian A. Bognaes norman@norman.no + 1008 Pilot Network Services, Inc. Rob Carrade carrade@pilot.net + 1009 Integrated Systems Solutions Corporation + Chris Cowan cc@austin.ibm.com + 1010 SISRO Kamp Alexandre 100074.344@compuserve.com + 1011 NetVantage Kevin Bailey speed@kaiwan.com + 1012 Marconi S.p.A. Giuseppe Grasso gg@relay.marconi.it + 1013 SURECOM Mike S. T. Hsieh +886.25.92232 + 1014 Royal Hong Kong Jockey Club + Edmond Lee 100267.3660@compuserve.com + 1015 Gupta Howard Cohen hcohen@gupta.com + 1016 Tone Software Corporation Neil P. Harkins (714) 991-9460 + 1017 Opus Telecom Pace Willisson pace@blitz.com + 1018 Cogsys Ltd. Niall Teasdale niall@hedgehog.demon.co.uk + 1019 Komatsu, Ltd. Akifumi Katsushima +81 463.22.84.30 + 1020 ROI Systems, Inc Michael Wong (801) 942-1752 + 1021 Lightning Instrumentation SA Mike O'Dowd odowd@lightning.ch + 1022 TimeStep Corp. Stephane Lacelle slacelle@newbridge.com + 1023 INTELSAT Ivan Giron i.giron@intelsat.int + 1024 Network Research Corporation Japan, Ltd. + Tsukasa Ueda 100156.2712@compuserve.com + 1025 Relational Development, Inc. Steven Smith rdi@ins.infonet.net + 1026 Emerald Systems, Corp. Robert A. Evans Jr. (619) 673-2161 x5120 + 1027 Mitel, Corp. Tom Quan tq@software.mitel.com + 1028 Software AG Peter Cohen sagpc@sagus.com + 1029 MillenNet, Inc. Manh Do (510) 770-9390 + 1030 NK-EXA Corp. Ken'ichi Hayami hayami@dst.nk-exa.co.jp + 1031 BMC Software Chris Sharp csharp@patrol.com + + + +Reynolds & Postel [Page 159] + +RFC 1700 Assigned Numbers October 1994 + + + 1032 StarFire Enterprises, Inc. Lew Gaiter lg@starfire.com + 1033 Hybrid Networks, Inc. Doug Muirhead dougm@hybrid.com + 1034 Quantum Software GmbH Thomas Omerzu omerzu@quantum.de + 1035 Openvision Technologies Limited + Andrew Lockhart alockhart@openvision.co.uk + 1036 Healthcare Communications, Inc. (HCI) + Larry Streepy streepy@healthcare.com + 1037 SAIT Systems Hai Dotu +3223.7053.11 + 1038 SAT Mleczko Alain +33.1.4077.1156 + 1039 CompuSci Inc., Bob Berry bberry@compusci.com + 1040 Aim Technology Ganesh Rajappan ganeshr@aim.com + 1041 CIESIN Kalpesh Unadkat kalpesh@ciesin.org + 1042 Systems & Technologies International + Howard Smith ghamex@aol.com + 1043 Israeli Electric Company (IEC) Yoram Harlev yoram@yor.iec.co.il + 1044 Phoenix Wireless Group, Inc. + Gregory M. Buchanan buchanan@pwgi.com + 1045 SWL Bill Kight wkightgrci.com (410) 290.7245 + 1046 nCUBE Greg Thompson gregt@ncube.com + 1047 Cerner, Corp. Dennis Avondet (816) 221.1024 X2432 + 1048 Andersen Consulting Mark Lindberg mlindber@andersen.com + 1049 Lincoln Telephone Company Bob Morrill root@si6000.ltec.com + 1050 Acer Jay Tao jtao@Altos.COM + 1051 Cedros Juergen Haakert +49.2241.9701.80 + 1052 AirAccess Ido Ophir 100274.365@compuserve.com + 1053 Expersoft Corporation David Curtis curtis@expersoft.com + 1054 Eskom Sanjay Lakhani h00161@duvi.eskom.co.za + 1055 SBE, Inc. Vimal Vaidya vimal@sbei.com + 1056 EBS, Inc. Emre Gundogan baroque@ebs.com + 1057 American Computer and Electronics, Corp. + Tom Abraham tha@acec.com + 1058 Syndesis Limited Wil Macaulay wil@syndesis.com + 1059 Isis Distributed Systems, Inc. Ken Chapman kchapman@isis.com + 1060 Priority Call Management Greg Schumacher gregs@world.std.com + 1061 Koelsch & Altmann GmbH + Christian Schreyer 100142.154@compuserve.com + 1062 WIPRO INFOTECH LTD. Chandrashekar Kapse kapse@wipinfo.soft.net + 1063 Controlware Uli Blatz ublatz@cware.de + 1064 Mosaic Software W.van Biljon willem@mosaic.co.za + 1065 Canon Information Systems + Victor Villalpando vvillalp@cisoc.canon.com + 1066 AmericaOnline Andrew R. Scholnick andrew@aol.net + 1067 Whitetree Network Technologies, Inc. + Carl Yang cyang@whitetree.com + 1068 Xetron Corp. Dave Alverson davea@xetron.com + 1069 Target Concepts, Inc. Bill Price bprice@tamu.edu + 1070 DMH Software Yigal Hochberg 72144.3704@compuserve.com + 1071 Innosoft International, Inc. Jeff Allison jeff@innosoft.com + + + +Reynolds & Postel [Page 160] + +RFC 1700 Assigned Numbers October 1994 + + + 1072 Controlware GmbH Uli Blatz ublatz@cware.de + 1073 Telecommunications Industry Association (TIA) + Mike Youngberg mikey@synacom.com + 1074 Boole & Babbage Rami Rubin rami@boole.com + 1075 System Engineering Support, Ltd. Vince Taylor +44 454.614.638 + 1076 SURFnet Ton Verschuren Ton.Verschuren@surfnet.nl + 1077 OpenConnect Systems, Inc. Mark Rensmeyer mrensme@oc.com + 1078 PDTS (Process Data Technology and Systems) + Martin Gutenbrunner GUT@pdts.mhs.compuserve.com + 1079 Cornet, Inc. Nat Kumar (703) 658-3400 + 1080 NetStar, Inc. John K. Renwick jkr@netstar.com + 1081 Semaphore Communications, Corp. Jimmy Soetarman (408) 980-7766 + 1082 Casio Computer Co., Ltd. Shouzo Ohdate ohdate@casio.co.jp + 1083 CSIR Frikkie Strecker fstreck@marge.mikom.csir.co.za + 1084 APOGEE Communications Olivier Caleff caleff@apogee-com.fr + 1085 Information Management Company Michael D. Liss mliss@imc.com + 1086 Wordlink, Inc. Mike Aleckson (314) 878-1422 + 1087 PEER Avinash S. Rao arao@cranel.com + 1088 Telstra Corp. Michael Scollay michaels@ind.tansu.com.au + 1089 Net X, Inc. Sridhar Kodela techsupp@netx.unicomp.net + 1090 PNC PLC Gordon Tees +44 716.061.200 + +To request an assignment of an Enterprise Number send the complete +company name, address, and phone number; and the contact's person +complete name, address, phone number, and email mailbox in an email +message to . + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/enterprise-numbers + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 161] + +RFC 1700 Assigned Numbers October 1994 + + +SGMP Vendor Specific Codes: [obsolete] + + +Prefix: 1,255, + +Decimal Name References +------- ---- ---------- + 0 Reserved [JKR1] + 1 Proteon [JS18] + 2 IBM [JXR] + 3 CMU [SXW] + 4 Unix [MS9] + 5 ACC [AB20] + 6 TWG [MTR] + 7 CAYMAN [BXM2] + 8 NYSERNET [MS9] + 9 cisco [GS2] + 10 BBN [RH6] + 11 Unassigned [JKR1] + 12 MIT [JR35] + 13-254 Unassigned [JKR1] + 255 Reserved [JKR1] + + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/sgmp-vendor-specific- +codes + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 162] + +RFC 1700 Assigned Numbers October 1994 + + +ADDRESS RESOLUTION PROTOCOL PARAMETERS + +The Address Resolution Protocol (ARP) specified in [RFC826] has +several parameters. The assigned values for these parameters are +listed here. + +REVERSE ADDRESS RESOLUTION PROTOCOL OPERATION CODES + +The Reverse Address Resolution Protocol (RARP) specified in [RFC903] +uses the "Reverse" codes below. + +DYNAMIC REVERSE ARP + +The Dynamic Reverse Address Resolution Protocol (DRARP) uses the +"DRARP" codes below. For further information, contact: David Brownell +(suneast!helium!db@Sun.COM). + +INVERSE ADDRESS RESOULUTION PROTOCOL + +The Inverse Address Resolution Protocol (IARP) specified in [RFC1293] +uses the "InARP" codes below. + +Assignments: + +Number Operation Code (op) Reference +------ -------------------------- --------- + 1 REQUEST [RFC826] + 2 REPLY [RFC826] + 3 request Reverse [RFC903] + 4 reply Reverse [RFC903] + 5 DRARP-Request [David Brownell] + 6 DRARP-Reply [David Brownell] + 7 DRARP-Error [David Brownell] + 8 InARP-Request [RFC1293] + 9 InARP-Reply [RFC1293] + 10 ARP-NAK [Mark Laubach] + +Number Hardware Type (hrd) References +------ ----------------------------------- ---------- + 1 Ethernet (10Mb) [JBP] + 2 Experimental Ethernet (3Mb) [JBP] + 3 Amateur Radio AX.25 [PXK] + 4 Proteon ProNET Token Ring [JBP] + 5 Chaos [GXP] + 6 IEEE 802 Networks [JBP] + 7 ARCNET [JBP] + 8 Hyperchannel [JBP] + 9 Lanstar [TU] + + + +Reynolds & Postel [Page 163] + +RFC 1700 Assigned Numbers October 1994 + + + 10 Autonet Short Address [MXB1] + 11 LocalTalk [JKR1] + 12 LocalNet (IBM PCNet or SYTEK LocalNET) [JXM] + 13 Ultra link [RXD2] + 14 SMDS [GXC1] + 15 Frame Relay [AGM] + 16 Asynchronous Transmission Mode (ATM) [JXB2] + 17 HDLC [JBP] + 18 Fibre Channel [Yakov Rekhter] + 19 Asynchronous Transmission Mode (ATM) [Mark Laubach] + 20 Serial Line [JBP] + 21 Asynchronous Transmission Mode (ATM) [MXB1] + +Protocol Type (pro) + +Use the same codes as listed in the section called "Ethernet Numbers +of Interest" (all hardware types use this code set for the protocol +type). + + +REFERENCES + +[RFC826] Plummer, D., "An Ethernet Address Resolution Protocol or + Converting Network Protocol Addresses to 48-bit Ethernet + Addresses for Transmission on Ethernet Hardware", STD 37, RFC + 826, MIT-LCS, November 1982. + +[RFC903] Finlayson, R., Mann, T., Mogul, J., and M. Theimer, "A + Reverse Address Resolution Protocol", STD 38, RFC 903, + Stanford University, June 1984. + +[RFC1293] Bradley, T., and C. Brown, "Inverse Address Resolution + Protocol", RFC 1293, Wellfleet Communications, Inc., + January 1992. + + +PEOPLE + +[AGM] Andy Malis + +[GXC1] George Clapp + +[GXP] Gill Pratt + +[JBP] Jon Postel + +[JKR1] Joyce K. Reynolds + + + + +Reynolds & Postel [Page 164] + +RFC 1700 Assigned Numbers October 1994 + + +[JXM] Joseph Murdock <---none---> + +[MXB1] Mike Burrows + +[PXK] Philip Koch + +[RXD2] Rajiv Dhingra + +[TU] Tom Unger + +[David Brownell] + +[Mark Laubach] + +[Yakov Rekhter] + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/arp-parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 165] + +RFC 1700 Assigned Numbers October 1994 + + +IEEE 802 NUMBERS OF INTEREST + +Some of the networks of all classes are IEEE 802 Networks. These +systems may use a Link Service Access Point (LSAP) field in much the +same way the MILNET uses the "link" field. Further, there is an +extension of the LSAP header called the Sub-Network Access Protocol +(SNAP). + +The IEEE likes to describe numbers in binary in bit transmission +order, which is the opposite of the big-endian order used throughout +the Internet protocol documentation. + + +Assignments: + + Link Service Access Point Description References + ------------------------- ----------- ---------- + IEEE Internet + binary binary decimal + 00000000 00000000 0 Null LSAP [IEEE] + 01000000 00000010 2 Indiv LLC Sublayer Mgt [IEEE] + 11000000 00000011 3 Group LLC Sublayer Mgt [IEEE] + 00100000 00000100 4 SNA Path Control [IEEE] + 01100000 00000110 6 Reserved (DOD IP) [RFC768,JBP] + 01110000 00001110 14 PROWAY-LAN [IEEE] + 01110010 01001110 78 EIA-RS 511 [IEEE] + 01111010 01011110 94 ISI IP [JBP] + 01110001 10001110 142 PROWAY-LAN [IEEE] + 01010101 10101010 170 SNAP [IEEE] + 01111111 11111110 254 ISO CLNS IS 8473 [RFC926,JXJ] + 11111111 11111111 255 Global DSAP [IEEE] + +These numbers (and others) are assigned by the IEEE Standards Office. +The address is: + +IEEE Registration Authority +c/o Iris Ringel +IEEE Standards Dept +445 Hoes Lane, P.O. Box 1331 +Piscataway, NJ 08855-1331 +Phone +1 908 562 3813 +Fax: +1 908 562 1571 + +The fee is $1000 and it takes 10 working days after receipt of the +request form and fee. They will not do anything via fax or phone. + +At an ad hoc special session on "IEEE 802 Networks and ARP", held +during the TCP Vendors Workshop (August 1986), an approach to a + + + +Reynolds & Postel [Page 166] + +RFC 1700 Assigned Numbers October 1994 + + +consistent way to send DoD-IP datagrams and other IP related protocols +(such as the Address Resolution Protocol (ARP)) on 802 networks was +developed, using the SNAP extension (see [RFC1042]). + +REFERENCES + +[RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, + USC/Information Sciences Institute, August 1980. + +[RFC926] International Standards Organization, "Protocol for Providing + the Connectionless-Mode Network Services", RFC 926, ISO, + December 1984. + +[RFC1042] Postel, J., and J. Reynolds, "A Standard for the + Transmission of IP Datagrams over IEEE 802 Networks", STD + 43, RFC 1042, USC/Information Sciences Institute, February + 1988. + +PEOPLE + +[JBP] Jon Postel + +[JXJ] + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ieee-802-numbers + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 167] + +RFC 1700 Assigned Numbers October 1994 + + +ETHER TYPES + +Many of the networks of all classes are Ethernets (10Mb) or +Experimental Ethernets (3Mb). These systems use a message "type" +field in much the same way the ARPANET uses the "link" field. + +If you need an Ether Type, contact: + +Xerox Systems Institute +3400 Hillview Ave. +PO BOX 10034 +Palo Alto, CA 94303 + +Phone: 415-813-7164 +Contact: Fonda Lix Pallone + +The following list of EtherTypes is contributed unverified information +from various sources. + +Assignments: + +Ethernet Exp. Ethernet Description References +------------- ------------- ----------- ---------- +decimal Hex decimal octal + 000 0000-05DC - - IEEE802.3 Length Field [XEROX] + 257 0101-01FF - - Experimental [XEROX] + 512 0200 512 1000 XEROX PUP (see 0A00) [8,XEROX] + 513 0201 - - PUP Addr Trans (see 0A01)[XEROX] + 0400 Nixdorf [XEROX] + 1536 0600 1536 3000 XEROX NS IDP [133,XEROX] + 0660 DLOG [XEROX] + 0661 DLOG [XEROX] + 2048 0800 513 1001 Internet IP (IPv4) [105,JBP] + 2049 0801 - - X.75 Internet [XEROX] + 2050 0802 - - NBS Internet [XEROX] + 2051 0803 - - ECMA Internet [XEROX] + 2052 0804 - - Chaosnet [XEROX] + 2053 0805 - - X.25 Level 3 [XEROX] + 2054 0806 - - ARP [88,JBP] + 2055 0807 - - XNS Compatability [XEROX] + 2076 081C - - Symbolics Private [DCP1] + 2184 0888-088A - - Xyplex [XEROX] + 2304 0900 - - Ungermann-Bass net debugr[XEROX] + 2560 0A00 - - Xerox IEEE802.3 PUP [XEROX] + 2561 0A01 - - PUP Addr Trans [XEROX] + 2989 0BAD - - Banyan Systems [XEROX] + 4096 1000 - - Berkeley Trailer nego [XEROX] + 4097 1001-100F - - Berkeley Trailer encap/IP[XEROX] + + + +Reynolds & Postel [Page 168] + +RFC 1700 Assigned Numbers October 1994 + + + 5632 1600 - - Valid Systems [XEROX] + 16962 4242 - - PCS Basic Block Protocol [XEROX] + 21000 5208 - - BBN Simnet [XEROX] + 24576 6000 - - DEC Unassigned (Exp.) [XEROX] + 24577 6001 - - DEC MOP Dump/Load [XEROX] + 24578 6002 - - DEC MOP Remote Console [XEROX] + 24579 6003 - - DEC DECNET Phase IV Route[XEROX] + 24580 6004 - - DEC LAT [XEROX] + 24581 6005 - - DEC Diagnostic Protocol [XEROX] + 24582 6006 - - DEC Customer Protocol [XEROX] + 24583 6007 - - DEC LAVC, SCA [XEROX] + 24584 6008-6009 - - DEC Unassigned [XEROX] + 24586 6010-6014 - - 3Com Corporation [XEROX] + 28672 7000 - - Ungermann-Bass download [XEROX] + 28674 7002 - - Ungermann-Bass dia/loop [XEROX] + 28704 7020-7029 - - LRT [XEROX] + 28720 7030 - - Proteon [XEROX] + 28724 7034 - - Cabletron [XEROX] + 32771 8003 - - Cronus VLN [131,DT15] + 32772 8004 - - Cronus Direct [131,DT15] + 32773 8005 - - HP Probe [XEROX] + 32774 8006 - - Nestar [XEROX] + 32776 8008 - - AT&T [XEROX] + 32784 8010 - - Excelan [XEROX] + 32787 8013 - - SGI diagnostics [AXC] + 32788 8014 - - SGI network games [AXC] + 32789 8015 - - SGI reserved [AXC] + 32790 8016 - - SGI bounce server [AXC] + 32793 8019 - - Apollo Computers [XEROX] + 32815 802E - - Tymshare [XEROX] + 32816 802F - - Tigan, Inc. [XEROX] + 32821 8035 - - Reverse ARP [48,JXM] + 32822 8036 - - Aeonic Systems [XEROX] + 32824 8038 - - DEC LANBridge [XEROX] + 32825 8039-803C - - DEC Unassigned [XEROX] + 32829 803D - - DEC Ethernet Encryption [XEROX] + 32830 803E - - DEC Unassigned [XEROX] + 32831 803F - - DEC LAN Traffic Monitor [XEROX] + 32832 8040-8042 - - DEC Unassigned [XEROX] + 32836 8044 - - Planning Research Corp. [XEROX] + 32838 8046 - - AT&T [XEROX] + 32839 8047 - - AT&T [XEROX] + 32841 8049 - - ExperData [XEROX] + 32859 805B - - Stanford V Kernel exp. [XEROX] + 32860 805C - - Stanford V Kernel prod. [XEROX] + 32861 805D - - Evans & Sutherland [XEROX] + 32864 8060 - - Little Machines [XEROX] + 32866 8062 - - Counterpoint Computers [XEROX] + + + +Reynolds & Postel [Page 169] + +RFC 1700 Assigned Numbers October 1994 + + + 32869 8065 - - Univ. of Mass. @ Amherst [XEROX] + 32870 8066 - - Univ. of Mass. @ Amherst [XEROX] + 32871 8067 - - Veeco Integrated Auto. [XEROX] + 32872 8068 - - General Dynamics [XEROX] + 32873 8069 - - AT&T [XEROX] + 32874 806A - - Autophon [XEROX] + 32876 806C - - ComDesign [XEROX] + 32877 806D - - Computgraphic Corp. [XEROX] + 32878 806E-8077 - - Landmark Graphics Corp. [XEROX] + 32890 807A - - Matra [XEROX] + 32891 807B - - Dansk Data Elektronik [XEROX] + 32892 807C - - Merit Internodal [HWB] + 32893 807D-807F - - Vitalink Communications [XEROX] + 32896 8080 - - Vitalink TransLAN III [XEROX] + 32897 8081-8083 - - Counterpoint Computers [XEROX] + 32923 809B - - Appletalk [XEROX] + 32924 809C-809E - - Datability [XEROX] + 32927 809F - - Spider Systems Ltd. [XEROX] + 32931 80A3 - - Nixdorf Computers [XEROX] + 32932 80A4-80B3 - - Siemens Gammasonics Inc. [XEROX] + 32960 80C0-80C3 - - DCA Data Exchange Cluster[XEROX] + 80C4 Banyan Systems [XEROX] + 80C5 Banyan Systems [XEROX] + 32966 80C6 - - Pacer Software [XEROX] + 32967 80C7 - - Applitek Corporation [XEROX] + 32968 80C8-80CC - - Intergraph Corporation [XEROX] + 32973 80CD-80CE - - Harris Corporation [XEROX] + 32975 80CF-80D2 - - Taylor Instrument [XEROX] + 32979 80D3-80D4 - - Rosemount Corporation [XEROX] + 32981 80D5 - - IBM SNA Service on Ether [XEROX] + 32989 80DD - - Varian Associates [XEROX] + 32990 80DE-80DF - - Integrated Solutions TRFS[XEROX] + 32992 80E0-80E3 - - Allen-Bradley [XEROX] + 32996 80E4-80F0 - - Datability [XEROX] + 33010 80F2 - - Retix [XEROX] + 33011 80F3 - - AppleTalk AARP (Kinetics)[XEROX] + 33012 80F4-80F5 - - Kinetics [XEROX] + 33015 80F7 - - Apollo Computer [XEROX] + 33023 80FF-8103 - - Wellfleet Communications [XEROX] + 33031 8107-8109 - - Symbolics Private [XEROX] + 33072 8130 - - Hayes Microcomputers [XEROX] + 33073 8131 - - VG Laboratory Systems [XEROX] + 8132-8136 Bridge Communications [XEROX] + 33079 8137-8138 - - Novell, Inc. [XEROX] + 33081 8139-813D - - KTI [XEROX] + 8148 Logicraft [XEROX] + 8149 Network Computing Devices[XEROX] + 814A Alpha Micro [XEROX] + + + +Reynolds & Postel [Page 170] + +RFC 1700 Assigned Numbers October 1994 + + + 33100 814C - - SNMP [JKR1] + 814D BIIN [XEROX] + 814E BIIN [XEROX] + 814F Technically Elite Concept[XEROX] + 8150 Rational Corp [XEROX] + 8151-8153 Qualcomm [XEROX] + 815C-815E Computer Protocol Pty Ltd[XEROX] + 8164-8166 Charles River Data System[XEROX] + 817D-818C Protocol Engines [XEROX] + 818D Motorola Computer [XEROX] + 819A-81A3 Qualcomm [XEROX] + 81A4 ARAI Bunkichi [XEROX] + 81A5-81AE RAD Network Devices [XEROX] + 81B7-81B9 Xyplex [XEROX] + 81CC-81D5 Apricot Computers [XEROX] + 81D6-81DD Artisoft [XEROX] + 81E6-81EF Polygon [XEROX] + 81F0-81F2 Comsat Labs [XEROX] + 81F3-81F5 SAIC [XEROX] + 81F6-81F8 VG Analytical [XEROX] + 8203-8205 Quantum Software [XEROX] + 8221-8222 Ascom Banking Systems [XEROX] + 823E-8240 Advanced Encryption Syste[XEROX] + 827F-8282 Athena Programming [XEROX] + 8263-826A Charles River Data System[XEROX] + 829A-829B Inst Ind Info Tech [XEROX] + 829C-82AB Taurus Controls [XEROX] + 82AC-8693 Walker Richer & Quinn [XEROX] + 8694-869D Idea Courier [XEROX] + 869E-86A1 Computer Network Tech [XEROX] + 86A3-86AC Gateway Communications [XEROX] + 86DB SECTRA [XEROX] + 86DE Delta Controls [XEROX] + 34543 86DF - - ATOMIC [JBP] + 86E0-86EF Landis & Gyr Powers [XEROX] + 8700-8710 Motorola [XEROX] + 8A96-8A97 Invisible Software [XEROX] + 36864 9000 - - Loopback [XEROX] + 36865 9001 - - 3Com(Bridge) XNS Sys Mgmt[XEROX] + 36866 9002 - - 3Com(Bridge) TCP-IP Sys [XEROX] + 36867 9003 - - 3Com(Bridge) loop detect [XEROX] + 65280 FF00 - - BBN VITAL-LanBridge cache[XEROX] + FF00-FF0F ISC Bunker Ramo [XEROX] + +The standard for transmission of IP datagrams over Ethernets and +Experimental Ethernets is specified in [RFC894] and [RFC895] +respectively. + + + + +Reynolds & Postel [Page 171] + +RFC 1700 Assigned Numbers October 1994 + + +NOTE: Ethernet 48-bit address blocks are assigned by the IEEE. + +IEEE Registration Authority +c/o Iris Ringel +IEEE Standards Department +445 Hoes Lane, P.O. Box 1331 +Piscataway, NJ 08855-1331 +Phone +1 908 562 3813 +Fax: +1 908 562 1571 + + +IANA ETHERNET ADDRESS BLOCK + + +The IANA owns an Ethernet address block which may be used for +multicast address asignments or other special purposes. + +The address block in IEEE binary is: 0000 0000 0000 0000 0111 1010 + +In the normal Internet dotted decimal notation this is 0.0.94 since +the bytes are transmitted higher order first and bits within bytes are +transmitted lower order first (see "Data Notation" in the +Introduction). + +IEEE CSMA/CD and Token Bus bit transmission order: 00 00 5E + +IEEE Token Ring bit transmission order: 00 00 7A + +Appearance on the wire (bits transmitted from left to right): + + + 0 23 47 + | | | + 1000 0000 0000 0000 0111 1010 xxxx xxx0 xxxx xxxx xxxx xxxx + | | + Multicast Bit 0 = Internet Multicast + 1 = Assigned by IANA for + other uses + +Appearance in memory (bits transmitted right-to-left within octets, +octets transmitted left-to-right): + + + 0 23 47 + | | | + 0000 0001 0000 0000 0101 1110 0xxx xxxx xxxx xxxx xxxx xxxx + | | + Multicast Bit 0 = Internet Multicast + + + +Reynolds & Postel [Page 172] + +RFC 1700 Assigned Numbers October 1994 + + + 1 = Assigned by IANA for other uses + +The latter representation corresponds to the Internet standard +bit-order, and is the format that most programmers have to deal with. +Using this representation, the range of Internet Multicast addresses +is: + + + 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF in hex, or + + 1.0.94.0.0.0 to 1.0.94.127.255.255 in dotted decimal + + + +ETHERNET VENDOR ADDRESS COMPONENTS + +Ethernet hardware addresses are 48 bits, expressed as 12 hexadecimal +digits (0-9, plus A-F, capitalized). These 12 hex digits consist of +the first/left 6 digits (which should match the vendor of the Ethernet +interface within the station) and the last/right 6 digits which +specify the interface serial number for that interface vendor. + +Ethernet addresses might be written unhyphenated (e.g., 123456789ABC), +or with one hyphen (e.g., 123456-789ABC), but should be written +hyphenated by octets (e.g., 12-34-56-78-9A-BC). + +These addresses are physical station addresses, not multicast nor +broadcast, so the second hex digit (reading from the left) will be +even, not odd. + +At present, it is not clear how the IEEE assigns Ethernet block +addresses. Whether in blocks of 2**24 or 2**25, and whether +multicasts are assigned with that block or separately. A portion of +the vendor block address is reportedly assigned serially, with the +other portion intentionally assigned randomly. If there is a global +algorithm for which addresses are designated to be physical (in a +chipset) versus logical (assigned in software), or globally-assigned +versus locally-assigned addresses, some of the known addresses do not +follow the scheme (e.g., AA0003; 02xxxx). + +00000C Cisco +00000E Fujitsu +00000F NeXT +000010 Sytek +00001D Cabletron +000020 DIAB (Data Intdustrier AB) +000022 Visual Technology +00002A TRW + + + +Reynolds & Postel [Page 173] + +RFC 1700 Assigned Numbers October 1994 + + +000032 GPT Limited (reassigned from GEC Computers Ltd) +00005A S & Koch +00005E IANA +000065 Network General +00006B MIPS +000077 MIPS +00007A Ardent +000089 Cayman Systems Gatorbox +000093 Proteon +00009F Ameristar Technology +0000A2 Wellfleet +0000A3 Network Application Technology +0000A6 Network General (internal assignment, not for products) +0000A7 NCD X-terminals +0000A9 Network Systems +0000AA Xerox Xerox machines +0000B3 CIMLinc +0000B7 Dove Fastnet +0000BC Allen-Bradley +0000C0 Western Digital +0000C5 Farallon phone net card +0000C6 HP Intelligent Networks Operation (formerly Eon Systems) +0000C8 Altos +0000C9 Emulex Terminal Servers +0000D7 Dartmouth College (NED Router) +0000D8 3Com? Novell? PS/2 +0000DD Gould +0000DE Unigraph +0000E2 Acer Counterpoint +0000EF Alantec +0000FD High Level Hardvare (Orion, UK) +000102 BBN BBN internal usage (not registered) +0020AF 3COM ??? +001700 Kabel +008064 Wyse Technology / Link Technologies +00802B IMAC ??? +00802D Xylogics, Inc. Annex terminal servers +00808C Frontier Software Development +0080C2 IEEE 802.1 Committee +0080D3 Shiva +00AA00 Intel +00DD00 Ungermann-Bass +00DD01 Ungermann-Bass +020701 Racal InterLan +020406 BBN BBN internal usage (not registered) +026086 Satelcom MegaPac (UK) +02608C 3Com IBM PC; Imagen; Valid; Cisco +02CF1F CMC Masscomp; Silicon Graphics; Prime EXL + + + +Reynolds & Postel [Page 174] + +RFC 1700 Assigned Numbers October 1994 + + +080002 3Com (Formerly Bridge) +080003 ACC (Advanced Computer Communications) +080005 Symbolics Symbolics LISP machines +080008 BBN +080009 Hewlett-Packard +08000A Nestar Systems +08000B Unisys +080011 Tektronix, Inc. +080014 Excelan BBN Butterfly, Masscomp, Silicon Graphics +080017 NSC +08001A Data General +08001B Data General +08001E Apollo +080020 Sun Sun machines +080022 NBI +080025 CDC +080026 Norsk Data (Nord) +080027 PCS Computer Systems GmbH +080028 TI Explorer +08002B DEC +08002E Metaphor +08002F Prime Computer Prime 50-Series LHC300 +080036 Intergraph CAE stations +080037 Fujitsu-Xerox +080038 Bull +080039 Spider Systems +080041 DCA Digital Comm. Assoc. +080045 ???? (maybe Xylogics, but they claim not to know this number) +080046 Sony +080047 Sequent +080049 Univation +08004C Encore +08004E BICC +080056 Stanford University +080058 ??? DECsystem-20 +08005A IBM +080067 Comdesign +080068 Ridge +080069 Silicon Graphics +08006E Concurrent Masscomp +080075 DDE (Danish Data Elektronik A/S) +08007C Vitalink TransLAN III +080080 XIOS +080086 Imagen/QMS +080087 Xyplex terminal servers +080089 Kinetics AppleTalk-Ethernet interface +08008B Pyramid +08008D XyVision XyVision machines + + + +Reynolds & Postel [Page 175] + +RFC 1700 Assigned Numbers October 1994 + + +080090 Retix Inc Bridges +484453 HDS ??? +800010 AT&T +AA0000 DEC obsolete +AA0001 DEC obsolete +AA0002 DEC obsolete +AA0003 DEC Global physical address for some DEC machines +AA0004 DEC Local logical address for systems running + DECNET + + +ETHERNET MULTICAST ADDRESSES + +An Ethernet multicast address consists of the multicast bit, the +23-bit vendor component, and the 24-bit group identifier assigned by +the vendor. For example, DEC is assigned the vendor component +08-00-2B, so multicast addresses assigned by DEC have the first +24-bits 09-00-2B (since the multicast bit is the low-order bit of the +first byte, which is "the first bit on the wire"). + + +Ethernet Type +Address Field Usage + +Multicast Addresses: + +01-00-5E-00-00-00- 0800 Internet Multicast [RFC1112] +01-00-5E-7F-FF-FF +01-00-5E-80-00-00- ???? Internet reserved by IANA +01-00-5E-FF-FF-FF +01-80-C2-00-00-00 -802- Spanning tree (for bridges) +09-00-02-04-00-01? 8080? Vitalink printer +09-00-02-04-00-02? 8080? Vitalink management +09-00-09-00-00-01 8005 HP Probe +09-00-09-00-00-01 -802- HP Probe +09-00-09-00-00-04 8005? HP DTC +09-00-1E-00-00-00 8019? Apollo DOMAIN +09-00-2B-00-00-00 6009? DEC MUMPS? +09-00-2B-00-00-01 8039? DEC DSM/DTP? +09-00-2B-00-00-02 803B? DEC VAXELN? +09-00-2B-00-00-03 8038 DEC Lanbridge Traffic Monitor (LTM) +09-00-2B-00-00-04 ???? DEC MAP End System Hello +09-00-2B-00-00-05 ???? DEC MAP Intermediate System Hello +09-00-2B-00-00-06 803D? DEC CSMA/CD Encryption? +09-00-2B-00-00-07 8040? DEC NetBios Emulator? +09-00-2B-00-00-0F 6004 DEC Local Area Transport (LAT) +09-00-2B-00-00-1x ???? DEC Experimental +09-00-2B-01-00-00 8038 DEC LanBridge Copy packets + + + +Reynolds & Postel [Page 176] + +RFC 1700 Assigned Numbers October 1994 + + + (All bridges) +09-00-2B-01-00-01 8038 DEC LanBridge Hello packets + (All local bridges) + 1 packet per second, sent by the + designated LanBridge +09-00-2B-02-00-00 ???? DEC DNA Lev. 2 Routing Layer routers? +09-00-2B-02-01-00 803C? DEC DNA Naming Service Advertisement? +09-00-2B-02-01-01 803C? DEC DNA Naming Service Solicitation? +09-00-2B-02-01-02 803E? DEC DNA Time Service? +09-00-2B-03-xx-xx ???? DEC default filtering by bridges? +09-00-2B-04-00-00 8041? DEC Local Area Sys. Transport (LAST)? +09-00-2B-23-00-00 803A? DEC Argonaut Console? +09-00-4E-00-00-02? 8137? Novell IPX +09-00-56-00-00-00- ???? Stanford reserved +09-00-56-FE-FF-FF +09-00-56-FF-00-00- 805C Stanford V Kernel, version 6.0 +09-00-56-FF-FF-FF +09-00-77-00-00-01 ???? Retix spanning tree bridges +09-00-7C-02-00-05 8080? Vitalink diagnostics +09-00-7C-05-00-01 8080? Vitalink gateway? +0D-1E-15-BA-DD-06 ???? HP +AB-00-00-01-00-00 6001 DEC Maintenance Operation Protocol + (MOP) Dump/Load Assistance +AB-00-00-02-00-00 6002 DEC Maintenance Operation Protocol + (MOP) Remote Console + 1 System ID packet every 8-10 minutes, + by every: + DEC LanBridge + DEC DEUNA interface + DEC DELUA interface + DEC DEQNA interface + (in a certain mode) +AB-00-00-03-00-00 6003 DECNET Phase IV end node Hello + packets 1 packet every 15 seconds, + sent by each DECNET host +AB-00-00-04-00-00 6003 DECNET Phase IV Router Hello packets + 1 packet every 15 seconds, sent by + the DECNET router +AB-00-00-05-00-00 ???? Reserved DEC through +AB-00-03-FF-FF-FF +AB-00-03-00-00-00 6004 DEC Local Area Transport (LAT) - old +AB-00-04-00-xx-xx ???? Reserved DEC customer private use +AB-00-04-01-xx-yy 6007 DEC Local Area VAX Cluster groups + Sys. Communication Architecture (SCA) +CF-00-00-00-00-00 9000 Ethernet Configuration Test protocol + (Loopback) + +Broadcast Address: + + + +Reynolds & Postel [Page 177] + +RFC 1700 Assigned Numbers October 1994 + + +FF-FF-FF-FF-FF-FF 0600 XNS packets, Hello or gateway search? + 6 packets every 15 seconds, per XNS + station +FF-FF-FF-FF-FF-FF 0800 IP (e.g. RWHOD via UDP) as needed +FF-FF-FF-FF-FF-FF 0804 CHAOS +FF-FF-FF-FF-FF-FF 0806 ARP (for IP and CHAOS) as needed +FF-FF-FF-FF-FF-FF 0BAD Banyan +FF-FF-FF-FF-FF-FF 1600 VALID packets, Hello or gateway + search? + 1 packets every 30 seconds, per VALID + station +FF-FF-FF-FF-FF-FF 8035 Reverse ARP +FF-FF-FF-FF-FF-FF 807C Merit Internodal (INP) +FF-FF-FF-FF-FF-FF 809B EtherTalk + + + + +REFERENCES + +[RFC894] Hornig, C., "A Standard for the Transmission of IP Datagrams + over Ethernet Networks, STD 41, RFC 894, Symbolics, + April 1984. + +[RFC895] Postel, J., "A Standard for the Transmission of IP Datagrams + over Experimental Ethernet Networks, STD 42, RFC 895, + USC/Information Sciences Institute, April 1984. + +[RFC1112] Deeering, S., "Host Extensions for IP Multicasting", + STD 5, RFC 1112, Stanford University, August 1989. + +PEOPLE + +[AXC] Andrew Cherenson + +[DCP1] David Plummer + +[DT15] Daniel Tappan + +[HWB] Hans-Werner Braun + +[JBP] Jon Postel + +[JKR1] Joyce K. Reynolds + +[JXM] Joseph Murdock <---none---> + +[XEROX] Fonda Pallone (415-813-7164) + + + +Reynolds & Postel [Page 178] + +RFC 1700 Assigned Numbers October 1994 + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 179] + +RFC 1700 Assigned Numbers October 1994 + + +X.25 TYPE NUMBERS + + +CCITT defines the high order two bits of the first octet of call user +data as follows: + + +00 - Used for other CCITT recomendations (such as X.29) +01 - Reserved for use by "national" administrative + authorities +10 - Reserved for use by international administrative authoorities +11 - Reserved for arbitrary use between consenting DTEs + +Call User Data (hex) Protocol Reference +------------------- -------- --------- + +01 PAD [GS2] +C5 Blacker front-end descr dev [AGM] +CC IP [RFC877,AGM]* +CD ISO-IP [AGM] +CF PPP [RFC1598] +DD Network Monitoring [AGM] + +*NOTE: ISO SC6/WG2 approved assignment in ISO 9577 (January 1990). + + +REFERENCES + +[RFC877] Korb, J., "A Standard for the Transmission of IP Datagrams + Over Public Data Networks", RFC 877, Purdue University, + September 1983. + +[RFC1598] Simpson, W., "PPPin X.25", RFC 1598, Daydreamer, March 1994. + + +PEOPLE + +[AGM] Andy Malis + +[GS2] Greg Satz + +[] + + + + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/x25-type-numbers + + + +Reynolds & Postel [Page 180] + +RFC 1700 Assigned Numbers October 1994 + + +PUBLIC DATA NETWORK NUMBERS + + +One of the Internet Class A Networks is the international system of +Public Data Networks. This section lists the mapping between the +Internet Addresses and the Public Data Network Addresses (X.121). + + +Assignments: + + + Internet Public Data Net Description References + -------------- ----------------- ----------- ---------- + 014.000.000.000 Reserved [JBP] + 014.000.000.001 3110-317-00035 00 PURDUE-TN [TN] + 014.000.000.002 3110-608-00027 00 UWISC-TN [TN] + 014.000.000.003 3110-302-00024 00 UDEL-TN [TN] + 014.000.000.004 2342-192-00149 23 UCL-VTEST [PK] + 014.000.000.005 2342-192-00300 23 UCL-TG [PK] + 014.000.000.006 2342-192-00300 25 UK-SATNET [PK] + 014.000.000.007 3110-608-00024 00 UWISC-IBM [MS56] + 014.000.000.008 3110-213-00045 00 RAND-TN [MO2] + 014.000.000.009 2342-192-00300 23 UCL-CS [PK] + 014.000.000.010 3110-617-00025 00 BBN-VAN-GW [JD21] + 014.000.000.011 2405-015-50300 00 CHALMERS [UXB] + 014.000.000.012 3110-713-00165 00 RICE [PAM6] + 014.000.000.013 3110-415-00261 00 DECWRL [PAM6] + 014.000.000.014 3110-408-00051 00 IBM-SJ [SXA3] + 014.000.000.015 2041-117-01000 00 SHAPE [JFW] + 014.000.000.016 2628-153-90075 00 DFVLR4-X25 [GB7] + 014.000.000.017 3110-213-00032 00 ISI-VAN-GW [JD21] + 014.000.000.018 2624-522-80900 52 FGAN-SIEMENS-X25 [GB7] + 014.000.000.019 2041-170-10000 00 SHAPE-X25 [JFW] + 014.000.000.020 5052-737-20000 50 UQNET [AXH] + 014.000.000.021 3020-801-00057 50 DMC-CRC1 [VXT] + 014.000.000.022 2624-522-80329 02 FGAN-FGANFFMVAX-X25 [GB7] + 014.000.000.023 2624-589-00908 01 ECRC-X25 [PXD] + 014.000.000.024 2342-905-24242 83 UK-MOD-RSRE [JXE2] + 014.000.000.025 2342-905-24242 82 UK-VAN-RSRE [AXM] + 014.000.000.026 2624-522-80329 05 DFVLRSUN-X25 [GB7] + 014.000.000.027 2624-457-11015 90 SELETFMSUN-X25 [BXD] + 014.000.000.028 3110-408-00146 00 CDC-SVL [RAM57] + 014.000.000.029 2222-551-04400 00 SUN-CNUCE [ABB2] + 014.000.000.030 2222-551-04500 00 ICNUCEVM-CNUCE [ABB2] + 014.000.000.031 2222-551-04600 00 SPARE-CNUCE [ABB2] + 014.000.000.032 2222-551-04700 00 ICNUCEVX-CNUCE [ABB2] + 014.000.000.033 2222-551-04524 00 CISCO-CNUCE [ABB2] + 014.000.000.034 2342-313-00260 90 SPIDER-GW [AD67] + + + +Reynolds & Postel [Page 181] + +RFC 1700 Assigned Numbers October 1994 + + + 014.000.000.035 2342-313-00260 91 SPIDER-EXP [AD67] + 014.000.000.036 2342-225-00101 22 PRAXIS-X25A [TXR] + 014.000.000.037 2342-225-00101 23 PRAXIS-X25B [TXR] + 014.000.000.038 2403-712-30250 00 DIAB-TABY-GW [FXB] + 014.000.000.039 2403-715-30100 00 DIAB-LKP-GW [FXB] + 014.000.000.040 2401-881-24038 00 DIAB-TABY1-GW [FXB] + 014.000.000.041 2041-170-10060 00 STC [TC27] + 014.000.000.042 2222-551-00652 60 CNUCE [TC27] + 014.000.000.043 2422-510-05900 00 Tollpost-Globe AS [OXG] + 014.000.000.044 2422-670-08900 00 Tollpost-Globe AS [OXG] + 014.000.000.045 2422-516-01000 00 Tollpost-Globe AS [OXG] + 014.000.000.046 2422-450-00800 00 Tollpost-Globe AS [OXG] + 014.000.000.047 2422-610-00200 00 Tollpost-Globe AS [OXG] + 014.000.000.048 2422-310-00300 00 Tollpost-Globe AS [OXG] + 014.000.000.049 2422-470-08800 00 Tollpost-Globe AS [OXG] + 014.000.000.050 2422-210-04600 00 Tollpost-Globe AS [OXG] + 014.000.000.051 2422-130-28900 00 Tollpost-Globe AS [OXG] + 014.000.000.052 2422-310-27200 00 Tollpost-Globe AS [OXG] + 014.000.000.053 2422-250-05800 00 Tollpost-Globe AS [OXG] + 014.000.000.054 2422-634-05900 00 Tollpost-Globe AS [OXG] + 014.000.000.055 2422-670-08800 00 Tollpost-Globe AS [OXG] + 014.000.000.056 2422-430-07400 00 Tollpost-Globe AS [OXG] + 014.000.000.057 2422-674-07800 00 Tollpost-Globe AS [OXG] + 014.000.000.058 2422-230-16900 00 Tollpost-Globe AS [OXG] + 014.000.000.059 2422-518-02900 00 Tollpost-Globe AS [OXG] + 014.000.000.060 2422-370-03100 00 Tollpost-Globe AS [OXG] + 014.000.000.061 2422-516-03400 00 Tollpost-Globe AS [OXG] + 014.000.000.062 2422-616-04400 00 Tollpost-Globe AS [OXG] + 014.000.000.063 2422-650-23500 00 Tollpost-Globe AS [OXG] + 014.000.000.064 2422-330-02500 00 Tollpost-Globe AS [OXG] + 014.000.000.065 2422-350-01900 00 Tollpost-Globe AS [OXG] + 014.000.000.066 2422-410-00700 00 Tollpost-Globe AS [OXG] + 014.000.000.067 2422-539-06200 00 Tollpost-Globe AS [OXG] + 014.000.000.068 2422-630-07200 00 Tollpost-Globe AS [OXG] + 014.000.000.069 2422-470-12300 00 Tollpost-Globe AS [OXG] + 014.000.000.070 2422-470-13000 00 Tollpost-Globe AS [OXG] + 014.000.000.071 2422-170-04600 00 Tollpost-Globe AS [OXG] + 014.000.000.072 2422-516-04300 00 Tollpost-Globe AS [OXG] + 014.000.000.073 2422-530-00700 00 Tollpost-Globe AS [OXG] + 014.000.000.074 2422-650-18800 00 Tollpost-Globe AS [OXG] + 014.000.000.075 2422-450-24500 00 Tollpost-Globe AS [OXG] + 014.000.000.076 2062-243-15631 00 DPT-BXL-DDC [LZ15] + 014.000.000.077 2062-243-15651 00 DPT-BXL-DDC2 [LZ15] + 014.000.000.078 3110-312-00431 00 DPT-CHI [LZ15] + 014.000.000.079 3110-512-00135 00 DPT-SAT-ENG [LZ15] + 014.000.000.080 2080-941-90550 00 DPT-PAR [LZ15] + 014.000.000.081 4545-511-30600 00 DPT-PBSC [LZ15] + 014.000.000.082 4545-513-30900 00 DPT-HONGKONG [LZ15] + + + +Reynolds & Postel [Page 182] + +RFC 1700 Assigned Numbers October 1994 + + + 014.000.000.083 4872-203-55000 00 UECI-TAIPEI [LZ15] + 014.000.000.084 2624-551-10400 20 DPT-HANOVR [LZ15] + 014.000.000.085 2624-569-00401 99 DPT-FNKFRT [LZ15] + 014.000.000.086 3110-512-00134 00 DPT-SAT-SUPT [LZ15] + 014.000.000.087 4602-3010-0103 20 DU-X25A [JK64] + 014.000.000.088 4602-3010-0103 21 FDU-X25B [JK64] + 014.000.000.089 2422-150-33700 00 Tollpost-Globe AS [OXG] + 014.000.000.090 2422-271-07100 00 Tollpost-Globe AS [OXG] + 014.000.000.091 2422-516-00100 00 Tollpost-Globe AS [OXG] + 014.000.000.092 2422-650-18800 00 Norsk Informas. [OXG] + 014.000.000.093 2422-250-30400 00 Tollpost-Globe AS [OXG] + 014.000.000.094 Leissner Data AB [PXF1] + 014.000.000.095 Leissner Data AB [PXF1] + 014.000.000.096 Leissner Data AB [PXF1] + 014.000.000.097 Leissner Data AB [PXF1] + 014.000.000.098 Leissner Data AB [PXF1] + 014.000.000.099 Leissner Data AB [PXF1] + 014.000.000.100 Leissner Data AB [PXF1] + 014.000.000.101 Leissner Data AB [PXF1] + 014.000.000.102 Leissner Data AB [PXF1] + 014.000.000.103 Leissner Data AB [PXF1] + 014.000.000.104 Leissner Data AB [PXF1] + 014.000.000.105 Leissner Data AB [PXF1] + 014.000.000.106 Leissner Data AB [PXF1] + 014.000.000.107 Leissner Data AB [PXF1] + 014.000.000.108 Leissner Data AB [PXF1] + 014.000.000.109 Leissner Data AB [PXF1] + 014.000.000.110 Leissner Data AB [PXF1] + 014.000.000.111 Leissner Data AB [PXF1] + 014.000.000.112 Leissner Data AB [PXF1] + 014.000.000.113 Leissner Data AB [PXF1] + 014.000.000.114 Leissner Data AB [PXF1] + 014.000.000.115 Leissner Data AB [PXF1] + 014.000.000.116 Leissner Data AB [PXF1] + 014.000.000.117 Leissner Data AB [PXF1] + 014.000.000.118 Leissner Data AB [PXF1] + 014.000.000.119 Leissner Data AB [PXF1] + 014.000.000.120 Leissner Data AB [PXF1] + 014.000.000.121 Leissner Data AB [PXF1] + 014.000.000.122 Leissner Data AB [PXF1] + 014.000.000.123 Leissner Data AB [PXF1] + 014.000.000.124 Leissner Data AB [PXF1] + 014.000.000.125 Leissner Data AB [PXF1] + 014.000.000.126 Leissner Data AB [PXF1] + 014.000.000.127 Leissner Data AB [PXF1] + 014.000.000.128 Leissner Data AB [PXF1] + 014.000.000.129 2422-150-17900 00 Tollpost-Globe AS [OXG] + 014.000.000.130 2422-150-42700 00 Tollpost-Globe AS [OXG] + + + +Reynolds & Postel [Page 183] + +RFC 1700 Assigned Numbers October 1994 + + + 014.000.000.131 2422-190-41900 00 T-G Airfreight AS [OXG] + 014.000.000.132 2422-616-16100 00 Tollpost-Globe AS [OXG] + 014.000.000.133 2422-150-50700-00 Tollpost-Globe Int. [OXG] + 014.000.000.134 2422-190-28100-00 Intersped AS [OXG] + + 014.000.000.135-014.255.255.254 Unassigned [JBP] + 014.255.255.255 Reserved [JBP] + +The standard for transmission of IP datagrams over the Public Data +Network is specified in RFC-1356 [69]. + +REFERENCES + +[RFC877] Korb, J., "A Standard for the Transmission of IP Datagrams + Over Public Data Networks", RFC 877, Purdue University, + September 1983. + + +PEOPLE + +[ABB2] A. Blasco Bonito + +[AD67] Andy Davis + +[AXH] Arthur Harvey + +[AXM] Alex Martin <---none---> + +[BXD] Brian Dockter <---none---> + +[FXB] + +[GB7] Gerd Beling + +[JBP] Jon Postel + +[JFW] Jon F. Wilkes + +[JK64] mystery contact! + +[JXE2] Jeanne Evans + +[LZ15] Lee Ziegenhals + +[MS56] Marvin Solomon + + + + +Reynolds & Postel [Page 184] + +RFC 1700 Assigned Numbers October 1994 + + +[MO2] Michael O'Brien + +[OXG] Oyvind Gjerstad + +[PAM6] Paul McNabb + +[PK] Peter Kirstein + +[PXD] Peter Delchiappo <---none---> + +[PXF1] Per Futtrup <---none---> + +[RAM57] Rex Mann <---none---> + +[SXA3] Sten Andler <---none---> + +[TN] Thomas Narten + +[TC27] Thomas Calderwood + +[TXR] Tim Rylance + +[UXB] + +[VXT] V. Taylor + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/public-data-network- +numbers + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 185] + +RFC 1700 Assigned Numbers October 1994 + + +MILNET LINK NUMBERS + + +The word "link" here refers to a field in the original MILNET Host/IMP +interface leader. The link was originally defined as an 8-bit field. +Later specifications defined this field as the "message-id" with a +length of 12 bits. The name link now refers to the high order 8 bits of +this 12-bit message-id field. The Host/IMP interface is defined in BBN +Report 1822 [BBN1822]. + +The low-order 4 bits of the message-id field are called the sub-link. +Unless explicitly specified otherwise for a particular protocol, there +is no sender to receiver significance to the sub-link. The sender may +use the sub-link in any way he chooses (it is returned in the RFNM by +the destination IMP), the receiver should ignore the sub-link. + + +Link Assignments: + +Decimal Description References +------- ----------- ---------- +0-63 BBNCC Monitoring [MB] +64-149 Unassigned [JBP] +150 Xerox NS IDP [ETHERNET,XEROX] +151 Unassigned [JBP] +152 PARC Universal Protocol [PUP,XEROX] +153 TIP Status Reporting [JGH] +154 TIP Accounting [JGH] +155 Internet Protocol [regular] [RFC791,JBP] +156-158 Internet Protocol [experimental] [RFC791,JBP] +159 Figleaf Link [JBW1] +160 Blacker Local Network Protocol [DM28] +161-194 Unassigned [JBP] +195 ISO-IP [RFC926,RXM] +196-247 Experimental Protocols [JBP] +248-255 Network Maintenance [JGH] + + + +MILNET LOGICAL ADDRESSES + +The MILNET facility for "logical addressing" is described in [RFC878] +and [RFC1005]. A portion of the possible logical addresses are +reserved for standard uses. + +There are 49,152 possible logical host addresses. Of these, 256 are +reserved for assignment to well-known functions. Assignments for +well-known functions are made by the IANA. Assignments for other + + + +Reynolds & Postel [Page 186] + +RFC 1700 Assigned Numbers October 1994 + + +logical host addresses are made by the NIC. + + +Logical Address Assignments: + +Decimal Description References +------- ----------- ---------- +0 Reserved [JBP] +1 The BBN Core Gateways [MB] +2-254 Unassigned [JBP] +255 Reserved [JBP] + + + +MILNET X.25 ADDRESS MAPPINGS + + +All MILNET hosts are assigned addresses by the Defense Data Network +(DDN). The address of a MILNET host may be obtained from the Network +Information Center (NIC), represented as an ASCII text string in what +is called "host table format". This section describes the process by +which MILNET X.25 addresses may be derived from addresses in the NIC +host table format. + +A NIC host table address consists of the ASCII text string +representations of four decimal numbers separated by periods, +corresponding to the four octeted of a thirty-two bit Internet +address. The four decimal numbers are referred to in this section as +"n", "h' "l", and "i". Thus, a host table address may be represented +as: "n.h.l.i". Each of these four numbers will have either one, two, +or three decimal digits and will never have a value greater than 255. +For example, in the host table, address: "10.2.0.124", n=10, h=2, l=0, +and i=124. To convert a host table address to a MILNET X.25 address: + +1. If h < 64, the host table address corresponds to the X.25 +physical address: + + +ZZZZ F IIIHHZZ (SS) + +where: + + ZZZZ = 0000 as required + + F = 0 because the address is a physical address; + + III is a three decimal digit respresentation of + "i", right-adjusted and padded with leading + + + +Reynolds & Postel [Page 187] + +RFC 1700 Assigned Numbers October 1994 + + + zeros if required; + + HH is a two decimal digit representation of "h", + right-adjusted and padded with leading zeros + if required; + + ZZ = 00 and + + (SS) is optional + + +In the example given above, the host table address 10.2.0.124 +corresponds to the X.25 physical address 000001240200. + +2. If h > 64 or h = 64, the host table address corresponds to the +X.25 logical address + + +ZZZZ F RRRRRZZ (SS) + +where: + + ZZZZ = 0000 as required + + F = 1 because the address is a logical address; + + RRRRR is a five decimal digit representation of + the result "r" of the calculation + + r = h * 256 + i + + (Note that the decimal representation of + "r" will always require five digits); + + ZZ = 00 and + + (SS) is optional + +Thus, the host table address 10.83.0.207 corresponds to the X.25 +logical address 000012145500. + +In both cases, the "n" and "l" fields of the host table address are +not used. + + +REFERENCES + +[BBN1822] BBN, "Specifications for the Interconnection of a Host and + + + +Reynolds & Postel [Page 188] + +RFC 1700 Assigned Numbers October 1994 + + + an IMP", Report 1822, Bolt Beranek and Newman, Cambridge, + Massachusetts, revised, December 1981. + +[ETHERNET] "The Ethernet, A Local Area Network: Data Link Layer and + Physical Layer Specification", AA-K759B-TK, Digital + Equipment Corporation, Maynard, MA. Also as: "The Ethernet + - A Local Area Network", Version 1.0, Digital Equipment + Corporation, Intel Corporation, Xerox Corporation, + September 1980. And: "The Ethernet, A Local Area Network: + Data Link Layer and Physical Layer Specifications", + Digital, Intel and Xerox, November 1982. And: XEROX, "The + Ethernet, A Local Area Network: Data Link Layer and + Physical Layer Specification", X3T51/80-50, Xerox + Corporation, Stamford, CT., October 1980. + +[PUP] Boggs, D., J. Shoch, E. Taft, and R. Metcalfe, "PUP: An + Internetwork Architecture", XEROX Palo Alto Research Center, + CSL-79-10, July 1979; also in IEEE Transactions on + Communication, Volume COM-28, Number 4, April 1980. + +[RFC791] Postel, J., ed., "Internet Protocol - DARPA Internet Program + Protocol Specification", STD 5, RFC 791, USC/Information + Sciences Institute, September 1981. + +[RFC878] Malis, Andrew, "The ARPANET 1822L Host Access Protocol", + RFC 878, BBN Communications Corp., December 1983. + +[RFC926] International Standards Organization, "Protocol for Providing + the Connectionless-Mode Network Services", RFC 926, ISO, + December 1984. + +[RFC1005] Khanna, A., and A. Malis, "The ARPANET AHIP-E Host Access + Protocol (Enhanced AHIP)", RFC 1005, BBN Communications + Corp., May 1987. + + +PEOPLE + +[DM28] Dennis Morris + +[JBP] Jon Postel + +[JBW1] Joseph Walters, Jr. + +[JGH] Jim Herman + +[MB] Michael Brescia + + + + +Reynolds & Postel [Page 189] + +RFC 1700 Assigned Numbers October 1994 + + +[RXM] Robert Myhill + +[XEROX] Fonda Pallone <---none---> + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/milnet-parameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 190] + +RFC 1700 Assigned Numbers October 1994 + + +XNS PROTOCOL TYPES + + +Assigned well-known socket numbers + + Routing Information 1 + Echo 2 + Router Error 3 + Experimental 40-77 + +Assigned internet packet types + + Routing Information 1 + Echo 2 + Error 3 + Packet Exchange 4 + Sequenced Packet 5 + PUP 12 + DoD IP 13 + Experimental 20-37 + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/xns-protocol-types + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 191] + +RFC 1700 Assigned Numbers October 1994 + + +INTERNET / XNS PROTOCOL MAPPINGS + + +Below are two tables describing the arrangement of protocol fields or +type field assignments so that one could send XNS Datagrams on the +MILNET or Internet Datagrams on 10Mb Ethernet, and also protocol and +type fields so one could encapsulate each kind of Datagram in the +other. + + + upper| DoD IP | PUP | NS IP | +lower | | | | +--------------|--------|--------|--------| + | Type | Type | Type | +3Mb Ethernet | 1001 | 1000 | 3000 | + | octal | octal | octal | +--------------|--------|--------|--------| + | Type | Type | Type | +10 Mb Ethernet| 0800 | 0200 | 0600 | + | hex | hex | hex | +--------------|--------|--------|--------| + | Link | Link | Link | +MILNET | 155 | 152 | 150 | + | decimal| decimal| decimal| +--------------|--------|--------|--------| + + + + upper| DoD IP | PUP | NS IP | +lower | | | | +--------------|--------|--------|--------| + | |Protocol|Protocol| +DoD IP | X | 12 | 22 | + | | decimal| decimal| +--------------|--------|--------|--------| + | | | | +PUP | ? | X | ? | + | | | | +--------------|--------|--------|--------| + | Type | Type | | +NS IP | 13 | 12 | X | + | decimal| decimal| | +--------------|--------|--------|--------| + + + +[] + + + + +Reynolds & Postel [Page 192] + +RFC 1700 Assigned Numbers October 1994 + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ip-xns-mapping + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 193] + +RFC 1700 Assigned Numbers October 1994 + + +PRONET 80 TYPE NUMBERS + + +Below is the current list of PRONET 80 Type Numbers. Note: a protocol +that is on this list does not necessarily mean that there is any +implementation of it on ProNET. + +Of these, protocols 1, 14, and 20 are the only ones that have ever +been seen in ARP packets. + +For reference, the header is (one byte/line): + + destination hardware address + source hardware address + data link header version (2) + data link header protocol number + data link header reserved (0) + data link header reserved (0) + +Some protocols have been known to tuck stuff in the reserved fields. + +Those who need a protocol number on ProNET-10/80 should contact John +Shriver (jas@proteon.com). + + +1 IP +2 IP with trailing headers +3 Address Resolution Protocol +4 Proteon HDLC +5 VAX Debugging Protocol (MIT) +10 Novell NetWare (IPX and pre-IPX) (old format, + 3 byte trailer) +11 Vianetix +12 PUP +13 Watstar protocol (University of Waterloo) +14 XNS +15 Diganostics +16 Echo protocol (link level) +17 Banyan Vines +20 DECnet (DEUNA Emulation) +21 Chaosnet +23 IEEE 802.2 or ISO 8802/2 Data Link +24 Reverse Address Resolution Protocol +29 TokenVIEW-10 +31 AppleTalk LAP Data Packet +33 Cornell Boot Server Location Protocol +34 Novell NetWare IPX (new format, no trailer, + new XOR checksum) + + + +Reynolds & Postel [Page 194] + +RFC 1700 Assigned Numbers October 1994 + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/pronet80-type-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 195] + +RFC 1700 Assigned Numbers October 1994 + + +NOVELL SAP NUMBERS OF INTEREST + +For the convenience of the Internet community the IANA maitains a list +of Novell Service Access Point (SAP) numbers. This list is kept +up-to-date- by contributions from the community. Please send +corrections and additions to IANA@ISI.EDU. + +Novell SAPs +====== ==== + +Decimal Hex SAP Description +======= ==== =============== + +0 0000 Unknown +1 0001 User +2 0002 User Group +3 0003 Print Queue or Print Group +4 0004 File Server (SLIST source) +5 0005 Job Server +6 0006 Gateway +7 0007 Print Server or Silent Print Server +8 0008 Archive Queue +9 0009 Archive Server +10 000a Job Queue +11 000b Administration +15 000F Novell TI-RPC +23 0017 Diagnostics +32 0020 NetBIOS +33 0021 NAS SNA Gateway +35 0023 NACS Async Gateway or Asynchronous Gateway +36 0024 Remote Bridge or Routing Service +38 0026 Bridge Server or Asynchronous Bridge Server +39 0027 TCP/IP Gateway Server +40 0028 Point to Point (Eicon) X.25 Bridge Server +41 0029 Eicon 3270 Gateway +42 002a CHI Corp ??? +44 002c PC Chalkboard +45 002d Time Synchronization Server or Asynchronous Timer +46 002e SAP Archive Server or SMS Target Service Agent +69 0045 DI3270 Gateway +71 0047 Advertising Print Server +75 004b Btrieve VAP/NLM 5.0 +76 004c Netware SQL VAP/NLM Server +77 004d Xtree Network Version Netware XTree +80 0050 Btrieve VAP 4.11 +82 0052 QuickLink (Cubix) +83 0053 Print Queue User +88 0058 Multipoint X.25 Eicon Router + + + +Reynolds & Postel [Page 196] + +RFC 1700 Assigned Numbers October 1994 + + +96 0060 STLB/NLM ??? +100 0064 ARCserve +102 0066 ARCserve 3.0 +114 0072 WAN Copy Utility +122 007a TES-Netware for VMS +146 0092 WATCOM Debugger or Emerald Tape Backup Server +149 0095 DDA OBGYN ??? +152 0098 Netware Access Server (Asynchronous gateway) +154 009a Netware for VMS II or Named Pipe Server +155 009b Netware Access Server +158 009e Portable Netware Server or SunLink NVT +161 00a1 Powerchute APC UPS NLM +170 00aa LAWserve ??? +172 00ac Compaq IDA Status Monitor +256 0100 PIPE STAIL ??? +258 0102 LAN Protect Bindery +259 0103 Oracle DataBase Server +263 0107 Netware 386 or RSPX Remote Console +271 010f Novell SNA Gateway +274 0112 Print Server (HP) +276 0114 CSA MUX (f/Communications Executive) +277 0115 CSA LCA (f/Communications Executive) +278 0116 CSA CM (f/Communications Executive) +279 0117 CSA SMA (f/Communications Executive) +280 0118 CSA DBA (f/Communications Executive) +281 0119 CSA NMA (f/Communications Executive) +282 011a CSA SSA (f/Communications Executive) +283 011b CSA STATUS (f/Communications Executive) +286 011e CSA APPC (f/Communications Executive) +294 0126 SNA TEST SSA Profile +298 012a CSA TRACE (f/Communications Executive) +304 0130 Communications Executive +307 0133 NNS Domain Server or Netware Naming Services Domain +309 0135 Netware Naming Services Profile +311 0137 Netware 386 Print Queue or NNS Print Queue +321 0141 LAN Spool Server (Vap, Intel) +338 0152 IRMALAN Gateway +340 0154 Named Pipe Server +360 0168 Intel PICKIT Comm Server or Intel CAS Talk Server +369 171 UNKNOWN??? +371 0173 Compaq +372 0174 Compaq SNMP Agent +373 0175 Compaq +384 0180 XTree Server or XTree Tools +394 18A UNKNOWN??? Running on a Novell Server +432 01b0 GARP Gateway (net research) +433 01b1 Binfview (Lan Support Group) +447 01bf Intel LanDesk Manager + + + +Reynolds & Postel [Page 197] + +RFC 1700 Assigned Numbers October 1994 + + +458 01ca AXTEC ??? +459 01cb Netmode ??? +460 1CC UNKNOWN??? Sheva netmodem??? +472 01d8 Castelle FAXPress Server +474 01da Castelle LANPress Print Server +476 1DC Castille FAX/Xerox 7033 Fax Server/Excel Lan Fax +496 01f0 LEGATO ??? +501 01f5 LEGATO ??? +563 0233 NMS Agent or Netware Management Agent +567 0237 NMS IPX Discovery or LANtern Read/Write Channel +568 0238 NMS IP Discovery or LANtern Trap/Alarm Channel +570 023a LABtern +572 023c MAVERICK ??? +574 23E UNKNOWN??? Running on a Novell Server +575 023f Used by eleven various Novell Servers +590 024e Remote Something ??? +618 026a Network Management (NMS) Service Console +619 026b Time Synchronization Server (Netware 4.x) +632 0278 Directory Server (Netware 4.x) +772 0304 Novell SAA Gateway +776 0308 COM or VERMED 1 ??? +778 030a Gallacticom BBS +780 030c Intel Netport 2 or HP JetDirect or HP Quicksilver +800 0320 Attachmate Gateway +807 0327 Microsoft Diagnostiocs ??? +821 0335 MultiTech Systems Multisynch Comm Server +853 0355 Arcada Backup Exec +858 0358 MSLCD1 ??? +865 0361 NETINELO ??? +894 037e Twelve Novell file servers in the PC3M family +895 037f ViruSafe Notify +902 0386 HP Bridge +903 0387 HP Hub +916 0394 NetWare SAA Gateway +923 039b Lotus Notes +951 03b7 Certus Anti Virus NLM +964 03c4 ARCserve 4.0 (Cheyenne) +967 03c7 LANspool 3.5 (Intel) +990 03de Gupta Sequel Base Server or NetWare SQL +993 03e1 Univel Unixware +996 03e4 Univel Unixware +1020 03fc Intel Netport +1021 03fd Print SErver Queue ??? +1034 40A ipnServer??? Running on a Novell Server +1035 40B UNKNOWN??? +1037 40D LVERRMAN??? Running on a Novell Server +1038 40E LVLIC??? Running on a Novell Server +1040 410 UNKNOWN??? Running on a Novell Server + + + +Reynolds & Postel [Page 198] + +RFC 1700 Assigned Numbers October 1994 + + +1044 0414 Kyocera +1065 0429 Site Lock Virus (Brightworks) +1074 0432 UFHELP R ??? +1075 433 Sunoptics SNMP Agent??? +1100 044c Backup ??? +1111 457 Canon GP55??? Running on a Canon GP55 network printer +1115 045b Dell SCSI Array (DSA) Monitor +1200 04b0 CD-Net (Meridian) +1217 4C1 UNKNOWN??? +1299 513 Emulux NQA??? Something from Emulex +1312 0520 Site Lock Checks +1321 0529 Site Lock Checks (Brightworks) +1325 052d Citrix OS/2 App Server +1344 536 Milan ??? +1408 0580 McAfee's NetShield anti-virus +1569 621 ?? Something from Emulex +1571 623 UNKNOWN??? Running on a Novell Server +1900 076C Xerox +2857 0b29 Site Lock +3113 0c29 Site Lock Applications +3116 0c2c Licensing Server +9088 2380 LAI Site Lock +9100 238c Meeting Maker +18440 4808 Site Lock Server or Site Lock Metering VAP/NLM +21845 5555 Site Lock User +25362 6312 Tapeware +28416 6f00 Rabbit Gateway (3270) +30467 7703 MODEM?? +32770 8002 NetPort Printers (Intel) or LANport +32776 8008 WordPerfect Network Version +34238 85BE Cisco Enhanced Interior Routing Protocol (EIGRP) +34952 8888 WordPerfect Network Version or Quick Network Management +36864 9000 McAfee's NetShield anti-virus +38404 9604 ?? CSA-NT_MON +61727 f11f Site Lock Metering VAP/NLM +61951 f1ff Site Lock +62723 F503 ?? SCA-NT +65535 ffff Any Service or Wildcard + +This file is + + ftp://ftp.isi.edu/in-notes/iana/assignments/novell-sap-numbers + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/novell-sap-numbers + + + + +Reynolds & Postel [Page 199] + +RFC 1700 Assigned Numbers October 1994 + + +POINT-TO-POINT PROTOCOL FIELD ASSIGNMENTS + +PPP DLL PROTOCOL NUMBERS + +The Point-to-Point Protocol (PPP) Data Link Layer [146,147,175] +contains a 16 bit Protocol field to identify the the encapsulated +protocol. The Protocol field is consistent with the ISO 3309 (HDLC) +extension mechanism for Address fields. All Protocols MUST be +assigned such that the least significant bit of the most significant +octet equals "0", and the least significant bit of the least +significant octet equals "1". + +Assigned PPP DLL Protocol Numbers + +Value (in hex) Protocol Name + +0001 Padding Protocol +0003 to 001f reserved (transparency inefficient) +0021 Internet Protocol +0023 OSI Network Layer +0025 Xerox NS IDP +0027 DECnet Phase IV +0029 Appletalk +002b Novell IPX +002d Van Jacobson Compressed TCP/IP +002f Van Jacobson Uncompressed TCP/IP +0031 Bridging PDU +0033 Stream Protocol (ST-II) +0035 Banyan Vines +0037 reserved (until 1993) +0039 AppleTalk EDDP +003b AppleTalk SmartBuffered +003d Multi-Link +003f NETBIOS Framing +0041 Cisco Systems +0043 Ascom Timeplex +0045 Fujitsu Link Backup and Load Balancing (LBLB) +0047 DCA Remote Lan +0049 Serial Data Transport Protocol (PPP-SDTP) +004b SNA over 802.2 +004d SNA +004f IP6 Header Compression +006f Stampede Bridging +007d reserved (Control Escape) [RFC1661] +007f reserved (compression inefficient) [RFC1662] +00cf reserved (PPP NLPID) +00fb compression on single link in multilink group +00fd 1st choice compression + + + +Reynolds & Postel [Page 200] + +RFC 1700 Assigned Numbers October 1994 + + +00ff reserved (compression inefficient) + +0201 802.1d Hello Packets +0203 IBM Source Routing BPDU +0205 DEC LANBridge100 Spanning Tree +0231 Luxcom +0233 Sigma Network Systems + +8001-801f Not Used - reserved [RFC1661] +8021 Internet Protocol Control Protocol +8023 OSI Network Layer Control Protocol +8025 Xerox NS IDP Control Protocol +8027 DECnet Phase IV Control Protocol +8029 Appletalk Control Protocol +802b Novell IPX Control Protocol +802d reserved +802f reserved +8031 Bridging NCP +8033 Stream Protocol Control Protocol +8035 Banyan Vines Control Protocol +8037 reserved till 1993 +8039 reserved +803b reserved +803d Multi-Link Control Protocol +803f NETBIOS Framing Control Protocol +807d Not Used - reserved [RFC1661] +8041 Cisco Systems Control Protocol +8043 Ascom Timeplex +8045 Fujitsu LBLB Control Protocol +8047 DCA Remote Lan Network Control Protocol (RLNCP) +8049 Serial Data Control Protocol (PPP-SDCP) +804b SNA over 802.2 Control Protocol +804d SNA Control Protocol +804f IP6 Header Compression Control Protocol +006f Stampede Bridging Control Protocol +80cf Not Used - reserved [RFC1661] +80fb compression on single link in multilink group control +80fd Compression Control Protocol +80ff Not Used - reserved [RFC1661] + +c021 Link Control Protocol +c023 Password Authentication Protocol +c025 Link Quality Report +c027 Shiva Password Authentication Protocol +c029 CallBack Control Protocol (CBCP) +c081 Container Control Protocol [KEN] +c223 Challenge Handshake Authentication Protocol +c281 Proprietary Authentication Protocol [KEN] + + + +Reynolds & Postel [Page 201] + +RFC 1700 Assigned Numbers October 1994 + + +c26f Stampede Bridging Authorization Protocol +c481 Proprietary Node ID Authentication Protocol [KEN] + +Protocol field values in the "0xxx" to "3xxx" range identify the +network-layer protocol of specific datagrams, and values in the "8xxx" +to "bxxx" range identify datagrams belonging to the associated Network +Control Protocol (NCP), if any. + +It is recommended that values in the "02xx" to "1exx" and "xx01" to +"xx1f" ranges not be assigned, as they are compression inefficient. + +Protocol field values in the "4xxx" to "7xxx" range are used for +protocols with low volume traffic which have no associated NCP. + +Protocol field values in the "cxxx" to "exxx" range identify datagrams +as Control Protocols (such as LCP). + +PPP LCP AND IPCP CODES + +The Point-to-Point Protocol (PPP) Link Control Protocol (LCP), [146] +the Compression Control Protocol (CCP), Internet Protocol Control +Protocol (IPCP), [147] and other control protocols, contain an 8 bit +Code field which identifies the type of packet. These Codes are +assigned as follows: + +Code Packet Type +---- ----------- + 1 Configure-Request + 2 Configure-Ack + 3 Configure-Nak + 4 Configure-Reject + 5 Terminate-Request + 6 Terminate-Ack + 7 Code-Reject + 8 * Protocol-Reject + 9 * Echo-Request + 10 * Echo-Reply + 11 * Discard-Request + 12 * Identification + 13 * Time-Remaining + 14 + Reset-Request + 15 + Reset-Reply + +* LCP Only ++ CCP Only + +PPP LCP CONFIGURATION OPTION TYPES + + + + +Reynolds & Postel [Page 202] + +RFC 1700 Assigned Numbers October 1994 + + +The Point-to-Point Protocol (PPP) Link Control Protocol (LCP) +specifies a number of Configuration Options [146] which are +distinguished by an 8 bit Type field. These Types are assigned as +follows: + +Type Configuration Option +---- -------------------- + 1 Maximum-Receive-Unit + 2 Async-Control-Character-Map + 3 Authentication-Protocol + 4 Quality-Protocol + 5 Magic-Number + 6 RESERVED + 7 Protocol-Field-Compression + 8 Address-and-Control-Field-Compression + 9 FCS-Alternatives + 10 Self-Describing-Pad + 11 Numbered-Mode + 12 Multi-Link-Procedure + 13 Callback + 14 Connect-Time + 15 Compound-Frames + 16 Nominal-Data-Encapsulation + 17 Multilink-MRRU + 18 Multilink-Short-Sequence-Number-Header-Format + 19 Multilink-Endpoint-Discriminator + 20 Proprietary [KEN] + 21 DCE-Identifier [SCHNEIDER] + +PPP LCP FCS-ALTERNATIVES + +The Point-to-Point Protocol (PPP) Link Control Protocol (LCP) +FCS-Alternatives Configuration Option contains an 8-bit Options field +which identifies the FCS used. These are assigned as follows: + +Bit FCS +---- ---------- + 1 Null FCS + 2 CCITT 16-Bit FCS + 4 CCITT 32-bit FCS + + +PPP LCP CALLBACK OPERATION FIELDS + +The Point-to-Point Protocol (PPP) Link Control Protocol (LCP) Callback +Configuration Option contains an 8-bit Operations field which +identifies the format of the Message. These are assigned as follows: + + + + +Reynolds & Postel [Page 203] + +RFC 1700 Assigned Numbers October 1994 + + +Operation Description +--------- --------------------------- + 0 Location determined by user authentication. + 1 Dialing string. + 2 Location identifier. + 3 E.164 number. + 4 X.500 distinguished name. + 5 unassigned + 6 Location is determined during CBCP negotiation. + +PPP IPCP CONFIGURATION OPTION TYPES + +The Point-to-Point Protocol (PPP) Internet Protocol Control Protocol +(IPCP) specifies a number of Configuration Options [147] which are +distinguished by an 8 bit Type field. These Types are assigned as +follows: + +Type Configuration Option +---- -------------------- + 1 IP-Addresses (deprecated) + 2 IP-Compression-Protocol + 3 IP-Address + +PPP ATCP CONFIGURATION OPTION TYPES + +The Point-to-Point Protocol (PPP) Apple Talk Control Protocol (ATCP) +specifies a number of Configuration Options [RFC-1378] which are +distinguished by an 8 bit Type field. These Types are assigned as +follows: + +Type Configuration Option +---- -------------------- + 1 AppleTalk-Address + 2 Routing-Protocol + 3 Suppress-Broadcasts + 4 AT-Compression-Protocol + 5 Reserved + 6 Server-information + 7 Zone-information + 8 Default-Router-Address + +PPP OSINLCP CONFIGURATION OPTION TYPES + +The Point-to-Point Protocol (PPP) OSI Network Layer Control Protocol +(OSINLCP) specifies a number of Configuration Options [RFC-1377] which +are distinguished by an 8 bit Type field. These Types are assigned as +follows: + + + + +Reynolds & Postel [Page 204] + +RFC 1700 Assigned Numbers October 1994 + + +Type Configuration Option +---- -------------------- + 1 Align-NPDU + +PPP BRIDGING CONFIGURATION OPTION TYPES + +The Point-to-Point Protocol (PPP) Bridging Control Protocol (BCP) +specifies a number of Configuration Options which are distinguished by +an 8 bit Type field. These Types are assigned as follows: + +Type Configuration Option +---- -------------------- + 1 Bridge-Identification + 2 Line-Identification + 3 MAC-Support + 4 Tinygram-Compression + 5 LAN-Identification + 6 MAC-Address + 7 Spanning-Tree-Protocol + +PPP BRIDGING MAC TYPES + +The Point-to-Point Protocol (PPP) Bridging Control Protocol (BCP) +contains an 8 bit MAC Type field which identifies the MAC +encapsulated. These Types are assigned as follows: + +Type MAC +---- ----------- + 0 Reserved + 1 IEEE 802.3/Ethernet with cannonical addresses + 2 IEEE 802.4 with cannonical addresses + 3 IEEE 802.5 with non-cannonical addresses + 4 FDDI with non-cannonical addresses + 5-10 reserved + 11 IEEE 802.5 with cannonical addresses + 12 FDDI with cannonical addresses + +PPP BRIDGING SPANNING TREE + +The Point-to-Point Protocol (PPP) Bridging Control Protocol (BCP) +Spanning Tree Configuration Option contains an 8-bit Protocol field +which identifies the spanning tree used. These are assigned as +follows: + +Protocol Spanning Tree +-------- --------------- + 0 Null - no spanning tree protocol supported + 1 IEEE 802.1D spanning tree protocol + + + +Reynolds & Postel [Page 205] + +RFC 1700 Assigned Numbers October 1994 + + + 2 IEEE 802.1G extended spanning tree protocol + 3 IBM source route spanning tree protocol + 4 DEC LANbridge 100 spanning tree protocol + + +REFERENCES + +[RFC1661] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", + STD 51, RFC 1661, Daydreamer, July 1994. + +[RFC1662] Simpson, W., Editor, "PPP in HDLC-like Framing", STD 51, RFC + 1662, Daydreamer, July 1994. + + +PEOPLE + +[KEN] + +[SCHNEIDER] Kevin Schneider + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ppp-numbers + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 206] + +RFC 1700 Assigned Numbers October 1994 + + +MACHINE NAMES + + +These are the Official Machine Names as they appear in the Domain Name +System HINFO records and the NIC Host Table. Their use is described +in [RFC952]. + +A machine name or CPU type may be up to 40 characters taken from the +set of uppercase letters, digits, and the two punctuation characters +hyphen and slash. It must start with a letter, and end with a letter +or digit. + +AMIGA-500 +AMIGA-500/010 +AMIGA-500/020 +AMIGA-500/EC030 +AMIGA-500/030 +AMIGA-600 +AMIGA-1000 +AMIGA-1000/010 +AMIGA-1000/020 +AMIGA-1000/EC030 +AMIGA-1000/030 +AMIGA-1200 +AMIGA-1200/EC030 +AMIGA-1200/030 +AMIGA-1200/EC040 +AMIGA-1200/LC040 +AMIGA-1200/040 +AMIGA-2000 +AMIGA-2000/010 +AMIGA-2000/020 +AMIGA-2000/EC030 +AMIGA-2000/030 +AMIGA-2000/LC040 +AMIGA-2000/EC040 +AMIGA-2000/040 +AMIGA-3000 +AMIGA-3000/EC040 +AMIGA-3000/LC040 +AMIGA-3000/040 +AMIGA-3000/060 +AMIGA-4000/EC030 +AMIGA-4000/030 +AMIGA-4000/LC040 +AMIGA-4000/040 +AMIGA-4000/060 +ALTO + + + +Reynolds & Postel [Page 207] + +RFC 1700 Assigned Numbers October 1994 + + +ALTOS-6800 +AMDAHL-V7 +APOLLO +APPLE-MACINTOSH +APPLE-POWERBOOK +ATARI-104ST +ATT-3B1 +ATT-3B2 +ATT-3B20 +ATT-7300 +AXP +BBN-C/60 +BURROUGHS-B/29 +BURROUGHS-B/4800 +BUTTERFLY +C/30 +C/70 +CADLINC +CADR +CDC-170 +CDC-170/750 +CDC-173 +CDTV +CDTV/060 +CD32 +CELERITY-1200 +CLUB-386 +COMPAQ-386/20 +COMTEN-3690 +CP8040 +CRAY-1 +CRAY-X/MP +CRAY-2 +CTIWS-117 +DANDELION +DEC-10 +DEC-1050 +DEC-1077 +DEC-1080 +DEC-1090 +DEC-1090B +DEC-1090T +DEC-2020T +DEC-2040 +DEC-2040T +DEC-2050T +DEC-2060 +DEC-2060T + + + +Reynolds & Postel [Page 208] + +RFC 1700 Assigned Numbers October 1994 + + +DEC-2065 +DEC-AXP +DEC-FALCON +DEC-KS10 +DECSTATION +DEC-VAX +DEC-VAXCLUSTER +DEC-VAXSTATION +DEC-VAX-11730 +DORADO +DPS8/70M +ELXSI-6400 +EVEREX-386 +FOONLY-F2 +FOONLY-F3 +FOONLY-F4 +GOULD +GOULD-6050 +GOULD-6080 +GOULD-9050 +GOULD-9080 +H-316 +H-60/68 +H-68 +H-68/80 +H-89 +HONEYWELL-DPS-6 +HONEYWELL-DPS-8/70 +HP3000 +HP3000/64 +IBM-158 +IBM-360/67 +IBM-370/3033 +IBM-3081 +IBM-3084QX +IBM-3101 +IBM-4331 +IBM-4341 +IBM-4361 +IBM-4381 +IBM-4956 +IBM-6152 +IBM-PC +IBM-PC/AT +IBM-PC/RT +IBM-PC/XT +IBM-RS/6000 +IBM-SERIES/1 + + + +Reynolds & Postel [Page 209] + +RFC 1700 Assigned Numbers October 1994 + + +IMAGEN +IMAGEN-8/300 +IMSAI +INTEGRATED-SOLUTIONS +INTEGRATED-SOLUTIONS-68K +INTEGRATED-SOLUTIONS-CREATOR +INTEGRATED-SOLUTIONS-CREATOR-8 +INTEL-386 +INTEL-IPSC +IS-1 +IS-68010 +LMI +LSI-11 +LSI-11/2 +LSI-11/23 +LSI-11/73 +M68000 +MAC-II +MAC-POWERBOOK +MACINTOSH +MASSCOMP +MC500 +MC68000 +MICROPORT +MICROVAX +MICROVAX-I +MV/8000 +NAS3-5 +NCR-COMTEN-3690 +NEXT/N1000-316 +NOW +ONYX-Z8000 +PDP-11 +PDP-11/3 +PDP-11/23 +PDP-11/24 +PDP-11/34 +PDP-11/40 +PDP-11/44 +PDP-11/45 +PDP-11/50 +PDP-11/70 +PDP-11/73 +PE-7/32 +PE-3205 +PERQ +PLEXUS-P/60 +PLI + + + +Reynolds & Postel [Page 210] + +RFC 1700 Assigned Numbers October 1994 + + +PLURIBUS +PRIME-2350 +PRIME-2450 +PRIME-2755 +PRIME-9655 +PRIME-9755 +PRIME-9955II +PRIME-2250 +PRIME-2655 +PRIME-9955 +PRIME-9950 +PRIME-9650 +PRIME-9750 +PRIME-2250 +PRIME-750 +PRIME-850 +PRIME-550II +PYRAMID-90 +PYRAMID-90MX +PYRAMID-90X +RIDGE +RIDGE-32 +RIDGE-32C +ROLM-1666 +RS/6000 +S1-MKIIA +SMI +SEQUENT-BALANCE-8000 +SIEMENS +SILICON-GRAPHICS +SILICON-GRAPHICS-IRIS +SGI-IRIS-2400 +SGI-IRIS-2500 +SGI-IRIS-3010 +SGI-IRIS-3020 +SGI-IRIS-3030 +SGI-IRIS-3110 +SGI-IRIS-3115 +SGI-IRIS-3120 +SGI-IRIS-3130 +SGI-IRIS-4D/20 +SGI-IRIS-4D/20G +SGI-IRIS-4D/25 +SGI-IRIS-4D/25G +SGI-IRIS-4D/25S +SGI-IRIS-4D/50 +SGI-IRIS-4D/50G +SGI-IRIS-4D/50GT + + + +Reynolds & Postel [Page 211] + +RFC 1700 Assigned Numbers October 1994 + + +SGI-IRIS-4D/60 +SGI-IRIS-4D/60G +SGI-IRIS-4D/60T +SGI-IRIS-4D/60GT +SGI-IRIS-4D/70 +SGI-IRIS-4D/70G +SGI-IRIS-4D/70GT +SGI-IRIS-4D/80GT +SGI-IRIS-4D/80S +SGI-IRIS-4D/120GTX +SGI-IRIS-4D/120S +SGI-IRIS-4D/210GTX +SGI-IRIS-4D/210S +SGI-IRIS-4D/220GTX +SGI-IRIS-4D/220S +SGI-IRIS-4D/240GTX +SGI-IRIS-4D/240S +SGI-IRIS-4D/280GTX +SGI-IRIS-4D/280S +SGI-IRIS-CS/12 +SGI-IRIS-4SERVER-8 +SPERRY-DCP/10 +SUN +SUN-2 +SUN-2/50 +SUN-2/100 +SUN-2/120 +SUN-2/130 +SUN-2/140 +SUN-2/150 +SUN-2/160 +SUN-2/170 +SUN-3/50 +SUN-3/60 +SUN-3/75 +SUN-3/80 +SUN-3/110 +SUN-3/140 +SUN-3/150 +SUN-3/160 +SUN-3/180 +SUN-3/200 +SUN-3/260 +SUN-3/280 +SUN-3/470 +SUN-3/480 +SUN-4/60 +SUN-4/110 + + + +Reynolds & Postel [Page 212] + +RFC 1700 Assigned Numbers October 1994 + + +SUN-4/150 +SUN-4/200 +SUN-4/260 +SUN-4/280 +SUN-4/330 +SUN-4/370 +SUN-4/390 +SUN-50 +SUN-100 +SUN-120 +SUN-130 +SUN-150 +SUN-170 +SUN-386i/250 +SUN-68000 +SYMBOLICS-3600 +SYMBOLICS-3670 +SYMMETRIC-375 +SYMULT +TANDEM-TXP +TANDY-6000 +TEK-6130 +TI-EXPLORER +TP-4000 +TRS-80 +UNIVAC-1100 +UNIVAC-1100/60 +UNIVAC-1100/62 +UNIVAC-1100/63 +UNIVAC-1100/64 +UNIVAC-1100/70 +UNIVAC-1160 +UNKNOWN +VAX +VAX-11/725 +VAX-11/730 +VAX-11/750 +VAX-11/780 +VAX-11/785 +VAX-11/790 +VAX-11/8600 +VAX-8600 +VAXCLUSTER +VAXSTATION +WANG-PC002 +WANG-VS100 +WANG-VS400 +WYSE-386 + + + +Reynolds & Postel [Page 213] + +RFC 1700 Assigned Numbers October 1994 + + +WYSE-WN5004 +WYSE-WN5008 +WYSE-WN5104 +WYSE-WN5108 +WYSE-WX15C +WYSE-WX17C +WYSE-WX17M +WYSE-WX19C +WYSE-WX19M +WYSE-WYX14M +WYSE-WYX5 +XEROX-1108 +XEROX-8010 +ZENITH-148 + + +REFERENCES + +[RFC952] Harrenstien, K., Stahl, M., and E. Feinler, "DoD Internet + Host Table Specification", RFC 952, SRI, October 1985. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/machine-names + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 214] + +RFC 1700 Assigned Numbers October 1994 + + +OPERATING SYSTEM NAMES + + +These are the Official System Names as they appear in the Domain Name +System HINFO records and the NIC Host Table. Their use is described in +[RFC952]. + +A system name may be up to 40 characters taken from the set of +uppercase letters, digits, and the three punctuation characters +hyphen, period, and slash. It must start with a letter, and end with +a letter or digit. + + +AEGIS +AMIGA-OS-1.2 +AMIGA-OS-1.3 +AMIGA-OS-2.0 +AMIGA-OS-2.1 +AMIGA-OS-3.0 +AMIGA-OS-3.1 +APOLLO +AIX/370 +AIX-PS/2 +BS-2000 +CEDAR +CGW +CHORUS +CHRYSALIS +CMOS +CMS +COS +CPIX +CTOS +CTSS +DCN +DDNOS +DOMAIN +DOS +EDX +ELF +EMBOS +EMMOS +EPOS +FOONEX +FORTH +FUZZ +GCOS +GPOS + + + +Reynolds & Postel [Page 215] + +RFC 1700 Assigned Numbers October 1994 + + +HDOS +IMAGEN +INTERCOM +IMPRESS +INTERLISP +IOS +IRIX +ISI-68020 +ITS +LISP +LISPM +LOCUS +MACOS +MINOS +MOS +MPE5 +MPE/V +MPE/IX +MSDOS +MULTICS +MUSIC +MUSIC/SP +MVS +MVS/SP +NEXUS +NMS +NONSTOP +NOS-2 +NTOS +OPENVMS +OS/DDP +OS/2 +OS4 +OS86 +OSX +PCDOS +PERQ/OS +PLI +PSDOS/MIT +PRIMOS +RMX/RDOS +ROS +RSX11M +RTE-A +SATOPS +SCO-OPEN-DESKTOP-1.0 +SCO-OPEN-DESKTOP-1.1 +SCO-OPEN-DESKTOP-2.0 + + + +Reynolds & Postel [Page 216] + +RFC 1700 Assigned Numbers October 1994 + + +SCO-OPEN-DESKTOP-3.0 +SCO-OPEN-DESKTOP-LITE-3.0 +SCO-OPEN-SERVER-3.0 +SCO-UNIX-3.2.0 +SCO-UNIX-3.2V2.0 +SCO-UNIX-3.2V2.1 +SCO-UNIX-3.2V4.0 +SCO-UNIX-3.2V4.1 +SCO-UNIX-3.2V4.2 +SCO-XENIX-386-2.3.2 +SCO-XENIX-386-2.3.3 +SCO-XENIX-386-2.3.4 +SCS +SIMP +SUN +SUN-OS-3.5 +SUN-OS-4.0 +SWIFT +TAC +TANDEM +TENEX +THE-MAJOR-BBS +TOPS10 +TOPS20 +TOS +TP3010 +TRSDOS +ULTRIX +UNIX +UNIX-BSD +UNIX-V1AT +UNIX-V +UNIX-V.1 +UNIX-V.2 +UNIX-V.3 +UNIX-PC +UNKNOWN +UT2D +V +VM +VM/370 +VM/CMS +VM/SP +VMS +VMS/EUNICE +VRTX +WAITS +WANG + + + +Reynolds & Postel [Page 217] + +RFC 1700 Assigned Numbers October 1994 + + +WIN32 +WYSE-WYXWARE +X11R3 +XDE +XENIX + + +REFERENCES + +[RFC952] Harrenstien, K., Stahl, M., and E. Feinler, "DoD Internet + Host Table Specification", RFC 952, SRI, October 1985. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/operating-system-names + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 218] + +RFC 1700 Assigned Numbers October 1994 + + +TERMINAL TYPE NAMES + + +These are the Official Terminal Type Names. Their use is described in +[RFC930]. The maximum length of a name is 40 characters. + +A terminal names may be up to 40 characters taken from the set of +uppercase letters, digits, and the two punctuation characters hyphen +and slash. It must start with a letter, and end with a letter or +digit. + + +ADDS-CONSUL-980 +ADDS-REGENT-100 +ADDS-REGENT-20 +ADDS-REGENT-200 +ADDS-REGENT-25 +ADDS-REGENT-40 +ADDS-REGENT-60 +ADDS-VIEWPOINT +ADDS-VIEWPOINT-60 +AED-512 +AMPEX-DIALOGUE-210 +AMPEX-DIALOGUE-80 +AMPEX-210 +AMPEX-230 +ANDERSON-JACOBSON-510 +ANDERSON-JACOBSON-630 +ANDERSON-JACOBSON-832 +ANDERSON-JACOBSON-841 +ANN-ARBOR-AMBASSADOR +ANSI +ARDS +BITGRAPH +BUSSIPLEXER +CALCOMP-565 +CDC-456 +CDI-1030 +CDI-1203 +C-ITOH-101 +C-ITOH-50 +C-ITOH-80 +CLNZ +COMPUCOLOR-II +CONCEPT-100 +CONCEPT-104 +CONCEPT-108 +DATA-100 + + + +Reynolds & Postel [Page 219] + +RFC 1700 Assigned Numbers October 1994 + + +DATA-GENERAL-6053 +DATAGRAPHIX-132A +DATAMEDIA-1520 +DATAMEDIA-1521 +DATAMEDIA-2500 +DATAMEDIA-3025 +DATAMEDIA-3025A +DATAMEDIA-3045 +DATAMEDIA-3045A +DATAMEDIA-DT80/1 +DATAPOINT-2200 +DATAPOINT-3000 +DATAPOINT-3300 +DATAPOINT-3360 +DEC-DECWRITER-I +DEC-DECWRITER-II +DEC-GIGI +DEC-GT40 +DEC-GT40A +DEC-GT42 +DEC-LA120 +DEC-LA30 +DEC-LA36 +DEC-LA38 +DEC-VT05 +DEC-VT100 +DEC-VT101 +DEC-VT102 +DEC-VT125 +DEC-VT131 +DEC-VT132 +DEC-VT200 +DEC-VT220 +DEC-VT240 +DEC-VT241 +DEC-VT300 +DEC-VT320 +DEC-VT340 +DEC-VT50 +DEC-VT50H +DEC-VT52 +DEC-VT55 +DEC-VT61 +DEC-VT62 +DELTA-DATA-5000 +DELTA-DATA-NIH-7000 +DELTA-TELTERM-2 +DIABLO-1620 + + + +Reynolds & Postel [Page 220] + +RFC 1700 Assigned Numbers October 1994 + + +DIABLO-1640 +DIGILOG-333 +DTC-300S +DTC-382 +EDT-1200 +ETOS52-APL +ETOS52-CRT +ETOS52-FDW +ETOS52-FUP +ETOS52-GFM +ETOS52-SPR +EXECUPORT-4000 +EXECUPORT-4080 +FACIT-TWIST-4440 +FREEDOM-100 +FREEDOM-110 +FREEDOM-200 +GENERAL-TERMINAL-100A +GENERAL-TERMINAL-101 +GIPSI-TX-M +GIPSI-TX-ME +GIPSI-TX-C4 +GIPSI-TX-C8 +GSI +HAZELTINE-1420 +HAZELTINE-1500 +HAZELTINE-1510 +HAZELTINE-1520 +HAZELTINE-1552 +HAZELTINE-2000 +HAZELTINE-ESPRIT +HITACHI-5601 +HITACHI-5603 +HITACHI-5603E +HITACHI-5603EA +HITACHI-560X +HITACHI-560XE +HITACHI-560XEA +HITACHI-560PR +HITACHI-HOAP1 +HITACHI-HOAP2 +HITACHI-HOAP3 +HITACHI-HOAP4 +HP-2392 +HP-2621 +HP-2621A +HP-2621P +HP-2623 + + + +Reynolds & Postel [Page 221] + +RFC 1700 Assigned Numbers October 1994 + + +HP-2626 +HP-2626A +HP-2626P +HP-2627 +HP-2640 +HP-2640A +HP-2640B +HP-2645 +HP-2645A +HP-2648 +HP-2648A +HP-2649 +HP-2649A +IBM-1050 +IBM-2741 +IBM-3101 +IBM-3101-10 +IBM-3151 +IBM-3179-2 +IBM-3180-2 +IBM-3196-A1 +IBM-3275-2 +IBM-3276-2 +IBM-3276-3 +IBM-3276-4 +IBM-3277-2 +IBM-3278-2 +IBM-3278-3 +IBM-3278-4 +IBM-3278-5 +IBM-3279-2 +IBM-3279-3 +IBM-3477-FC +IBM-3477-FG +IBM-5081 +IBM-5151 +IBM-5154 +IBM-5251-11 +IBM-5291-1 +IBM-5292-2 +IBM-5555-B01 +IBM-5555-C01 +IBM-6153 +IBM-6154 +IBM-6155 +IBM-AED +IBM-3278-2-E +IBM-3278-3-E + + + +Reynolds & Postel [Page 222] + +RFC 1700 Assigned Numbers October 1994 + + +IBM-3278-4-E +IBM-3278-5-E +IBM-3279-2-E +IBM-3279-3-E +IMLAC +INFOTON-100 +INFOTON-400 +INFOTONKAS +ISC-8001 +LSI-ADM-1 +LSI-ADM-11 +LSI-ADM-12 +LSI-ADM-2 +LSI-ADM-20 +LSI-ADM-22 +LSI-ADM-220 +LSI-ADM-3 +LSI-ADM-31 +LSI-ADM-3A +LSI-ADM-42 +LSI-ADM-5 +MEMOREX-1240 +MICROBEE +MICROTERM-ACT-IV +MICROTERM-ACT-V +MICROTERM-ERGO-301 +MICROTERM-MIME-1 +MICROTERM-MIME-2 +MICROTERM-ACT-5A +MICROTERM-TWIST +NEC-5520 +NETRONICS +NETWORK-VIRTUAL-TERMINAL +OMRON-8025AG +PERKIN-ELMER-550 +PERKIN-ELMER-1100 +PERKIN-ELMER-1200 +PERQ +PLASMA-PANEL +QUME-SPRINT-5 +QUME-101 +QUME-102 +SOROC +SOROC-120 +SOUTHWEST-TECHNICAL-PRODUCTS-CT82 +SUN +SUPERBEE +SUPERBEE-III-M + + + +Reynolds & Postel [Page 223] + +RFC 1700 Assigned Numbers October 1994 + + +TEC +TEKTRONIX-4006 +TEKTRONIX-4010 +TEKTRONIX-4012 +TEKTRONIX-4013 +TEKTRONIX-4014 +TEKTRONIX-4023 +TEKTRONIX-4024 +TEKTRONIX-4025 +TEKTRONIX-4027 +TEKTRONIX-4105 +TEKTRONIX-4107 +TEKTRONIX-4110 +TEKTRONIX-4112 +TEKTRONIX-4113 +TEKTRONIX-4114 +TEKTRONIX-4115 +TEKTRONIX-4125 +TEKTRONIX-4404 +TELERAY-1061 +TELERAY-3700 +TELERAY-3800 +TELETEC-DATASCREEN +TELETERM-1030 +TELETYPE-33 +TELETYPE-35 +TELETYPE-37 +TELETYPE-38 +TELETYPE-40 +TELETYPE-43 +TELEVIDEO-910 +TELEVIDEO-912 +TELEVIDEO-920 +TELEVIDEO-920B +TELEVIDEO-920C +TELEVIDEO-925 +TELEVIDEO-955 +TELEVIDEO-950 +TELEVIDEO-970 +TELEVIDEO-975 +TERMINET-1200 +TERMINET-300 +TI-700 +TI-733 +TI-735 +TI-743 +TI-745 +TI-800 + + + +Reynolds & Postel [Page 224] + +RFC 1700 Assigned Numbers October 1994 + + +TYCOM +UNIVAC-DCT-500 +VIDEO-SYSTEMS-1200 +VIDEO-SYSTEMS-5000 +VOLKER-CRAIG-303 +VOLKER-CRAIG-303A +VOLKER-CRAIG-404 +VISUAL-200 +VISUAL-55 +WYSE-30 +WYSE-50 +WYSE-60 +WYSE-75 +WYSE-85 +WYSE-99GT +WYSE-100 +WYSE-120 +WYSE-120ES +WYSE-150 +WYSE-150ES +WYSE-160 +WYSE-160ES +WYSE-185 +WYSE-185ES +WYSE-285 +WYSE-285ES +WYSE-325 +WYSE-325ES +WYSE-350 +WYSE-370 +XEROX-1720 +XTERM +ZENITH-H19 +ZENITH-Z29 +ZENTEC-30 + + +REFERENCES + +[RFC930] Solomon, M., and E. Wimmers, "Telnet Terminal Type Option", + RFC 930, University of Wisconsin, Madison, January 1985. + + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/terminal-type-names + + + + +Reynolds & Postel [Page 225] + +RFC 1700 Assigned Numbers October 1994 + + +PROTOCOL AND SERVICE NAMES + + +These are the Official Protocol Names as they appear in the Domain +Name System WKS records and the NIC Host Table. Their use is +described in [RFC952]. + +A protocol or service may be up to 40 characters taken from the set of +uppercase letters, digits, and the punctuation character hyphen. It +must start with a letter, and end with a letter or digit. + + +ARGUS - ARGUS Protocol +ARP - Address Resolution Protocol +AUTH - Authentication Service +BBN-RCC-MON - BBN RCC Monitoring +BL-IDM - Britton Lee Intelligent Database Machine +BOOTP - Bootstrap Protocol +BOOTPC - Bootstrap Protocol Client +BOOTPS - Bootstrap Protocol Server +BR-SAT-MON - Backroom SATNET Monitoring +CFTP - CFTP +CHAOS - CHAOS Protocol +CHARGEN - Character Generator Protocol +CISCO-FNA - CISCO FNATIVE +CISCO-TNA - CISCO TNATIVE +CISCO-SYS - CISCO SYSMAINT +CLOCK - DCNET Time Server Protocol +CMOT - Common Mgmnt Info Ser and Prot over TCP/IP +COOKIE-JAR - Authentication Scheme +CSNET-NS - CSNET Mailbox Nameserver Protocol +DAYTIME - Daytime Protocol +DCN-MEAS - DCN Measurement Subsystems Protocol +DCP - Device Control Protocol +DGP - Dissimilar Gateway Protocol +DISCARD - Discard Protocol +DMF-MAIL - Digest Message Format for Mail +DOMAIN - Domain Name System +ECHO - Echo Protocol +EGP - Exterior Gateway Protocol +EHF-MAIL - Encoding Header Field for Mail +EMCON - Emission Control Protocol +EMFIS-CNTL - EMFIS Control Service +EMFIS-DATA - EMFIS Data Service +FCONFIG - Fujitsu Config Protocol +FINGER - Finger Protocol +FTP - File Transfer Protocol +FTP-DATA - File Transfer Protocol Data + + + +Reynolds & Postel [Page 226] + +RFC 1700 Assigned Numbers October 1994 + + +GGP - Gateway Gateway Protocol +GRAPHICS - Graphics Protocol +HMP - Host Monitoring Protocol +HOST2-NS - Host2 Name Server +HOSTNAME - Hostname Protocol +ICMP - Internet Control Message Protocol +IGMP - Internet Group Management Protocol +IGP - Interior Gateway Protocol +IMAP2 - Interim Mail Access Protocol version 2 +INGRES-NET - INGRES-NET Service +IP - Internet Protocol +IPCU - Internet Packet Core Utility +IPPC - Internet Pluribus Packet Core +IP-ARC - Internet Protocol on ARCNET +IP-ARPA - Internet Protocol on ARPANET +IP-CMPRS - Compressing TCP/IP Headers +IP-DC - Internet Protocol on DC Networks +IP-DVMRP - Distance Vector Multicast Routing Protocol +IP-E - Internet Protocol on Ethernet Networks +IP-EE - Internet Protocol on Exp. Ethernet Nets +IP-FDDI - Transmission of IP over FDDI +IP-HC - Internet Protocol on Hyperchannnel +IP-IEEE - Internet Protocol on IEEE 802 +IP-IPX - Transmission of 802.2 over IPX Networks +IP-MTU - IP MTU Discovery Options +IP-NETBIOS - Internet Protocol over NetBIOS Networks +IP-SLIP - Transmission of IP over Serial Lines +IP-WB - Internet Protocol on Wideband Network +IP-X25 - Internet Protocol on X.25 Networks +IRTP - Internet Reliable Transaction Protocol +ISI-GL - ISI Graphics Language Protocol +ISO-TP4 - ISO Transport Protocol Class 4 +ISO-TSAP - ISO TSAP +LA-MAINT - IMP Logical Address Maintenance +LARP - Locus Address Resoultion Protocol +LDP - Loader Debugger Protocol +LEAF-1 - Leaf-1 Protocol +LEAF-2 - Leaf-2 Protocol +LINK - Link Protocol +LOC-SRV - Location Service +LOGIN - Login Host Protocol +MAIL - Format of Electronic Mail Messages +MERIT-INP - MERIT Internodal Protocol +METAGRAM - Metagram Relay +MIB - Management Information Base +MIT-ML-DEV - MIT ML Device +MFE-NSP - MFE Network Services Protocol +MIT-SUBNET - MIT Subnet Support + + + +Reynolds & Postel [Page 227] + +RFC 1700 Assigned Numbers October 1994 + + +MIT-DOV - MIT Dover Spooler +MPM - Internet Message Protocol (Multimedia Mail) +MPM-FLAGS - MPM Flags Protocol +MPM-SND - MPM Send Protocol +MSG-AUTH - MSG Authentication Protocol +MSG-ICP - MSG ICP Protocol +MUX - Multiplexing Protocol +NAMESERVER - Host Name Server +NETBIOS-DGM - NETBIOS Datagram Service +NETBIOS-NS - NETBIOS Name Service +NETBIOS-SSN - NETBIOS Session Service +NETBLT - Bulk Data Transfer Protocol +NETED - Network Standard Text Editor +NETRJS - Remote Job Service +NI-FTP - NI File Transfer Protocol +NI-MAIL - NI Mail Protocol +NICNAME - Who Is Protocol +NFILE - A File Access Protocol +NNTP - Network News Transfer Protocol +NSW-FE - NSW User System Front End +NTP - Network Time Protocol +NVP-II - Network Voice Protocol +OSPF - Open Shortest Path First Interior GW Protocol +PCMAIL - Pcmail Transport Protocol +POP2 - Post Office Protocol - Version 2 +POP3 - Post Office Protocol - Version 3 +PPP - Point-to-Point Protocol +PRM - Packet Radio Measurement +PUP - PUP Protocol +PWDGEN - Password Generator Protocol +QUOTE - Quote of the Day Protocol +RARP - A Reverse Address Resolution Protocol +RATP - Reliable Asynchronous Transfer Protocol +RE-MAIL-CK - Remote Mail Checking Protocol +RDP - Reliable Data Protocol +RIP - Routing Information Protocol +RJE - Remote Job Entry +RLP - Resource Location Protocol +RTELNET - Remote Telnet Service +RVD - Remote Virtual Disk Protocol +SAT-EXPAK - Satnet and Backroom EXPAK +SAT-MON - SATNET Monitoring +SEP - Sequential Exchange Protocol +SFTP - Simple File Transfer Protocol +SGMP - Simple Gateway Monitoring Protocol +SNMP - Simple Network Management Protocol +SMI - Structure of Management Information +SMTP - Simple Mail Transfer Protocol + + + +Reynolds & Postel [Page 228] + +RFC 1700 Assigned Numbers October 1994 + + +SQLSRV - SQL Service +ST - Stream Protocol +STATSRV - Statistics Service +SU-MIT-TG - SU/MIT Telnet Gateway Protocol +SUN-RPC - SUN Remote Procedure Call +SUPDUP - SUPDUP Protocol +SUR-MEAS - Survey Measurement +SWIFT-RVF - Remote Virtual File Protocol +TACACS-DS - TACACS-Database Service +TACNEWS - TAC News +TCP - Transmission Control Protocol +TCP-ACO - TCP Alternate Checksum Option +TELNET - Telnet Protocol +TFTP - Trivial File Transfer Protocol +THINWIRE - Thinwire Protocol +TIME - Time Server Protocol +TP-TCP - ISO Transport Service on top of the TCP +TRUNK-1 - Trunk-1 Protocol +TRUNK-2 - Trunk-2 Protocol +UCL - University College London Protocol +UDP - User Datagram Protocol +NNTP - Network News Transfer Protocol +USERS - Active Users Protocol +UUCP-PATH - UUCP Path Service +VIA-FTP - VIA Systems-File Transfer Protocol +VISA - VISA Protocol +VMTP - Versatile Message Transaction Protocol +WB-EXPAK - Wideband EXPAK +WB-MON - Wideband Monitoring +XNET - Cross Net Debugger +XNS-IDP - Xerox NS IDP + + +REFERENCES + +[RFC952] Harrenstien, K., Stahl, M., and E. Feinler, "DoD Internet + Host Table Specification", RFC 952, SRI, October 1985. + +[] + + +URL = ftp://ftp.isi.edu/in-notes/iana/assignments/service-names + + + + + + + + + +Reynolds & Postel [Page 229] + +RFC 1700 Assigned Numbers October 1994 + + +Security Considerations + + Security issues are not discussed in this memo. + +Authors' Addresses + + Joyce K. Reynolds + USC/Information Sciences Institute + 4676 Admiralty Way + Marina del Rey, California 90292-6695 + + Phone: +1 310-822-1511 + EMail: jkrey@isi.edu + + + Jon Postel + USC/Information Sciences Institute + 4676 Admiralty Way + Marina del Rey, California 90292-6695 + + Phone: +1 310-822-1511 + EMail: postel@isi.edu + + [] + + + + + + + + + + + + + + + + + + + + + + + + + + + +Reynolds & Postel [Page 230] + + + diff --git a/doc/rfc/rfc854.txt b/doc/rfc/rfc854.txt new file mode 100644 index 00000000..5e8c5975 --- /dev/null +++ b/doc/rfc/rfc854.txt @@ -0,0 +1,855 @@ +Network Working Group J. Postel +Request for Comments: 854 J. Reynolds + ISI +Obsoletes: NIC 18639 May 1983 + + TELNET PROTOCOL SPECIFICATION + + +This RFC specifies a standard for the ARPA Internet community. Hosts on +the ARPA Internet are expected to adopt and implement this standard. + +INTRODUCTION + + The purpose of the TELNET Protocol is to provide a fairly general, + bi-directional, eight-bit byte oriented communications facility. Its + primary goal is to allow a standard method of interfacing terminal + devices and terminal-oriented processes to each other. It is + envisioned that the protocol may also be used for terminal-terminal + communication ("linking") and process-process communication + (distributed computation). + +GENERAL CONSIDERATIONS + + A TELNET connection is a Transmission Control Protocol (TCP) + connection used to transmit data with interspersed TELNET control + information. + + The TELNET Protocol is built upon three main ideas: first, the + concept of a "Network Virtual Terminal"; second, the principle of + negotiated options; and third, a symmetric view of terminals and + processes. + + 1. When a TELNET connection is first established, each end is + assumed to originate and terminate at a "Network Virtual Terminal", + or NVT. An NVT is an imaginary device which provides a standard, + network-wide, intermediate representation of a canonical terminal. + This eliminates the need for "server" and "user" hosts to keep + information about the characteristics of each other's terminals and + terminal handling conventions. All hosts, both user and server, map + their local device characteristics and conventions so as to appear to + be dealing with an NVT over the network, and each can assume a + similar mapping by the other party. The NVT is intended to strike a + balance between being overly restricted (not providing hosts a rich + enough vocabulary for mapping into their local character sets), and + being overly inclusive (penalizing users with modest terminals). + + NOTE: The "user" host is the host to which the physical terminal + is normally attached, and the "server" host is the host which is + normally providing some service. As an alternate point of view, + + + + +Postel & Reynolds [Page 1] + + + +RFC 854 May 1983 + + + applicable even in terminal-to-terminal or process-to-process + communications, the "user" host is the host which initiated the + communication. + + 2. The principle of negotiated options takes cognizance of the fact + that many hosts will wish to provide additional services over and + above those available within an NVT, and many users will have + sophisticated terminals and would like to have elegant, rather than + minimal, services. Independent of, but structured within the TELNET + Protocol are various "options" that will be sanctioned and may be + used with the "DO, DON'T, WILL, WON'T" structure (discussed below) to + allow a user and server to agree to use a more elaborate (or perhaps + just different) set of conventions for their TELNET connection. Such + options could include changing the character set, the echo mode, etc. + + The basic strategy for setting up the use of options is to have + either party (or both) initiate a request that some option take + effect. The other party may then either accept or reject the + request. If the request is accepted the option immediately takes + effect; if it is rejected the associated aspect of the connection + remains as specified for an NVT. Clearly, a party may always refuse + a request to enable, and must never refuse a request to disable some + option since all parties must be prepared to support the NVT. + + The syntax of option negotiation has been set up so that if both + parties request an option simultaneously, each will see the other's + request as the positive acknowledgment of its own. + + 3. The symmetry of the negotiation syntax can potentially lead to + nonterminating acknowledgment loops -- each party seeing the incoming + commands not as acknowledgments but as new requests which must be + acknowledged. To prevent such loops, the following rules prevail: + + a. Parties may only request a change in option status; i.e., a + party may not send out a "request" merely to announce what mode it + is in. + + b. If a party receives what appears to be a request to enter some + mode it is already in, the request should not be acknowledged. + This non-response is essential to prevent endless loops in the + negotiation. It is required that a response be sent to requests + for a change of mode -- even if the mode is not changed. + + c. Whenever one party sends an option command to a second party, + whether as a request or an acknowledgment, and use of the option + will have any effect on the processing of the data being sent from + the first party to the second, then the command must be inserted + in the data stream at the point where it is desired that it take + + +Postel & Reynolds [Page 2] + + + +RFC 854 May 1983 + + + effect. (It should be noted that some time will elapse between + the transmission of a request and the receipt of an + acknowledgment, which may be negative. Thus, a host may wish to + buffer data, after requesting an option, until it learns whether + the request is accepted or rejected, in order to hide the + "uncertainty period" from the user.) + + Option requests are likely to flurry back and forth when a TELNET + connection is first established, as each party attempts to get the + best possible service from the other party. Beyond that, however, + options can be used to dynamically modify the characteristics of the + connection to suit changing local conditions. For example, the NVT, + as will be explained later, uses a transmission discipline well + suited to the many "line at a time" applications such as BASIC, but + poorly suited to the many "character at a time" applications such as + NLS. A server might elect to devote the extra processor overhead + required for a "character at a time" discipline when it was suitable + for the local process and would negotiate an appropriate option. + However, rather than then being permanently burdened with the extra + processing overhead, it could switch (i.e., negotiate) back to NVT + when the detailed control was no longer necessary. + + It is possible for requests initiated by processes to stimulate a + nonterminating request loop if the process responds to a rejection by + merely re-requesting the option. To prevent such loops from + occurring, rejected requests should not be repeated until something + changes. Operationally, this can mean the process is running a + different program, or the user has given another command, or whatever + makes sense in the context of the given process and the given option. + A good rule of thumb is that a re-request should only occur as a + result of subsequent information from the other end of the connection + or when demanded by local human intervention. + + Option designers should not feel constrained by the somewhat limited + syntax available for option negotiation. The intent of the simple + syntax is to make it easy to have options -- since it is + correspondingly easy to profess ignorance about them. If some + particular option requires a richer negotiation structure than + possible within "DO, DON'T, WILL, WON'T", the proper tack is to use + "DO, DON'T, WILL, WON'T" to establish that both parties understand + the option, and once this is accomplished a more exotic syntax can be + used freely. For example, a party might send a request to alter + (establish) line length. If it is accepted, then a different syntax + can be used for actually negotiating the line length -- such a + "sub-negotiation" might include fields for minimum allowable, maximum + allowable and desired line lengths. The important concept is that + + + + +Postel & Reynolds [Page 3] + + + +RFC 854 May 1983 + + + such expanded negotiations should never begin until some prior + (standard) negotiation has established that both parties are capable + of parsing the expanded syntax. + + In summary, WILL XXX is sent, by either party, to indicate that + party's desire (offer) to begin performing option XXX, DO XXX and + DON'T XXX being its positive and negative acknowledgments; similarly, + DO XXX is sent to indicate a desire (request) that the other party + (i.e., the recipient of the DO) begin performing option XXX, WILL XXX + and WON'T XXX being the positive and negative acknowledgments. Since + the NVT is what is left when no options are enabled, the DON'T and + WON'T responses are guaranteed to leave the connection in a state + which both ends can handle. Thus, all hosts may implement their + TELNET processes to be totally unaware of options that are not + supported, simply returning a rejection to (i.e., refusing) any + option request that cannot be understood. + + As much as possible, the TELNET protocol has been made server-user + symmetrical so that it easily and naturally covers the user-user + (linking) and server-server (cooperating processes) cases. It is + hoped, but not absolutely required, that options will further this + intent. In any case, it is explicitly acknowledged that symmetry is + an operating principle rather than an ironclad rule. + + A companion document, "TELNET Option Specifications," should be + consulted for information about the procedure for establishing new + options. + +THE NETWORK VIRTUAL TERMINAL + + The Network Virtual Terminal (NVT) is a bi-directional character + device. The NVT has a printer and a keyboard. The printer responds + to incoming data and the keyboard produces outgoing data which is + sent over the TELNET connection and, if "echoes" are desired, to the + NVT's printer as well. "Echoes" will not be expected to traverse the + network (although options exist to enable a "remote" echoing mode of + operation, no host is required to implement this option). The code + set is seven-bit USASCII in an eight-bit field, except as modified + herein. Any code conversion and timing considerations are local + problems and do not affect the NVT. + + TRANSMISSION OF DATA + + Although a TELNET connection through the network is intrinsically + full duplex, the NVT is to be viewed as a half-duplex device + operating in a line-buffered mode. That is, unless and until + + + + +Postel & Reynolds [Page 4] + + + +RFC 854 May 1983 + + + options are negotiated to the contrary, the following default + conditions pertain to the transmission of data over the TELNET + connection: + + 1) Insofar as the availability of local buffer space permits, + data should be accumulated in the host where it is generated + until a complete line of data is ready for transmission, or + until some locally-defined explicit signal to transmit occurs. + This signal could be generated either by a process or by a + human user. + + The motivation for this rule is the high cost, to some hosts, + of processing network input interrupts, coupled with the + default NVT specification that "echoes" do not traverse the + network. Thus, it is reasonable to buffer some amount of data + at its source. Many systems take some processing action at the + end of each input line (even line printers or card punches + frequently tend to work this way), so the transmission should + be triggered at the end of a line. On the other hand, a user + or process may sometimes find it necessary or desirable to + provide data which does not terminate at the end of a line; + therefore implementers are cautioned to provide methods of + locally signaling that all buffered data should be transmitted + immediately. + + 2) When a process has completed sending data to an NVT printer + and has no queued input from the NVT keyboard for further + processing (i.e., when a process at one end of a TELNET + connection cannot proceed without input from the other end), + the process must transmit the TELNET Go Ahead (GA) command. + + This rule is not intended to require that the TELNET GA command + be sent from a terminal at the end of each line, since server + hosts do not normally require a special signal (in addition to + end-of-line or other locally-defined characters) in order to + commence processing. Rather, the TELNET GA is designed to help + a user's local host operate a physically half duplex terminal + which has a "lockable" keyboard such as the IBM 2741. A + description of this type of terminal may help to explain the + proper use of the GA command. + + The terminal-computer connection is always under control of + either the user or the computer. Neither can unilaterally + seize control from the other; rather the controlling end must + relinguish its control explicitly. At the terminal end, the + hardware is constructed so as to relinquish control each time + that a "line" is terminated (i.e., when the "New Line" key is + typed by the user). When this occurs, the attached (local) + + +Postel & Reynolds [Page 5] + + + +RFC 854 May 1983 + + + computer processes the input data, decides if output should be + generated, and if not returns control to the terminal. If + output should be generated, control is retained by the computer + until all output has been transmitted. + + The difficulties of using this type of terminal through the + network should be obvious. The "local" computer is no longer + able to decide whether to retain control after seeing an + end-of-line signal or not; this decision can only be made by + the "remote" computer which is processing the data. Therefore, + the TELNET GA command provides a mechanism whereby the "remote" + (server) computer can signal the "local" (user) computer that + it is time to pass control to the user of the terminal. It + should be transmitted at those times, and only at those times, + when the user should be given control of the terminal. Note + that premature transmission of the GA command may result in the + blocking of output, since the user is likely to assume that the + transmitting system has paused, and therefore he will fail to + turn the line around manually. + + The foregoing, of course, does not apply to the user-to-server + direction of communication. In this direction, GAs may be sent at + any time, but need not ever be sent. Also, if the TELNET + connection is being used for process-to-process communication, GAs + need not be sent in either direction. Finally, for + terminal-to-terminal communication, GAs may be required in + neither, one, or both directions. If a host plans to support + terminal-to-terminal communication it is suggested that the host + provide the user with a means of manually signaling that it is + time for a GA to be sent over the TELNET connection; this, + however, is not a requirement on the implementer of a TELNET + process. + + Note that the symmetry of the TELNET model requires that there is + an NVT at each end of the TELNET connection, at least + conceptually. + + STANDARD REPRESENTATION OF CONTROL FUNCTIONS + + As stated in the Introduction to this document, the primary goal + of the TELNET protocol is the provision of a standard interfacing + of terminal devices and terminal-oriented processes through the + network. Early experiences with this type of interconnection have + shown that certain functions are implemented by most servers, but + that the methods of invoking these functions differ widely. For a + human user who interacts with several server systems, these + differences are highly frustrating. TELNET, therefore, defines a + standard representation for five of these functions, as described + + +Postel & Reynolds [Page 6] + + + +RFC 854 May 1983 + + + below. These standard representations have standard, but not + required, meanings (with the exception that the Interrupt Process + (IP) function may be required by other protocols which use + TELNET); that is, a system which does not provide the function to + local users need not provide it to network users and may treat the + standard representation for the function as a No-operation. On + the other hand, a system which does provide the function to a + local user is obliged to provide the same function to a network + user who transmits the standard representation for the function. + + Interrupt Process (IP) + + Many systems provide a function which suspends, interrupts, + aborts, or terminates the operation of a user process. This + function is frequently used when a user believes his process is + in an unending loop, or when an unwanted process has been + inadvertently activated. IP is the standard representation for + invoking this function. It should be noted by implementers + that IP may be required by other protocols which use TELNET, + and therefore should be implemented if these other protocols + are to be supported. + + Abort Output (AO) + + Many systems provide a function which allows a process, which + is generating output, to run to completion (or to reach the + same stopping point it would reach if running to completion) + but without sending the output to the user's terminal. + Further, this function typically clears any output already + produced but not yet actually printed (or displayed) on the + user's terminal. AO is the standard representation for + invoking this function. For example, some subsystem might + normally accept a user's command, send a long text string to + the user's terminal in response, and finally signal readiness + to accept the next command by sending a "prompt" character + (preceded by ) to the user's terminal. If the AO were + received during the transmission of the text string, a + reasonable implementation would be to suppress the remainder of + the text string, but transmit the prompt character and the + preceding . (This is possibly in distinction to the + action which might be taken if an IP were received; the IP + might cause suppression of the text string and an exit from the + subsystem.) + + It should be noted, by server systems which provide this + function, that there may be buffers external to the system (in + + + + +Postel & Reynolds [Page 7] + + + +RFC 854 May 1983 + + + the network and the user's local host) which should be cleared; + the appropriate way to do this is to transmit the "Synch" + signal (described below) to the user system. + + Are You There (AYT) + + Many systems provide a function which provides the user with + some visible (e.g., printable) evidence that the system is + still up and running. This function may be invoked by the user + when the system is unexpectedly "silent" for a long time, + because of the unanticipated (by the user) length of a + computation, an unusually heavy system load, etc. AYT is the + standard representation for invoking this function. + + Erase Character (EC) + + Many systems provide a function which deletes the last + preceding undeleted character or "print position"* from the + stream of data being supplied by the user. This function is + typically used to edit keyboard input when typing mistakes are + made. EC is the standard representation for invoking this + function. + + *NOTE: A "print position" may contain several characters + which are the result of overstrikes, or of sequences such as + BS ... + + Erase Line (EL) + + Many systems provide a function which deletes all the data in + the current "line" of input. This function is typically used + to edit keyboard input. EL is the standard representation for + invoking this function. + + THE TELNET "SYNCH" SIGNAL + + Most time-sharing systems provide mechanisms which allow a + terminal user to regain control of a "runaway" process; the IP and + AO functions described above are examples of these mechanisms. + Such systems, when used locally, have access to all of the signals + supplied by the user, whether these are normal characters or + special "out of band" signals such as those supplied by the + teletype "BREAK" key or the IBM 2741 "ATTN" key. This is not + necessarily true when terminals are connected to the system + through the network; the network's flow control mechanisms may + cause such a signal to be buffered elsewhere, for example in the + user's host. + + + +Postel & Reynolds [Page 8] + + + +RFC 854 May 1983 + + + To counter this problem, the TELNET "Synch" mechanism is + introduced. A Synch signal consists of a TCP Urgent notification, + coupled with the TELNET command DATA MARK. The Urgent + notification, which is not subject to the flow control pertaining + to the TELNET connection, is used to invoke special handling of + the data stream by the process which receives it. In this mode, + the data stream is immediately scanned for "interesting" signals + as defined below, discarding intervening data. The TELNET command + DATA MARK (DM) is the synchronizing mark in the data stream which + indicates that any special signal has already occurred and the + recipient can return to normal processing of the data stream. + + The Synch is sent via the TCP send operation with the Urgent + flag set and the DM as the last (or only) data octet. + + When several Synchs are sent in rapid succession, the Urgent + notifications may be merged. It is not possible to count Urgents + since the number received will be less than or equal the number + sent. When in normal mode, a DM is a no operation; when in urgent + mode, it signals the end of the urgent processing. + + If TCP indicates the end of Urgent data before the DM is found, + TELNET should continue the special handling of the data stream + until the DM is found. + + If TCP indicates more Urgent data after the DM is found, it can + only be because of a subsequent Synch. TELNET should continue + the special handling of the data stream until another DM is + found. + + "Interesting" signals are defined to be: the TELNET standard + representations of IP, AO, and AYT (but not EC or EL); the local + analogs of these standard representations (if any); all other + TELNET commands; other site-defined signals which can be acted on + without delaying the scan of the data stream. + + Since one effect of the SYNCH mechanism is the discarding of + essentially all characters (except TELNET commands) between the + sender of the Synch and its recipient, this mechanism is specified + as the standard way to clear the data path when that is desired. + For example, if a user at a terminal causes an AO to be + transmitted, the server which receives the AO (if it provides that + function at all) should return a Synch to the user. + + Finally, just as the TCP Urgent notification is needed at the + TELNET level as an out-of-band signal, so other protocols which + make use of TELNET may require a TELNET command which can be + viewed as an out-of-band signal at a different level. + + +Postel & Reynolds [Page 9] + + + +RFC 854 May 1983 + + + By convention the sequence [IP, Synch] is to be used as such a + signal. For example, suppose that some other protocol, which uses + TELNET, defines the character string STOP analogously to the + TELNET command AO. Imagine that a user of this protocol wishes a + server to process the STOP string, but the connection is blocked + because the server is processing other commands. The user should + instruct his system to: + + 1. Send the TELNET IP character; + + 2. Send the TELNET SYNC sequence, that is: + + Send the Data Mark (DM) as the only character + in a TCP urgent mode send operation. + + 3. Send the character string STOP; and + + 4. Send the other protocol's analog of the TELNET DM, if any. + + The user (or process acting on his behalf) must transmit the + TELNET SYNCH sequence of step 2 above to ensure that the TELNET IP + gets through to the server's TELNET interpreter. + + The Urgent should wake up the TELNET process; the IP should + wake up the next higher level process. + + THE NVT PRINTER AND KEYBOARD + + The NVT printer has an unspecified carriage width and page length + and can produce representations of all 95 USASCII graphics (codes + 32 through 126). Of the 33 USASCII control codes (0 through 31 + and 127), and the 128 uncovered codes (128 through 255), the + following have specified meaning to the NVT printer: + + NAME CODE MEANING + + NULL (NUL) 0 No Operation + Line Feed (LF) 10 Moves the printer to the + next print line, keeping the + same horizontal position. + Carriage Return (CR) 13 Moves the printer to the left + margin of the current line. + + + + + + + + +Postel & Reynolds [Page 10] + + + +RFC 854 May 1983 + + + In addition, the following codes shall have defined, but not + required, effects on the NVT printer. Neither end of a TELNET + connection may assume that the other party will take, or will + have taken, any particular action upon receipt or transmission + of these: + + BELL (BEL) 7 Produces an audible or + visible signal (which does + NOT move the print head). + Back Space (BS) 8 Moves the print head one + character position towards + the left margin. + Horizontal Tab (HT) 9 Moves the printer to the + next horizontal tab stop. + It remains unspecified how + either party determines or + establishes where such tab + stops are located. + Vertical Tab (VT) 11 Moves the printer to the + next vertical tab stop. It + remains unspecified how + either party determines or + establishes where such tab + stops are located. + Form Feed (FF) 12 Moves the printer to the top + of the next page, keeping + the same horizontal position. + + All remaining codes do not cause the NVT printer to take any + action. + + The sequence "CR LF", as defined, will cause the NVT to be + positioned at the left margin of the next print line (as would, + for example, the sequence "LF CR"). However, many systems and + terminals do not treat CR and LF independently, and will have to + go to some effort to simulate their effect. (For example, some + terminals do not have a CR independent of the LF, but on such + terminals it may be possible to simulate a CR by backspacing.) + Therefore, the sequence "CR LF" must be treated as a single "new + line" character and used whenever their combined action is + intended; the sequence "CR NUL" must be used where a carriage + return alone is actually desired; and the CR character must be + avoided in other contexts. This rule gives assurance to systems + which must decide whether to perform a "new line" function or a + multiple-backspace that the TELNET stream contains a character + following a CR that will allow a rational decision. + + Note that "CR LF" or "CR NUL" is required in both directions + + +Postel & Reynolds [Page 11] + + + +RFC 854 May 1983 + + + (in the default ASCII mode), to preserve the symmetry of the + NVT model. Even though it may be known in some situations + (e.g., with remote echo and suppress go ahead options in + effect) that characters are not being sent to an actual + printer, nonetheless, for the sake of consistency, the protocol + requires that a NUL be inserted following a CR not followed by + a LF in the data stream. The converse of this is that a NUL + received in the data stream after a CR (in the absence of + options negotiations which explicitly specify otherwise) should + be stripped out prior to applying the NVT to local character + set mapping. + + The NVT keyboard has keys, or key combinations, or key sequences, + for generating all 128 USASCII codes. Note that although many + have no effect on the NVT printer, the NVT keyboard is capable of + generating them. + + In addition to these codes, the NVT keyboard shall be capable of + generating the following additional codes which, except as noted, + have defined, but not reguired, meanings. The actual code + assignments for these "characters" are in the TELNET Command + section, because they are viewed as being, in some sense, generic + and should be available even when the data stream is interpreted + as being some other character set. + + Synch + + This key allows the user to clear his data path to the other + party. The activation of this key causes a DM (see command + section) to be sent in the data stream and a TCP Urgent + notification is associated with it. The pair DM-Urgent is to + have required meaning as defined previously. + + Break (BRK) + + This code is provided because it is a signal outside the + USASCII set which is currently given local meaning within many + systems. It is intended to indicate that the Break Key or the + Attention Key was hit. Note, however, that this is intended to + provide a 129th code for systems which require it, not as a + synonym for the IP standard representation. + + Interrupt Process (IP) + + Suspend, interrupt, abort or terminate the process to which the + NVT is connected. Also, part of the out-of-band signal for + other protocols which use TELNET. + + + +Postel & Reynolds [Page 12] + + + +RFC 854 May 1983 + + + Abort Output (AO) + + Allow the current process to (appear to) run to completion, but + do not send its output to the user. Also, send a Synch to the + user. + + Are You There (AYT) + + Send back to the NVT some visible (i.e., printable) evidence + that the AYT was received. + + Erase Character (EC) + + The recipient should delete the last preceding undeleted + character or "print position" from the data stream. + + Erase Line (EL) + + The recipient should delete characters from the data stream + back to, but not including, the last "CR LF" sequence sent over + the TELNET connection. + + The spirit of these "extra" keys, and also the printer format + effectors, is that they should represent a natural extension of + the mapping that already must be done from "NVT" into "local". + Just as the NVT data byte 68 (104 octal) should be mapped into + whatever the local code for "uppercase D" is, so the EC character + should be mapped into whatever the local "Erase Character" + function is. Further, just as the mapping for 124 (174 octal) is + somewhat arbitrary in an environment that has no "vertical bar" + character, the EL character may have a somewhat arbitrary mapping + (or none at all) if there is no local "Erase Line" facility. + Similarly for format effectors: if the terminal actually does + have a "Vertical Tab", then the mapping for VT is obvious, and + only when the terminal does not have a vertical tab should the + effect of VT be unpredictable. + +TELNET COMMAND STRUCTURE + + All TELNET commands consist of at least a two byte sequence: the + "Interpret as Command" (IAC) escape character followed by the code + for the command. The commands dealing with option negotiation are + three byte sequences, the third byte being the code for the option + referenced. This format was chosen so that as more comprehensive use + of the "data space" is made -- by negotiations from the basic NVT, of + course -- collisions of data bytes with reserved command values will + be minimized, all such collisions requiring the inconvenience, and + + + +Postel & Reynolds [Page 13] + + + +RFC 854 May 1983 + + + inefficiency, of "escaping" the data bytes into the stream. With the + current set-up, only the IAC need be doubled to be sent as data, and + the other 255 codes may be passed transparently. + + The following are the defined TELNET commands. Note that these codes + and code sequences have the indicated meaning only when immediately + preceded by an IAC. + + NAME CODE MEANING + + SE 240 End of subnegotiation parameters. + NOP 241 No operation. + Data Mark 242 The data stream portion of a Synch. + This should always be accompanied + by a TCP Urgent notification. + Break 243 NVT character BRK. + Interrupt Process 244 The function IP. + Abort output 245 The function AO. + Are You There 246 The function AYT. + Erase character 247 The function EC. + Erase Line 248 The function EL. + Go ahead 249 The GA signal. + SB 250 Indicates that what follows is + subnegotiation of the indicated + option. + WILL (option code) 251 Indicates the desire to begin + performing, or confirmation that + you are now performing, the + indicated option. + WON'T (option code) 252 Indicates the refusal to perform, + or continue performing, the + indicated option. + DO (option code) 253 Indicates the request that the + other party perform, or + confirmation that you are expecting + the other party to perform, the + indicated option. + DON'T (option code) 254 Indicates the demand that the + other party stop performing, + or confirmation that you are no + longer expecting the other party + to perform, the indicated option. + IAC 255 Data Byte 255. + + + + + + + +Postel & Reynolds [Page 14] + + + +RFC 854 May 1983 + + +CONNECTION ESTABLISHMENT + + The TELNET TCP connection is established between the user's port U + and the server's port L. The server listens on its well known port L + for such connections. Since a TCP connection is full duplex and + identified by the pair of ports, the server can engage in many + simultaneous connections involving its port L and different user + ports U. + + Port Assignment + + When used for remote user access to service hosts (i.e., remote + terminal access) this protocol is assigned server port 23 + (27 octal). That is L=23. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 15] + + + diff --git a/doc/rfc/std5.txt b/doc/rfc/std5.txt new file mode 100644 index 00000000..e32de917 --- /dev/null +++ b/doc/rfc/std5.txt @@ -0,0 +1,7227 @@ + +RFC: 791 + + + + + + + + INTERNET PROTOCOL + + + DARPA INTERNET PROGRAM + + PROTOCOL SPECIFICATION + + + + September 1981 + + + + + + + + + + + + + + prepared for + + Defense Advanced Research Projects Agency + Information Processing Techniques Office + 1400 Wilson Boulevard + Arlington, Virginia 22209 + + + + + + + + by + + Information Sciences Institute + University of Southern California + 4676 Admiralty Way + Marina del Rey, California 90291 + + + +September 1981 + Internet Protocol + + + + TABLE OF CONTENTS + + PREFACE ........................................................ iii + +1. INTRODUCTION ..................................................... 1 + + 1.1 Motivation .................................................... 1 + 1.2 Scope ......................................................... 1 + 1.3 Interfaces .................................................... 1 + 1.4 Operation ..................................................... 2 + +2. OVERVIEW ......................................................... 5 + + 2.1 Relation to Other Protocols ................................... 9 + 2.2 Model of Operation ............................................ 5 + 2.3 Function Description .......................................... 7 + 2.4 Gateways ...................................................... 9 + +3. SPECIFICATION ................................................... 11 + + 3.1 Internet Header Format ....................................... 11 + 3.2 Discussion ................................................... 23 + 3.3 Interfaces ................................................... 31 + +APPENDIX A: Examples & Scenarios ................................... 34 +APPENDIX B: Data Transmission Order ................................ 39 + +GLOSSARY ............................................................ 41 + +REFERENCES .......................................................... 45 + + + + + + + + + + + + + + + + + + + + + + [Page i] + + + September 1981 +Internet Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page ii] + + +September 1981 + Internet Protocol + + + + PREFACE + + + +This document specifies the DoD Standard Internet Protocol. This +document is based on six earlier editions of the ARPA Internet Protocol +Specification, and the present text draws heavily from them. There have +been many contributors to this work both in terms of concepts and in +terms of text. This edition revises aspects of addressing, error +handling, option codes, and the security, precedence, compartments, and +handling restriction features of the internet protocol. + + Jon Postel + + Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page iii] + + + + September 1981 + + +RFC: 791 +Replaces: RFC 760 +IENs 128, 123, 111, +80, 54, 44, 41, 28, 26 + + INTERNET PROTOCOL + + DARPA INTERNET PROGRAM + PROTOCOL SPECIFICATION + + + + 1. INTRODUCTION + +1.1. Motivation + + The Internet Protocol is designed for use in interconnected systems of + packet-switched computer communication networks. Such a system has + been called a "catenet" [1]. The internet protocol provides for + transmitting blocks of data called datagrams from sources to + destinations, where sources and destinations are hosts identified by + fixed length addresses. The internet protocol also provides for + fragmentation and reassembly of long datagrams, if necessary, for + transmission through "small packet" networks. + +1.2. Scope + + The internet protocol is specifically limited in scope to provide the + functions necessary to deliver a package of bits (an internet + datagram) from a source to a destination over an interconnected system + of networks. There are no mechanisms to augment end-to-end data + reliability, flow control, sequencing, or other services commonly + found in host-to-host protocols. The internet protocol can capitalize + on the services of its supporting networks to provide various types + and qualities of service. + +1.3. Interfaces + + This protocol is called on by host-to-host protocols in an internet + environment. This protocol calls on local network protocols to carry + the internet datagram to the next gateway or destination host. + + For example, a TCP module would call on the internet module to take a + TCP segment (including the TCP header and user data) as the data + portion of an internet datagram. The TCP module would provide the + addresses and other parameters in the internet header to the internet + module as arguments of the call. The internet module would then + create an internet datagram and call on the local network interface to + transmit the internet datagram. + + In the ARPANET case, for example, the internet module would call on a + + + [Page 1] + + + September 1981 +Internet Protocol +Introduction + + + + local net module which would add the 1822 leader [2] to the internet + datagram creating an ARPANET message to transmit to the IMP. The + ARPANET address would be derived from the internet address by the + local network interface and would be the address of some host in the + ARPANET, that host might be a gateway to other networks. + +1.4. Operation + + The internet protocol implements two basic functions: addressing and + fragmentation. + + The internet modules use the addresses carried in the internet header + to transmit internet datagrams toward their destinations. The + selection of a path for transmission is called routing. + + The internet modules use fields in the internet header to fragment and + reassemble internet datagrams when necessary for transmission through + "small packet" networks. + + The model of operation is that an internet module resides in each host + engaged in internet communication and in each gateway that + interconnects networks. These modules share common rules for + interpreting address fields and for fragmenting and assembling + internet datagrams. In addition, these modules (especially in + gateways) have procedures for making routing decisions and other + functions. + + The internet protocol treats each internet datagram as an independent + entity unrelated to any other internet datagram. There are no + connections or logical circuits (virtual or otherwise). + + The internet protocol uses four key mechanisms in providing its + service: Type of Service, Time to Live, Options, and Header Checksum. + + The Type of Service is used to indicate the quality of the service + desired. The type of service is an abstract or generalized set of + parameters which characterize the service choices provided in the + networks that make up the internet. This type of service indication + is to be used by gateways to select the actual transmission parameters + for a particular network, the network to be used for the next hop, or + the next gateway when routing an internet datagram. + + The Time to Live is an indication of an upper bound on the lifetime of + an internet datagram. It is set by the sender of the datagram and + reduced at the points along the route where it is processed. If the + time to live reaches zero before the internet datagram reaches its + destination, the internet datagram is destroyed. The time to live can + be thought of as a self destruct time limit. + + +[Page 2] + + +September 1981 + Internet Protocol + Introduction + + + + The Options provide for control functions needed or useful in some + situations but unnecessary for the most common communications. The + options include provisions for timestamps, security, and special + routing. + + The Header Checksum provides a verification that the information used + in processing internet datagram has been transmitted correctly. The + data may contain errors. If the header checksum fails, the internet + datagram is discarded at once by the entity which detects the error. + + The internet protocol does not provide a reliable communication + facility. There are no acknowledgments either end-to-end or + hop-by-hop. There is no error control for data, only a header + checksum. There are no retransmissions. There is no flow control. + + Errors detected may be reported via the Internet Control Message + Protocol (ICMP) [3] which is implemented in the internet protocol + module. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 3] + + + September 1981 +Internet Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 4] + + +September 1981 + Internet Protocol + + + + 2. OVERVIEW + +2.1. Relation to Other Protocols + + The following diagram illustrates the place of the internet protocol + in the protocol hierarchy: + + + +------+ +-----+ +-----+ +-----+ + |Telnet| | FTP | | TFTP| ... | ... | + +------+ +-----+ +-----+ +-----+ + | | | | + +-----+ +-----+ +-----+ + | TCP | | UDP | ... | ... | + +-----+ +-----+ +-----+ + | | | + +--------------------------+----+ + | Internet Protocol & ICMP | + +--------------------------+----+ + | + +---------------------------+ + | Local Network Protocol | + +---------------------------+ + + Protocol Relationships + + Figure 1. + + Internet protocol interfaces on one side to the higher level + host-to-host protocols and on the other side to the local network + protocol. In this context a "local network" may be a small network in + a building or a large network such as the ARPANET. + +2.2. Model of Operation + + The model of operation for transmitting a datagram from one + application program to another is illustrated by the following + scenario: + + We suppose that this transmission will involve one intermediate + gateway. + + The sending application program prepares its data and calls on its + local internet module to send that data as a datagram and passes the + destination address and other parameters as arguments of the call. + + The internet module prepares a datagram header and attaches the data + to it. The internet module determines a local network address for + this internet address, in this case it is the address of a gateway. + + + [Page 5] + + + September 1981 +Internet Protocol +Overview + + + + It sends this datagram and the local network address to the local + network interface. + + The local network interface creates a local network header, and + attaches the datagram to it, then sends the result via the local + network. + + The datagram arrives at a gateway host wrapped in the local network + header, the local network interface strips off this header, and + turns the datagram over to the internet module. The internet module + determines from the internet address that the datagram is to be + forwarded to another host in a second network. The internet module + determines a local net address for the destination host. It calls + on the local network interface for that network to send the + datagram. + + This local network interface creates a local network header and + attaches the datagram sending the result to the destination host. + + At this destination host the datagram is stripped of the local net + header by the local network interface and handed to the internet + module. + + The internet module determines that the datagram is for an + application program in this host. It passes the data to the + application program in response to a system call, passing the source + address and other parameters as results of the call. + + + Application Application + Program Program + \ / + Internet Module Internet Module Internet Module + \ / \ / + LNI-1 LNI-1 LNI-2 LNI-2 + \ / \ / + Local Network 1 Local Network 2 + + + + Transmission Path + + Figure 2 + + + + + + + +[Page 6] + + +September 1981 + Internet Protocol + Overview + + + +2.3. Function Description + + The function or purpose of Internet Protocol is to move datagrams + through an interconnected set of networks. This is done by passing + the datagrams from one internet module to another until the + destination is reached. The internet modules reside in hosts and + gateways in the internet system. The datagrams are routed from one + internet module to another through individual networks based on the + interpretation of an internet address. Thus, one important mechanism + of the internet protocol is the internet address. + + In the routing of messages from one internet module to another, + datagrams may need to traverse a network whose maximum packet size is + smaller than the size of the datagram. To overcome this difficulty, a + fragmentation mechanism is provided in the internet protocol. + + Addressing + + A distinction is made between names, addresses, and routes [4]. A + name indicates what we seek. An address indicates where it is. A + route indicates how to get there. The internet protocol deals + primarily with addresses. It is the task of higher level (i.e., + host-to-host or application) protocols to make the mapping from + names to addresses. The internet module maps internet addresses to + local net addresses. It is the task of lower level (i.e., local net + or gateways) procedures to make the mapping from local net addresses + to routes. + + Addresses are fixed length of four octets (32 bits). An address + begins with a network number, followed by local address (called the + "rest" field). There are three formats or classes of internet + addresses: in class a, the high order bit is zero, the next 7 bits + are the network, and the last 24 bits are the local address; in + class b, the high order two bits are one-zero, the next 14 bits are + the network and the last 16 bits are the local address; in class c, + the high order three bits are one-one-zero, the next 21 bits are the + network and the last 8 bits are the local address. + + Care must be taken in mapping internet addresses to local net + addresses; a single physical host must be able to act as if it were + several distinct hosts to the extent of using several distinct + internet addresses. Some hosts will also have several physical + interfaces (multi-homing). + + That is, provision must be made for a host to have several physical + interfaces to the network with each having several logical internet + addresses. + + + + [Page 7] + + + September 1981 +Internet Protocol +Overview + + + + Examples of address mappings may be found in "Address Mappings" [5]. + + Fragmentation + + Fragmentation of an internet datagram is necessary when it + originates in a local net that allows a large packet size and must + traverse a local net that limits packets to a smaller size to reach + its destination. + + An internet datagram can be marked "don't fragment." Any internet + datagram so marked is not to be internet fragmented under any + circumstances. If internet datagram marked don't fragment cannot be + delivered to its destination without fragmenting it, it is to be + discarded instead. + + Fragmentation, transmission and reassembly across a local network + which is invisible to the internet protocol module is called + intranet fragmentation and may be used [6]. + + The internet fragmentation and reassembly procedure needs to be able + to break a datagram into an almost arbitrary number of pieces that + can be later reassembled. The receiver of the fragments uses the + identification field to ensure that fragments of different datagrams + are not mixed. The fragment offset field tells the receiver the + position of a fragment in the original datagram. The fragment + offset and length determine the portion of the original datagram + covered by this fragment. The more-fragments flag indicates (by + being reset) the last fragment. These fields provide sufficient + information to reassemble datagrams. + + The identification field is used to distinguish the fragments of one + datagram from those of another. The originating protocol module of + an internet datagram sets the identification field to a value that + must be unique for that source-destination pair and protocol for the + time the datagram will be active in the internet system. The + originating protocol module of a complete datagram sets the + more-fragments flag to zero and the fragment offset to zero. + + To fragment a long internet datagram, an internet protocol module + (for example, in a gateway), creates two new internet datagrams and + copies the contents of the internet header fields from the long + datagram into both new internet headers. The data of the long + datagram is divided into two portions on a 8 octet (64 bit) boundary + (the second portion might not be an integral multiple of 8 octets, + but the first must be). Call the number of 8 octet blocks in the + first portion NFB (for Number of Fragment Blocks). The first + portion of the data is placed in the first new internet datagram, + and the total length field is set to the length of the first + + +[Page 8] + + +September 1981 + Internet Protocol + Overview + + + + datagram. The more-fragments flag is set to one. The second + portion of the data is placed in the second new internet datagram, + and the total length field is set to the length of the second + datagram. The more-fragments flag carries the same value as the + long datagram. The fragment offset field of the second new internet + datagram is set to the value of that field in the long datagram plus + NFB. + + This procedure can be generalized for an n-way split, rather than + the two-way split described. + + To assemble the fragments of an internet datagram, an internet + protocol module (for example at a destination host) combines + internet datagrams that all have the same value for the four fields: + identification, source, destination, and protocol. The combination + is done by placing the data portion of each fragment in the relative + position indicated by the fragment offset in that fragment's + internet header. The first fragment will have the fragment offset + zero, and the last fragment will have the more-fragments flag reset + to zero. + +2.4. Gateways + + Gateways implement internet protocol to forward datagrams between + networks. Gateways also implement the Gateway to Gateway Protocol + (GGP) [7] to coordinate routing and other internet control + information. + + In a gateway the higher level protocols need not be implemented and + the GGP functions are added to the IP module. + + + +-------------------------------+ + | Internet Protocol & ICMP & GGP| + +-------------------------------+ + | | + +---------------+ +---------------+ + | Local Net | | Local Net | + +---------------+ +---------------+ + + Gateway Protocols + + Figure 3. + + + + + + + + [Page 9] + + + September 1981 +Internet Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 10] + + +September 1981 + Internet Protocol + + + + 3. SPECIFICATION + +3.1. Internet Header Format + + A summary of the contents of the internet header follows: + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Version| IHL |Type of Service| Total Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification |Flags| Fragment Offset | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time to Live | Protocol | Header Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Source Address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Destination Address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Options | Padding | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Example Internet Datagram Header + + Figure 4. + + Note that each tick mark represents one bit position. + + Version: 4 bits + + The Version field indicates the format of the internet header. This + document describes version 4. + + IHL: 4 bits + + Internet Header Length is the length of the internet header in 32 + bit words, and thus points to the beginning of the data. Note that + the minimum value for a correct header is 5. + + + + + + + + + + + + + [Page 11] + + + September 1981 +Internet Protocol +Specification + + + + Type of Service: 8 bits + + The Type of Service provides an indication of the abstract + parameters of the quality of service desired. These parameters are + to be used to guide the selection of the actual service parameters + when transmitting a datagram through a particular network. Several + networks offer service precedence, which somehow treats high + precedence traffic as more important than other traffic (generally + by accepting only traffic above a certain precedence at time of high + load). The major choice is a three way tradeoff between low-delay, + high-reliability, and high-throughput. + + Bits 0-2: Precedence. + Bit 3: 0 = Normal Delay, 1 = Low Delay. + Bits 4: 0 = Normal Throughput, 1 = High Throughput. + Bits 5: 0 = Normal Relibility, 1 = High Relibility. + Bit 6-7: Reserved for Future Use. + + 0 1 2 3 4 5 6 7 + +-----+-----+-----+-----+-----+-----+-----+-----+ + | | | | | | | + | PRECEDENCE | D | T | R | 0 | 0 | + | | | | | | | + +-----+-----+-----+-----+-----+-----+-----+-----+ + + Precedence + + 111 - Network Control + 110 - Internetwork Control + 101 - CRITIC/ECP + 100 - Flash Override + 011 - Flash + 010 - Immediate + 001 - Priority + 000 - Routine + + The use of the Delay, Throughput, and Reliability indications may + increase the cost (in some sense) of the service. In many networks + better performance for one of these parameters is coupled with worse + performance on another. Except for very unusual cases at most two + of these three indications should be set. + + The type of service is used to specify the treatment of the datagram + during its transmission through the internet system. Example + mappings of the internet type of service to the actual service + provided on networks such as AUTODIN II, ARPANET, SATNET, and PRNET + is given in "Service Mappings" [8]. + + + +[Page 12] + + +September 1981 + Internet Protocol + Specification + + + + The Network Control precedence designation is intended to be used + within a network only. The actual use and control of that + designation is up to each network. The Internetwork Control + designation is intended for use by gateway control originators only. + If the actual use of these precedence designations is of concern to + a particular network, it is the responsibility of that network to + control the access to, and use of, those precedence designations. + + Total Length: 16 bits + + Total Length is the length of the datagram, measured in octets, + including internet header and data. This field allows the length of + a datagram to be up to 65,535 octets. Such long datagrams are + impractical for most hosts and networks. All hosts must be prepared + to accept datagrams of up to 576 octets (whether they arrive whole + or in fragments). It is recommended that hosts only send datagrams + larger than 576 octets if they have assurance that the destination + is prepared to accept the larger datagrams. + + The number 576 is selected to allow a reasonable sized data block to + be transmitted in addition to the required header information. For + example, this size allows a data block of 512 octets plus 64 header + octets to fit in a datagram. The maximal internet header is 60 + octets, and a typical internet header is 20 octets, allowing a + margin for headers of higher level protocols. + + Identification: 16 bits + + An identifying value assigned by the sender to aid in assembling the + fragments of a datagram. + + Flags: 3 bits + + Various Control Flags. + + Bit 0: reserved, must be zero + Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment. + Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments. + + 0 1 2 + +---+---+---+ + | | D | M | + | 0 | F | F | + +---+---+---+ + + Fragment Offset: 13 bits + + This field indicates where in the datagram this fragment belongs. + + + [Page 13] + + + September 1981 +Internet Protocol +Specification + + + + The fragment offset is measured in units of 8 octets (64 bits). The + first fragment has offset zero. + + Time to Live: 8 bits + + This field indicates the maximum time the datagram is allowed to + remain in the internet system. If this field contains the value + zero, then the datagram must be destroyed. This field is modified + in internet header processing. The time is measured in units of + seconds, but since every module that processes a datagram must + decrease the TTL by at least one even if it process the datagram in + less than a second, the TTL must be thought of only as an upper + bound on the time a datagram may exist. The intention is to cause + undeliverable datagrams to be discarded, and to bound the maximum + datagram lifetime. + + Protocol: 8 bits + + This field indicates the next level protocol used in the data + portion of the internet datagram. The values for various protocols + are specified in "Assigned Numbers" [9]. + + Header Checksum: 16 bits + + A checksum on the header only. Since some header fields change + (e.g., time to live), this is recomputed and verified at each point + that the internet header is processed. + + The checksum algorithm is: + + The checksum field is the 16 bit one's complement of the one's + complement sum of all 16 bit words in the header. For purposes of + computing the checksum, the value of the checksum field is zero. + + This is a simple to compute checksum and experimental evidence + indicates it is adequate, but it is provisional and may be replaced + by a CRC procedure, depending on further experience. + + Source Address: 32 bits + + The source address. See section 3.2. + + Destination Address: 32 bits + + The destination address. See section 3.2. + + + + + +[Page 14] + + +September 1981 + Internet Protocol + Specification + + + + Options: variable + + The options may appear or not in datagrams. They must be + implemented by all IP modules (host and gateways). What is optional + is their transmission in any particular datagram, not their + implementation. + + In some environments the security option may be required in all + datagrams. + + The option field is variable in length. There may be zero or more + options. There are two cases for the format of an option: + + Case 1: A single octet of option-type. + + Case 2: An option-type octet, an option-length octet, and the + actual option-data octets. + + The option-length octet counts the option-type octet and the + option-length octet as well as the option-data octets. + + The option-type octet is viewed as having 3 fields: + + 1 bit copied flag, + 2 bits option class, + 5 bits option number. + + The copied flag indicates that this option is copied into all + fragments on fragmentation. + + 0 = not copied + 1 = copied + + The option classes are: + + 0 = control + 1 = reserved for future use + 2 = debugging and measurement + 3 = reserved for future use + + + + + + + + + + + + [Page 15] + + + September 1981 +Internet Protocol +Specification + + + + The following internet options are defined: + + CLASS NUMBER LENGTH DESCRIPTION + ----- ------ ------ ----------- + 0 0 - End of Option list. This option occupies only + 1 octet; it has no length octet. + 0 1 - No Operation. This option occupies only 1 + octet; it has no length octet. + 0 2 11 Security. Used to carry Security, + Compartmentation, User Group (TCC), and + Handling Restriction Codes compatible with DOD + requirements. + 0 3 var. Loose Source Routing. Used to route the + internet datagram based on information + supplied by the source. + 0 9 var. Strict Source Routing. Used to route the + internet datagram based on information + supplied by the source. + 0 7 var. Record Route. Used to trace the route an + internet datagram takes. + 0 8 4 Stream ID. Used to carry the stream + identifier. + 2 4 var. Internet Timestamp. + + + + Specific Option Definitions + + End of Option List + + +--------+ + |00000000| + +--------+ + Type=0 + + This option indicates the end of the option list. This might + not coincide with the end of the internet header according to + the internet header length. This is used at the end of all + options, not the end of each option, and need only be used if + the end of the options would not otherwise coincide with the end + of the internet header. + + May be copied, introduced, or deleted on fragmentation, or for + any other reason. + + + + + + +[Page 16] + + +September 1981 + Internet Protocol + Specification + + + + No Operation + + +--------+ + |00000001| + +--------+ + Type=1 + + This option may be used between options, for example, to align + the beginning of a subsequent option on a 32 bit boundary. + + May be copied, introduced, or deleted on fragmentation, or for + any other reason. + + Security + + This option provides a way for hosts to send security, + compartmentation, handling restrictions, and TCC (closed user + group) parameters. The format for this option is as follows: + + +--------+--------+---//---+---//---+---//---+---//---+ + |10000010|00001011|SSS SSS|CCC CCC|HHH HHH| TCC | + +--------+--------+---//---+---//---+---//---+---//---+ + Type=130 Length=11 + + Security (S field): 16 bits + + Specifies one of 16 levels of security (eight of which are + reserved for future use). + + 00000000 00000000 - Unclassified + 11110001 00110101 - Confidential + 01111000 10011010 - EFTO + 10111100 01001101 - MMMM + 01011110 00100110 - PROG + 10101111 00010011 - Restricted + 11010111 10001000 - Secret + 01101011 11000101 - Top Secret + 00110101 11100010 - (Reserved for future use) + 10011010 11110001 - (Reserved for future use) + 01001101 01111000 - (Reserved for future use) + 00100100 10111101 - (Reserved for future use) + 00010011 01011110 - (Reserved for future use) + 10001001 10101111 - (Reserved for future use) + 11000100 11010110 - (Reserved for future use) + 11100010 01101011 - (Reserved for future use) + + + + + + [Page 17] + + + September 1981 +Internet Protocol +Specification + + + + Compartments (C field): 16 bits + + An all zero value is used when the information transmitted is + not compartmented. Other values for the compartments field + may be obtained from the Defense Intelligence Agency. + + Handling Restrictions (H field): 16 bits + + The values for the control and release markings are + alphanumeric digraphs and are defined in the Defense + Intelligence Agency Manual DIAM 65-19, "Standard Security + Markings". + + Transmission Control Code (TCC field): 24 bits + + Provides a means to segregate traffic and define controlled + communities of interest among subscribers. The TCC values are + trigraphs, and are available from HQ DCA Code 530. + + Must be copied on fragmentation. This option appears at most + once in a datagram. + + Loose Source and Record Route + + +--------+--------+--------+---------//--------+ + |10000011| length | pointer| route data | + +--------+--------+--------+---------//--------+ + Type=131 + + The loose source and record route (LSRR) option provides a means + for the source of an internet datagram to supply routing + information to be used by the gateways in forwarding the + datagram to the destination, and to record the route + information. + + The option begins with the option type code. The second octet + is the option length which includes the option type code and the + length octet, the pointer octet, and length-3 octets of route + data. The third octet is the pointer into the route data + indicating the octet which begins the next source address to be + processed. The pointer is relative to this option, and the + smallest legal value for the pointer is 4. + + A route data is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. If the pointer is + greater than the length, the source route is empty (and the + recorded route full) and the routing is to be based on the + destination address field. + + +[Page 18] + + +September 1981 + Internet Protocol + Specification + + + + If the address in destination address field has been reached and + the pointer is not greater than the length, the next address in + the source route replaces the address in the destination address + field, and the recorded route address replaces the source + address just used, and pointer is increased by four. + + The recorded route address is the internet module's own internet + address as known in the environment into which this datagram is + being forwarded. + + This procedure of replacing the source route with the recorded + route (though it is in the reverse of the order it must be in to + be used as a source route) means the option (and the IP header + as a whole) remains a constant length as the datagram progresses + through the internet. + + This option is a loose source route because the gateway or host + IP is allowed to use any route of any number of other + intermediate gateways to reach the next address in the route. + + Must be copied on fragmentation. Appears at most once in a + datagram. + + Strict Source and Record Route + + +--------+--------+--------+---------//--------+ + |10001001| length | pointer| route data | + +--------+--------+--------+---------//--------+ + Type=137 + + The strict source and record route (SSRR) option provides a + means for the source of an internet datagram to supply routing + information to be used by the gateways in forwarding the + datagram to the destination, and to record the route + information. + + The option begins with the option type code. The second octet + is the option length which includes the option type code and the + length octet, the pointer octet, and length-3 octets of route + data. The third octet is the pointer into the route data + indicating the octet which begins the next source address to be + processed. The pointer is relative to this option, and the + smallest legal value for the pointer is 4. + + A route data is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. If the pointer is + greater than the length, the source route is empty (and the + + + + [Page 19] + + + September 1981 +Internet Protocol +Specification + + + + recorded route full) and the routing is to be based on the + destination address field. + + If the address in destination address field has been reached and + the pointer is not greater than the length, the next address in + the source route replaces the address in the destination address + field, and the recorded route address replaces the source + address just used, and pointer is increased by four. + + The recorded route address is the internet module's own internet + address as known in the environment into which this datagram is + being forwarded. + + This procedure of replacing the source route with the recorded + route (though it is in the reverse of the order it must be in to + be used as a source route) means the option (and the IP header + as a whole) remains a constant length as the datagram progresses + through the internet. + + This option is a strict source route because the gateway or host + IP must send the datagram directly to the next address in the + source route through only the directly connected network + indicated in the next address to reach the next gateway or host + specified in the route. + + Must be copied on fragmentation. Appears at most once in a + datagram. + + Record Route + + +--------+--------+--------+---------//--------+ + |00000111| length | pointer| route data | + +--------+--------+--------+---------//--------+ + Type=7 + + The record route option provides a means to record the route of + an internet datagram. + + The option begins with the option type code. The second octet + is the option length which includes the option type code and the + length octet, the pointer octet, and length-3 octets of route + data. The third octet is the pointer into the route data + indicating the octet which begins the next area to store a route + address. The pointer is relative to this option, and the + smallest legal value for the pointer is 4. + + A recorded route is composed of a series of internet addresses. + Each internet address is 32 bits or 4 octets. If the pointer is + + +[Page 20] + + +September 1981 + Internet Protocol + Specification + + + + greater than the length, the recorded route data area is full. + The originating host must compose this option with a large + enough route data area to hold all the address expected. The + size of the option does not change due to adding addresses. The + intitial contents of the route data area must be zero. + + When an internet module routes a datagram it checks to see if + the record route option is present. If it is, it inserts its + own internet address as known in the environment into which this + datagram is being forwarded into the recorded route begining at + the octet indicated by the pointer, and increments the pointer + by four. + + If the route data area is already full (the pointer exceeds the + length) the datagram is forwarded without inserting the address + into the recorded route. If there is some room but not enough + room for a full address to be inserted, the original datagram is + considered to be in error and is discarded. In either case an + ICMP parameter problem message may be sent to the source + host [3]. + + Not copied on fragmentation, goes in first fragment only. + Appears at most once in a datagram. + + Stream Identifier + + +--------+--------+--------+--------+ + |10001000|00000010| Stream ID | + +--------+--------+--------+--------+ + Type=136 Length=4 + + This option provides a way for the 16-bit SATNET stream + identifier to be carried through networks that do not support + the stream concept. + + Must be copied on fragmentation. Appears at most once in a + datagram. + + + + + + + + + + + + + + [Page 21] + + + September 1981 +Internet Protocol +Specification + + + + Internet Timestamp + + +--------+--------+--------+--------+ + |01000100| length | pointer|oflw|flg| + +--------+--------+--------+--------+ + | internet address | + +--------+--------+--------+--------+ + | timestamp | + +--------+--------+--------+--------+ + | . | + . + . + Type = 68 + + The Option Length is the number of octets in the option counting + the type, length, pointer, and overflow/flag octets (maximum + length 40). + + The Pointer is the number of octets from the beginning of this + option to the end of timestamps plus one (i.e., it points to the + octet beginning the space for next timestamp). The smallest + legal value is 5. The timestamp area is full when the pointer + is greater than the length. + + The Overflow (oflw) [4 bits] is the number of IP modules that + cannot register timestamps due to lack of space. + + The Flag (flg) [4 bits] values are + + 0 -- time stamps only, stored in consecutive 32-bit words, + + 1 -- each timestamp is preceded with internet address of the + registering entity, + + 3 -- the internet address fields are prespecified. An IP + module only registers its timestamp if it matches its own + address with the next specified internet address. + + The Timestamp is a right-justified, 32-bit timestamp in + milliseconds since midnight UT. If the time is not available in + milliseconds or cannot be provided with respect to midnight UT + then any time may be inserted as a timestamp provided the high + order bit of the timestamp field is set to one to indicate the + use of a non-standard value. + + The originating host must compose this option with a large + enough timestamp data area to hold all the timestamp information + expected. The size of the option does not change due to adding + + +[Page 22] + + +September 1981 + Internet Protocol + Specification + + + + timestamps. The intitial contents of the timestamp data area + must be zero or internet address/zero pairs. + + If the timestamp data area is already full (the pointer exceeds + the length) the datagram is forwarded without inserting the + timestamp, but the overflow count is incremented by one. + + If there is some room but not enough room for a full timestamp + to be inserted, or the overflow count itself overflows, the + original datagram is considered to be in error and is discarded. + In either case an ICMP parameter problem message may be sent to + the source host [3]. + + The timestamp option is not copied upon fragmentation. It is + carried in the first fragment. Appears at most once in a + datagram. + + Padding: variable + + The internet header padding is used to ensure that the internet + header ends on a 32 bit boundary. The padding is zero. + +3.2. Discussion + + The implementation of a protocol must be robust. Each implementation + must expect to interoperate with others created by different + individuals. While the goal of this specification is to be explicit + about the protocol there is the possibility of differing + interpretations. In general, an implementation must be conservative + in its sending behavior, and liberal in its receiving behavior. That + is, it must be careful to send well-formed datagrams, but must accept + any datagram that it can interpret (e.g., not object to technical + errors where the meaning is still clear). + + The basic internet service is datagram oriented and provides for the + fragmentation of datagrams at gateways, with reassembly taking place + at the destination internet protocol module in the destination host. + Of course, fragmentation and reassembly of datagrams within a network + or by private agreement between the gateways of a network is also + allowed since this is transparent to the internet protocols and the + higher-level protocols. This transparent type of fragmentation and + reassembly is termed "network-dependent" (or intranet) fragmentation + and is not discussed further here. + + Internet addresses distinguish sources and destinations to the host + level and provide a protocol field as well. It is assumed that each + protocol will provide for whatever multiplexing is necessary within a + host. + + + [Page 23] + + + September 1981 +Internet Protocol +Specification + + + + Addressing + + To provide for flexibility in assigning address to networks and + allow for the large number of small to intermediate sized networks + the interpretation of the address field is coded to specify a small + number of networks with a large number of host, a moderate number of + networks with a moderate number of hosts, and a large number of + networks with a small number of hosts. In addition there is an + escape code for extended addressing mode. + + Address Formats: + + High Order Bits Format Class + --------------- ------------------------------- ----- + 0 7 bits of net, 24 bits of host a + 10 14 bits of net, 16 bits of host b + 110 21 bits of net, 8 bits of host c + 111 escape to extended addressing mode + + A value of zero in the network field means this network. This is + only used in certain ICMP messages. The extended addressing mode + is undefined. Both of these features are reserved for future use. + + The actual values assigned for network addresses is given in + "Assigned Numbers" [9]. + + The local address, assigned by the local network, must allow for a + single physical host to act as several distinct internet hosts. + That is, there must be a mapping between internet host addresses and + network/host interfaces that allows several internet addresses to + correspond to one interface. It must also be allowed for a host to + have several physical interfaces and to treat the datagrams from + several of them as if they were all addressed to a single host. + + Address mappings between internet addresses and addresses for + ARPANET, SATNET, PRNET, and other networks are described in "Address + Mappings" [5]. + + Fragmentation and Reassembly. + + The internet identification field (ID) is used together with the + source and destination address, and the protocol fields, to identify + datagram fragments for reassembly. + + The More Fragments flag bit (MF) is set if the datagram is not the + last fragment. The Fragment Offset field identifies the fragment + location, relative to the beginning of the original unfragmented + datagram. Fragments are counted in units of 8 octets. The + + +[Page 24] + + +September 1981 + Internet Protocol + Specification + + + + fragmentation strategy is designed so than an unfragmented datagram + has all zero fragmentation information (MF = 0, fragment offset = + 0). If an internet datagram is fragmented, its data portion must be + broken on 8 octet boundaries. + + This format allows 2**13 = 8192 fragments of 8 octets each for a + total of 65,536 octets. Note that this is consistent with the the + datagram total length field (of course, the header is counted in the + total length and not in the fragments). + + When fragmentation occurs, some options are copied, but others + remain with the first fragment only. + + Every internet module must be able to forward a datagram of 68 + octets without further fragmentation. This is because an internet + header may be up to 60 octets, and the minimum fragment is 8 octets. + + Every internet destination must be able to receive a datagram of 576 + octets either in one piece or in fragments to be reassembled. + + The fields which may be affected by fragmentation include: + + (1) options field + (2) more fragments flag + (3) fragment offset + (4) internet header length field + (5) total length field + (6) header checksum + + If the Don't Fragment flag (DF) bit is set, then internet + fragmentation of this datagram is NOT permitted, although it may be + discarded. This can be used to prohibit fragmentation in cases + where the receiving host does not have sufficient resources to + reassemble internet fragments. + + One example of use of the Don't Fragment feature is to down line + load a small host. A small host could have a boot strap program + that accepts a datagram stores it in memory and then executes it. + + The fragmentation and reassembly procedures are most easily + described by examples. The following procedures are example + implementations. + + General notation in the following pseudo programs: "=<" means "less + than or equal", "#" means "not equal", "=" means "equal", "<-" means + "is set to". Also, "x to y" includes x and excludes y; for example, + "4 to 7" would include 4, 5, and 6 (but not 7). + + + + [Page 25] + + + September 1981 +Internet Protocol +Specification + + + + An Example Fragmentation Procedure + + The maximum sized datagram that can be transmitted through the + next network is called the maximum transmission unit (MTU). + + If the total length is less than or equal the maximum transmission + unit then submit this datagram to the next step in datagram + processing; otherwise cut the datagram into two fragments, the + first fragment being the maximum size, and the second fragment + being the rest of the datagram. The first fragment is submitted + to the next step in datagram processing, while the second fragment + is submitted to this procedure in case it is still too large. + + Notation: + + FO - Fragment Offset + IHL - Internet Header Length + DF - Don't Fragment flag + MF - More Fragments flag + TL - Total Length + OFO - Old Fragment Offset + OIHL - Old Internet Header Length + OMF - Old More Fragments flag + OTL - Old Total Length + NFB - Number of Fragment Blocks + MTU - Maximum Transmission Unit + + Procedure: + + IF TL =< MTU THEN Submit this datagram to the next step + in datagram processing ELSE IF DF = 1 THEN discard the + datagram ELSE + To produce the first fragment: + (1) Copy the original internet header; + (2) OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF; + (3) NFB <- (MTU-IHL*4)/8; + (4) Attach the first NFB*8 data octets; + (5) Correct the header: + MF <- 1; TL <- (IHL*4)+(NFB*8); + Recompute Checksum; + (6) Submit this fragment to the next step in + datagram processing; + To produce the second fragment: + (7) Selectively copy the internet header (some options + are not copied, see option definitions); + (8) Append the remaining data; + (9) Correct the header: + IHL <- (((OIHL*4)-(length of options not copied))+3)/4; + + +[Page 26] + + +September 1981 + Internet Protocol + Specification + + + + TL <- OTL - NFB*8 - (OIHL-IHL)*4); + FO <- OFO + NFB; MF <- OMF; Recompute Checksum; + (10) Submit this fragment to the fragmentation test; DONE. + + In the above procedure each fragment (except the last) was made + the maximum allowable size. An alternative might produce less + than the maximum size datagrams. For example, one could implement + a fragmentation procedure that repeatly divided large datagrams in + half until the resulting fragments were less than the maximum + transmission unit size. + + An Example Reassembly Procedure + + For each datagram the buffer identifier is computed as the + concatenation of the source, destination, protocol, and + identification fields. If this is a whole datagram (that is both + the fragment offset and the more fragments fields are zero), then + any reassembly resources associated with this buffer identifier + are released and the datagram is forwarded to the next step in + datagram processing. + + If no other fragment with this buffer identifier is on hand then + reassembly resources are allocated. The reassembly resources + consist of a data buffer, a header buffer, a fragment block bit + table, a total data length field, and a timer. The data from the + fragment is placed in the data buffer according to its fragment + offset and length, and bits are set in the fragment block bit + table corresponding to the fragment blocks received. + + If this is the first fragment (that is the fragment offset is + zero) this header is placed in the header buffer. If this is the + last fragment ( that is the more fragments field is zero) the + total data length is computed. If this fragment completes the + datagram (tested by checking the bits set in the fragment block + table), then the datagram is sent to the next step in datagram + processing; otherwise the timer is set to the maximum of the + current timer value and the value of the time to live field from + this fragment; and the reassembly routine gives up control. + + If the timer runs out, the all reassembly resources for this + buffer identifier are released. The initial setting of the timer + is a lower bound on the reassembly waiting time. This is because + the waiting time will be increased if the Time to Live in the + arriving fragment is greater than the current timer value but will + not be decreased if it is less. The maximum this timer value + could reach is the maximum time to live (approximately 4.25 + minutes). The current recommendation for the initial timer + setting is 15 seconds. This may be changed as experience with + + + [Page 27] + + + September 1981 +Internet Protocol +Specification + + + + this protocol accumulates. Note that the choice of this parameter + value is related to the buffer capacity available and the data + rate of the transmission medium; that is, data rate times timer + value equals buffer size (e.g., 10Kb/s X 15s = 150Kb). + + Notation: + + FO - Fragment Offset + IHL - Internet Header Length + MF - More Fragments flag + TTL - Time To Live + NFB - Number of Fragment Blocks + TL - Total Length + TDL - Total Data Length + BUFID - Buffer Identifier + RCVBT - Fragment Received Bit Table + TLB - Timer Lower Bound + + Procedure: + + (1) BUFID <- source|destination|protocol|identification; + (2) IF FO = 0 AND MF = 0 + (3) THEN IF buffer with BUFID is allocated + (4) THEN flush all reassembly for this BUFID; + (5) Submit datagram to next step; DONE. + (6) ELSE IF no buffer with BUFID is allocated + (7) THEN allocate reassembly resources + with BUFID; + TIMER <- TLB; TDL <- 0; + (8) put data from fragment into data buffer with + BUFID from octet FO*8 to + octet (TL-(IHL*4))+FO*8; + (9) set RCVBT bits from FO + to FO+((TL-(IHL*4)+7)/8); + (10) IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8) + (11) IF FO = 0 THEN put header in header buffer + (12) IF TDL # 0 + (13) AND all RCVBT bits from 0 + to (TDL+7)/8 are set + (14) THEN TL <- TDL+(IHL*4) + (15) Submit datagram to next step; + (16) free all reassembly resources + for this BUFID; DONE. + (17) TIMER <- MAX(TIMER,TTL); + (18) give up until next fragment or timer expires; + (19) timer expires: flush all reassembly with this BUFID; DONE. + + In the case that two or more fragments contain the same data + + +[Page 28] + + +September 1981 + Internet Protocol + Specification + + + + either identically or through a partial overlap, this procedure + will use the more recently arrived copy in the data buffer and + datagram delivered. + + Identification + + The choice of the Identifier for a datagram is based on the need to + provide a way to uniquely identify the fragments of a particular + datagram. The protocol module assembling fragments judges fragments + to belong to the same datagram if they have the same source, + destination, protocol, and Identifier. Thus, the sender must choose + the Identifier to be unique for this source, destination pair and + protocol for the time the datagram (or any fragment of it) could be + alive in the internet. + + It seems then that a sending protocol module needs to keep a table + of Identifiers, one entry for each destination it has communicated + with in the last maximum packet lifetime for the internet. + + However, since the Identifier field allows 65,536 different values, + some host may be able to simply use unique identifiers independent + of destination. + + It is appropriate for some higher level protocols to choose the + identifier. For example, TCP protocol modules may retransmit an + identical TCP segment, and the probability for correct reception + would be enhanced if the retransmission carried the same identifier + as the original transmission since fragments of either datagram + could be used to construct a correct TCP segment. + + Type of Service + + The type of service (TOS) is for internet service quality selection. + The type of service is specified along the abstract parameters + precedence, delay, throughput, and reliability. These abstract + parameters are to be mapped into the actual service parameters of + the particular networks the datagram traverses. + + Precedence. An independent measure of the importance of this + datagram. + + Delay. Prompt delivery is important for datagrams with this + indication. + + Throughput. High data rate is important for datagrams with this + indication. + + + + + [Page 29] + + + September 1981 +Internet Protocol +Specification + + + + Reliability. A higher level of effort to ensure delivery is + important for datagrams with this indication. + + For example, the ARPANET has a priority bit, and a choice between + "standard" messages (type 0) and "uncontrolled" messages (type 3), + (the choice between single packet and multipacket messages can also + be considered a service parameter). The uncontrolled messages tend + to be less reliably delivered and suffer less delay. Suppose an + internet datagram is to be sent through the ARPANET. Let the + internet type of service be given as: + + Precedence: 5 + Delay: 0 + Throughput: 1 + Reliability: 1 + + In this example, the mapping of these parameters to those available + for the ARPANET would be to set the ARPANET priority bit on since + the Internet precedence is in the upper half of its range, to select + standard messages since the throughput and reliability requirements + are indicated and delay is not. More details are given on service + mappings in "Service Mappings" [8]. + + Time to Live + + The time to live is set by the sender to the maximum time the + datagram is allowed to be in the internet system. If the datagram + is in the internet system longer than the time to live, then the + datagram must be destroyed. + + This field must be decreased at each point that the internet header + is processed to reflect the time spent processing the datagram. + Even if no local information is available on the time actually + spent, the field must be decremented by 1. The time is measured in + units of seconds (i.e. the value 1 means one second). Thus, the + maximum time to live is 255 seconds or 4.25 minutes. Since every + module that processes a datagram must decrease the TTL by at least + one even if it process the datagram in less than a second, the TTL + must be thought of only as an upper bound on the time a datagram may + exist. The intention is to cause undeliverable datagrams to be + discarded, and to bound the maximum datagram lifetime. + + Some higher level reliable connection protocols are based on + assumptions that old duplicate datagrams will not arrive after a + certain time elapses. The TTL is a way for such protocols to have + an assurance that their assumption is met. + + + + +[Page 30] + + +September 1981 + Internet Protocol + Specification + + + + Options + + The options are optional in each datagram, but required in + implementations. That is, the presence or absence of an option is + the choice of the sender, but each internet module must be able to + parse every option. There can be several options present in the + option field. + + The options might not end on a 32-bit boundary. The internet header + must be filled out with octets of zeros. The first of these would + be interpreted as the end-of-options option, and the remainder as + internet header padding. + + Every internet module must be able to act on every option. The + Security Option is required if classified, restricted, or + compartmented traffic is to be passed. + + Checksum + + The internet header checksum is recomputed if the internet header is + changed. For example, a reduction of the time to live, additions or + changes to internet options, or due to fragmentation. This checksum + at the internet level is intended to protect the internet header + fields from transmission errors. + + There are some applications where a few data bit errors are + acceptable while retransmission delays are not. If the internet + protocol enforced data correctness such applications could not be + supported. + + Errors + + Internet protocol errors may be reported via the ICMP messages [3]. + +3.3. Interfaces + + The functional description of user interfaces to the IP is, at best, + fictional, since every operating system will have different + facilities. Consequently, we must warn readers that different IP + implementations may have different user interfaces. However, all IPs + must provide a certain minimum set of services to guarantee that all + IP implementations can support the same protocol hierarchy. This + section specifies the functional interfaces required of all IP + implementations. + + Internet protocol interfaces on one side to the local network and on + the other side to either a higher level protocol or an application + program. In the following, the higher level protocol or application + + + [Page 31] + + + September 1981 +Internet Protocol +Specification + + + + program (or even a gateway program) will be called the "user" since it + is using the internet module. Since internet protocol is a datagram + protocol, there is minimal memory or state maintained between datagram + transmissions, and each call on the internet protocol module by the + user supplies all information necessary for the IP to perform the + service requested. + + An Example Upper Level Interface + + The following two example calls satisfy the requirements for the user + to internet protocol module communication ("=>" means returns): + + SEND (src, dst, prot, TOS, TTL, BufPTR, len, Id, DF, opt => result) + + where: + + src = source address + dst = destination address + prot = protocol + TOS = type of service + TTL = time to live + BufPTR = buffer pointer + len = length of buffer + Id = Identifier + DF = Don't Fragment + opt = option data + result = response + OK = datagram sent ok + Error = error in arguments or local network error + + Note that the precedence is included in the TOS and the + security/compartment is passed as an option. + + RECV (BufPTR, prot, => result, src, dst, TOS, len, opt) + + where: + + BufPTR = buffer pointer + prot = protocol + result = response + OK = datagram received ok + Error = error in arguments + len = length of buffer + src = source address + dst = destination address + TOS = type of service + opt = option data + + + +[Page 32] + + +September 1981 + Internet Protocol + Specification + + + + When the user sends a datagram, it executes the SEND call supplying + all the arguments. The internet protocol module, on receiving this + call, checks the arguments and prepares and sends the message. If the + arguments are good and the datagram is accepted by the local network, + the call returns successfully. If either the arguments are bad, or + the datagram is not accepted by the local network, the call returns + unsuccessfully. On unsuccessful returns, a reasonable report must be + made as to the cause of the problem, but the details of such reports + are up to individual implementations. + + When a datagram arrives at the internet protocol module from the local + network, either there is a pending RECV call from the user addressed + or there is not. In the first case, the pending call is satisfied by + passing the information from the datagram to the user. In the second + case, the user addressed is notified of a pending datagram. If the + user addressed does not exist, an ICMP error message is returned to + the sender, and the data is discarded. + + The notification of a user may be via a pseudo interrupt or similar + mechanism, as appropriate in the particular operating system + environment of the implementation. + + A user's RECV call may then either be immediately satisfied by a + pending datagram, or the call may be pending until a datagram arrives. + + The source address is included in the send call in case the sending + host has several addresses (multiple physical connections or logical + addresses). The internet module must check to see that the source + address is one of the legal address for this host. + + An implementation may also allow or require a call to the internet + module to indicate interest in or reserve exclusive use of a class of + datagrams (e.g., all those with a certain value in the protocol + field). + + This section functionally characterizes a USER/IP interface. The + notation used is similar to most procedure of function calls in high + level languages, but this usage is not meant to rule out trap type + service calls (e.g., SVCs, UUOs, EMTs), or any other form of + interprocess communication. + + + + + + + + + + + [Page 33] + + + September 1981 +Internet Protocol + + + +APPENDIX A: Examples & Scenarios + +Example 1: + + This is an example of the minimal data carrying internet datagram: + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Ver= 4 |IHL= 5 |Type of Service| Total Length = 21 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification = 111 |Flg=0| Fragment Offset = 0 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time = 123 | Protocol = 1 | header checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | source address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | destination address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+ + + Example Internet Datagram + + Figure 5. + + Note that each tick mark represents one bit position. + + This is a internet datagram in version 4 of internet protocol; the + internet header consists of five 32 bit words, and the total length of + the datagram is 21 octets. This datagram is a complete datagram (not + a fragment). + + + + + + + + + + + + + + + + + + +[Page 34] + + +September 1981 + Internet Protocol + + + +Example 2: + + In this example, we show first a moderate size internet datagram (452 + data octets), then two internet fragments that might result from the + fragmentation of this datagram if the maximum sized transmission + allowed were 280 octets. + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Ver= 4 |IHL= 5 |Type of Service| Total Length = 472 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification = 111 |Flg=0| Fragment Offset = 0 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time = 123 | Protocol = 6 | header checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | source address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | destination address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + \ \ + \ \ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Example Internet Datagram + + Figure 6. + + + + + + + + + + + + + + + + + + [Page 35] + + + September 1981 +Internet Protocol + + + + Now the first fragment that results from splitting the datagram after + 256 data octets. + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Ver= 4 |IHL= 5 |Type of Service| Total Length = 276 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification = 111 |Flg=1| Fragment Offset = 0 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time = 119 | Protocol = 6 | Header Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | source address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | destination address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + \ \ + \ \ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Example Internet Fragment + + Figure 7. + + + + + + + + + + + + + + + + + + + + + +[Page 36] + + +September 1981 + Internet Protocol + + + + And the second fragment. + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Ver= 4 |IHL= 5 |Type of Service| Total Length = 216 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification = 111 |Flg=0| Fragment Offset = 32 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time = 119 | Protocol = 6 | Header Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | source address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | destination address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + \ \ + \ \ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Example Internet Fragment + + Figure 8. + + + + + + + + + + + + + + + + + + + + + + + [Page 37] + + + September 1981 +Internet Protocol + + + +Example 3: + + Here, we show an example of a datagram containing options: + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Ver= 4 |IHL= 8 |Type of Service| Total Length = 576 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification = 111 |Flg=0| Fragment Offset = 0 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Time = 123 | Protocol = 6 | Header Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | source address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | destination address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Opt. Code = x | Opt. Len.= 3 | option value | Opt. Code = x | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Opt. Len. = 4 | option value | Opt. Code = 1 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Opt. Code = y | Opt. Len. = 3 | option value | Opt. Code = 0 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + \ \ + \ \ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Example Internet Datagram + + Figure 9. + + + + + + + + + + + + + + + + +[Page 38] + + +September 1981 + Internet Protocol + + + +APPENDIX B: Data Transmission Order + +The order of transmission of the header and data described in this +document is resolved to the octet level. Whenever a diagram shows a +group of octets, the order of transmission of those octets is the normal +order in which they are read in English. For example, in the following +diagram the octets are transmitted in the order they are numbered. + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 1 | 2 | 3 | 4 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 5 | 6 | 7 | 8 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 9 | 10 | 11 | 12 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Transmission Order of Bytes + + Figure 10. + +Whenever an octet represents a numeric quantity the left most bit in the +diagram is the high order or most significant bit. That is, the bit +labeled 0 is the most significant bit. For example, the following +diagram represents the value 170 (decimal). + + + 0 1 2 3 4 5 6 7 + +-+-+-+-+-+-+-+-+ + |1 0 1 0 1 0 1 0| + +-+-+-+-+-+-+-+-+ + + Significance of Bits + + Figure 11. + +Similarly, whenever a multi-octet field represents a numeric quantity +the left most bit of the whole field is the most significant bit. When +a multi-octet quantity is transmitted the most significant octet is +transmitted first. + + + + + + + + + + [Page 39] + + + September 1981 +Internet Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 40] + + +September 1981 + Internet Protocol + + + + GLOSSARY + + + +1822 + BBN Report 1822, "The Specification of the Interconnection of + a Host and an IMP". The specification of interface between a + host and the ARPANET. + +ARPANET leader + The control information on an ARPANET message at the host-IMP + interface. + +ARPANET message + The unit of transmission between a host and an IMP in the + ARPANET. The maximum size is about 1012 octets (8096 bits). + +ARPANET packet + A unit of transmission used internally in the ARPANET between + IMPs. The maximum size is about 126 octets (1008 bits). + +Destination + The destination address, an internet header field. + +DF + The Don't Fragment bit carried in the flags field. + +Flags + An internet header field carrying various control flags. + +Fragment Offset + This internet header field indicates where in the internet + datagram a fragment belongs. + +GGP + Gateway to Gateway Protocol, the protocol used primarily + between gateways to control routing and other gateway + functions. + +header + Control information at the beginning of a message, segment, + datagram, packet or block of data. + +ICMP + Internet Control Message Protocol, implemented in the internet + module, the ICMP is used from gateways to hosts and between + hosts to report errors and make routing suggestions. + + + + + [Page 41] + + + September 1981 +Internet Protocol +Glossary + + + +Identification + An internet header field carrying the identifying value + assigned by the sender to aid in assembling the fragments of a + datagram. + +IHL + The internet header field Internet Header Length is the length + of the internet header measured in 32 bit words. + +IMP + The Interface Message Processor, the packet switch of the + ARPANET. + +Internet Address + A four octet (32 bit) source or destination address consisting + of a Network field and a Local Address field. + +internet datagram + The unit of data exchanged between a pair of internet modules + (includes the internet header). + +internet fragment + A portion of the data of an internet datagram with an internet + header. + +Local Address + The address of a host within a network. The actual mapping of + an internet local address on to the host addresses in a + network is quite general, allowing for many to one mappings. + +MF + The More-Fragments Flag carried in the internet header flags + field. + +module + An implementation, usually in software, of a protocol or other + procedure. + +more-fragments flag + A flag indicating whether or not this internet datagram + contains the end of an internet datagram, carried in the + internet header Flags field. + +NFB + The Number of Fragment Blocks in a the data portion of an + internet fragment. That is, the length of a portion of data + measured in 8 octet units. + + + +[Page 42] + + +September 1981 + Internet Protocol + Glossary + + + +octet + An eight bit byte. + +Options + The internet header Options field may contain several options, + and each option may be several octets in length. + +Padding + The internet header Padding field is used to ensure that the + data begins on 32 bit word boundary. The padding is zero. + +Protocol + In this document, the next higher level protocol identifier, + an internet header field. + +Rest + The local address portion of an Internet Address. + +Source + The source address, an internet header field. + +TCP + Transmission Control Protocol: A host-to-host protocol for + reliable communication in internet environments. + +TCP Segment + The unit of data exchanged between TCP modules (including the + TCP header). + +TFTP + Trivial File Transfer Protocol: A simple file transfer + protocol built on UDP. + +Time to Live + An internet header field which indicates the upper bound on + how long this internet datagram may exist. + +TOS + Type of Service + +Total Length + The internet header field Total Length is the length of the + datagram in octets including internet header and data. + +TTL + Time to Live + + + + + [Page 43] + + + September 1981 +Internet Protocol +Glossary + + + +Type of Service + An internet header field which indicates the type (or quality) + of service for this internet datagram. + +UDP + User Datagram Protocol: A user level protocol for transaction + oriented applications. + +User + The user of the internet protocol. This may be a higher level + protocol module, an application program, or a gateway program. + +Version + The Version field indicates the format of the internet header. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 44] + + +September 1981 + Internet Protocol + + + + REFERENCES + + + +[1] Cerf, V., "The Catenet Model for Internetworking," Information + Processing Techniques Office, Defense Advanced Research Projects + Agency, IEN 48, July 1978. + +[2] Bolt Beranek and Newman, "Specification for the Interconnection of + a Host and an IMP," BBN Technical Report 1822, Revised May 1978. + +[3] Postel, J., "Internet Control Message Protocol - DARPA Internet + Program Protocol Specification," RFC 792, USC/Information Sciences + Institute, September 1981. + +[4] Shoch, J., "Inter-Network Naming, Addressing, and Routing," + COMPCON, IEEE Computer Society, Fall 1978. + +[5] Postel, J., "Address Mappings," RFC 796, USC/Information Sciences + Institute, September 1981. + +[6] Shoch, J., "Packet Fragmentation in Inter-Network Protocols," + Computer Networks, v. 3, n. 1, February 1979. + +[7] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek and + Newman, August 1979. + +[8] Postel, J., "Service Mappings," RFC 795, USC/Information Sciences + Institute, September 1981. + +[9] Postel, J., "Assigned Numbers," RFC 790, USC/Information Sciences + Institute, September 1981. + + + + + + + + + + + + + + + + + + + + [Page 45] + + +======================================================================== + +Network Working Group J. Mogul (Stanford) +Request for Comments: 950 J. Postel (ISI) + August 1985 + + Internet Standard Subnetting Procedure + + +Status Of This Memo + + This RFC specifies a protocol for the ARPA-Internet community. If + subnetting is implemented it is strongly recommended that these + procedures be followed. Distribution of this memo is unlimited. + +Overview + + This memo discusses the utility of "subnets" of Internet networks, + which are logically visible sub-sections of a single Internet + network. For administrative or technical reasons, many organizations + have chosen to divide one Internet network into several subnets, + instead of acquiring a set of Internet network numbers. This memo + specifies procedures for the use of subnets. These procedures are + for hosts (e.g., workstations). The procedures used in and between + subnet gateways are not fully described. Important motivation and + background information for a subnetting standard is provided in + RFC-940 [7]. + +Acknowledgment + + This memo is based on RFC-917 [1]. Many people contributed to the + development of the concepts described here. J. Noel Chiappa, Chris + Kent, and Tim Mann, in particular, provided important suggestions. + Additional contributions in shaping this memo were made by Zaw-Sing + Su, Mike Karels, and the Gateway Algorithms and Data Structures Task + Force (GADS). + + + + + + + + + + + + + + + + + + + +Mogul & Postel [Page 1] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + +1. Motivation + + The original view of the Internet universe was a two-level hierarchy: + the top level the Internet as a whole, and the level below it + individual networks, each with its own network number. The Internet + does not have a hierarchical topology, rather the interpretation of + addresses is hierarchical. In this two-level model, each host sees + its network as a single entity; that is, the network may be treated + as a "black box" to which a set of hosts is connected. + + While this view has proved simple and powerful, a number of + organizations have found it inadequate, and have added a third level + to the interpretation of Internet addresses. In this view, a given + Internet network is divided into a collection of subnets. + + The three-level model is useful in networks belonging to moderately + large organizations (e.g., Universities or companies with more than + one building), where it is often necessary to use more than one LAN + cable to cover a "local area". Each LAN may then be treated as a + subnet. + + There are several reasons why an organization might use more than one + cable to cover a campus: + + - Different technologies: Especially in a research environment, + there may be more than one kind of LAN in use; e.g., an + organization may have some equipment that supports Ethernet, and + some that supports a ring network. + + - Limits of technologies: Most LAN technologies impose limits, + based on electrical parameters, on the number of hosts + connected, and on the total length of the cable. It is easy to + exceed these limits, especially those on cable length. + + - Network congestion: It is possible for a small subset of the + hosts on a LAN to monopolize most of the bandwidth. A common + solution to this problem is to divide the hosts into cliques of + high mutual communication, and put these cliques on separate + cables. + + - Point-to-Point links: Sometimes a "local area", such as a + university campus, is split into two locations too far apart to + connect using the preferred LAN technology. In this case, + high-speed point-to-point links might connect several LANs. + + An organization that has been forced to use more than one LAN has + three choices for assigning Internet addresses: + + +Mogul & Postel [Page 2] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + 1. Acquire a distinct Internet network number for each cable; + subnets are not used at all. + + 2. Use a single network number for the entire organization, but + assign host numbers without regard to which LAN a host is on + ("transparent subnets"). + + 3. Use a single network number, and partition the host address + space by assigning subnet numbers to the LANs ("explicit + subnets"). + + Each of these approaches has disadvantages. The first, although not + requiring any new or modified protocols, results in an explosion in + the size of Internet routing tables. Information about the internal + details of local connectivity is propagated everywhere, although it + is of little or no use outside the local organization. Especially as + some current gateway implementations do not have much space for + routing tables, it would be good to avoid this problem. + + The second approach requires some convention or protocol that makes + the collection of LANs appear to be a single Internet network. For + example, this can be done on LANs where each Internet address is + translated to a hardware address using an Address Resolution Protocol + (ARP), by having the bridges between the LANs intercept ARP requests + for non-local targets, see RFC-925 [2]. However, it is not possible + to do this for all LAN technologies, especially those where ARP + protocols are not currently used, or if the LAN does not support + broadcasts. A more fundamental problem is that bridges must discover + which LAN a host is on, perhaps by using a broadcast algorithm. As + the number of LANs grows, the cost of broadcasting grows as well; + also, the size of translation caches required in the bridges grows + with the total number of hosts in the network. + + The third approach is to explicitly support subnets. This does have + a disadvantage, in that it is a modification of the Internet + Protocol, and thus requires changes to IP implementations already in + use (if these implementations are to be used on a subnetted network). + However, these changes are relatively minor, and once made, yield a + simple and efficient solution to the problem. Also, the approach + avoids any changes that would be incompatible with existing hosts on + non-subnetted networks. + + Further, when appropriate design choices are made, it is possible for + hosts which believe they are on a non-subnetted network to be used on + a subnetted one, as explained in RFC-917 [1]. This is useful when it + is not possible to modify some of the hosts to support subnets + explicitly, or when a gradual transition is preferred. + + +Mogul & Postel [Page 3] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + +2. Standards for Subnet Addressing + + This section first describes a proposal for interpretation of + Internet addresses to support subnets. Next it discusses changes to + host software to support subnets. Finally, it presents a procedures + for discovering what address interpretation is in use on a given + network (i.e., what address mask is in use). + + 2.1. Interpretation of Internet Addresses + + Suppose that an organization has been assigned an Internet network + number, has further divided that network into a set of subnets, + and wants to assign host addresses: how should this be done? + Since there are minimal restrictions on the assignment of the + "local address" part of the Internet address, several approaches + have been proposed for representing the subnet number: + + 1. Variable-width field: Any number of the bits of the local + address part are used for the subnet number; the size of + this field, although constant for a given network, varies + from network to network. If the field width is zero, then + subnets are not in use. + + 2. Fixed-width field: A specific number of bits (e.g., eight) + is used for the subnet number, if subnets are in use. + + 3. Self-encoding variable-width field: Just as the width + (i.e., class) of the network number field is encoded by its + high-order bits, the width of the subnet field is similarly + encoded. + + 4. Self-encoding fixed-width field: A specific number of bits + is used for the subnet number. + + 5. Masked bits: Use a bit mask ("address mask") to identify + which bits of the local address field indicate the subnet + number. + + What criteria can be used to choose one of these five schemes? + First, should we use a self-encoding scheme? And, should it be + possible to tell from examining an Internet address if it refers + to a subnetted network, without reference to any other + information? + + An interesting feature of self-encoding is that it allows the + + + + +Mogul & Postel [Page 4] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + address space of a network to be divided into subnets of + different sizes, typically one subnet of half the address space + and a set of small subnets. + + For example, consider a class C network that uses a + self-encoding scheme with one bit to indicate if it is the + large subnet or not and an additional three bits to identify + the small subnet. If the first bit is zero then this is the + large subnet, if the first bit is one then the following + bits (3 in this example) give the subnet number. There is + one subnet with 128 host addresses, and eight subnets with + 16 hosts each. + + To establish a subnetting standard the parameters and + interpretation of the self-encoding scheme must be fixed and + consistent throughout the Internet. + + It could be assumed that all networks are subnetted. This + would allow addresses to be interpreted without reference to + any other information. + + This is a significant advantage, that given the Internet + address no additional information is needed for an + implementation to determine if two addresses are on the same + subnet. However, this can also be viewed as a disadvantage: + it may cause problems for networks which have existing host + numbers that use arbitrary bits in the local address part. + In other words, it is useful to be able to control whether a + network is subnetted independently from the assignment of + host addresses. + + The alternative is to have the fact that a network is subnetted + kept separate from the address. If one finds, somehow, that + the network is subnetted then the standard self-encoded + subnetted network address rules are followed, otherwise the + non-subnetted network addressing rules are followed. + + If a self-encoding scheme is not used, there is no reason to use a + fixed-width field scheme: since there must in any case be some + per-network "flag" to indicate if subnets are in use, the + additional cost of using an integer (a subnet field width or + address mask) instead of a boolean is negligible. The advantage + of using the address mask scheme is that it allows each + organization to choose the best way to allocate relatively scarce + bits of local address to subnet and host numbers. Therefore, we + choose the address-mask scheme: it is the most flexible scheme, + yet costs no more to implement than any other. + + +Mogul & Postel [Page 5] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + For example, the Internet address might be interpreted as: + + + + where the field is as defined by IP [3], the + field is at least 1-bit wide, and the width of the + field is constant for a given network. No further + structure is required for the or + fields. If the width of the field is zero, then + the network is not subnetted (i.e., the interpretation of [3] is + used). + + For example, on a Class B network with a 6-bit wide subnet field, + an address would be broken down like this: + + 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |1 0| NETWORK | SUBNET | Host Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Since the bits that identify the subnet are specified by a + bitmask, they need not be adjacent in the address. However, we + recommend that the subnet bits be contiguous and located as the + most significant bits of the local address. + + Special Addresses: + + From the Assigned Numbers memo [9]: + + "In certain contexts, it is useful to have fixed addresses + with functional significance rather than as identifiers of + specific hosts. When such usage is called for, the address + zero is to be interpreted as meaning "this", as in "this + network". The address of all ones are to be interpreted as + meaning "all", as in "all hosts". For example, the address + 128.9.255.255 could be interpreted as meaning all hosts on + the network 128.9. Or, the address 0.0.0.37 could be + interpreted as meaning host 37 on this network." + + It is useful to preserve and extend the interpretation of these + special addresses in subnetted networks. This means the values + of all zeros and all ones in the subnet field should not be + assigned to actual (physical) subnets. + + In the example above, the 6-bit wide subnet field may have + any value except 0 and 63. + + +Mogul & Postel [Page 6] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + Please note that there is no effect or new restriction on the + addresses of hosts on non-subnetted networks. + + 2.2. Changes to Host Software to Support Subnets + + In most implementations of IP, there is code in the module that + handles outgoing datagrams to decide if a datagram can be sent + directly to the destination on the local network or if it must be + sent to a gateway. + + Generally the code is something like this: + + IF ip_net_number(dg.ip_dest) = ip_net_number(my_ip_addr) + THEN + send_dg_locally(dg, dg.ip_dest) + ELSE + send_dg_locally(dg, + gateway_to(ip_net_number(dg.ip_dest))) + + (If the code supports multiply-connected networks, it will be more + complicated, but this is irrelevant to the current discussion.) + + To support subnets, it is necessary to store one more 32-bit + quantity, called my_ip_mask. This is a bit-mask with bits set in + the fields corresponding to the IP network number, and additional + bits set corresponding to the subnet number field. + + The code then becomes: + + IF bitwise_and(dg.ip_dest, my_ip_mask) + = bitwise_and(my_ip_addr, my_ip_mask) + THEN + send_dg_locally(dg, dg.ip_dest) + ELSE + send_dg_locally(dg, + gateway_to(bitwise_and(dg.ip_dest, my_ip_mask))) + + Of course, part of the expression in the conditional can be + pre-computed. + + It may or may not be necessary to modify the "gateway_to" + function, so that it too takes the subnet field bits into account + when performing comparisons. + + To support multiply-connected hosts, the code can be changed to + + + + +Mogul & Postel [Page 7] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + keep the "my_ip_addr" and "my_ip_mask" quantities on a + per-interface basis; the expression in the conditional must then + be evaluated for each interface. + + 2.3. Finding the Address Mask + + How can a host determine what address mask is in use on a subnet + to which it is connected? The problem is analogous to several + other "bootstrapping" problems for Internet hosts: how a host + determines its own address, and how it locates a gateway on its + local network. In all three cases, there are two basic solutions: + "hardwired" information, and broadcast-based protocols. + + Hardwired information is that available to a host in isolation + from a network. It may be compiled-in, or (preferably) stored in + a disk file. However, for the increasingly common case of a + diskless workstation that is bootloaded over a LAN, neither + hardwired solution is satisfactory. + + Instead, since most LAN technology supports broadcasting, a better + method is for the newly-booted host to broadcast a request for the + necessary information. For example, for the purpose of + determining its Internet address, a host may use the "Reverse + Address Resolution Protocol" (RARP) [4]. + + However, since a newly-booted host usually needs to gather several + facts (e.g., its IP address, the hardware address of a gateway, + the IP address of a domain name server, the subnet address mask), + it would be better to acquire all this information in one request + if possible, rather than doing numerous broadcasts on the network. + The mechanisms designed to boot diskless workstations can also + load per-host specific configuration files that contain the + required information (e.g., see RFC-951 [8]). It is possible, and + desirable, to obtain all the facts necessary to operate a host + from a boot server using only one broadcast message. + + In the case where it is necessary for a host to find the address + mask as a separate operation the following mechanism is provided: + + To provide the address mask information the ICMP protocol [5] + is extended by adding a new pair of ICMP message types, + "Address Mask Request" and "Address Mask Reply", analogous to + the "Information Request" and "Information Reply" ICMP + messages. These are described in detail in Appendix I. + + The intended use of these new ICMP messages is that a host, + when booting, broadcast an "Address Mask Request" message. A + + +Mogul & Postel [Page 8] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + gateway (or a host acting in lieu of a gateway) that receives + this message responds with an "Address Mask Reply". If there + is no indication in the request which host sent it (i.e., the + IP Source Address is zero), the reply is broadcast as well. + The requesting host will hear the response, and from it + determine the address mask. + + Since there is only one possible value that can be sent in an + "Address Mask Reply" on any given LAN, there is no need for the + requesting host to match the responses it hears against the + request it sent; similarly, there is no problem if more than + one gateway responds. We assume that hosts reboot + infrequently, so the broadcast load on a network from use of + this protocol should be small. + + If a host is connected to more than one LAN, it might have to find + the address mask for each. + + One potential problem is what a host should do if it can not find + out the address mask, even after a reasonable number of tries. + Three interpretations can be placed on the situation: + + 1. The local net exists in (permanent) isolation from all other + nets. + + 2. Subnets are not in use, and no host can supply the address + mask. + + 3. All gateways on the local net are (temporarily) down. + + The first and second situations imply that the address mask is + identical with the Internet network number mask. In the third + situation, there is no way to determine what the proper value is; + the safest choice is thus a mask identical with the Internet + network number mask. Although this might later turn out to be + wrong, it will not prevent transmissions that would otherwise + succeed. It is possible for a host to recover from a wrong + choice: when a gateway comes up, it should broadcast an "Address + Mask Reply"; when a host receives such a message that disagrees + with its guess, it should change its mask to conform to the + received value. No host or gateway should send an "Address Mask + Reply" based on a "guessed" value. + + Finally, note that no host is required to use this ICMP protocol + to discover the address mask; it is perfectly reasonable for a + host with non-volatile storage to use stored information + (including a configuration file from a boot server). + + +Mogul & Postel [Page 9] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + +Appendix I. Address Mask ICMP + + Address Mask Request or Address Mask Reply + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identifier | Sequence Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Address Mask | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Addresses + + The address of the source in an address mask request message + will be the destination of the address mask reply message. + To form an address mask reply message, the source address of + the request becomes the destination address of the reply, + the source address of the reply is set to the replier's + address, the type code changed to AM2, the address mask + value inserted into the Address Mask field, and the checksum + recomputed. However, if the source address in the request + message is zero, then the destination address for the reply + message should denote a broadcast. + + ICMP Fields: + + Type + + AM1 for address mask request message + + AM2 for address mask reply message + + Code + + 0 for address mask request message + + 0 for address mask reply message + + Checksum + + The checksum is the 16-bit one's complement of the one's + + + +Mogul & Postel [Page 10] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + complement sum of the ICMP message starting with the ICMP + Type. For computing the checksum, the checksum field should + be zero. This checksum may be replaced in the future. + + Identifier + + An identifier to aid in matching requests and replies, may + be zero. + + Sequence Number + + A sequence number to aid in matching requests and replies, + may be zero. + + Address Mask + + A 32-bit mask. + + Description + + A gateway receiving an address mask request should return it + with the address mask field set to the 32-bit mask of the bits + identifying the subnet and network, for the subnet on which the + request was received. + + If the requesting host does not know its own IP address, it may + leave the source field zero; the reply should then be + broadcast. However, this approach should be avoided if at all + possible, since it increases the superfluous broadcast load on + the network. Even when the replies are broadcast, since there + is only one possible address mask for a subnet, there is no + need to match requests with replies. The "Identifier" and + "Sequence Number" fields can be ignored. + + Type AM1 may be received from a gateway or a host. + + Type AM2 may be received from a gateway, or a host acting in + lieu of a gateway. + + + + + + + + + + + +Mogul & Postel [Page 11] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + +Appendix II. Examples + + These examples show how a host can find out the address mask using + the ICMP Address Mask Request and Address Mask Reply messages. For + the following examples, assume that address 255.255.255.255 denotes + "broadcast to this physical medium" [6]. + + 1. A Class A Network Case + + For this case, assume that the requesting host is on class A + network 36.0.0.0, has address 36.40.0.123, that there is a gateway + at 36.40.0.62, and that a 8-bit wide subnet field is in use, that + is, the address mask is 255.255.0.0. + + The most efficient method, and the one we recommend, is for a host + to first discover its own address (perhaps using "RARP" [4]), and + then to send the ICMP request to 255.255.255.255: + + Source address: 36.40.0.123 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + The gateway can then respond directly to the requesting host. + + Source address: 36.40.0.62 + Destination address: 36.40.0.123 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.0.0 + + Suppose that 36.40.0.123 is a diskless workstation, and does not + know even its own host number. It could send the following + datagram: + + Source address: 0.0.0.0 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 36.40.0.62 will hear the datagram, and should respond with this + datagram: + + +Mogul & Postel [Page 12] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + Source address: 36.40.0.62 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.0.0 + + Note that the gateway uses the narrowest possible broadcast to + reply. Even so, the over use of broadcasts presents an + unnecessary load to all hosts on the subnet, and so the use of the + "anonymous" (0.0.0.0) source address must be kept to a minimum. + + If broadcasting is not allowed, we assume that hosts have wired-in + information about neighbor gateways; thus, 36.40.0.123 might send + this datagram: + + Source address: 36.40.0.123 + Destination address: 36.40.0.62 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 36.40.0.62 should respond exactly as in the previous case. + + Source address: 36.40.0.62 + Destination address: 36.40.0.123 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.0.0 + + 2. A Class B Network Case + + For this case, assume that the requesting host is on class B + network 128.99.0.0, has address 128.99.4.123, that there is a + gateway at 128.99.4.62, and that a 6-bit wide subnet field is in + use, that is, the address mask is 255.255.252.0. + + The host sends the ICMP request to 255.255.255.255: + + Source address: 128.99.4.123 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + +Mogul & Postel [Page 13] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + The gateway can then respond directly to the requesting host. + + Source address: 128.99.4.62 + Destination address: 128.99.4.123 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.252.0 + + In the diskless workstation case the host sends: + + Source address: 0.0.0.0 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 128.99.4.62 will hear the datagram, and should respond with this + datagram: + + Source address: 128.99.4.62 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.252.0 + + If broadcasting is not allowed 128.99.4.123 sends: + + Source address: 128.99.4.123 + Destination address: 128.99.4.62 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 128.99.4.62 should respond exactly as in the previous case. + + Source address: 128.99.4.62 + Destination address: 128.99.4.123 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.252.0 + + + + +Mogul & Postel [Page 14] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + 3. A Class C Network Case (illustrating non-contiguous subnet bits) + + For this case, assume that the requesting host is on class C + network 192.1.127.0, has address 192.1.127.19, that there is a + gateway at 192.1.127.50, and that on network an 3-bit subnet field + is in use (01011000), that is, the address mask is 255.255.255.88. + + The host sends the ICMP request to 255.255.255.255: + + Source address: 192.1.127.19 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + The gateway can then respond directly to the requesting host. + + Source address: 192.1.127.50 + Destination address: 192.1.127.19 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.255.88. + + In the diskless workstation case the host sends: + + Source address: 0.0.0.0 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 192.1.127.50 will hear the datagram, and should respond with this + datagram: + + Source address: 192.1.127.50 + Destination address: 255.255.255.255 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.255.88. + + If broadcasting is not allowed 192.1.127.19 sends: + + + + +Mogul & Postel [Page 15] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + Source address: 192.1.127.19 + Destination address: 192.1.127.50 + Protocol: ICMP = 1 + Type: Address Mask Request = AM1 + Code: 0 + Mask: 0 + + 192.1.127.50 should respond exactly as in the previous case. + + Source address: 192.1.127.50 + Destination address: 192.1.127.19 + Protocol: ICMP = 1 + Type: Address Mask Reply = AM2 + Code: 0 + Mask: 255.255.255.88 + +Appendix III. Glossary + + Bridge + + A node connected to two or more administratively indistinguishable + but physically distinct subnets, that automatically forwards + datagrams when necessary, but whose existence is not known to + other hosts. Also called a "software repeater". + + Gateway + + A node connected to two or more administratively distinct networks + and/or subnets, to which hosts send datagrams to be forwarded. + + Host Field + + The bit field in an Internet address used for denoting a specific + host. + + Internet + + The collection of connected networks using the IP protocol. + + Local Address + + The rest field of the Internet address (as defined in [3]). + + Network + + A single Internet network (which may or may not be divided into + subnets). + + +Mogul & Postel [Page 16] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + + Network Number + + The network field of the Internet address. + + Subnet + + One or more physical networks forming a subset of an Internet + network. A subnet is explicitly identified in the Internet + address. + + Subnet Field + + The bit field in an Internet address denoting the subnet number. + The bits making up this field are not necessarily contiguous in + the address. + + Subnet Number + + A number identifying a subnet within a network. + +Appendix IV. Assigned Numbers + + The following assignments are made for protocol parameters used in + the support of subnets. The only assignments needed are for the + Internet Control Message Protocol (ICMP) [5]. + + ICMP Message Types + + AM1 = 17 + + AM2 = 18 + + + + + + + + + + + + + + + + + + +Mogul & Postel [Page 17] + + + +RFC 950 August 1985 +Internet Standard Subnetting Procedure + + +References + + [1] Mogul, J., "Internet Subnets", RFC-917, Stanford University, + October 1984. + + [2] Postel, J., "Multi-LAN Address Resolution", RFC-925, + USC/Information Sciences Institute, October 1984. + + [3] Postel, J., "Internet Protocol", RFC-791, USC/Information + Sciences Institute, September 1981. + + [4] Finlayson, R., T. Mann, J. Mogul, M. Theimer, "A Reverse Address + Resolution Protocol", RFC-903, Stanford University, June 1984. + + [5] Postel, J., "Internet Control Message Protocol", RFC-792, + USC/Information Sciences Institute, September 1981. + + [6] Mogul, J., "Broadcasting Internet Datagrams", RFC-919, Stanford + University, October 1984. + + [7] GADS, "Towards an Internet Standard Scheme for Subnetting", + RFC-940, Network Information Center, SRI International, + April 1985. + + [8] Croft, B., and J. Gilmore, "BOOTP -- UDP Bootstrap Protocol", + RFC-951, Stanford University, August 1985. + + [9] Reynolds, J., and J. Postel, "Assigned Numbers", RFC-943, + USC/Information Sciences Institute, April 1985. + + + + + + + + + + + + + + + + + + + + +Mogul & Postel [Page 18] + +======================================================================== + +Network Working Group Jeffrey Mogul +Request for Comments: 919 Computer Science Department + Stanford University + October 1984 + + BROADCASTING INTERNET DATAGRAMS + + +Status of this Memo + + We propose simple rules for broadcasting Internet datagrams on local + networks that support broadcast, for addressing broadcasts, and for + how gateways should handle them. + + This RFC suggests a proposed protocol for the ARPA-Internet + community, and requests discussion and suggestions for improvements. + Distribution of this memo is unlimited. + +Acknowledgement + + This proposal is the result of discussion with several other people, + especially J. Noel Chiappa and Christopher A. Kent, both of whom both + pointed me at important references. + +1. Introduction + + The use of broadcasts, especially on high-speed local area networks, + is a good base for many applications. Since broadcasting is not + covered in the basic IP specification [13], there is no agreed-upon + way to do it, and so protocol designers have not made use of it. (The + issue has been touched upon before, e.g. [6], but has not been the + subject of a standard.) + + We consider here only the case of unreliable, unsequenced, possibly + duplicated datagram broadcasts (for a discussion of TCP broadcasting, + see [11].) Even though unreliable and limited in length, datagram + broadcasts are quite useful [1]. + + We assume that the data link layer of the local network supports + efficient broadcasting. Most common local area networks do support + broadcast; for example, Ethernet [7, 5], ChaosNet [10], token ring + networks [2], etc. + + We do not assume, however, that broadcasts are reliably delivered. + (One might consider providing a reliable broadcast protocol as a + layer above IP.) It is quite expensive to guarantee delivery of + broadcasts; instead, what we assume is that a host will receive most + of the broadcasts that are sent. This is important to avoid + excessive use of broadcasts; since every host on the network devotes + at least some effort to every broadcast, they are costly. + + + +Mogul [Page 1] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + + When a datagram is broadcast, it imposes a cost on every host that + hears it. Therefore, broadcasting should not be used + indiscriminately, but rather only when it is the best solution to a + problem. + + Note: some organizations have divided their IP networks into subnets, + for which a standard [8] has been proposed. This RFC does not cover + the numerous complications arising from the interactions between + subnets and broadcasting; see [9] for a complete discussion. + +2. Terminology + + Because broadcasting depends on the specific data link layer in use + on a local network, we must discuss it with reference to both + physical networks and logical networks. + + The terms we will use in referring to physical networks are, from the + point of view of the host sending or forwarding a broadcast: + + Local Hardware Network + + The physical link to which the host is attached. + + Remote Hardware Network + + A physical network which is separated from the host by at least + one gateway. + + Collection of Hardware Networks + + A set of hardware networks (transitively) connected by gateways. + + The IP world includes several kinds of logical network. To avoid + ambiguity, we will use the following terms: + + Internet + + The DARPA Internet collection of IP networks. + + IP Network + + One or a collection of several hardware networks that have one + specific IP network number. + + + + + + +Mogul [Page 2] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + +3. Why Broadcast? + + Broadcasts are useful when a host needs to find information without + knowing exactly what other host can supply it, or when a host wants + to provide information to a large set of hosts in a timely manner. + + When a host needs information that one or more of its neighbors might + have, it could have a list of neighbors to ask, or it could poll all + of its possible neighbors until one responds. Use of a wired-in list + creates obvious network management problems (early binding is + inflexible). On the other hand, asking all of one's neighbors is + slow if one must generate plausible host addresses, and try them + until one works. On the ARPANET, for example, there are roughly 65 + thousand plausible host numbers. Most IP implementations have used + wired-in lists (for example, addresses of "Prime" gateways.) + Fortunately, broadcasting provides a fast and simple way for a host + to reach all of its neighbors. + + A host might also use a broadcast to provide all of its neighbors + with some information; for example, a gateway might announce its + presence to other gateways. + + One way to view broadcasting is as an imperfect substitute for + multicasting, the sending of messages to a subset of the hosts on a + network. In practice, broadcasts are usually used where multicasts + are what is wanted; packets are broadcast at the hardware level, but + filtering software in the receiving hosts gives the effect of + multicasting. + + For more examples of broadcast applications, see [1, 3]. + +4. Broadcast Classes + + There are several classes of IP broadcasting: + + - Single-destination datagram broadcast on the local IP net: A + datagrams is destined for a specific IP host, but the sending + host broadcasts it at the data link layer, perhaps to avoid + having to do routing. Since this is not an IP broadcast, the IP + layer is not involved, except that a host should discard + datagrams not meant for it without becoming flustered (i.e., + printing an error message). + + - Broadcast to all hosts on the local IP net: A distinguished + value for the host-number part of the IP address denotes + broadcast instead of a specific host. The receiving IP layer + must be able to recognize this address as well as its own. + + +Mogul [Page 3] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + + However, it might still be useful to distinguish at higher + levels between broadcasts and non-broadcasts, especially in + gateways. This is the most useful case of broadcast; it allows a + host to discover gateways without wired-in tables, it is the + basis for address resolution protocols, and it is also useful + for accessing such utilities as name servers, time servers, + etc., without requiring wired-in addresses. + + - Broadcast to all hosts on a remote IP network: It is + occasionally useful to send a broadcast to all hosts on a + non-local network; for example, to find the latest version of a + hostname database, to bootload a host on an IP network without a + bootserver, or to monitor the timeservers on the IP network. + This case is the same as local-network broadcasts; the datagram + is routed by normal mechanisms until it reaches a gateway + attached to the destination IP network, at which point it is + broadcast. This class of broadcasting is also known as "directed + broadcasting", or quaintly as sending a "letter bomb" [1]. + + - Broadcast to the entire Internet: This is probably not useful, + and almost certainly not desirable. + + For reasons of performance or security, a gateway may choose not to + forward broadcasts; especially, it may be a good idea to ban + broadcasts into or out of an autonomous group of networks. + +5. Broadcast Methods + + A host's IP receiving layer must be modified to support broadcasting. + In the absence of broadcasting, a host determines if it is the + recipient of a datagram by matching the destination address against + all of its IP addresses. With broadcasting, a host must compare the + destination address not only against the host's addresses, but also + against the possible broadcast addresses for that host. + + The problem of how best to send a broadcast has been extensively + discussed [1, 3, 4, 14, 15]. Since we assume that the problem has + already been solved at the data link layer, an IP host wishing to + send either a local broadcast or a directed broadcast need only + specify the appropriate destination address and send the datagram as + usual. Any sophisticated algorithms need only reside in gateways. + + + + + + + + +Mogul [Page 4] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + +6. Gateways and Broadcasts + + Most of the complexity in supporting broadcasts lies in gateways. If + a gateway receives a directed broadcast for a network to which it is + not connected, it simply forwards it using the usual mechanism. + Otherwise, it must do some additional work. + + When a gateway receives a local broadcast datagram, there are several + things it might have to do with it. The situation is unambiguous, + but without due care it is possible to create infinite loops. + + The appropriate action to take on receipt of a broadcast datagram + depends on several things: the subnet it was received on, the + destination network, and the addresses of the gateway. + + - The primary rule for avoiding loops is "never broadcast a + datagram on the hardware network it was received on". It is not + sufficient simply to avoid repeating datagrams that a gateway + has heard from itself; this still allows loops if there are + several gateways on a hardware network. + + - If the datagram is received on the hardware network to which it + is addressed, then it should not be forwarded. However, the + gateway should consider itself to be a destination of the + datagram (for example, it might be a routing table update.) + + - Otherwise, if the datagram is addressed to a hardware network to + which the gateway is connected, it should be sent as a (data + link layer) broadcast on that network. Again, the gateway + should consider itself a destination of the datagram. + + - Otherwise, the gateway should use its normal routing procedure + to choose a subsequent gateway, and send the datagram along to + it. + +7. Broadcast IP Addressing - Proposed Standards + + If different IP implementations are to be compatible, there must be a + distinguished number to denote "all hosts". + + Since the local network layer can always map an IP address into data + link layer address, the choice of an IP "broadcast host number" is + somewhat arbitrary. For simplicity, it should be one not likely to + be assigned to a real host. The number whose bits are all ones has + this property; this assignment was first proposed in [6]. In the few + cases where a host has been assigned an address with a host-number + part of all ones, it does not seem onerous to require renumbering. + + +Mogul [Page 5] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + + The address 255.255.255.255 denotes a broadcast on a local hardware + network, which must not be forwarded. This address may be used, for + example, by hosts that do not know their network number and are + asking some server for it. + + Thus, a host on net 36, for example, may: + + - broadcast to all of its immediate neighbors by using + 255.255.255.255 + + - broadcast to all of net 36 by using 36.255.255.255 + + (Note that unless the network has been broken up into subnets, these + two methods have identical effects.) + + If the use of "all ones" in a field of an IP address means + "broadcast", using "all zeros" could be viewed as meaning + "unspecified". There is probably no reason for such addresses to + appear anywhere but as the source address of an ICMP Information + Request datagram. However, as a notational convention, we refer to + networks (as opposed to hosts) by using addresses with zero fields. + For example, 36.0.0.0 means "network number 36" while 36.255.255.255 + means "all hosts on network number 36". + + 7.1. ARP Servers and Broadcasts + + The Address Resolution Protocol (ARP) described in [12] can, if + incorrectly implemented, cause problems when broadcasts are used + on a network where not all hosts share an understanding of what a + broadcast address is. The temptation exists to modify the ARP + server so that it provides the mapping between an IP broadcast + address and the hardware broadcast address. + + This temptation must be resisted. An ARP server should never + respond to a request whose target is a broadcast address. Such a + request can only come from a host that does not recognize the + broadcast address as such, and so honoring it would almost + certainly lead to a forwarding loop. If there are N such hosts on + the physical network that do not recognize this address as a + broadcast, then a datagram sent with a Time-To-Live of T could + potentially give rise to T**N spurious re-broadcasts. + + + + + + + + +Mogul [Page 6] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + +8. References + + 1. David Reeves Boggs. Internet Broadcasting. Ph.D. Th., Stanford + University, January 1982. + + 2. D.D. Clark, K.T. Pogran, and D.P. Reed. "An Introduction to + Local Area Networks". Proc. IEEE 66, 11, pp1497-1516, 1978. + + 3. Yogan Kantilal Dalal. Broadcast Protocols in Packet Switched + Computer Networks. Ph.D. Th., Stanford University, April 1977. + + 4. Yogan K. Dalal and Robert M. Metcalfe. "Reverse Path Forwarding + of Broadcast Packets". Comm. ACM 21, 12, pp1040-1048, December + 1978. + + 5. The Ethernet, A Local Area Network: Data Link Layer and Physical + Layer Specifications. Version 1.0, Digital Equipment + Corporation, Intel, Xerox, September 1980. + + 6. Robert Gurwitz and Robert Hinden. IP - Local Area Network + Addressing Issues. IEN-212, Bolt Beranek and Newman, September + 1982. + + 7. R.M. Metcalfe and D.R. Boggs. "Ethernet: Distributed Packet + Switching for Local Computer Networks". Comm. ACM 19, 7, + pp395-404, July 1976. Also CSL-75-7, Xerox Palo Alto Research + Center, reprinted in CSL-80-2. + + 8. Jeffrey Mogul. Internet Subnets. RFC-917, Stanford University, + October 1984. + + 9. Jeffrey Mogul. Broadcasting Internet Packets in the Presence of + Subnets. RFC-922, Stanford University, October 1984. + + 10. David A. Moon. Chaosnet. A.I. Memo 628, Massachusetts + Institute of Technology Artificial Intelligence Laboratory, June + 1981. + + 11. William W. Plummer. Internet Broadcast Protocols. IEN-10, Bolt + Beranek and Newman, March 1977. + + 12. David Plummer. An Ethernet Address Resolution Protocol. + RFC-826, Symbolics, September 1982. + + 13. Jon Postel. Internet Protocol. RFC 791, ISI, September 1981. + + + + +Mogul [Page 7] + + + +RFC 919 October 1984 +Broadcasting Internet Datagrams + + + 14. David W. Wall. Mechanisms for Broadcast and Selective + Broadcast. Ph.D. Th., Stanford University, June 1980. + + 15. David W. Wall and Susan S. Owicki. Center-based Broadcasting. + Computer Systems Lab Technical Report TR189, Stanford + University, June 1980. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Mogul [Page 8] + +======================================================================== + +Network Working Group Jeffrey Mogul +Request for Comments: 922 Computer Science Department + Stanford University + October 1984 + + BROADCASTING INTERNET DATAGRAMS IN THE PRESENCE OF SUBNETS + + +Status of this Memo + + We propose simple rules for broadcasting Internet datagrams on local + networks that support broadcast, for addressing broadcasts, and for + how gateways should handle them. + + This RFC suggests a proposed protocol for the ARPA-Internet + community, and requests discussion and suggestions for improvements. + Distribution of this memo is unlimited. + +Acknowledgement + + This proposal here is the result of discussion with several other + people, especially J. Noel Chiappa and Christopher A. Kent, both of + whom both pointed me at important references. + +1. Introduction + + The use of broadcasts, especially on high-speed local area networks, + is a good base for many applications. Since broadcasting is not + covered in the basic IP specification [12], there is no agreed-upon + way to do it, and so protocol designers have not made use of it. (The + issue has been touched upon before, e.g. [6], but has not been the + subject of a standard.) + + We consider here only the case of unreliable, unsequenced, possibly + duplicated datagram broadcasts (for a discussion of TCP broadcasting, + see [10].) Even though unreliable and limited in length, datagram + broadcasts are quite useful [1]. + + We assume that the data link layer of the local network supports + efficient broadcasting. Most common local area networks do support + broadcast; for example, Ethernet [7, 5], ChaosNet [9], token ring + networks [2], etc. + + We do not assume, however, that broadcasts are reliably delivered. + (One might consider providing a reliable datagram broadcast protocol + as a layer above IP.) It is quite expensive to guarantee delivery of + broadcasts; instead, what we assume is that a host will receive most + of the broadcasts that are sent. This is important to avoid + excessive use of broadcasts; since every host on the network devotes + at least some effort to every broadcast, they are costly. + + + +Mogul [Page 1] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + When a datagram is broadcast, it imposes a cost on every host that + hears it. Therefore, broadcasting should not be used + indiscriminately, but rather only when it is the best solution to a + problem. + +2. Terminology + + Because broadcasting depends on the specific data link layer in use + on a local network, we must discuss it with reference to both + physical networks and logical networks. + + The terms we will use in referring to physical networks are, from the + point of view of the host sending or forwarding a broadcast: + + Local Hardware Network + + The physical link to which the host is attached. + + Remote Hardware Network + + A physical network which is separated from the host by at least + one gateway. + + Collection of Hardware Networks + + A set of hardware networks (transitively) connected by gateways. + + The IP world includes several kinds of logical network. To avoid + ambiguity, we will use the following terms: + + Internet + + The DARPA Internet collection of IP networks. + + IP Network + + One or a collection of several hardware networks that have one + specific IP network number. + + Subnet + + A single member of the collection of hardware networks that + compose an IP network. Host addresses on a given subnet share an + IP network number with hosts on all other subnets of that IP + network, but the local-address part is divided into subnet-number + + + + +Mogul [Page 2] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + and host-number fields to indicate which subnet a host is on. We + do not assume a particular division of the local-address part; + this could vary from network to network. + + The introduction of a subnet level in the addressing hierarchy is at + variance with the IP specification [12], but as the use of + addressable subnets proliferates it is obvious that a broadcasting + scheme should support subnetting. For more on subnets, see [8]. + + In this paper, the term "host address" refers to the host-on-subnet + address field of a subnetted IP network, or the host-part field + otherwise. + + An IP network may consist of a single hardware network or a + collection of subnets; from the point of view of a host on another IP + network, it should not matter. + +3. Why Broadcast? + + Broadcasts are useful when a host needs to find information without + knowing exactly what other host can supply it, or when a host wants + to provide information to a large set of hosts in a timely manner. + + When a host needs information that one or more of its neighbors might + have, it could have a list of neighbors to ask, or it could poll all + of its possible neighbors until one responds. Use of a wired-in list + creates obvious network management problems (early binding is + inflexible). On the other hand, asking all of one's neighbors is + slow if one must generate plausible host addresses, and try them + until one works. On the ARPANET, for example, there are roughly 65 + thousand plausible host numbers. Most IP implementations have used + wired-in lists (for example, addresses of "Prime" gateways.) + Fortunately, broadcasting provides a fast and simple way for a host + to reach all of its neighbors. + + A host might also use a broadcast to provide all of its neighbors + with some information; for example, a gateway might announce its + presence to other gateways. + + One way to view broadcasting is as an imperfect substitute for + multicasting, the sending of messages to a subset of the hosts on a + network. In practice, broadcasts are usually used where multicasts + are what is wanted; datagrams are broadcast at the hardware level, + but filtering software in the receiving hosts gives the effect of + multicasting. + + For more examples of broadcast applications, see [1, 3]. + + +Mogul [Page 3] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + +4. Broadcast Classes + + There are several classes of IP broadcasting: + + - Single-destination datagrams broadcast on the local hardware + net: A datagram is destined for a specific IP host, but the + sending host broadcasts it at the data link layer, perhaps to + avoid having to do routing. Since this is not an IP broadcast, + the IP layer is not involved, except that a host should discard + datagram not meant for it without becoming flustered (i.e., + printing an error message). + + - Broadcast to all hosts on the local hardware net: A + distinguished value for the host-number part of the IP address + denotes broadcast instead of a specific host. The receiving IP + layer must be able to recognize this address as well as its own. + However, it might still be useful to distinguish at higher + levels between broadcasts and non-broadcasts, especially in + gateways. This is the most useful case of broadcast; it allows + a host to discover gateways without wired-in tables, it is the + basis for address resolution protocols, and it is also useful + for accessing such utilities as name servers, time servers, + etc., without requiring wired-in addresses. + + - Broadcast to all hosts on a remote hardware network: It is + occasionally useful to send a broadcast to all hosts on a + non-local network; for example, to find the latest version of a + hostname database, to bootload a host on a subnet without a + bootserver, or to monitor the timeservers on the subnet. This + case is the same as local-network broadcasts; the datagram is + routed by normal mechanisms until it reaches a gateway attached + to the destination hardware network, at which point it is + broadcast. This class of broadcasting is also known as + "directed broadcasting", or quaintly as sending a "letter bomb" + [1]. + + - Broadcast to all hosts on a subnetted IP network (Multi-subnet + broadcasts): A distinguished value for the subnet-number part of + the IP address is used to denote "all subnets". Broadcasts to + all hosts of a remote subnetted IP network are done just as + directed broadcasts to a single subnet. + + - Broadcast to the entire Internet: This is probably not useful, + and almost certainly not desirable. + + + + + +Mogul [Page 4] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + For reasons of performance or security, a gateway may choose not to + forward broadcasts; especially, it may be a good idea to ban + broadcasts into or out of an autonomous group of networks. + +5. Broadcast Methods + + A host's IP receiving layer must be modified to support broadcasting. + In the absence of broadcasting, a host determines if it is the + recipient of a datagram by matching the destination address against + all of its IP addresses. With broadcasting, a host must compare the + destination address not only against the host's addresses, but also + against the possible broadcast addresses for that host. + + The problem of how best to send a broadcast has been extensively + discussed [1, 3, 4, 13, 14]. Since we assume that the problem has + already been solved at the data link layer, an IP host wishing to + send either a local broadcast or a directed broadcast need only + specify the appropriate destination address and send the datagram as + usual. Any sophisticated algorithms need only reside in gateways. + + The problem of broadcasting to all hosts on a subnetted IP network is + apparently somewhat harder. However, even in this case it turns out + that the best known algorithms require no additional complexity in + non-gateway hosts. A good broadcast method will meet these + additional criteria: + + - No modification of the IP datagram format. + + - Reasonable efficiency in terms of the number of excess copies + generated and the cost of paths chosen. + + - Minimization of gateway modification, in both code and data + space. + + - High likelihood of delivery. + + The algorithm that appears best is the Reverse Path Forwarding (RPF) + method [4]. While RPF is suboptimal in cost and reliability, it is + quite good, and is extremely simple to implement, requiring no + additional data space in a gateway. + + + + + + + + + +Mogul [Page 5] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + +6. Gateways and Broadcasts + + Most of the complexity in supporting broadcasts lies in gateways. If + a gateway receives a directed broadcast for a network to which it is + not connected, it simply forwards it using the usual mechanism. + Otherwise, it must do some additional work. + + 6.1. Local Broadcasts + + When a gateway receives a local broadcast datagram, there are + several things it might have to do with it. The situation is + unambiguous, but without due care it is possible to create + infinite loops. + + The appropriate action to take on receipt of a broadcast datagram + depends on several things: the subnet it was received on, the + destination network, and the addresses of the gateway. + + - The primary rule for avoiding loops is "never broadcast a + datagram on the hardware network it was received on". It is + not sufficient simply to avoid repeating datagram that a + gateway has heard from itself; this still allows loops if + there are several gateways on a hardware network. + + - If the datagram is received on the hardware network to which + it is addressed, then it should not be forwarded. However, + the gateway should consider itself to be a destination of the + datagram (for example, it might be a routing table update.) + + - Otherwise, if the datagram is addressed to a hardware network + to which the gateway is connected, it should be sent as a + (data link layer) broadcast on that network. Again, the + gateway should consider itself a destination of the datagram. + + - Otherwise, the gateway should use its normal routing + procedure to choose a subsequent gateway, and send the + datagram along to it. + + + + + + + + + + + + +Mogul [Page 6] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + 6.2. Multi-subnet broadcasts + + When a gateway receives a broadcast meant for all subnets of an IP + network, it must use the Reverse Path Forwarding algorithm to + decide what to do. The method is simple: the gateway should + forward copies of the datagram along all connected links, if and + only if the datagram arrived on the link which is part of the best + route between the gateway and the source of the datagram. + Otherwise, the datagram should be discarded. + + This algorithm may be improved if some or all of the gateways + exchange among themselves additional information; this can be done + transparently from the point of view of other hosts and even other + gateways. See [4, 3] for details. + + 6.3. Pseudo-Algol Routing Algorithm + + This is a pseudo-Algol description of the routing algorithm a + gateway should use. The algorithm is shown in figure 1. Some + definitions are: + + RouteLink(host) + + A function taking a host address as a parameter and returning + the first-hop link from the gateway to the host. + + RouteHost(host) + + As above but returns the first-hop host address. + + ResolveAddress(host) + + Returns the hardware address for an IP host. + + IncomingLink + + The link on which the packet arrived. + + OutgoingLinkSet + + The set of links on which the packet should be sent. + + OutgoingHardwareHost + + The hardware host address to send the packet to. + + + + +Mogul [Page 7] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + Destination.host + + The host-part of the destination address. + + Destination.subnet + + The subnet-part of the destination address. + + Destination.ipnet + + The IP-network-part of the destination address. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Mogul [Page 8] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + +BEGIN + IF Destination.ipnet IN AllLinks THEN + BEGIN + IF IsSubnetted(Destination.ipnet) THEN + BEGIN + IF Destination.subnet = BroadcastSubnet THEN + BEGIN /* use Reverse Path Forwarding algorithm */ + IF IncomingLink = RouteLink(Source) THEN + BEGIN IF Destination.host = BroadcastHost THEN + OutgoingLinkSet <- AllLinks - + IncomingLink; + OutgoingHost <- BroadcastHost; + Examine packet for possible internal use; + END + ELSE /* duplicate from another gateway, discard */ + Discard; + END + ELSE + IF Destination.subnet = IncomingLink.subnet THEN + BEGIN /* forwarding would cause a loop */ + IF Destination.host = BroadcastHost THEN + Examine packet for possible internal use; + Discard; + END + ELSE BEGIN /* forward to (possibly local) subnet */ + OutgoingLinkSet <- RouteLink(Destination); + OutgoingHost <- RouteHost(Destination); + END + END + ELSE BEGIN /* destined for one of our local networks */ + IF Destination.ipnet = IncomingLink.ipnet THEN + BEGIN /* forwarding would cause a loop */ + IF Destination.host = BroadcastHost THEN + Examine packet for possible internal use; + Discard; + END + ELSE BEGIN /* might be a broadcast */ + OutgoingLinkSet <- RouteLink(Destination); + OutgoingHost <- RouteHost(Destination); + END + END + END + ELSE BEGIN /* forward to a non-local IP network */ + OutgoingLinkSet <- RouteLink(Destination); + OutgoingHost <- RouteHost(Destination); + END + OutgoingHardwareHost <- ResolveAddress(OutgoingHost); +END + +Figure 1: Pseudo-Algol algorithm for routing broadcasts by gateways + +Mogul [Page 9] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + +7. Broadcast IP Addressing - Conventions + + If different IP implementations are to be compatible, there must be + convention distinguished number to denote "all hosts" and "all + subnets". + + Since the local network layer can always map an IP address into data + link layer address, the choice of an IP "broadcast host number" is + somewhat arbitrary. For simplicity, it should be one not likely to + be assigned to a real host. The number whose bits are all ones has + this property; this assignment was first proposed in [6]. In the few + cases where a host has been assigned an address with a host-number + part of all ones, it does not seem onerous to require renumbering. + + The "all subnets" number is also all ones; this means that a host + wishing to broadcast to all hosts on a remote IP network need not + know how the destination address is divided up into subnet and host + fields, or if it is even divided at all. For example, 36.255.255.255 + may denote all the hosts on a single hardware network, or all the + hosts on a subnetted IP network with 1 byte of subnet field and 2 + bytes of host field, or any other possible division. + + The address 255.255.255.255 denotes a broadcast on a local hardware + network that must not be forwarded. This address may be used, for + example, by hosts that do not know their network number and are + asking some server for it. + + Thus, a host on net 36, for example, may: + + - broadcast to all of its immediate neighbors by using + 255.255.255.255 + + - broadcast to all of net 36 by using 36.255.255.255 + + without knowing if the net is subnetted; if it is not, then both + addresses have the same effect. A robust application might try the + former address, and if no response is received, then try the latter. + See [1] for a discussion of such "expanding ring search" techniques. + + If the use of "all ones" in a field of an IP address means + "broadcast", using "all zeros" could be viewed as meaning + "unspecified". There is probably no reason for such addresses to + appear anywhere but as the source address of an ICMP Information + Request datagram. However, as a notational convention, we refer to + networks (as opposed to hosts) by using addresses with zero fields. + For example, 36.0.0.0 means "network number 36" while 36.255.255.255 + means "all hosts on network number 36". + + +Mogul [Page 10] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + 7.1. ARP Servers and Broadcasts + + The Address Resolution Protocol (ARP) described in [11] can, if + incorrectly implemented, cause problems when broadcasts are used + on a network where not all hosts share an understanding of what a + broadcast address is. The temptation exists to modify the ARP + server so that it provides the mapping between an IP broadcast + address and the hardware broadcast address. + + This temptation must be resisted. An ARP server should never + respond to a request whose target is a broadcast address. Such a + request can only come from a host that does not recognize the + broadcast address as such, and so honoring it would almost + certainly lead to a forwarding loop. If there are N such hosts on + the physical network that do not recognize this address as a + broadcast, then a datagram sent with a Time-To-Live of T could + potentially give rise to T**N spurious re-broadcasts. + +8. References + + 1. David Reeves Boggs. Internet Broadcasting. Ph.D. Th., Stanford + University, January 1982. + + 2. D.D. Clark, K.T. Pogran, and D.P. Reed. "An Introduction to + Local Area Networks". Proc. IEEE 66, 11, pp1497-1516, + November 1978. + + 3. Yogan Kantilal Dalal. Broadcast Protocols in Packet Switched + Computer Networks. Ph.D. Th., Stanford University, April 1977. + + 4. Yogan K. Dalal and Robert M. Metcalfe. "Reverse Path Forwarding + of Broadcast Packets". Comm. ACM 21, 12, pp1040-1048, + December 1978. + + 5. The Ethernet, A Local Area Network: Data Link Layer and Physical + Layer Specifications. Version 1.0, Digital Equipment + Corporation, Intel, Xerox, September 1980. + + 6. Robert Gurwitz and Robert Hinden. IP - Local Area Network + Addressing Issues. IEN-212, BBN, September 1982. + + 7. R.M. Metcalfe and D.R. Boggs. "Ethernet: Distributed Packet + Switching for Local Computer Networks". Comm. ACM 19, 7, + pp395-404, July 1976. Also CSL-75-7, Xerox Palo Alto Research + Center, reprinted in CSL-80-2. + + + + +Mogul [Page 11] + + + +RFC 922 October 1984 +Broadcasting Internet Datagrams in the Presence of Subnets + + + 8. Jeffrey Mogul. Internet Subnets. RFC-917, Stanford University, + October 1984. + + 9. David A. Moon. Chaosnet. A.I. Memo 628, Massachusetts + Institute of Technology Artificial Intelligence Laboratory, + June 1981. + + 10. William W. Plummer. Internet Broadcast Protocols. IEN-10, BBN, + March 1977. + + 11. David Plummer. An Ethernet Address Resolution Protocol. + RFC-826, Symbolics, September 1982. + + 12. Jon Postel. Internet Protocol. RFC-791, ISI, September 1981. + + 13. David W. Wall. Mechanisms for Broadcast and Selective + Broadcast. Ph.D. Th., Stanford University, June 1980. + + 14. David W. Wall and Susan S. Owicki. Center-based Broadcasting. + Computer Systems Lab Technical Report TR189, Stanford + University, June 1980. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Mogul [Page 12] + +======================================================================== + +Network Working Group J. Postel +Request for Comments: 792 ISI + September 1981 +Updates: RFCs 777, 760 +Updates: IENs 109, 128 + + INTERNET CONTROL MESSAGE PROTOCOL + + DARPA INTERNET PROGRAM + PROTOCOL SPECIFICATION + + + +Introduction + + The Internet Protocol (IP) [1] is used for host-to-host datagram + service in a system of interconnected networks called the + Catenet [2]. The network connecting devices are called Gateways. + These gateways communicate between themselves for control purposes + via a Gateway to Gateway Protocol (GGP) [3,4]. Occasionally a + gateway or destination host will communicate with a source host, for + example, to report an error in datagram processing. For such + purposes this protocol, the Internet Control Message Protocol (ICMP), + is used. ICMP, uses the basic support of IP as if it were a higher + level protocol, however, ICMP is actually an integral part of IP, and + must be implemented by every IP module. + + ICMP messages are sent in several situations: for example, when a + datagram cannot reach its destination, when the gateway does not have + the buffering capacity to forward a datagram, and when the gateway + can direct the host to send traffic on a shorter route. + + The Internet Protocol is not designed to be absolutely reliable. The + purpose of these control messages is to provide feedback about + problems in the communication environment, not to make IP reliable. + There are still no guarantees that a datagram will be delivered or a + control message will be returned. Some datagrams may still be + undelivered without any report of their loss. The higher level + protocols that use IP must implement their own reliability procedures + if reliable communication is required. + + The ICMP messages typically report errors in the processing of + datagrams. To avoid the infinite regress of messages about messages + etc., no ICMP messages are sent about ICMP messages. Also ICMP + messages are only sent about errors in handling fragment zero of + fragemented datagrams. (Fragment zero has the fragment offeset equal + zero). + + + + + + + + [Page 1] + + + September 1981 +RFC 792 + + + +Message Formats + + ICMP messages are sent using the basic IP header. The first octet of + the data portion of the datagram is a ICMP type field; the value of + this field determines the format of the remaining data. Any field + labeled "unused" is reserved for later extensions and must be zero + when sent, but receivers should not use these fields (except to + include them in the checksum). Unless otherwise noted under the + individual format descriptions, the values of the internet header + fields are as follows: + + Version + + 4 + + IHL + + Internet header length in 32-bit words. + + Type of Service + + 0 + + Total Length + + Length of internet header and data in octets. + + Identification, Flags, Fragment Offset + + Used in fragmentation, see [1]. + + Time to Live + + Time to live in seconds; as this field is decremented at each + machine in which the datagram is processed, the value in this + field should be at least as great as the number of gateways which + this datagram will traverse. + + Protocol + + ICMP = 1 + + Header Checksum + + The 16 bit one's complement of the one's complement sum of all 16 + bit words in the header. For computing the checksum, the checksum + field should be zero. This checksum may be replaced in the + future. + + +[Page 2] + + +September 1981 +RFC 792 + + + + Source Address + + The address of the gateway or host that composes the ICMP message. + Unless otherwise noted, this can be any of a gateway's addresses. + + Destination Address + + The address of the gateway or host to which the message should be + sent. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 3] + + + September 1981 +RFC 792 + + + +Destination Unreachable Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unused | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Internet Header + 64 bits of Original Data Datagram | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Destination Address + + The source network and address from the original datagram's data. + + ICMP Fields: + + Type + + 3 + + Code + + 0 = net unreachable; + + 1 = host unreachable; + + 2 = protocol unreachable; + + 3 = port unreachable; + + 4 = fragmentation needed and DF set; + + 5 = source route failed. + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Internet Header + 64 bits of Data Datagram + + The internet header plus the first 64 bits of the original + + +[Page 4] + + +September 1981 +RFC 792 + + + + datagram's data. This data is used by the host to match the + message to the appropriate process. If a higher level protocol + uses port numbers, they are assumed to be in the first 64 data + bits of the original datagram's data. + + Description + + If, according to the information in the gateway's routing tables, + the network specified in the internet destination field of a + datagram is unreachable, e.g., the distance to the network is + infinity, the gateway may send a destination unreachable message + to the internet source host of the datagram. In addition, in some + networks, the gateway may be able to determine if the internet + destination host is unreachable. Gateways in these networks may + send destination unreachable messages to the source host when the + destination host is unreachable. + + If, in the destination host, the IP module cannot deliver the + datagram because the indicated protocol module or process port is + not active, the destination host may send a destination + unreachable message to the source host. + + Another case is when a datagram must be fragmented to be forwarded + by a gateway yet the Don't Fragment flag is on. In this case the + gateway must discard the datagram and may return a destination + unreachable message. + + Codes 0, 1, 4, and 5 may be received from a gateway. Codes 2 and + 3 may be received from a host. + + + + + + + + + + + + + + + + + + + + + + [Page 5] + + + September 1981 +RFC 792 + + + +Time Exceeded Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unused | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Internet Header + 64 bits of Original Data Datagram | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Destination Address + + The source network and address from the original datagram's data. + + ICMP Fields: + + Type + + 11 + + Code + + 0 = time to live exceeded in transit; + + 1 = fragment reassembly time exceeded. + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Internet Header + 64 bits of Data Datagram + + The internet header plus the first 64 bits of the original + datagram's data. This data is used by the host to match the + message to the appropriate process. If a higher level protocol + uses port numbers, they are assumed to be in the first 64 data + bits of the original datagram's data. + + Description + + If the gateway processing a datagram finds the time to live field + + +[Page 6] + + +September 1981 +RFC 792 + + + + is zero it must discard the datagram. The gateway may also notify + the source host via the time exceeded message. + + If a host reassembling a fragmented datagram cannot complete the + reassembly due to missing fragments within its time limit it + discards the datagram, and it may send a time exceeded message. + + If fragment zero is not available then no time exceeded need be + sent at all. + + Code 0 may be received from a gateway. Code 1 may be received + from a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 7] + + + September 1981 +RFC 792 + + + +Parameter Problem Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Pointer | unused | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Internet Header + 64 bits of Original Data Datagram | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Destination Address + + The source network and address from the original datagram's data. + + ICMP Fields: + + Type + + 12 + + Code + + 0 = pointer indicates the error. + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Pointer + + If code = 0, identifies the octet where an error was detected. + + Internet Header + 64 bits of Data Datagram + + The internet header plus the first 64 bits of the original + datagram's data. This data is used by the host to match the + message to the appropriate process. If a higher level protocol + uses port numbers, they are assumed to be in the first 64 data + bits of the original datagram's data. + + + + +[Page 8] + + +September 1981 +RFC 792 + + + + Description + + If the gateway or host processing a datagram finds a problem with + the header parameters such that it cannot complete processing the + datagram it must discard the datagram. One potential source of + such a problem is with incorrect arguments in an option. The + gateway or host may also notify the source host via the parameter + problem message. This message is only sent if the error caused + the datagram to be discarded. + + The pointer identifies the octet of the original datagram's header + where the error was detected (it may be in the middle of an + option). For example, 1 indicates something is wrong with the + Type of Service, and (if there are options present) 20 indicates + something is wrong with the type code of the first option. + + Code 0 may be received from a gateway or a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 9] + + + September 1981 +RFC 792 + + + +Source Quench Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unused | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Internet Header + 64 bits of Original Data Datagram | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Destination Address + + The source network and address of the original datagram's data. + + ICMP Fields: + + Type + + 4 + + Code + + 0 + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Internet Header + 64 bits of Data Datagram + + The internet header plus the first 64 bits of the original + datagram's data. This data is used by the host to match the + message to the appropriate process. If a higher level protocol + uses port numbers, they are assumed to be in the first 64 data + bits of the original datagram's data. + + Description + + A gateway may discard internet datagrams if it does not have the + buffer space needed to queue the datagrams for output to the next + network on the route to the destination network. If a gateway + + +[Page 10] + + +September 1981 +RFC 792 + + + + discards a datagram, it may send a source quench message to the + internet source host of the datagram. A destination host may also + send a source quench message if datagrams arrive too fast to be + processed. The source quench message is a request to the host to + cut back the rate at which it is sending traffic to the internet + destination. The gateway may send a source quench message for + every message that it discards. On receipt of a source quench + message, the source host should cut back the rate at which it is + sending traffic to the specified destination until it no longer + receives source quench messages from the gateway. The source host + can then gradually increase the rate at which it sends traffic to + the destination until it again receives source quench messages. + + The gateway or host may send the source quench message when it + approaches its capacity limit rather than waiting until the + capacity is exceeded. This means that the data datagram which + triggered the source quench message may be delivered. + + Code 0 may be received from a gateway or a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 11] + + + September 1981 +RFC 792 + + + +Redirect Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Gateway Internet Address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Internet Header + 64 bits of Original Data Datagram | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Destination Address + + The source network and address of the original datagram's data. + + ICMP Fields: + + Type + + 5 + + Code + + 0 = Redirect datagrams for the Network. + + 1 = Redirect datagrams for the Host. + + 2 = Redirect datagrams for the Type of Service and Network. + + 3 = Redirect datagrams for the Type of Service and Host. + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Gateway Internet Address + + Address of the gateway to which traffic for the network specified + in the internet destination network field of the original + datagram's data should be sent. + + + + +[Page 12] + + +September 1981 +RFC 792 + + + + Internet Header + 64 bits of Data Datagram + + The internet header plus the first 64 bits of the original + datagram's data. This data is used by the host to match the + message to the appropriate process. If a higher level protocol + uses port numbers, they are assumed to be in the first 64 data + bits of the original datagram's data. + + Description + + The gateway sends a redirect message to a host in the following + situation. A gateway, G1, receives an internet datagram from a + host on a network to which the gateway is attached. The gateway, + G1, checks its routing table and obtains the address of the next + gateway, G2, on the route to the datagram's internet destination + network, X. If G2 and the host identified by the internet source + address of the datagram are on the same network, a redirect + message is sent to the host. The redirect message advises the + host to send its traffic for network X directly to gateway G2 as + this is a shorter path to the destination. The gateway forwards + the original datagram's data to its internet destination. + + For datagrams with the IP source route options and the gateway + address in the destination address field, a redirect message is + not sent even if there is a better route to the ultimate + destination than the next address in the source route. + + Codes 0, 1, 2, and 3 may be received from a gateway. + + + + + + + + + + + + + + + + + + + + + + + [Page 13] + + + September 1981 +RFC 792 + + + +Echo or Echo Reply Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identifier | Sequence Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Data ... + +-+-+-+-+- + + IP Fields: + + Addresses + + The address of the source in an echo message will be the + destination of the echo reply message. To form an echo reply + message, the source and destination addresses are simply reversed, + the type code changed to 0, and the checksum recomputed. + + IP Fields: + + Type + + 8 for echo message; + + 0 for echo reply message. + + Code + + 0 + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + If the total length is odd, the received data is padded with one + octet of zeros for computing the checksum. This checksum may be + replaced in the future. + + Identifier + + If code = 0, an identifier to aid in matching echos and replies, + may be zero. + + Sequence Number + + +[Page 14] + + +September 1981 +RFC 792 + + + + If code = 0, a sequence number to aid in matching echos and + replies, may be zero. + + Description + + The data received in the echo message must be returned in the echo + reply message. + + The identifier and sequence number may be used by the echo sender + to aid in matching the replies with the echo requests. For + example, the identifier might be used like a port in TCP or UDP to + identify a session, and the sequence number might be incremented + on each echo request sent. The echoer returns these same values + in the echo reply. + + Code 0 may be received from a gateway or a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 15] + + + September 1981 +RFC 792 + + + +Timestamp or Timestamp Reply Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identifier | Sequence Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Originate Timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Receive Timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Transmit Timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Addresses + + The address of the source in a timestamp message will be the + destination of the timestamp reply message. To form a timestamp + reply message, the source and destination addresses are simply + reversed, the type code changed to 14, and the checksum + recomputed. + + IP Fields: + + Type + + 13 for timestamp message; + + 14 for timestamp reply message. + + Code + + 0 + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Identifier + + + + +[Page 16] + + +September 1981 +RFC 792 + + + + If code = 0, an identifier to aid in matching timestamp and + replies, may be zero. + + Sequence Number + + If code = 0, a sequence number to aid in matching timestamp and + replies, may be zero. + + Description + + The data received (a timestamp) in the message is returned in the + reply together with an additional timestamp. The timestamp is 32 + bits of milliseconds since midnight UT. One use of these + timestamps is described by Mills [5]. + + The Originate Timestamp is the time the sender last touched the + message before sending it, the Receive Timestamp is the time the + echoer first touched it on receipt, and the Transmit Timestamp is + the time the echoer last touched the message on sending it. + + If the time is not available in miliseconds or cannot be provided + with respect to midnight UT then any time can be inserted in a + timestamp provided the high order bit of the timestamp is also set + to indicate this non-standard value. + + The identifier and sequence number may be used by the echo sender + to aid in matching the replies with the requests. For example, + the identifier might be used like a port in TCP or UDP to identify + a session, and the sequence number might be incremented on each + request sent. The destination returns these same values in the + reply. + + Code 0 may be received from a gateway or a host. + + + + + + + + + + + + + + + + + + [Page 17] + + + September 1981 +RFC 792 + + + +Information Request or Information Reply Message + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Type | Code | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identifier | Sequence Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + IP Fields: + + Addresses + + The address of the source in a information request message will be + the destination of the information reply message. To form a + information reply message, the source and destination addresses + are simply reversed, the type code changed to 16, and the checksum + recomputed. + + IP Fields: + + Type + + 15 for information request message; + + 16 for information reply message. + + Code + + 0 + + Checksum + + The checksum is the 16-bit ones's complement of the one's + complement sum of the ICMP message starting with the ICMP Type. + For computing the checksum , the checksum field should be zero. + This checksum may be replaced in the future. + + Identifier + + If code = 0, an identifier to aid in matching request and replies, + may be zero. + + Sequence Number + + If code = 0, a sequence number to aid in matching request and + replies, may be zero. + + +[Page 18] + + +September 1981 +RFC 792 + + + + Description + + This message may be sent with the source network in the IP header + source and destination address fields zero (which means "this" + network). The replying IP module should send the reply with the + addresses fully specified. This message is a way for a host to + find out the number of the network it is on. + + The identifier and sequence number may be used by the echo sender + to aid in matching the replies with the requests. For example, + the identifier might be used like a port in TCP or UDP to identify + a session, and the sequence number might be incremented on each + request sent. The destination returns these same values in the + reply. + + Code 0 may be received from a gateway or a host. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 19] + + + September 1981 +RFC 792 + + + +Summary of Message Types + + 0 Echo Reply + + 3 Destination Unreachable + + 4 Source Quench + + 5 Redirect + + 8 Echo + + 11 Time Exceeded + + 12 Parameter Problem + + 13 Timestamp + + 14 Timestamp Reply + + 15 Information Request + + 16 Information Reply + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 20] + + +September 1981 +RFC 792 + + + +References + + [1] Postel, J. (ed.), "Internet Protocol - DARPA Internet Program + Protocol Specification," RFC 791, USC/Information Sciences + Institute, September 1981. + + [2] Cerf, V., "The Catenet Model for Internetworking," IEN 48, + Information Processing Techniques Office, Defense Advanced + Research Projects Agency, July 1978. + + [3] Strazisar, V., "Gateway Routing: An Implementation + Specification", IEN 30, Bolt Beranek and Newman, April 1979. + + [4] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek + and Newman, August 1979. + + [5] Mills, D., "DCNET Internet Clock Service," RFC 778, COMSAT + Laboratories, April 1981. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 21] + +======================================================================== + + + + +Network Working Group S. Deering +Request for Comments: 1112 Stanford University +Obsoletes: RFCs 988, 1054 August 1989 + + + Host Extensions for IP Multicasting + +1. STATUS OF THIS MEMO + + This memo specifies the extensions required of a host implementation + of the Internet Protocol (IP) to support multicasting. It is the + recommended standard for IP multicasting in the Internet. + Distribution of this memo is unlimited. + +2. INTRODUCTION + + IP multicasting is the transmission of an IP datagram to a "host + group", a set of zero or more hosts identified by a single IP + destination address. A multicast datagram is delivered to all + members of its destination host group with the same "best-efforts" + reliability as regular unicast IP datagrams, i.e., the datagram is + not guaranteed to arrive intact at all members of the destination + group or in the same order relative to other datagrams. + + The membership of a host group is dynamic; that is, hosts may join + and leave groups at any time. There is no restriction on the + location or number of members in a host group. A host may be a + member of more than one group at a time. A host need not be a member + of a group to send datagrams to it. + + A host group may be permanent or transient. A permanent group has a + well-known, administratively assigned IP address. It is the address, + not the membership of the group, that is permanent; at any time a + permanent group may have any number of members, even zero. Those IP + multicast addresses that are not reserved for permanent groups are + available for dynamic assignment to transient groups which exist only + as long as they have members. + + Internetwork forwarding of IP multicast datagrams is handled by + "multicast routers" which may be co-resident with, or separate from, + internet gateways. A host transmits an IP multicast datagram as a + local network multicast which reaches all immediately-neighboring + members of the destination host group. If the datagram has an IP + time-to-live greater than 1, the multicast router(s) attached to the + local network take responsibility for forwarding it towards all other + networks that have members of the destination group. On those other + member networks that are reachable within the IP time-to-live, an + attached multicast router completes delivery by transmitting the + + + +Deering [Page 1] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + datagram as a local multicast. + + This memo specifies the extensions required of a host IP + implementation to support IP multicasting, where a "host" is any + internet host or gateway other than those acting as multicast + routers. The algorithms and protocols used within and between + multicast routers are transparent to hosts and will be specified in + separate documents. This memo also does not specify how local + network multicasting is accomplished for all types of network, + although it does specify the required service interface to an + arbitrary local network and gives an Ethernet specification as an + example. Specifications for other types of network will be the + subject of future memos. + +3. LEVELS OF CONFORMANCE + + There are three levels of conformance to this specification: + + Level 0: no support for IP multicasting. + + There is, at this time, no requirement that all IP implementations + support IP multicasting. Level 0 hosts will, in general, be + unaffected by multicast activity. The only exception arises on some + types of local network, where the presence of level 1 or 2 hosts may + cause misdelivery of multicast IP datagrams to level 0 hosts. Such + datagrams can easily be identified by the presence of a class D IP + address in their destination address field; they should be quietly + discarded by hosts that do not support IP multicasting. Class D + addresses are described in section 4 of this memo. + + Level 1: support for sending but not receiving multicast IP + datagrams. + + Level 1 allows a host to partake of some multicast-based services, + such as resource location or status reporting, but it does not allow + a host to join any host groups. An IP implementation may be upgraded + from level 0 to level 1 very easily and with little new code. Only + sections 4, 5, and 6 of this memo are applicable to level 1 + implementations. + + Level 2: full support for IP multicasting. + + Level 2 allows a host to join and leave host groups, as well as send + IP datagrams to host groups. It requires implementation of the + Internet Group Management Protocol (IGMP) and extension of the IP and + local network service interfaces within the host. All of the + following sections of this memo are applicable to level 2 + implementations. + + + +Deering [Page 2] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +4. HOST GROUP ADDRESSES + + Host groups are identified by class D IP addresses, i.e., those with + "1110" as their high-order four bits. Class E IP addresses, i.e., + those with "1111" as their high-order four bits, are reserved for + future addressing modes. + + In Internet standard "dotted decimal" notation, host group addresses + range from 224.0.0.0 to 239.255.255.255. The address 224.0.0.0 is + guaranteed not to be assigned to any group, and 224.0.0.1 is assigned + to the permanent group of all IP hosts (including gateways). This is + used to address all multicast hosts on the directly connected + network. There is no multicast address (or any other IP address) for + all hosts on the total Internet. The addresses of other well-known, + permanent groups are to be published in "Assigned Numbers". + + Appendix II contains some background discussion of several issues + related to host group addresses. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Deering [Page 3] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +5. MODEL OF A HOST IP IMPLEMENTATION + + The multicast extensions to a host IP implementation are specified in + terms of the layered model illustrated below. In this model, ICMP + and (for level 2 hosts) IGMP are considered to be implemented within + the IP module, and the mapping of IP addresses to local network + addresses is considered to be the responsibility of local network + modules. This model is for expository purposes only, and should not + be construed as constraining an actual implementation. + + | | + | Upper-Layer Protocol Modules | + |__________________________________________________________| + + --------------------- IP Service Interface ----------------------- + __________________________________________________________ + | | | | + | | ICMP | IGMP | + | IP |______________|______________| + | Module | + | | + |__________________________________________________________| + + ---------------- Local Network Service Interface ----------------- + __________________________________________________________ + | | | + | Local | IP-to-local address mapping | + | Network | (e.g., ARP) | + | Modules |_____________________________| + | (e.g., Ethernet) | + | | + + To provide level 1 multicasting, a host IP implementation must + support the transmission of multicast IP datagrams. To provide level + 2 multicasting, a host must also support the reception of multicast + IP datagrams. Each of these two new services is described in a + separate section, below. For each service, extensions are specified + for the IP service interface, the IP module, the local network + service interface, and an Ethernet local network module. Extensions + to local network modules other than Ethernet are mentioned briefly, + but are not specified in detail. + + + + + + + + + + +Deering [Page 4] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +6. SENDING MULTICAST IP DATAGRAMS + +6.1. Extensions to the IP Service Interface + + Multicast IP datagrams are sent using the same "Send IP" operation + used to send unicast IP datagrams; an upper-layer protocol module + merely specifies an IP host group address, rather than an individual + IP address, as the destination. However, a number of extensions may + be necessary or desirable. + + First, the service interface should provide a way for the upper-layer + protocol to specify the IP time-to-live of an outgoing multicast + datagram, if such a capability does not already exist. If the + upper-layer protocol chooses not to specify a time-to-live, it should + default to 1 for all multicast IP datagrams, so that an explicit + choice is required to multicast beyond a single network. + + Second, for hosts that may be attached to more than one network, the + service interface should provide a way for the upper-layer protocol + to identify which network interface is be used for the multicast + transmission. Only one interface is used for the initial + transmission; multicast routers are responsible for forwarding to any + other networks, if necessary. If the upper-layer protocol chooses + not to identify an outgoing interface, a default interface should be + used, preferably under the control of system management. + + Third (level 2 implementations only), for the case in which the host + is itself a member of a group to which a datagram is being sent, the + service interface should provide a way for the upper-layer protocol + to inhibit local delivery of the datagram; by default, a copy of the + datagram is looped back. This is a performance optimization for + upper-layer protocols that restrict the membership of a group to one + process per host (such as a routing protocol), or that handle + loopback of group communication at a higher layer (such as a + multicast transport protocol). + +6.2. Extensions to the IP Module + + To support the sending of multicast IP datagrams, the IP module must + be extended to recognize IP host group addresses when routing + outgoing datagrams. Most IP implementations include the following + logic: + + if IP-destination is on the same local network, + send datagram locally to IP-destination + else + send datagram locally to GatewayTo( IP-destination ) + + + + +Deering [Page 5] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + To allow multicast transmissions, the routing logic must be changed + to: + + if IP-destination is on the same local network + or IP-destination is a host group, + send datagram locally to IP-destination + else + send datagram locally to GatewayTo( IP-destination ) + + + If the sending host is itself a member of the destination group on + the outgoing interface, a copy of the outgoing datagram must be + looped-back for local delivery, unless inhibited by the sender. + (Level 2 implementations only.) + + The IP source address of the outgoing datagram must be one of the + individual addresses corresponding to the outgoing interface. + + A host group address must never be placed in the source address field + or anywhere in a source route or record route option of an outgoing + IP datagram. + +6.3. Extensions to the Local Network Service Interface + + No change to the local network service interface is required to + support the sending of multicast IP datagrams. The IP module merely + specifies an IP host group destination, rather than an individual IP + destination, when it invokes the existing "Send Local" operation. + +6.4. Extensions to an Ethernet Local Network Module + + The Ethernet directly supports the sending of local multicast packets + by allowing multicast addresses in the destination field of Ethernet + packets. All that is needed to support the sending of multicast IP + datagrams is a procedure for mapping IP host group addresses to + Ethernet multicast addresses. + + An IP host group address is mapped to an Ethernet multicast address + by placing the low-order 23-bits of the IP address into the low-order + 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex). + Because there are 28 significant bits in an IP host group address, + more than one host group address may map to the same Ethernet + multicast address. + +6.5. Extensions to Local Network Modules other than Ethernet + + Other networks that directly support multicasting, such as rings or + buses conforming to the IEEE 802.2 standard, may be handled the same + + + +Deering [Page 6] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + way as Ethernet for the purpose of sending multicast IP datagrams. + For a network that supports broadcast but not multicast, such as the + Experimental Ethernet, all IP host group addresses may be mapped to a + single local broadcast address (at the cost of increased overhead on + all local hosts). For a point-to-point link joining two hosts (or a + host and a multicast router), multicasts should be transmitted + exactly like unicasts. For a store-and-forward network like the + ARPANET or a public X.25 network, all IP host group addresses might + be mapped to the well-known local address of an IP multicast router; + a router on such a network would take responsibility for completing + multicast delivery within the network as well as among networks. + +7. RECEIVING MULTICAST IP DATAGRAMS + +7.1. Extensions to the IP Service Interface + + Incoming multicast IP datagrams are received by upper-layer protocol + modules using the same "Receive IP" operation as normal, unicast + datagrams. Selection of a destination upper-layer protocol is based + on the protocol field in the IP header, regardless of the destination + IP address. However, before any datagrams destined to a particular + group can be received, an upper-layer protocol must ask the IP module + to join that group. Thus, the IP service interface must be extended + to provide two new operations: + + JoinHostGroup ( group-address, interface ) + + LeaveHostGroup ( group-address, interface ) + + The JoinHostGroup operation requests that this host become a member + of the host group identified by "group-address" on the given network + interface. The LeaveGroup operation requests that this host give up + its membership in the host group identified by "group-address" on the + given network interface. The interface argument may be omitted on + hosts that support only one interface. For hosts that may be + attached to more than one network, the upper-layer protocol may + choose to leave the interface unspecified, in which case the request + will apply to the default interface for sending multicast datagrams + (see section 6.1). + + It is permissible to join the same group on more than one interface, + in which case duplicate multicast datagrams may be received. It is + also permissible for more than one upper-layer protocol to request + membership in the same group. + + Both operations should return immediately (i.e., they are non- + blocking operations), indicating success or failure. Either + operation may fail due to an invalid group address or interface + + + +Deering [Page 7] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + identifier. JoinHostGroup may fail due to lack of local resources. + LeaveHostGroup may fail because the host does not belong to the given + group on the given interface. LeaveHostGroup may succeed, but the + membership persist, if more than one upper-layer protocol has + requested membership in the same group. + +7.2. Extensions to the IP Module + + To support the reception of multicast IP datagrams, the IP module + must be extended to maintain a list of host group memberships + associated with each network interface. An incoming datagram + destined to one of those groups is processed exactly the same way as + datagrams destined to one of the host's individual addresses. + + Incoming datagrams destined to groups to which the host does not + belong are discarded without generating any error report or log + entry. On hosts with more than one network interface, if a datagram + arrives via one interface, destined for a group to which the host + belongs only on a different interface, the datagram is quietly + discarded. (These cases should occur only as a result of inadequate + multicast address filtering in a local network module.) + + An incoming datagram is not rejected for having an IP time-to-live of + 1 (i.e., the time-to-live should not automatically be decremented on + arriving datagrams that are not being forwarded). An incoming + datagram with an IP host group address in its source address field is + quietly discarded. An ICMP error message (Destination Unreachable, + Time Exceeded, Parameter Problem, Source Quench, or Redirect) is + never generated in response to a datagram destined to an IP host + group. + + The list of host group memberships is updated in response to + JoinHostGroup and LeaveHostGroup requests from upper-layer protocols. + Each membership should have an associated reference count or similar + mechanism to handle multiple requests to join and leave the same + group. On the first request to join and the last request to leave a + group on a given interface, the local network module for that + interface is notified, so that it may update its multicast reception + filter (see section 7.3). + + The IP module must also be extended to implement the IGMP protocol, + specified in Appendix I. IGMP is used to keep neighboring multicast + routers informed of the host group memberships present on a + particular local network. To support IGMP, every level 2 host must + join the "all-hosts" group (address 224.0.0.1) on each network + interface at initialization time and must remain a member for as long + as the host is active. + + + + +Deering [Page 8] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + (Datagrams addressed to the all-hosts group are recognized as a + special case by the multicast routers and are never forwarded beyond + a single network, regardless of their time-to-live. Thus, the all- + hosts address may not be used as an internet-wide broadcast address. + For the purpose of IGMP, membership in the all-hosts group is really + necessary only while the host belongs to at least one other group. + However, it is specified that the host shall remain a member of the + all-hosts group at all times because (1) it is simpler, (2) the + frequency of reception of unnecessary IGMP queries should be low + enough that overhead is negligible, and (3) the all-hosts address may + serve other routing-oriented purposes, such as advertising the + presence of gateways or resolving local addresses.) + +7.3. Extensions to the Local Network Service Interface + + Incoming local network multicast packets are delivered to the IP + module using the same "Receive Local" operation as local network + unicast packets. To allow the IP module to tell the local network + module which multicast packets to accept, the local network service + interface is extended to provide two new operations: + + JoinLocalGroup ( group-address ) + + LeaveLocalGroup ( group-address ) + + where "group-address" is an IP host group address. The + JoinLocalGroup operation requests the local network module to accept + and deliver up subsequently arriving packets destined to the given IP + host group address. The LeaveLocalGroup operation requests the local + network module to stop delivering up packets destined to the given IP + host group address. The local network module is expected to map the + IP host group addresses to local network addresses as required to + update its multicast reception filter. Any local network module is + free to ignore LeaveLocalGroup requests, and may deliver up packets + destined to more addresses than just those specified in + JoinLocalGroup requests, if it is unable to filter incoming packets + adequately. + + The local network module must not deliver up any multicast packets + that were transmitted from that module; loopback of multicasts is + handled at the IP layer or higher. + +7.4. Extensions to an Ethernet Local Network Module + + To support the reception of multicast IP datagrams, an Ethernet + module must be able to receive packets addressed to the Ethernet + multicast addresses that correspond to the host's IP host group + addresses. It is highly desirable to take advantage of any address + + + +Deering [Page 9] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + filtering capabilities that the Ethernet hardware interface may have, + so that the host receives only those packets that are destined to it. + + Unfortunately, many current Ethernet interfaces have a small limit on + the number of addresses that the hardware can be configured to + recognize. Nevertheless, an implementation must be capable of + listening on an arbitrary number of Ethernet multicast addresses, + which may mean "opening up" the address filter to accept all + multicast packets during those periods when the number of addresses + exceeds the limit of the filter. + + For interfaces with inadequate hardware address filtering, it may be + desirable (for performance reasons) to perform Ethernet address + filtering within the software of the Ethernet module. This is not + mandatory, however, because the IP module performs its own filtering + based on IP destination addresses. + +7.5. Extensions to Local Network Modules other than Ethernet + + Other multicast networks, such as IEEE 802.2 networks, can be handled + the same way as Ethernet for the purpose of receiving multicast IP + datagrams. For pure broadcast networks, such as the Experimental + Ethernet, all incoming broadcast packets can be accepted and passed + to the IP module for IP-level filtering. On point-to-point or + store-and-forward networks, multicast IP datagrams will arrive as + local network unicasts, so no change to the local network module + should be necessary. + + + + + + + + + + + + + + + + + + + + + + + + +Deering [Page 10] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +APPENDIX I. INTERNET GROUP MANAGEMENT PROTOCOL (IGMP) + + The Internet Group Management Protocol (IGMP) is used by IP hosts to + report their host group memberships to any immediately-neighboring + multicast routers. IGMP is an asymmetric protocol and is specified + here from the point of view of a host, rather than a multicast + router. (IGMP may also be used, symmetrically or asymmetrically, + between multicast routers. Such use is not specified here.) + + Like ICMP, IGMP is a integral part of IP. It is required to be + implemented by all hosts conforming to level 2 of the IP multicasting + specification. IGMP messages are encapsulated in IP datagrams, with + an IP protocol number of 2. All IGMP messages of concern to hosts + have the following format: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |Version| Type | Unused | Checksum | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Group Address | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Version + + This memo specifies version 1 of IGMP. Version 0 is specified + in RFC-988 and is now obsolete. + + Type + + There are two types of IGMP message of concern to hosts: + + 1 = Host Membership Query + 2 = Host Membership Report + + Unused + + Unused field, zeroed when sent, ignored when received. + + Checksum + + The checksum is the 16-bit one's complement of the one's + complement sum of the 8-octet IGMP message. For computing + the checksum, the checksum field is zeroed. + + Group Address + + In a Host Membership Query message, the group address field + + + +Deering [Page 11] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + is zeroed when sent, ignored when received. + + In a Host Membership Report message, the group address field + holds the IP host group address of the group being reported. + +Informal Protocol Description + + Multicast routers send Host Membership Query messages (hereinafter + called Queries) to discover which host groups have members on their + attached local networks. Queries are addressed to the all-hosts + group (address 224.0.0.1), and carry an IP time-to-live of 1. + + Hosts respond to a Query by generating Host Membership Reports + (hereinafter called Reports), reporting each host group to which they + belong on the network interface from which the Query was received. + In order to avoid an "implosion" of concurrent Reports and to reduce + the total number of Reports transmitted, two techniques are used: + + 1. When a host receives a Query, rather than sending Reports + immediately, it starts a report delay timer for each of its + group memberships on the network interface of the incoming + Query. Each timer is set to a different, randomly-chosen + value between zero and D seconds. When a timer expires, a + Report is generated for the corresponding host group. Thus, + Reports are spread out over a D second interval instead of + all occurring at once. + + 2. A Report is sent with an IP destination address equal to the + host group address being reported, and with an IP + time-to-live of 1, so that other members of the same group on + the same network can overhear the Report. If a host hears a + Report for a group to which it belongs on that network, the + host stops its own timer for that group and does not generate + a Report for that group. Thus, in the normal case, only one + Report will be generated for each group present on the + network, by the member host whose delay timer expires first. + Note that the multicast routers receive all IP multicast + datagrams, and therefore need not be addressed explicitly. + Further note that the routers need not know which hosts + belong to a group, only that at least one host belongs to a + group on a particular network. + + There are two exceptions to the behavior described above. First, if + a report delay timer is already running for a group membership when a + Query is received, that timer is not reset to a new random value, but + rather allowed to continue running with its current value. Second, a + report delay timer is never set for a host's membership in the all- + hosts group (224.0.0.1), and that membership is never reported. + + + +Deering [Page 12] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + If a host uses a pseudo-random number generator to compute the + reporting delays, one of the host's own individual IP address should + be used as part of the seed for the generator, to reduce the chance + of multiple hosts generating the same sequence of delays. + + A host should confirm that a received Report has the same IP host + group address in its IP destination field and its IGMP group address + field, to ensure that the host's own Report is not cancelled by an + erroneous received Report. A host should quietly discard any IGMP + message of type other than Host Membership Query or Host Membership + Report. + + Multicast routers send Queries periodically to refresh their + knowledge of memberships present on a particular network. If no + Reports are received for a particular group after some number of + Queries, the routers assume that that group has no local members and + that they need not forward remotely-originated multicasts for that + group onto the local network. Queries are normally sent infrequently + (no more than once a minute) so as to keep the IGMP overhead on hosts + and networks very low. However, when a multicast router starts up, + it may issue several closely-spaced Queries in order to build up its + knowledge of local memberships quickly. + + When a host joins a new group, it should immediately transmit a + Report for that group, rather than waiting for a Query, in case it is + the first member of that group on the network. To cover the + possibility of the initial Report being lost or damaged, it is + recommended that it be repeated once or twice after short delays. (A + simple way to accomplish this is to act as if a Query had been + received for that group only, setting the group's random report delay + timer. The state transition diagram below illustrates this + approach.) + + Note that, on a network with no multicast routers present, the only + IGMP traffic is the one or more Reports sent whenever a host joins a + new group. + +State Transition Diagram + + IGMP behavior is more formally specified by the state transition + diagram below. A host may be in one of three possible states, with + respect to any single IP host group on any single network interface: + + - Non-Member state, when the host does not belong to the group + on the interface. This is the initial state for all + memberships on all network interfaces; it requires no storage + in the host. + + + + +Deering [Page 13] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + - Delaying Member state, when the host belongs to the group on + the interface and has a report delay timer running for that + membership. + + - Idle Member state, when the host belongs to the group on the + interface and does not have a report delay timer running for + that membership. + + There are five significant events that can cause IGMP state + transitions: + + - "join group" occurs when the host decides to join the group on + the interface. It may occur only in the Non-Member state. + + - "leave group" occurs when the host decides to leave the group + on the interface. It may occur only in the Delaying Member + and Idle Member states. + + - "query received" occurs when the host receives a valid IGMP + Host Membership Query message. To be valid, the Query message + must be at least 8 octets long, have a correct IGMP + checksum and have an IP destination address of 224.0.0.1. + A single Query applies to all memberships on the + interface from which the Query is received. It is ignored for + memberships in the Non-Member or Delaying Member state. + + - "report received" occurs when the host receives a valid IGMP + Host Membership Report message. To be valid, the Report + message must be at least 8 octets long, have a correct IGMP + checksum, and contain the same IP host group address in its IP + destination field and its IGMP group address field. A Report + applies only to the membership in the group identified by the + Report, on the interface from which the Report is received. + It is ignored for memberships in the Non-Member or Idle Member + state. + + - "timer expired" occurs when the report delay timer for the + group on the interface expires. It may occur only in the + Delaying Member state. + + All other events, such as receiving invalid IGMP messages, or IGMP + messages other than Query or Report, are ignored in all states. + + There are three possible actions that may be taken in response to the + above events: + + - "send report" for the group on the interface. + + + + +Deering [Page 14] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + + - "start timer" for the group on the interface, using a random + delay value between 0 and D seconds. + + - "stop timer" for the group on the interface. + + In the following diagram, each state transition arc is labelled with + the event that causes the transition, and, in parentheses, any + actions taken during the transition. + + ________________ + | | + | | + | | + | | + --------->| Non-Member |<--------- + | | | | + | | | | + | | | | + | |________________| | + | | | + | leave group | join group | leave group + | (stop timer) |(send report, | + | | start timer) | + ________|________ | ________|________ + | |<--------- | | + | | | | + | |<-------------------| | + | | query received | | + | Delaying Member | (start timer) | Idle Member | + | |------------------->| | + | | report received | | + | | (stop timer) | | + |_________________|------------------->|_________________| + timer expired + (send report) + + The all-hosts group (address 224.0.0.1) is handled as a special case. + The host starts in Idle Member state for that group on every + interface, never transitions to another state, and never sends a + report for that group. + +Protocol Parameters + + The maximum report delay, D, is 10 seconds. + + + + + + + +Deering [Page 15] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +APPENDIX II. HOST GROUP ADDRESS ISSUES + + This appendix is not part of the IP multicasting specification, but + provides background discussion of several issues related to IP host + group addresses. + +Group Address Binding + + The binding of IP host group addresses to physical hosts may be + considered a generalization of the binding of IP unicast addresses. + An IP unicast address is statically bound to a single local network + interface on a single IP network. An IP host group address is + dynamically bound to a set of local network interfaces on a set of IP + networks. + + It is important to understand that an IP host group address is NOT + bound to a set of IP unicast addresses. The multicast routers do not + need to maintain a list of individual members of each host group. + For example, a multicast router attached to an Ethernet need + associate only a single Ethernet multicast address with each host + group having local members, rather than a list of the members' + individual IP or Ethernet addresses. + +Allocation of Transient Host Group Addresses + + This memo does not specify how transient group address are allocated. + It is anticipated that different portions of the IP transient host + group address space will be allocated using different techniques. + For example, there may be a number of servers that can be contacted + to acquire a new transient group address. Some higher-level + protocols (such as VMTP, specified in RFC-1045) may generate higher- + level transient "process group" or "entity group" addresses which are + then algorithmically mapped to a subset of the IP transient host + group addresses, similarly to the way that IP host group addresses + are mapped to Ethernet multicast addresses. A portion of the IP + group address space may be set aside for random allocation by + applications that can tolerate occasional collisions with other + multicast users, perhaps generating new addresses until a suitably + "quiet" one is found. + + In general, a host cannot assume that datagrams sent to any host + group address will reach only the intended hosts, or that datagrams + received as a member of a transient host group are intended for the + recipient. Misdelivery must be detected at a level above IP, using + higher-level identifiers or authentication tokens. Information + transmitted to a host group address should be encrypted or governed + by administrative routing controls if the sender is concerned about + unwanted listeners. + + + +Deering [Page 16] + +RFC 1112 Host Extensions for IP Multicasting August 1989 + + +Author's Address + + Steve Deering + Stanford University + Computer Science Department + Stanford, CA 94305-2140 + + Phone: (415) 723-9427 + + EMail: deering@PESCADERO.STANFORD.EDU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Deering [Page 17] + + diff --git a/doc/rfc/std7.txt b/doc/rfc/std7.txt new file mode 100644 index 00000000..a7c36a14 --- /dev/null +++ b/doc/rfc/std7.txt @@ -0,0 +1,5248 @@ + +RFC: 793 + + + + + + + + TRANSMISSION CONTROL PROTOCOL + + + DARPA INTERNET PROGRAM + + PROTOCOL SPECIFICATION + + + + September 1981 + + + + + + + + + + + + + + prepared for + + Defense Advanced Research Projects Agency + Information Processing Techniques Office + 1400 Wilson Boulevard + Arlington, Virginia 22209 + + + + + + + + by + + Information Sciences Institute + University of Southern California + 4676 Admiralty Way + Marina del Rey, California 90291 + + + +September 1981 + Transmission Control Protocol + + + + TABLE OF CONTENTS + + PREFACE ........................................................ iii + +1. INTRODUCTION ..................................................... 1 + + 1.1 Motivation .................................................... 1 + 1.2 Scope ......................................................... 2 + 1.3 About This Document ........................................... 2 + 1.4 Interfaces .................................................... 3 + 1.5 Operation ..................................................... 3 + +2. PHILOSOPHY ....................................................... 7 + + 2.1 Elements of the Internetwork System ........................... 7 + 2.2 Model of Operation ............................................ 7 + 2.3 The Host Environment .......................................... 8 + 2.4 Interfaces .................................................... 9 + 2.5 Relation to Other Protocols ................................... 9 + 2.6 Reliable Communication ........................................ 9 + 2.7 Connection Establishment and Clearing ........................ 10 + 2.8 Data Communication ........................................... 12 + 2.9 Precedence and Security ...................................... 13 + 2.10 Robustness Principle ......................................... 13 + +3. FUNCTIONAL SPECIFICATION ........................................ 15 + + 3.1 Header Format ................................................ 15 + 3.2 Terminology .................................................. 19 + 3.3 Sequence Numbers ............................................. 24 + 3.4 Establishing a connection .................................... 30 + 3.5 Closing a Connection ......................................... 37 + 3.6 Precedence and Security ...................................... 40 + 3.7 Data Communication ........................................... 40 + 3.8 Interfaces ................................................... 44 + 3.9 Event Processing ............................................. 52 + +GLOSSARY ............................................................ 79 + +REFERENCES .......................................................... 85 + + + + + + + + + + + + [Page i] + + + September 1981 +Transmission Control Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page ii] + + +September 1981 + Transmission Control Protocol + + + + PREFACE + + + +This document describes the DoD Standard Transmission Control Protocol +(TCP). There have been nine earlier editions of the ARPA TCP +specification on which this standard is based, and the present text +draws heavily from them. There have been many contributors to this work +both in terms of concepts and in terms of text. This edition clarifies +several details and removes the end-of-letter buffer-size adjustments, +and redescribes the letter mechanism as a push function. + + Jon Postel + + Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page iii] + + + + +RFC: 793 +Replaces: RFC 761 +IENs: 129, 124, 112, 81, +55, 44, 40, 27, 21, 5 + + TRANSMISSION CONTROL PROTOCOL + + DARPA INTERNET PROGRAM + PROTOCOL SPECIFICATION + + + + 1. INTRODUCTION + +The Transmission Control Protocol (TCP) is intended for use as a highly +reliable host-to-host protocol between hosts in packet-switched computer +communication networks, and in interconnected systems of such networks. + +This document describes the functions to be performed by the +Transmission Control Protocol, the program that implements it, and its +interface to programs or users that require its services. + +1.1. Motivation + + Computer communication systems are playing an increasingly important + role in military, government, and civilian environments. This + document focuses its attention primarily on military computer + communication requirements, especially robustness in the presence of + communication unreliability and availability in the presence of + congestion, but many of these problems are found in the civilian and + government sector as well. + + As strategic and tactical computer communication networks are + developed and deployed, it is essential to provide means of + interconnecting them and to provide standard interprocess + communication protocols which can support a broad range of + applications. In anticipation of the need for such standards, the + Deputy Undersecretary of Defense for Research and Engineering has + declared the Transmission Control Protocol (TCP) described herein to + be a basis for DoD-wide inter-process communication protocol + standardization. + + TCP is a connection-oriented, end-to-end reliable protocol designed to + fit into a layered hierarchy of protocols which support multi-network + applications. The TCP provides for reliable inter-process + communication between pairs of processes in host computers attached to + distinct but interconnected computer communication networks. Very few + assumptions are made as to the reliability of the communication + protocols below the TCP layer. TCP assumes it can obtain a simple, + potentially unreliable datagram service from the lower level + protocols. In principle, the TCP should be able to operate above a + wide spectrum of communication systems ranging from hard-wired + connections to packet-switched or circuit-switched networks. + + + [Page 1] + + + September 1981 +Transmission Control Protocol +Introduction + + + + TCP is based on concepts first described by Cerf and Kahn in [1]. The + TCP fits into a layered protocol architecture just above a basic + Internet Protocol [2] which provides a way for the TCP to send and + receive variable-length segments of information enclosed in internet + datagram "envelopes". The internet datagram provides a means for + addressing source and destination TCPs in different networks. The + internet protocol also deals with any fragmentation or reassembly of + the TCP segments required to achieve transport and delivery through + multiple networks and interconnecting gateways. The internet protocol + also carries information on the precedence, security classification + and compartmentation of the TCP segments, so this information can be + communicated end-to-end across multiple networks. + + Protocol Layering + + +---------------------+ + | higher-level | + +---------------------+ + | TCP | + +---------------------+ + | internet protocol | + +---------------------+ + |communication network| + +---------------------+ + + Figure 1 + + Much of this document is written in the context of TCP implementations + which are co-resident with higher level protocols in the host + computer. Some computer systems will be connected to networks via + front-end computers which house the TCP and internet protocol layers, + as well as network specific software. The TCP specification describes + an interface to the higher level protocols which appears to be + implementable even for the front-end case, as long as a suitable + host-to-front end protocol is implemented. + +1.2. Scope + + The TCP is intended to provide a reliable process-to-process + communication service in a multinetwork environment. The TCP is + intended to be a host-to-host protocol in common use in multiple + networks. + +1.3. About this Document + + This document represents a specification of the behavior required of + any TCP implementation, both in its interactions with higher level + protocols and in its interactions with other TCPs. The rest of this + + +[Page 2] + + +September 1981 + Transmission Control Protocol + Introduction + + + + section offers a very brief view of the protocol interfaces and + operation. Section 2 summarizes the philosophical basis for the TCP + design. Section 3 offers both a detailed description of the actions + required of TCP when various events occur (arrival of new segments, + user calls, errors, etc.) and the details of the formats of TCP + segments. + +1.4. Interfaces + + The TCP interfaces on one side to user or application processes and on + the other side to a lower level protocol such as Internet Protocol. + + The interface between an application process and the TCP is + illustrated in reasonable detail. This interface consists of a set of + calls much like the calls an operating system provides to an + application process for manipulating files. For example, there are + calls to open and close connections and to send and receive data on + established connections. It is also expected that the TCP can + asynchronously communicate with application programs. Although + considerable freedom is permitted to TCP implementors to design + interfaces which are appropriate to a particular operating system + environment, a minimum functionality is required at the TCP/user + interface for any valid implementation. + + The interface between TCP and lower level protocol is essentially + unspecified except that it is assumed there is a mechanism whereby the + two levels can asynchronously pass information to each other. + Typically, one expects the lower level protocol to specify this + interface. TCP is designed to work in a very general environment of + interconnected networks. The lower level protocol which is assumed + throughout this document is the Internet Protocol [2]. + +1.5. Operation + + As noted above, the primary purpose of the TCP is to provide reliable, + securable logical circuit or connection service between pairs of + processes. To provide this service on top of a less reliable internet + communication system requires facilities in the following areas: + + Basic Data Transfer + Reliability + Flow Control + Multiplexing + Connections + Precedence and Security + + The basic operation of the TCP in each of these areas is described in + the following paragraphs. + + + [Page 3] + + + September 1981 +Transmission Control Protocol +Introduction + + + + Basic Data Transfer: + + The TCP is able to transfer a continuous stream of octets in each + direction between its users by packaging some number of octets into + segments for transmission through the internet system. In general, + the TCPs decide when to block and forward data at their own + convenience. + + Sometimes users need to be sure that all the data they have + submitted to the TCP has been transmitted. For this purpose a push + function is defined. To assure that data submitted to a TCP is + actually transmitted the sending user indicates that it should be + pushed through to the receiving user. A push causes the TCPs to + promptly forward and deliver data up to that point to the receiver. + The exact push point might not be visible to the receiving user and + the push function does not supply a record boundary marker. + + Reliability: + + The TCP must recover from data that is damaged, lost, duplicated, or + delivered out of order by the internet communication system. This + is achieved by assigning a sequence number to each octet + transmitted, and requiring a positive acknowledgment (ACK) from the + receiving TCP. If the ACK is not received within a timeout + interval, the data is retransmitted. At the receiver, the sequence + numbers are used to correctly order segments that may be received + out of order and to eliminate duplicates. Damage is handled by + adding a checksum to each segment transmitted, checking it at the + receiver, and discarding damaged segments. + + As long as the TCPs continue to function properly and the internet + system does not become completely partitioned, no transmission + errors will affect the correct delivery of data. TCP recovers from + internet communication system errors. + + Flow Control: + + TCP provides a means for the receiver to govern the amount of data + sent by the sender. This is achieved by returning a "window" with + every ACK indicating a range of acceptable sequence numbers beyond + the last segment successfully received. The window indicates an + allowed number of octets that the sender may transmit before + receiving further permission. + + + + + + + +[Page 4] + + +September 1981 + Transmission Control Protocol + Introduction + + + + Multiplexing: + + To allow for many processes within a single Host to use TCP + communication facilities simultaneously, the TCP provides a set of + addresses or ports within each host. Concatenated with the network + and host addresses from the internet communication layer, this forms + a socket. A pair of sockets uniquely identifies each connection. + That is, a socket may be simultaneously used in multiple + connections. + + The binding of ports to processes is handled independently by each + Host. However, it proves useful to attach frequently used processes + (e.g., a "logger" or timesharing service) to fixed sockets which are + made known to the public. These services can then be accessed + through the known addresses. Establishing and learning the port + addresses of other processes may involve more dynamic mechanisms. + + Connections: + + The reliability and flow control mechanisms described above require + that TCPs initialize and maintain certain status information for + each data stream. The combination of this information, including + sockets, sequence numbers, and window sizes, is called a connection. + Each connection is uniquely specified by a pair of sockets + identifying its two sides. + + When two processes wish to communicate, their TCP's must first + establish a connection (initialize the status information on each + side). When their communication is complete, the connection is + terminated or closed to free the resources for other uses. + + Since connections must be established between unreliable hosts and + over the unreliable internet communication system, a handshake + mechanism with clock-based sequence numbers is used to avoid + erroneous initialization of connections. + + Precedence and Security: + + The users of TCP may indicate the security and precedence of their + communication. Provision is made for default values to be used when + these features are not needed. + + + + + + + + + + [Page 5] + + + September 1981 +Transmission Control Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 6] + + +September 1981 + Transmission Control Protocol + + + + 2. PHILOSOPHY + +2.1. Elements of the Internetwork System + + The internetwork environment consists of hosts connected to networks + which are in turn interconnected via gateways. It is assumed here + that the networks may be either local networks (e.g., the ETHERNET) or + large networks (e.g., the ARPANET), but in any case are based on + packet switching technology. The active agents that produce and + consume messages are processes. Various levels of protocols in the + networks, the gateways, and the hosts support an interprocess + communication system that provides two-way data flow on logical + connections between process ports. + + The term packet is used generically here to mean the data of one + transaction between a host and its network. The format of data blocks + exchanged within the a network will generally not be of concern to us. + + Hosts are computers attached to a network, and from the communication + network's point of view, are the sources and destinations of packets. + Processes are viewed as the active elements in host computers (in + accordance with the fairly common definition of a process as a program + in execution). Even terminals and files or other I/O devices are + viewed as communicating with each other through the use of processes. + Thus, all communication is viewed as inter-process communication. + + Since a process may need to distinguish among several communication + streams between itself and another process (or processes), we imagine + that each process may have a number of ports through which it + communicates with the ports of other processes. + +2.2. Model of Operation + + Processes transmit data by calling on the TCP and passing buffers of + data as arguments. The TCP packages the data from these buffers into + segments and calls on the internet module to transmit each segment to + the destination TCP. The receiving TCP places the data from a segment + into the receiving user's buffer and notifies the receiving user. The + TCPs include control information in the segments which they use to + ensure reliable ordered data transmission. + + The model of internet communication is that there is an internet + protocol module associated with each TCP which provides an interface + to the local network. This internet module packages TCP segments + inside internet datagrams and routes these datagrams to a destination + internet module or intermediate gateway. To transmit the datagram + through the local network, it is embedded in a local network packet. + + The packet switches may perform further packaging, fragmentation, or + + + [Page 7] + + + September 1981 +Transmission Control Protocol +Philosophy + + + + other operations to achieve the delivery of the local packet to the + destination internet module. + + At a gateway between networks, the internet datagram is "unwrapped" + from its local packet and examined to determine through which network + the internet datagram should travel next. The internet datagram is + then "wrapped" in a local packet suitable to the next network and + routed to the next gateway, or to the final destination. + + A gateway is permitted to break up an internet datagram into smaller + internet datagram fragments if this is necessary for transmission + through the next network. To do this, the gateway produces a set of + internet datagrams; each carrying a fragment. Fragments may be + further broken into smaller fragments at subsequent gateways. The + internet datagram fragment format is designed so that the destination + internet module can reassemble fragments into internet datagrams. + + A destination internet module unwraps the segment from the datagram + (after reassembling the datagram, if necessary) and passes it to the + destination TCP. + + This simple model of the operation glosses over many details. One + important feature is the type of service. This provides information + to the gateway (or internet module) to guide it in selecting the + service parameters to be used in traversing the next network. + Included in the type of service information is the precedence of the + datagram. Datagrams may also carry security information to permit + host and gateways that operate in multilevel secure environments to + properly segregate datagrams for security considerations. + +2.3. The Host Environment + + The TCP is assumed to be a module in an operating system. The users + access the TCP much like they would access the file system. The TCP + may call on other operating system functions, for example, to manage + data structures. The actual interface to the network is assumed to be + controlled by a device driver module. The TCP does not call on the + network device driver directly, but rather calls on the internet + datagram protocol module which may in turn call on the device driver. + + The mechanisms of TCP do not preclude implementation of the TCP in a + front-end processor. However, in such an implementation, a + host-to-front-end protocol must provide the functionality to support + the type of TCP-user interface described in this document. + + + + + + +[Page 8] + + +September 1981 + Transmission Control Protocol + Philosophy + + + +2.4. Interfaces + + The TCP/user interface provides for calls made by the user on the TCP + to OPEN or CLOSE a connection, to SEND or RECEIVE data, or to obtain + STATUS about a connection. These calls are like other calls from user + programs on the operating system, for example, the calls to open, read + from, and close a file. + + The TCP/internet interface provides calls to send and receive + datagrams addressed to TCP modules in hosts anywhere in the internet + system. These calls have parameters for passing the address, type of + service, precedence, security, and other control information. + +2.5. Relation to Other Protocols + + The following diagram illustrates the place of the TCP in the protocol + hierarchy: + + + +------+ +-----+ +-----+ +-----+ + |Telnet| | FTP | |Voice| ... | | Application Level + +------+ +-----+ +-----+ +-----+ + | | | | + +-----+ +-----+ +-----+ + | TCP | | RTP | ... | | Host Level + +-----+ +-----+ +-----+ + | | | + +-------------------------------+ + | Internet Protocol & ICMP | Gateway Level + +-------------------------------+ + | + +---------------------------+ + | Local Network Protocol | Network Level + +---------------------------+ + + Protocol Relationships + + Figure 2. + + It is expected that the TCP will be able to support higher level + protocols efficiently. It should be easy to interface higher level + protocols like the ARPANET Telnet or AUTODIN II THP to the TCP. + +2.6. Reliable Communication + + A stream of data sent on a TCP connection is delivered reliably and in + order at the destination. + + + + [Page 9] + + + September 1981 +Transmission Control Protocol +Philosophy + + + + Transmission is made reliable via the use of sequence numbers and + acknowledgments. Conceptually, each octet of data is assigned a + sequence number. The sequence number of the first octet of data in a + segment is transmitted with that segment and is called the segment + sequence number. Segments also carry an acknowledgment number which + is the sequence number of the next expected data octet of + transmissions in the reverse direction. When the TCP transmits a + segment containing data, it puts a copy on a retransmission queue and + starts a timer; when the acknowledgment for that data is received, the + segment is deleted from the queue. If the acknowledgment is not + received before the timer runs out, the segment is retransmitted. + + An acknowledgment by TCP does not guarantee that the data has been + delivered to the end user, but only that the receiving TCP has taken + the responsibility to do so. + + To govern the flow of data between TCPs, a flow control mechanism is + employed. The receiving TCP reports a "window" to the sending TCP. + This window specifies the number of octets, starting with the + acknowledgment number, that the receiving TCP is currently prepared to + receive. + +2.7. Connection Establishment and Clearing + + To identify the separate data streams that a TCP may handle, the TCP + provides a port identifier. Since port identifiers are selected + independently by each TCP they might not be unique. To provide for + unique addresses within each TCP, we concatenate an internet address + identifying the TCP with a port identifier to create a socket which + will be unique throughout all networks connected together. + + A connection is fully specified by the pair of sockets at the ends. A + local socket may participate in many connections to different foreign + sockets. A connection can be used to carry data in both directions, + that is, it is "full duplex". + + TCPs are free to associate ports with processes however they choose. + However, several basic concepts are necessary in any implementation. + There must be well-known sockets which the TCP associates only with + the "appropriate" processes by some means. We envision that processes + may "own" ports, and that processes can initiate connections only on + the ports they own. (Means for implementing ownership is a local + issue, but we envision a Request Port user command, or a method of + uniquely allocating a group of ports to a given process, e.g., by + associating the high order bits of a port name with a given process.) + + A connection is specified in the OPEN call by the local port and + foreign socket arguments. In return, the TCP supplies a (short) local + + +[Page 10] + + +September 1981 + Transmission Control Protocol + Philosophy + + + + connection name by which the user refers to the connection in + subsequent calls. There are several things that must be remembered + about a connection. To store this information we imagine that there + is a data structure called a Transmission Control Block (TCB). One + implementation strategy would have the local connection name be a + pointer to the TCB for this connection. The OPEN call also specifies + whether the connection establishment is to be actively pursued, or to + be passively waited for. + + A passive OPEN request means that the process wants to accept incoming + connection requests rather than attempting to initiate a connection. + Often the process requesting a passive OPEN will accept a connection + request from any caller. In this case a foreign socket of all zeros + is used to denote an unspecified socket. Unspecified foreign sockets + are allowed only on passive OPENs. + + A service process that wished to provide services for unknown other + processes would issue a passive OPEN request with an unspecified + foreign socket. Then a connection could be made with any process that + requested a connection to this local socket. It would help if this + local socket were known to be associated with this service. + + Well-known sockets are a convenient mechanism for a priori associating + a socket address with a standard service. For instance, the + "Telnet-Server" process is permanently assigned to a particular + socket, and other sockets are reserved for File Transfer, Remote Job + Entry, Text Generator, Echoer, and Sink processes (the last three + being for test purposes). A socket address might be reserved for + access to a "Look-Up" service which would return the specific socket + at which a newly created service would be provided. The concept of a + well-known socket is part of the TCP specification, but the assignment + of sockets to services is outside this specification. (See [4].) + + Processes can issue passive OPENs and wait for matching active OPENs + from other processes and be informed by the TCP when connections have + been established. Two processes which issue active OPENs to each + other at the same time will be correctly connected. This flexibility + is critical for the support of distributed computing in which + components act asynchronously with respect to each other. + + There are two principal cases for matching the sockets in the local + passive OPENs and an foreign active OPENs. In the first case, the + local passive OPENs has fully specified the foreign socket. In this + case, the match must be exact. In the second case, the local passive + OPENs has left the foreign socket unspecified. In this case, any + foreign socket is acceptable as long as the local sockets match. + Other possibilities include partially restricted matches. + + + + [Page 11] + + + September 1981 +Transmission Control Protocol +Philosophy + + + + If there are several pending passive OPENs (recorded in TCBs) with the + same local socket, an foreign active OPEN will be matched to a TCB + with the specific foreign socket in the foreign active OPEN, if such a + TCB exists, before selecting a TCB with an unspecified foreign socket. + + The procedures to establish connections utilize the synchronize (SYN) + control flag and involves an exchange of three messages. This + exchange has been termed a three-way hand shake [3]. + + A connection is initiated by the rendezvous of an arriving segment + containing a SYN and a waiting TCB entry each created by a user OPEN + command. The matching of local and foreign sockets determines when a + connection has been initiated. The connection becomes "established" + when sequence numbers have been synchronized in both directions. + + The clearing of a connection also involves the exchange of segments, + in this case carrying the FIN control flag. + +2.8. Data Communication + + The data that flows on a connection may be thought of as a stream of + octets. The sending user indicates in each SEND call whether the data + in that call (and any preceeding calls) should be immediately pushed + through to the receiving user by the setting of the PUSH flag. + + A sending TCP is allowed to collect data from the sending user and to + send that data in segments at its own convenience, until the push + function is signaled, then it must send all unsent data. When a + receiving TCP sees the PUSH flag, it must not wait for more data from + the sending TCP before passing the data to the receiving process. + + There is no necessary relationship between push functions and segment + boundaries. The data in any particular segment may be the result of a + single SEND call, in whole or part, or of multiple SEND calls. + + The purpose of push function and the PUSH flag is to push data through + from the sending user to the receiving user. It does not provide a + record service. + + There is a coupling between the push function and the use of buffers + of data that cross the TCP/user interface. Each time a PUSH flag is + associated with data placed into the receiving user's buffer, the + buffer is returned to the user for processing even if the buffer is + not filled. If data arrives that fills the user's buffer before a + PUSH is seen, the data is passed to the user in buffer size units. + + TCP also provides a means to communicate to the receiver of data that + at some point further along in the data stream than the receiver is + + +[Page 12] + + +September 1981 + Transmission Control Protocol + Philosophy + + + + currently reading there is urgent data. TCP does not attempt to + define what the user specifically does upon being notified of pending + urgent data, but the general notion is that the receiving process will + take action to process the urgent data quickly. + +2.9. Precedence and Security + + The TCP makes use of the internet protocol type of service field and + security option to provide precedence and security on a per connection + basis to TCP users. Not all TCP modules will necessarily function in + a multilevel secure environment; some may be limited to unclassified + use only, and others may operate at only one security level and + compartment. Consequently, some TCP implementations and services to + users may be limited to a subset of the multilevel secure case. + + TCP modules which operate in a multilevel secure environment must + properly mark outgoing segments with the security, compartment, and + precedence. Such TCP modules must also provide to their users or + higher level protocols such as Telnet or THP an interface to allow + them to specify the desired security level, compartment, and + precedence of connections. + +2.10. Robustness Principle + + TCP implementations will follow a general principle of robustness: be + conservative in what you do, be liberal in what you accept from + others. + + + + + + + + + + + + + + + + + + + + + + + + [Page 13] + + + September 1981 +Transmission Control Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 14] + + +September 1981 + Transmission Control Protocol + + + + 3. FUNCTIONAL SPECIFICATION + +3.1. Header Format + + TCP segments are sent as internet datagrams. The Internet Protocol + header carries several information fields, including the source and + destination host addresses [2]. A TCP header follows the internet + header, supplying information specific to the TCP protocol. This + division allows for the existence of host level protocols other than + TCP. + + TCP Header Format + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Source Port | Destination Port | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Sequence Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Acknowledgment Number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Data | |U|A|P|R|S|F| | + | Offset| Reserved |R|C|S|S|Y|I| Window | + | | |G|K|H|T|N|N| | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Checksum | Urgent Pointer | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Options | Padding | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + TCP Header Format + + Note that one tick mark represents one bit position. + + Figure 3. + + Source Port: 16 bits + + The source port number. + + Destination Port: 16 bits + + The destination port number. + + + + + [Page 15] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + Sequence Number: 32 bits + + The sequence number of the first data octet in this segment (except + when SYN is present). If SYN is present the sequence number is the + initial sequence number (ISN) and the first data octet is ISN+1. + + Acknowledgment Number: 32 bits + + If the ACK control bit is set this field contains the value of the + next sequence number the sender of the segment is expecting to + receive. Once a connection is established this is always sent. + + Data Offset: 4 bits + + The number of 32 bit words in the TCP Header. This indicates where + the data begins. The TCP header (even one including options) is an + integral number of 32 bits long. + + Reserved: 6 bits + + Reserved for future use. Must be zero. + + Control Bits: 6 bits (from left to right): + + URG: Urgent Pointer field significant + ACK: Acknowledgment field significant + PSH: Push Function + RST: Reset the connection + SYN: Synchronize sequence numbers + FIN: No more data from sender + + Window: 16 bits + + The number of data octets beginning with the one indicated in the + acknowledgment field which the sender of this segment is willing to + accept. + + Checksum: 16 bits + + The checksum field is the 16 bit one's complement of the one's + complement sum of all 16 bit words in the header and text. If a + segment contains an odd number of header and text octets to be + checksummed, the last octet is padded on the right with zeros to + form a 16 bit word for checksum purposes. The pad is not + transmitted as part of the segment. While computing the checksum, + the checksum field itself is replaced with zeros. + + The checksum also covers a 96 bit pseudo header conceptually + + +[Page 16] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + prefixed to the TCP header. This pseudo header contains the Source + Address, the Destination Address, the Protocol, and TCP length. + This gives the TCP protection against misrouted segments. This + information is carried in the Internet Protocol and is transferred + across the TCP/Network interface in the arguments or results of + calls by the TCP on the IP. + + +--------+--------+--------+--------+ + | Source Address | + +--------+--------+--------+--------+ + | Destination Address | + +--------+--------+--------+--------+ + | zero | PTCL | TCP Length | + +--------+--------+--------+--------+ + + The TCP Length is the TCP header length plus the data length in + octets (this is not an explicitly transmitted quantity, but is + computed), and it does not count the 12 octets of the pseudo + header. + + Urgent Pointer: 16 bits + + This field communicates the current value of the urgent pointer as a + positive offset from the sequence number in this segment. The + urgent pointer points to the sequence number of the octet following + the urgent data. This field is only be interpreted in segments with + the URG control bit set. + + Options: variable + + Options may occupy space at the end of the TCP header and are a + multiple of 8 bits in length. All options are included in the + checksum. An option may begin on any octet boundary. There are two + cases for the format of an option: + + Case 1: A single octet of option-kind. + + Case 2: An octet of option-kind, an octet of option-length, and + the actual option-data octets. + + The option-length counts the two octets of option-kind and + option-length as well as the option-data octets. + + Note that the list of options may be shorter than the data offset + field might imply. The content of the header beyond the + End-of-Option option must be header padding (i.e., zero). + + A TCP must implement all options. + + + [Page 17] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + Currently defined options include (kind indicated in octal): + + Kind Length Meaning + ---- ------ ------- + 0 - End of option list. + 1 - No-Operation. + 2 4 Maximum Segment Size. + + + Specific Option Definitions + + End of Option List + + +--------+ + |00000000| + +--------+ + Kind=0 + + This option code indicates the end of the option list. This + might not coincide with the end of the TCP header according to + the Data Offset field. This is used at the end of all options, + not the end of each option, and need only be used if the end of + the options would not otherwise coincide with the end of the TCP + header. + + No-Operation + + +--------+ + |00000001| + +--------+ + Kind=1 + + This option code may be used between options, for example, to + align the beginning of a subsequent option on a word boundary. + There is no guarantee that senders will use this option, so + receivers must be prepared to process options even if they do + not begin on a word boundary. + + Maximum Segment Size + + +--------+--------+---------+--------+ + |00000010|00000100| max seg size | + +--------+--------+---------+--------+ + Kind=2 Length=4 + + + + + + +[Page 18] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + Maximum Segment Size Option Data: 16 bits + + If this option is present, then it communicates the maximum + receive segment size at the TCP which sends this segment. + This field must only be sent in the initial connection request + (i.e., in segments with the SYN control bit set). If this + option is not used, any segment size is allowed. + + Padding: variable + + The TCP header padding is used to ensure that the TCP header ends + and data begins on a 32 bit boundary. The padding is composed of + zeros. + +3.2. Terminology + + Before we can discuss very much about the operation of the TCP we need + to introduce some detailed terminology. The maintenance of a TCP + connection requires the remembering of several variables. We conceive + of these variables being stored in a connection record called a + Transmission Control Block or TCB. Among the variables stored in the + TCB are the local and remote socket numbers, the security and + precedence of the connection, pointers to the user's send and receive + buffers, pointers to the retransmit queue and to the current segment. + In addition several variables relating to the send and receive + sequence numbers are stored in the TCB. + + Send Sequence Variables + + SND.UNA - send unacknowledged + SND.NXT - send next + SND.WND - send window + SND.UP - send urgent pointer + SND.WL1 - segment sequence number used for last window update + SND.WL2 - segment acknowledgment number used for last window + update + ISS - initial send sequence number + + Receive Sequence Variables + + RCV.NXT - receive next + RCV.WND - receive window + RCV.UP - receive urgent pointer + IRS - initial receive sequence number + + + + + + + [Page 19] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + The following diagrams may help to relate some of these variables to + the sequence space. + + Send Sequence Space + + 1 2 3 4 + ----------|----------|----------|---------- + SND.UNA SND.NXT SND.UNA + +SND.WND + + 1 - old sequence numbers which have been acknowledged + 2 - sequence numbers of unacknowledged data + 3 - sequence numbers allowed for new data transmission + 4 - future sequence numbers which are not yet allowed + + Send Sequence Space + + Figure 4. + + + + The send window is the portion of the sequence space labeled 3 in + figure 4. + + Receive Sequence Space + + 1 2 3 + ----------|----------|---------- + RCV.NXT RCV.NXT + +RCV.WND + + 1 - old sequence numbers which have been acknowledged + 2 - sequence numbers allowed for new reception + 3 - future sequence numbers which are not yet allowed + + Receive Sequence Space + + Figure 5. + + + + The receive window is the portion of the sequence space labeled 2 in + figure 5. + + There are also some variables used frequently in the discussion that + take their values from the fields of the current segment. + + + + +[Page 20] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + Current Segment Variables + + SEG.SEQ - segment sequence number + SEG.ACK - segment acknowledgment number + SEG.LEN - segment length + SEG.WND - segment window + SEG.UP - segment urgent pointer + SEG.PRC - segment precedence value + + A connection progresses through a series of states during its + lifetime. The states are: LISTEN, SYN-SENT, SYN-RECEIVED, + ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, + TIME-WAIT, and the fictional state CLOSED. CLOSED is fictional + because it represents the state when there is no TCB, and therefore, + no connection. Briefly the meanings of the states are: + + LISTEN - represents waiting for a connection request from any remote + TCP and port. + + SYN-SENT - represents waiting for a matching connection request + after having sent a connection request. + + SYN-RECEIVED - represents waiting for a confirming connection + request acknowledgment after having both received and sent a + connection request. + + ESTABLISHED - represents an open connection, data received can be + delivered to the user. The normal state for the data transfer phase + of the connection. + + FIN-WAIT-1 - represents waiting for a connection termination request + from the remote TCP, or an acknowledgment of the connection + termination request previously sent. + + FIN-WAIT-2 - represents waiting for a connection termination request + from the remote TCP. + + CLOSE-WAIT - represents waiting for a connection termination request + from the local user. + + CLOSING - represents waiting for a connection termination request + acknowledgment from the remote TCP. + + LAST-ACK - represents waiting for an acknowledgment of the + connection termination request previously sent to the remote TCP + (which includes an acknowledgment of its connection termination + request). + + + + [Page 21] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + TIME-WAIT - represents waiting for enough time to pass to be sure + the remote TCP received the acknowledgment of its connection + termination request. + + CLOSED - represents no connection state at all. + + A TCP connection progresses from one state to another in response to + events. The events are the user calls, OPEN, SEND, RECEIVE, CLOSE, + ABORT, and STATUS; the incoming segments, particularly those + containing the SYN, ACK, RST and FIN flags; and timeouts. + + The state diagram in figure 6 illustrates only state changes, together + with the causing events and resulting actions, but addresses neither + error conditions nor actions which are not connected with state + changes. In a later section, more detail is offered with respect to + the reaction of the TCP to events. + + NOTE BENE: this diagram is only a summary and must not be taken as + the total specification. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 22] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + + +---------+ ---------\ active OPEN + | CLOSED | \ ----------- + +---------+<---------\ \ create TCB + | ^ \ \ snd SYN + passive OPEN | | CLOSE \ \ + ------------ | | ---------- \ \ + create TCB | | delete TCB \ \ + V | \ \ + +---------+ CLOSE | \ + | LISTEN | ---------- | | + +---------+ delete TCB | | + rcv SYN | | SEND | | + ----------- | | ------- | V + +---------+ snd SYN,ACK / \ snd SYN +---------+ + | |<----------------- ------------------>| | + | SYN | rcv SYN | SYN | + | RCVD |<-----------------------------------------------| SENT | + | | snd ACK | | + | |------------------ -------------------| | + +---------+ rcv ACK of SYN \ / rcv SYN,ACK +---------+ + | -------------- | | ----------- + | x | | snd ACK + | V V + | CLOSE +---------+ + | ------- | ESTAB | + | snd FIN +---------+ + | CLOSE | | rcv FIN + V ------- | | ------- + +---------+ snd FIN / \ snd ACK +---------+ + | FIN |<----------------- ------------------>| CLOSE | + | WAIT-1 |------------------ | WAIT | + +---------+ rcv FIN \ +---------+ + | rcv ACK of FIN ------- | CLOSE | + | -------------- snd ACK | ------- | + V x V snd FIN V + +---------+ +---------+ +---------+ + |FINWAIT-2| | CLOSING | | LAST-ACK| + +---------+ +---------+ +---------+ + | rcv ACK of FIN | rcv ACK of FIN | + | rcv FIN -------------- | Timeout=2MSL -------------- | + | ------- x V ------------ x V + \ snd ACK +---------+delete TCB +---------+ + ------------------------>|TIME WAIT|------------------>| CLOSED | + +---------+ +---------+ + + TCP Connection State Diagram + Figure 6. + + + [Page 23] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + +3.3. Sequence Numbers + + A fundamental notion in the design is that every octet of data sent + over a TCP connection has a sequence number. Since every octet is + sequenced, each of them can be acknowledged. The acknowledgment + mechanism employed is cumulative so that an acknowledgment of sequence + number X indicates that all octets up to but not including X have been + received. This mechanism allows for straight-forward duplicate + detection in the presence of retransmission. Numbering of octets + within a segment is that the first data octet immediately following + the header is the lowest numbered, and the following octets are + numbered consecutively. + + It is essential to remember that the actual sequence number space is + finite, though very large. This space ranges from 0 to 2**32 - 1. + Since the space is finite, all arithmetic dealing with sequence + numbers must be performed modulo 2**32. This unsigned arithmetic + preserves the relationship of sequence numbers as they cycle from + 2**32 - 1 to 0 again. There are some subtleties to computer modulo + arithmetic, so great care should be taken in programming the + comparison of such values. The symbol "=<" means "less than or equal" + (modulo 2**32). + + The typical kinds of sequence number comparisons which the TCP must + perform include: + + (a) Determining that an acknowledgment refers to some sequence + number sent but not yet acknowledged. + + (b) Determining that all sequence numbers occupied by a segment + have been acknowledged (e.g., to remove the segment from a + retransmission queue). + + (c) Determining that an incoming segment contains sequence numbers + which are expected (i.e., that the segment "overlaps" the + receive window). + + + + + + + + + + + + + + +[Page 24] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + In response to sending data the TCP will receive acknowledgments. The + following comparisons are needed to process the acknowledgments. + + SND.UNA = oldest unacknowledged sequence number + + SND.NXT = next sequence number to be sent + + SEG.ACK = acknowledgment from the receiving TCP (next sequence + number expected by the receiving TCP) + + SEG.SEQ = first sequence number of a segment + + SEG.LEN = the number of octets occupied by the data in the segment + (counting SYN and FIN) + + SEG.SEQ+SEG.LEN-1 = last sequence number of a segment + + A new acknowledgment (called an "acceptable ack"), is one for which + the inequality below holds: + + SND.UNA < SEG.ACK =< SND.NXT + + A segment on the retransmission queue is fully acknowledged if the sum + of its sequence number and length is less or equal than the + acknowledgment value in the incoming segment. + + When data is received the following comparisons are needed: + + RCV.NXT = next sequence number expected on an incoming segments, and + is the left or lower edge of the receive window + + RCV.NXT+RCV.WND-1 = last sequence number expected on an incoming + segment, and is the right or upper edge of the receive window + + SEG.SEQ = first sequence number occupied by the incoming segment + + SEG.SEQ+SEG.LEN-1 = last sequence number occupied by the incoming + segment + + A segment is judged to occupy a portion of valid receive sequence + space if + + RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + + or + + RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND + + + + [Page 25] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + The first part of this test checks to see if the beginning of the + segment falls in the window, the second part of the test checks to see + if the end of the segment falls in the window; if the segment passes + either part of the test it contains data in the window. + + Actually, it is a little more complicated than this. Due to zero + windows and zero length segments, we have four cases for the + acceptability of an incoming segment: + + Segment Receive Test + Length Window + ------- ------- ------------------------------------------- + + 0 0 SEG.SEQ = RCV.NXT + + 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + + >0 0 not acceptable + + >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND + + Note that when the receive window is zero no segments should be + acceptable except ACK segments. Thus, it is be possible for a TCP to + maintain a zero receive window while transmitting data and receiving + ACKs. However, even when the receive window is zero, a TCP must + process the RST and URG fields of all incoming segments. + + We have taken advantage of the numbering scheme to protect certain + control information as well. This is achieved by implicitly including + some control flags in the sequence space so they can be retransmitted + and acknowledged without confusion (i.e., one and only one copy of the + control will be acted upon). Control information is not physically + carried in the segment data space. Consequently, we must adopt rules + for implicitly assigning sequence numbers to control. The SYN and FIN + are the only controls requiring this protection, and these controls + are used only at connection opening and closing. For sequence number + purposes, the SYN is considered to occur before the first actual data + octet of the segment in which it occurs, while the FIN is considered + to occur after the last actual data octet in a segment in which it + occurs. The segment length (SEG.LEN) includes both data and sequence + space occupying controls. When a SYN is present then SEG.SEQ is the + sequence number of the SYN. + + + + + + + +[Page 26] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + Initial Sequence Number Selection + + The protocol places no restriction on a particular connection being + used over and over again. A connection is defined by a pair of + sockets. New instances of a connection will be referred to as + incarnations of the connection. The problem that arises from this is + -- "how does the TCP identify duplicate segments from previous + incarnations of the connection?" This problem becomes apparent if the + connection is being opened and closed in quick succession, or if the + connection breaks with loss of memory and is then reestablished. + + To avoid confusion we must prevent segments from one incarnation of a + connection from being used while the same sequence numbers may still + be present in the network from an earlier incarnation. We want to + assure this, even if a TCP crashes and loses all knowledge of the + sequence numbers it has been using. When new connections are created, + an initial sequence number (ISN) generator is employed which selects a + new 32 bit ISN. The generator is bound to a (possibly fictitious) 32 + bit clock whose low order bit is incremented roughly every 4 + microseconds. Thus, the ISN cycles approximately every 4.55 hours. + Since we assume that segments will stay in the network no more than + the Maximum Segment Lifetime (MSL) and that the MSL is less than 4.55 + hours we can reasonably assume that ISN's will be unique. + + For each connection there is a send sequence number and a receive + sequence number. The initial send sequence number (ISS) is chosen by + the data sending TCP, and the initial receive sequence number (IRS) is + learned during the connection establishing procedure. + + For a connection to be established or initialized, the two TCPs must + synchronize on each other's initial sequence numbers. This is done in + an exchange of connection establishing segments carrying a control bit + called "SYN" (for synchronize) and the initial sequence numbers. As a + shorthand, segments carrying the SYN bit are also called "SYNs". + Hence, the solution requires a suitable mechanism for picking an + initial sequence number and a slightly involved handshake to exchange + the ISN's. + + The synchronization requires each side to send it's own initial + sequence number and to receive a confirmation of it in acknowledgment + from the other side. Each side must also receive the other side's + initial sequence number and send a confirming acknowledgment. + + 1) A --> B SYN my sequence number is X + 2) A <-- B ACK your sequence number is X + 3) A <-- B SYN my sequence number is Y + 4) A --> B ACK your sequence number is Y + + + + [Page 27] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + Because steps 2 and 3 can be combined in a single message this is + called the three way (or three message) handshake. + + A three way handshake is necessary because sequence numbers are not + tied to a global clock in the network, and TCPs may have different + mechanisms for picking the ISN's. The receiver of the first SYN has + no way of knowing whether the segment was an old delayed one or not, + unless it remembers the last sequence number used on the connection + (which is not always possible), and so it must ask the sender to + verify this SYN. The three way handshake and the advantages of a + clock-driven scheme are discussed in [3]. + + Knowing When to Keep Quiet + + To be sure that a TCP does not create a segment that carries a + sequence number which may be duplicated by an old segment remaining in + the network, the TCP must keep quiet for a maximum segment lifetime + (MSL) before assigning any sequence numbers upon starting up or + recovering from a crash in which memory of sequence numbers in use was + lost. For this specification the MSL is taken to be 2 minutes. This + is an engineering choice, and may be changed if experience indicates + it is desirable to do so. Note that if a TCP is reinitialized in some + sense, yet retains its memory of sequence numbers in use, then it need + not wait at all; it must only be sure to use sequence numbers larger + than those recently used. + + The TCP Quiet Time Concept + + This specification provides that hosts which "crash" without + retaining any knowledge of the last sequence numbers transmitted on + each active (i.e., not closed) connection shall delay emitting any + TCP segments for at least the agreed Maximum Segment Lifetime (MSL) + in the internet system of which the host is a part. In the + paragraphs below, an explanation for this specification is given. + TCP implementors may violate the "quiet time" restriction, but only + at the risk of causing some old data to be accepted as new or new + data rejected as old duplicated by some receivers in the internet + system. + + TCPs consume sequence number space each time a segment is formed and + entered into the network output queue at a source host. The + duplicate detection and sequencing algorithm in the TCP protocol + relies on the unique binding of segment data to sequence space to + the extent that sequence numbers will not cycle through all 2**32 + values before the segment data bound to those sequence numbers has + been delivered and acknowledged by the receiver and all duplicate + copies of the segments have "drained" from the internet. Without + such an assumption, two distinct TCP segments could conceivably be + + +[Page 28] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + assigned the same or overlapping sequence numbers, causing confusion + at the receiver as to which data is new and which is old. Remember + that each segment is bound to as many consecutive sequence numbers + as there are octets of data in the segment. + + Under normal conditions, TCPs keep track of the next sequence number + to emit and the oldest awaiting acknowledgment so as to avoid + mistakenly using a sequence number over before its first use has + been acknowledged. This alone does not guarantee that old duplicate + data is drained from the net, so the sequence space has been made + very large to reduce the probability that a wandering duplicate will + cause trouble upon arrival. At 2 megabits/sec. it takes 4.5 hours + to use up 2**32 octets of sequence space. Since the maximum segment + lifetime in the net is not likely to exceed a few tens of seconds, + this is deemed ample protection for foreseeable nets, even if data + rates escalate to l0's of megabits/sec. At 100 megabits/sec, the + cycle time is 5.4 minutes which may be a little short, but still + within reason. + + The basic duplicate detection and sequencing algorithm in TCP can be + defeated, however, if a source TCP does not have any memory of the + sequence numbers it last used on a given connection. For example, if + the TCP were to start all connections with sequence number 0, then + upon crashing and restarting, a TCP might re-form an earlier + connection (possibly after half-open connection resolution) and emit + packets with sequence numbers identical to or overlapping with + packets still in the network which were emitted on an earlier + incarnation of the same connection. In the absence of knowledge + about the sequence numbers used on a particular connection, the TCP + specification recommends that the source delay for MSL seconds + before emitting segments on the connection, to allow time for + segments from the earlier connection incarnation to drain from the + system. + + Even hosts which can remember the time of day and used it to select + initial sequence number values are not immune from this problem + (i.e., even if time of day is used to select an initial sequence + number for each new connection incarnation). + + Suppose, for example, that a connection is opened starting with + sequence number S. Suppose that this connection is not used much + and that eventually the initial sequence number function (ISN(t)) + takes on a value equal to the sequence number, say S1, of the last + segment sent by this TCP on a particular connection. Now suppose, + at this instant, the host crashes, recovers, and establishes a new + incarnation of the connection. The initial sequence number chosen is + S1 = ISN(t) -- last used sequence number on old incarnation of + connection! If the recovery occurs quickly enough, any old + + + [Page 29] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + duplicates in the net bearing sequence numbers in the neighborhood + of S1 may arrive and be treated as new packets by the receiver of + the new incarnation of the connection. + + The problem is that the recovering host may not know for how long it + crashed nor does it know whether there are still old duplicates in + the system from earlier connection incarnations. + + One way to deal with this problem is to deliberately delay emitting + segments for one MSL after recovery from a crash- this is the "quite + time" specification. Hosts which prefer to avoid waiting are + willing to risk possible confusion of old and new packets at a given + destination may choose not to wait for the "quite time". + Implementors may provide TCP users with the ability to select on a + connection by connection basis whether to wait after a crash, or may + informally implement the "quite time" for all connections. + Obviously, even where a user selects to "wait," this is not + necessary after the host has been "up" for at least MSL seconds. + + To summarize: every segment emitted occupies one or more sequence + numbers in the sequence space, the numbers occupied by a segment are + "busy" or "in use" until MSL seconds have passed, upon crashing a + block of space-time is occupied by the octets of the last emitted + segment, if a new connection is started too soon and uses any of the + sequence numbers in the space-time footprint of the last segment of + the previous connection incarnation, there is a potential sequence + number overlap area which could cause confusion at the receiver. + +3.4. Establishing a connection + + The "three-way handshake" is the procedure used to establish a + connection. This procedure normally is initiated by one TCP and + responded to by another TCP. The procedure also works if two TCP + simultaneously initiate the procedure. When simultaneous attempt + occurs, each TCP receives a "SYN" segment which carries no + acknowledgment after it has sent a "SYN". Of course, the arrival of + an old duplicate "SYN" segment can potentially make it appear, to the + recipient, that a simultaneous connection initiation is in progress. + Proper use of "reset" segments can disambiguate these cases. + + Several examples of connection initiation follow. Although these + examples do not show connection synchronization using data-carrying + segments, this is perfectly legitimate, so long as the receiving TCP + doesn't deliver the data to the user until it is clear the data is + valid (i.e., the data must be buffered at the receiver until the + connection reaches the ESTABLISHED state). The three-way handshake + reduces the possibility of false connections. It is the + + + +[Page 30] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + implementation of a trade-off between memory and messages to provide + information for this checking. + + The simplest three-way handshake is shown in figure 7 below. The + figures should be interpreted in the following way. Each line is + numbered for reference purposes. Right arrows (-->) indicate + departure of a TCP segment from TCP A to TCP B, or arrival of a + segment at B from A. Left arrows (<--), indicate the reverse. + Ellipsis (...) indicates a segment which is still in the network + (delayed). An "XXX" indicates a segment which is lost or rejected. + Comments appear in parentheses. TCP states represent the state AFTER + the departure or arrival of the segment (whose contents are shown in + the center of each line). Segment contents are shown in abbreviated + form, with sequence number, control flags, and ACK field. Other + fields such as window, addresses, lengths, and text have been left out + in the interest of clarity. + + + + TCP A TCP B + + 1. CLOSED LISTEN + + 2. SYN-SENT --> --> SYN-RECEIVED + + 3. ESTABLISHED <-- <-- SYN-RECEIVED + + 4. ESTABLISHED --> --> ESTABLISHED + + 5. ESTABLISHED --> --> ESTABLISHED + + Basic 3-Way Handshake for Connection Synchronization + + Figure 7. + + In line 2 of figure 7, TCP A begins by sending a SYN segment + indicating that it will use sequence numbers starting with sequence + number 100. In line 3, TCP B sends a SYN and acknowledges the SYN it + received from TCP A. Note that the acknowledgment field indicates TCP + B is now expecting to hear sequence 101, acknowledging the SYN which + occupied sequence 100. + + At line 4, TCP A responds with an empty segment containing an ACK for + TCP B's SYN; and in line 5, TCP A sends some data. Note that the + sequence number of the segment in line 5 is the same as in line 4 + because the ACK does not occupy sequence number space (if it did, we + would wind up ACKing ACK's!). + + + + [Page 31] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + Simultaneous initiation is only slightly more complex, as is shown in + figure 8. Each TCP cycles from CLOSED to SYN-SENT to SYN-RECEIVED to + ESTABLISHED. + + + + TCP A TCP B + + 1. CLOSED CLOSED + + 2. SYN-SENT --> ... + + 3. SYN-RECEIVED <-- <-- SYN-SENT + + 4. ... --> SYN-RECEIVED + + 5. SYN-RECEIVED --> ... + + 6. ESTABLISHED <-- <-- SYN-RECEIVED + + 7. ... --> ESTABLISHED + + Simultaneous Connection Synchronization + + Figure 8. + + The principle reason for the three-way handshake is to prevent old + duplicate connection initiations from causing confusion. To deal with + this, a special control message, reset, has been devised. If the + receiving TCP is in a non-synchronized state (i.e., SYN-SENT, + SYN-RECEIVED), it returns to LISTEN on receiving an acceptable reset. + If the TCP is in one of the synchronized states (ESTABLISHED, + FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), it + aborts the connection and informs its user. We discuss this latter + case under "half-open" connections below. + + + + + + + + + + + + + + + +[Page 32] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + + + TCP A TCP B + + 1. CLOSED LISTEN + + 2. SYN-SENT --> ... + + 3. (duplicate) ... --> SYN-RECEIVED + + 4. SYN-SENT <-- <-- SYN-RECEIVED + + 5. SYN-SENT --> --> LISTEN + + + 6. ... --> SYN-RECEIVED + + 7. SYN-SENT <-- <-- SYN-RECEIVED + + 8. ESTABLISHED --> --> ESTABLISHED + + Recovery from Old Duplicate SYN + + Figure 9. + + As a simple example of recovery from old duplicates, consider + figure 9. At line 3, an old duplicate SYN arrives at TCP B. TCP B + cannot tell that this is an old duplicate, so it responds normally + (line 4). TCP A detects that the ACK field is incorrect and returns a + RST (reset) with its SEQ field selected to make the segment + believable. TCP B, on receiving the RST, returns to the LISTEN state. + When the original SYN (pun intended) finally arrives at line 6, the + synchronization proceeds normally. If the SYN at line 6 had arrived + before the RST, a more complex exchange might have occurred with RST's + sent in both directions. + + Half-Open Connections and Other Anomalies + + An established connection is said to be "half-open" if one of the + TCPs has closed or aborted the connection at its end without the + knowledge of the other, or if the two ends of the connection have + become desynchronized owing to a crash that resulted in loss of + memory. Such connections will automatically become reset if an + attempt is made to send data in either direction. However, half-open + connections are expected to be unusual, and the recovery procedure is + mildly involved. + + If at site A the connection no longer exists, then an attempt by the + + + [Page 33] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + user at site B to send any data on it will result in the site B TCP + receiving a reset control message. Such a message indicates to the + site B TCP that something is wrong, and it is expected to abort the + connection. + + Assume that two user processes A and B are communicating with one + another when a crash occurs causing loss of memory to A's TCP. + Depending on the operating system supporting A's TCP, it is likely + that some error recovery mechanism exists. When the TCP is up again, + A is likely to start again from the beginning or from a recovery + point. As a result, A will probably try to OPEN the connection again + or try to SEND on the connection it believes open. In the latter + case, it receives the error message "connection not open" from the + local (A's) TCP. In an attempt to establish the connection, A's TCP + will send a segment containing SYN. This scenario leads to the + example shown in figure 10. After TCP A crashes, the user attempts to + re-open the connection. TCP B, in the meantime, thinks the connection + is open. + + + + TCP A TCP B + + 1. (CRASH) (send 300,receive 100) + + 2. CLOSED ESTABLISHED + + 3. SYN-SENT --> --> (??) + + 4. (!!) <-- <-- ESTABLISHED + + 5. SYN-SENT --> --> (Abort!!) + + 6. SYN-SENT CLOSED + + 7. SYN-SENT --> --> + + Half-Open Connection Discovery + + Figure 10. + + When the SYN arrives at line 3, TCP B, being in a synchronized state, + and the incoming segment outside the window, responds with an + acknowledgment indicating what sequence it next expects to hear (ACK + 100). TCP A sees that this segment does not acknowledge anything it + sent and, being unsynchronized, sends a reset (RST) because it has + detected a half-open connection. TCP B aborts at line 5. TCP A will + + + +[Page 34] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + continue to try to establish the connection; the problem is now + reduced to the basic 3-way handshake of figure 7. + + An interesting alternative case occurs when TCP A crashes and TCP B + tries to send data on what it thinks is a synchronized connection. + This is illustrated in figure 11. In this case, the data arriving at + TCP A from TCP B (line 2) is unacceptable because no such connection + exists, so TCP A sends a RST. The RST is acceptable so TCP B + processes it and aborts the connection. + + + + TCP A TCP B + + 1. (CRASH) (send 300,receive 100) + + 2. (??) <-- <-- ESTABLISHED + + 3. --> --> (ABORT!!) + + Active Side Causes Half-Open Connection Discovery + + Figure 11. + + In figure 12, we find the two TCPs A and B with passive connections + waiting for SYN. An old duplicate arriving at TCP B (line 2) stirs B + into action. A SYN-ACK is returned (line 3) and causes TCP A to + generate a RST (the ACK in line 3 is not acceptable). TCP B accepts + the reset and returns to its passive LISTEN state. + + + + TCP A TCP B + + 1. LISTEN LISTEN + + 2. ... --> SYN-RECEIVED + + 3. (??) <-- <-- SYN-RECEIVED + + 4. --> --> (return to LISTEN!) + + 5. LISTEN LISTEN + + Old Duplicate SYN Initiates a Reset on two Passive Sockets + + Figure 12. + + + + [Page 35] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + A variety of other cases are possible, all of which are accounted for + by the following rules for RST generation and processing. + + Reset Generation + + As a general rule, reset (RST) must be sent whenever a segment arrives + which apparently is not intended for the current connection. A reset + must not be sent if it is not clear that this is the case. + + There are three groups of states: + + 1. If the connection does not exist (CLOSED) then a reset is sent + in response to any incoming segment except another reset. In + particular, SYNs addressed to a non-existent connection are rejected + by this means. + + If the incoming segment has an ACK field, the reset takes its + sequence number from the ACK field of the segment, otherwise the + reset has sequence number zero and the ACK field is set to the sum + of the sequence number and segment length of the incoming segment. + The connection remains in the CLOSED state. + + 2. If the connection is in any non-synchronized state (LISTEN, + SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges + something not yet sent (the segment carries an unacceptable ACK), or + if an incoming segment has a security level or compartment which + does not exactly match the level and compartment requested for the + connection, a reset is sent. + + If our SYN has not been acknowledged and the precedence level of the + incoming segment is higher than the precedence level requested then + either raise the local precedence level (if allowed by the user and + the system) or send a reset; or if the precedence level of the + incoming segment is lower than the precedence level requested then + continue as if the precedence matched exactly (if the remote TCP + cannot raise the precedence level to match ours this will be + detected in the next segment it sends, and the connection will be + terminated then). If our SYN has been acknowledged (perhaps in this + incoming segment) the precedence level of the incoming segment must + match the local precedence level exactly, if it does not a reset + must be sent. + + If the incoming segment has an ACK field, the reset takes its + sequence number from the ACK field of the segment, otherwise the + reset has sequence number zero and the ACK field is set to the sum + of the sequence number and segment length of the incoming segment. + The connection remains in the same state. + + + +[Page 36] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + 3. If the connection is in a synchronized state (ESTABLISHED, + FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), + any unacceptable segment (out of window sequence number or + unacceptible acknowledgment number) must elicit only an empty + acknowledgment segment containing the current send-sequence number + and an acknowledgment indicating the next sequence number expected + to be received, and the connection remains in the same state. + + If an incoming segment has a security level, or compartment, or + precedence which does not exactly match the level, and compartment, + and precedence requested for the connection,a reset is sent and + connection goes to the CLOSED state. The reset takes its sequence + number from the ACK field of the incoming segment. + + Reset Processing + + In all states except SYN-SENT, all reset (RST) segments are validated + by checking their SEQ-fields. A reset is valid if its sequence number + is in the window. In the SYN-SENT state (a RST received in response + to an initial SYN), the RST is acceptable if the ACK field + acknowledges the SYN. + + The receiver of a RST first validates it, then changes state. If the + receiver was in the LISTEN state, it ignores it. If the receiver was + in SYN-RECEIVED state and had previously been in the LISTEN state, + then the receiver returns to the LISTEN state, otherwise the receiver + aborts the connection and goes to the CLOSED state. If the receiver + was in any other state, it aborts the connection and advises the user + and goes to the CLOSED state. + +3.5. Closing a Connection + + CLOSE is an operation meaning "I have no more data to send." The + notion of closing a full-duplex connection is subject to ambiguous + interpretation, of course, since it may not be obvious how to treat + the receiving side of the connection. We have chosen to treat CLOSE + in a simplex fashion. The user who CLOSEs may continue to RECEIVE + until he is told that the other side has CLOSED also. Thus, a program + could initiate several SENDs followed by a CLOSE, and then continue to + RECEIVE until signaled that a RECEIVE failed because the other side + has CLOSED. We assume that the TCP will signal a user, even if no + RECEIVEs are outstanding, that the other side has closed, so the user + can terminate his side gracefully. A TCP will reliably deliver all + buffers SENT before the connection was CLOSED so a user who expects no + data in return need only wait to hear the connection was CLOSED + successfully to know that all his data was received at the destination + TCP. Users must keep reading connections they close for sending until + the TCP says no more data. + + + [Page 37] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + There are essentially three cases: + + 1) The user initiates by telling the TCP to CLOSE the connection + + 2) The remote TCP initiates by sending a FIN control signal + + 3) Both users CLOSE simultaneously + + Case 1: Local user initiates the close + + In this case, a FIN segment can be constructed and placed on the + outgoing segment queue. No further SENDs from the user will be + accepted by the TCP, and it enters the FIN-WAIT-1 state. RECEIVEs + are allowed in this state. All segments preceding and including FIN + will be retransmitted until acknowledged. When the other TCP has + both acknowledged the FIN and sent a FIN of its own, the first TCP + can ACK this FIN. Note that a TCP receiving a FIN will ACK but not + send its own FIN until its user has CLOSED the connection also. + + Case 2: TCP receives a FIN from the network + + If an unsolicited FIN arrives from the network, the receiving TCP + can ACK it and tell the user that the connection is closing. The + user will respond with a CLOSE, upon which the TCP can send a FIN to + the other TCP after sending any remaining data. The TCP then waits + until its own FIN is acknowledged whereupon it deletes the + connection. If an ACK is not forthcoming, after the user timeout + the connection is aborted and the user is told. + + Case 3: both users close simultaneously + + A simultaneous CLOSE by users at both ends of a connection causes + FIN segments to be exchanged. When all segments preceding the FINs + have been processed and acknowledged, each TCP can ACK the FIN it + has received. Both will, upon receiving these ACKs, delete the + connection. + + + + + + + + + + + + + + +[Page 38] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + + + TCP A TCP B + + 1. ESTABLISHED ESTABLISHED + + 2. (Close) + FIN-WAIT-1 --> --> CLOSE-WAIT + + 3. FIN-WAIT-2 <-- <-- CLOSE-WAIT + + 4. (Close) + TIME-WAIT <-- <-- LAST-ACK + + 5. TIME-WAIT --> --> CLOSED + + 6. (2 MSL) + CLOSED + + Normal Close Sequence + + Figure 13. + + + + TCP A TCP B + + 1. ESTABLISHED ESTABLISHED + + 2. (Close) (Close) + FIN-WAIT-1 --> ... FIN-WAIT-1 + <-- <-- + ... --> + + 3. CLOSING --> ... CLOSING + <-- <-- + ... --> + + 4. TIME-WAIT TIME-WAIT + (2 MSL) (2 MSL) + CLOSED CLOSED + + Simultaneous Close Sequence + + Figure 14. + + + + + + [Page 39] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + +3.6. Precedence and Security + + The intent is that connection be allowed only between ports operating + with exactly the same security and compartment values and at the + higher of the precedence level requested by the two ports. + + The precedence and security parameters used in TCP are exactly those + defined in the Internet Protocol (IP) [2]. Throughout this TCP + specification the term "security/compartment" is intended to indicate + the security parameters used in IP including security, compartment, + user group, and handling restriction. + + A connection attempt with mismatched security/compartment values or a + lower precedence value must be rejected by sending a reset. Rejecting + a connection due to too low a precedence only occurs after an + acknowledgment of the SYN has been received. + + Note that TCP modules which operate only at the default value of + precedence will still have to check the precedence of incoming + segments and possibly raise the precedence level they use on the + connection. + + The security paramaters may be used even in a non-secure environment + (the values would indicate unclassified data), thus hosts in + non-secure environments must be prepared to receive the security + parameters, though they need not send them. + +3.7. Data Communication + + Once the connection is established data is communicated by the + exchange of segments. Because segments may be lost due to errors + (checksum test failure), or network congestion, TCP uses + retransmission (after a timeout) to ensure delivery of every segment. + Duplicate segments may arrive due to network or TCP retransmission. + As discussed in the section on sequence numbers the TCP performs + certain tests on the sequence and acknowledgment numbers in the + segments to verify their acceptability. + + The sender of data keeps track of the next sequence number to use in + the variable SND.NXT. The receiver of data keeps track of the next + sequence number to expect in the variable RCV.NXT. The sender of data + keeps track of the oldest unacknowledged sequence number in the + variable SND.UNA. If the data flow is momentarily idle and all data + sent has been acknowledged then the three variables will be equal. + + When the sender creates a segment and transmits it the sender advances + SND.NXT. When the receiver accepts a segment it advances RCV.NXT and + sends an acknowledgment. When the data sender receives an + + +[Page 40] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + acknowledgment it advances SND.UNA. The extent to which the values of + these variables differ is a measure of the delay in the communication. + The amount by which the variables are advanced is the length of the + data in the segment. Note that once in the ESTABLISHED state all + segments must carry current acknowledgment information. + + The CLOSE user call implies a push function, as does the FIN control + flag in an incoming segment. + + Retransmission Timeout + + Because of the variability of the networks that compose an + internetwork system and the wide range of uses of TCP connections the + retransmission timeout must be dynamically determined. One procedure + for determining a retransmission time out is given here as an + illustration. + + An Example Retransmission Timeout Procedure + + Measure the elapsed time between sending a data octet with a + particular sequence number and receiving an acknowledgment that + covers that sequence number (segments sent do not have to match + segments received). This measured elapsed time is the Round Trip + Time (RTT). Next compute a Smoothed Round Trip Time (SRTT) as: + + SRTT = ( ALPHA * SRTT ) + ((1-ALPHA) * RTT) + + and based on this, compute the retransmission timeout (RTO) as: + + RTO = min[UBOUND,max[LBOUND,(BETA*SRTT)]] + + where UBOUND is an upper bound on the timeout (e.g., 1 minute), + LBOUND is a lower bound on the timeout (e.g., 1 second), ALPHA is + a smoothing factor (e.g., .8 to .9), and BETA is a delay variance + factor (e.g., 1.3 to 2.0). + + The Communication of Urgent Information + + The objective of the TCP urgent mechanism is to allow the sending user + to stimulate the receiving user to accept some urgent data and to + permit the receiving TCP to indicate to the receiving user when all + the currently known urgent data has been received by the user. + + This mechanism permits a point in the data stream to be designated as + the end of urgent information. Whenever this point is in advance of + the receive sequence number (RCV.NXT) at the receiving TCP, that TCP + must tell the user to go into "urgent mode"; when the receive sequence + number catches up to the urgent pointer, the TCP must tell user to go + + + [Page 41] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + into "normal mode". If the urgent pointer is updated while the user + is in "urgent mode", the update will be invisible to the user. + + The method employs a urgent field which is carried in all segments + transmitted. The URG control flag indicates that the urgent field is + meaningful and must be added to the segment sequence number to yield + the urgent pointer. The absence of this flag indicates that there is + no urgent data outstanding. + + To send an urgent indication the user must also send at least one data + octet. If the sending user also indicates a push, timely delivery of + the urgent information to the destination process is enhanced. + + Managing the Window + + The window sent in each segment indicates the range of sequence + numbers the sender of the window (the data receiver) is currently + prepared to accept. There is an assumption that this is related to + the currently available data buffer space available for this + connection. + + Indicating a large window encourages transmissions. If more data + arrives than can be accepted, it will be discarded. This will result + in excessive retransmissions, adding unnecessarily to the load on the + network and the TCPs. Indicating a small window may restrict the + transmission of data to the point of introducing a round trip delay + between each new segment transmitted. + + The mechanisms provided allow a TCP to advertise a large window and to + subsequently advertise a much smaller window without having accepted + that much data. This, so called "shrinking the window," is strongly + discouraged. The robustness principle dictates that TCPs will not + shrink the window themselves, but will be prepared for such behavior + on the part of other TCPs. + + The sending TCP must be prepared to accept from the user and send at + least one octet of new data even if the send window is zero. The + sending TCP must regularly retransmit to the receiving TCP even when + the window is zero. Two minutes is recommended for the retransmission + interval when the window is zero. This retransmission is essential to + guarantee that when either TCP has a zero window the re-opening of the + window will be reliably reported to the other. + + When the receiving TCP has a zero window and a segment arrives it must + still send an acknowledgment showing its next expected sequence number + and current window (zero). + + The sending TCP packages the data to be transmitted into segments + + +[Page 42] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + which fit the current window, and may repackage segments on the + retransmission queue. Such repackaging is not required, but may be + helpful. + + In a connection with a one-way data flow, the window information will + be carried in acknowledgment segments that all have the same sequence + number so there will be no way to reorder them if they arrive out of + order. This is not a serious problem, but it will allow the window + information to be on occasion temporarily based on old reports from + the data receiver. A refinement to avoid this problem is to act on + the window information from segments that carry the highest + acknowledgment number (that is segments with acknowledgment number + equal or greater than the highest previously received). + + The window management procedure has significant influence on the + communication performance. The following comments are suggestions to + implementers. + + Window Management Suggestions + + Allocating a very small window causes data to be transmitted in + many small segments when better performance is achieved using + fewer large segments. + + One suggestion for avoiding small windows is for the receiver to + defer updating a window until the additional allocation is at + least X percent of the maximum allocation possible for the + connection (where X might be 20 to 40). + + Another suggestion is for the sender to avoid sending small + segments by waiting until the window is large enough before + sending data. If the the user signals a push function then the + data must be sent even if it is a small segment. + + Note that the acknowledgments should not be delayed or unnecessary + retransmissions will result. One strategy would be to send an + acknowledgment when a small segment arrives (with out updating the + window information), and then to send another acknowledgment with + new window information when the window is larger. + + The segment sent to probe a zero window may also begin a break up + of transmitted data into smaller and smaller segments. If a + segment containing a single data octet sent to probe a zero window + is accepted, it consumes one octet of the window now available. + If the sending TCP simply sends as much as it can whenever the + window is non zero, the transmitted data will be broken into + alternating big and small segments. As time goes on, occasional + pauses in the receiver making window allocation available will + + + [Page 43] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + result in breaking the big segments into a small and not quite so + big pair. And after a while the data transmission will be in + mostly small segments. + + The suggestion here is that the TCP implementations need to + actively attempt to combine small window allocations into larger + windows, since the mechanisms for managing the window tend to lead + to many small windows in the simplest minded implementations. + +3.8. Interfaces + + There are of course two interfaces of concern: the user/TCP interface + and the TCP/lower-level interface. We have a fairly elaborate model + of the user/TCP interface, but the interface to the lower level + protocol module is left unspecified here, since it will be specified + in detail by the specification of the lowel level protocol. For the + case that the lower level is IP we note some of the parameter values + that TCPs might use. + + User/TCP Interface + + The following functional description of user commands to the TCP is, + at best, fictional, since every operating system will have different + facilities. Consequently, we must warn readers that different TCP + implementations may have different user interfaces. However, all + TCPs must provide a certain minimum set of services to guarantee + that all TCP implementations can support the same protocol + hierarchy. This section specifies the functional interfaces + required of all TCP implementations. + + TCP User Commands + + The following sections functionally characterize a USER/TCP + interface. The notation used is similar to most procedure or + function calls in high level languages, but this usage is not + meant to rule out trap type service calls (e.g., SVCs, UUOs, + EMTs). + + The user commands described below specify the basic functions the + TCP must perform to support interprocess communication. + Individual implementations must define their own exact format, and + may provide combinations or subsets of the basic functions in + single calls. In particular, some implementations may wish to + automatically OPEN a connection on the first SEND or RECEIVE + issued by the user for a given connection. + + + + + +[Page 44] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + In providing interprocess communication facilities, the TCP must + not only accept commands, but must also return information to the + processes it serves. The latter consists of: + + (a) general information about a connection (e.g., interrupts, + remote close, binding of unspecified foreign socket). + + (b) replies to specific user commands indicating success or + various types of failure. + + Open + + Format: OPEN (local port, foreign socket, active/passive + [, timeout] [, precedence] [, security/compartment] [, options]) + -> local connection name + + We assume that the local TCP is aware of the identity of the + processes it serves and will check the authority of the process + to use the connection specified. Depending upon the + implementation of the TCP, the local network and TCP identifiers + for the source address will either be supplied by the TCP or the + lower level protocol (e.g., IP). These considerations are the + result of concern about security, to the extent that no TCP be + able to masquerade as another one, and so on. Similarly, no + process can masquerade as another without the collusion of the + TCP. + + If the active/passive flag is set to passive, then this is a + call to LISTEN for an incoming connection. A passive open may + have either a fully specified foreign socket to wait for a + particular connection or an unspecified foreign socket to wait + for any call. A fully specified passive call can be made active + by the subsequent execution of a SEND. + + A transmission control block (TCB) is created and partially + filled in with data from the OPEN command parameters. + + On an active OPEN command, the TCP will begin the procedure to + synchronize (i.e., establish) the connection at once. + + The timeout, if present, permits the caller to set up a timeout + for all data submitted to TCP. If data is not successfully + delivered to the destination within the timeout period, the TCP + will abort the connection. The present global default is five + minutes. + + The TCP or some component of the operating system will verify + the users authority to open a connection with the specified + + + [Page 45] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + precedence or security/compartment. The absence of precedence + or security/compartment specification in the OPEN call indicates + the default values must be used. + + TCP will accept incoming requests as matching only if the + security/compartment information is exactly the same and only if + the precedence is equal to or higher than the precedence + requested in the OPEN call. + + The precedence for the connection is the higher of the values + requested in the OPEN call and received from the incoming + request, and fixed at that value for the life of the + connection.Implementers may want to give the user control of + this precedence negotiation. For example, the user might be + allowed to specify that the precedence must be exactly matched, + or that any attempt to raise the precedence be confirmed by the + user. + + A local connection name will be returned to the user by the TCP. + The local connection name can then be used as a short hand term + for the connection defined by the + pair. + + Send + + Format: SEND (local connection name, buffer address, byte + count, PUSH flag, URGENT flag [,timeout]) + + This call causes the data contained in the indicated user buffer + to be sent on the indicated connection. If the connection has + not been opened, the SEND is considered an error. Some + implementations may allow users to SEND first; in which case, an + automatic OPEN would be done. If the calling process is not + authorized to use this connection, an error is returned. + + If the PUSH flag is set, the data must be transmitted promptly + to the receiver, and the PUSH bit will be set in the last TCP + segment created from the buffer. If the PUSH flag is not set, + the data may be combined with data from subsequent SENDs for + transmission efficiency. + + If the URGENT flag is set, segments sent to the destination TCP + will have the urgent pointer set. The receiving TCP will signal + the urgent condition to the receiving process if the urgent + pointer indicates that data preceding the urgent pointer has not + been consumed by the receiving process. The purpose of urgent + is to stimulate the receiver to process the urgent data and to + indicate to the receiver when all the currently known urgent + + +[Page 46] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + data has been received. The number of times the sending user's + TCP signals urgent will not necessarily be equal to the number + of times the receiving user will be notified of the presence of + urgent data. + + If no foreign socket was specified in the OPEN, but the + connection is established (e.g., because a LISTENing connection + has become specific due to a foreign segment arriving for the + local socket), then the designated buffer is sent to the implied + foreign socket. Users who make use of OPEN with an unspecified + foreign socket can make use of SEND without ever explicitly + knowing the foreign socket address. + + However, if a SEND is attempted before the foreign socket + becomes specified, an error will be returned. Users can use the + STATUS call to determine the status of the connection. In some + implementations the TCP may notify the user when an unspecified + socket is bound. + + If a timeout is specified, the current user timeout for this + connection is changed to the new one. + + In the simplest implementation, SEND would not return control to + the sending process until either the transmission was complete + or the timeout had been exceeded. However, this simple method + is both subject to deadlocks (for example, both sides of the + connection might try to do SENDs before doing any RECEIVEs) and + offers poor performance, so it is not recommended. A more + sophisticated implementation would return immediately to allow + the process to run concurrently with network I/O, and, + furthermore, to allow multiple SENDs to be in progress. + Multiple SENDs are served in first come, first served order, so + the TCP will queue those it cannot service immediately. + + We have implicitly assumed an asynchronous user interface in + which a SEND later elicits some kind of SIGNAL or + pseudo-interrupt from the serving TCP. An alternative is to + return a response immediately. For instance, SENDs might return + immediate local acknowledgment, even if the segment sent had not + been acknowledged by the distant TCP. We could optimistically + assume eventual success. If we are wrong, the connection will + close anyway due to the timeout. In implementations of this + kind (synchronous), there will still be some asynchronous + signals, but these will deal with the connection itself, and not + with specific segments or buffers. + + In order for the process to distinguish among error or success + indications for different SENDs, it might be appropriate for the + + + [Page 47] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + buffer address to be returned along with the coded response to + the SEND request. TCP-to-user signals are discussed below, + indicating the information which should be returned to the + calling process. + + Receive + + Format: RECEIVE (local connection name, buffer address, byte + count) -> byte count, urgent flag, push flag + + This command allocates a receiving buffer associated with the + specified connection. If no OPEN precedes this command or the + calling process is not authorized to use this connection, an + error is returned. + + In the simplest implementation, control would not return to the + calling program until either the buffer was filled, or some + error occurred, but this scheme is highly subject to deadlocks. + A more sophisticated implementation would permit several + RECEIVEs to be outstanding at once. These would be filled as + segments arrive. This strategy permits increased throughput at + the cost of a more elaborate scheme (possibly asynchronous) to + notify the calling program that a PUSH has been seen or a buffer + filled. + + If enough data arrive to fill the buffer before a PUSH is seen, + the PUSH flag will not be set in the response to the RECEIVE. + The buffer will be filled with as much data as it can hold. If + a PUSH is seen before the buffer is filled the buffer will be + returned partially filled and PUSH indicated. + + If there is urgent data the user will have been informed as soon + as it arrived via a TCP-to-user signal. The receiving user + should thus be in "urgent mode". If the URGENT flag is on, + additional urgent data remains. If the URGENT flag is off, this + call to RECEIVE has returned all the urgent data, and the user + may now leave "urgent mode". Note that data following the + urgent pointer (non-urgent data) cannot be delivered to the user + in the same buffer with preceeding urgent data unless the + boundary is clearly marked for the user. + + To distinguish among several outstanding RECEIVEs and to take + care of the case that a buffer is not completely filled, the + return code is accompanied by both a buffer pointer and a byte + count indicating the actual length of the data received. + + Alternative implementations of RECEIVE might have the TCP + + + +[Page 48] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + allocate buffer storage, or the TCP might share a ring buffer + with the user. + + Close + + Format: CLOSE (local connection name) + + This command causes the connection specified to be closed. If + the connection is not open or the calling process is not + authorized to use this connection, an error is returned. + Closing connections is intended to be a graceful operation in + the sense that outstanding SENDs will be transmitted (and + retransmitted), as flow control permits, until all have been + serviced. Thus, it should be acceptable to make several SEND + calls, followed by a CLOSE, and expect all the data to be sent + to the destination. It should also be clear that users should + continue to RECEIVE on CLOSING connections, since the other side + may be trying to transmit the last of its data. Thus, CLOSE + means "I have no more to send" but does not mean "I will not + receive any more." It may happen (if the user level protocol is + not well thought out) that the closing side is unable to get rid + of all its data before timing out. In this event, CLOSE turns + into ABORT, and the closing TCP gives up. + + The user may CLOSE the connection at any time on his own + initiative, or in response to various prompts from the TCP + (e.g., remote close executed, transmission timeout exceeded, + destination inaccessible). + + Because closing a connection requires communication with the + foreign TCP, connections may remain in the closing state for a + short time. Attempts to reopen the connection before the TCP + replies to the CLOSE command will result in error responses. + + Close also implies push function. + + Status + + Format: STATUS (local connection name) -> status data + + This is an implementation dependent user command and could be + excluded without adverse effect. Information returned would + typically come from the TCB associated with the connection. + + This command returns a data block containing the following + information: + + local socket, + + + [Page 49] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + + foreign socket, + local connection name, + receive window, + send window, + connection state, + number of buffers awaiting acknowledgment, + number of buffers pending receipt, + urgent state, + precedence, + security/compartment, + and transmission timeout. + + Depending on the state of the connection, or on the + implementation itself, some of this information may not be + available or meaningful. If the calling process is not + authorized to use this connection, an error is returned. This + prevents unauthorized processes from gaining information about a + connection. + + Abort + + Format: ABORT (local connection name) + + This command causes all pending SENDs and RECEIVES to be + aborted, the TCB to be removed, and a special RESET message to + be sent to the TCP on the other side of the connection. + Depending on the implementation, users may receive abort + indications for each outstanding SEND or RECEIVE, or may simply + receive an ABORT-acknowledgment. + + TCP-to-User Messages + + It is assumed that the operating system environment provides a + means for the TCP to asynchronously signal the user program. When + the TCP does signal a user program, certain information is passed + to the user. Often in the specification the information will be + an error message. In other cases there will be information + relating to the completion of processing a SEND or RECEIVE or + other user call. + + The following information is provided: + + Local Connection Name Always + Response String Always + Buffer Address Send & Receive + Byte count (counts bytes received) Receive + Push flag Receive + Urgent flag Receive + + +[Page 50] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + TCP/Lower-Level Interface + + The TCP calls on a lower level protocol module to actually send and + receive information over a network. One case is that of the ARPA + internetwork system where the lower level module is the Internet + Protocol (IP) [2]. + + If the lower level protocol is IP it provides arguments for a type + of service and for a time to live. TCP uses the following settings + for these parameters: + + Type of Service = Precedence: routine, Delay: normal, Throughput: + normal, Reliability: normal; or 00000000. + + Time to Live = one minute, or 00111100. + + Note that the assumed maximum segment lifetime is two minutes. + Here we explicitly ask that a segment be destroyed if it cannot + be delivered by the internet system within one minute. + + If the lower level is IP (or other protocol that provides this + feature) and source routing is used, the interface must allow the + route information to be communicated. This is especially important + so that the source and destination addresses used in the TCP + checksum be the originating source and ultimate destination. It is + also important to preserve the return route to answer connection + requests. + + Any lower level protocol will have to provide the source address, + destination address, and protocol fields, and some way to determine + the "TCP length", both to provide the functional equivlent service + of IP and to be used in the TCP checksum. + + + + + + + + + + + + + + + + + + + [Page 51] + + + September 1981 +Transmission Control Protocol +Functional Specification + + + +3.9. Event Processing + + The processing depicted in this section is an example of one possible + implementation. Other implementations may have slightly different + processing sequences, but they should differ from those in this + section only in detail, not in substance. + + The activity of the TCP can be characterized as responding to events. + The events that occur can be cast into three categories: user calls, + arriving segments, and timeouts. This section describes the + processing the TCP does in response to each of the events. In many + cases the processing required depends on the state of the connection. + + Events that occur: + + User Calls + + OPEN + SEND + RECEIVE + CLOSE + ABORT + STATUS + + Arriving Segments + + SEGMENT ARRIVES + + Timeouts + + USER TIMEOUT + RETRANSMISSION TIMEOUT + TIME-WAIT TIMEOUT + + The model of the TCP/user interface is that user commands receive an + immediate return and possibly a delayed response via an event or + pseudo interrupt. In the following descriptions, the term "signal" + means cause a delayed response. + + Error responses are given as character strings. For example, user + commands referencing connections that do not exist receive "error: + connection not open". + + Please note in the following that all arithmetic on sequence numbers, + acknowledgment numbers, windows, et cetera, is modulo 2**32 the size + of the sequence number space. Also note that "=<" means less than or + equal to (modulo 2**32). + + + +[Page 52] + + +September 1981 + Transmission Control Protocol + Functional Specification + + + + A natural way to think about processing incoming segments is to + imagine that they are first tested for proper sequence number (i.e., + that their contents lie in the range of the expected "receive window" + in the sequence number space) and then that they are generally queued + and processed in sequence number order. + + When a segment overlaps other already received segments we reconstruct + the segment to contain just the new data, and adjust the header fields + to be consistent. + + Note that if no state change is mentioned the TCP stays in the same + state. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 53] + + + September 1981 +Transmission Control Protocol +Functional Specification + OPEN Call + + + + OPEN Call + + CLOSED STATE (i.e., TCB does not exist) + + Create a new transmission control block (TCB) to hold connection + state information. Fill in local socket identifier, foreign + socket, precedence, security/compartment, and user timeout + information. Note that some parts of the foreign socket may be + unspecified in a passive OPEN and are to be filled in by the + parameters of the incoming SYN segment. Verify the security and + precedence requested are allowed for this user, if not return + "error: precedence not allowed" or "error: security/compartment + not allowed." If passive enter the LISTEN state and return. If + active and the foreign socket is unspecified, return "error: + foreign socket unspecified"; if active and the foreign socket is + specified, issue a SYN segment. An initial send sequence number + (ISS) is selected. A SYN segment of the form + is sent. Set SND.UNA to ISS, SND.NXT to ISS+1, enter SYN-SENT + state, and return. + + If the caller does not have access to the local socket specified, + return "error: connection illegal for this process". If there is + no room to create a new connection, return "error: insufficient + resources". + + LISTEN STATE + + If active and the foreign socket is specified, then change the + connection from passive to active, select an ISS. Send a SYN + segment, set SND.UNA to ISS, SND.NXT to ISS+1. Enter SYN-SENT + state. Data associated with SEND may be sent with SYN segment or + queued for transmission after entering ESTABLISHED state. The + urgent bit if requested in the command must be sent with the data + segments sent as a result of this command. If there is no room to + queue the request, respond with "error: insufficient resources". + If Foreign socket was not specified, then return "error: foreign + socket unspecified". + + + + + + + + + + + + +[Page 54] + + +September 1981 + Transmission Control Protocol + Functional Specification +OPEN Call + + + + SYN-SENT STATE + SYN-RECEIVED STATE + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + CLOSE-WAIT STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Return "error: connection already exists". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 55] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEND Call + + + + SEND Call + + CLOSED STATE (i.e., TCB does not exist) + + If the user does not have access to such a connection, then return + "error: connection illegal for this process". + + Otherwise, return "error: connection does not exist". + + LISTEN STATE + + If the foreign socket is specified, then change the connection + from passive to active, select an ISS. Send a SYN segment, set + SND.UNA to ISS, SND.NXT to ISS+1. Enter SYN-SENT state. Data + associated with SEND may be sent with SYN segment or queued for + transmission after entering ESTABLISHED state. The urgent bit if + requested in the command must be sent with the data segments sent + as a result of this command. If there is no room to queue the + request, respond with "error: insufficient resources". If + Foreign socket was not specified, then return "error: foreign + socket unspecified". + + SYN-SENT STATE + SYN-RECEIVED STATE + + Queue the data for transmission after entering ESTABLISHED state. + If no space to queue, respond with "error: insufficient + resources". + + ESTABLISHED STATE + CLOSE-WAIT STATE + + Segmentize the buffer and send it with a piggybacked + acknowledgment (acknowledgment value = RCV.NXT). If there is + insufficient space to remember this buffer, simply return "error: + insufficient resources". + + If the urgent flag is set, then SND.UP <- SND.NXT-1 and set the + urgent pointer in the outgoing segments. + + + + + + + + + + +[Page 56] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEND Call + + + + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Return "error: connection closing" and do not service request. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 57] + + + September 1981 +Transmission Control Protocol +Functional Specification + RECEIVE Call + + + + RECEIVE Call + + CLOSED STATE (i.e., TCB does not exist) + + If the user does not have access to such a connection, return + "error: connection illegal for this process". + + Otherwise return "error: connection does not exist". + + LISTEN STATE + SYN-SENT STATE + SYN-RECEIVED STATE + + Queue for processing after entering ESTABLISHED state. If there + is no room to queue this request, respond with "error: + insufficient resources". + + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + + If insufficient incoming segments are queued to satisfy the + request, queue the request. If there is no queue space to + remember the RECEIVE, respond with "error: insufficient + resources". + + Reassemble queued incoming segments into receive buffer and return + to user. Mark "push seen" (PUSH) if this is the case. + + If RCV.UP is in advance of the data currently being passed to the + user notify the user of the presence of urgent data. + + When the TCP takes responsibility for delivering data to the user + that fact must be communicated to the sender via an + acknowledgment. The formation of such an acknowledgment is + described below in the discussion of processing an incoming + segment. + + + + + + + + + + + + +[Page 58] + + +September 1981 + Transmission Control Protocol + Functional Specification +RECEIVE Call + + + + CLOSE-WAIT STATE + + Since the remote side has already sent FIN, RECEIVEs must be + satisfied by text already on hand, but not yet delivered to the + user. If no text is awaiting delivery, the RECEIVE will get a + "error: connection closing" response. Otherwise, any remaining + text can be used to satisfy the RECEIVE. + + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Return "error: connection closing". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 59] + + + September 1981 +Transmission Control Protocol +Functional Specification + CLOSE Call + + + + CLOSE Call + + CLOSED STATE (i.e., TCB does not exist) + + If the user does not have access to such a connection, return + "error: connection illegal for this process". + + Otherwise, return "error: connection does not exist". + + LISTEN STATE + + Any outstanding RECEIVEs are returned with "error: closing" + responses. Delete TCB, enter CLOSED state, and return. + + SYN-SENT STATE + + Delete the TCB and return "error: closing" responses to any + queued SENDs, or RECEIVEs. + + SYN-RECEIVED STATE + + If no SENDs have been issued and there is no pending data to send, + then form a FIN segment and send it, and enter FIN-WAIT-1 state; + otherwise queue for processing after entering ESTABLISHED state. + + ESTABLISHED STATE + + Queue this until all preceding SENDs have been segmentized, then + form a FIN segment and send it. In any case, enter FIN-WAIT-1 + state. + + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + + Strictly speaking, this is an error and should receive a "error: + connection closing" response. An "ok" response would be + acceptable, too, as long as a second FIN is not emitted (the first + FIN may be retransmitted though). + + + + + + + + + + + +[Page 60] + + +September 1981 + Transmission Control Protocol + Functional Specification +CLOSE Call + + + + CLOSE-WAIT STATE + + Queue this request until all preceding SENDs have been + segmentized; then send a FIN segment, enter CLOSING state. + + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Respond with "error: connection closing". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 61] + + + September 1981 +Transmission Control Protocol +Functional Specification + ABORT Call + + + + ABORT Call + + CLOSED STATE (i.e., TCB does not exist) + + If the user should not have access to such a connection, return + "error: connection illegal for this process". + + Otherwise return "error: connection does not exist". + + LISTEN STATE + + Any outstanding RECEIVEs should be returned with "error: + connection reset" responses. Delete TCB, enter CLOSED state, and + return. + + SYN-SENT STATE + + All queued SENDs and RECEIVEs should be given "connection reset" + notification, delete the TCB, enter CLOSED state, and return. + + SYN-RECEIVED STATE + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + CLOSE-WAIT STATE + + Send a reset segment: + + + + All queued SENDs and RECEIVEs should be given "connection reset" + notification; all segments queued for transmission (except for the + RST formed above) or retransmission should be flushed, delete the + TCB, enter CLOSED state, and return. + + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Respond with "ok" and delete the TCB, enter CLOSED state, and + return. + + + + + + + + +[Page 62] + + +September 1981 + Transmission Control Protocol + Functional Specification +STATUS Call + + + + STATUS Call + + CLOSED STATE (i.e., TCB does not exist) + + If the user should not have access to such a connection, return + "error: connection illegal for this process". + + Otherwise return "error: connection does not exist". + + LISTEN STATE + + Return "state = LISTEN", and the TCB pointer. + + SYN-SENT STATE + + Return "state = SYN-SENT", and the TCB pointer. + + SYN-RECEIVED STATE + + Return "state = SYN-RECEIVED", and the TCB pointer. + + ESTABLISHED STATE + + Return "state = ESTABLISHED", and the TCB pointer. + + FIN-WAIT-1 STATE + + Return "state = FIN-WAIT-1", and the TCB pointer. + + FIN-WAIT-2 STATE + + Return "state = FIN-WAIT-2", and the TCB pointer. + + CLOSE-WAIT STATE + + Return "state = CLOSE-WAIT", and the TCB pointer. + + CLOSING STATE + + Return "state = CLOSING", and the TCB pointer. + + LAST-ACK STATE + + Return "state = LAST-ACK", and the TCB pointer. + + + + + + [Page 63] + + + September 1981 +Transmission Control Protocol +Functional Specification + STATUS Call + + + + TIME-WAIT STATE + + Return "state = TIME-WAIT", and the TCB pointer. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 64] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + SEGMENT ARRIVES + + If the state is CLOSED (i.e., TCB does not exist) then + + all data in the incoming segment is discarded. An incoming + segment containing a RST is discarded. An incoming segment not + containing a RST causes a RST to be sent in response. The + acknowledgment and sequence field values are selected to make the + reset sequence acceptable to the TCP that sent the offending + segment. + + If the ACK bit is off, sequence number zero is used, + + + + If the ACK bit is on, + + + + Return. + + If the state is LISTEN then + + first check for an RST + + An incoming RST should be ignored. Return. + + second check for an ACK + + Any acknowledgment is bad if it arrives on a connection still in + the LISTEN state. An acceptable reset segment should be formed + for any arriving ACK-bearing segment. The RST should be + formatted as follows: + + + + Return. + + third check for a SYN + + If the SYN bit is set, check the security. If the + security/compartment on the incoming segment does not exactly + match the security/compartment in the TCB then send a reset and + return. + + + + + + [Page 65] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + If the SEG.PRC is greater than the TCB.PRC then if allowed by + the user and the system set TCB.PRC<-SEG.PRC, if not allowed + send a reset and return. + + + + If the SEG.PRC is less than the TCB.PRC then continue. + + Set RCV.NXT to SEG.SEQ+1, IRS is set to SEG.SEQ and any other + control or text should be queued for processing later. ISS + should be selected and a SYN segment sent of the form: + + + + SND.NXT is set to ISS+1 and SND.UNA to ISS. The connection + state should be changed to SYN-RECEIVED. Note that any other + incoming control or data (combined with SYN) will be processed + in the SYN-RECEIVED state, but processing of SYN and ACK should + not be repeated. If the listen was not fully specified (i.e., + the foreign socket was not fully specified), then the + unspecified fields should be filled in now. + + fourth other text or control + + Any other control or text-bearing segment (not containing SYN) + must have an ACK and thus would be discarded by the ACK + processing. An incoming RST segment could not be valid, since + it could not have been sent in response to anything sent by this + incarnation of the connection. So you are unlikely to get here, + but if you do, drop the segment, and return. + + If the state is SYN-SENT then + + first check the ACK bit + + If the ACK bit is set + + If SEG.ACK =< ISS, or SEG.ACK > SND.NXT, send a reset (unless + the RST bit is set, if so drop the segment and return) + + + + and discard the segment. Return. + + If SND.UNA =< SEG.ACK =< SND.NXT then the ACK is acceptable. + + second check the RST bit + + +[Page 66] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + If the RST bit is set + + If the ACK was acceptable then signal the user "error: + connection reset", drop the segment, enter CLOSED state, + delete TCB, and return. Otherwise (no ACK) drop the segment + and return. + + third check the security and precedence + + If the security/compartment in the segment does not exactly + match the security/compartment in the TCB, send a reset + + If there is an ACK + + + + Otherwise + + + + If there is an ACK + + The precedence in the segment must match the precedence in the + TCB, if not, send a reset + + + + If there is no ACK + + If the precedence in the segment is higher than the precedence + in the TCB then if allowed by the user and the system raise + the precedence in the TCB to that in the segment, if not + allowed to raise the prec then send a reset. + + + + If the precedence in the segment is lower than the precedence + in the TCB continue. + + If a reset was sent, discard the segment and return. + + fourth check the SYN bit + + This step should be reached only if the ACK is ok, or there is + no ACK, and it the segment did not contain a RST. + + If the SYN bit is on and the security/compartment and precedence + + + [Page 67] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + are acceptable then, RCV.NXT is set to SEG.SEQ+1, IRS is set to + SEG.SEQ. SND.UNA should be advanced to equal SEG.ACK (if there + is an ACK), and any segments on the retransmission queue which + are thereby acknowledged should be removed. + + If SND.UNA > ISS (our SYN has been ACKed), change the connection + state to ESTABLISHED, form an ACK segment + + + + and send it. Data or controls which were queued for + transmission may be included. If there are other controls or + text in the segment then continue processing at the sixth step + below where the URG bit is checked, otherwise return. + + Otherwise enter SYN-RECEIVED, form a SYN,ACK segment + + + + and send it. If there are other controls or text in the + segment, queue them for processing after the ESTABLISHED state + has been reached, return. + + fifth, if neither of the SYN or RST bits is set then drop the + segment and return. + + + + + + + + + + + + + + + + + + + + + + + + +[Page 68] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + Otherwise, + + first check sequence number + + SYN-RECEIVED STATE + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + CLOSE-WAIT STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + Segments are processed in sequence. Initial tests on arrival + are used to discard old duplicates, but further processing is + done in SEG.SEQ order. If a segment's contents straddle the + boundary between old and new, only the new parts should be + processed. + + There are four cases for the acceptability test for an incoming + segment: + + Segment Receive Test + Length Window + ------- ------- ------------------------------------------- + + 0 0 SEG.SEQ = RCV.NXT + + 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + + >0 0 not acceptable + + >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND + or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND + + If the RCV.WND is zero, no segments will be acceptable, but + special allowance should be made to accept valid ACKs, URGs and + RSTs. + + If an incoming segment is not acceptable, an acknowledgment + should be sent in reply (unless the RST bit is set, if so drop + the segment and return): + + + + After sending the acknowledgment, drop the unacceptable segment + and return. + + + [Page 69] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + In the following it is assumed that the segment is the idealized + segment that begins at RCV.NXT and does not exceed the window. + One could tailor actual segments to fit this assumption by + trimming off any portions that lie outside the window (including + SYN and FIN), and only processing further if the segment then + begins at RCV.NXT. Segments with higher begining sequence + numbers may be held for later processing. + + second check the RST bit, + + SYN-RECEIVED STATE + + If the RST bit is set + + If this connection was initiated with a passive OPEN (i.e., + came from the LISTEN state), then return this connection to + LISTEN state and return. The user need not be informed. If + this connection was initiated with an active OPEN (i.e., came + from SYN-SENT state) then the connection was refused, signal + the user "connection refused". In either case, all segments + on the retransmission queue should be removed. And in the + active OPEN case, enter the CLOSED state and delete the TCB, + and return. + + ESTABLISHED + FIN-WAIT-1 + FIN-WAIT-2 + CLOSE-WAIT + + If the RST bit is set then, any outstanding RECEIVEs and SEND + should receive "reset" responses. All segment queues should be + flushed. Users should also receive an unsolicited general + "connection reset" signal. Enter the CLOSED state, delete the + TCB, and return. + + CLOSING STATE + LAST-ACK STATE + TIME-WAIT + + If the RST bit is set then, enter the CLOSED state, delete the + TCB, and return. + + + + + + + + +[Page 70] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + third check security and precedence + + SYN-RECEIVED + + If the security/compartment and precedence in the segment do not + exactly match the security/compartment and precedence in the TCB + then send a reset, and return. + + ESTABLISHED STATE + + If the security/compartment and precedence in the segment do not + exactly match the security/compartment and precedence in the TCB + then send a reset, any outstanding RECEIVEs and SEND should + receive "reset" responses. All segment queues should be + flushed. Users should also receive an unsolicited general + "connection reset" signal. Enter the CLOSED state, delete the + TCB, and return. + + Note this check is placed following the sequence check to prevent + a segment from an old connection between these ports with a + different security or precedence from causing an abort of the + current connection. + + fourth, check the SYN bit, + + SYN-RECEIVED + ESTABLISHED STATE + FIN-WAIT STATE-1 + FIN-WAIT STATE-2 + CLOSE-WAIT STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + If the SYN is in the window it is an error, send a reset, any + outstanding RECEIVEs and SEND should receive "reset" responses, + all segment queues should be flushed, the user should also + receive an unsolicited general "connection reset" signal, enter + the CLOSED state, delete the TCB, and return. + + If the SYN is not in the window this step would not be reached + and an ack would have been sent in the first step (sequence + number check). + + + + + + + [Page 71] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + fifth check the ACK field, + + if the ACK bit is off drop the segment and return + + if the ACK bit is on + + SYN-RECEIVED STATE + + If SND.UNA =< SEG.ACK =< SND.NXT then enter ESTABLISHED state + and continue processing. + + If the segment acknowledgment is not acceptable, form a + reset segment, + + + + and send it. + + ESTABLISHED STATE + + If SND.UNA < SEG.ACK =< SND.NXT then, set SND.UNA <- SEG.ACK. + Any segments on the retransmission queue which are thereby + entirely acknowledged are removed. Users should receive + positive acknowledgments for buffers which have been SENT and + fully acknowledged (i.e., SEND buffer should be returned with + "ok" response). If the ACK is a duplicate + (SEG.ACK < SND.UNA), it can be ignored. If the ACK acks + something not yet sent (SEG.ACK > SND.NXT) then send an ACK, + drop the segment, and return. + + If SND.UNA < SEG.ACK =< SND.NXT, the send window should be + updated. If (SND.WL1 < SEG.SEQ or (SND.WL1 = SEG.SEQ and + SND.WL2 =< SEG.ACK)), set SND.WND <- SEG.WND, set + SND.WL1 <- SEG.SEQ, and set SND.WL2 <- SEG.ACK. + + Note that SND.WND is an offset from SND.UNA, that SND.WL1 + records the sequence number of the last segment used to update + SND.WND, and that SND.WL2 records the acknowledgment number of + the last segment used to update SND.WND. The check here + prevents using old segments to update the window. + + + + + + + + + +[Page 72] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + FIN-WAIT-1 STATE + + In addition to the processing for the ESTABLISHED state, if + our FIN is now acknowledged then enter FIN-WAIT-2 and continue + processing in that state. + + FIN-WAIT-2 STATE + + In addition to the processing for the ESTABLISHED state, if + the retransmission queue is empty, the user's CLOSE can be + acknowledged ("ok") but do not delete the TCB. + + CLOSE-WAIT STATE + + Do the same processing as for the ESTABLISHED state. + + CLOSING STATE + + In addition to the processing for the ESTABLISHED state, if + the ACK acknowledges our FIN then enter the TIME-WAIT state, + otherwise ignore the segment. + + LAST-ACK STATE + + The only thing that can arrive in this state is an + acknowledgment of our FIN. If our FIN is now acknowledged, + delete the TCB, enter the CLOSED state, and return. + + TIME-WAIT STATE + + The only thing that can arrive in this state is a + retransmission of the remote FIN. Acknowledge it, and restart + the 2 MSL timeout. + + sixth, check the URG bit, + + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + + If the URG bit is set, RCV.UP <- max(RCV.UP,SEG.UP), and signal + the user that the remote side has urgent data if the urgent + pointer (RCV.UP) is in advance of the data consumed. If the + user has already been signaled (or is still in the "urgent + mode") for this continuous sequence of urgent data, do not + signal the user again. + + + + [Page 73] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + CLOSE-WAIT STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT + + This should not occur, since a FIN has been received from the + remote side. Ignore the URG. + + seventh, process the segment text, + + ESTABLISHED STATE + FIN-WAIT-1 STATE + FIN-WAIT-2 STATE + + Once in the ESTABLISHED state, it is possible to deliver segment + text to user RECEIVE buffers. Text from segments can be moved + into buffers until either the buffer is full or the segment is + empty. If the segment empties and carries an PUSH flag, then + the user is informed, when the buffer is returned, that a PUSH + has been received. + + When the TCP takes responsibility for delivering the data to the + user it must also acknowledge the receipt of the data. + + Once the TCP takes responsibility for the data it advances + RCV.NXT over the data accepted, and adjusts RCV.WND as + apporopriate to the current buffer availability. The total of + RCV.NXT and RCV.WND should not be reduced. + + Please note the window management suggestions in section 3.7. + + Send an acknowledgment of the form: + + + + This acknowledgment should be piggybacked on a segment being + transmitted if possible without incurring undue delay. + + + + + + + + + + + + +[Page 74] + + +September 1981 + Transmission Control Protocol + Functional Specification +SEGMENT ARRIVES + + + + CLOSE-WAIT STATE + CLOSING STATE + LAST-ACK STATE + TIME-WAIT STATE + + This should not occur, since a FIN has been received from the + remote side. Ignore the segment text. + + eighth, check the FIN bit, + + Do not process the FIN if the state is CLOSED, LISTEN or SYN-SENT + since the SEG.SEQ cannot be validated; drop the segment and + return. + + If the FIN bit is set, signal the user "connection closing" and + return any pending RECEIVEs with same message, advance RCV.NXT + over the FIN, and send an acknowledgment for the FIN. Note that + FIN implies PUSH for any segment text not yet delivered to the + user. + + SYN-RECEIVED STATE + ESTABLISHED STATE + + Enter the CLOSE-WAIT state. + + FIN-WAIT-1 STATE + + If our FIN has been ACKed (perhaps in this segment), then + enter TIME-WAIT, start the time-wait timer, turn off the other + timers; otherwise enter the CLOSING state. + + FIN-WAIT-2 STATE + + Enter the TIME-WAIT state. Start the time-wait timer, turn + off the other timers. + + CLOSE-WAIT STATE + + Remain in the CLOSE-WAIT state. + + CLOSING STATE + + Remain in the CLOSING state. + + LAST-ACK STATE + + Remain in the LAST-ACK state. + + + [Page 75] + + + September 1981 +Transmission Control Protocol +Functional Specification + SEGMENT ARRIVES + + + + TIME-WAIT STATE + + Remain in the TIME-WAIT state. Restart the 2 MSL time-wait + timeout. + + and return. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 76] + + +September 1981 + Transmission Control Protocol + Functional Specification +USER TIMEOUT + + + + USER TIMEOUT + + For any state if the user timeout expires, flush all queues, signal + the user "error: connection aborted due to user timeout" in general + and for any outstanding calls, delete the TCB, enter the CLOSED + state and return. + + RETRANSMISSION TIMEOUT + + For any state if the retransmission timeout expires on a segment in + the retransmission queue, send the segment at the front of the + retransmission queue again, reinitialize the retransmission timer, + and return. + + TIME-WAIT TIMEOUT + + If the time-wait timeout expires on a connection delete the TCB, + enter the CLOSED state and return. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 77] + + + September 1981 +Transmission Control Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Page 78] + + +September 1981 + Transmission Control Protocol + + + + GLOSSARY + + + +1822 + BBN Report 1822, "The Specification of the Interconnection of + a Host and an IMP". The specification of interface between a + host and the ARPANET. + +ACK + A control bit (acknowledge) occupying no sequence space, which + indicates that the acknowledgment field of this segment + specifies the next sequence number the sender of this segment + is expecting to receive, hence acknowledging receipt of all + previous sequence numbers. + +ARPANET message + The unit of transmission between a host and an IMP in the + ARPANET. The maximum size is about 1012 octets (8096 bits). + +ARPANET packet + A unit of transmission used internally in the ARPANET between + IMPs. The maximum size is about 126 octets (1008 bits). + +connection + A logical communication path identified by a pair of sockets. + +datagram + A message sent in a packet switched computer communications + network. + +Destination Address + The destination address, usually the network and host + identifiers. + +FIN + A control bit (finis) occupying one sequence number, which + indicates that the sender will send no more data or control + occupying sequence space. + +fragment + A portion of a logical unit of data, in particular an internet + fragment is a portion of an internet datagram. + +FTP + A file transfer protocol. + + + + + + [Page 79] + + + September 1981 +Transmission Control Protocol +Glossary + + + +header + Control information at the beginning of a message, segment, + fragment, packet or block of data. + +host + A computer. In particular a source or destination of messages + from the point of view of the communication network. + +Identification + An Internet Protocol field. This identifying value assigned + by the sender aids in assembling the fragments of a datagram. + +IMP + The Interface Message Processor, the packet switch of the + ARPANET. + +internet address + A source or destination address specific to the host level. + +internet datagram + The unit of data exchanged between an internet module and the + higher level protocol together with the internet header. + +internet fragment + A portion of the data of an internet datagram with an internet + header. + +IP + Internet Protocol. + +IRS + The Initial Receive Sequence number. The first sequence + number used by the sender on a connection. + +ISN + The Initial Sequence Number. The first sequence number used + on a connection, (either ISS or IRS). Selected on a clock + based procedure. + +ISS + The Initial Send Sequence number. The first sequence number + used by the sender on a connection. + +leader + Control information at the beginning of a message or block of + data. In particular, in the ARPANET, the control information + on an ARPANET message at the host-IMP interface. + + + +[Page 80] + + +September 1981 + Transmission Control Protocol + Glossary + + + +left sequence + This is the next sequence number to be acknowledged by the + data receiving TCP (or the lowest currently unacknowledged + sequence number) and is sometimes referred to as the left edge + of the send window. + +local packet + The unit of transmission within a local network. + +module + An implementation, usually in software, of a protocol or other + procedure. + +MSL + Maximum Segment Lifetime, the time a TCP segment can exist in + the internetwork system. Arbitrarily defined to be 2 minutes. + +octet + An eight bit byte. + +Options + An Option field may contain several options, and each option + may be several octets in length. The options are used + primarily in testing situations; for example, to carry + timestamps. Both the Internet Protocol and TCP provide for + options fields. + +packet + A package of data with a header which may or may not be + logically complete. More often a physical packaging than a + logical packaging of data. + +port + The portion of a socket that specifies which logical input or + output channel of a process is associated with the data. + +process + A program in execution. A source or destination of data from + the point of view of the TCP or other host-to-host protocol. + +PUSH + A control bit occupying no sequence space, indicating that + this segment contains data that must be pushed through to the + receiving user. + +RCV.NXT + receive next sequence number + + + + [Page 81] + + + September 1981 +Transmission Control Protocol +Glossary + + + +RCV.UP + receive urgent pointer + +RCV.WND + receive window + +receive next sequence number + This is the next sequence number the local TCP is expecting to + receive. + +receive window + This represents the sequence numbers the local (receiving) TCP + is willing to receive. Thus, the local TCP considers that + segments overlapping the range RCV.NXT to + RCV.NXT + RCV.WND - 1 carry acceptable data or control. + Segments containing sequence numbers entirely outside of this + range are considered duplicates and discarded. + +RST + A control bit (reset), occupying no sequence space, indicating + that the receiver should delete the connection without further + interaction. The receiver can determine, based on the + sequence number and acknowledgment fields of the incoming + segment, whether it should honor the reset command or ignore + it. In no case does receipt of a segment containing RST give + rise to a RST in response. + +RTP + Real Time Protocol: A host-to-host protocol for communication + of time critical information. + +SEG.ACK + segment acknowledgment + +SEG.LEN + segment length + +SEG.PRC + segment precedence value + +SEG.SEQ + segment sequence + +SEG.UP + segment urgent pointer field + + + + + +[Page 82] + + +September 1981 + Transmission Control Protocol + Glossary + + + +SEG.WND + segment window field + +segment + A logical unit of data, in particular a TCP segment is the + unit of data transfered between a pair of TCP modules. + +segment acknowledgment + The sequence number in the acknowledgment field of the + arriving segment. + +segment length + The amount of sequence number space occupied by a segment, + including any controls which occupy sequence space. + +segment sequence + The number in the sequence field of the arriving segment. + +send sequence + This is the next sequence number the local (sending) TCP will + use on the connection. It is initially selected from an + initial sequence number curve (ISN) and is incremented for + each octet of data or sequenced control transmitted. + +send window + This represents the sequence numbers which the remote + (receiving) TCP is willing to receive. It is the value of the + window field specified in segments from the remote (data + receiving) TCP. The range of new sequence numbers which may + be emitted by a TCP lies between SND.NXT and + SND.UNA + SND.WND - 1. (Retransmissions of sequence numbers + between SND.UNA and SND.NXT are expected, of course.) + +SND.NXT + send sequence + +SND.UNA + left sequence + +SND.UP + send urgent pointer + +SND.WL1 + segment sequence number at last window update + +SND.WL2 + segment acknowledgment number at last window update + + + + [Page 83] + + + September 1981 +Transmission Control Protocol +Glossary + + + +SND.WND + send window + +socket + An address which specifically includes a port identifier, that + is, the concatenation of an Internet Address with a TCP port. + +Source Address + The source address, usually the network and host identifiers. + +SYN + A control bit in the incoming segment, occupying one sequence + number, used at the initiation of a connection, to indicate + where the sequence numbering will start. + +TCB + Transmission control block, the data structure that records + the state of a connection. + +TCB.PRC + The precedence of the connection. + +TCP + Transmission Control Protocol: A host-to-host protocol for + reliable communication in internetwork environments. + +TOS + Type of Service, an Internet Protocol field. + +Type of Service + An Internet Protocol field which indicates the type of service + for this internet fragment. + +URG + A control bit (urgent), occupying no sequence space, used to + indicate that the receiving user should be notified to do + urgent processing as long as there is data to be consumed with + sequence numbers less than the value indicated in the urgent + pointer. + +urgent pointer + A control field meaningful only when the URG bit is on. This + field communicates the value of the urgent pointer which + indicates the data octet associated with the sending user's + urgent call. + + + + + +[Page 84] + + +September 1981 + Transmission Control Protocol + + + + REFERENCES + + + +[1] Cerf, V., and R. Kahn, "A Protocol for Packet Network + Intercommunication", IEEE Transactions on Communications, + Vol. COM-22, No. 5, pp 637-648, May 1974. + +[2] Postel, J. (ed.), "Internet Protocol - DARPA Internet Program + Protocol Specification", RFC 791, USC/Information Sciences + Institute, September 1981. + +[3] Dalal, Y. and C. Sunshine, "Connection Management in Transport + Protocols", Computer Networks, Vol. 2, No. 6, pp. 454-473, + December 1978. + +[4] Postel, J., "Assigned Numbers", RFC 790, USC/Information Sciences + Institute, September 1981. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Page 85] + + + diff --git a/doc/rfc/std9.txt b/doc/rfc/std9.txt new file mode 100644 index 00000000..2357b82f --- /dev/null +++ b/doc/rfc/std9.txt @@ -0,0 +1,3934 @@ + +Network Working Group J. Postel +Request for Comments: 959 J. Reynolds + ISI +Obsoletes RFC: 765 (IEN 149) October 1985 + + FILE TRANSFER PROTOCOL (FTP) + + +Status of this Memo + + This memo is the official specification of the File Transfer + Protocol (FTP). Distribution of this memo is unlimited. + + The following new optional commands are included in this edition of + the specification: + + CDUP (Change to Parent Directory), SMNT (Structure Mount), STOU + (Store Unique), RMD (Remove Directory), MKD (Make Directory), PWD + (Print Directory), and SYST (System). + + Note that this specification is compatible with the previous edition. + +1. INTRODUCTION + + The objectives of FTP are 1) to promote sharing of files (computer + programs and/or data), 2) to encourage indirect or implicit (via + programs) use of remote computers, 3) to shield a user from + variations in file storage systems among hosts, and 4) to transfer + data reliably and efficiently. FTP, though usable directly by a user + at a terminal, is designed mainly for use by programs. + + The attempt in this specification is to satisfy the diverse needs of + users of maxi-hosts, mini-hosts, personal workstations, and TACs, + with a simple, and easily implemented protocol design. + + This paper assumes knowledge of the Transmission Control Protocol + (TCP) [2] and the Telnet Protocol [3]. These documents are contained + in the ARPA-Internet protocol handbook [1]. + +2. OVERVIEW + + In this section, the history, the terminology, and the FTP model are + discussed. The terms defined in this section are only those that + have special significance in FTP. Some of the terminology is very + specific to the FTP model; some readers may wish to turn to the + section on the FTP model while reviewing the terminology. + + + + + + + +Postel & Reynolds [Page 1] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 2.1. HISTORY + + FTP has had a long evolution over the years. Appendix III is a + chronological compilation of Request for Comments documents + relating to FTP. These include the first proposed file transfer + mechanisms in 1971 that were developed for implementation on hosts + at M.I.T. (RFC 114), plus comments and discussion in RFC 141. + + RFC 172 provided a user-level oriented protocol for file transfer + between host computers (including terminal IMPs). A revision of + this as RFC 265, restated FTP for additional review, while RFC 281 + suggested further changes. The use of a "Set Data Type" + transaction was proposed in RFC 294 in January 1982. + + RFC 354 obsoleted RFCs 264 and 265. The File Transfer Protocol + was now defined as a protocol for file transfer between HOSTs on + the ARPANET, with the primary function of FTP defined as + transfering files efficiently and reliably among hosts and + allowing the convenient use of remote file storage capabilities. + RFC 385 further commented on errors, emphasis points, and + additions to the protocol, while RFC 414 provided a status report + on the working server and user FTPs. RFC 430, issued in 1973, + (among other RFCs too numerous to mention) presented further + comments on FTP. Finally, an "official" FTP document was + published as RFC 454. + + By July 1973, considerable changes from the last versions of FTP + were made, but the general structure remained the same. RFC 542 + was published as a new "official" specification to reflect these + changes. However, many implementations based on the older + specification were not updated. + + In 1974, RFCs 607 and 614 continued comments on FTP. RFC 624 + proposed further design changes and minor modifications. In 1975, + RFC 686 entitled, "Leaving Well Enough Alone", discussed the + differences between all of the early and later versions of FTP. + RFC 691 presented a minor revision of RFC 686, regarding the + subject of print files. + + Motivated by the transition from the NCP to the TCP as the + underlying protocol, a phoenix was born out of all of the above + efforts in RFC 765 as the specification of FTP for use on TCP. + + This current edition of the FTP specification is intended to + correct some minor documentation errors, to improve the + explanation of some protocol features, and to add some new + optional commands. + + +Postel & Reynolds [Page 2] + + + +RFC 959 October 1985 +File Transfer Protocol + + + In particular, the following new optional commands are included in + this edition of the specification: + + CDUP - Change to Parent Directory + + SMNT - Structure Mount + + STOU - Store Unique + + RMD - Remove Directory + + MKD - Make Directory + + PWD - Print Directory + + SYST - System + + This specification is compatible with the previous edition. A + program implemented in conformance to the previous specification + should automatically be in conformance to this specification. + + 2.2. TERMINOLOGY + + ASCII + + The ASCII character set is as defined in the ARPA-Internet + Protocol Handbook. In FTP, ASCII characters are defined to be + the lower half of an eight-bit code set (i.e., the most + significant bit is zero). + + access controls + + Access controls define users' access privileges to the use of a + system, and to the files in that system. Access controls are + necessary to prevent unauthorized or accidental use of files. + It is the prerogative of a server-FTP process to invoke access + controls. + + byte size + + There are two byte sizes of interest in FTP: the logical byte + size of the file, and the transfer byte size used for the + transmission of the data. The transfer byte size is always 8 + bits. The transfer byte size is not necessarily the byte size + in which data is to be stored in a system, nor the logical byte + size for interpretation of the structure of the data. + + + +Postel & Reynolds [Page 3] + + + +RFC 959 October 1985 +File Transfer Protocol + + + control connection + + The communication path between the USER-PI and SERVER-PI for + the exchange of commands and replies. This connection follows + the Telnet Protocol. + + data connection + + A full duplex connection over which data is transferred, in a + specified mode and type. The data transferred may be a part of + a file, an entire file or a number of files. The path may be + between a server-DTP and a user-DTP, or between two + server-DTPs. + + data port + + The passive data transfer process "listens" on the data port + for a connection from the active transfer process in order to + open the data connection. + + DTP + + The data transfer process establishes and manages the data + connection. The DTP can be passive or active. + + End-of-Line + + The end-of-line sequence defines the separation of printing + lines. The sequence is Carriage Return, followed by Line Feed. + + EOF + + The end-of-file condition that defines the end of a file being + transferred. + + EOR + + The end-of-record condition that defines the end of a record + being transferred. + + error recovery + + A procedure that allows a user to recover from certain errors + such as failure of either host system or transfer process. In + FTP, error recovery may involve restarting a file transfer at a + given checkpoint. + + + +Postel & Reynolds [Page 4] + + + +RFC 959 October 1985 +File Transfer Protocol + + + FTP commands + + A set of commands that comprise the control information flowing + from the user-FTP to the server-FTP process. + + file + + An ordered set of computer data (including programs), of + arbitrary length, uniquely identified by a pathname. + + mode + + The mode in which data is to be transferred via the data + connection. The mode defines the data format during transfer + including EOR and EOF. The transfer modes defined in FTP are + described in the Section on Transmission Modes. + + NVT + + The Network Virtual Terminal as defined in the Telnet Protocol. + + NVFS + + The Network Virtual File System. A concept which defines a + standard network file system with standard commands and + pathname conventions. + + page + + A file may be structured as a set of independent parts called + pages. FTP supports the transmission of discontinuous files as + independent indexed pages. + + pathname + + Pathname is defined to be the character string which must be + input to a file system by a user in order to identify a file. + Pathname normally contains device and/or directory names, and + file name specification. FTP does not yet specify a standard + pathname convention. Each user must follow the file naming + conventions of the file systems involved in the transfer. + + PI + + The protocol interpreter. The user and server sides of the + protocol have distinct roles implemented in a user-PI and a + server-PI. + + +Postel & Reynolds [Page 5] + + + +RFC 959 October 1985 +File Transfer Protocol + + + record + + A sequential file may be structured as a number of contiguous + parts called records. Record structures are supported by FTP + but a file need not have record structure. + + reply + + A reply is an acknowledgment (positive or negative) sent from + server to user via the control connection in response to FTP + commands. The general form of a reply is a completion code + (including error codes) followed by a text string. The codes + are for use by programs and the text is usually intended for + human users. + + server-DTP + + The data transfer process, in its normal "active" state, + establishes the data connection with the "listening" data port. + It sets up parameters for transfer and storage, and transfers + data on command from its PI. The DTP can be placed in a + "passive" state to listen for, rather than initiate a + connection on the data port. + + server-FTP process + + A process or set of processes which perform the function of + file transfer in cooperation with a user-FTP process and, + possibly, another server. The functions consist of a protocol + interpreter (PI) and a data transfer process (DTP). + + server-PI + + The server protocol interpreter "listens" on Port L for a + connection from a user-PI and establishes a control + communication connection. It receives standard FTP commands + from the user-PI, sends replies, and governs the server-DTP. + + type + + The data representation type used for data transfer and + storage. Type implies certain transformations between the time + of data storage and data transfer. The representation types + defined in FTP are described in the Section on Establishing + Data Connections. + + + + +Postel & Reynolds [Page 6] + + + +RFC 959 October 1985 +File Transfer Protocol + + + user + + A person or a process on behalf of a person wishing to obtain + file transfer service. The human user may interact directly + with a server-FTP process, but use of a user-FTP process is + preferred since the protocol design is weighted towards + automata. + + user-DTP + + The data transfer process "listens" on the data port for a + connection from a server-FTP process. If two servers are + transferring data between them, the user-DTP is inactive. + + user-FTP process + + A set of functions including a protocol interpreter, a data + transfer process and a user interface which together perform + the function of file transfer in cooperation with one or more + server-FTP processes. The user interface allows a local + language to be used in the command-reply dialogue with the + user. + + user-PI + + The user protocol interpreter initiates the control connection + from its port U to the server-FTP process, initiates FTP + commands, and governs the user-DTP if that process is part of + the file transfer. + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 7] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 2.3. THE FTP MODEL + + With the above definitions in mind, the following model (shown in + Figure 1) may be diagrammed for an FTP service. + + ------------- + |/---------\| + || User || -------- + ||Interface|<--->| User | + |\----^----/| -------- + ---------- | | | + |/------\| FTP Commands |/----V----\| + ||Server|<---------------->| User || + || PI || FTP Replies || PI || + |\--^---/| |\----^----/| + | | | | | | + -------- |/--V---\| Data |/----V----\| -------- + | File |<--->|Server|<---------------->| User |<--->| File | + |System| || DTP || Connection || DTP || |System| + -------- |\------/| |\---------/| -------- + ---------- ------------- + + Server-FTP USER-FTP + + NOTES: 1. The data connection may be used in either direction. + 2. The data connection need not exist all of the time. + + Figure 1 Model for FTP Use + + In the model described in Figure 1, the user-protocol interpreter + initiates the control connection. The control connection follows + the Telnet protocol. At the initiation of the user, standard FTP + commands are generated by the user-PI and transmitted to the + server process via the control connection. (The user may + establish a direct control connection to the server-FTP, from a + TAC terminal for example, and generate standard FTP commands + independently, bypassing the user-FTP process.) Standard replies + are sent from the server-PI to the user-PI over the control + connection in response to the commands. + + The FTP commands specify the parameters for the data connection + (data port, transfer mode, representation type, and structure) and + the nature of file system operation (store, retrieve, append, + delete, etc.). The user-DTP or its designate should "listen" on + the specified data port, and the server initiate the data + connection and data transfer in accordance with the specified + parameters. It should be noted that the data port need not be in + + +Postel & Reynolds [Page 8] + + + +RFC 959 October 1985 +File Transfer Protocol + + + the same host that initiates the FTP commands via the control + connection, but the user or the user-FTP process must ensure a + "listen" on the specified data port. It ought to also be noted + that the data connection may be used for simultaneous sending and + receiving. + + In another situation a user might wish to transfer files between + two hosts, neither of which is a local host. The user sets up + control connections to the two servers and then arranges for a + data connection between them. In this manner, control information + is passed to the user-PI but data is transferred between the + server data transfer processes. Following is a model of this + server-server interaction. + + + Control ------------ Control + ---------->| User-FTP |<----------- + | | User-PI | | + | | "C" | | + V ------------ V + -------------- -------------- + | Server-FTP | Data Connection | Server-FTP | + | "A" |<---------------------->| "B" | + -------------- Port (A) Port (B) -------------- + + + Figure 2 + + The protocol requires that the control connections be open while + data transfer is in progress. It is the responsibility of the + user to request the closing of the control connections when + finished using the FTP service, while it is the server who takes + the action. The server may abort data transfer if the control + connections are closed without command. + + The Relationship between FTP and Telnet: + + The FTP uses the Telnet protocol on the control connection. + This can be achieved in two ways: first, the user-PI or the + server-PI may implement the rules of the Telnet Protocol + directly in their own procedures; or, second, the user-PI or + the server-PI may make use of the existing Telnet module in the + system. + + Ease of implementaion, sharing code, and modular programming + argue for the second approach. Efficiency and independence + + + +Postel & Reynolds [Page 9] + + + +RFC 959 October 1985 +File Transfer Protocol + + + argue for the first approach. In practice, FTP relies on very + little of the Telnet Protocol, so the first approach does not + necessarily involve a large amount of code. + +3. DATA TRANSFER FUNCTIONS + + Files are transferred only via the data connection. The control + connection is used for the transfer of commands, which describe the + functions to be performed, and the replies to these commands (see the + Section on FTP Replies). Several commands are concerned with the + transfer of data between hosts. These data transfer commands include + the MODE command which specify how the bits of the data are to be + transmitted, and the STRUcture and TYPE commands, which are used to + define the way in which the data are to be represented. The + transmission and representation are basically independent but the + "Stream" transmission mode is dependent on the file structure + attribute and if "Compressed" transmission mode is used, the nature + of the filler byte depends on the representation type. + + 3.1. DATA REPRESENTATION AND STORAGE + + Data is transferred from a storage device in the sending host to a + storage device in the receiving host. Often it is necessary to + perform certain transformations on the data because data storage + representations in the two systems are different. For example, + NVT-ASCII has different data storage representations in different + systems. DEC TOPS-20s's generally store NVT-ASCII as five 7-bit + ASCII characters, left-justified in a 36-bit word. IBM Mainframe's + store NVT-ASCII as 8-bit EBCDIC codes. Multics stores NVT-ASCII + as four 9-bit characters in a 36-bit word. It is desirable to + convert characters into the standard NVT-ASCII representation when + transmitting text between dissimilar systems. The sending and + receiving sites would have to perform the necessary + transformations between the standard representation and their + internal representations. + + A different problem in representation arises when transmitting + binary data (not character codes) between host systems with + different word lengths. It is not always clear how the sender + should send data, and the receiver store it. For example, when + transmitting 32-bit bytes from a 32-bit word-length system to a + 36-bit word-length system, it may be desirable (for reasons of + efficiency and usefulness) to store the 32-bit bytes + right-justified in a 36-bit word in the latter system. In any + case, the user should have the option of specifying data + representation and transformation functions. It should be noted + + + +Postel & Reynolds [Page 10] + + + +RFC 959 October 1985 +File Transfer Protocol + + + that FTP provides for very limited data type representations. + Transformations desired beyond this limited capability should be + performed by the user directly. + + 3.1.1. DATA TYPES + + Data representations are handled in FTP by a user specifying a + representation type. This type may implicitly (as in ASCII or + EBCDIC) or explicitly (as in Local byte) define a byte size for + interpretation which is referred to as the "logical byte size." + Note that this has nothing to do with the byte size used for + transmission over the data connection, called the "transfer + byte size", and the two should not be confused. For example, + NVT-ASCII has a logical byte size of 8 bits. If the type is + Local byte, then the TYPE command has an obligatory second + parameter specifying the logical byte size. The transfer byte + size is always 8 bits. + + 3.1.1.1. ASCII TYPE + + This is the default type and must be accepted by all FTP + implementations. It is intended primarily for the transfer + of text files, except when both hosts would find the EBCDIC + type more convenient. + + The sender converts the data from an internal character + representation to the standard 8-bit NVT-ASCII + representation (see the Telnet specification). The receiver + will convert the data from the standard form to his own + internal form. + + In accordance with the NVT standard, the sequence + should be used where necessary to denote the end of a line + of text. (See the discussion of file structure at the end + of the Section on Data Representation and Storage.) + + Using the standard NVT-ASCII representation means that data + must be interpreted as 8-bit bytes. + + The Format parameter for ASCII and EBCDIC types is discussed + below. + + + + + + + + +Postel & Reynolds [Page 11] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 3.1.1.2. EBCDIC TYPE + + This type is intended for efficient transfer between hosts + which use EBCDIC for their internal character + representation. + + For transmission, the data are represented as 8-bit EBCDIC + characters. The character code is the only difference + between the functional specifications of EBCDIC and ASCII + types. + + End-of-line (as opposed to end-of-record--see the discussion + of structure) will probably be rarely used with EBCDIC type + for purposes of denoting structure, but where it is + necessary the character should be used. + + 3.1.1.3. IMAGE TYPE + + The data are sent as contiguous bits which, for transfer, + are packed into the 8-bit transfer bytes. The receiving + site must store the data as contiguous bits. The structure + of the storage system might necessitate the padding of the + file (or of each record, for a record-structured file) to + some convenient boundary (byte, word or block). This + padding, which must be all zeros, may occur only at the end + of the file (or at the end of each record) and there must be + a way of identifying the padding bits so that they may be + stripped off if the file is retrieved. The padding + transformation should be well publicized to enable a user to + process a file at the storage site. + + Image type is intended for the efficient storage and + retrieval of files and for the transfer of binary data. It + is recommended that this type be accepted by all FTP + implementations. + + 3.1.1.4. LOCAL TYPE + + The data is transferred in logical bytes of the size + specified by the obligatory second parameter, Byte size. + The value of Byte size must be a decimal integer; there is + no default value. The logical byte size is not necessarily + the same as the transfer byte size. If there is a + difference in byte sizes, then the logical bytes should be + packed contiguously, disregarding transfer byte boundaries + and with any necessary padding at the end. + + + +Postel & Reynolds [Page 12] + + + +RFC 959 October 1985 +File Transfer Protocol + + + When the data reaches the receiving host, it will be + transformed in a manner dependent on the logical byte size + and the particular host. This transformation must be + invertible (i.e., an identical file can be retrieved if the + same parameters are used) and should be well publicized by + the FTP implementors. + + For example, a user sending 36-bit floating-point numbers to + a host with a 32-bit word could send that data as Local byte + with a logical byte size of 36. The receiving host would + then be expected to store the logical bytes so that they + could be easily manipulated; in this example putting the + 36-bit logical bytes into 64-bit double words should + suffice. + + In another example, a pair of hosts with a 36-bit word size + may send data to one another in words by using TYPE L 36. + The data would be sent in the 8-bit transmission bytes + packed so that 9 transmission bytes carried two host words. + + 3.1.1.5. FORMAT CONTROL + + The types ASCII and EBCDIC also take a second (optional) + parameter; this is to indicate what kind of vertical format + control, if any, is associated with a file. The following + data representation types are defined in FTP: + + A character file may be transferred to a host for one of + three purposes: for printing, for storage and later + retrieval, or for processing. If a file is sent for + printing, the receiving host must know how the vertical + format control is represented. In the second case, it must + be possible to store a file at a host and then retrieve it + later in exactly the same form. Finally, it should be + possible to move a file from one host to another and process + the file at the second host without undue trouble. A single + ASCII or EBCDIC format does not satisfy all these + conditions. Therefore, these types have a second parameter + specifying one of the following three formats: + + 3.1.1.5.1. NON PRINT + + This is the default format to be used if the second + (format) parameter is omitted. Non-print format must be + accepted by all FTP implementations. + + + + +Postel & Reynolds [Page 13] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The file need contain no vertical format information. If + it is passed to a printer process, this process may + assume standard values for spacing and margins. + + Normally, this format will be used with files destined + for processing or just storage. + + 3.1.1.5.2. TELNET FORMAT CONTROLS + + The file contains ASCII/EBCDIC vertical format controls + (i.e., , , , , ) which the printer + process will interpret appropriately. , in exactly + this sequence, also denotes end-of-line. + + 3.1.1.5.2. CARRIAGE CONTROL (ASA) + + The file contains ASA (FORTRAN) vertical format control + characters. (See RFC 740 Appendix C; and Communications + of the ACM, Vol. 7, No. 10, p. 606, October 1964.) In a + line or a record formatted according to the ASA Standard, + the first character is not to be printed. Instead, it + should be used to determine the vertical movement of the + paper which should take place before the rest of the + record is printed. + + The ASA Standard specifies the following control + characters: + + Character Vertical Spacing + + blank Move paper up one line + 0 Move paper up two lines + 1 Move paper to top of next page + + No movement, i.e., overprint + + Clearly there must be some way for a printer process to + distinguish the end of the structural entity. If a file + has record structure (see below) this is no problem; + records will be explicitly marked during transfer and + storage. If the file has no record structure, the + end-of-line sequence is used to separate printing lines, + but these format effectors are overridden by the ASA + controls. + + + + + + +Postel & Reynolds [Page 14] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 3.1.2. DATA STRUCTURES + + In addition to different representation types, FTP allows the + structure of a file to be specified. Three file structures are + defined in FTP: + + file-structure, where there is no internal structure and + the file is considered to be a + continuous sequence of data bytes, + + record-structure, where the file is made up of sequential + records, + + and page-structure, where the file is made up of independent + indexed pages. + + File-structure is the default to be assumed if the STRUcture + command has not been used but both file and record structures + must be accepted for "text" files (i.e., files with TYPE ASCII + or EBCDIC) by all FTP implementations. The structure of a file + will affect both the transfer mode of a file (see the Section + on Transmission Modes) and the interpretation and storage of + the file. + + The "natural" structure of a file will depend on which host + stores the file. A source-code file will usually be stored on + an IBM Mainframe in fixed length records but on a DEC TOPS-20 + as a stream of characters partitioned into lines, for example + by . If the transfer of files between such disparate + sites is to be useful, there must be some way for one site to + recognize the other's assumptions about the file. + + With some sites being naturally file-oriented and others + naturally record-oriented there may be problems if a file with + one structure is sent to a host oriented to the other. If a + text file is sent with record-structure to a host which is file + oriented, then that host should apply an internal + transformation to the file based on the record structure. + Obviously, this transformation should be useful, but it must + also be invertible so that an identical file may be retrieved + using record structure. + + In the case of a file being sent with file-structure to a + record-oriented host, there exists the question of what + criteria the host should use to divide the file into records + which can be processed locally. If this division is necessary, + the FTP implementation should use the end-of-line sequence, + + +Postel & Reynolds [Page 15] + + + +RFC 959 October 1985 +File Transfer Protocol + + + for ASCII, or for EBCDIC text files, as the + delimiter. If an FTP implementation adopts this technique, it + must be prepared to reverse the transformation if the file is + retrieved with file-structure. + + 3.1.2.1. FILE STRUCTURE + + File structure is the default to be assumed if the STRUcture + command has not been used. + + In file-structure there is no internal structure and the + file is considered to be a continuous sequence of data + bytes. + + 3.1.2.2. RECORD STRUCTURE + + Record structures must be accepted for "text" files (i.e., + files with TYPE ASCII or EBCDIC) by all FTP implementations. + + In record-structure the file is made up of sequential + records. + + 3.1.2.3. PAGE STRUCTURE + + To transmit files that are discontinuous, FTP defines a page + structure. Files of this type are sometimes known as + "random access files" or even as "holey files". In these + files there is sometimes other information associated with + the file as a whole (e.g., a file descriptor), or with a + section of the file (e.g., page access controls), or both. + In FTP, the sections of the file are called pages. + + To provide for various page sizes and associated + information, each page is sent with a page header. The page + header has the following defined fields: + + Header Length + + The number of logical bytes in the page header + including this byte. The minimum header length is 4. + + Page Index + + The logical page number of this section of the file. + This is not the transmission sequence number of this + page, but the index used to identify this page of the + file. + + +Postel & Reynolds [Page 16] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Data Length + + The number of logical bytes in the page data. The + minimum data length is 0. + + Page Type + + The type of page this is. The following page types + are defined: + + 0 = Last Page + + This is used to indicate the end of a paged + structured transmission. The header length must + be 4, and the data length must be 0. + + 1 = Simple Page + + This is the normal type for simple paged files + with no page level associated control + information. The header length must be 4. + + 2 = Descriptor Page + + This type is used to transmit the descriptive + information for the file as a whole. + + 3 = Access Controlled Page + + This type includes an additional header field + for paged files with page level access control + information. The header length must be 5. + + Optional Fields + + Further header fields may be used to supply per page + control information, for example, per page access + control. + + All fields are one logical byte in length. The logical byte + size is specified by the TYPE command. See Appendix I for + further details and a specific case at the page structure. + + A note of caution about parameters: a file must be stored and + retrieved with the same parameters if the retrieved version is to + + + + +Postel & Reynolds [Page 17] + + + +RFC 959 October 1985 +File Transfer Protocol + + + be identical to the version originally transmitted. Conversely, + FTP implementations must return a file identical to the original + if the parameters used to store and retrieve a file are the same. + + 3.2. ESTABLISHING DATA CONNECTIONS + + The mechanics of transferring data consists of setting up the data + connection to the appropriate ports and choosing the parameters + for transfer. Both the user and the server-DTPs have a default + data port. The user-process default data port is the same as the + control connection port (i.e., U). The server-process default + data port is the port adjacent to the control connection port + (i.e., L-1). + + The transfer byte size is 8-bit bytes. This byte size is relevant + only for the actual transfer of the data; it has no bearing on + representation of the data within a host's file system. + + The passive data transfer process (this may be a user-DTP or a + second server-DTP) shall "listen" on the data port prior to + sending a transfer request command. The FTP request command + determines the direction of the data transfer. The server, upon + receiving the transfer request, will initiate the data connection + to the port. When the connection is established, the data + transfer begins between DTP's, and the server-PI sends a + confirming reply to the user-PI. + + Every FTP implementation must support the use of the default data + ports, and only the USER-PI can initiate a change to non-default + ports. + + It is possible for the user to specify an alternate data port by + use of the PORT command. The user may want a file dumped on a TAC + line printer or retrieved from a third party host. In the latter + case, the user-PI sets up control connections with both + server-PI's. One server is then told (by an FTP command) to + "listen" for a connection which the other will initiate. The + user-PI sends one server-PI a PORT command indicating the data + port of the other. Finally, both are sent the appropriate + transfer commands. The exact sequence of commands and replies + sent between the user-controller and the servers is defined in the + Section on FTP Replies. + + In general, it is the server's responsibility to maintain the data + connection--to initiate it and to close it. The exception to this + + + + +Postel & Reynolds [Page 18] + + + +RFC 959 October 1985 +File Transfer Protocol + + + is when the user-DTP is sending the data in a transfer mode that + requires the connection to be closed to indicate EOF. The server + MUST close the data connection under the following conditions: + + 1. The server has completed sending data in a transfer mode + that requires a close to indicate EOF. + + 2. The server receives an ABORT command from the user. + + 3. The port specification is changed by a command from the + user. + + 4. The control connection is closed legally or otherwise. + + 5. An irrecoverable error condition occurs. + + Otherwise the close is a server option, the exercise of which the + server must indicate to the user-process by either a 250 or 226 + reply only. + + 3.3. DATA CONNECTION MANAGEMENT + + Default Data Connection Ports: All FTP implementations must + support use of the default data connection ports, and only the + User-PI may initiate the use of non-default ports. + + Negotiating Non-Default Data Ports: The User-PI may specify a + non-default user side data port with the PORT command. The + User-PI may request the server side to identify a non-default + server side data port with the PASV command. Since a connection + is defined by the pair of addresses, either of these actions is + enough to get a different data connection, still it is permitted + to do both commands to use new ports on both ends of the data + connection. + + Reuse of the Data Connection: When using the stream mode of data + transfer the end of the file must be indicated by closing the + connection. This causes a problem if multiple files are to be + transfered in the session, due to need for TCP to hold the + connection record for a time out period to guarantee the reliable + communication. Thus the connection can not be reopened at once. + + There are two solutions to this problem. The first is to + negotiate a non-default port. The second is to use another + transfer mode. + + A comment on transfer modes. The stream transfer mode is + + +Postel & Reynolds [Page 19] + + + +RFC 959 October 1985 +File Transfer Protocol + + + inherently unreliable, since one can not determine if the + connection closed prematurely or not. The other transfer modes + (Block, Compressed) do not close the connection to indicate the + end of file. They have enough FTP encoding that the data + connection can be parsed to determine the end of the file. + Thus using these modes one can leave the data connection open + for multiple file transfers. + + 3.4. TRANSMISSION MODES + + The next consideration in transferring data is choosing the + appropriate transmission mode. There are three modes: one which + formats the data and allows for restart procedures; one which also + compresses the data for efficient transfer; and one which passes + the data with little or no processing. In this last case the mode + interacts with the structure attribute to determine the type of + processing. In the compressed mode, the representation type + determines the filler byte. + + All data transfers must be completed with an end-of-file (EOF) + which may be explicitly stated or implied by the closing of the + data connection. For files with record structure, all the + end-of-record markers (EOR) are explicit, including the final one. + For files transmitted in page structure a "last-page" page type is + used. + + NOTE: In the rest of this section, byte means "transfer byte" + except where explicitly stated otherwise. + + For the purpose of standardized transfer, the sending host will + translate its internal end of line or end of record denotation + into the representation prescribed by the transfer mode and file + structure, and the receiving host will perform the inverse + translation to its internal denotation. An IBM Mainframe record + count field may not be recognized at another host, so the + end-of-record information may be transferred as a two byte control + code in Stream mode or as a flagged bit in a Block or Compressed + mode descriptor. End-of-line in an ASCII or EBCDIC file with no + record structure should be indicated by or , + respectively. Since these transformations imply extra work for + some systems, identical systems transferring non-record structured + text files might wish to use a binary representation and stream + mode for the transfer. + + + + + + +Postel & Reynolds [Page 20] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The following transmission modes are defined in FTP: + + 3.4.1. STREAM MODE + + The data is transmitted as a stream of bytes. There is no + restriction on the representation type used; record structures + are allowed. + + In a record structured file EOR and EOF will each be indicated + by a two-byte control code. The first byte of the control code + will be all ones, the escape character. The second byte will + have the low order bit on and zeros elsewhere for EOR and the + second low order bit on for EOF; that is, the byte will have + value 1 for EOR and value 2 for EOF. EOR and EOF may be + indicated together on the last byte transmitted by turning both + low order bits on (i.e., the value 3). If a byte of all ones + was intended to be sent as data, it should be repeated in the + second byte of the control code. + + If the structure is a file structure, the EOF is indicated by + the sending host closing the data connection and all bytes are + data bytes. + + 3.4.2. BLOCK MODE + + The file is transmitted as a series of data blocks preceded by + one or more header bytes. The header bytes contain a count + field, and descriptor code. The count field indicates the + total length of the data block in bytes, thus marking the + beginning of the next data block (there are no filler bits). + The descriptor code defines: last block in the file (EOF) last + block in the record (EOR), restart marker (see the Section on + Error Recovery and Restart) or suspect data (i.e., the data + being transferred is suspected of errors and is not reliable). + This last code is NOT intended for error control within FTP. + It is motivated by the desire of sites exchanging certain types + of data (e.g., seismic or weather data) to send and receive all + the data despite local errors (such as "magnetic tape read + errors"), but to indicate in the transmission that certain + portions are suspect). Record structures are allowed in this + mode, and any representation type may be used. + + The header consists of the three bytes. Of the 24 bits of + header information, the 16 low order bits shall represent byte + count, and the 8 high order bits shall represent descriptor + codes as shown below. + + + +Postel & Reynolds [Page 21] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Block Header + + +----------------+----------------+----------------+ + | Descriptor | Byte Count | + | 8 bits | 16 bits | + +----------------+----------------+----------------+ + + + The descriptor codes are indicated by bit flags in the + descriptor byte. Four codes have been assigned, where each + code number is the decimal value of the corresponding bit in + the byte. + + Code Meaning + + 128 End of data block is EOR + 64 End of data block is EOF + 32 Suspected errors in data block + 16 Data block is a restart marker + + With this encoding, more than one descriptor coded condition + may exist for a particular block. As many bits as necessary + may be flagged. + + The restart marker is embedded in the data stream as an + integral number of 8-bit bytes representing printable + characters in the language being used over the control + connection (e.g., default--NVT-ASCII). (Space, in the + appropriate language) must not be used WITHIN a restart marker. + + For example, to transmit a six-character marker, the following + would be sent: + + +--------+--------+--------+ + |Descrptr| Byte count | + |code= 16| = 6 | + +--------+--------+--------+ + + +--------+--------+--------+ + | Marker | Marker | Marker | + | 8 bits | 8 bits | 8 bits | + +--------+--------+--------+ + + +--------+--------+--------+ + | Marker | Marker | Marker | + | 8 bits | 8 bits | 8 bits | + +--------+--------+--------+ + + +Postel & Reynolds [Page 22] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 3.4.3. COMPRESSED MODE + + There are three kinds of information to be sent: regular data, + sent in a byte string; compressed data, consisting of + replications or filler; and control information, sent in a + two-byte escape sequence. If n>0 bytes (up to 127) of regular + data are sent, these n bytes are preceded by a byte with the + left-most bit set to 0 and the right-most 7 bits containing the + number n. + + Byte string: + + 1 7 8 8 + +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ + |0| n | | d(1) | ... | d(n) | + +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ + ^ ^ + |---n bytes---| + of data + + String of n data bytes d(1),..., d(n) + Count n must be positive. + + To compress a string of n replications of the data byte d, the + following 2 bytes are sent: + + Replicated Byte: + + 2 6 8 + +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ + |1 0| n | | d | + +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ + + A string of n filler bytes can be compressed into a single + byte, where the filler byte varies with the representation + type. If the type is ASCII or EBCDIC the filler byte is + (Space, ASCII code 32, EBCDIC code 64). If the type is Image + or Local byte the filler is a zero byte. + + Filler String: + + 2 6 + +-+-+-+-+-+-+-+-+ + |1 1| n | + +-+-+-+-+-+-+-+-+ + + The escape sequence is a double byte, the first of which is the + + +Postel & Reynolds [Page 23] + + + +RFC 959 October 1985 +File Transfer Protocol + + + escape byte (all zeros) and the second of which contains + descriptor codes as defined in Block mode. The descriptor + codes have the same meaning as in Block mode and apply to the + succeeding string of bytes. + + Compressed mode is useful for obtaining increased bandwidth on + very large network transmissions at a little extra CPU cost. + It can be most effectively used to reduce the size of printer + files such as those generated by RJE hosts. + + 3.5. ERROR RECOVERY AND RESTART + + There is no provision for detecting bits lost or scrambled in data + transfer; this level of error control is handled by the TCP. + However, a restart procedure is provided to protect users from + gross system failures (including failures of a host, an + FTP-process, or the underlying network). + + The restart procedure is defined only for the block and compressed + modes of data transfer. It requires the sender of data to insert + a special marker code in the data stream with some marker + information. The marker information has meaning only to the + sender, but must consist of printable characters in the default or + negotiated language of the control connection (ASCII or EBCDIC). + The marker could represent a bit-count, a record-count, or any + other information by which a system may identify a data + checkpoint. The receiver of data, if it implements the restart + procedure, would then mark the corresponding position of this + marker in the receiving system, and return this information to the + user. + + In the event of a system failure, the user can restart the data + transfer by identifying the marker point with the FTP restart + procedure. The following example illustrates the use of the + restart procedure. + + The sender of the data inserts an appropriate marker block in the + data stream at a convenient point. The receiving host marks the + corresponding data point in its file system and conveys the last + known sender and receiver marker information to the user, either + directly or over the control connection in a 110 reply (depending + on who is the sender). In the event of a system failure, the user + or controller process restarts the server at the last server + marker by sending a restart command with server's marker code as + its argument. The restart command is transmitted over the control + + + + +Postel & Reynolds [Page 24] + + + +RFC 959 October 1985 +File Transfer Protocol + + + connection and is immediately followed by the command (such as + RETR, STOR or LIST) which was being executed when the system + failure occurred. + +4. FILE TRANSFER FUNCTIONS + + The communication channel from the user-PI to the server-PI is + established as a TCP connection from the user to the standard server + port. The user protocol interpreter is responsible for sending FTP + commands and interpreting the replies received; the server-PI + interprets commands, sends replies and directs its DTP to set up the + data connection and transfer the data. If the second party to the + data transfer (the passive transfer process) is the user-DTP, then it + is governed through the internal protocol of the user-FTP host; if it + is a second server-DTP, then it is governed by its PI on command from + the user-PI. The FTP replies are discussed in the next section. In + the description of a few of the commands in this section, it is + helpful to be explicit about the possible replies. + + 4.1. FTP COMMANDS + + 4.1.1. ACCESS CONTROL COMMANDS + + The following commands specify access control identifiers + (command codes are shown in parentheses). + + USER NAME (USER) + + The argument field is a Telnet string identifying the user. + The user identification is that which is required by the + server for access to its file system. This command will + normally be the first command transmitted by the user after + the control connections are made (some servers may require + this). Additional identification information in the form of + a password and/or an account command may also be required by + some servers. Servers may allow a new USER command to be + entered at any point in order to change the access control + and/or accounting information. This has the effect of + flushing any user, password, and account information already + supplied and beginning the login sequence again. All + transfer parameters are unchanged and any file transfer in + progress is completed under the old access control + parameters. + + + + + + +Postel & Reynolds [Page 25] + + + +RFC 959 October 1985 +File Transfer Protocol + + + PASSWORD (PASS) + + The argument field is a Telnet string specifying the user's + password. This command must be immediately preceded by the + user name command, and, for some sites, completes the user's + identification for access control. Since password + information is quite sensitive, it is desirable in general + to "mask" it or suppress typeout. It appears that the + server has no foolproof way to achieve this. It is + therefore the responsibility of the user-FTP process to hide + the sensitive password information. + + ACCOUNT (ACCT) + + The argument field is a Telnet string identifying the user's + account. The command is not necessarily related to the USER + command, as some sites may require an account for login and + others only for specific access, such as storing files. In + the latter case the command may arrive at any time. + + There are reply codes to differentiate these cases for the + automation: when account information is required for login, + the response to a successful PASSword command is reply code + 332. On the other hand, if account information is NOT + required for login, the reply to a successful PASSword + command is 230; and if the account information is needed for + a command issued later in the dialogue, the server should + return a 332 or 532 reply depending on whether it stores + (pending receipt of the ACCounT command) or discards the + command, respectively. + + CHANGE WORKING DIRECTORY (CWD) + + This command allows the user to work with a different + directory or dataset for file storage or retrieval without + altering his login or accounting information. Transfer + parameters are similarly unchanged. The argument is a + pathname specifying a directory or other system dependent + file group designator. + + CHANGE TO PARENT DIRECTORY (CDUP) + + This command is a special case of CWD, and is included to + simplify the implementation of programs for transferring + directory trees between operating systems having different + + + + +Postel & Reynolds [Page 26] + + + +RFC 959 October 1985 +File Transfer Protocol + + + syntaxes for naming the parent directory. The reply codes + shall be identical to the reply codes of CWD. See + Appendix II for further details. + + STRUCTURE MOUNT (SMNT) + + This command allows the user to mount a different file + system data structure without altering his login or + accounting information. Transfer parameters are similarly + unchanged. The argument is a pathname specifying a + directory or other system dependent file group designator. + + REINITIALIZE (REIN) + + This command terminates a USER, flushing all I/O and account + information, except to allow any transfer in progress to be + completed. All parameters are reset to the default settings + and the control connection is left open. This is identical + to the state in which a user finds himself immediately after + the control connection is opened. A USER command may be + expected to follow. + + LOGOUT (QUIT) + + This command terminates a USER and if file transfer is not + in progress, the server closes the control connection. If + file transfer is in progress, the connection will remain + open for result response and the server will then close it. + If the user-process is transferring files for several USERs + but does not wish to close and then reopen connections for + each, then the REIN command should be used instead of QUIT. + + An unexpected close on the control connection will cause the + server to take the effective action of an abort (ABOR) and a + logout (QUIT). + + 4.1.2. TRANSFER PARAMETER COMMANDS + + All data transfer parameters have default values, and the + commands specifying data transfer parameters are required only + if the default parameter values are to be changed. The default + value is the last specified value, or if no value has been + specified, the standard default value is as stated here. This + implies that the server must "remember" the applicable default + values. The commands may be in any order except that they must + precede the FTP service request. The following commands + specify data transfer parameters: + + +Postel & Reynolds [Page 27] + + + +RFC 959 October 1985 +File Transfer Protocol + + + DATA PORT (PORT) + + The argument is a HOST-PORT specification for the data port + to be used in data connection. There are defaults for both + the user and server data ports, and under normal + circumstances this command and its reply are not needed. If + this command is used, the argument is the concatenation of a + 32-bit internet host address and a 16-bit TCP port address. + This address information is broken into 8-bit fields and the + value of each field is transmitted as a decimal number (in + character string representation). The fields are separated + by commas. A port command would be: + + PORT h1,h2,h3,h4,p1,p2 + + where h1 is the high order 8 bits of the internet host + address. + + PASSIVE (PASV) + + This command requests the server-DTP to "listen" on a data + port (which is not its default data port) and to wait for a + connection rather than initiate one upon receipt of a + transfer command. The response to this command includes the + host and port address this server is listening on. + + REPRESENTATION TYPE (TYPE) + + The argument specifies the representation type as described + in the Section on Data Representation and Storage. Several + types take a second parameter. The first parameter is + denoted by a single Telnet character, as is the second + Format parameter for ASCII and EBCDIC; the second parameter + for local byte is a decimal integer to indicate Bytesize. + The parameters are separated by a (Space, ASCII code + 32). + + The following codes are assigned for type: + + \ / + A - ASCII | | N - Non-print + |-><-| T - Telnet format effectors + E - EBCDIC| | C - Carriage Control (ASA) + / \ + I - Image + + L - Local byte Byte size + + +Postel & Reynolds [Page 28] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The default representation type is ASCII Non-print. If the + Format parameter is changed, and later just the first + argument is changed, Format then returns to the Non-print + default. + + FILE STRUCTURE (STRU) + + The argument is a single Telnet character code specifying + file structure described in the Section on Data + Representation and Storage. + + The following codes are assigned for structure: + + F - File (no record structure) + R - Record structure + P - Page structure + + The default structure is File. + + TRANSFER MODE (MODE) + + The argument is a single Telnet character code specifying + the data transfer modes described in the Section on + Transmission Modes. + + The following codes are assigned for transfer modes: + + S - Stream + B - Block + C - Compressed + + The default transfer mode is Stream. + + 4.1.3. FTP SERVICE COMMANDS + + The FTP service commands define the file transfer or the file + system function requested by the user. The argument of an FTP + service command will normally be a pathname. The syntax of + pathnames must conform to server site conventions (with + standard defaults applicable), and the language conventions of + the control connection. The suggested default handling is to + use the last specified device, directory or file name, or the + standard default defined for local users. The commands may be + in any order except that a "rename from" command must be + followed by a "rename to" command and the restart command must + be followed by the interrupted service command (e.g., STOR or + RETR). The data, when transferred in response to FTP service + + +Postel & Reynolds [Page 29] + + + +RFC 959 October 1985 +File Transfer Protocol + + + commands, shall always be sent over the data connection, except + for certain informative replies. The following commands + specify FTP service requests: + + RETRIEVE (RETR) + + This command causes the server-DTP to transfer a copy of the + file, specified in the pathname, to the server- or user-DTP + at the other end of the data connection. The status and + contents of the file at the server site shall be unaffected. + + STORE (STOR) + + This command causes the server-DTP to accept the data + transferred via the data connection and to store the data as + a file at the server site. If the file specified in the + pathname exists at the server site, then its contents shall + be replaced by the data being transferred. A new file is + created at the server site if the file specified in the + pathname does not already exist. + + STORE UNIQUE (STOU) + + This command behaves like STOR except that the resultant + file is to be created in the current directory under a name + unique to that directory. The 250 Transfer Started response + must include the name generated. + + APPEND (with create) (APPE) + + This command causes the server-DTP to accept the data + transferred via the data connection and to store the data in + a file at the server site. If the file specified in the + pathname exists at the server site, then the data shall be + appended to that file; otherwise the file specified in the + pathname shall be created at the server site. + + ALLOCATE (ALLO) + + This command may be required by some servers to reserve + sufficient storage to accommodate the new file to be + transferred. The argument shall be a decimal integer + representing the number of bytes (using the logical byte + size) of storage to be reserved for the file. For files + sent with record or page structure a maximum record or page + size (in logical bytes) might also be necessary; this is + indicated by a decimal integer in a second argument field of + + +Postel & Reynolds [Page 30] + + + +RFC 959 October 1985 +File Transfer Protocol + + + the command. This second argument is optional, but when + present should be separated from the first by the three + Telnet characters R . This command shall be + followed by a STORe or APPEnd command. The ALLO command + should be treated as a NOOP (no operation) by those servers + which do not require that the maximum size of the file be + declared beforehand, and those servers interested in only + the maximum record or page size should accept a dummy value + in the first argument and ignore it. + + RESTART (REST) + + The argument field represents the server marker at which + file transfer is to be restarted. This command does not + cause file transfer but skips over the file to the specified + data checkpoint. This command shall be immediately followed + by the appropriate FTP service command which shall cause + file transfer to resume. + + RENAME FROM (RNFR) + + This command specifies the old pathname of the file which is + to be renamed. This command must be immediately followed by + a "rename to" command specifying the new file pathname. + + RENAME TO (RNTO) + + This command specifies the new pathname of the file + specified in the immediately preceding "rename from" + command. Together the two commands cause a file to be + renamed. + + ABORT (ABOR) + + This command tells the server to abort the previous FTP + service command and any associated transfer of data. The + abort command may require "special action", as discussed in + the Section on FTP Commands, to force recognition by the + server. No action is to be taken if the previous command + has been completed (including data transfer). The control + connection is not to be closed by the server, but the data + connection must be closed. + + There are two cases for the server upon receipt of this + command: (1) the FTP service command was already completed, + or (2) the FTP service command is still in progress. + + + +Postel & Reynolds [Page 31] + + + +RFC 959 October 1985 +File Transfer Protocol + + + In the first case, the server closes the data connection + (if it is open) and responds with a 226 reply, indicating + that the abort command was successfully processed. + + In the second case, the server aborts the FTP service in + progress and closes the data connection, returning a 426 + reply to indicate that the service request terminated + abnormally. The server then sends a 226 reply, + indicating that the abort command was successfully + processed. + + DELETE (DELE) + + This command causes the file specified in the pathname to be + deleted at the server site. If an extra level of protection + is desired (such as the query, "Do you really wish to + delete?"), it should be provided by the user-FTP process. + + REMOVE DIRECTORY (RMD) + + This command causes the directory specified in the pathname + to be removed as a directory (if the pathname is absolute) + or as a subdirectory of the current working directory (if + the pathname is relative). See Appendix II. + + MAKE DIRECTORY (MKD) + + This command causes the directory specified in the pathname + to be created as a directory (if the pathname is absolute) + or as a subdirectory of the current working directory (if + the pathname is relative). See Appendix II. + + PRINT WORKING DIRECTORY (PWD) + + This command causes the name of the current working + directory to be returned in the reply. See Appendix II. + + LIST (LIST) + + This command causes a list to be sent from the server to the + passive DTP. If the pathname specifies a directory or other + group of files, the server should transfer a list of files + in the specified directory. If the pathname specifies a + file then the server should send current information on the + file. A null argument implies the user's current working or + default directory. The data transfer is over the data + connection in type ASCII or type EBCDIC. (The user must + + +Postel & Reynolds [Page 32] + + + +RFC 959 October 1985 +File Transfer Protocol + + + ensure that the TYPE is appropriately ASCII or EBCDIC). + Since the information on a file may vary widely from system + to system, this information may be hard to use automatically + in a program, but may be quite useful to a human user. + + NAME LIST (NLST) + + This command causes a directory listing to be sent from + server to user site. The pathname should specify a + directory or other system-specific file group descriptor; a + null argument implies the current directory. The server + will return a stream of names of files and no other + information. The data will be transferred in ASCII or + EBCDIC type over the data connection as valid pathname + strings separated by or . (Again the user must + ensure that the TYPE is correct.) This command is intended + to return information that can be used by a program to + further process the files automatically. For example, in + the implementation of a "multiple get" function. + + SITE PARAMETERS (SITE) + + This command is used by the server to provide services + specific to his system that are essential to file transfer + but not sufficiently universal to be included as commands in + the protocol. The nature of these services and the + specification of their syntax can be stated in a reply to + the HELP SITE command. + + SYSTEM (SYST) + + This command is used to find out the type of operating + system at the server. The reply shall have as its first + word one of the system names listed in the current version + of the Assigned Numbers document [4]. + + STATUS (STAT) + + This command shall cause a status response to be sent over + the control connection in the form of a reply. The command + may be sent during a file transfer (along with the Telnet IP + and Synch signals--see the Section on FTP Commands) in which + case the server will respond with the status of the + operation in progress, or it may be sent between file + transfers. In the latter case, the command may have an + argument field. If the argument is a pathname, the command + is analogous to the "list" command except that data shall be + + +Postel & Reynolds [Page 33] + + + +RFC 959 October 1985 +File Transfer Protocol + + + transferred over the control connection. If a partial + pathname is given, the server may respond with a list of + file names or attributes associated with that specification. + If no argument is given, the server should return general + status information about the server FTP process. This + should include current values of all transfer parameters and + the status of connections. + + HELP (HELP) + + This command shall cause the server to send helpful + information regarding its implementation status over the + control connection to the user. The command may take an + argument (e.g., any command name) and return more specific + information as a response. The reply is type 211 or 214. + It is suggested that HELP be allowed before entering a USER + command. The server may use this reply to specify + site-dependent parameters, e.g., in response to HELP SITE. + + NOOP (NOOP) + + This command does not affect any parameters or previously + entered commands. It specifies no action other than that the + server send an OK reply. + + The File Transfer Protocol follows the specifications of the Telnet + protocol for all communications over the control connection. Since + the language used for Telnet communication may be a negotiated + option, all references in the next two sections will be to the + "Telnet language" and the corresponding "Telnet end-of-line code". + Currently, one may take these to mean NVT-ASCII and . No other + specifications of the Telnet protocol will be cited. + + FTP commands are "Telnet strings" terminated by the "Telnet end of + line code". The command codes themselves are alphabetic characters + terminated by the character (Space) if parameters follow and + Telnet-EOL otherwise. The command codes and the semantics of + commands are described in this section; the detailed syntax of + commands is specified in the Section on Commands, the reply sequences + are discussed in the Section on Sequencing of Commands and Replies, + and scenarios illustrating the use of commands are provided in the + Section on Typical FTP Scenarios. + + FTP commands may be partitioned as those specifying access-control + identifiers, data transfer parameters, or FTP service requests. + Certain commands (such as ABOR, STAT, QUIT) may be sent over the + control connection while a data transfer is in progress. Some + + +Postel & Reynolds [Page 34] + + + +RFC 959 October 1985 +File Transfer Protocol + + + servers may not be able to monitor the control and data connections + simultaneously, in which case some special action will be necessary + to get the server's attention. The following ordered format is + tentatively recommended: + + 1. User system inserts the Telnet "Interrupt Process" (IP) signal + in the Telnet stream. + + 2. User system sends the Telnet "Synch" signal. + + 3. User system inserts the command (e.g., ABOR) in the Telnet + stream. + + 4. Server PI, after receiving "IP", scans the Telnet stream for + EXACTLY ONE FTP command. + + (For other servers this may not be necessary but the actions listed + above should have no unusual effect.) + + 4.2. FTP REPLIES + + Replies to File Transfer Protocol commands are devised to ensure + the synchronization of requests and actions in the process of file + transfer, and to guarantee that the user process always knows the + state of the Server. Every command must generate at least one + reply, although there may be more than one; in the latter case, + the multiple replies must be easily distinguished. In addition, + some commands occur in sequential groups, such as USER, PASS and + ACCT, or RNFR and RNTO. The replies show the existence of an + intermediate state if all preceding commands have been successful. + A failure at any point in the sequence necessitates the repetition + of the entire sequence from the beginning. + + The details of the command-reply sequence are made explicit in + a set of state diagrams below. + + An FTP reply consists of a three digit number (transmitted as + three alphanumeric characters) followed by some text. The number + is intended for use by automata to determine what state to enter + next; the text is intended for the human user. It is intended + that the three digits contain enough encoded information that the + user-process (the User-PI) will not need to examine the text and + may either discard it or pass it on to the user, as appropriate. + In particular, the text may be server-dependent, so there are + likely to be varying texts for each reply code. + + A reply is defined to contain the 3-digit code, followed by Space + + +Postel & Reynolds [Page 35] + + + +RFC 959 October 1985 +File Transfer Protocol + + + , followed by one line of text (where some maximum line length + has been specified), and terminated by the Telnet end-of-line + code. There will be cases however, where the text is longer than + a single line. In these cases the complete text must be bracketed + so the User-process knows when it may stop reading the reply (i.e. + stop processing input on the control connection) and go do other + things. This requires a special format on the first line to + indicate that more than one line is coming, and another on the + last line to designate it as the last. At least one of these must + contain the appropriate reply code to indicate the state of the + transaction. To satisfy all factions, it was decided that both + the first and last line codes should be the same. + + Thus the format for multi-line replies is that the first line + will begin with the exact required reply code, followed + immediately by a Hyphen, "-" (also known as Minus), followed by + text. The last line will begin with the same code, followed + immediately by Space , optionally some text, and the Telnet + end-of-line code. + + For example: + 123-First line + Second line + 234 A line beginning with numbers + 123 The last line + + The user-process then simply needs to search for the second + occurrence of the same reply code, followed by (Space), at + the beginning of a line, and ignore all intermediary lines. If + an intermediary line begins with a 3-digit number, the Server + must pad the front to avoid confusion. + + This scheme allows standard system routines to be used for + reply information (such as for the STAT reply), with + "artificial" first and last lines tacked on. In rare cases + where these routines are able to generate three digits and a + Space at the beginning of any line, the beginning of each + text line should be offset by some neutral text, like Space. + + This scheme assumes that multi-line replies may not be nested. + + The three digits of the reply each have a special significance. + This is intended to allow a range of very simple to very + sophisticated responses by the user-process. The first digit + denotes whether the response is good, bad or incomplete. + (Referring to the state diagram), an unsophisticated user-process + will be able to determine its next action (proceed as planned, + + +Postel & Reynolds [Page 36] + + + +RFC 959 October 1985 +File Transfer Protocol + + + redo, retrench, etc.) by simply examining this first digit. A + user-process that wants to know approximately what kind of error + occurred (e.g. file system error, command syntax error) may + examine the second digit, reserving the third digit for the finest + gradation of information (e.g., RNTO command without a preceding + RNFR). + + There are five values for the first digit of the reply code: + + 1yz Positive Preliminary reply + + The requested action is being initiated; expect another + reply before proceeding with a new command. (The + user-process sending another command before the + completion reply would be in violation of protocol; but + server-FTP processes should queue any commands that + arrive while a preceding command is in progress.) This + type of reply can be used to indicate that the command + was accepted and the user-process may now pay attention + to the data connections, for implementations where + simultaneous monitoring is difficult. The server-FTP + process may send at most, one 1yz reply per command. + + 2yz Positive Completion reply + + The requested action has been successfully completed. A + new request may be initiated. + + 3yz Positive Intermediate reply + + The command has been accepted, but the requested action + is being held in abeyance, pending receipt of further + information. The user should send another command + specifying this information. This reply is used in + command sequence groups. + + 4yz Transient Negative Completion reply + + The command was not accepted and the requested action did + not take place, but the error condition is temporary and + the action may be requested again. The user should + return to the beginning of the command sequence, if any. + It is difficult to assign a meaning to "transient", + particularly when two distinct sites (Server- and + User-processes) have to agree on the interpretation. + Each reply in the 4yz category might have a slightly + different time value, but the intent is that the + + +Postel & Reynolds [Page 37] + + + +RFC 959 October 1985 +File Transfer Protocol + + + user-process is encouraged to try again. A rule of thumb + in determining if a reply fits into the 4yz or the 5yz + (Permanent Negative) category is that replies are 4yz if + the commands can be repeated without any change in + command form or in properties of the User or Server + (e.g., the command is spelled the same with the same + arguments used; the user does not change his file access + or user name; the server does not put up a new + implementation.) + + 5yz Permanent Negative Completion reply + + The command was not accepted and the requested action did + not take place. The User-process is discouraged from + repeating the exact request (in the same sequence). Even + some "permanent" error conditions can be corrected, so + the human user may want to direct his User-process to + reinitiate the command sequence by direct action at some + point in the future (e.g., after the spelling has been + changed, or the user has altered his directory status.) + + The following function groupings are encoded in the second + digit: + + x0z Syntax - These replies refer to syntax errors, + syntactically correct commands that don't fit any + functional category, unimplemented or superfluous + commands. + + x1z Information - These are replies to requests for + information, such as status or help. + + x2z Connections - Replies referring to the control and + data connections. + + x3z Authentication and accounting - Replies for the login + process and accounting procedures. + + x4z Unspecified as yet. + + x5z File system - These replies indicate the status of the + Server file system vis-a-vis the requested transfer or + other file system action. + + The third digit gives a finer gradation of meaning in each of + the function categories, specified by the second digit. The + list of replies below will illustrate this. Note that the text + + +Postel & Reynolds [Page 38] + + + +RFC 959 October 1985 +File Transfer Protocol + + + associated with each reply is recommended, rather than + mandatory, and may even change according to the command with + which it is associated. The reply codes, on the other hand, + must strictly follow the specifications in the last section; + that is, Server implementations should not invent new codes for + situations that are only slightly different from the ones + described here, but rather should adapt codes already defined. + + A command such as TYPE or ALLO whose successful execution + does not offer the user-process any new information will + cause a 200 reply to be returned. If the command is not + implemented by a particular Server-FTP process because it + has no relevance to that computer system, for example ALLO + at a TOPS20 site, a Positive Completion reply is still + desired so that the simple User-process knows it can proceed + with its course of action. A 202 reply is used in this case + with, for example, the reply text: "No storage allocation + necessary." If, on the other hand, the command requests a + non-site-specific action and is unimplemented, the response + is 502. A refinement of that is the 504 reply for a command + that is implemented, but that requests an unimplemented + parameter. + + 4.2.1 Reply Codes by Function Groups + + 200 Command okay. + 500 Syntax error, command unrecognized. + This may include errors such as command line too long. + 501 Syntax error in parameters or arguments. + 202 Command not implemented, superfluous at this site. + 502 Command not implemented. + 503 Bad sequence of commands. + 504 Command not implemented for that parameter. + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 39] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 110 Restart marker reply. + In this case, the text is exact and not left to the + particular implementation; it must read: + MARK yyyy = mmmm + Where yyyy is User-process data stream marker, and mmmm + server's equivalent marker (note the spaces between markers + and "="). + 211 System status, or system help reply. + 212 Directory status. + 213 File status. + 214 Help message. + On how to use the server or the meaning of a particular + non-standard command. This reply is useful only to the + human user. + 215 NAME system type. + Where NAME is an official system name from the list in the + Assigned Numbers document. + + 120 Service ready in nnn minutes. + 220 Service ready for new user. + 221 Service closing control connection. + Logged out if appropriate. + 421 Service not available, closing control connection. + This may be a reply to any command if the service knows it + must shut down. + 125 Data connection already open; transfer starting. + 225 Data connection open; no transfer in progress. + 425 Can't open data connection. + 226 Closing data connection. + Requested file action successful (for example, file + transfer or file abort). + 426 Connection closed; transfer aborted. + 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). + + 230 User logged in, proceed. + 530 Not logged in. + 331 User name okay, need password. + 332 Need account for login. + 532 Need account for storing files. + + + + + + + + + + +Postel & Reynolds [Page 40] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 150 File status okay; about to open data connection. + 250 Requested file action okay, completed. + 257 "PATHNAME" created. + 350 Requested file action pending further information. + 450 Requested file action not taken. + File unavailable (e.g., file busy). + 550 Requested action not taken. + File unavailable (e.g., file not found, no access). + 451 Requested action aborted. Local error in processing. + 551 Requested action aborted. Page type unknown. + 452 Requested action not taken. + Insufficient storage space in system. + 552 Requested file action aborted. + Exceeded storage allocation (for current directory or + dataset). + 553 Requested action not taken. + File name not allowed. + + + 4.2.2 Numeric Order List of Reply Codes + + 110 Restart marker reply. + In this case, the text is exact and not left to the + particular implementation; it must read: + MARK yyyy = mmmm + Where yyyy is User-process data stream marker, and mmmm + server's equivalent marker (note the spaces between markers + and "="). + 120 Service ready in nnn minutes. + 125 Data connection already open; transfer starting. + 150 File status okay; about to open data connection. + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 41] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 200 Command okay. + 202 Command not implemented, superfluous at this site. + 211 System status, or system help reply. + 212 Directory status. + 213 File status. + 214 Help message. + On how to use the server or the meaning of a particular + non-standard command. This reply is useful only to the + human user. + 215 NAME system type. + Where NAME is an official system name from the list in the + Assigned Numbers document. + 220 Service ready for new user. + 221 Service closing control connection. + Logged out if appropriate. + 225 Data connection open; no transfer in progress. + 226 Closing data connection. + Requested file action successful (for example, file + transfer or file abort). + 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). + 230 User logged in, proceed. + 250 Requested file action okay, completed. + 257 "PATHNAME" created. + + 331 User name okay, need password. + 332 Need account for login. + 350 Requested file action pending further information. + + 421 Service not available, closing control connection. + This may be a reply to any command if the service knows it + must shut down. + 425 Can't open data connection. + 426 Connection closed; transfer aborted. + 450 Requested file action not taken. + File unavailable (e.g., file busy). + 451 Requested action aborted: local error in processing. + 452 Requested action not taken. + Insufficient storage space in system. + + + + + + + + + + + +Postel & Reynolds [Page 42] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 500 Syntax error, command unrecognized. + This may include errors such as command line too long. + 501 Syntax error in parameters or arguments. + 502 Command not implemented. + 503 Bad sequence of commands. + 504 Command not implemented for that parameter. + 530 Not logged in. + 532 Need account for storing files. + 550 Requested action not taken. + File unavailable (e.g., file not found, no access). + 551 Requested action aborted: page type unknown. + 552 Requested file action aborted. + Exceeded storage allocation (for current directory or + dataset). + 553 Requested action not taken. + File name not allowed. + + +5. DECLARATIVE SPECIFICATIONS + + 5.1. MINIMUM IMPLEMENTATION + + In order to make FTP workable without needless error messages, the + following minimum implementation is required for all servers: + + TYPE - ASCII Non-print + MODE - Stream + STRUCTURE - File, Record + COMMANDS - USER, QUIT, PORT, + TYPE, MODE, STRU, + for the default values + RETR, STOR, + NOOP. + + The default values for transfer parameters are: + + TYPE - ASCII Non-print + MODE - Stream + STRU - File + + All hosts must accept the above as the standard defaults. + + + + + + + + +Postel & Reynolds [Page 43] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 5.2. CONNECTIONS + + The server protocol interpreter shall "listen" on Port L. The + user or user protocol interpreter shall initiate the full-duplex + control connection. Server- and user- processes should follow the + conventions of the Telnet protocol as specified in the + ARPA-Internet Protocol Handbook [1]. Servers are under no + obligation to provide for editing of command lines and may require + that it be done in the user host. The control connection shall be + closed by the server at the user's request after all transfers and + replies are completed. + + The user-DTP must "listen" on the specified data port; this may be + the default user port (U) or a port specified in the PORT command. + The server shall initiate the data connection from his own default + data port (L-1) using the specified user data port. The direction + of the transfer and the port used will be determined by the FTP + service command. + + Note that all FTP implementation must support data transfer using + the default port, and that only the USER-PI may initiate the use + of non-default ports. + + When data is to be transferred between two servers, A and B (refer + to Figure 2), the user-PI, C, sets up control connections with + both server-PI's. One of the servers, say A, is then sent a PASV + command telling him to "listen" on his data port rather than + initiate a connection when he receives a transfer service command. + When the user-PI receives an acknowledgment to the PASV command, + which includes the identity of the host and port being listened + on, the user-PI then sends A's port, a, to B in a PORT command; a + reply is returned. The user-PI may then send the corresponding + service commands to A and B. Server B initiates the connection + and the transfer proceeds. The command-reply sequence is listed + below where the messages are vertically synchronous but + horizontally asynchronous: + + + + + + + + + + + + + +Postel & Reynolds [Page 44] + + + +RFC 959 October 1985 +File Transfer Protocol + + + User-PI - Server A User-PI - Server B + ------------------ ------------------ + + C->A : Connect C->B : Connect + C->A : PASV + A->C : 227 Entering Passive Mode. A1,A2,A3,A4,a1,a2 + C->B : PORT A1,A2,A3,A4,a1,a2 + B->C : 200 Okay + C->A : STOR C->B : RETR + B->A : Connect to HOST-A, PORT-a + + Figure 3 + + The data connection shall be closed by the server under the + conditions described in the Section on Establishing Data + Connections. If the data connection is to be closed following a + data transfer where closing the connection is not required to + indicate the end-of-file, the server must do so immediately. + Waiting until after a new transfer command is not permitted + because the user-process will have already tested the data + connection to see if it needs to do a "listen"; (remember that the + user must "listen" on a closed data port BEFORE sending the + transfer request). To prevent a race condition here, the server + sends a reply (226) after closing the data connection (or if the + connection is left open, a "file transfer completed" reply (250) + and the user-PI should wait for one of these replies before + issuing a new transfer command). + + Any time either the user or server see that the connection is + being closed by the other side, it should promptly read any + remaining data queued on the connection and issue the close on its + own side. + + 5.3. COMMANDS + + The commands are Telnet character strings transmitted over the + control connections as described in the Section on FTP Commands. + The command functions and semantics are described in the Section + on Access Control Commands, Transfer Parameter Commands, FTP + Service Commands, and Miscellaneous Commands. The command syntax + is specified here. + + The commands begin with a command code followed by an argument + field. The command codes are four or fewer alphabetic characters. + Upper and lower case alphabetic characters are to be treated + identically. Thus, any of the following may represent the + retrieve command: + + +Postel & Reynolds [Page 45] + + + +RFC 959 October 1985 +File Transfer Protocol + + + RETR Retr retr ReTr rETr + + This also applies to any symbols representing parameter values, + such as A or a for ASCII TYPE. The command codes and the argument + fields are separated by one or more spaces. + + The argument field consists of a variable length character string + ending with the character sequence (Carriage Return, Line + Feed) for NVT-ASCII representation; for other negotiated languages + a different end of line character might be used. It should be + noted that the server is to take no action until the end of line + code is received. + + The syntax is specified below in NVT-ASCII. All characters in the + argument field are ASCII characters including any ASCII + represented decimal integers. Square brackets denote an optional + argument field. If the option is not taken, the appropriate + default is implied. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 46] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 5.3.1. FTP COMMANDS + + The following are the FTP commands: + + USER + PASS + ACCT + CWD + CDUP + SMNT + QUIT + REIN + PORT + PASV + TYPE + STRU + MODE + RETR + STOR + STOU + APPE + ALLO + [ R ] + REST + RNFR + RNTO + ABOR + DELE + RMD + MKD + PWD + LIST [ ] + NLST [ ] + SITE + SYST + STAT [ ] + HELP [ ] + NOOP + + + + + + + + + + + +Postel & Reynolds [Page 47] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 5.3.2. FTP COMMAND ARGUMENTS + + The syntax of the above argument fields (using BNF notation + where applicable) is: + + ::= + ::= + ::= + ::= | + ::= any of the 128 ASCII characters except and + + ::= + ::= | + ::= printable characters, any + ASCII code 33 through 126 + ::= + ::= , + ::= ,,, + ::= , + ::= any decimal integer 1 through 255 + ::= N | T | C + ::= A [ ] + | E [ ] + | I + | L + ::= F | R | P + ::= S | B | C + ::= + ::= any decimal integer + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 48] + + + +RFC 959 October 1985 +File Transfer Protocol + + + 5.4. SEQUENCING OF COMMANDS AND REPLIES + + The communication between the user and server is intended to be an + alternating dialogue. As such, the user issues an FTP command and + the server responds with a prompt primary reply. The user should + wait for this initial primary success or failure response before + sending further commands. + + Certain commands require a second reply for which the user should + also wait. These replies may, for example, report on the progress + or completion of file transfer or the closing of the data + connection. They are secondary replies to file transfer commands. + + One important group of informational replies is the connection + greetings. Under normal circumstances, a server will send a 220 + reply, "awaiting input", when the connection is completed. The + user should wait for this greeting message before sending any + commands. If the server is unable to accept input right away, a + 120 "expected delay" reply should be sent immediately and a 220 + reply when ready. The user will then know not to hang up if there + is a delay. + + Spontaneous Replies + + Sometimes "the system" spontaneously has a message to be sent + to a user (usually all users). For example, "System going down + in 15 minutes". There is no provision in FTP for such + spontaneous information to be sent from the server to the user. + It is recommended that such information be queued in the + server-PI and delivered to the user-PI in the next reply + (possibly making it a multi-line reply). + + The table below lists alternative success and failure replies for + each command. These must be strictly adhered to; a server may + substitute text in the replies, but the meaning and action implied + by the code numbers and by the specific command reply sequence + cannot be altered. + + Command-Reply Sequences + + In this section, the command-reply sequence is presented. Each + command is listed with its possible replies; command groups are + listed together. Preliminary replies are listed first (with + their succeeding replies indented and under them), then + positive and negative completion, and finally intermediary + + + + +Postel & Reynolds [Page 49] + + + +RFC 959 October 1985 +File Transfer Protocol + + + replies with the remaining commands from the sequence + following. This listing forms the basis for the state + diagrams, which will be presented separately. + + Connection Establishment + 120 + 220 + 220 + 421 + Login + USER + 230 + 530 + 500, 501, 421 + 331, 332 + PASS + 230 + 202 + 530 + 500, 501, 503, 421 + 332 + ACCT + 230 + 202 + 530 + 500, 501, 503, 421 + CWD + 250 + 500, 501, 502, 421, 530, 550 + CDUP + 200 + 500, 501, 502, 421, 530, 550 + SMNT + 202, 250 + 500, 501, 502, 421, 530, 550 + Logout + REIN + 120 + 220 + 220 + 421 + 500, 502 + QUIT + 221 + 500 + + + + +Postel & Reynolds [Page 50] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Transfer parameters + PORT + 200 + 500, 501, 421, 530 + PASV + 227 + 500, 501, 502, 421, 530 + MODE + 200 + 500, 501, 504, 421, 530 + TYPE + 200 + 500, 501, 504, 421, 530 + STRU + 200 + 500, 501, 504, 421, 530 + File action commands + ALLO + 200 + 202 + 500, 501, 504, 421, 530 + REST + 500, 501, 502, 421, 530 + 350 + STOR + 125, 150 + (110) + 226, 250 + 425, 426, 451, 551, 552 + 532, 450, 452, 553 + 500, 501, 421, 530 + STOU + 125, 150 + (110) + 226, 250 + 425, 426, 451, 551, 552 + 532, 450, 452, 553 + 500, 501, 421, 530 + RETR + 125, 150 + (110) + 226, 250 + 425, 426, 451 + 450, 550 + 500, 501, 421, 530 + + + + +Postel & Reynolds [Page 51] + + + +RFC 959 October 1985 +File Transfer Protocol + + + LIST + 125, 150 + 226, 250 + 425, 426, 451 + 450 + 500, 501, 502, 421, 530 + NLST + 125, 150 + 226, 250 + 425, 426, 451 + 450 + 500, 501, 502, 421, 530 + APPE + 125, 150 + (110) + 226, 250 + 425, 426, 451, 551, 552 + 532, 450, 550, 452, 553 + 500, 501, 502, 421, 530 + RNFR + 450, 550 + 500, 501, 502, 421, 530 + 350 + RNTO + 250 + 532, 553 + 500, 501, 502, 503, 421, 530 + DELE + 250 + 450, 550 + 500, 501, 502, 421, 530 + RMD + 250 + 500, 501, 502, 421, 530, 550 + MKD + 257 + 500, 501, 502, 421, 530, 550 + PWD + 257 + 500, 501, 502, 421, 550 + ABOR + 225, 226 + 500, 501, 502, 421 + + + + + + +Postel & Reynolds [Page 52] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Informational commands + SYST + 215 + 500, 501, 502, 421 + STAT + 211, 212, 213 + 450 + 500, 501, 502, 421, 530 + HELP + 211, 214 + 500, 501, 502, 421 + Miscellaneous commands + SITE + 200 + 202 + 500, 501, 530 + NOOP + 200 + 500 421 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 53] + + + +RFC 959 October 1985 +File Transfer Protocol + + +6. STATE DIAGRAMS + + Here we present state diagrams for a very simple minded FTP + implementation. Only the first digit of the reply codes is used. + There is one state diagram for each group of FTP commands or command + sequences. + + The command groupings were determined by constructing a model for + each command then collecting together the commands with structurally + identical models. + + For each command or command sequence there are three possible + outcomes: success (S), failure (F), and error (E). In the state + diagrams below we use the symbol B for "begin", and the symbol W for + "wait for reply". + + We first present the diagram that represents the largest group of FTP + commands: + + + 1,3 +---+ + ----------->| E | + | +---+ + | + +---+ cmd +---+ 2 +---+ + | B |---------->| W |---------->| S | + +---+ +---+ +---+ + | + | 4,5 +---+ + ----------->| F | + +---+ + + + This diagram models the commands: + + ABOR, ALLO, DELE, CWD, CDUP, SMNT, HELP, MODE, NOOP, PASV, + QUIT, SITE, PORT, SYST, STAT, RMD, MKD, PWD, STRU, and TYPE. + + + + + + + + + + + + +Postel & Reynolds [Page 54] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The other large group of commands is represented by a very similar + diagram: + + + 3 +---+ + ----------->| E | + | +---+ + | + +---+ cmd +---+ 2 +---+ + | B |---------->| W |---------->| S | + +---+ --->+---+ +---+ + | | | + | | | 4,5 +---+ + | 1 | ----------->| F | + ----- +---+ + + + This diagram models the commands: + + APPE, LIST, NLST, REIN, RETR, STOR, and STOU. + + Note that this second model could also be used to represent the first + group of commands, the only difference being that in the first group + the 100 series replies are unexpected and therefore treated as error, + while the second group expects (some may require) 100 series replies. + Remember that at most, one 100 series reply is allowed per command. + + The remaining diagrams model command sequences, perhaps the simplest + of these is the rename sequence: + + + +---+ RNFR +---+ 1,2 +---+ + | B |---------->| W |---------->| E | + +---+ +---+ -->+---+ + | | | + 3 | | 4,5 | + -------------- ------ | + | | | +---+ + | ------------->| S | + | | 1,3 | | +---+ + | 2| -------- + | | | | + V | | | + +---+ RNTO +---+ 4,5 ----->+---+ + | |---------->| W |---------->| F | + +---+ +---+ +---+ + + + +Postel & Reynolds [Page 55] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The next diagram is a simple model of the Restart command: + + + +---+ REST +---+ 1,2 +---+ + | B |---------->| W |---------->| E | + +---+ +---+ -->+---+ + | | | + 3 | | 4,5 | + -------------- ------ | + | | | +---+ + | ------------->| S | + | | 3 | | +---+ + | 2| -------- + | | | | + V | | | + +---+ cmd +---+ 4,5 ----->+---+ + | |---------->| W |---------->| F | + +---+ -->+---+ +---+ + | | + | 1 | + ------ + + + Where "cmd" is APPE, STOR, or RETR. + + We note that the above three models are similar. The Restart differs + from the Rename two only in the treatment of 100 series replies at + the second stage, while the second group expects (some may require) + 100 series replies. Remember that at most, one 100 series reply is + allowed per command. + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 56] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The most complicated diagram is for the Login sequence: + + + 1 + +---+ USER +---+------------->+---+ + | B |---------->| W | 2 ---->| E | + +---+ +---+------ | -->+---+ + | | | | | + 3 | | 4,5 | | | + -------------- ----- | | | + | | | | | + | | | | | + | --------- | + | 1| | | | + V | | | | + +---+ PASS +---+ 2 | ------>+---+ + | |---------->| W |------------->| S | + +---+ +---+ ---------->+---+ + | | | | | + 3 | |4,5| | | + -------------- -------- | + | | | | | + | | | | | + | ----------- + | 1,3| | | | + V | 2| | | + +---+ ACCT +---+-- | ----->+---+ + | |---------->| W | 4,5 -------->| F | + +---+ +---+------------->+---+ + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 57] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Finally, we present a generalized diagram that could be used to model + the command and reply interchange: + + + ------------------------------------ + | | + Begin | | + | V | + | +---+ cmd +---+ 2 +---+ | + -->| |------->| |---------->| | | + | | | W | | S |-----| + -->| | -->| |----- | | | + | +---+ | +---+ 4,5 | +---+ | + | | | | | | | + | | | 1| |3 | +---+ | + | | | | | | | | | + | | ---- | ---->| F |----- + | | | | | + | | | +---+ + ------------------- + | + | + V + End + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 58] + + + +RFC 959 October 1985 +File Transfer Protocol + + +7. TYPICAL FTP SCENARIO + + User at host U wanting to transfer files to/from host S: + + In general, the user will communicate to the server via a mediating + user-FTP process. The following may be a typical scenario. The + user-FTP prompts are shown in parentheses, '---->' represents + commands from host U to host S, and '<----' represents replies from + host S to host U. + + LOCAL COMMANDS BY USER ACTION INVOLVED + + ftp (host) multics Connect to host S, port L, + establishing control connections. + <---- 220 Service ready . + username Doe USER Doe----> + <---- 331 User name ok, + need password. + password mumble PASS mumble----> + <---- 230 User logged in. + retrieve (local type) ASCII + (local pathname) test 1 User-FTP opens local file in ASCII. + (for. pathname) test.pl1 RETR test.pl1 ----> + <---- 150 File status okay; + about to open data + connection. + Server makes data connection + to port U. + + <---- 226 Closing data connection, + file transfer successful. + type Image TYPE I ----> + <---- 200 Command OK + store (local type) image + (local pathname) file dump User-FTP opens local file in Image. + (for.pathname) >udd>cn>fd STOR >udd>cn>fd ----> + <---- 550 Access denied + terminate QUIT ----> + Server closes all + connections. + +8. CONNECTION ESTABLISHMENT + + The FTP control connection is established via TCP between the user + process port U and the server process port L. This protocol is + assigned the service port 21 (25 octal), that is L=21. + + + +Postel & Reynolds [Page 59] + + + +RFC 959 October 1985 +File Transfer Protocol + + +APPENDIX I - PAGE STRUCTURE + + The need for FTP to support page structure derives principally from + the need to support efficient transmission of files between TOPS-20 + systems, particularly the files used by NLS. + + The file system of TOPS-20 is based on the concept of pages. The + operating system is most efficient at manipulating files as pages. + The operating system provides an interface to the file system so that + many applications view files as sequential streams of characters. + However, a few applications use the underlying page structures + directly, and some of these create holey files. + + A TOPS-20 disk file consists of four things: a pathname, a page + table, a (possibly empty) set of pages, and a set of attributes. + + The pathname is specified in the RETR or STOR command. It includes + the directory name, file name, file name extension, and generation + number. + + The page table contains up to 2**18 entries. Each entry may be + EMPTY, or may point to a page. If it is not empty, there are also + some page-specific access bits; not all pages of a file need have the + same access protection. + + A page is a contiguous set of 512 words of 36 bits each. + + The attributes of the file, in the File Descriptor Block (FDB), + contain such things as creation time, write time, read time, writer's + byte-size, end-of-file pointer, count of reads and writes, backup + system tape numbers, etc. + + Note that there is NO requirement that entries in the page table be + contiguous. There may be empty page table slots between occupied + ones. Also, the end of file pointer is simply a number. There is no + requirement that it in fact point at the "last" datum in the file. + Ordinary sequential I/O calls in TOPS-20 will cause the end of file + pointer to be left after the last datum written, but other operations + may cause it not to be so, if a particular programming system so + requires. + + In fact, in both of these special cases, "holey" files and + end-of-file pointers NOT at the end of the file, occur with NLS data + files. + + + + + +Postel & Reynolds [Page 60] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The TOPS-20 paged files can be sent with the FTP transfer parameters: + TYPE L 36, STRU P, and MODE S (in fact, any mode could be used). + + Each page of information has a header. Each header field, which is a + logical byte, is a TOPS-20 word, since the TYPE is L 36. + + The header fields are: + + Word 0: Header Length. + + The header length is 5. + + Word 1: Page Index. + + If the data is a disk file page, this is the number of that + page in the file's page map. Empty pages (holes) in the file + are simply not sent. Note that a hole is NOT the same as a + page of zeros. + + Word 2: Data Length. + + The number of data words in this page, following the header. + Thus, the total length of the transmission unit is the Header + Length plus the Data Length. + + Word 3: Page Type. + + A code for what type of chunk this is. A data page is type 3, + the FDB page is type 2. + + Word 4: Page Access Control. + + The access bits associated with the page in the file's page + map. (This full word quantity is put into AC2 of an SPACS by + the program reading from net to disk.) + + After the header are Data Length data words. Data Length is + currently either 512 for a data page or 31 for an FDB. Trailing + zeros in a disk file page may be discarded, making Data Length less + than 512 in that case. + + + + + + + + + +Postel & Reynolds [Page 61] + + + +RFC 959 October 1985 +File Transfer Protocol + + +APPENDIX II - DIRECTORY COMMANDS + + Since UNIX has a tree-like directory structure in which directories + are as easy to manipulate as ordinary files, it is useful to expand + the FTP servers on these machines to include commands which deal with + the creation of directories. Since there are other hosts on the + ARPA-Internet which have tree-like directories (including TOPS-20 and + Multics), these commands are as general as possible. + + Four directory commands have been added to FTP: + + MKD pathname + + Make a directory with the name "pathname". + + RMD pathname + + Remove the directory with the name "pathname". + + PWD + + Print the current working directory name. + + CDUP + + Change to the parent of the current working directory. + + The "pathname" argument should be created (removed) as a + subdirectory of the current working directory, unless the "pathname" + string contains sufficient information to specify otherwise to the + server, e.g., "pathname" is an absolute pathname (in UNIX and + Multics), or pathname is something like "" to + TOPS-20. + + REPLY CODES + + The CDUP command is a special case of CWD, and is included to + simplify the implementation of programs for transferring directory + trees between operating systems having different syntaxes for + naming the parent directory. The reply codes for CDUP be + identical to the reply codes of CWD. + + The reply codes for RMD be identical to the reply codes for its + file analogue, DELE. + + The reply codes for MKD, however, are a bit more complicated. A + freshly created directory will probably be the object of a future + + +Postel & Reynolds [Page 62] + + + +RFC 959 October 1985 +File Transfer Protocol + + + CWD command. Unfortunately, the argument to MKD may not always be + a suitable argument for CWD. This is the case, for example, when + a TOPS-20 subdirectory is created by giving just the subdirectory + name. That is, with a TOPS-20 server FTP, the command sequence + + MKD MYDIR + CWD MYDIR + + will fail. The new directory may only be referred to by its + "absolute" name; e.g., if the MKD command above were issued while + connected to the directory , the new subdirectory + could only be referred to by the name . + + Even on UNIX and Multics, however, the argument given to MKD may + not be suitable. If it is a "relative" pathname (i.e., a pathname + which is interpreted relative to the current directory), the user + would need to be in the same current directory in order to reach + the subdirectory. Depending on the application, this may be + inconvenient. It is not very robust in any case. + + To solve these problems, upon successful completion of an MKD + command, the server should return a line of the form: + + 257"" + + That is, the server will tell the user what string to use when + referring to the created directory. The directory name can + contain any character; embedded double-quotes should be escaped by + double-quotes (the "quote-doubling" convention). + + For example, a user connects to the directory /usr/dm, and creates + a subdirectory, named pathname: + + CWD /usr/dm + 200 directory changed to /usr/dm + MKD pathname + 257 "/usr/dm/pathname" directory created + + An example with an embedded double quote: + + MKD foo"bar + 257 "/usr/dm/foo""bar" directory created + CWD /usr/dm/foo"bar + 200 directory changed to /usr/dm/foo"bar + + + + + +Postel & Reynolds [Page 63] + + + +RFC 959 October 1985 +File Transfer Protocol + + + The prior existence of a subdirectory with the same name is an + error, and the server must return an "access denied" error reply + in that case. + + CWD /usr/dm + 200 directory changed to /usr/dm + MKD pathname + 521-"/usr/dm/pathname" directory already exists; + 521 taking no action. + + The failure replies for MKD are analogous to its file creating + cousin, STOR. Also, an "access denied" return is given if a file + name with the same name as the subdirectory will conflict with the + creation of the subdirectory (this is a problem on UNIX, but + shouldn't be one on TOPS-20). + + Essentially because the PWD command returns the same type of + information as the successful MKD command, the successful PWD + command uses the 257 reply code as well. + + SUBTLETIES + + Because these commands will be most useful in transferring + subtrees from one machine to another, carefully observe that the + argument to MKD is to be interpreted as a sub-directory of the + current working directory, unless it contains enough information + for the destination host to tell otherwise. A hypothetical + example of its use in the TOPS-20 world: + + CWD + 200 Working directory changed + MKD overrainbow + 257 "" directory created + CWD overrainbow + 431 No such directory + CWD + 200 Working directory changed + + CWD + 200 Working directory changed to + MKD + 257 "" directory created + CWD + + Note that the first example results in a subdirectory of the + connected directory. In contrast, the argument in the second + example contains enough information for TOPS-20 to tell that the + + +Postel & Reynolds [Page 64] + + + +RFC 959 October 1985 +File Transfer Protocol + + + directory is a top-level directory. Note also that + in the first example the user "violated" the protocol by + attempting to access the freshly created directory with a name + other than the one returned by TOPS-20. Problems could have + resulted in this case had there been an directory; + this is an ambiguity inherent in some TOPS-20 implementations. + Similar considerations apply to the RMD command. The point is + this: except where to do so would violate a host's conventions for + denoting relative versus absolute pathnames, the host should treat + the operands of the MKD and RMD commands as subdirectories. The + 257 reply to the MKD command must always contain the absolute + pathname of the created directory. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 65] + + + +RFC 959 October 1985 +File Transfer Protocol + + +APPENDIX III - RFCs on FTP + + Bhushan, Abhay, "A File Transfer Protocol", RFC 114 (NIC 5823), + MIT-Project MAC, 16 April 1971. + + Harslem, Eric, and John Heafner, "Comments on RFC 114 (A File + Transfer Protocol)", RFC 141 (NIC 6726), RAND, 29 April 1971. + + Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 172 + (NIC 6794), MIT-Project MAC, 23 June 1971. + + Braden, Bob, "Comments on DTP and FTP Proposals", RFC 238 (NIC 7663), + UCLA/CCN, 29 September 1971. + + Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 265 + (NIC 7813), MIT-Project MAC, 17 November 1971. + + McKenzie, Alex, "A Suggested Addition to File Transfer Protocol", + RFC 281 (NIC 8163), BBN, 8 December 1971. + + Bhushan, Abhay, "The Use of "Set Data Type" Transaction in File + Transfer Protocol", RFC 294 (NIC 8304), MIT-Project MAC, + 25 January 1972. + + Bhushan, Abhay, "The File Transfer Protocol", RFC 354 (NIC 10596), + MIT-Project MAC, 8 July 1972. + + Bhushan, Abhay, "Comments on the File Transfer Protocol (RFC 354)", + RFC 385 (NIC 11357), MIT-Project MAC, 18 August 1972. + + Hicks, Greg, "User FTP Documentation", RFC 412 (NIC 12404), Utah, + 27 November 1972. + + Bhushan, Abhay, "File Transfer Protocol (FTP) Status and Further + Comments", RFC 414 (NIC 12406), MIT-Project MAC, 20 November 1972. + + Braden, Bob, "Comments on File Transfer Protocol", RFC 430 + (NIC 13299), UCLA/CCN, 7 February 1973. + + Thomas, Bob, and Bob Clements, "FTP Server-Server Interaction", + RFC 438 (NIC 13770), BBN, 15 January 1973. + + Braden, Bob, "Print Files in FTP", RFC 448 (NIC 13299), UCLA/CCN, + 27 February 1973. + + McKenzie, Alex, "File Transfer Protocol", RFC 454 (NIC 14333), BBN, + 16 February 1973. + + +Postel & Reynolds [Page 66] + + + +RFC 959 October 1985 +File Transfer Protocol + + + Bressler, Bob, and Bob Thomas, "Mail Retrieval via FTP", RFC 458 + (NIC 14378), BBN-NET and BBN-TENEX, 20 February 1973. + + Neigus, Nancy, "File Transfer Protocol", RFC 542 (NIC 17759), BBN, + 12 July 1973. + + Krilanovich, Mark, and George Gregg, "Comments on the File Transfer + Protocol", RFC 607 (NIC 21255), UCSB, 7 January 1974. + + Pogran, Ken, and Nancy Neigus, "Response to RFC 607 - Comments on the + File Transfer Protocol", RFC 614 (NIC 21530), BBN, 28 January 1974. + + Krilanovich, Mark, George Gregg, Wayne Hathaway, and Jim White, + "Comments on the File Transfer Protocol", RFC 624 (NIC 22054), UCSB, + Ames Research Center, SRI-ARC, 28 February 1974. + + Bhushan, Abhay, "FTP Comments and Response to RFC 430", RFC 463 + (NIC 14573), MIT-DMCG, 21 February 1973. + + Braden, Bob, "FTP Data Compression", RFC 468 (NIC 14742), UCLA/CCN, + 8 March 1973. + + Bhushan, Abhay, "FTP and Network Mail System", RFC 475 (NIC 14919), + MIT-DMCG, 6 March 1973. + + Bressler, Bob, and Bob Thomas "FTP Server-Server Interaction - II", + RFC 478 (NIC 14947), BBN-NET and BBN-TENEX, 26 March 1973. + + White, Jim, "Use of FTP by the NIC Journal", RFC 479 (NIC 14948), + SRI-ARC, 8 March 1973. + + White, Jim, "Host-Dependent FTP Parameters", RFC 480 (NIC 14949), + SRI-ARC, 8 March 1973. + + Padlipsky, Mike, "An FTP Command-Naming Problem", RFC 506 + (NIC 16157), MIT-Multics, 26 June 1973. + + Day, John, "Memo to FTP Group (Proposal for File Access Protocol)", + RFC 520 (NIC 16819), Illinois, 25 June 1973. + + Merryman, Robert, "The UCSD-CC Server-FTP Facility", RFC 532 + (NIC 17451), UCSD-CC, 22 June 1973. + + Braden, Bob, "TENEX FTP Problem", RFC 571 (NIC 18974), UCLA/CCN, + 15 November 1973. + + + + +Postel & Reynolds [Page 67] + + + +RFC 959 October 1985 +File Transfer Protocol + + + McKenzie, Alex, and Jon Postel, "Telnet and FTP Implementation - + Schedule Change", RFC 593 (NIC 20615), BBN and MITRE, + 29 November 1973. + + Sussman, Julie, "FTP Error Code Usage for More Reliable Mail + Service", RFC 630 (NIC 30237), BBN, 10 April 1974. + + Postel, Jon, "Revised FTP Reply Codes", RFC 640 (NIC 30843), + UCLA/NMC, 5 June 1974. + + Harvey, Brian, "Leaving Well Enough Alone", RFC 686 (NIC 32481), + SU-AI, 10 May 1975. + + Harvey, Brian, "One More Try on the FTP", RFC 691 (NIC 32700), SU-AI, + 28 May 1975. + + Lieb, J., "CWD Command of FTP", RFC 697 (NIC 32963), 14 July 1975. + + Harrenstien, Ken, "FTP Extension: XSEN", RFC 737 (NIC 42217), SRI-KL, + 31 October 1977. + + Harrenstien, Ken, "FTP Extension: XRSQ/XRCP", RFC 743 (NIC 42758), + SRI-KL, 30 December 1977. + + Lebling, P. David, "Survey of FTP Mail and MLFL", RFC 751, MIT, + 10 December 1978. + + Postel, Jon, "File Transfer Protocol Specification", RFC 765, ISI, + June 1980. + + Mankins, David, Dan Franklin, and Buzz Owen, "Directory Oriented FTP + Commands", RFC 776, BBN, December 1980. + + Padlipsky, Michael, "FTP Unique-Named Store Command", RFC 949, MITRE, + July 1985. + + + + + + + + + + + + + + +Postel & Reynolds [Page 68] + + + +RFC 959 October 1985 +File Transfer Protocol + + +REFERENCES + + [1] Feinler, Elizabeth, "Internet Protocol Transition Workbook", + Network Information Center, SRI International, March 1982. + + [2] Postel, Jon, "Transmission Control Protocol - DARPA Internet + Program Protocol Specification", RFC 793, DARPA, September 1981. + + [3] Postel, Jon, and Joyce Reynolds, "Telnet Protocol + Specification", RFC 854, ISI, May 1983. + + [4] Reynolds, Joyce, and Jon Postel, "Assigned Numbers", RFC 943, + ISI, April 1985. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Postel & Reynolds [Page 69] + + + diff --git a/include/syscalls.h b/include/syscalls.h index 21ef8305..84108fee 100644 --- a/include/syscalls.h +++ b/include/syscalls.h @@ -80,6 +80,9 @@ extern int wait __P((int *statloc)); extern int write __P((int d, void *buf, uint nbytes)); extern int reboot __P((char p1, char p2)); extern int systrace __P((int onoff)); +#if 1 /* Nick */ +extern int sysdebug __P((int onoff)); +#endif extern int unix __P((int callno, ...)); /* ensures IAR doesn't use regparms */ extern long unix_long __P((int callno, ...)); /* ensures IAR doesn't use reg */ diff --git a/lib/libsysb.lib b/lib/libsysb.lib index 6c982515..503b75f4 100644 --- a/lib/libsysb.lib +++ b/lib/libsysb.lib @@ -47,6 +47,7 @@ relsysb\symlink.rel relsysb\sync.rel relsysb\sys0b.rel relsysb\sys1b.rel +relsysb\sysdebug.rel relsysb\systrace.rel relsysb\time.rel relsysb\times.rel diff --git a/lib/libsysl.lib b/lib/libsysl.lib index 1cb0d327..e77395d9 100644 --- a/lib/libsysl.lib +++ b/lib/libsysl.lib @@ -47,6 +47,7 @@ relsysl\symlink.rel relsysl\sync.rel relsysl\sys0l.rel relsysl\sys1l.rel +relsysl\sysdebug.rel relsysl\systrace.rel relsysl\time.rel relsysl\times.rel diff --git a/lib/relsysb/sysdebug.rel b/lib/relsysb/sysdebug.rel new file mode 100644 index 00000000..a64d4cd1 --- /dev/null +++ b/lib/relsysb/sysdebug.rel @@ -0,0 +1,22 @@ +XL4 +H 2 areas 7 global symbols +M _sysdebug +S unix Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 1A flags 0 +S sysdebug Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 D5 21 0C 00 E5 21 +R 00 00 01 00 02 05 02 00 +T 09 00 00 00 07 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 00 00 +T 0F 00 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 00 00 02 09 03 00 +T 16 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 06 01 00 diff --git a/lib/relsysl/sysdebug.rel b/lib/relsysl/sysdebug.rel new file mode 100644 index 00000000..c293814b --- /dev/null +++ b/lib/relsysl/sysdebug.rel @@ -0,0 +1,19 @@ +XL4 +H 2 areas 6 global symbols +M _sysdebug +S ?CL64180L_4_06_L00 Ref00000000 +S unix Ref00000000 +S ?LEAVE_DIRECT_L09 Ref00000000 +S ?ENT_PARM_DIRECT_L09 Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 15 flags 0 +S sysdebug Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 D5 21 0C 00 E5 21 +R 00 00 01 00 02 05 03 00 +T 09 00 00 00 07 00 E5 CD 00 00 00 00 F1 F1 F1 +R 00 00 01 00 02 08 01 00 +T 12 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 02 00 diff --git a/relnotes/20030512.txt b/relnotes/20030512.txt new file mode 100644 index 00000000..d427663b --- /dev/null +++ b/relnotes/20030512.txt @@ -0,0 +1,667 @@ +HYTECH-INTERNATIONAL BV +CMX/UZI TESTRELEASE FOR SOFTWARE DEPARTMENT 030512SD + +MANIFEST + +-rw-r--r-- 1 nick users 8907957 May 12 16:02 uzi.zip + +Please download the files for this release from: +http://www.hytechscales.com/release/nld/test/030512SD + +INTRODUCTION + +Full release of the Hytech CMX/UZI kernel and associated utilities. In the +folders within the zip we have a complete set of binaries, libraries and +source, including pre-built flash card images. Contains a version of Joost's +login and test programs, with X/Y positioning of text slightly modified by +Nick. This operating system release is much more stable than the previous one, +and should be adopted as the platform for application level development. + +The kernel is not substantially changed from the previous 030306SD testrelease, +except for the addition of debugging changes, and a bugfix for a problem +discovered by Joost. The utility programs received a few enhancements and +bugfixes. The most major change is to the filesystem, ie. the folder structure +of the flash card, the scripts which control the building of the card, and the +subsequent loading phases. + +Support for the touchscreen is also improved, with new font files being +available on the flash card for downloading to the touchscreen. These are also +downloaded automatically once, during the initial loading process. The source +image files for the fonts are easily edited, using Photoshop or similar. Using +the new font compiler, we can easily add new typefaces, or arbitrary graphics +and images specific to the application. + +DETAILS OF CHANGES TO THE KERNEL + +1. Extensive support for debuglevels in the kernel. An example of the new +format for debugging code in the kernel is as follows: + + ... + variable = 1; +#if DEBUG >= 2 + dprintf(2, "the value of variable = %d\n", variable); +#endif + switch (variable) + ... + +In this case the programmer wanted to inspect the value of some variable during +a critical operation. To better control when this diagnostic should be +printed, the programmer has selected debuglevel 2, with the minimum debuglevel +being 1, and an increasing debuglevel indicating more and more detailed +information. The dprintf() function is new in this release. It works the same +as kprintf() but the first argument is an integer debuglevel. + +2. We now have both compile-time and run-time selection of the debuglevel. +The compile-time setting is controlled by "/uzi/src/kernel/build.ban" and +should be edited on every line beginning with "iccz80". For example: + +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 +..\libc\memcpy +@if errorlevel 1 goto failure +del memcpy.r01 +as-z80 -l -o memcpy.s01 +@if errorlevel 1 goto failure +If we want to change the debuglevel compiled into kernel's internal "memcpy" +function, we would change the -DDEBUG=2 option to the compiler into something +different. In particular, if the option is set to 0, or omitted entirely, no +debuglevel support is compiled in, and we achieve a smaller kernel executable. +There is no specific limit to what the debuglevel could be set to, other than +the range of an "int", but commonsense limits us to about 10. + +3. Typically the compile-time selection will be the same for all modules, so +you can just load up the file "/uzi/src/kernel/build.ban" into your text editor +and perform a search and replace eg. change "DEBUG=2" into "DEBUG=4" if you +require more detailed debugging output. Then recompile the kernel and load. +You must run "mkboot.bat" then "n.bat" in "/uzi/bin". Nick has configured the +debuglevels in this release, so that most of the system calls will provide some +output at debuglevel 2, with more detailed information (eg. dumps of directory +searches and block cache operations) being available at debuglevels 3 and 4. + +4. Changing the compile-time debuglevel selection will not have any immediate +effect, because debugging output is turned off by default, when the system +boots. At the moment there is no key combination which will allow changing the +debuglevel, (unlike the Ctrl-N command which enables/disables global system +tracing), but instead, requests for kernel debugging output must be compiled +into your programs. The "/uzi/src/libsys/sysdebug.c" module and the +corresponding system call handling in the kernel have been provided to control +this. + +5. For example, when Nick was debugging a problem in the falign() system call, +the offending call was bracketed with sysdebug(4) and sysdebug(0) calls. Thus, +an extensive amount of debugging information was turned on while processing +this one particular system call, with no debugging information being printed at +bootup or after finishing the call. This control is very important because it +can take an impossibly long time to boot the system when full debugging output +is turned on. Similarly the systrace() call is available for your use. + +6. Fixed a bug which was causing problems for Joost's development. This +subtle bug was due to IAR's default of "unsigned char" whereas the original +author of the filesystem code had obviously expected char to default to "signed +char". The bug could be observed in the fork() system call, as it tried to +increment reference counts for all the inherited handles. The kernel thought +all handles were open, and so it went and incremented a byte of memory which +happened to lie in the disk block cache. Strange and subtle corruption of the +disks was the result, manifested in an ECORRUPTFS error down the track. Now +fixed! + +7. Removed support for the original UZI filesystem. Since the 030306SD +release, we have been running on a customised filesystem containing various new +locking fields and bitmaps. These are needed to make the "align" command +perform its magic. The older UZI filesystem was still useable although it +didn't support the "align" command. This meant we wasted a lot of space in the +superblock for the "inode free list" and "block free list", which have now been +replaced by the "inode free bitmap" and "block free bitmap". To make the disks +more compact, all references to the older filesystem in the kernel and +utilities are gone. + +8. Fixed a subtle bug in the alignment procedure, which was caused by a script +"unlinking" itself during running. Normally, in this case, the file remains +intact on disk until the last handle is closed, at which point its space is +reclaimed. This led to an inconsistency between the inode's linkcount and its +reference count, which caused the alignment routine to think the filesystem was +corrupt and bomb out. I decided to modify the i_open routine so a linkcount of +zero is allowed, as long as the in-core reference count is nonzero. + +DETAILS OF CHANGES TO SUPPORT PROGRAMS + +1. The "ls" command no longer relies on the line-wrap performed by your +terminal. Instead the "ls" program counts how many filenames have been +printed, and issues a newline after 5 columns. This works better on broken +terminals such as Hyperterminal and Minicom, which don't correctly perform a +linewrap if the end of the screen was reached by tabbing. Instead they leave +the cursor on the last column of the display ie. just before the tab stop. +This was rather unsightly when viewing the "ls" output, so it's now been fixed. + +2. We now have "banked" versions of the "fsck" and "mkfs" support utilities. +Previously it didn't make sense to run these programs after the system had been +loaded, but we now keep a "banked" version of the "fsck" program in memory all +the time. The startup scripts have been changed so that we always perform a +filesystem check at boot. Errors are fixed automatically, although this might +not be appropriate for the running system. For now, we just want to detect +corruption. Please note: The filesystem is mounted read/write during the +filecheck. This will soon be fixed by Nick, with support for "mount -o +remount,rw". + +3. Removed support for the original UZI filesystem. Since the 030306SD +release, we have been running on a customised filesystem containing various new +locking fields and bitmaps. As mentioned in the section on kernel level +changes, all references to the older filesystem in the kernel and utilities are +gone. This meant quite a few changes to the "mkfs" and "fsck" utilities, in +particular their use of malloc() to allocate memory for the bitmaps. The +switch "-b" to "mkfs" is now redundant and is longer accepted, since the +filesystem is always a bitmapped filesystem. So I also removed "-b" from the +"/uzi/bin/*.bat" scripts. + +4. Added the commands "chown" and "chgrp" to our "ucp" (unix copy) utility. +As mentioned further down, this is needed to set the ownerships for home +directories in the pre-prepared filesystem. Code was lifted out of +"/uzi/src/simple/chown.c" and "/uzi/src/simple/chgrp.c" and inserted into +"/uzi/src/fsutil/ucp.c" and "/uzi/src/fsutil/ucpsub.c". I also added a new +wrapper function "UZIXchown()" for interfacing to the kernel code. Please +note: "ucp" also needs a setting to allow operating on a disk file other than +"uzidisk.dat". Coming soon. We'll probably provide a command line switch, +plus an option to the "root" command. + +5. Added several "fatal error" messages to the Minix shell, in particular +where it does heap and stack management. A subtle incompatibility with the +"uzix" C runtime library was discovered when running a shell script which used +globbing. The opendir() and closedir() functions had used malloc() and free(), +which is not allowed because the Minix shell relies on doing its own heap +management using brk() and sbrk(). Next time the Minix shell tried to push an +object on its stack, it bombed out using abort(), but now we have a proper +error message. The actual bug is fixed by adding functions nick_opendir(), +nick_readdir(), etc. + +6. Changes to the time/date setting in the "/uzio/src/init/init.c" program. +Previously there had been an inconsistency because the date was printed first, +followed by the time, whereas the keyboard input format required the time +first, followed by the date. We've now standardised on "time followed by date" +and the "init.c" code was changed to reflect this. Please follow this example +whenever times and dates must be printed. We now prompt the user to "Please +enter time/date" rather than "Please enter date/time". The "setclock" utility +in "/uzi/src/simple/setclock.c" received a cosmetic change because of this. + +DETAILS OF CHANGES TO THE FILESYSTEM + +1. The "w.sh", "w.bat" and "w.ucp" scripts have now changed to "appinst.sh", +"appinst.bat" and "appinst.ucp". The name better reflects the function of the +scripts, and the folder position of the "w.sh" file on the running system has +also changed. Previously the "w.sh" file was held in /wnd on the flash card, +and copied to /wnd on the memory filesystem. It's now always executed from +/boot on the flash card, or /usr/boot when the card is mounted on /usr as it +normally is. + +2. We now have the following extra directories in "/uzi/bin": +data Joost's screenfiles. Soon to be upgraded to XML. +font Nick's fontfiles. Suitable for copying to /dev/lcdx. +The files from these directories end up in "/wnd" and "/usr/lib/font", +respectively, when the system reaches its running state. The intermediate +directories "/uzi/bin/data" and "/uzi/bin/font" are only present on your PC, +and are referenced from the "*.ucp" scripts. Please feel free to add new +folders under "/uzi/bin" if this helps keep things organised. + +3. We now have a prototype "fstab.txt", which states where the filesystems +should be mounted in the running system. The file "/uzi/bin/fstab.txt" becomes +the "/etc/fstab" of the running system. The file "/uzi/bin/xfstab.txt" is the +"/etc/fstab" of the flash card - this is not normally referenced, but would be +significant if the system is booted directly from the card, ie. if the card is +for some reason mounted as the root filesystem. + +4. We now have a prototype "mtab.txt", which is really a dummy file since it +gets deleted immediately on startup, but the mere existence of the file is +needed to prevent an ugly error message on the initial boot. The file +"/uzi/bin/mtab.txt" becomes the "/etc/mtab" of the running system. The file +"/uzi/bin/xmtab.txt" is the "/etc/mtab" of the flash card - this is not +normally referenced, but would be significant if the system is booted directly +from the card, ie. if the card is for some reason mounted as the root +filesystem. + +5. The prototype group.txt has been edited by Nick. The "users" group has +been removed and we now have groups called "operator" and "manager" instead. +The entries in the /etc/passwd file of the running system are graded in access +level by specifying which "group" the user belongs to. Application programs +should inspect the group id (gid) to see which level of userinterface +functionality should be revealed to the user. + +6. The prototype passwd.txt has been edited by Nick. The "90" user remains +unchanged, so as not to break Joost's login code, but Nick has added several +new users in the style we wish to adopt. For the added users, the Unix user +number is also the Hytech user number which gets entered as the first 2 digits +of the PIN. This should be less confusing, and it means the Unix username can +now be set to arbitrary text. + +user=downingn pass=666 uid=60 gid=100 name=Downing, Nick +user=morsinkj pass=777 uid=70 gid=100 name=Morsink, Joost +user=buijsr pass=888 uid=80 gid=100 name=Buijs, Rob +user=90 pass=999 uid=11 gid=101 (we'll delete this later on) + +7. The format of /etc/inittab has been extended. This is a simple list of +programs which are executed by "init" before any spawning of ttys begins. We +can now specify arguments to the programs to be executed (though there is no +shell-like substitution or quote expansion), and we can specify "silent" +entries, which won't show any indication whether the command could be executed +or not. This is specifically for the new "runonce.sh" functionality, which +will be described below. + +8. The prototype inittab.txt has been edited by Nick. This is the starting +point of the new loading structure, so it should be understood thoroughly +before examining the other scripts. The file /uzi/bin/inittab.txt becomes the +/etc/inittab of the running system, whereas the file /uzi/bin/xinittab.txt +becomes the /etc/inittab of the flash card. As with xfstab.txt, this file is +only significant if the system is booted directly from the flash card (not the +default way). + +The commands in the new /uzi/bin/inittab.txt are as follows: + +# Hytech initialisation table for running system + +@/etc/rc.d/rc.sysinit +@/etc/rc.d/rc.runonce +/bin/grlogin + +The first 2 lines are required for the loading system and should not be +changed. The @ indicates that the entries are silent, so if you want to +disable the functionality of the "rc.runonce" or "rc.sysinit" scripts, just +make sure those scripts are not loaded onto the flash card. The last line +refers to Joost's front-end login program, and can be changed to whatever is +most appropriate for a particular customer. + +9. The scripts "rc.sysinit" and "rc.runonce" have been added to the system by +Nick. These reside in a special folder called "/etc/rc.d" (runlevel control +directory). For better compatibility with DOS style text editors the master +files are "/uzi/bin/sysinit.rc" and "/uzi/bin/runonce.rc" and the renaming +takes place inside the scripts which build the flash card filesystem: +"/uzi/bin/n.ucp" and "/uzi/bin/mkboot.ucp". The scripts "rc.sysinit" and +"rc.runonce" are copied into the RAM filesystem's "/etc/rc.d" folder during the +initial boot. + +The commands in the new /uzi/bin/sysinit.rc are as follows: + +#!/bin/sh + +echo "/etc/rc.d/rc.sysinit" +fsck -y /dev/hd0 + +The "echo" command compensates for the fact that the script is invoked by a +"silent" inittab entry. The string is output on the console (SERIAL 1) so we +can see which scripts are being executed. The "fsck" command causes a startup +filecheck on every bootstrap. + +The commands in the new /uzi/bin/runonce.rc are as follows: + +#!/bin/sh + +echo "/etc/rc.d/rc.runonce" +rm -v /etc/rc.d/rc.runonce +exec /usr/boot/runonce.sh + +As before, the "echo" command just allows us to see which script is being +executed. After this, we execute an "rm -v" command which deletes the +executing script "rc.runonce" from the RAM filesystem. Thus, on a subsequent +bootstrap, the "silent" inittab entry referring to the non-existent file +/etc/rc.d/rc.runonce will have no effect. We then proceed to do any required +first-time initialisation, for both operating system and application programs. + +This file, which gets deleted after the first bootstrap, has deliberately been +kept as short as possible. Thus, not so much information is lost when we +delete the file. The real initialisation sequence is executed from the flash +card, by invoking a further script "/usr/boot/runonce.sh". This is +deliberately not copied to the RAM filesystem, for reasons which will be +outlined further down. The initialisation can of course be repeated at any +time, by executing /usr/boot/runonce.sh from the console. (eg. to re-download +font files). + +10. As outlined in the description for "rc.runonce", the real initialisation +of the system is performed by a further script held on the flash card in /boot. +The master file for this further script is "/uzi/bin/runonce.sh", which appears +as "/usr/boot/runonce.sh" after the flash card has been mounted on /usr, as it +usually is. However, this script should not be modified, except by Nick, since +a deliberate hook has been provided in the new "appinst.sh". + +The commands in the new /uzi/bin/runonce.sh are as follows: + +#!/bin/sh + +echo "" +echo "Installing LCD character sets" +echo "" + +cp -v /usr/lib/font/lcd0.cmd /dev/lcd0 +cp -v /usr/lib/font/lcd1.cmd /dev/lcd1 + +umask 022 +mkdir /wnd +exec /usr/boot/appinst.sh + +Notice that we are now trying to be more user-friendly by printing a few blank +lines and a large banner saying what we are doing. This script is executed on +initial loading, and it takes a while to execute. So we want to tell the user +what we're doing. This only appears on the console for now, but we could later +extend it to display on the touchscreen also. + +This "runonce.sh" file is intended to contain operating system initialisation, +which will probably be extended further by Nick (eg. initialising a hostname, +setting up an IP address, downloading to the thermal printer and the Cognitive +printer, etc). For the moment, we just download the required command files to +the touchscreen and customer display. Once this is done, we proceed to the +application-dependent initialisation by executing the new +"/usr/boot/appinst.sh", formerly "/usr/wnd/w.sh". + +11. In addition to the renaming of "w.sh" to "appinst.sh", Nick has edited the +contents. The new installation sequence for the application software is as +follows: + +#!/bin/sh + +echo "" +echo "Installing application program" +echo "" + +rm -f /wnd/*.scr +cp -v /usr/boot/inst/wnd/*.scr /wnd + +rm -f /bin/grlogin /bin/test +cp -v /usr/boot/inst/bin/grlogin /usr/boot/inst/bin/test /bin +align -v /bin/grlogin /bin/test + +echo "" +echo "Finished installing application" +echo "" + +Notice that we remove the "/wnd/*.scr" files before copying them afresh. This +might be important if files are renamed or deleted. However we could probably +optimise the install by copying only changed files. Nick will look into this +in due course. For the moment, we also have to delete any aligned executables +before copying the replacements in. This is described in "030306SD test +readme.txt". Hence the "rm -f /bin/grlogin /bin/test" command. + +Please note that this relies on having a "/boot/inst/wnd" directory on the +flash card which contains the "*.scr" files, and a separate "/boot/inst/bin" +directory with the binaries. Nick has added these new directories by editing +the script "appinst.ucp", formerly "w.ucp". Of course the layout and filenames +are completely up to the developer, so the files "appinst.*" will probably need +to be changed as the application development progresses. + +The function of the new "/boot/inst" folder (which appears as "/usr/boot/inst" +after the flash card has been mounted on /usr as it normally is), is somewhat +analogous to the already existing "/boot/skel" folder that contains the +skeleton filesystem. For early development we used "/wnd" and "/boot/skel/wnd" +but this has been superseded by the new "/boot/inst". Therefore we keep the +operating system files separate from the application files. This will become +important if we want to distribute pre-built flash card images of the system. + +12. Home directories are now created. In the previous release, there was an +oversight meaning that the sample home directory "/home/90" was not writeable +by the user 90, and so could not be used as a home directory. In this release, +the "mkramfs.sh" script is not yet fixed, since it's not operational. So if +you are using home directories, you must boot via the filesystem self-extractor +described in the next section. Fortunately this is already selected for you. +The home directories in the pre-prepared filesystem have the correct ownership, +set by the new "chown" and "chgrp" commands in our "ucp" (unix copy) utility. + +DETAILS OF THE FILESYSTEM SELF-EXTRACTOR + +1. The loading phase, from a completely cold boot, is normally controlled by +the "/boot/mkramfs.sh" script, at least until the change described here. +Because the loading from cold was taking an excessively long time (4 or 5 +minutes), we now initialise the filesystem from a pre-prepared image, rather +than using scripts to copy the required files. This means less redundant +copying, and we get the benefit of data compression as well. + +2. The "mkramfs.sh" script is no longer referenced, although we can revert to +the earlier loading method at any time. The same applies to the "/boot/skel" +folder on the flash card. The "mkramfs.sh" and "/boot/skel" files have been +updated with this release, and will continue to be updated by Nick, although +they're not directly used. To select the earlier loading method, edit the file +"/uzi/bin/n.bat" and refer to the "@rem" comments. + +3. The new filesystem image is prepared with the usual "mkfs.exe" and +"ucp.exe" programs. For details please see the new "/uzi/bin/mkboot.bat" and +"/uzi/bin/mkboot.ucp" scripts prepared by Nick. After we have prepared the +"uzidisk.dat" image for a filesystem of the correct size (768k), with the +correct locking options, and the unallocated space not written, we then +compress the disk image using "gzip" to produce the "/uzi/bin/uzboot.gz" +compressed filesystem image. This might eventually be distributed in pre-built +form by Nick. + +4. Since the bootstrap is controlled by a fixed size area (2 kbytes is +reserved from the 768 kbyte disk for the "gboot.bin" boot loader), it was not +possible to include unzipping code in the boot loader. Instead, the +"uzboot.gz" image is packaged into a self extracting executable, which looks +like a kernel for boot loading purposes. This packaging is done by +concatenating the "uzboot.ldr" executable with the "uzboot.gz" data to produce +"uzboot.bin". For the source code of "uzboot.ldr", please see the files +"/uzi/src/gboot/uz*.asm". + +5. The boot loader did not need to be changed to accommodate the new self +extractor. Instead, the self extractor masquerades as a kernel, and then +reboots once its job is done. By the time of the reboot, the filesystem has +been unzipped and we execute the (real) kernel found on the pre-prepared +filesystem. Because of the new requirement for two different kernels (one for +the initial loading, and one for building into the pre-prepared filesystem), we +now keep separate copies in the "/boot" and "/boot/skel/boot" folders of the +flash card. + +6. This means the "mkramfs.sh" script is simplified, since it now copies +everything from "/boot/skel" instead of needing an extra step to copy the +kernel from "/boot". However, the process of building the flash card is +slightly complicated because of the different kernels needed. While the flash +card is being built, we grab "uzboot.bin" (the initial kernel) and rename it to +"kernel.bin" for the "/boot" folder of the flash card. Then we grab +"kernel.bin" (the real kernel) and place it in the "/boot/skel/boot" folder of +the card. + +7. The "/boot/skel/boot/kernel.bin" would be the kernel copied into "/boot" of +the RAM filesystem during the initial copying of files controlled by +"/boot/mkramfs.sh". However, since we now have the kernel self-extractor, the +"/boot/skel/boot/kernel.bin" file is not referenced, and instead we must ensure +the correct (real) kernel has been preloaded into the "uzboot.bin" filesystem +that was built with "/uzi/bin/mkboot.bat". Fortunately, this doesn't need any +renaming, but it means you must run "mkboot.bat" before running "n.bat". + +8. Another tricky step is the generation of the "/boot/checksum" and +"/boot/crc" files on the flash card. These are needed for compatibility with +the Hytech version 5.544+ EPROM. We use the old "crc.com" program from a POS +distribution for this purpose. In this operating system release, the +"/uzi/bin/n.bat" command is modified so that the checksum files are always +regenerated when the flash card is rebuilt. This should be more reliable, but +you need to be aware that software releases in "/nlddl" would get rudely +overwritten each time you run "/uzi/bin/n.bat". This is a limitation of the +"crc" program and will be fixed soon. + +9. The "/boot/checksum" file controls loading by the Hytech version 5.544+ +EPROM. It will read this file, from the hard coded location of "/boot", and +then read any further files specified here. For the current setup we request +the EPROM to load "/boot/kernel.bin" and "/boot/boot.bin", these end up as +"A:KERNEL.BIN" and "A:BOOT.BIN" after being downloaded by the EPROM code. The +"/boot/crc" file is a hardlinked copy of "/boot/checksum", and this is needed +if we are forced to boot from an earlier version EPROM by downloading the +version 5.544+ RAM operating system first. This was needed by Nick in +developing the new EPROM. + +10. The filename "BOOT.BIN" is special and allows our custom boot loader to +get control when the EPROM reboots after downloading the needed files from +"/boot" on the flash card. The filename "KERNEL.BIN" is arbitrary, although it +must match the filename expected by the BOOT.BIN code. This could be changed +by editing "/uzi/src/gboot.asm". However, I did not want to change the boot +loader, so instead I specified that "uzboot.bin" be renamed to "kernel.bin". +Later we could clean this up, but I wanted to keep supporting the old style +bootstrap copying of files for the moment. Hence, we are stuck with the name +"KERNEL.BIN". + +11. The maximum size of the "uzboot.bin" image is 256 kbytes. This is because +it gets loaded at physical addresses C:0000 thru F:FFFF during the initial +boot. The filesystem contained within "uzboot.bin" could potentially be up to +512 kbytes in size, and this gets loaded at physical addresses 4:0000 thru +B:FFFF. We could also increase these limits by overwriting the compressed data +during decompression, but I didn't think it was necessary for now. The +unzipper is based on the "ZIPFILE.INC" decompressor from the 5.529+ EPROM, with +modifications to handle "gzip" rather than "pkzip" format. Most "gzip" options +are not supported, so we use the commandline "gzip --best < infile > outfile" +to compress. + +12. When the self-extractor has done its work and the filesystem has been +unpacked to the terminal's RAM drive, we reboot and execute the +"/etc/rc.d/rc.sysinit" and "/etc/rc.d/rc.runonce" scripts that have been +preloaded onto the gzipped filesystem. It is expected that system +initialisation performed by "rc.sysinit" will be specific to the kernel +unpacked. However, the first-time initialisation triggered by "rc.runonce" is +dependent on the application, and might be changed independent of any kernel +changes. So the first-time initialisation is really done by "/boot/runonce.sh" +from the flash card, and it is expected that the "rc.runonce" script will not +need to be changed. Thus the "uzboot.bin" file can be distributed +independently of the application specific files, and should be very stable. + +DETAILS OF SUPPORT FOR THE TOUCHSCREEN + +1. The new character set compiler suite is built in "/uzi/src/mkfont" and the +executables are placed in "/uzi/src/bin". As mentioned in "030306SD test +readme.txt", the folder "/uzi/src/bin" must be placed in your path for correct +building of the software. The new executables are "bmp2txt.exe", "txt2chs.exe" +and "chs2cmd.exe". We perform the conversion in 3 stages. Intermediate files +of "setxx.txt" and "setxx.chs" are built before creating the final "lcdx.cmd" +file containing all character sets for a particular device. + +2. The new fonts themselves are built in "/uzi/src/font" and the font files +"lcdx.cmd" are placed in "/uzi/bin/font". The fonts are easily editable by +changing "setxx.bmp" with some kind of image editor, such as Photoshop or The +Gimp. After editing the source image files, just run "n.bat" in +"/uzi/src/font" and then rebuild the flash card. If the assignment of fonts to +devices must be changed, you must edit "n.bat". Look for the lines containing: + +chs2cmd set01.chs 1 +chs2cmd set02.chs 2 +chs2cmd set03.chs 3 +chs2cmd set04.chs 4 +chs2cmd set05.chs 5 +chs2cmd set06.chs 6 + +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd+set06.cmd lcd0.cmd +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd lcd1.cmd + +This indicates that the operator display (lcd0) is to receive fonts 1 thru 6. +The customer display (lcd1) is to receive fonts 1 thru 5. The difference is +necessary because of the reduced RAM available on the customer display +controller (32 kbytes rather than 128 kbytes). At the moment, the font numbers +are chosen so that they are identical on both devices. However this may not +always be possible in the future. If some kind of font translation needs to be +performed, the building sequence could be changed as follows: + +chs2cmd set01.chs 1 +chs2cmd set02.chs 2 +chs2cmd set03.chs 3 +chs2cmd set04.chs 4 +chs2cmd set05.chs 5 +chs2cmd set06.chs 6 +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd+set06.cmd lcd0.cmd + +chs2cmd set07.chs 1 +chs2cmd set08.chs 2 +chs2cmd set09.chs 3 +chs2cmd set10.chs 4 +chs2cmd set11.chs 5 +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd lcd1.cmd + +In this example, the operator display assignments are unchanged, but the 5 +fonts loaded to the customer display are completely new fonts designed for the +purpose. The bitmaps would be "set07.bmp" through "set11.bmp" but the fonts +would be selected as fonts 1 thru 5. We need this translation because the +customer display is only capable of addressing 1 thru 5. + +3. The purpose of the initial step, performed by "bmp2txt.exe", is to analyse +the user's bitmap and try to locate the lines of text within the bitmap. We +then try to determine the baseline of the text using a weighted average of the +pixel contents of each line. Finally we break each line of text into +individual characters, and spit them out individually in an intermediate text +format. Here is the lowercase "j" from "/uzi/src/font/set02.txt": + +at 103,67 size 4,10 + + #### + +###### + #### + #### + #### +__####__ + #### +#### + +The header line, "at 103,67 size 4,10" tells us that the character was located +at location 103,67 in the user's bitmap and the detected size of the character +is 4 pixels wide by 10 pixels high. The height of all characters in each line +of text gathered from the bitmap should be the same, since they are determined +as a group. Similarly, the relative position of the baseline (shown above by +the underline characters) should be the same for the entire line of text. + +If the user's bitmap is split into several lines of text, they might be output +with different heights eg. all characters on the line containing the "$" sign +might be output a few pixels taller, because of the ascender on the "$" coming +up a bit higher than the other characters. This doesn't matter though, because +the subsequent step, performed by "txt2chs.exe", will trim all characters to +size. In this case the "j" would be trimmed to size 3,9. + +As you can see from the example above, the text files are output in "double +width", so that 2 consecutive "#" signs indicate a single dark pixel. Two +consecutive spaces or underlines indicate a single light pixel. This is simply +to aid readability. Also, a fixed amount of inter-character space is appended +to each character on the right. In this case it is one single pixel, as can be +seen by the fact that the underline extends 2 columns to the right of the +character. The converter "bmp2txt.exe" always appends one single pixel of +space. + +4. The purpose of the subsequent step, performed by "txt2chs.exe", is to +examine the individual character bitmaps found in the previous step, along with +their size and baseline information, then trim each character to its exact +extents. In the process, "offset" X/Y values are generated, which tell the +touchscreen or customer display exactly where the trimmed bitmap should be +drawn, relative to a given cursor position. Finally the bitmaps are padded to +a multiple of 8 bits horizontally, and stored in a compact binary format. + +The binary format of the "*.chs" files is determined by the AVR code running in +the touchscreen and customer display modules, and can't be easily changed. +Briefly, the format consists of 16 dummy header bytes, followed by an index for +256 characters, followed by a few miscellaneous byte-sized fields. The index +consists of 256 "word" sized pointers into the data (specified relative to the +starting position of the index). The touchscreen or customer display follows +the index pointer corresponding to the ASCII value of a character to be drawn, +to find the character data (X/Y size bytes followed by a raw bitmap array). + +In the miscellaneous data area immediately following the index, we have a few +fields that can be determined automatically (for example the X and Y cell size +when fixed spacing is being used), and a few fields which need to be specified +via the command line to "bmp2chs.exe". This includes inter-character and +inter-line space, which can be set to arbitrary values. For example in the +subsequent processing of the "j" example we use the command: + +txt2chs set02.txt 1 3 +This means that the input file "/uzi/src/font/set02.txt" should be converted to +the output file "/uzi/src/font/set02.chs" with an inter-character spacing of 1 +and an inter-line spacing of 3. Given that a normal uppercase character in the +set has height 8, we end up with a total cell height of 8 + 3 = 11 pixels, of +which 3 will usually be blank separators. The height of an uppercase character +is determined by a clever "median" algorithm in which the heights of all +characters are post processed after being trimmed to size. In general we can +determine the cell width and height automatically, but the inter-character and +inter-line space need to be adjusted manually, to visually pleasing values. + +5. If arbitrary images are to be added into the character sets, for example +the customer's logo, or icons representing letters or parcels, they should be +added by extending the font bitmap vertically and placing the image on a line +by itself. This way any awkwardly shaped images will not upset the normal +process of determining the baselines and heights of text. The system will +still assign a baseline intelligently, by ignoring any narrow protrusions from +the bottom of the image, but this will not upset the baselines of other +characters. In some cases we DO want this interaction, for example if you +define a set of 4 "arrow" characters pointing in different directions, they +should become a single "line" of text in the font. Thus they are assigned a +common baseline and will drawn aligned with each other. + +6. Please note that Nick is working on a utility to extract the widths of +characters from the "*.chs" files and generate a smaller binary format for use +by Joost's GUI and other applications. Sorry, this didn't make it into the +current release. I thought it was more important to document the changes to +date and get them out the door. The new width tables will be generated using a +modification of the public domain "mkfont" utility downloaded by Nick. Thus +they will be compatible with text formatters like "groff", "ditroff" and "man". + diff --git a/silly.bat b/silly.bat deleted file mode 100644 index 1b8cb908..00000000 --- a/silly.bat +++ /dev/null @@ -1,3 +0,0 @@ -del uzi.zip -pkzipc -add=update -path=relative -recurse -excl=build -excl=build-b -excl=build-l -excl=*.s01 -excl=*.lst -excl=*.i86 -excl=*.rst -excl=*.obj -excl=*.pdb -excl=*.ilk silly * -xcopy silly.zip \\darkstar\public\uzi.backup.zip diff --git a/src/as-z80/as-z80.exe b/src/as-z80/as-z80.exe deleted file mode 100644 index 632a28d5..00000000 Binary files a/src/as-z80/as-z80.exe and /dev/null differ diff --git a/src/as-z80/as-z80.map b/src/as-z80/as-z80.map deleted file mode 100644 index fd58a664..00000000 --- a/src/as-z80/as-z80.map +++ /dev/null @@ -1,533 +0,0 @@ - as-z80 - - Timestamp is 3e5dbb0b (Thu Feb 27 18:15:23 2003) - - Preferred load address is 00400000 - - Start Length Name Class - 0001:00000000 00011801H .text CODE - 0002:00000000 000005d1H .rdata DATA - 0002:000005d1 00000000H .edata DATA - 0003:00000000 00000104H .CRT$XCA DATA - 0003:00000104 00000104H .CRT$XCZ DATA - 0003:00000208 00000104H .CRT$XIA DATA - 0003:0000030c 00000109H .CRT$XIC DATA - 0003:00000418 00000104H .CRT$XIZ DATA - 0003:0000051c 00000104H .CRT$XPA DATA - 0003:00000620 00000104H .CRT$XPX DATA - 0003:00000724 00000104H .CRT$XPZ DATA - 0003:00000828 00000104H .CRT$XTA DATA - 0003:0000092c 00000104H .CRT$XTZ DATA - 0003:00000a30 00002d2aH .data DATA - 0003:0000375c 00003568H .bss DATA - 0004:00000000 00000014H .idata$2 DATA - 0004:00000014 00000014H .idata$3 DATA - 0004:00000028 000000fcH .idata$4 DATA - 0004:00000124 000000fcH .idata$5 DATA - 0004:00000220 00000444H .idata$6 DATA - - Address Publics by Value Rva+Base Lib:Object - - 0001:000003d0 _expr 004013d0 f asexpr.obj - 0001:0000085b _getop 0040185b f asexpr.obj - 0001:00000892 _getnop 00401892 f asexpr.obj - 0001:000008e6 _getop_binary 004018e6 f asexpr.obj - 0001:00000965 _getop_unary 00401965 f asexpr.obj - 0001:000009ff _getop_srch 004019ff f asexpr.obj - 0001:00000aa3 _absexpr 00401aa3 f asexpr.obj - 0001:00000ad6 _term 00401ad6 f asexpr.obj - 0001:000015cc _digit 004025cc f asexpr.obj - 0001:00001681 _abscheck 00402681 f asexpr.obj - 0001:000016b0 _is_abs 004026b0 f asexpr.obj - 0001:000016d2 _oprio 004026d2 f asexpr.obj - 0001:0000173f _clrexpr 0040273f f asexpr.obj - 0001:0000176c _exprmasks 0040276c f asexpr.obj - 0001:00001d10 _getid 00402d10 f aslex.obj - 0001:00001dcd _getst 00402dcd f aslex.obj - 0001:00001e55 _getnb 00402e55 f aslex.obj - 0001:00001e76 _get 00402e76 f aslex.obj - 0001:00001ea4 _unget 00402ea4 f aslex.obj - 0001:00001ec8 _getmap 00402ec8 f aslex.obj - 0001:00002015 _getline 00403015 f aslex.obj - 0001:000021f4 _more 004031f4 f aslex.obj - 0001:00002231 _endline 00403231 f aslex.obj - 0001:00002370 _list 00403370 f aslist.obj - 0001:00002c6f _list1 00403c6f f aslist.obj - 0001:00002e99 _list2 00403e99 f aslist.obj - 0001:00002fb6 _slew 00403fb6 f aslist.obj - 0001:00003096 _lstsym 00404096 f aslist.obj - 0001:00003f70 _main 00404f70 f asmain.obj - 0001:00004548 _asexit 00405548 f asmain.obj - 0001:00004614 _asmbl 00405614 f asmain.obj - 0001:00005874 _afile 00406874 f asmain.obj - 0001:0000591a _afilex 0040691a f asmain.obj - 0001:00005a81 _fndidx 00406a81 f asmain.obj - 0001:00005af7 _newdot 00406af7 f asmain.obj - 0001:00005b43 _phase 00406b43 f asmain.obj - 0001:00005b68 _usage 00406b68 f asmain.obj - 0001:000062d0 _outab 004072d0 f asout.obj - 0001:000062e3 _outaw 004072e3 f asout.obj - 0001:000062f6 _outa3b 004072f6 f asout.obj - 0001:00006309 _outa4b 00407309 f asout.obj - 0001:0000631c _outaxb 0040731c f asout.obj - 0001:00006372 _outatxb 00407372 f asout.obj - 0001:000064d1 _outrb 004074d1 f asout.obj - 0001:000064e8 _outrw 004074e8 f asout.obj - 0001:000064ff _outr3b 004074ff f asout.obj - 0001:00006516 _outr4b 00407516 f asout.obj - 0001:0000652d _outrxb 0040752d f asout.obj - 0001:0000674b _outdp 0040774b f asout.obj - 0001:00006853 _outall 00407853 f asout.obj - 0001:00006877 _outdot 00407877 f asout.obj - 0001:0000692c _outchk 0040792c f asout.obj - 0001:000069ce _outbuf 004079ce f asout.obj - 0001:00006a7d _outgsd 00407a7d f asout.obj - 0001:00006d4a _outarea 00407d4a f asout.obj - 0001:00006e0a _outsym 00407e0a f asout.obj - 0001:00006f43 _out 00407f43 f asout.obj - 0001:00007013 _out_lb 00408013 f asout.obj - 0001:00007056 _out_lw 00408056 f asout.obj - 0001:0000706d _out_l3b 0040806d f asout.obj - 0001:00007084 _out_l4b 00408084 f asout.obj - 0001:0000709b _out_lxb 0040809b f asout.obj - 0001:00007267 _out_rw 00408267 f asout.obj - 0001:00007303 _out_txb 00408303 f asout.obj - 0001:00007462 _lobyte 00408462 f asout.obj - 0001:0000746f _hibyte 0040846f f asout.obj - 0001:0000747f _thrdbyte 0040847f f asout.obj - 0001:0000748f _frthbyte 0040848f f asout.obj - 0001:0000749f _outr11 0040849f f asout.obj - 0001:0000760f _outr19 0040860f f asout.obj - 0001:00007cb0 _err 00408cb0 f assubr.obj - 0001:00007d25 _diag 00408d25 f assubr.obj - 0001:00007e7f _rerr 00408e7f f assubr.obj - 0001:00007e8e _aerr 00408e8e f assubr.obj - 0001:00007e9d _qerr 00408e9d f assubr.obj - 0001:00007eac _geterr 00408eac f assubr.obj - 0001:00007fb0 _syminit 00408fb0 f assym.obj - 0001:000080b5 _alookup 004090b5 f assym.obj - 0001:000080f5 _mlookup 004090f5 f assym.obj - 0001:0000814d _slookup 0040914d f assym.obj - 0001:000081ae _lookup 004091ae f assym.obj - 0001:000082a1 _symglob 004092a1 f assym.obj - 0001:000082fb _allglob 004092fb f assym.obj - 0001:0000835f _symeq 0040935f f assym.obj - 0001:00008404 _hash 00409404 f assym.obj - 0001:00008465 _strsto 00409465 f assym.obj - 0001:000084e4 _new 004094e4 f assym.obj - 0001:00008680 _addr 00409680 f z80adr.obj - 0001:00008949 _admode 00409949 f z80adr.obj - 0001:000089b8 _srch 004099b8 f z80adr.obj - 0001:00008a7d _any 00409a7d f z80adr.obj - 0001:00008bc0 _machine 00409bc0 f z80mch.obj - 0001:00009c59 _genop 0040ac59 f z80mch.obj - 0001:00009d73 _gixiy 0040ad73 f z80mch.obj - 0001:00009de9 _mchpcr 0040ade9 f z80mch.obj - 0001:00009e2b _comma 0040ae2b f z80mch.obj - 0001:00009e44 _minit 0040ae44 f z80mch.obj - 0001:0000a230 _strlen 0040b230 f LIBC:strlen.obj - 0001:0000a2b0 _strcpy 0040b2b0 f LIBC:strcat.obj - 0001:0000a2c0 _strcat 0040b2c0 f LIBC:strcat.obj - 0001:0000a3a0 _fclose 0040b3a0 f LIBC:fclose.obj - 0001:0000a3f6 _fgets 0040b3f6 f LIBC:fgets.obj - 0001:0000a44d __flsbuf 0040b44d f LIBC:_flsbuf.obj - 0001:0000a562 _fprintf 0040b562 f LIBC:fprintf.obj - 0001:0000a5a0 _strcmp 0040b5a0 f LIBC:strcmp.obj - 0001:0000a624 _malloc 0040b624 f LIBC:malloc.obj - 0001:0000a636 __nh_malloc 0040b636 f LIBC:malloc.obj - 0001:0000a662 __heap_alloc 0040b662 f LIBC:malloc.obj - 0001:0000a698 _rewind 0040b698 f LIBC:rewind.obj - 0001:0000a6ec ___initstdio 0040b6ec f LIBC:_file.obj - 0001:0000a791 ___endstdio 0040b791 f LIBC:_file.obj - 0001:0000a7a8 __setjmp3 0040b7a8 f LIBC:setjmp3.obj - 0001:0000a823 __cinit 0040b823 f LIBC:crt0dat.obj - 0001:0000a850 _exit 0040b850 f LIBC:crt0dat.obj - 0001:0000a861 __exit 0040b861 f LIBC:crt0dat.obj - 0001:0000a872 __cexit 0040b872 f LIBC:crt0dat.obj - 0001:0000a881 __c_exit 0040b881 f LIBC:crt0dat.obj - 0001:0000a943 __fsopen 0040b943 f LIBC:fopen.obj - 0001:0000a963 _fopen 0040b963 f LIBC:fopen.obj - 0001:0000a980 _strncpy 0040b980 f LIBC:strncpy.obj - 0001:0000aa80 _strrchr 0040ba80 f LIBC:strrchr.obj - 0001:0000aaa8 _longjmp 0040baa8 f LIBC:longjmp.obj - 0001:0000ab21 _sprintf 0040bb21 f LIBC:sprintf.obj - 0001:0000ab73 _mainCRTStartup 0040bb73 f LIBC:crt0.obj - 0001:0000ac52 __amsg_exit 0040bc52 f LIBC:crt0.obj - 0001:0000ac9b _free 0040bc9b f LIBC:free.obj - 0001:0000acca __close 0040bcca f LIBC:close.obj - 0001:0000ad7d __freebuf 0040bd7d f LIBC:_freebuf.obj - 0001:0000ada8 _fflush 0040bda8 f LIBC:fflush.obj - 0001:0000ade3 __flush 0040bde3 f LIBC:fflush.obj - 0001:0000ae3f __flushall 0040be3f f LIBC:fflush.obj - 0001:0000aeb5 __filbuf 0040beb5 f LIBC:_filbuf.obj - 0001:0000af8e __lseek 0040bf8e f LIBC:lseek.obj - 0001:0000b028 __ioinit 0040c028 f LIBC:ioinit.obj - 0001:0000b1d3 __ioterm 0040c1d3 f LIBC:ioinit.obj - 0001:0000b1f6 __write 0040c1f6 f LIBC:write.obj - 0001:0000b3a3 __getbuf 0040c3a3 f LIBC:_getbuf.obj - 0001:0000b3e7 __isatty 0040c3e7 f LIBC:isatty.obj - 0001:0000b40d __stbuf 0040c40d f LIBC:_sftbuf.obj - 0001:0000b49a __ftbuf 0040c49a f LIBC:_sftbuf.obj - 0001:0000b4d7 __output 0040c4d7 f LIBC:output.obj - 0001:0000bce1 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 0040cce1 f LIBC:handler.obj - 0001:0000bcf1 ?_query_new_handler@@YAP6AHI@ZXZ 0040ccf1 f LIBC:handler.obj - 0001:0000bcf7 __callnewh 0040ccf7 f LIBC:handler.obj - 0001:0000bd12 __heap_init 0040cd12 f LIBC:heapinit.obj - 0001:0000bd4e __heap_term 0040cd4e f LIBC:heapinit.obj - 0001:0000bdc3 __get_sbh_threshold 0040cdc3 f LIBC:sbheap.obj - 0001:0000bdc9 __set_sbh_threshold 0040cdc9 f LIBC:sbheap.obj - 0001:0000bde0 ___sbh_heap_init 0040cde0 f LIBC:sbheap.obj - 0001:0000be1e ___sbh_find_block 0040ce1e f LIBC:sbheap.obj - 0001:0000be49 ___sbh_free_block 0040ce49 f LIBC:sbheap.obj - 0001:0000c174 ___sbh_alloc_block 0040d174 f LIBC:sbheap.obj - 0001:0000c47d ___sbh_alloc_new_region 0040d47d f LIBC:sbheap.obj - 0001:0000c52e ___sbh_alloc_new_group 0040d52e f LIBC:sbheap.obj - 0001:0000c629 ___sbh_resize_block 0040d629 f LIBC:sbheap.obj - 0001:0000c91f ___sbh_heapmin 0040d91f f LIBC:sbheap.obj - 0001:0000c9f0 ___sbh_heap_check 0040d9f0 f LIBC:sbheap.obj - 0001:0000cd1f _calloc 0040dd1f f LIBC:calloc.obj - 0001:0000cd9c __fcloseall 0040dd9c f LIBC:closeall.obj - 0001:0000cdf4 __global_unwind2 0040ddf4 f LIBC:exsup.obj - 0001:0000ce36 __local_unwind2 0040de36 f LIBC:exsup.obj - 0001:0000ce8e __NLG_Return2 0040de8e f LIBC:exsup.obj - 0001:0000ce9e __abnormal_termination 0040de9e f LIBC:exsup.obj - 0001:0000cec1 __NLG_Notify1 0040dec1 f LIBC:exsup.obj - 0001:0000ceca __NLG_Notify 0040deca f LIBC:exsup.obj - 0001:0000cedd __NLG_Dispatch 0040dedd f LIBC:exsup.obj - 0001:0000cee2 __openfile 0040dee2 f LIBC:_open.obj - 0001:0000d052 __getstream 0040e052 f LIBC:stream.obj - 0001:0000d0ca __rt_probe_read4@4 0040e0ca f LIBC:sehsupp.obj - 0001:0000d12f __XcptFilter 0040e12f f LIBC:winxfltr.obj - 0001:0000d2b3 __setenvp 0040e2b3 f LIBC:stdenvp.obj - 0001:0000d36c __setargv 0040e36c f LIBC:stdargv.obj - 0001:0000d5b9 ___crtGetEnvironmentStringsA 0040e5b9 f LIBC:a_env.obj - 0001:0000d6f4 __except_handler3 0040e6f4 f LIBC:exsup3.obj - 0001:0000d7b1 __seh_longjmp_unwind@4 0040e7b1 f LIBC:exsup3.obj - 0001:0000d7cc __FF_MSGBANNER 0040e7cc f LIBC:crt0msg.obj - 0001:0000d805 __NMSG_WRITE 0040e805 f LIBC:crt0msg.obj - 0001:0000d958 __GET_RTERRMSG 0040e958 f LIBC:crt0msg.obj - 0001:0000d989 __dosmaperr 0040e989 f LIBC:dosmap.obj - 0001:0000d9f0 __alloc_osfhnd 0040e9f0 f LIBC:osfinfo.obj - 0001:0000da85 __set_osfhnd 0040ea85 f LIBC:osfinfo.obj - 0001:0000dafc __free_osfhnd 0040eafc f LIBC:osfinfo.obj - 0001:0000db76 __get_osfhandle 0040eb76 f LIBC:osfinfo.obj - 0001:0000dbb3 __open_osfhandle 0040ebb3 f LIBC:osfinfo.obj - 0001:0000dc50 __commit 0040ec50 f LIBC:commit.obj - 0001:0000dca7 __read 0040eca7 f LIBC:read.obj - 0001:0000de9d _wctomb 0040ee9d f LIBC:wctomb.obj - 0001:0000df10 __aulldiv 0040ef10 f LIBC:ulldiv.obj - 0001:0000df80 __aullrem 0040ef80 f LIBC:ullrem.obj - 0001:0000e000 _memmove 0040f000 f LIBC:memmove.obj - 0001:0000e340 _memset 0040f340 f LIBC:memset.obj - 0001:0000e398 __open 0040f398 f LIBC:open.obj - 0001:0000e3af __sopen 0040f3af f LIBC:open.obj - 0001:0000e668 __setmbcp 0040f668 f LIBC:mbctype.obj - 0001:0000ea2c __getmbcp 0040fa2c f LIBC:mbctype.obj - 0001:0000ea3c ___initmbctable 0040fa3c f LIBC:mbctype.obj - 0001:0000ea60 _memcpy 0040fa60 f LIBC:memcpy.obj - 0001:0000ed95 ___crtMessageBoxA 0040fd95 f LIBC:crtmbox.obj - 0001:0000ee1e __fptrap 0040fe1e f LIBC:crt0fp.obj - 0001:0000ee27 __chsize 0040fe27 f LIBC:chsize.obj - 0001:0000ef6d ___crtLCMapStringA 0040ff6d f LIBC:a_map.obj - 0001:0000f1bc ___crtGetStringTypeA 004101bc f LIBC:a_str.obj - 0001:0000f305 __setmode 00410305 f LIBC:setmode.obj - 0001:0000f380 __alloca_probe 00410380 f LIBC:chkstk.obj - 0001:0000f380 __chkstk 00410380 f LIBC:chkstk.obj - 0001:0000f3b0 _HeapAlloc@12 004103b0 f kernel32:KERNEL32.dll - 0001:0000f3b6 _ExitProcess@4 004103b6 f kernel32:KERNEL32.dll - 0001:0000f3bc _TerminateProcess@8 004103bc f kernel32:KERNEL32.dll - 0001:0000f3c2 _GetCurrentProcess@0 004103c2 f kernel32:KERNEL32.dll - 0001:0000f3c8 _GetCommandLineA@0 004103c8 f kernel32:KERNEL32.dll - 0001:0000f3ce _GetVersion@0 004103ce f kernel32:KERNEL32.dll - 0001:0000f3d4 _HeapFree@12 004103d4 f kernel32:KERNEL32.dll - 0001:0000f3da _GetLastError@0 004103da f kernel32:KERNEL32.dll - 0001:0000f3e0 _CloseHandle@4 004103e0 f kernel32:KERNEL32.dll - 0001:0000f3e6 _SetFilePointer@16 004103e6 f kernel32:KERNEL32.dll - 0001:0000f3ec _SetHandleCount@4 004103ec f kernel32:KERNEL32.dll - 0001:0000f3f2 _GetStdHandle@4 004103f2 f kernel32:KERNEL32.dll - 0001:0000f3f8 _GetFileType@4 004103f8 f kernel32:KERNEL32.dll - 0001:0000f3fe _GetStartupInfoA@4 004103fe f kernel32:KERNEL32.dll - 0001:0000f404 _WriteFile@20 00410404 f kernel32:KERNEL32.dll - 0001:0000f40a _HeapDestroy@4 0041040a f kernel32:KERNEL32.dll - 0001:0000f410 _HeapCreate@12 00410410 f kernel32:KERNEL32.dll - 0001:0000f416 _VirtualFree@12 00410416 f kernel32:KERNEL32.dll - 0001:0000f41c _VirtualAlloc@16 0041041c f kernel32:KERNEL32.dll - 0001:0000f422 _HeapReAlloc@16 00410422 f kernel32:KERNEL32.dll - 0001:0000f428 _IsBadWritePtr@8 00410428 f kernel32:KERNEL32.dll - 0001:0000f42e _RtlUnwind@16 0041042e f kernel32:KERNEL32.dll - 0001:0000f434 _UnhandledExceptionFilter@4 00410434 f kernel32:KERNEL32.dll - 0001:0000f43a _GetModuleFileNameA@12 0041043a f kernel32:KERNEL32.dll - 0001:0000f440 _FreeEnvironmentStringsA@4 00410440 f kernel32:KERNEL32.dll - 0001:0000f446 _FreeEnvironmentStringsW@4 00410446 f kernel32:KERNEL32.dll - 0001:0000f44c _WideCharToMultiByte@32 0041044c f kernel32:KERNEL32.dll - 0001:0000f452 _GetEnvironmentStrings@0 00410452 f kernel32:KERNEL32.dll - 0001:0000f458 _GetEnvironmentStringsW@0 00410458 f kernel32:KERNEL32.dll - 0001:0000f45e _SetStdHandle@8 0041045e f kernel32:KERNEL32.dll - 0001:0000f464 _FlushFileBuffers@4 00410464 f kernel32:KERNEL32.dll - 0001:0000f46a _ReadFile@20 0041046a f kernel32:KERNEL32.dll - 0001:0000f470 _CreateFileA@28 00410470 f kernel32:KERNEL32.dll - 0001:0000f476 _GetCPInfo@8 00410476 f kernel32:KERNEL32.dll - 0001:0000f47c _GetACP@0 0041047c f kernel32:KERNEL32.dll - 0001:0000f482 _GetOEMCP@0 00410482 f kernel32:KERNEL32.dll - 0001:0000f488 _GetProcAddress@8 00410488 f kernel32:KERNEL32.dll - 0001:0000f48e _LoadLibraryA@4 0041048e f kernel32:KERNEL32.dll - 0001:0000f494 _SetEndOfFile@4 00410494 f kernel32:KERNEL32.dll - 0001:0000f49a _MultiByteToWideChar@24 0041049a f kernel32:KERNEL32.dll - 0001:0000f4a0 _LCMapStringA@24 004104a0 f kernel32:KERNEL32.dll - 0001:0000f4a6 _LCMapStringW@24 004104a6 f kernel32:KERNEL32.dll - 0001:0000f4ac _GetStringTypeA@20 004104ac f kernel32:KERNEL32.dll - 0001:0000f4b2 _GetStringTypeW@16 004104b2 f kernel32:KERNEL32.dll - 0002:0000002c ___lookuptable 0041302c LIBC:output.obj - 0002:00000088 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 00413088 LIBC:output.obj - 0002:00000098 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 00413098 LIBC:output.obj - 0002:000000ac ??_C@_0P@GGKG@runtime?5error?5?$AA@ 004130ac LIBC:crt0msg.obj - 0002:000000bc ??_C@_02PIMC@?$AN?6?$AA@ 004130bc LIBC:crt0msg.obj - 0002:000000c0 ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 004130c0 LIBC:crt0msg.obj - 0002:000000d0 ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 004130d0 LIBC:crt0msg.obj - 0002:000000e0 ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 004130e0 LIBC:crt0msg.obj - 0002:000000f0 ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 004130f0 LIBC:crt0msg.obj - 0002:00000118 ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 00413118 LIBC:crt0msg.obj - 0002:00000150 ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 00413150 LIBC:crt0msg.obj - 0002:00000188 ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 00413188 LIBC:crt0msg.obj - 0002:000001b0 ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 004131b0 LIBC:crt0msg.obj - 0002:000001e8 ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 004131e8 LIBC:crt0msg.obj - 0002:00000214 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 00413214 LIBC:crt0msg.obj - 0002:00000238 ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 00413238 LIBC:crt0msg.obj - 0002:00000268 ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 00413268 LIBC:crt0msg.obj - 0002:00000294 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 00413294 LIBC:crt0msg.obj - 0002:000002b8 ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 004132b8 LIBC:crt0msg.obj - 0002:000002e4 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 004132e4 LIBC:crt0msg.obj - 0002:00000310 ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 00413310 LIBC:crt0msg.obj - 0002:00000338 ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 00413338 LIBC:crt0msg.obj - 0002:00000360 ??_C@_02JJJH@?6?6?$AA@ 00413360 LIBC:crt0msg.obj - 0002:00000364 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 00413364 LIBC:crt0msg.obj - 0002:00000380 ??_C@_03NAME@?4?4?4?$AA@ 00413380 LIBC:crt0msg.obj - 0002:00000384 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 00413384 LIBC:crt0msg.obj - 0002:0000039c ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 0041339c LIBC:crtmbox.obj - 0002:000003b0 ??_C@_0BA@GILI@GetActiveWindow?$AA@ 004133b0 LIBC:crtmbox.obj - 0002:000003c0 ??_C@_0M@PKCK@MessageBoxA?$AA@ 004133c0 LIBC:crtmbox.obj - 0002:000003cc ??_C@_0L@HKL@user32?4dll?$AA@ 004133cc LIBC:crtmbox.obj - 0002:000003d8 ??_C@_01A@?$AA?$AA@ 004133d8 LIBC:a_map.obj - 0002:000003dc ??_C@_13A@?$AA?$AA?$AA?$AA@ 004133dc LIBC:a_map.obj - 0003:00000000 ___xc_a 00414000 LIBC:crt0init.obj - 0003:00000104 ___xc_z 00414104 LIBC:crt0init.obj - 0003:00000208 ___xi_a 00414208 LIBC:crt0init.obj - 0003:00000418 ___xi_z 00414418 LIBC:crt0init.obj - 0003:0000051c ___xp_a 0041451c LIBC:crt0init.obj - 0003:00000724 ___xp_z 00414724 LIBC:crt0init.obj - 0003:00000828 ___xt_a 00414828 LIBC:crt0init.obj - 0003:0000092c ___xt_z 0041492c LIBC:crt0init.obj - 0003:00000a30 _symtbl 00414a30 asdata.obj - 0003:00000a40 _aretbl 00414a40 asdata.obj - 0003:00000a50 _sym 00414a50 asdata.obj - 0003:00000a88 _area 00414a88 asdata.obj - 0003:00000aa0 _ctype 00414aa0 asdata.obj - 0003:00000b20 _ccase 00414b20 asdata.obj - 0003:00001214 _usetxt 00415214 asmain.obj - 0003:00001614 _txtp 00415614 asout.obj - 0003:00001618 _relp 00415618 asout.obj - 0003:000017c4 _errors 004157c4 assubr.obj - 0003:00001b18 _R8 00415b18 z80adr.obj - 0003:00001b58 _R8X 00415b58 z80adr.obj - 0003:00001b70 _R16 00415b70 z80adr.obj - 0003:00001ba8 _R16X 00415ba8 z80adr.obj - 0003:00001bc0 _CND 00415bc0 z80adr.obj - 0003:00001c44 _cpu 00415c44 z80ext.obj - 0003:00001c48 _dsft 00415c48 z80ext.obj - 0003:00001c74 _imtab 00415c74 z80mch.obj - 0003:00001c78 _mne 00415c78 z80pst.obj - 0003:00002c30 __iob 00416c30 LIBC:_file.obj - 0003:00002eb0 __aexit_rtn 00416eb0 LIBC:crt0.obj - 0003:00002eb4 ___app_type 00416eb4 LIBC:crt0.obj - 0003:00002eb8 ___badioinfo 00416eb8 LIBC:ioinit.obj - 0003:00002ec0 ___nullstring 00416ec0 LIBC:output.obj - 0003:00002ec4 ___wnullstring 00416ec4 LIBC:output.obj - 0003:00002ec8 __amblksiz 00416ec8 LIBC:heapinit.obj - 0003:00002ecc ___sbh_threshold 00416ecc LIBC:sbheap.obj - 0003:00002ed0 __NLG_Destination 00416ed0 LIBC:exsup.obj - 0003:00002ee0 __XcptActTab 00416ee0 LIBC:winxfltr.obj - 0003:00002f58 __First_FPE_Indx 00416f58 LIBC:winxfltr.obj - 0003:00002f5c __Num_FPE 00416f5c LIBC:winxfltr.obj - 0003:00002f60 __XcptActTabCount 00416f60 LIBC:winxfltr.obj - 0003:00002f64 __fpecode 00416f64 LIBC:winxfltr.obj - 0003:00003160 __cfltcvt_tab 00417160 LIBC:cmiscdat.obj - 0003:00003178 __pctype 00417178 LIBC:ctype.obj - 0003:0000317c __pwctype 0041717c LIBC:ctype.obj - 0003:00003180 __ctype 00417180 LIBC:ctype.obj - 0003:00003490 ___mb_cur_max 00417490 LIBC:nlsdata1.obj - 0003:00003494 ___decimal_point 00417494 LIBC:nlsdata1.obj - 0003:00003498 ___decimal_point_length 00417498 LIBC:nlsdata1.obj - 0003:00003784 _hd64 00417784 - 0003:000037a0 _fflag 004177a0 - 0003:000037a4 _hilo 004177a4 z80ext.obj - 0003:000037a8 __cflush 004177a8 LIBC:_file.obj - 0003:000037ac _errno 004177ac LIBC:crt0dat.obj - 0003:000037b0 __doserrno 004177b0 LIBC:crt0dat.obj - 0003:000037b4 __umaskval 004177b4 LIBC:crt0dat.obj - 0003:000037b8 __osver 004177b8 LIBC:crt0dat.obj - 0003:000037bc __winver 004177bc LIBC:crt0dat.obj - 0003:000037c0 __winmajor 004177c0 LIBC:crt0dat.obj - 0003:000037c4 __winminor 004177c4 LIBC:crt0dat.obj - 0003:000037c8 ___argc 004177c8 LIBC:crt0dat.obj - 0003:000037cc ___argv 004177cc LIBC:crt0dat.obj - 0003:000037d0 ___wargv 004177d0 LIBC:crt0dat.obj - 0003:000037d4 __environ 004177d4 LIBC:crt0dat.obj - 0003:000037d8 ___initenv 004177d8 LIBC:crt0dat.obj - 0003:000037dc __wenviron 004177dc LIBC:crt0dat.obj - 0003:000037e0 ___winitenv 004177e0 LIBC:crt0dat.obj - 0003:000037e4 __pgmptr 004177e4 LIBC:crt0dat.obj - 0003:000037e8 __wpgmptr 004177e8 LIBC:crt0dat.obj - 0003:000037ec __exitflag 004177ec LIBC:crt0dat.obj - 0003:000037f0 __C_Termination_Done 004177f0 LIBC:crt0dat.obj - 0003:000037f4 __C_Exit_Done 004177f4 LIBC:crt0dat.obj - 0003:000037f8 __aenvptr 004177f8 LIBC:crt0.obj - 0003:000037fc __wenvptr 004177fc LIBC:crt0.obj - 0003:00003800 ___error_mode 00417800 LIBC:crt0.obj - 0003:00003804 __stdbuf 00417804 LIBC:_sftbuf.obj - 0003:0000380c __newmode 0041780c LIBC:_newmode.obj - 0003:00003810 ?_pnhHeap@@3P6AHI@ZA 00417810 LIBC:handler.obj - 0003:00003814 __pxcptinfoptrs 00417814 LIBC:winxfltr.obj - 0003:00003920 __adbgmsg 00417920 LIBC:crt0msg.obj - 0003:00003924 __commode 00417924 LIBC:ncommode.obj - 0003:00003938 ___lc_handle 00417938 LIBC:nlsdata2.obj - 0003:00003950 ___lc_codepage 00417950 LIBC:nlsdata2.obj - 0003:00003954 ___lc_collate_cp 00417954 LIBC:nlsdata2.obj - 0003:00003958 __fmode 00417958 LIBC:txtmode.obj - 0003:00003964 _tlevel 00417964 - 0003:00003968 _symp 00417968 - 0003:0000396c _inpfil 0041796c - 0003:00003970 _rel 00417970 - 0003:00003980 _txt 00417980 - 0003:00003990 _afp 00417990 - 0003:00003994 _lmode 00417994 - 0003:00003998 _laddr 00417998 - 0003:0000399c _cpt 0041799c - 0003:000039a0 _module 004179a0 - 0003:000039f4 _fuzz 004179f4 - 0003:000039f8 _incfil 004179f8 - 0003:000039fc _cfile 004179fc - 0003:00003a00 _afn 00417a00 - 0003:00003b00 _cbt 00417b00 - 0003:00003d00 _symhash 00417d00 - 0003:00003e00 _mnehash 00417e00 - 0003:00003f00 _srcfn 00417f00 - 0003:00004500 _srcfp 00418500 - 0003:00004518 _lfp 00418518 - 0003:0000451c _gflag 0041851c - 0003:00004520 _erb 00418520 - 0003:000045a4 _a_mask 004185a4 - 0003:000045a8 _line 004185a8 - 0003:000045ac _lop 004185ac - 0003:000045b0 _ofp 004185b0 - 0003:000045b4 _zflag 004185b4 - 0003:000045b8 _oflag 004185b8 - 0003:000045bc _areap 004185bc - 0003:000045c0 _incfn 004185c0 - 0003:00004bc0 _incfp 00418bc0 - 0003:00004bd8 _tfp 00418bd8 - 0003:00004bdc _page 00418bdc - 0003:00004be0 _ifp 00418be0 - 0003:00004bf8 _pass 00418bf8 - 0003:00004bfc _sflag 00418bfc - 0003:00004c00 _srcline 00418c00 - 0003:00004c18 _eb 00418c18 - 0003:00004c1c _cp 00418c1c - 0003:00004c20 _sfp 00418c20 - 0003:00004c38 _aserr 00418c38 - 0003:00004c3c _ep 00418c3c - 0003:00004c40 _stb 00418c40 - 0003:00004c90 _wflag 00418c90 - 0003:00004c94 _ip 00418c94 - 0003:00004c98 _lflag 00418c98 - 0003:00004c9c _a_bytes 00418c9c - 0003:00004ca0 _cb 00418ca0 - 0003:00004d20 _ib 00418d20 - 0003:00004da0 _afntmp 00418da0 - 0003:00004ea0 _tb 00418ea0 - 0003:00004ef0 _afptmp 00418ef0 - 0003:00004ef4 _pflag 00418ef4 - 0003:00004ef8 _aflag 00418ef8 - 0003:00004efc _s_mask 00418efc - 0003:00004f00 _incline 00418f00 - 0003:00004f18 _xflag 00418f18 - 0003:00004f1c _radix 00418f1c - 0003:00004f20 _ifcnd 00418f20 - 0003:00004f4c _flevel 00418f4c - 0003:00004f50 _v_mask 00418f50 - 0003:00004f60 _jump_env 00418f60 - 0003:00004fa0 _iflvl 00418fa0 - 0003:0000552c ___mbcodepage 0041952c - 0003:000055b0 ___mbulinfo 004195b0 - 0003:000055bc ___ismbcodepage 004195bc - 0003:000055c0 __mbcasemap 004195c0 - 0003:000056c0 __mbctype 004196c0 - 0003:000057c4 ___mblcid 004197c4 - 0003:000057c8 ___sbh_sizeHeaderList 004197c8 - 0003:000057d8 ___sbh_indGroupDefer 004197d8 - 0003:000057dc ___sbh_pHeaderScan 004197dc - 0003:000057e0 ___sbh_pHeaderDefer 004197e0 - 0003:000057e4 ___sbh_cntHeaderList 004197e4 - 0003:000057e8 ___sbh_pHeaderList 004197e8 - 0003:000057ec __crtheap 004197ec - 0003:00005800 ___pioinfo 00419800 - 0003:0000593c __nhandle 0041993c - 0003:00005940 __acmdln 00419940 - 0003:0000594c __setjmpexused 0041994c - 0003:00005958 ___env_initialized 00419958 - 0003:00005968 ___mbctype_initialized 00419968 - 0003:0000596c ___onexitend 0041996c - 0003:00005970 ___onexitbegin 00419970 - 0003:00005974 __FPinit 00419974 - 0003:00005978 ___piob 00419978 - 0003:00005cc0 __bufin 00419cc0 - 0003:00006cc0 __nstream 0041acc0 - 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 0041b000 kernel32:KERNEL32.dll - 0004:00000014 __NULL_IMPORT_DESCRIPTOR 0041b014 kernel32:KERNEL32.dll - 0004:00000124 __imp__UnhandledExceptionFilter@4 0041b124 kernel32:KERNEL32.dll - 0004:00000128 __imp__ExitProcess@4 0041b128 kernel32:KERNEL32.dll - 0004:0000012c __imp__TerminateProcess@8 0041b12c kernel32:KERNEL32.dll - 0004:00000130 __imp__GetCurrentProcess@0 0041b130 kernel32:KERNEL32.dll - 0004:00000134 __imp__GetCommandLineA@0 0041b134 kernel32:KERNEL32.dll - 0004:00000138 __imp__GetVersion@0 0041b138 kernel32:KERNEL32.dll - 0004:0000013c __imp__HeapFree@12 0041b13c kernel32:KERNEL32.dll - 0004:00000140 __imp__GetLastError@0 0041b140 kernel32:KERNEL32.dll - 0004:00000144 __imp__CloseHandle@4 0041b144 kernel32:KERNEL32.dll - 0004:00000148 __imp__SetFilePointer@16 0041b148 kernel32:KERNEL32.dll - 0004:0000014c __imp__SetHandleCount@4 0041b14c kernel32:KERNEL32.dll - 0004:00000150 __imp__GetStdHandle@4 0041b150 kernel32:KERNEL32.dll - 0004:00000154 __imp__GetFileType@4 0041b154 kernel32:KERNEL32.dll - 0004:00000158 __imp__GetStartupInfoA@4 0041b158 kernel32:KERNEL32.dll - 0004:0000015c __imp__WriteFile@20 0041b15c kernel32:KERNEL32.dll - 0004:00000160 __imp__HeapDestroy@4 0041b160 kernel32:KERNEL32.dll - 0004:00000164 __imp__HeapCreate@12 0041b164 kernel32:KERNEL32.dll - 0004:00000168 __imp__VirtualFree@12 0041b168 kernel32:KERNEL32.dll - 0004:0000016c __imp__VirtualAlloc@16 0041b16c kernel32:KERNEL32.dll - 0004:00000170 __imp__HeapReAlloc@16 0041b170 kernel32:KERNEL32.dll - 0004:00000174 __imp__IsBadWritePtr@8 0041b174 kernel32:KERNEL32.dll - 0004:00000178 __imp__RtlUnwind@16 0041b178 kernel32:KERNEL32.dll - 0004:0000017c __imp__HeapAlloc@12 0041b17c kernel32:KERNEL32.dll - 0004:00000180 __imp__GetModuleFileNameA@12 0041b180 kernel32:KERNEL32.dll - 0004:00000184 __imp__FreeEnvironmentStringsA@4 0041b184 kernel32:KERNEL32.dll - 0004:00000188 __imp__FreeEnvironmentStringsW@4 0041b188 kernel32:KERNEL32.dll - 0004:0000018c __imp__WideCharToMultiByte@32 0041b18c kernel32:KERNEL32.dll - 0004:00000190 __imp__GetEnvironmentStrings@0 0041b190 kernel32:KERNEL32.dll - 0004:00000194 __imp__GetEnvironmentStringsW@0 0041b194 kernel32:KERNEL32.dll - 0004:00000198 __imp__SetStdHandle@8 0041b198 kernel32:KERNEL32.dll - 0004:0000019c __imp__FlushFileBuffers@4 0041b19c kernel32:KERNEL32.dll - 0004:000001a0 __imp__ReadFile@20 0041b1a0 kernel32:KERNEL32.dll - 0004:000001a4 __imp__CreateFileA@28 0041b1a4 kernel32:KERNEL32.dll - 0004:000001a8 __imp__GetCPInfo@8 0041b1a8 kernel32:KERNEL32.dll - 0004:000001ac __imp__GetACP@0 0041b1ac kernel32:KERNEL32.dll - 0004:000001b0 __imp__GetOEMCP@0 0041b1b0 kernel32:KERNEL32.dll - 0004:000001b4 __imp__GetProcAddress@8 0041b1b4 kernel32:KERNEL32.dll - 0004:000001b8 __imp__LoadLibraryA@4 0041b1b8 kernel32:KERNEL32.dll - 0004:000001bc __imp__SetEndOfFile@4 0041b1bc kernel32:KERNEL32.dll - 0004:000001c0 __imp__MultiByteToWideChar@24 0041b1c0 kernel32:KERNEL32.dll - 0004:000001c4 __imp__LCMapStringA@24 0041b1c4 kernel32:KERNEL32.dll - 0004:000001c8 __imp__LCMapStringW@24 0041b1c8 kernel32:KERNEL32.dll - 0004:000001cc __imp__GetStringTypeA@20 0041b1cc kernel32:KERNEL32.dll - 0004:000001d0 __imp__GetStringTypeW@16 0041b1d0 kernel32:KERNEL32.dll - 0004:000001d4 \177KERNEL32_NULL_THUNK_DATA 0041b1d4 kernel32:KERNEL32.dll - - entry point at 0001:0000ab73 - diff --git a/src/avr/2313def.inc b/src/avr/2313def.inc new file mode 100644 index 00000000..969a3c56 --- /dev/null +++ b/src/avr/2313def.inc @@ -0,0 +1,232 @@ +;*************************************************************************** +;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y +;* +;* Number :AVR000 +;* File Name :"2313def.inc" +;* Title :Register/Bit Definitions for the AT90S2313 +;* Date :98.05.22 +;* Version :1.22 +;* Support telephone :+47 72 88 43 88 (ATMEL Norway) +;* Support fax :+47 72 88 43 99 (ATMEL Norway) +;* Support E-Mail :avr@atmel.com +;* Target MCU :AT90S2313 +;* +;* DESCRIPTION +;* When including this file in the assembly program file, all I/O register +;* names and I/O register bit names appearing in the data book can be used. +;* +;* The Register names are represented by their hexadecimal addresses. +;* +;* The Register Bit names are represented by their bit number (0-7). +;* +;* Please observe the difference in using the bit names with instructions +;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" +;* (skip if bit in register set/cleared). The following example illustrates +;* this: +;* +;* in r16,PORTB ;read PORTB latch +;* sbr r16,(1< + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + diff --git a/src/avr/CFLASHV0.HEX b/src/avr/CFLASHV0.HEX new file mode 100644 index 00000000..30751b36 --- /dev/null +++ b/src/avr/CFLASHV0.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F445E0EB +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE849B94FEB54227724559841 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE809B900E90AB933244424AA +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742B2ACEC +:00000001FF diff --git a/src/avr/CFLASHV1.HEX b/src/avr/CFLASHV1.HEX new file mode 100644 index 00000000..be960cc1 --- /dev/null +++ b/src/avr/CFLASHV1.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F445E0EB +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE849B94FEB54227724559841 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE809B900E90AB933244424AA +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742BAACE4 +:00000001FF diff --git a/src/avr/CFLASHV2.HEX b/src/avr/CFLASHV2.HEX new file mode 100644 index 00000000..a62f4788 --- /dev/null +++ b/src/avr/CFLASHV2.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F443E0ED +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE549B94FEB54227724559844 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE509B900E90AB933244424AD +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742B2ACEC +:00000001FF diff --git a/src/avr/CHSET00.WIN b/src/avr/CHSET00.WIN new file mode 100644 index 00000000..2217627d Binary files /dev/null and b/src/avr/CHSET00.WIN differ diff --git a/src/avr/CS64V4.HEX b/src/avr/CS64V4.HEX new file mode 100644 index 00000000..e5b357b9 --- /dev/null +++ b/src/avr/CS64V4.HEX @@ -0,0 +1,385 @@ +:020000020000FC +:100000000DC087C387C3189518951895189518952E +:1000100082C31895189527C711C762C702E00EBFA3 +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300009BF0BBF08EF01BB08EB02BB0FE107BB19 +:100040000FEF0ABB04BB00270BBB03E008BB00E0BB +:1000500005BB00E2B02E1FE519B910E91AB9442416 +:10006000552422243324EE246624CC24552750938F +:100070000101509323015093430150934401509345 +:100080004501969AE0E0F0E0A8953197E9F7979856 +:1000900000E0B8D0B7D002E4B1D000E2B3D000E0C5 +:1000A000B1D003E4ABD000E8A9D000E9A7D000E0CC +:1000B000A9D0A8D004E2A2D000EBA0D0E0E0F8E004 +:1000C00000E0A2D03197E1F702EB9AD008E996D090 +:1000D000979A789410E3B9D2CF93DF93C4D2BF91AB +:1000E000AF911BD5212F1D2F12950DD31217B1F4EF +:1000F000119613D5212F1D2F06D3121779F41196BF +:100100000CD5212F1C2F1295FED2121739F41196FF +:1001100004D5212F1C2FF7D2121749F1E6E7F2E19F +:10012000A6E6B3E0D8E1D0930201C0D0D0E8C0E0A9 +:10013000DBBBC39AC398D0930101F89435B33C2735 +:1001400030783C27789435BBC8950BBAC29ABA98D8 +:10015000C1980000C19AC298BA9A119741F031969D +:10016000C3951C2F1F7349F7C054D395E1CF20E1ED +:100170002093F30020E22093F40028E12093F5007F +:1001800021D6112710935101EE27FF271EEF109360 +:10019000FD001BEA1093FC0022E01BD21C7F109391 +:1001A000FE0023E016D21093FF001091FE00209174 +:1001B000FF001A380DEF200720F01B3A0FEF200741 +:1001C00030F01EEF1093FF0010E41093FE001EEFBE +:1001D00019BD1BEA18BD1CEF1DBD1EEC1CBD10E5B2 +:1001E0001FBD11E01EBD00E003BF04E008BF09BF52 +:1001F0000AE005BF00EC0ABF0BBF92C219D006C0CF +:1002000011D004C015D001C00DD0A8980BBB0000C0 +:1002100000000000F894C1980000000000007894ED +:10022000C19A08950F930BD003FFFDCF0F9108954E +:100230000F9305D000FD01FFFCCF0F910895A89A00 +:1002400000E00ABBF894C098000000000000000025 +:10025000C09A09B378940F930FEF0ABB0F910895DA +:1002600002E00EBF0FE50DBF1FE7B122AF98C498A3 +:10027000409101014BBBC39AC39850E05FBD5EBD86 +:1002800094989598C298BA9A96989798C098C19859 +:100290005FEF5ABB50E05BBB50E059BF5BBF5FE113 +:1002A00051BD57E151BD5AE655BF889508957894E0 +:1002B0001FEDE12210E01EBB1FBB62D21B3129F1F2 +:1002C000B3FC0DC0103258F4183009F4FEC01D30D4 +:1002D00009F40DC11A3009F48BC0173041F7B2FC94 +:1002E00012C0103381F4C091F300D091F40020913A +:1002F000F500CC5FDD4FF89435B320FB36F97894E8 +:1003000035BBF1D4102D72D2D2CF3AD21B3139F392 +:100310001E3209F475C11F3209F44FC01F3309F4AE +:1003200084C1113409F4A6C0123409F427C213346D +:1003300009F404C1133609F451C9143409F4EBC0AB +:10034000153409F4D8C0163409F408C1163609F476 +:1003500051C9173409F49EC0183409F463C918361A +:1003600009F454C91B3409F461C01C3409F4D4C124 +:100370001D3409F42BC01E3409F4FCC0103509F4F7 +:1003800097C0123509F4DCC0133509F4D2C0153515 +:1003900009F4F4C1163519F410E2E12AF7C0173553 +:1003A00009F4ECC1183509F4B8C11A3509F4E2C1F1 +:1003B000103310F01A3398F07ACFE2D110FF03C057 +:1003C00014E0B12A74CF1BEFB12271CFD9D1103311 +:1003D00021F4F89400E4B02A43CF69CFD1D135D1CC +:1003E000C0E1C093F300D093F4002093F5005FCFF9 +:1003F00001D05DCF0F92C091F300D091F400209115 +:10040000F500DE5FC395F89435B320FB36F9789498 +:1004100035BB69D4182F100D100D1A95103418F033 +:10042000EED00F900895800D0F900895979800E0FA +:10043000E9DEE8DE02E4E2DE00E2E4DE00E0E2DE45 +:1004400003E4DCDE00E8DADE00E9D8DE00E0DADE34 +:10045000D9DE04E2D3DE00EBD1DEE0E0F8E000E03C +:10046000D3DE3197E1F702EBCBDE08E9C7DE979ADE +:10047000A9D41DCF85D1117051F41FE7B122AF98D7 +:10048000C498409101014BBBC39AC39810CF10E8A8 +:10049000B12A0DCF75D1103309F404C0113309F41A +:1004A00004C005CF07EFB02202CF08E0B02AFFCE8C +:1004B00067D1103309F403C0113309F403C00FEE00 +:1004C000B022F5CE00E1B02AF2CEC091F300D09177 +:1004D000F4002091F500DE5FF89435B320FB36F987 +:1004E000789435BB00D470191FB712FFE0CE01D04D +:1004F000DECE7727089544D111FD07C010FD03C05B +:100500000FEDB022D4CE00E2B02A002700932301E1 +:1005100082D2F1F7CCCE34D1103309F404C01133B8 +:1005200009F404C0C4CE0EEFB022C1CE01E0B02A5F +:10053000BECE26D1712F24D1812FB9CE02E0B02AB0 +:1005400070933401809335011BD11093360118D17B +:1005500010933701E5D20DEFB022A9CE7093380188 +:10056000809339010DD110933A010AD110933B01C8 +:100570002CD39DCE709338018093390101D1109313 +:100580003A01FED010933B0145D391CEF9D010FF34 +:100590000BC01091FE002091FF001C5F2F4F1B3AF3 +:1005A0000FEF2007A8F40AC01091FE002091FF0071 +:1005B000145020401A380DEF200750F01093FE0021 +:1005C0002093FF0022E00DD01091FF0023E009D01E +:1005D0006ECEE199FECF2EBB22272FBBE09A1DB332 +:1005E0000895E199FECFE5FEFFCF2EBB22272FBB5A +:1005F0001DBBF894E5FEFFCFE29AE19A18951AC563 +:10060000BFD023D0BDD0A12FBBD0B12FB9D0F8948B +:1006100035B320FB36F9789435BB80D221961197FB +:100620001A2F1B2B09F0F2CF42CEAAD00ED01F9367 +:100630001AD01BE1C6D01FE3C4D01F91105DC1D0FA +:100640001D2F5AD01C2F58D032CEC0E0D0E022E669 +:100650001F70163008F4210F2695D7952695D7954B +:10066000D695D6950895A6E1B2E0AC0FBD1FF894DB +:1006700035B320FB36F9789435BB4FD2E12F119674 +:100680004CD2F12FAC2FBD2F1496CFEFDFEF319767 +:10069000FF70349780F1319640D2119601E220E14B +:1006A000D127CC0FDD1F10F4C027D227CC0FDD1FC0 +:1006B00010F4C027D227CC0FDD1F10F4C027D2279B +:1006C000CC0FDD1F10F4C027D227CC0FDD1F10F494 +:1006D000C027D227CC0FDD1F10F4C027D227CC0FA4 +:1006E000DD1F10F4C027D227CC0FDD1F10F4C02768 +:1006F000D227319789F608951F93129504D061D0BF +:100700001F9101D05EC01F7010631A3308F0195F8B +:100710000895F7C3FFC307C4AAC432D010FD13C0A5 +:100720007093460180934701B09248011091F30005 +:10073000109349011091F40010934A011091F500B3 +:1007400010934B01B4CD709146018091470110EC9C +:10075000B122109148011F73B12A109149011093E1 +:10076000F30010914A011093F40010914B01109383 +:10077000F5009DCD05D004D003D002D001D097CD97 +:1007800010EC10934401A89510E01EBB1FBB10ECA9 +:10079000809910934401B5FC3ED13320A1F310E0C1 +:1007A00010934401CF93DF93C22DC059DD271881E8 +:1007B000F8943A942394CFE72C227894DF91CF9148 +:1007C00008951F93A895152D1031E0F71F91CF9331 +:1007D000DF93DFB7F894C52DC40DDFBFCF70C05ACB +:1007E000DD2718835394DF91CF91089578940027E3 +:1007F00000930001982E672F6AD26093F200A092B6 +:10080000F000C12FDD27CC0FDD1F1091F300C10FC9 +:100810001091F400D11F1091F50026D564D22196D5 +:10082000F02C61D2CF2DD02D1091F300C10F10917B +:10083000F400D11F58D2802C1C2F2D2F219785FC1E +:1008400007C0C091F300D091F400DE5F4CD21DC010 +:100850004AD2B4FC1AC0C091F300D091F400DE5F1C +:10086000F02C41D20F1808F40024069400920001E5 +:10087000672F600D2CD26093F200A092F000C0911F +:10088000F300D091F400DE5F2ED2B3FC1AC0072F24 +:10089000000D08F016C01F932F932BDEABDD0091E7 +:1008A0000001700F982E672F12D26093F200A09271 +:1008B000F00000910001701B1091F500D5D42F912C +:1008C0001F91700D86FE05C0C12FD22F22970BD22B +:1008D000900CC12FD22F219606D2702C0FEF0ABB9D +:1008E000C09A0FE180228092F1000027801201C09F +:1008F00087C0AA27B92DB695A795B695A795B05FDD +:1009000007C09394A05CBF4F8090F100A090F000CE +:10091000AA2A222721961091F500A6D4E4D1112706 +:100920006091F200662339F08894079417956A95D0 +:10093000E1F7022A212F08E1F89435B300FB36F9DC +:10094000789435BBF89435B33A25307C3A257894C1 +:1009500035BB3B2F330F330FA7FA31F9A6FA30F925 +:100960003BBBF894C39AC398789430930101002755 +:100970000ABBF894C29ABA98C0980000C09A09B30A +:100980000026B0FC002A0FEF0ABB0BBAC19800008A +:10099000C19A7894C298BA9AA3948A9409F0BACF6B +:1009A000222351F1F89435B33A25307C3A257894D6 +:1009B00035BB3B2F330F330FA7FA31F9A6FA30F9C5 +:1009C0003BBBF894C39AC3987894309301010027F5 +:1009D0000ABBF894C29ABA98C0980000C09A09B3AA +:1009E0002027B0FC202B0FEF0ABB2BBBC1980000C7 +:1009F000C19A7894C298BA9A04D07A9409F081CFB7 +:100A00000895CF93DF93192D78D01881122B188376 +:100A1000DF91CF9108952F93CF93DF93109123010E +:100A20006CD01881122309F45EC028812127288305 +:100A300010E010934401AF93BF93A3E0B1E0CC2743 +:100A4000D0912301D695C795D695C795D05F18E16B +:100A50000BD42EE1F89435B33C27307C3C277894B6 +:100A600035BB3D2F330F330FC7FB31F9C6FB30F9D0 +:100A70003BBBF894C39AC398789430930101002744 +:100A80000ABBF894C29ABA98C0980000C09A19B3E9 +:100A90007894C298BA9A0FEF0ABB1D93C3952A9512 +:100AA00009F0D8CFBF91AF91CC27D0912301D69533 +:100AB000C795D695C795D695C79597980C2FA2DB65 +:100AC0000D2FA0DB04E29ADB00EB98DB2EE1C3E004 +:100AD000D1E0099199DB2A95E1F702EB91DB979A36 +:100AE00010EC109344011091230113951F73109380 +:100AF0002301DF91CF912F910895C4E2D1E0212FFE +:100B0000269526952695C20F20E0D21F21E017706A +:100B100019F0220F1A95E9F7089562C385C3C7CB70 +:100B200078949090350160913401D1D06093F200B7 +:100B3000A092F00070903701CC27D92DD695C7959B +:100B4000D695C795D05F18E18FD307C0C05CDF4F43 +:100B500093946091F200A090F000AC2A1FEF809077 +:100B6000360100E0801641F008E08016B8F06623F8 +:100B700019F016956A95E9F7DAD008E01091F200BD +:100B8000011B801AA3941FEF08E0801638F0B1F023 +:100B9000CED01FEF08E0801AA394F6CF882079F01A +:100BA00016958A94E9F71095662341F02227169549 +:100BB00027956A95E1F7BBD0A394122FB8D021DF17 +:100BC0007A9400277012C2CF089500913A010A95D5 +:100BD0000230D0F300913B010330B0F300913801B3 +:100BE0000395009334010091390100933501809001 +:100BF0003A018A948A948092360101E00093370189 +:100C00008FDF009138010093340180903A01809287 +:100C100036013AC000913A010A950230A8F20091DB +:100C20003B01033088F200913801039500933401B1 +:100C3000009139010093350180903A018A948A9499 +:100C40008092360101E0009337016ADF009138019C +:100C500000933401009139010395009335017090A0 +:100C60003B017A947A947092370101E00093360147 +:100C700057DF80903A0100913801080D0A950093E2 +:100C8000340101E00093360100913901039500938E +:100C9000350170903B017A947A947092370140DF6D +:100CA0000091380103950093340180903A018A94B1 +:100CB0008A948092360170903B0100913901070DB2 +:100CC0000A950093350101E00093370129CFAA244A +:100CD00000EFA01A67FFAA246F77685014F0A3945E +:100CE000FCCF685F0895F89435B33C27307C3C27EF +:100CF000789435BB3D2F330F330FC7FB31F9C6FB5B +:100D000030F93BBBF894C39AC398789430930101AF +:100D100000270ABBF894C29ABA98C0980000C09AFB +:100D200009B27894C298BA9A0FEF0ABB0895F89462 +:100D300035B33A25307C3A25789435BB3D2F330FB7 +:100D4000330FA7FA31F9A6FA30F93BBBF894C39AEE +:100D5000C39878943093010100270ABBF894C29A93 +:100D6000BA98C0980000C09AF9B27894C298BA9A1A +:100D70000FEF0ABBB1FE03C01095F12203C0F126AC +:100D8000B0FCF12AF89435B33A25307C3A257894B2 +:100D900035BB3D2F330F330FA7FA31F9A6FA30F9DF +:100DA0003BBBF894C39AC398789430930101FBBA83 +:100DB000F894C29ABA98C1980000C19A7894C298DF +:100DC000BA9A08959924C0E0D0E118E14DD2AA243E +:100DD000A092F0001091F0001C2BF89435B331274D +:100DE000307C3127789435BB3D2F330F330F17FB01 +:100DF00031F916FB30F93BBBF894C39AC398789449 +:100E00003093010100E00BBBF894C29ABA98C198E4 +:100E10000000C19A7894C298BA9AA39400E2A016EE +:100E200019F0A092F000D6CFECDD9394C05CDF4FB8 +:100E3000D03209F0CCCF7727882708951FB60F93BB +:100E40000FEDC02EEF93FF93E42DE05AFF270081B2 +:100E5000FF91EF910CB95A9443940FE040226A94A9 +:100E60000AF046C04BC01FB60F930FEDC02E0CB159 +:100E70005C9938C0E7FC26C0E6FC08C0033029F4C2 +:100E800003E009B9539A00E4E02A38C0602E00E874 +:100E900003190AF40FE7662012F4052D00680CB957 +:100EA000061508F4602E062D0F7739F000ECE02AC5 +:100EB0006A9422F55798559A21C00FEBE022569A72 +:100EC0005E9A1CC0EF93FF93E32DE20DEF77E0599C +:100ED000FF270083FF91EF9133946A947AF40CC05A +:100EE0001FB60F9353980FE509B90FEBE022CC24FE +:100EF00055985698579A0CB10FE7E0220F911FBEF4 +:100F000018951FB68A9A4CB55DB55093FB00409377 +:100F1000FA008EC01FB68B9A4CB55DB55093F900A0 +:100F20004093F80085C01FB65AB35F935BB35F93DD +:100F30005FEF5ABBB7FE14C0509151015395553223 +:100F400028F4523159F4AF98C49A03C0AF9AC498A8 +:100F500050E0409101014BBBC39AC398509351019B +:100F600055B35F93509101015F9350914501505CDF +:100F70005093450149F450914401539550934401D5 +:100F800019F45FEBB5226CC950EB5FBD4CB55DB594 +:100F9000485F5F4F5BBD4ABD59BD48BD8A9A929A72 +:100FA0008B9A939A8D9895985091FD004091FC00F2 +:100FB0008D9A859907C040389DEF59074AF04150F6 +:100FC000504006C0453D9FEF590712F44F5F5F4FF9 +:100FD0005093FD004093FC005BBD4ABD9091FE0024 +:100FE000491B9091FF00590B1AF445EF5FEF02C0C7 +:100FF00040E85DEF59BD48BD000000000000000062 +:10100000000000005DEF5DBD55E75CBD8A989298D9 +:101010008B98939850EE5FBD5F915BBBC39AC3986A +:10102000509301015F9155BB5F915BBB5F915ABBD0 +:101030001FBE18959924C0E0D0E1A0E0B0E118E10E +:1010400013D1A05CBF4F0A94E1F720E22F93C8D0E0 +:10105000EBD0A395C3952F912A9509F0F7CFD1DC5A +:101060009394A0969096B03209F0EFCFB0CE88DB83 +:101070001F9386DB10934C0183DB1695169516950E +:1010800009F410E210934F017BDB10935001172FEE +:1010900016951695169510934D0180934E0118E103 +:1010A000E3D01F9110FD46C0CC27D0914E019D2E5C +:1010B000D695C795D695C79510914D01C10FD05FB4 +:1010C0002091500110914C01121720F5211BAA27E5 +:1010D000B0914E01B10FB695A795B695A795109111 +:1010E0004D01A10FB05F2F93AF93BF93CF93DF93C9 +:1010F00020914F0168D085DCDF91CF91BF91AF91F6 +:101100002F919394A05CBF4FC05CDF4F2A9559F795 +:1011100020914C012F93CF93DF9320914F015AD010 +:1011200070DCDF91CF912F919394C05CDF4F2A95B3 +:1011300089F7F5CCCC27D0914E0100915001D00F0A +:101140009D2ED695C795D695C79510914D01C10F87 +:10115000D05F202F10914C01121728F5211BAA27D0 +:10116000B0914E01B00FB11BB695A795B695A79556 +:1011700010914D01A10FB05F9A94A054B040C0549B +:10118000D0402F93AF93BF93CF93DF9320914F0124 +:101190001AD037DCDF91CF91BF91AF912F912A9573 +:1011A00059F720914C019A94C054D0402F93CF937B +:1011B000DF9320914F010ED024DCDF91CF912F914E +:1011C0002A9589F7ACCC0CD011962ED021962A9571 +:1011D000D1F7089510E028D021962A95E1F70895D7 +:1011E000F89435B33A27307C3A27789435BB3B2FB7 +:1011F000330F330FA7FB31F9A6FB30F93BBBF89453 +:10120000C39AC39878943093010100270ABBF894DD +:10121000C29ABA98C0980000C09A19B37894C2983C +:10122000BA9A0FEF0ABB0895F89435B33C27307C87 +:101230003C27789435BB3D2F330F330FC7FB31F973 +:10124000C6FB30F93BBBF894C39AC39878943093AB +:1012500001011BBBF894C29ABA98C1980000C19AC8 +:101260007894C298BA9A0895F89435B310FB36F979 +:10127000789435BB089546323444303331393033B5 +:101280003132313730394C034C034C034C034C039F +:101290004C034C034C034C034C034C034C034C03D6 +:1012A0004C034C034C034C034C034C034C034C03C6 +:1012B0004C034C034C034C034C034C034C034C03B6 +:1012C0004C034C034C0300014C034C034C034C03F4 +:1012D0004C034C034C034C034C034C034C034C0396 +:1012E00003014C034C0306010F01180121012A01DF +:1012F00033013C0145014E0157014C034C034C03A3 +:101300004C034C034C034C036001690172017B01E7 +:1013100084018D0196019F01A901B201BB01C401A5 +:10132000CD01D601DF01E801F101080211021A0224 +:1013300023022C0235023E02470250024C034C03AA +:101340004C034C034C034C03590262026B027402BF +:101350007D0286028F029902A302AD02B802C20288 +:10136000CB02D402DD02E602F002FC0203030C030E +:1013700015031E0327033003390343034C034C03B7 +:101380004C034C034C030003066101F8010770880D +:1013900098A8C888700107206020202020700107CD +:1013A000708808102040F80107F810201008887095 +:1013B000010710305090F810100107F880F008086D +:1013C00088700107304080F08888700107F80810A5 +:1013D000204040400107708888708888700107703D +:1013E000888878081060010770888888F8888801E4 +:1013F00007F08888F08888F00107708880808088EE +:10140000700107E09088888890E00107F88080F0FC +:101410008080F80107F88080F08080800107708864 +:1014200080B88888780107888888F88888880221A9 +:10143000078080808080808001070808080808886D +:101440007001078890A0C0A09088010780808080EC +:101450008080F8010788D8A8A8888888010788882C +:10146000C8A89888880107708888888888700107CC +:10147000F08888F0808080010770888888A890684C +:101480004C034C034C03060801014F0065030107A0 +:10149000F08888F0A09088010770888070088870B4 +:1014A0000107F820202020202001078888888888CC +:1014B0008870010788888888885020010788888874 +:1014C000A8A8A8500107888850205088880107885C +:1014D0008888502020200107F80810204080F8015B +:1014E000070000700878887801078080F088888875 +:1014F000F00107000078808080780107080878886C +:10150000888878010700007088F88070010718202B +:10151000F8202020200108000078888878087001D1 +:10152000078080B0C888888802210780008080807A +:101530008080052108100010101010906005210710 +:10154000808090A0C0A090032107C0404040404050 +:101550004001070000F0A8A8A8A801070000B0C833 +:10156000888888010700007088888870010800005A +:10157000F08888F080800108000078888878080862 +:1015800002056105B0C0808080010700007880708E +:1015900008F001072020F82020201801070000880B +:1015A0008888986801070000888888502001070013 +:1015B000008888A8A85001070000885020508801A2 +:1015C00008000088888878087001070000F810205B +:1015D00040F80107F8F8F8F8F8F8F80070933801C7 +:1015E00080933901CDD810933A01CAD810933B01AA +:1015F00026D05DC67093380180933901C1D810930D +:101600003A01BED810933B012FD051C670933401DC +:1016100080933501B5D810933601B2D810933701B5 +:1016200078D045C67093340180933501A9D81093C2 +:101630003601A6D81093370171D039C608950091AC +:101640003801009334010091390100933501009174 +:101650003A010093360100913B010093370102E00B +:10166000B02A5EDA0DEFB02200913A010A950230FD +:1016700028F300913B01033008F3009138010093F7 +:101680003401009139010093350100913A01009332 +:10169000360101E00093370143DA009138010093ED +:1016A00034010091390103950093350100913B010C +:1016B00002500093370101E00093360131DA809047 +:1016C0003A0100913801080D0A950093340101E0B8 +:1016D0000093360100913901039500933501009183 +:1016E0003B010250009337011BDA0091380100934F +:1016F000340100913A010093360170903B01009152 +:101700003901070D0A950093350101E00093370177 +:1017100007CA02E0B02A04DA0DEFB0227894909064 +:10172000350160913401D3DA6093F200A092F000A9 +:1017300070903701CC27D92D15E5D0FF1AEA012E7C +:10174000D695C795D695C795D05F18E18DDD07C0B2 +:10175000C05CDF4F93946091F200A090F000AC2A3F +:101760001FEF8090360100E0801641F008E08016FF +:10177000C8F0662319F016956A95E9F71021D7DAB3 +:1017800008E01091F200011B801AA3941FEF08E0FB +:10179000801640F0C1F01021CADA1FEF08E0801A6D +:1017A000A394F5CF882089F016958A94E9F71095CF +:1017B000662349F02227169527956A95E1F71021AF +:1017C000B6DAA394122F1021B2DA00941AD97A94BF +:0817D00000277012BDCF08953F +:0220000003419A +:00000001FF diff --git a/src/avr/CS64V5.ASM b/src/avr/CS64V5.ASM new file mode 100644 index 00000000..813e9353 --- /dev/null +++ b/src/avr/CS64V5.ASM @@ -0,0 +1,3077 @@ +; CS64V5.ASM + +; 01FEB02 REVISE FOR 7.3728MHz XTAL +; 22NOV01 REVISE FOR OPERATION FROM VCC INSTEAD OF VBAT +; INVERT SENSE OF SRAM CHIP SELECT +; STILL NEED TO REMOVE VCC COMPENSATION CODE + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APICS.INC" ; NOT API.INC BECAUSE APICS.INC HAS WDR IN TX_WAIT_LOOP + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS XPAGE,YH + RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL +; THIS WILL CORRUPT BACKLIGHT + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 + ANDI R19,$80 + EOR R19,@0 + SEI + OUT PORTC,R19 +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @0,1 ; A15 +; BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @1,7 ; A15 +; BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =-818 ;$FB35 +.EQU T1_FULL_SCALE =-651 ;$FC2F + +.EQU VEE_MIN =-640 ;$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX = -43 ;$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =-341 ;$FE00 + +.EQU CONTRAST_LONG =-640 ;$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT = -11 ;$FFF0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =-341 ;$FE00 + +.EQU VCC_NOMINAL =-536 ;$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =-630 ;$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX = -85 ;$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =-448 ;$FD60 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS +.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +TEMP: .BYTE 1 ; 10C + +LATCH11_SAV: .BYTE 1 +XPAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 2 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +BACKLIGHT_COUNT: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RETI ; TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + +RESTART_ENTRY: + LDI F,$00 + OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED + OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F ; D6 = LOW TO RESET T6963C + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + +; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO + LDI F,$03 ; CS, RD, WR HI, LEs ALL LO + OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT + + LDI F,$00 + OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT + + LDI F,$20 ;$A0 NO BACKLIGHT INVERSION INITIALLY + MOV FLAGS,F ; START WITH DISPLAY ON + + INIT_API_BUS + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT+1,D ; KLUDGE FOR EXTRA 2 BITS OF RESOLUTION + + ; INITIALISE T6963C DISPLAY CONTROLLER + SBI PORTD,6 ; COME OUT OF RESET + + LDI ZL,0 + LDI ZH,0 +RESET_DELAY: + WDR ; 10OCT02 RESET WATCHDOG + SBIW ZL,1 + BRNE RESET_DELAY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOP: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: +; LDIZ CHSET00 ; POINT Z TO FLASH + LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + +; LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + CLR A + STS BACKLIGHT_COUNT,A ; ENSURE BACKLIGHT COUNT IS IN RANGE + + CLR ZL + CLR ZH ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$04 ;$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +WRITE_COMMAND: + RCALL WAIT_STATUS ; LEAVES C/D = 1 + RJMP WRITE_ENTRY +WRITE_COMMAND_AUTO: + RCALL WAIT_AUTO ; LEAVES C/D = 1 + RJMP WRITE_ENTRY + +WRITE_DATA: + RCALL WAIT_STATUS + RJMP WRITE_DATA_ENTRY +WRITE_DATA_AUTO: + RCALL WAIT_AUTO +WRITE_DATA_ENTRY: + CBI PORTC,0 ; C/D = 0 +WRITE_ENTRY: + OUT PORTA,F + NOP + NOP + NOP + CLI + CBI PORTB,1 ; WR = 0 + NOP + NOP + NOP + SEI + SBI PORTB,1 ; WR = 1 + RET + +WAIT_AUTO: + PUSH F +WAIT_AUTO_LOOP: + RCALL READ_STATUS + SBRS F,3 + RJMP WAIT_AUTO_LOOP + POP F + RET + +WAIT_STATUS: + PUSH F +WAIT_STATUS_LOOP: + RCALL READ_STATUS + SBRC F,0 + SBRS F,1 + RJMP WAIT_STATUS_LOOP + POP F + RET + +READ_STATUS: + SBI PORTC,0 ; C/D = 1 + LDI F,0 + OUT DDRA,F ; D0-D7 = INPUTS + CLI + CBI PORTB,0 ; RD = 0 + NOP + NOP + NOP + NOP + SBI PORTB,0 ; RD = 1 + IN F,PINA ; READ DATA BEFORE RD COMES UP + SEI + PUSH F + LDI F,$FF + OUT DDRA,F ; D0-D7 = OUTPUTS + POP F + RET + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; TURN OFF VEE MEASURING + + CBI PORTB,2 ; REMOVE WEAK PULL UP (SRAM SELECT = 1) + SBI DDRB,2 ; NOW DRIVE LOW + CBI PORTD,6 ; T6963C RESET = 0 + CBI PORTD,7 ; T6963C SELECT = 0 + CBI PORTB,0 ; RD = 0 + CBI PORTB,1 ; WR = 0 + + LDI D,$FF + OUT DDRA,D ; D0-D7 = OUTPUTS + LDI D,0 + OUT PORTA,D ; D0-D7 = 0 + + LDI D,0 ;$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + ;LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$1F ; WATCHDOG TURN OFF ENABLE = 1 + OUT WDTCR,D + LDI D,$17 ; WATCHDOG ENABLE = 0 + OUT WDTCR,D + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,XPAGE +; INC YH +; ANDI YH,$1F +; STS XPAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: +; CLI ; FOR BEST SAFETY +; +; LDI F,$00 +; OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED +; OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED +; +; LDI F,$F8 ; INIT_PORTS +; OUT DDRD,F +; LDI F,$B8 ;$F8 +; OUT PORTD,F ; D6 = LOW TO RESET T6963C +; LDI F,$1F +; OUT DDRB,F +; LDI F,$FF +; OUT DDRA,F +; OUT DDRC,F +; +; CLR F +; OUT PORTA,F +; +;; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO +;; LDI F,$03 ; CS, RD, WR HI, LEs ALL LO +; IN F,PORTB +; ANDI F,$10 ; PRESERVE B4 FOR BACKLIGHT +; ORI F,$03 ; CS, RD, WR HI, LEs ALL LO +; OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT +; +;; LDI F,$00 +; IN F,PORTC +; ANDI F,$80 ; PRESERVE C7 FOR BACKLIGHT +; OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT +; +; SEI ; FOR BEST SAFETY +; CBI PORTD,6 ; SEE OUT PORTD,F ABOVE +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYX: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYX +; +; ; INITIALISE T6963C DISPLAY CONTROLLER +; SBI PORTD,6 ; COME OUT OF RESET +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYY: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOPZ: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOPZ + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + +; CLI ; FOR BEST SAFETY +; +; LDI A,HIGH(CONTRAST_MID) +; OUT OCR1BH,A +; LDI A,LOW(CONTRAST_MID) +; OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH +; +; LDI A,HIGH(T1_INIT) +; OUT TCNT1H,A +; LDI A,LOW(T1_INIT) +; OUT TCNT1L,A +; +; LDI A,$50 +; OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH +; LDI A,$01 +; OUT TCCR1B,A ; TIMER 1 RUNNING +; +; LDI F,$00 +; OUT TCCR0,F ; TIMER 0 NOT RUNNING YET +; +; LDI F,$04 ;$05 +; OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS +; OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS +; +; LDI F,$0A +; OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE +; LDI F,$C0 +; OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS +; OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 +; +; SEI ; FOR BEST SAFETY + + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT + ANDI A,1 + BRNE SET_BACKLIGHT_ON + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + RJMP MAIN_LOOP +SET_BACKLIGHT_ON: + LDI A,1<<7 + OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + +; LDS A,CONTRASTL +; RCALL TX_WAIT +; LDS A,CONTRASTH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 1 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_XPAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + LDI XL,LOW(ROWBUF) + LDI XH,HIGH(ROWBUF) ; X -> SINGLE LINE BUFFER IN AVR SRAM + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + LDI B,30 ; BYTES TO COPY +DO_MORE: + A0_A13 YL,YH + RAMRD A + ST X+,A + INC YL + DEC B + RJNE DO_MORE ;BRNE DO_MORE + + POP XH + POP XL + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> SINGLE LINE IN T6963C BUFFER + + CBI PORTD,7 ; CS0 = 0 + MOV F,YL + RCALL WRITE_DATA + MOV F,YH + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI B,30 + LDI YL,LOW(ROWBUF) + LDI YH,HIGH(ROWBUF) ; Y -> SINGLE LINE BUFFER IN AVR SRAM +NICK_SUB2_LOOP: + LD F,Y+ + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + DEC B + BRNE NICK_SUB2_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + SBI PORTD,7 ; CS0 = 1 + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +; SBI DDRB,7 +; IN D,PORTB +; SUBI D,$80 +; OUT PORTB,D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + SBRS FLAGS,7 + RJMP BACKLIGHT_SKIP + LDS D,BACKLIGHT_COUNT + INC D +; LDS C,CONTRASTL +; LSL C +; CP D,C + CPI D,37 ;62 ;64 ; 64 COUNTS = 150 HZ + BRSH BACKLIGHT_EVEN +; LSR C +; CP D,C + CPI D,18 ;31 ;32 + BRNE BACKLIGHT_SAVE +;BACKLIGHT_ODD: + CBI PORTC,7 + SBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 + RJMP BACKLIGHT_CONT +BACKLIGHT_EVEN: + SBI PORTC,7 + CBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + LDI D,0 +BACKLIGHT_CONT: + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 +BACKLIGHT_SAVE: + STS BACKLIGHT_COUNT,D +BACKLIGHT_SKIP: + + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS D,BREAK_COUNT+1 ; WORD IS STORED IN REVERSE ORDER + SUBI D,-$40 + STS BREAK_COUNT+1,D ; START OF 4 INTERRUPT BLOCK? + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + LDI D,$B0 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, CLR OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + +; 10mar03 for better API bus performance (let the chips fall where they may) +; ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN +; ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD +; LDI D,$0B+$AB ; WAIT FOR 3uSEC +;SETTLE_CL2: +; DEC D +; BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + +; LDS C,VCCL +; LDS D,VCCH +; LDI E,LOW(VCC_NOMINAL) +; SUB C,E +; LDI E,HIGH(VCC_NOMINAL) +; SBC D,E +; +; ROR D +; ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +;; PUSH D +;; PUSH C +; ASR D +; ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +;; POP E +;; ADD C,E +;; POP E +;; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 +; +;; CLR D +;; CLR C +; +; LDS E,VEEL +; ADD C,E +; LDS E,VEEH +; ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH WE ARE NO LONGER SETTING TIMER 0 + NOP + NOP + NOP + NOP + NOP + NOP + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + +;END_INT: + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_XPAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +CHSET00: +.INCLUDE "CHSET00.INC" +CHSET00_END: + +; ----------------------------------------------------------------------------- + +GET_CLEAR_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL CLEAR_FRAME_RECT + RJMP MAIN_LOOP + +GET_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FRAME_RECT + RJMP MAIN_LOOP + +GET_CLEAR_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL CLEAR_HALFTONE_RECT + RJMP MAIN_LOOP + +GET_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL HALFTONE_RECT + RJMP MAIN_LOOP + +NO_GOX: RET + +CLEAR_FRAME_RECT: + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS F,RECTNC_YY + STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +FRAME_RECT: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GOX + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GOX + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CLEAR_HALFTONE_RECT: +; LDS F,RECTNC_X +; STS RECT_X,F +; LDS F,RECTNC_Y +; STS RECT_Y,F +; LDS F,RECTNC_XX +; STS RECT_XX,F +; LDS F,RECTNC_YY +; STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +HALFTONE_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LDI A,$55 + SBRS YH,0 + LDI A,$AA + MOV PATTERN,A + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP X03A3 +X039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +X03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ X03B0 + LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + TST XPIXEL + BREQ X03B0 +X03AD: LSR A + DEC XPIXEL + BRNE X03AD +X03B0: AND A,PATTERN + RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +X03B8: LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + BREQ X03D2 + AND A,PATTERN + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP X03B8 +X03C2: TST X_SIZE + BREQ X03D3 +X03C4: LSR A + DEC X_SIZE + BRNE X03C4 + COM A + TST XPIXEL + BREQ X03D2 + CLR B +X03CB: LSR A + ROR B + DEC XPIXEL + BRNE X03CB + AND A,PATTERN + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +X03D2: AND A,PATTERN + RCALL WR_DISP_MEM +X03D3: COM PATTERN + RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP X039A + RET + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/CS64V5.HEX b/src/avr/CS64V5.HEX new file mode 100644 index 00000000..6b6abee7 --- /dev/null +++ b/src/avr/CS64V5.HEX @@ -0,0 +1,385 @@ +:020000020000FC +:100000000DC087C387C3189518951895189518952E +:1000100082C31895189527C711C762C702E00EBFA3 +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300009BF0BBF08EF01BB08EB02BB0FE107BB19 +:100040000FEF0ABB04BB00270BBB03E008BB00E0BB +:1000500005BB00E2B02E17E119B910E91AB9442422 +:10006000552422243324EE246624CC24552750938F +:100070000101509323015093430150934401509345 +:100080004501969AE0E0F0E0A8953197E9F7979856 +:1000900000E0B8D0B7D002E4B1D000E2B3D000E0C5 +:1000A000B1D003E4ABD000E8A9D000E9A7D000E0CC +:1000B000A9D0A8D004E2A2D000EBA0D0E0E0F8E004 +:1000C00000E0A2D03197E1F702EB9AD008E996D090 +:1000D000979A789410E3B9D2CF93DF93C4D2BF91AB +:1000E000AF911BD5212F1D2F12950DD31217B1F4EF +:1000F000119613D5212F1D2F06D3121779F41196BF +:100100000CD5212F1C2F1295FED2121739F41196FF +:1001100004D5212F1C2FF7D2121749F1E6E7F2E19F +:10012000A6E6B3E0D8E1D0930201C0D0D0E8C0E0A9 +:10013000DBBBC39AC398D0930101F89435B33C2735 +:1001400030783C27789435BBC8950BBAC29ABA98D8 +:10015000C1980000C19AC298BA9A119741F031969D +:10016000C3951C2F1F7349F7C054D395E1CF20E1ED +:100170002093F30020E22093F40028E12093F5007F +:1001800021D6112710935101EE27FF271EEF109360 +:10019000FD001BEA1093FC0022E01BD21C7F109391 +:1001A000FE0023E016D21093FF001091FE00209174 +:1001B000FF001A380DEF200720F01B3A0FEF200741 +:1001C00030F01EEF1093FF0010E41093FE001EEFBE +:1001D00019BD1BEA18BD1CEF1DBD1EEC1CBD10E5B2 +:1001E0001FBD11E01EBD00E003BF04E008BF09BF52 +:1001F0000AE005BF00EC0ABF0BBF92C219D006C0CF +:1002000011D004C015D001C00DD0A8980BBB0000C0 +:1002100000000000F894C1980000000000007894ED +:10022000C19A08950F930BD003FFFDCF0F9108954E +:100230000F9305D000FD01FFFCCF0F910895A89A00 +:1002400000E00ABBF894C098000000000000000025 +:10025000C09A09B378940F930FEF0ABB0F910895DA +:1002600002E00EBF0FE50DBF1FE7B122AF98C498A3 +:10027000409101014BBBC39AC39850E05FBD5EBD86 +:1002800094989598C298BA9A96989798C098C19859 +:100290005FEF5ABB50E05BBB50E059BF5BBF5FE113 +:1002A00051BD57E151BD5AE655BF889508957894E0 +:1002B0001FEDE12210E01EBB1FBB62D21B3129F1F2 +:1002C000B3FC0DC0103258F4183009F4FEC01D30D4 +:1002D00009F40DC11A3009F48BC0173041F7B2FC94 +:1002E00012C0103381F4C091F300D091F40020913A +:1002F000F500CC5FDD4FF89435B320FB36F97894E8 +:1003000035BBF1D4102D72D2D2CF3AD21B3139F392 +:100310001E3209F475C11F3209F44FC01F3309F4AE +:1003200084C1113409F4A6C0123409F427C213346D +:1003300009F404C1133609F451C9143409F4EBC0AB +:10034000153409F4D8C0163409F408C1163609F476 +:1003500051C9173409F49EC0183409F463C918361A +:1003600009F454C91B3409F461C01C3409F4D4C124 +:100370001D3409F42BC01E3409F4FCC0103509F4F7 +:1003800097C0123509F4DCC0133509F4D2C0153515 +:1003900009F4F4C1163519F410E2E12AF7C0173553 +:1003A00009F4ECC1183509F4B8C11A3509F4E2C1F1 +:1003B000103310F01A3398F07ACFE2D110FF03C057 +:1003C00014E0B12A74CF1BEFB12271CFD9D1103311 +:1003D00021F4F89400E4B02A43CF69CFD1D135D1CC +:1003E000C0E1C093F300D093F4002093F5005FCFF9 +:1003F00001D05DCF0F92C091F300D091F400209115 +:10040000F500DE5FC395F89435B320FB36F9789498 +:1004100035BB69D4182F100D100D1A95103418F033 +:10042000EED00F900895800D0F900895979800E0FA +:10043000E9DEE8DE02E4E2DE00E2E4DE00E0E2DE45 +:1004400003E4DCDE00E8DADE00E9D8DE00E0DADE34 +:10045000D9DE04E2D3DE00EBD1DEE0E0F8E000E03C +:10046000D3DE3197E1F702EBCBDE08E9C7DE979ADE +:10047000A9D41DCF85D1117051F41FE7B122AF98D7 +:10048000C498409101014BBBC39AC39810CF10E8A8 +:10049000B12A0DCF75D1103309F404C0113309F41A +:1004A00004C005CF07EFB02202CF08E0B02AFFCE8C +:1004B00067D1103309F403C0113309F403C00FEE00 +:1004C000B022F5CE00E1B02AF2CEC091F300D09177 +:1004D000F4002091F500DE5FF89435B320FB36F987 +:1004E000789435BB00D470191FB712FFE0CE01D04D +:1004F000DECE7727089544D111FD07C010FD03C05B +:100500000FEDB022D4CE00E2B02A002700932301E1 +:1005100082D2F1F7CCCE34D1103309F404C01133B8 +:1005200009F404C0C4CE0EEFB022C1CE01E0B02A5F +:10053000BECE26D1712F24D1812FB9CE02E0B02AB0 +:1005400070933401809335011BD11093360118D17B +:1005500010933701E5D20DEFB022A9CE7093380188 +:10056000809339010DD110933A010AD110933B01C8 +:100570002CD39DCE709338018093390101D1109313 +:100580003A01FED010933B0145D391CEF9D010FF34 +:100590000BC01091FE002091FF001C5F2F4F1B3AF3 +:1005A0000FEF2007A8F40AC01091FE002091FF0071 +:1005B000145020401A380DEF200750F01093FE0021 +:1005C0002093FF0022E00DD01091FF0023E009D01E +:1005D0006ECEE199FECF2EBB22272FBBE09A1DB332 +:1005E0000895E199FECFE5FEFFCF2EBB22272FBB5A +:1005F0001DBBF894E5FEFFCFE29AE19A18951AC563 +:10060000BFD023D0BDD0A12FBBD0B12FB9D0F8948B +:1006100035B320FB36F9789435BB80D221961197FB +:100620001A2F1B2B09F0F2CF42CEAAD00ED01F9367 +:100630001AD01BE1C6D01FE3C4D01F91105DC1D0FA +:100640001D2F5AD01C2F58D032CEC0E0D0E022E669 +:100650001F70163008F4210F2695D7952695D7954B +:10066000D695D6950895A6E1B2E0AC0FBD1FF894DB +:1006700035B320FB36F9789435BB4FD2E12F119674 +:100680004CD2F12FAC2FBD2F1496CFEFDFEF319767 +:10069000FF70349780F1319640D2119601E220E14B +:1006A000D127CC0FDD1F10F4C027D227CC0FDD1FC0 +:1006B00010F4C027D227CC0FDD1F10F4C027D2279B +:1006C000CC0FDD1F10F4C027D227CC0FDD1F10F494 +:1006D000C027D227CC0FDD1F10F4C027D227CC0FA4 +:1006E000DD1F10F4C027D227CC0FDD1F10F4C02768 +:1006F000D227319789F608951F93129504D061D0BF +:100700001F9101D05EC01F7010631A3308F0195F8B +:100710000895F7C3FFC307C4AAC432D010FD13C0A5 +:100720007093460180934701B09248011091F30005 +:10073000109349011091F40010934A011091F500B3 +:1007400010934B01B4CD709146018091470110EC9C +:10075000B122109148011F73B12A109149011093E1 +:10076000F30010914A011093F40010914B01109383 +:10077000F5009DCD05D004D003D002D001D097CD97 +:1007800010EC10934401A89510E01EBB1FBB10ECA9 +:10079000809910934401B5FC3ED13320A1F310E0C1 +:1007A00010934401CF93DF93C22DC059DD271881E8 +:1007B000F8943A942394CFE72C227894DF91CF9148 +:1007C00008951F93A895152D1031E0F71F91CF9331 +:1007D000DF93DFB7F894C52DC40DDFBFCF70C05ACB +:1007E000DD2718835394DF91CF91089578940027E3 +:1007F00000930001982E672F6AD26093F200A092B6 +:10080000F000C12FDD27CC0FDD1F1091F300C10FC9 +:100810001091F400D11F1091F50026D564D22196D5 +:10082000F02C61D2CF2DD02D1091F300C10F10917B +:10083000F400D11F58D2802C1C2F2D2F219785FC1E +:1008400007C0C091F300D091F400DE5F4CD21DC010 +:100850004AD2B4FC1AC0C091F300D091F400DE5F1C +:10086000F02C41D20F1808F40024069400920001E5 +:10087000672F600D2CD26093F200A092F000C0911F +:10088000F300D091F400DE5F2ED2B3FC1AC0072F24 +:10089000000D08F016C01F932F932BDEABDD0091E7 +:1008A0000001700F982E672F12D26093F200A09271 +:1008B000F00000910001701B1091F500D5D42F912C +:1008C0001F91700D86FE05C0C12FD22F22970BD22B +:1008D000900CC12FD22F219606D2702C0FEF0ABB9D +:1008E000C09A0FE180228092F1000027801201C09F +:1008F00087C0AA27B92DB695A795B695A795B05FDD +:1009000007C09394A05CBF4F8090F100A090F000CE +:10091000AA2A222721961091F500A6D4E4D1112706 +:100920006091F200662339F08894079417956A95D0 +:10093000E1F7022A212F08E1F89435B300FB36F9DC +:10094000789435BBF89435B33A25307C3A257894C1 +:1009500035BB3B2F330F330FA7FA31F9A6FA30F925 +:100960003BBBF894C39AC398789430930101002755 +:100970000ABBF894C29ABA98C0980000C09A09B30A +:100980000026B0FC002A0FEF0ABB0BBAC19800008A +:10099000C19A7894C298BA9AA3948A9409F0BACF6B +:1009A000222351F1F89435B33A25307C3A257894D6 +:1009B00035BB3B2F330F330FA7FA31F9A6FA30F9C5 +:1009C0003BBBF894C39AC3987894309301010027F5 +:1009D0000ABBF894C29ABA98C0980000C09A09B3AA +:1009E0002027B0FC202B0FEF0ABB2BBBC1980000C7 +:1009F000C19A7894C298BA9A04D07A9409F081CFB7 +:100A00000895CF93DF93192D78D01881122B188376 +:100A1000DF91CF9108952F93CF93DF93109123010E +:100A20006CD01881122309F45EC028812127288305 +:100A300010E010934401AF93BF93A3E0B1E0CC2743 +:100A4000D0912301D695C795D695C795D05F18E16B +:100A50000BD42EE1F89435B33C27307C3C277894B6 +:100A600035BB3D2F330F330FC7FB31F9C6FB30F9D0 +:100A70003BBBF894C39AC398789430930101002744 +:100A80000ABBF894C29ABA98C0980000C09A19B3E9 +:100A90007894C298BA9A0FEF0ABB1D93C3952A9512 +:100AA00009F0D8CFBF91AF91CC27D0912301D69533 +:100AB000C795D695C795D695C79597980C2FA2DB65 +:100AC0000D2FA0DB04E29ADB00EB98DB2EE1C3E004 +:100AD000D1E0099199DB2A95E1F702EB91DB979A36 +:100AE00010EC109344011091230113951F73109380 +:100AF0002301DF91CF912F910895C4E2D1E0212FFE +:100B0000269526952695C20F20E0D21F21E017706A +:100B100019F0220F1A95E9F7089562C385C3C7CB70 +:100B200078949090350160913401D1D06093F200B7 +:100B3000A092F00070903701CC27D92DD695C7959B +:100B4000D695C795D05F18E18FD307C0C05CDF4F43 +:100B500093946091F200A090F000AC2A1FEF809077 +:100B6000360100E0801641F008E08016B8F06623F8 +:100B700019F016956A95E9F7DAD008E01091F200BD +:100B8000011B801AA3941FEF08E0801638F0B1F023 +:100B9000CED01FEF08E0801AA394F6CF882079F01A +:100BA00016958A94E9F71095662341F02227169549 +:100BB00027956A95E1F7BBD0A394122FB8D021DF17 +:100BC0007A9400277012C2CF089500913A010A95D5 +:100BD0000230D0F300913B010330B0F300913801B3 +:100BE0000395009334010091390100933501809001 +:100BF0003A018A948A948092360101E00093370189 +:100C00008FDF009138010093340180903A01809287 +:100C100036013AC000913A010A950230A8F20091DB +:100C20003B01033088F200913801039500933401B1 +:100C3000009139010093350180903A018A948A9499 +:100C40008092360101E0009337016ADF009138019C +:100C500000933401009139010395009335017090A0 +:100C60003B017A947A947092370101E00093360147 +:100C700057DF80903A0100913801080D0A950093E2 +:100C8000340101E00093360100913901039500938E +:100C9000350170903B017A947A947092370140DF6D +:100CA0000091380103950093340180903A018A94B1 +:100CB0008A948092360170903B0100913901070DB2 +:100CC0000A950093350101E00093370129CFAA244A +:100CD00000EFA01A67FFAA246F77685014F0A3945E +:100CE000FCCF685F0895F89435B33C27307C3C27EF +:100CF000789435BB3D2F330F330FC7FB31F9C6FB5B +:100D000030F93BBBF894C39AC398789430930101AF +:100D100000270ABBF894C29ABA98C0980000C09AFB +:100D200009B27894C298BA9A0FEF0ABB0895F89462 +:100D300035B33A25307C3A25789435BB3D2F330FB7 +:100D4000330FA7FA31F9A6FA30F93BBBF894C39AEE +:100D5000C39878943093010100270ABBF894C29A93 +:100D6000BA98C0980000C09AF9B27894C298BA9A1A +:100D70000FEF0ABBB1FE03C01095F12203C0F126AC +:100D8000B0FCF12AF89435B33A25307C3A257894B2 +:100D900035BB3D2F330F330FA7FA31F9A6FA30F9DF +:100DA0003BBBF894C39AC398789430930101FBBA83 +:100DB000F894C29ABA98C1980000C19A7894C298DF +:100DC000BA9A08959924C0E0D0E118E14DD2AA243E +:100DD000A092F0001091F0001C2BF89435B331274D +:100DE000307C3127789435BB3D2F330F330F17FB01 +:100DF00031F916FB30F93BBBF894C39AC398789449 +:100E00003093010100E00BBBF894C29ABA98C198E4 +:100E10000000C19A7894C298BA9AA39400E2A016EE +:100E200019F0A092F000D6CFECDD9394C05CDF4FB8 +:100E3000D03209F0CCCF7727882708951FB60F93BB +:100E40000FEDC02EEF93FF93E42DE05AFF270081B2 +:100E5000FF91EF910CB95A9443940FE040226A94A9 +:100E60000AF046C04BC01FB60F930FEDC02E0CB159 +:100E70005C9938C0E7FC26C0E6FC08C0033029F4C2 +:100E800000E009B9539A00E4E02A38C0602E00E877 +:100E900003190AF40FE7662012F4052D00680CB957 +:100EA000061508F4602E062D0F7739F000ECE02AC5 +:100EB0006A9422F55798559A21C00FEBE022569A72 +:100EC0005E9A1CC0EF93FF93E32DE20DEF77E0599C +:100ED000FF270083FF91EF9133946A947AF40CC05A +:100EE0001FB60F93539807E109B90FEBE022CC240A +:100EF00055985698579A0CB10FE7E0220F911FBEF4 +:100F000018951FB68A9A4CB55DB55093FB00409377 +:100F1000FA008EC01FB68B9A4CB55DB55093F900A0 +:100F20004093F80085C01FB65AB35F935BB35F93DD +:100F30005FEF5ABBB7FE14C0509151015395553223 +:100F400028F4523159F4AF98C49A03C0AF9AC498A8 +:100F500050E0409101014BBBC39AC398509351019B +:100F600055B35F93509101015F9350914501505CDF +:100F70005093450149F450914401539550934401D5 +:100F800019F45FEBB5226CC950EB5FBD4CB55DB594 +:100F9000485F5F4F5BBD4ABD59BD48BD8A9A929A72 +:100FA0008B9A939A8D9895985091FD004091FC00F2 +:100FB0008D9A859907C040389DEF59074AF04150F6 +:100FC000504006C0453D9FEF590712F44F5F5F4FF9 +:100FD0005093FD004093FC005BBD4ABD9091FE0024 +:100FE000491B9091FF00590B1AF445EF5FEF02C0C7 +:100FF00040E85DEF59BD48BD000000000000000062 +:10100000000000005DEF5DBD55E75CBD8A989298D9 +:101010008B98939850EE5FBD5F915BBBC39AC3986A +:10102000509301015F9155BB5F915BBB5F915ABBD0 +:101030001FBE18959924C0E0D0E1A0E0B0E118E10E +:1010400013D1A05CBF4F0A94E1F720E22F93C8D0E0 +:10105000EBD0A395C3952F912A9509F0F7CFD1DC5A +:101060009394A0969096B03209F0EFCFB0CE88DB83 +:101070001F9386DB10934C0183DB1695169516950E +:1010800009F410E210934F017BDB10935001172FEE +:1010900016951695169510934D0180934E0118E103 +:1010A000E3D01F9110FD46C0CC27D0914E019D2E5C +:1010B000D695C795D695C79510914D01C10FD05FB4 +:1010C0002091500110914C01121720F5211BAA27E5 +:1010D000B0914E01B10FB695A795B695A795109111 +:1010E0004D01A10FB05F2F93AF93BF93CF93DF93C9 +:1010F00020914F0168D085DCDF91CF91BF91AF91F6 +:101100002F919394A05CBF4FC05CDF4F2A9559F795 +:1011100020914C012F93CF93DF9320914F015AD010 +:1011200070DCDF91CF912F919394C05CDF4F2A95B3 +:1011300089F7F5CCCC27D0914E0100915001D00F0A +:101140009D2ED695C795D695C79510914D01C10F87 +:10115000D05F202F10914C01121728F5211BAA27D0 +:10116000B0914E01B00FB11BB695A795B695A79556 +:1011700010914D01A10FB05F9A94A054B040C0549B +:10118000D0402F93AF93BF93CF93DF9320914F0124 +:101190001AD037DCDF91CF91BF91AF912F912A9573 +:1011A00059F720914C019A94C054D0402F93CF937B +:1011B000DF9320914F010ED024DCDF91CF912F914E +:1011C0002A9589F7ACCC0CD011962ED021962A9571 +:1011D000D1F7089510E028D021962A95E1F70895D7 +:1011E000F89435B33A27307C3A27789435BB3B2FB7 +:1011F000330F330FA7FB31F9A6FB30F93BBBF89453 +:10120000C39AC39878943093010100270ABBF894DD +:10121000C29ABA98C0980000C09A19B37894C2983C +:10122000BA9A0FEF0ABB0895F89435B33C27307C87 +:101230003C27789435BB3D2F330F330FC7FB31F973 +:10124000C6FB30F93BBBF894C39AC39878943093AB +:1012500001011BBBF894C29ABA98C1980000C19AC8 +:101260007894C298BA9A0895F89435B310FB36F979 +:10127000789435BB089546323444303331393033B5 +:101280003132313730394C034C034C034C034C039F +:101290004C034C034C034C034C034C034C034C03D6 +:1012A0004C034C034C034C034C034C034C034C03C6 +:1012B0004C034C034C034C034C034C034C034C03B6 +:1012C0004C034C034C0300014C034C034C034C03F4 +:1012D0004C034C034C034C034C034C034C034C0396 +:1012E00003014C034C0306010F01180121012A01DF +:1012F00033013C0145014E0157014C034C034C03A3 +:101300004C034C034C034C036001690172017B01E7 +:1013100084018D0196019F01A901B201BB01C401A5 +:10132000CD01D601DF01E801F101080211021A0224 +:1013300023022C0235023E02470250024C034C03AA +:101340004C034C034C034C03590262026B027402BF +:101350007D0286028F029902A302AD02B802C20288 +:10136000CB02D402DD02E602F002FC0203030C030E +:1013700015031E0327033003390343034C034C03B7 +:101380004C034C034C030003066101F8010770880D +:1013900098A8C888700107206020202020700107CD +:1013A000708808102040F80107F810201008887095 +:1013B000010710305090F810100107F880F008086D +:1013C00088700107304080F08888700107F80810A5 +:1013D000204040400107708888708888700107703D +:1013E000888878081060010770888888F8888801E4 +:1013F00007F08888F08888F00107708880808088EE +:10140000700107E09088888890E00107F88080F0FC +:101410008080F80107F88080F08080800107708864 +:1014200080B88888780107888888F88888880221A9 +:10143000078080808080808001070808080808886D +:101440007001078890A0C0A09088010780808080EC +:101450008080F8010788D8A8A8888888010788882C +:10146000C8A89888880107708888888888700107CC +:10147000F08888F0808080010770888888A890684C +:101480004C034C034C03060801014F0065030107A0 +:10149000F08888F0A09088010770888070088870B4 +:1014A0000107F820202020202001078888888888CC +:1014B0008870010788888888885020010788888874 +:1014C000A8A8A8500107888850205088880107885C +:1014D0008888502020200107F80810204080F8015B +:1014E000070000700878887801078080F088888875 +:1014F000F00107000078808080780107080878886C +:10150000888878010700007088F88070010718202B +:10151000F8202020200108000078888878087001D1 +:10152000078080B0C888888802210780008080807A +:101530008080052108100010101010906005210710 +:10154000808090A0C0A090032107C0404040404050 +:101550004001070000F0A8A8A8A801070000B0C833 +:10156000888888010700007088888870010800005A +:10157000F08888F080800108000078888878080862 +:1015800002056105B0C0808080010700007880708E +:1015900008F001072020F82020201801070000880B +:1015A0008888986801070000888888502001070013 +:1015B000008888A8A85001070000885020508801A2 +:1015C00008000088888878087001070000F810205B +:1015D00040F80107F8F8F8F8F8F8F80070933801C7 +:1015E00080933901CDD810933A01CAD810933B01AA +:1015F00026D05DC67093380180933901C1D810930D +:101600003A01BED810933B012FD051C670933401DC +:1016100080933501B5D810933601B2D810933701B5 +:1016200078D045C67093340180933501A9D81093C2 +:101630003601A6D81093370171D039C608950091AC +:101640003801009334010091390100933501009174 +:101650003A010093360100913B010093370102E00B +:10166000B02A5EDA0DEFB02200913A010A950230FD +:1016700028F300913B01033008F3009138010093F7 +:101680003401009139010093350100913A01009332 +:10169000360101E00093370143DA009138010093ED +:1016A00034010091390103950093350100913B010C +:1016B00002500093370101E00093360131DA809047 +:1016C0003A0100913801080D0A950093340101E0B8 +:1016D0000093360100913901039500933501009183 +:1016E0003B010250009337011BDA0091380100934F +:1016F000340100913A010093360170903B01009152 +:101700003901070D0A950093350101E00093370177 +:1017100007CA02E0B02A04DA0DEFB0227894909064 +:10172000350160913401D3DA6093F200A092F000A9 +:1017300070903701CC27D92D15E5D0FF1AEA012E7C +:10174000D695C795D695C795D05F18E18DDD07C0B2 +:10175000C05CDF4F93946091F200A090F000AC2A3F +:101760001FEF8090360100E0801641F008E08016FF +:10177000C8F0662319F016956A95E9F71021D7DAB3 +:1017800008E01091F200011B801AA3941FEF08E0FB +:10179000801640F0C1F01021CADA1FEF08E0801A6D +:1017A000A394F5CF882089F016958A94E9F71095CF +:1017B000662349F02227169527956A95E1F71021AF +:1017C000B6DAA394122F1021B2DA00941AD97A94BF +:0817D00000277012BDCF08953F +:0220000003419A +:00000001FF diff --git a/src/avr/ISPD.EXE b/src/avr/ISPD.EXE new file mode 100644 index 00000000..747ba737 Binary files /dev/null and b/src/avr/ISPD.EXE differ diff --git a/src/avr/ISPD.INI b/src/avr/ISPD.INI new file mode 100644 index 00000000..f90fec49 --- /dev/null +++ b/src/avr/ISPD.INI @@ -0,0 +1,16 @@ +-1 +0 +0 +-1 + +WPOV2.HEX + + +00 +0 +9600 +-1 +0 + + + diff --git a/src/avr/MAKCHR.LOG b/src/avr/MAKCHR.LOG new file mode 100644 index 00000000..44dd8ad4 --- /dev/null +++ b/src/avr/MAKCHR.LOG @@ -0,0 +1,96 @@ +CHR=00 PTR=034C XB= 1 YB= 7 +CHR=01 PTR=034C XB= 1 YB= 7 +CHR=02 PTR=034C XB= 1 YB= 7 +CHR=03 PTR=034C XB= 1 YB= 7 +CHR=04 PTR=034C XB= 1 YB= 7 +CHR=05 PTR=034C XB= 1 YB= 7 +CHR=06 PTR=034C XB= 1 YB= 7 +CHR=07 PTR=034C XB= 1 YB= 7 +CHR=08 PTR=034C XB= 1 YB= 7 +CHR=09 PTR=034C XB= 1 YB= 7 +CHR=0A PTR=034C XB= 1 YB= 7 +CHR=0B PTR=034C XB= 1 YB= 7 +CHR=0C PTR=034C XB= 1 YB= 7 +CHR=0D PTR=034C XB= 1 YB= 7 +CHR=0E PTR=034C XB= 1 YB= 7 +CHR=0F PTR=034C XB= 1 YB= 7 +CHR=10 PTR=034C XB= 1 YB= 7 +CHR=11 PTR=034C XB= 1 YB= 7 +CHR=12 PTR=034C XB= 1 YB= 7 +CHR=13 PTR=034C XB= 1 YB= 7 +CHR=14 PTR=034C XB= 1 YB= 7 +CHR=15 PTR=034C XB= 1 YB= 7 +CHR=16 PTR=034C XB= 1 YB= 7 +CHR=17 PTR=034C XB= 1 YB= 7 +CHR=18 PTR=034C XB= 1 YB= 7 +CHR=19 PTR=034C XB= 1 YB= 7 +CHR=1A PTR=034C XB= 1 YB= 7 +CHR=1B PTR=034C XB= 1 YB= 7 +CHR=1C PTR=034C XB= 1 YB= 7 +CHR=1D PTR=034C XB= 1 YB= 7 +CHR=1E PTR=034C XB= 1 YB= 7 +CHR=1F PTR=034C XB= 1 YB= 7 +CHR=20 PTR=0100 +CHR=21 PTR=034C XB= 1 YB= 7 +CHR=22 PTR=034C XB= 1 YB= 7 +CHR=23 PTR=034C XB= 1 YB= 7 +CHR=24 PTR=034C XB= 1 YB= 7 +CHR=25 PTR=034C XB= 1 YB= 7 +CHR=26 PTR=034C XB= 1 YB= 7 +CHR=27 PTR=034C XB= 1 YB= 7 +CHR=28 PTR=034C XB= 1 YB= 7 +CHR=29 PTR=034C XB= 1 YB= 7 +CHR=2A PTR=034C XB= 1 YB= 7 +CHR=2B PTR=034C XB= 1 YB= 7 +CHR=2C PTR=034C XB= 1 YB= 7 +CHR=2D PTR=0103 XB= 1 YB= 1 YO= 3 PW= 6 +CHR=2E PTR=034C XB= 1 YB= 7 +CHR=2F PTR=034C XB= 1 YB= 7 +CHR=30 PTR=0106 XB= 1 YB= 7 +CHR=31 PTR=010F XB= 1 YB= 7 +CHR=32 PTR=0118 XB= 1 YB= 7 +CHR=33 PTR=0121 XB= 1 YB= 7 +CHR=34 PTR=012A XB= 1 YB= 7 +CHR=35 PTR=0133 XB= 1 YB= 7 +CHR=36 PTR=013C XB= 1 YB= 7 +CHR=37 PTR=0145 XB= 1 YB= 7 +CHR=38 PTR=014E XB= 1 YB= 7 +CHR=39 PTR=0157 XB= 1 YB= 7 +CHR=3A PTR=034C XB= 1 YB= 7 +CHR=3B PTR=034C XB= 1 YB= 7 +CHR=3C PTR=034C XB= 1 YB= 7 +CHR=3D PTR=034C XB= 1 YB= 7 +CHR=3E PTR=034C XB= 1 YB= 7 +CHR=3F PTR=034C XB= 1 YB= 7 +CHR=40 PTR=034C XB= 1 YB= 7 +CHR=41 PTR=0160 XB= 1 YB= 7 +CHR=42 PTR=0169 XB= 1 YB= 7 +CHR=43 PTR=0172 XB= 1 YB= 7 +CHR=44 PTR=017B XB= 1 YB= 7 +CHR=45 PTR=0184 XB= 1 YB= 7 +CHR=46 PTR=018D XB= 1 YB= 7 +CHR=47 PTR=0196 XB= 1 YB= 7 +CHR=48 PTR=019F XB= 1 YB= 7 +CHR=49 PTR=01A9 XB= 1 YB= 7 PW= 2 +CHR=4A PTR=01B2 XB= 1 YB= 7 +CHR=4B PTR=01BB XB= 1 YB= 7 +CHR=4C PTR=01C4 XB= 1 YB= 7 +CHR=4D PTR=01CD XB= 1 YB= 7 +CHR=4E PTR=01D6 XB= 1 YB= 7 +CHR=4F PTR=01DF XB= 1 YB= 7 +CHR=50 PTR=01E8 XB= 1 YB= 7 +CHR=51 PTR=01F1 XB= 1 YB= 7 +CHR=52 PTR=0208 XB= 1 YB= 7 +CHR=53 PTR=0211 XB= 1 YB= 7 +CHR=54 PTR=021A XB= 1 YB= 7 +CHR=55 PTR=0223 XB= 1 YB= 7 +CHR=56 PTR=022C XB= 1 YB= 7 +CHR=57 PTR=0235 XB= 1 YB= 7 +CHR=58 PTR=023E XB= 1 YB= 7 +CHR=59 PTR=0247 XB= 1 YB= 7 +CHR=5A PTR=0250 XB= 1 YB= 7 +CHR=5B PTR=034C XB= 1 YB= 7 +CHR=5C PTR=034C XB= 1 YB= 7 +CHR=5D PTR=034C XB= 1 YB= 7 +CHR=5E PTR=034C XB= 1 YB= 7 +CHR=5F PTR=034C XB= 1 YB= 7 diff --git a/src/avr/MT102V0.HEX b/src/avr/MT102V0.HEX new file mode 100644 index 00000000..6263fea7 --- /dev/null +++ b/src/avr/MT102V0.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F445E049B9539A40E4542AFD +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE849B9B9 +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE809B900E90AB9B7 +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541B2AC38 +:00000001FF diff --git a/src/avr/MT102V1.HEX b/src/avr/MT102V1.HEX new file mode 100644 index 00000000..1e074a5a --- /dev/null +++ b/src/avr/MT102V1.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F445E049B9539A40E4542AFD +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE849B9B9 +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE809B900E90AB9B7 +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541BAAC30 +:00000001FF diff --git a/src/avr/MT102V2.HEX b/src/avr/MT102V2.HEX new file mode 100644 index 00000000..9d5f9c2b --- /dev/null +++ b/src/avr/MT102V2.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F443E049B9539A40E4542AFF +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE549B9BC +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE509B900E90AB9BA +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541B2AC38 +:00000001FF diff --git a/src/avr/TAVRASM.EXE b/src/avr/TAVRASM.EXE new file mode 100644 index 00000000..dddb3ae5 Binary files /dev/null and b/src/avr/TAVRASM.EXE differ diff --git a/src/avr/TSV3.HEX b/src/avr/TSV3.HEX new file mode 100644 index 00000000..0b6e310f --- /dev/null +++ b/src/avr/TSV3.HEX @@ -0,0 +1,504 @@ +:020000020000FC +:100000000DC006C606C6189505C61895189518950C +:1000100002C602C61895EDC6D7C62EC702E00EBFAF +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300000935F01009360010093610100936201EE +:10004000009363010093640101E000936501009354 +:10005000660104E10093670108E002BD03E005BD0D +:1000600000E409BF00E00BBF08EB01BB02BB0FE1DE +:1000700007BB0FEF0ABB04BB00270BBB03E008BBA9 +:1000800000E105BBC29AC2980093190100E2B02EAC +:100090001FE519B910E91AB9442455242224332440 +:1000A000EE246624CC2458E15BBBC49AC4985093D8 +:1000B000170155275093180150933B0150936A0143 +:1000C00050936B0150931001DD24D0921401D09213 +:1000D0001501D092160154EF509369015BBB50910A +:1000E000190155BBA89AC29AC298A898C29AC298F8 +:1000F0007894E2E0F9E1A2EEB0E0DBE1D0931A01FE +:1001000008D1D0E8C0ECDBBBC39AC398D0931801E8 +:10011000C5BBC89500240BBAC198C0980000C09A0E +:10012000C19AAA9541F03196C3951C2F1F7381F790 +:10013000C054D395E8CF10E3D9D2CF93DF93E4D264 +:10014000BF91AF915FD5212F1D2F129533D3121779 +:10015000B1F4119657D5212F1D2F2CD3121779F4F6 +:10016000119650D5212F1C2F129524D3121739F434 +:10017000119648D5212F1C2F1DD3121709F1E4EE3B +:10018000F9E1A6E6B3E0D9E1D0931A01C2D0D0E0FC +:10019000C0E4DBBBC39AC398D0931801C5BBC89514 +:1001A0000BBAC198C0980000C09AC19A119741F04B +:1001B0003196C3951C2F1F7389F7C054D395E9CF8F +:1001C00020E12093030120E42093040129E12093FE +:1001D0000501C0E0D0E218E118D520E82F93CF93B5 +:1001E000DF9320E211D5269622E00ED5DF91CF9144 +:1001F0002F91C05CDF4F2A9589F7B4D610E0109399 +:10020000110116E31093100110E01093680110E043 +:1002100010934C0110934D011EEF10930D011CEA39 +:1002200010930C0122E020D21C7F10930E0123E0DA +:100230001BD210930F0110910E0120910F011A3360 +:100240000DEF200720F01C3B0DEF200730F01DEFD5 +:1002500010930F0110E810930E011FEF19BD18E362 +:1002600018BD1CEF1DBD1EEC1CBD10E51FBD11E02F +:100270001EBD00E003BF05E008BF05E409BF0AE0BA +:1002800005BF00EC0ABF0BBF9EC202E00EBF0FE528 +:100290000DBF50E05FBD5EBD949A959850911701D7 +:1002A0005F7B5BBBC49AC4985093170154E7B6FEBA +:1002B00054E3509369015BBB5091190155BBA89A57 +:1002C000C29AC298A898C29AC29851E459BF50E005 +:1002D00053BF5BBF04E000936A011FE519B910E941 +:1002E0001AB94424552422243324EE246624CC2431 +:1002F000F89403B700230AE411F4809B0AE705BFD2 +:1003000078948895A89500916A01002389F7F8945C +:10031000A3CED0911A01C0911701C07EDC2BDBBBAC +:10032000C49AC498D0931701089578941FEDE122E0 +:1003300010E01EBB1FBBE2D21B3159F1B3FC0DC054 +:10034000103258F4183009F407C11D3009F41CC1EB +:100350001A3009F4C0C0173041F7B2FC18C010338E +:10036000B1F4C0910301D091040120910501CC5F4B +:10037000DD4FF894309117013227307E32273BBB96 +:10038000C49AC49878943093170193D5102DECD269 +:10039000CCCFB4D21B3109F31E3209F47CC11F3219 +:1003A00009F452C01F3309F491C1123409F45EC03C +:1003B000123609F45FC0133409F40BC1133609F483 +:1003C000C4CC143409F4F2C0153409F4DFC0163477 +:1003D00009F40FC1163609F4C4CC173409F4A1C0CE +:1003E000183409F4D6CC183609F4C7CC1B3409F4F8 +:1003F00096C01C3409F40AC41D3409F42EC01E34FE +:1004000009F403C1103509F49AC0123509F4E3C0A8 +:10041000133509F4D9C0143509F440C0153509F471 +:100420006BC2163519F410E2E12AFBC0173509F446 +:1004300063C2183509F4C4C11A3509F4EEC110338A +:1004400010F01A3310F171CF59D210FF03C014E02D +:10045000B12A6BCF1BEFB12268CF50D2103329F4F1 +:10046000F89400E4B02A8A9A10CF5FCF47D21F9346 +:1004700010E004C043D21F9341D21F7010931101AA +:100480001F911093100151CF39D230D1C0E1C093E8 +:100490000301D09304012093050147CF10E015BD5F +:1004A00010935F01109360011093610127D21093A4 +:1004B000640124D21093630121D2109362011ED2F1 +:1004C000109366011BD21093650118D21093670137 +:1004D00013E015BD2ACF01D028CF0F92C0910301A0 +:1004E000D091040120910501DE5FC395F89430910D +:1004F00017013227307E32273BBBC49AC4987894C8 +:1005000030931701D6D4182F100D100D1A951038EE +:1005100018F0C0D00F900895800D0F90089522D547 +:1005200004CFECD1103309F404C0113309F404C032 +:10053000FCCE07EFB022F9CE08E0B02AF6CEDED12D +:10054000103309F403C0113309F403C00FEEB022D5 +:10055000ECCE00E1B02AE9CEC0910301D0910401B4 +:1005600020910501DE5FF894309117013227307E2B +:1005700032273BBBC49AC49878943093170199D41E +:1005800070191FB712FFD1CE7727CFCEB7D111FD8B +:1005900007C010FD03C00FEDB022C7CE00E2B02AA5 +:1005A000002700933B01EAD2F1F7BFCEA7D1103369 +:1005B00009F404C0113309F404C0B7CE0EEFB02221 +:1005C000B4CE01E0B02AB1CE99D1712F97D1812F4D +:1005D000ACCE02E0B02A70935201809353018ED1C9 +:1005E000109354018BD11093550117D30DEFB02206 +:1005F0009CCE709356018093570180D1109358017F +:100600007DD1109359015ED390CE709356018093A3 +:10061000570174D11093580171D11093590177D3B8 +:1006200084CE6CD110FF0BC010910E0120910F01F0 +:100630001C5F2F4F1C3B0DEF2007A8F40AC0109140 +:100640000E0120910F01145020401A330DEF2007A6 +:1006500050F010930E0120930F0122E00DD0109165 +:100660000F0123E009D061CEE199FECF2EBB2227F6 +:100670002FBBE09A1DB30895E199FECFE5FEFFCFB1 +:100680002EBB22272FBB1DBBF894E5FEFFCFE29ABD +:10069000E19A189536C732D129D030D1A12F2ED169 +:1006A000B12F2CD1F894309117013227307E3227A8 +:1006B0003BBBC49AC498789430931701A4D2219676 +:1006C00011971A2F1B2B09F0ECCF2FCE17D10ED07C +:1006D0001F931AD01BE133D11FE331D11F91105D5D +:1006E0002ED11D2F60D01C2F5ED01FCEC0E0D0E0D9 +:1006F00024E61F701A3008F4210F2695D795269509 +:10070000D795D695D6950895A6E1B2E0AC0FBD1F5A +:10071000F894309117013227307E32273BBBC49AC0 +:10072000C4987894309317016DD2E12F11966AD254 +:10073000F12FAC2FBD2F1496CFEFDFEF3197FF7065 +:10074000349780F131965ED2119601E220E1D127F3 +:10075000CC0FDD1F10F4C027D227CC0FDD1F10F403 +:10076000C027D227CC0FDD1F10F4C027D227CC0F13 +:10077000DD1F10F4C027D227CC0FDD1F10F4C027D7 +:10078000D227CC0FDD1F10F4C027D227CC0FDD1FDE +:1007900010F4C027D227CC0FDD1F10F4C027D227BA +:1007A000319789F608951F93129504D0C8D01F91F0 +:1007B00001D0C5C01F7010631A3308F0195F089587 +:1007C0009DD010FD13C070936C0180936D01B092A9 +:1007D0006E011091030110936F01109104011093A9 +:1007E000700110910501109371019FCD70916C0102 +:1007F00080916D0110ECB12210916E011F73B12A2E +:1008000010916F0110930301109170011093040176 +:10081000109171011093050188CD70D010935A0189 +:100820006DD0C12F175F5DD020935B0167D0D12FB2 +:100830001C5F5CD020935C0161D01C0F1F5051D015 +:1008400020935D015BD01D0F115150D020935E01AC +:10085000D0915C0110915E011D1B08F441C0C09154 +:100860005B011C2F1D0F2D2F220F220F220F120FA5 +:10087000220F120FA0E0B0EE20E0A10FB21F2BE17B +:10088000F894309117013227307E32273BBBC49A4F +:10089000C49878943093170110915D011C1BF0F0FF +:1008A0003A2F3F7335BB3B2F330F330FA7FB31F983 +:1008B000A6FB30F93BBBF894C39AC3987894309365 +:1008C000180110915A011BBBF894C198C098000000 +:1008D000C09A7894C19A1196C395DECFD395BACFBA +:1008E00024CD2FEF23951A50E8F708952FEF239585 +:1008F0001D50E8F7089502D001D017CD10EC1093E9 +:100900006B01A89510E01EBB1FBB10EC80991093E3 +:100910006B01B5FC33D13320A1F310E010936B01D0 +:10092000CF93DF93C22DC058DD271881F8943A94F5 +:100930002394CFE72C227894DF91CF9108951F93D1 +:10094000A895152D1032E0F71F91CF93DF93DFB7F5 +:10095000F894C52DC40DDFBFCF71C05ADD271883B1 +:100960005394DF91CF910895D2D0EFD00027009318 +:100970001201B4FC0FC0C0910301D0910401DE5FED +:10098000F02C97D20F920F1808F4002406940092CE +:1009900012010F90B3FC08C0072F000D28F4772731 +:1009A0009CDD10910501B9D600911201070F00934B +:1009B0004E0180934F01700D60914E0190904F0158 +:1009C00086FE07C0C0915001D0915101229771D28B +:1009D000900C87FE07C0C0915001D0915101239720 +:1009E00068D2600D5AD260930201A0920001C091BA +:1009F0005001D091510121965CD2702C0FEF0ABBAF +:100A0000C09A0FE18022809201010027801201C06C +:100A10007DC0AA27B92DB695A795B695A795B05EC6 +:100A200007C09394A05CBF4F80900101A09000018B +:100A3000AA2A22272196109105016FD63AD21127B2 +:100A400060910201662339F08894079417956A959E +:100A5000E1F7022A212F08E1F8943091170130279D +:100A6000307E30273BBBC49AC498789430931701EA +:100A70003A2D3F7335BB3B2F330F330FA7FA31F9B4 +:100A8000A6FA30F93BBBF894C39AC3987894309394 +:100A9000180100270ABBF894C0980000C19809B358 +:100AA0000026B0FC002A0FEF0ABB0BBA0000C09A68 +:100AB0007894C19AA3948A9409F0BCCF222311F1AF +:100AC0003A2D3F7335BB3B2F330F330FA7FA31F964 +:100AD000A6FA30F93BBBF894C39AC3987894309344 +:100AE000180100270ABBF894C0980000C19809B308 +:100AF0002027B0FC202B0FEF0ABB2BBB0000C09AB5 +:100B00007894C19A31D07A9409F08BCF0895C12F8F +:100B1000DD27CC0FDD1F10910301C10F10910401DF +:100B2000D11F10910501F9D5C4D12196F02CC1D166 +:100B3000CF2DD02D10910301C10F10910401D11FB1 +:100B4000C0935001D09351010895C0915001D091AC +:100B50005101AFD1802C219785FCABC1C09103011D +:100B6000D0910401DE5FA5C1CF93DF93192D39D059 +:100B70001881122B1883DF91CF9108952F93CF9373 +:100B8000DF9310913B012DD01881122309F41FC06F +:100B900028812127288310E010936B01AF93BF9326 +:100BA000CC27D0913B01D695C795D695C795AC2F4C +:100BB000BD2FB05E18E1B1D520E26CD51297269614 +:100BC00022E068D5BF91AF9110EC10936B011091AA +:100BD0003B0113951F7710933B01DF91CF912F912C +:100BE0000895CCE3D1E01F77212F269526952695F1 +:100BF000C20F20E0D21F21E0177019F0220F1A95C2 +:100C0000E9F7089554C56FC54CC587C597C48DCB0A +:100C1000DFC1DFC18FC5E6C1C6C278949090530191 +:100C2000609152013AD160930201A092000170904C +:100C30005501CC27D92DD695C795D695C795D05EA9 +:100C400018E16BD507C0C05CDF4F9394609102013F +:100C5000A0900001AC2A1FEF8090540100E08016A4 +:100C600041F008E08016B8F0662319F016956A95F1 +:100C7000E9F73BD108E010910201011B801AA3940F +:100C80001FEF08E0801638F0B1F02FD11FEF08E019 +:100C9000801AA394F6CF882079F016958A94E9F704 +:100CA0001095662341F02227169527956A95E1F75E +:100CB0001CD1A394122F19D157DF7A9400277012F8 +:100CC000C2CF0895009158010A950230D0F30091E7 +:100CD00059010330B0F3009156010395009352017E +:100CE0000091570100935301809058018A948A948F +:100CF0008092540101E0009355018FDF009156016D +:100D00000093520180905801809254013AC00091A2 +:100D100058010A950230A8F200915901033088F277 +:100D200000915601039500935201009157010093E1 +:100D30005301809058018A948A948092540101E072 +:100D4000009355016ADF0091560100935201009112 +:100D50005701039500935301709059017A947A9446 +:100D60007092550101E00093540157DF80905801C3 +:100D700000915601080D0A950093520101E000937D +:100D8000540100915701039500935301709059014C +:100D90007A947A947092550140DF00915601039540 +:100DA00000935201809058018A948A948092540151 +:100DB0007090590100915701070D0A950093530156 +:100DC00001E00093550129CF1FB60F930FEDC02E00 +:100DD000EF93FF93E42DE05AFF270081FF91EF91FD +:100DE0000CB95A9443940FE140226A940AF04CC023 +:100DF00051C01FB60F930FEDC02E0CB15C993EC0D1 +:100E0000E7FC2CC0E6FC0EC0023031F403E009B967 +:100E1000539A00E4E02A3EC00A3A19F400E0009335 +:100E20006A0138C0602E00E803190AF40FE7662053 +:100E300012F4052D00680CB9061508F4602E062D75 +:100E40000F7739F000ECE02A6A9422F55798559A0A +:100E500021C00FEBE022569A5E9A1CC0EF93FF93DD +:100E6000E32DE20DEF77E058FF270083FF91EF912C +:100E700033946A947AF40CC01FB60F9353980FE51D +:100E800009B90FEBE022CC2455985698579A0CB12B +:100E90000FE7E0220F911FBE1895AA2400EFA01AB9 +:100EA00067FFAA246F77685014F0A394FCCF685FA3 +:100EB00008953C2F3F7335BB3D2F330F330FC7FBD6 +:100EC00031F9C6FB30F93BBBF894C39AC3987894C8 +:100ED0003093180100270ABBF894C0980000C09A0C +:100EE00009B278940FEF0ABB08953A2D3F7335BBD2 +:100EF0003D2F330F330FA7FA31F9A6FA30F93BBB78 +:100F0000F894C39AC39878943093180100270ABBC9 +:100F1000F894C0980000C09AF9B278940FEF0ABB19 +:100F2000B1FE03C01095F12203C0F126B0FCF12AF6 +:100F30003A2D3F7335BB3D2F330F330FA7FA31F9ED +:100F4000A6FA30F93BBBF894C39AC39878943093CF +:100F50001801FBBAF894C198C0980000C09A789420 +:100F6000C19A0895772788279924C0E0D0E218E134 +:100F7000D4D3AA24A0920001109100011C2B312F80 +:100F80003F7335BB3D2F330F330F17FB31F916FB82 +:100F900030F93BBBF894C39AC39878943093180106 +:100FA00000E00BBBF894C198C0980000C09A7894F8 +:100FB000C19AA39400E2A01619F0A0920001DCCF20 +:100FC000D3DD9394C05CDF4FD03409F0D2CF0895C5 +:100FD00018951FB68B9A4CB55DB550930901409397 +:100FE000080114C11FB65AB35F935BB35F9355B347 +:100FF0005F93509118015F935FEF5ABB50E75FBD5D +:101000004CB55DB5485F5F4F5BBD4ABD59BD48BD3E +:1010100040914C0150914D015170452B49F4509134 +:101020006B01539550936B0151F45FEBB5222DC9C1 +:1010300000000000000000000000000000008B9A8B +:10104000939A55275EBD5DBD5CBD50914D01542BFB +:1010500071F0509117015BBBC49ADD9ADD98C4987A +:101060000000000000000000000000000EC05091D1 +:101070001701506850625BBBC49A40E654275BBBC3 +:101080005F775BBBC49850931701509117015F9332 +:10109000EF93FF93E0914C01F0914D01E05CFF4F25 +:1010A000FF713F933E2F3F7335BB3F2F330F330FFD +:1010B000E7FB31F9E6FB30F93BBBC39AC398F093E9 +:1010C000180130911701F7FB31F9F6FB30F93BBB02 +:1010D000C49AC498309317013F91C198C19A9798C8 +:1010E00044274ABB40EC44BBC09855275BBD5ABD62 +:1010F00059E05EBDE0934C01F0934D01FF91EF91FB +:101100005CE35A95F1F7C09A5FEF5ABB979A54BBCC +:101110008D98959851E000005EBD5BE05A95F1F71F +:1011200050910D0140910C018D9A859907C04A3369 +:101130009DEF590752F0415050400BC0453D9FEF85 +:1011400059071AF44F5F5F4F04C000000000000011 +:10115000000050930D0140930C015BBD4ABD4091CE +:101160000C0150910D0190910E01491B90910F01BE +:10117000590B1AF445ED5FEF04C04CEA5EEF000036 +:10118000000059BD48BD52E053BF5DEE52BF51E073 +:10119000509368015DEF5DBD54E35CBD8B989398FF +:1011A00050EE5FBD21C01FB65AB35F935BB35F9330 +:1011B00055B35F93509118015F93509117015F935E +:1011C000FF93EF930F925FEF5ABB509168015395D5 +:1011D000509368015A95E1F05A9511F15A9509F426 +:1011E00089C00F90EF91FF915F915BBBC49AC49847 +:1011F000509317015F915BBBC39AC398509318013A +:101200005F9155BB5F915BBB5F915ABB1FBE189549 +:1012100053E053BF50EF52BF51E05093680153C1A8 +:1012200050911001552399F150911101505118F02E +:10123000509311012CC0452F429554235093110116 +:101240004091190143FF10C0509110015A955093DD +:101250001001A1F050911901577F546055BBC29AFB +:10126000C2985093190113C05091190158605B7FC7 +:1012700055BBC29AC2985093190109C050911901E7 +:10128000577F5B7F55BBC29AC2985093190150910A +:10129000690157FF06C050E8B5261AF4552753BF19 +:1012A000A0CF52E053BF52EF52BFEAE3F8E1552717 +:1012B000ED0DF51FC89554E3D51648F4509119016A +:1012C0005F7E55BBC29AC2985093190108C05091D5 +:1012D0001901506155BBC29AC298509319010BBABB +:1012E0000090190105BAA99AC29AC298A998C29AFF +:1012F000C29877CF50B340EE4BBB4091190145BB2C +:10130000A99AC29AC298A998C29AC298889456FD7E +:1013100008C050911301552319F054E05093130164 +:1013200008944FB754E3D51660F44FBFE091150110 +:10133000F0911601EE1FFF1FE0931501F0931601C7 +:101340007BC04FBF08F078C050911301552321F0A6 +:1013500054E05093130170C0F0911601E091150113 +:1013600050911401552329F0452FF795E7954450E6 +:10137000E1F75C5FF795E79518F05433D0F35CC064 +:101380005093140144E3451BECE3F8E15527E40FC7 +:10139000F51FC895402D000C000C000C400D000CF2 +:1013A000400DECE3F8E15527ED0DF51FC895400D14 +:1013B000E0E0F0EE5527E40FF51F3F933E2F3F731B +:1013C00035BB3F2F330F330FE7FB31F9E6FB30F925 +:1013D0003BBBC39AC398F093180130911701F7FBF8 +:1013E00031F9F6FB30F93BBBC49AC498309317012E +:1013F0003F910F9300270ABBC0980000C09A09B222 +:101400000FEF0ABB0F91002029F4509114015433BF +:1014100098F45EC054E0509313010092070156E324 +:1014200050931001552D5F3138F41F93102D8DDA34 +:101430001B3109F48ADA1F9154E0D50E50916901ED +:1014400057FD27C053E053BF50EF52BF51E05093B8 +:10145000680144E3D416E8F250E053BF50911601FE +:1014600040911501452B50916A01543018F45130C8 +:1014700028F4B7CE442329F055E003C0442309F4EF +:1014800054E05A9550936A01A1F75FEBB5228A9810 +:10149000CECD50E053BF5093140148ECD416C0F0A9 +:1014A00050911301552379F05A955093130159F433 +:1014B00050910701552339F0552D503220F41F93D8 +:1014C00010E043DA1F91DD24D0921501D09216016D +:1014D000EAE3F8E131965527ED0DF51FC8955091D7 +:1014E0006901507850645029509369015BBB509159 +:1014F000190155BBA89AC29AC298A898C29AC298D4 +:1015000070CE9924C0E0D0E2A0E0B0E218E105D1AD +:10151000A05CBF4F0A94E1F720E22F93C8D0E3D03C +:10152000A395C3952F912A9509F0F7CF1DDB9394CE +:10153000A0969096B03409F0EFCF1BCDDFD91F9362 +:10154000DDD910937201DAD916951695169509F41E +:1015500010E210937501D2D910937601172F1695CA +:1015600016951695109373018093740118E1D5D0E8 +:101570001F9110FD46C0CC27D09174019D2ED695A9 +:10158000C795D695C79510917301C10FD05E209174 +:10159000760110917201121720F5211BAA27B09134 +:1015A0007401B10FB695A795B695A79510917301E3 +:1015B000A10FB05E2F93AF93BF93CF93DF93209192 +:1015C000750168D0D1DADF91CF91BF91AF912F91A2 +:1015D0009394A05CBF4FC05CDF4F2A9559F72091D0 +:1015E00072012F93CF93DF93209175015AD0BCDA0B +:1015F000DF91CF912F919394C05CDF4F2A9589F7AB +:1016000006CBCC27D091740100917601D00F9D2E8E +:10161000D695C795D695C79510917301C10FD05E29 +:10162000202F10917201121728F5211BAA27B091C3 +:101630007401B00FB11BB695A795B695A7951091FB +:101640007301A10FB05E9A94A054B040C054D04032 +:101650002F93AF93BF93CF93DF93209175011AD04F +:1016600083DADF91CF91BF91AF912F912A9559F7EE +:10167000209172019A94C054D0402F93CF93DF935E +:10168000209175010ED070DADF91CF912F912A95BC +:1016900089F7BDCA0CD0119626D021962A95D1F78C +:1016A000089510E020D021962A95E1F708953A2F69 +:1016B0003F7335BB3B2F330F330FA7FB31F9A6FB2D +:1016C00030F93BBBF894C39AC398789430931801CF +:1016D00000270ABBF894C0980000C09A19B3789408 +:1016E0000FEF0ABB08953C2F3F7335BB3D2F330FDF +:1016F000330FC7FB31F9C6FB30F93BBBF894C39AF3 +:10170000C3987894309318011BBBF894C198C09883 +:101710000000C09A7894C19A0895F8943091170106 +:101720003127307E31273BBBC49AC49878943093DC +:10173000170108951FB650915F015C5550935F01EA +:10174000509160015F4F5093600150916101564E7E +:10175000543650F4509361011FBEB6FE189550E008 +:101760005093680120CDF1C850E050936101509131 +:10177000620153955C33E8F15091630153955C33FA +:10178000A8F1509164015395583168F1EF93FF939C +:101790000F92EDE2F8E190916601E90F90E0F91FF8 +:1017A000C895902D9C3131F49091670193709CE124 +:1017B00009F49DE10F90FF91EF9150916501591748 +:1017C00070F0509166015C3030F050916701539594 +:1017D00050936701552753955093660155275395AC +:1017E0005093650155275093640155275093630129 +:1017F000552750936201552D5931C0F41F931BE1B9 +:10180000A4D814E5A2D810916401ADDF1091630152 +:10181000AADF10916201A7DF10916601A4DF109189 +:101820006501A1DF109167019EDF1F9195CF1F1CFD +:101830001F1E1F1E1F1F1E1F1E1FF0340000E83436 +:101840000100F0330100E8330200E4330300E83222 +:101850000300E4320400E2320500E4310500E23125 +:101860000600E1310700E2300700E1300800C12A3C +:101870000000C22A0100C12B0100C22B0200C42BB0 +:101880000300C22C0300C42C0400C82C0500C4189B +:101890000500C8180600D0180700C8190700D0199D +:1018A0000800A1190900D01A0900A11A0A00A21AF9 +:1018B0000B00A11B0B00A21B0C00A41B0D00A21C03 +:1018C0000D00A41C0E00A81C0F00A41D0F00A81DD5 +:1018D0001000B01D1100A81E1100B01E1200611EE4 +:1018E0001300B01F1300611F1400621F1500612850 +:1018F0001500622816006428170062291700642961 +:1019000018000000000000000000000000000000BF +:1019100000000000000000000808080000000000AF +:1019200000000000000000000000000000000000B7 +:10193000000000007E00310032003300340035002A +:10194000360037003800390030002D003D0000001F +:101950000000000000000000000000000000000087 +:1019600000000000000051005700450052005400E4 +:101970005900550049004F0050005B005D005C00BD +:101980000000000000000000000000000000000057 +:101990000000000000000000410053004400460029 +:1019A000470048004A004B004C003B0027000D0D4B +:1019B0000D0000000000000000000000000000001A +:1019C0000000000000000000000000005A00580065 +:1019D0004300560042004E004D002C002E002F0008 +:1019E0000000000046323444303331393033313274 +:1019F000313730394C034C034C034C034C034C033C +:101A00004C034C034C034C034C034C034C034C035E +:101A10004C034C034C034C034C034C034C034C034E +:101A20004C034C034C034C034C034C034C034C033E +:101A30004C034C0300014C034C034C034C034C037C +:101A40004C034C034C034C034C034C034C03030169 +:101A50004C034C0306010F01180121012A01330137 +:101A60003C0145014E0157014C034C034C034C0310 +:101A70004C034C034C036001690172017B0184013A +:101A80008D0196019F01A901B201BB01C401CD01E5 +:101A9000D601DF01E801F101080211021A02230256 +:101AA0002C0235023E02470250024C034C034C0309 +:101AB0004C034C034C03590262026B0274027D0218 +:101AC00086028F029902A302AD02B802C202CB02C3 +:101AD000D402DD02E602F002FC0203030C0315034C +:101AE0001E0327033003390343034C034C034C0309 +:101AF0004C034C030003066101F80107708898A8A5 +:101B0000C88870010720602020202070010770889D +:101B100008102040F80107F810201008887001070D +:101B200010305090F810100107F880F00808887005 +:101B30000107304080F08888700107F808102040C5 +:101B40004040010770888870888870010770888815 +:101B500078081060010770888888F888880107F085 +:101B60008888F08888F001077088808080887001FC +:101B700007E09088888890E00107F88080F08080F6 +:101B8000F80107F88080F08080800107708880B8B5 +:101B90008888780107888888F888888802210780E3 +:101BA000808080808080010708080808088870010C +:101BB000078890A0C0A090880107808080808080E6 +:101BC000F8010788D8A8A888888801078888C8A845 +:101BD0009888880107708888888888700107F0884D +:101BE00088F0808080010770888888A890684C03FE +:101BF0004C034C03060801014F0065030107F08800 +:101C000088F0A090880107708880700888700107AC +:101C1000F820202020202001078888888888887064 +:101C20000107888888888850200107888888A8A8A4 +:101C3000A850010788885020508888010788888824 +:101C4000502020200107F80810204080F8010700EC +:101C500000700878887801078080F0888888F00113 +:101C600007000078808080780107080878888888D5 +:101C700078010700007088F8807001071820F820AC +:101C800020202001080000788888780870010780EB +:101C900080B0C8888888022107800080808080808A +:101CA0000521081000101010109060052107808099 +:101CB00090A0C0A090032107C04040404040400198 +:101CC000070000F0A8A8A8A801070000B0C88888ED +:101CD0008801070000708888887001080000F0887B +:101CE00088F080800108000078888878080802055C +:101CF0006105B0C08080800107000078807008F026 +:101D000001072020F820202018010700008888887B +:101D10009868010700008888885020010700008823 +:101D200088A8A850010700008850205088010800AA +:101D30000088888878087001070000F8102040F8B3 +:101D40000107F8F8F8F8F8F8F80070935601809356 +:101D50005701D4D510935801D1D51093590126D0ED +:101D6000E4C27093560180935701C8D5109358016F +:101D7000C5D5109359012FD0D8C2709352018093CA +:101D80005301BCD510935401B9D51093550178D0A7 +:101D9000CCC27093520180935301B0D5109354017B +:101DA000ADD51093550171D0C0C208950091560170 +:101DB0000093520100915701009353010091580183 +:101DC00000935401009159010093550102E0B02A9B +:101DD00024D70DEFB022009158010A95023028F364 +:101DE00000915901033008F300915601009352010C +:101DF0000091570100935301009158010093540141 +:101E000001E00093550109D700915601009352015A +:101E1000009157010395009353010091590102501D +:101E20000093550101E000935401F7D680905801CA +:101E300000915601080D0A950093520101E00093AC +:101E400054010091570103950093530100915901EA +:101E5000025000935501E1D60091560100935201C2 +:101E6000009158010093540170905901009157015D +:101E7000070D0A950093530101E000935501CDC66B +:101E800002E0B02ACAD60DEFB022789490905301A8 +:101E90006091520102D860930201A09200017090FB +:101EA0005501CC27D92D15E5D0FF1AEA012ED6957C +:101EB000C795D695C795D05E18E12FDC07C0C05CEA +:101EC000DF4F939460910201A0900001AC2A1FEFB4 +:101ED0008090540100E0801641F008E08016C8F0C0 +:101EE000662319F016956A95E9F71021FED708E0E8 +:101EF00010910201011B801AA3941FEF08E08016C5 +:101F000040F0C1F01021F1D71FEF08E0801AA39430 +:101F1000F5CF882089F016958A94E9F71095662305 +:101F200049F02227169527956A95E1F71021DDD70C +:101F3000A394122F1021D9D7009416D67A94002793 +:061F40007012BDCF0895F0 +:0220000002419B +:00000001FF diff --git a/src/avr/TSV4.ASM b/src/avr/TSV4.ASM new file mode 100644 index 00000000..5e6b38d2 --- /dev/null +++ b/src/avr/TSV4.ASM @@ -0,0 +1,3708 @@ +; TSV4.ASM + +; 19FEB02 REVISE FOR GREATER CONTRAST VOLTAGE FOR ALBERT'S 2ND BATCH -15V +; 01FEB02 REVISE FOR 7.3728MHz XTAL (SEE !!!) + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS +; ;!! INDICATES CHANGES + +;** INDICATES CHANGES FOR LOW VCC AVR MOD + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APITS.INC" ; NOT API.INC BECAUSE APITS.INC ALSO HAS TURNON COMMAND +;.INCLUDE "TERTS.INC" ; NOT TER.INC BECAUSE FLAGS IN LOWER HALF OF REGISTER SET + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS XPAGE,YH + RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 +.ENDMACRO + +.MACRO A14_A18 + CLI + LDS R19,LATCH10_SAV ; AND THIS + EOR R19,@0 + ANDI R19,$E0 + EOR R19,@0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + SEI + STS LATCH10_SAV,R19 ; MUST BE ATOMIC DUE TO TOGGLING M +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@1 + + LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,1 + BST @1,6 ; A14 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + NOP + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO + OUT PORTA,@0 ; SELECT PHOTODIODE CHANNEL + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LED + OUT PORTA,@0 ; MAIN LED DRIVE PORT + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LEDLO + LDS D,LATCH12_SAV ; DRIVE LED COMMON LO + CBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO LEDHI + LDS D,LATCH12_SAV ; DRIVE LED COMMON HI + SBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKHI + LDS D,LATCH12_SAV ; DRIVE SPEAKER HI + SBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKLO + LDS D,LATCH12_SAV ; DRIVE SPEAKER LO + CBR D,1<<3 + SBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKOFF + LDS D,LATCH12_SAV ; DRIVE SPEAKER OFF + CBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.EQU T1_INIT =-818 ;$FB35 +.EQU T1_FULL_SCALE =-716 ;50.0HZ ; SETS LCD FRAME RATE TEMPORARY TO STOP FLIKER +;.EQU T1_FULL_SCALE =-651 ;53.5HZ ; SETS LCD FRAME RATE +;.EQU T1_FULL_SCALE =-600 ;54.8HZ ; SETS LCD FRAME RATE + +.EQU CONTRAST_LONG =-340 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +;.EQU CONTRAST_LONG =-250 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +.EQU CONTRAST_MID =-200 +.EQU CONTRAST_SHORT = -43 ; ALL SHORT PULSES IS FULLY LIGHT + +.EQU VCC_NOMINAL =-552 ;$FCC4 + +.EQU VEE_MIN =-710 ; MIN IS FULLY DARK +.EQU VEE_INIT =-340 +.EQU VEE_MAX = -43 ; MAX IS FULLY LIGHT + +; WHEN VCC = $FCC4 FOR 6.0V: +.EQU CONTRAST_MIN =-710 ; MIN IS FULLY DARK +.EQU CONTRAST_INIT =-640 +.EQU CONTRAST_MAX =-580 ; MAX IS FULLY LIGHT + +; GENEROUS LIMITS FOR EXPERIMENTATION: +;.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FE10 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =10 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$20 +.EQU RX_SIZE =$80 + +.EQU TK_LED_PULSE =14 ; 18US ?? CLOCKS OF /8 +.EQU TK_DELAY_0 =19 ; ??US DELAY TILL START OF LED PULSE (/8) +;.EQU TK_DELAY_0 =$20 ;$38 ; ??US DELAY TILL START OF LED PULSE +;.EQU TK_DELAY_0 =$25 ;$38 ; 54US ?? CLOCKS OF /8 +.EQU TK_DELAY_1 =$10 ;$28 ; CLOCKS OF /64, CHANNEL SELECT DELAY +.EQU TK_DELAY_2 =$00 ; CLOCKS OF /1024, VDD POWER ON DELAY + ; $D0 IS TOO SHORT, $E0 SEEMS TO WORK + +.EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS +.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 USED TO CONTROL LED PULSING FOR TOUCHSCREEN EVERY 2ND CYCLE +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +; for AVRA / TAVRASM: +;.def XL =R26 +;.def XH =R27 +;.def YL =R28 +;.def YH =R29 +;.def ZL =R30 +;.def ZH =R31 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +BUZZ_PERIOD: .BYTE 1 +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +XPAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +CHAR_X: .BYTE 1 +CHAR_Y: .BYTE 1 +CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC_64K: .BYTE 1 +TIME_HSEC_256: .BYTE 1 +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_STATE: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RJMP GO_TIM2_OVF ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_T1_OVERFLOW + RJMP GO_T0_OVERFLOW + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + LDI F,0 + STS TIME_HSEC_64K,F + STS TIME_HSEC_256,F + STS TIME_HSEC,F + STS TIME_SECOND,F + STS TIME_MINUTE,F + STS TIME_HOUR,F + LDI F,1 + STS DATE_DAY,F + STS DATE_MONTH,F + LDI F,20 + STS DATE_YEAR,F + +RESTART_ENTRY: +;**: + LDI F,8 ; TIMER 2 CLOCKED BY 32 KHZ +;** LDI F,0 ; TIMER 2 CLOCKED BY 11 MHZ + OUT ASSR,F +;**: + ; MUST MATCH SET_TIME ROUTINE % + LDI F,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;!! LDI F,$11 ; DIVIDE BY 2, TOGGLE OC2 (PIN 21) + ; (RTC DIAGNOSTIC) +;** LDI F,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,F + ; % + LDI F,$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + LDI F,$00 + OUT GIMSK,F + + LDI F,$B8 ; INIT_PORTS + OUT DDRD,F + OUT PORTD,F ; D2 = TRI-STATE, VSWT ON + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + OUT PORTC,F + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + + LDI D,$18 ; A18|A17|A16|A15|A14=11000 + OUT PORTA,D ; CL1=M=FLM=0 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BUZZ_TIME,D ; NOT BUZZING (SHORT BEEP COMES LATER) + + CLR SCAN + STS ROW_INDEX,SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + + LDI D,$F4 ; BIT 6 = 1 VDD ON, BIT 7 = 1 LCD ON + STS LATCH5_SAV,D + PHOTO D + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +RTNCDE: ;LDIZ RTN_CODE ; POINT Z TO FLASH + LDI ZL,LOW((RTN_CODE)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER + LDI XL,LOW((RTN_CODE_END-RTN_CODE)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((RTN_CODE_END-RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + CLR R0 ; TEMPORARY CLEAR KB + RAMWRX R0 ; WRITE DATA TO DSPRAM + DEC XL + BREQ RTNCDE_END ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CDE1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CDE0 +RTNCDE_END: + + ; INITIALISE DEFAULT CHARACTER SET + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + ;LDIZ CHSET00 ; POINT Z TO FLASH + LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + ; CLEAR REFRESH BUFFER TO AVOID A BRIEF FLICKER + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL GO_SELECT_XPAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +CLEAR_REFRESH: + PUSH B + PUSH YL + PUSH YH + + LDI B,32 + RCALL GO_CLEAR_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + ADIW YL,6 + LDI B,2 + RCALL GO_CLEAR_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP YH + POP YL + POP B + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE CLEAR_REFRESH + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,0 + STS BUZZ_PERIOD,A ; HIGHEST FREQUENCY + LDI A,54 ;$40 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + LDI A,0 + STS SCAN_STATE,A ; START ON FIRST LED / PHOTODIODE PAIR + + LDI A,0 + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + LDI F,$45 + OUT TIMSK,F ; TURN ON TIMER 0, 1, 2 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL HELLO_DISPLAY ; SHOW EXAMPLE DISPLAY + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + SBI PORTD,4 ; TURN TRANSISTOR OFF + CBI PORTD,5 ; DROP CL2 + + LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + LDI D,$74 ; BIT 6 = 1 VDD ON, BIT 7 = 0 LCD OFF + SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + LDI D,$34 ; BIT 6 = 0 VDD OFF, BIT 7 = 0 LCD OFF + STS LATCH5_SAV,D + PHOTO D + + LDI D,$41 + OUT TIMSK,D ; DISABLE TIMER 1 INTERRUPTS + + LDI D,0 + OUT TCCR0,D ; DISABLE TIMER 0 TEMPORARILY ONLY + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + + LDI F,4 + STS TURNON_COUNT,F ; .25 SEC TO BREAK, .75 SEC TO MAKE + + INIT_API_BUS ; RESET UART TO RECEIVE TURNON COMMAND + +SLEEP_LOOP: + CLI + IN F,TCCR0 + TST F + LDI F,$4A ; SE=1 SM1:SM0=00 FOR IDLE MODE + BRNE SLEEP_SETUP ; TIMER 0 RUNNING, STAY IN IDLE MODE + SBIS PIND,0 ; BREAK OFF, UART ACTIVE, STAY IN IDLE + LDI F,$7A ; SE=1 SM1:SM0=11 FOR POWER SAVE MODE +SLEEP_SETUP: + OUT MCUCR,F + SEI + SLEEP + + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDS F,TURNON_COUNT + TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;SBIS PIND,0 ; AND BREAK HAS DISAPPEARED, WAKE UP + BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP + + CLI + RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + +; ----------------------------------------------------------------------------- + +ADRYP: LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL + OUT PORTA,YH + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,XPAGE +; INC YH +; ANDI YH,$1F +; STS XPAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +;HELLO_DISPLAY: +; LDI A,0 +; STS RECTNC_X,A +; STS RECTNC_Y,A +; STS RECTNC_XX,A +; LDI A,$80 +; STS RECTNC_YY,A +; RCALL DRAW_RECTNC +; +; LDI A,16 +; STS CHAR_X,A +; STS CHAR_Y,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; RCALL STRING_DRAW +; +; LDI A,240 +; STS CHAR_X,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; +;STRING_RIGHT_JUST: +; PUSH B +; PUSH ZL +; PUSH ZH +; RCALL STRING_WIDTH +; POP ZH +; POP ZL +; POP B +; LDS A,CHAR_X +; SUB A,R0 +; STS CHAR_X,A +; +;STRING_DRAW: +; PUSH B +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; PUSH R0 +; RCALL DRAW_CHAR +; POP R0 +; POP ZH +; POP ZL +; LDS A,CHAR_X +; ADD A,R0 +; STS CHAR_X,A +; POP B +; DEC B +; BRNE STRING_DRAW +; RET +; +;STRING_WIDTH: +; CLR R0 +;STRING_WIDTH_LOOP: +; PUSH B +; PUSH R0 +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; POP ZH +; POP ZL +; POP A +; ADD R0,A +; POP B +; DEC B +; BRNE STRING_WIDTH_LOOP +; RET +; +;HELLO_MESSAGE: .DB 'H','E','L','L','O',0 + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +SET_TIME: + LDI A,0 + OUT TCCR2,A ; STOP COUNTING WHILE SETTING CLOCK + STS TIME_HSEC_64K,A + STS TIME_HSEC_256,A + STS TIME_HSEC,A + RCALL RX_WAIT + STS TIME_HOUR,A + RCALL RX_WAIT + STS TIME_MINUTE,A + RCALL RX_WAIT + STS TIME_SECOND,A + RCALL RX_WAIT + STS DATE_MONTH,A + RCALL RX_WAIT + STS DATE_DAY,A + RCALL RX_WAIT + STS DATE_YEAR,A + LDI A,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;** LDI A,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,A + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE +;L01A3: + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: CLR CURSORX + RJMP MAIN_LOOP + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRCC DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRCC DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + RCALL FIND_CHAR ; SET UP CHAR_PTR FROM A = CHAR + RCALL CHAR_WIDTH ; SET UP R0 = PROP WIDTH FROM CHAR PTR + + CLR F + STS TEMP,F ; NUDGE FOR FIXED SPACING MODE + + SBRC FLAGS,4 + RJMP PROP_MODE ; FORCED TO FIXED SPACING MODE? + + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS ; GET R0 = CELL WIDTH FOR CHARACTER SET + PUSH R0 + SUB R0,W + BRCC NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + POP R0 ; RESTORE R0 = FIXED CELL WIDTH + +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE ; FORCED TO GRAPHICS MODE? + + MOV F,CURSORX + ADD F,R0 ; CHECK IF CHAR WILL FIT ON THIS LINE + BRCC OK_LINE + + CLR CURSORX + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 + RCALL SELECT_XPAGE ; IN CASE WE SCROLLED THE DISPLAY + +OK_LINE: + LDS F,TEMP + ADD F,CURSORX + STS CHAR_X,F + STS CHAR_Y,CURSORY ; SET UP TOP LEFT COORDINATES + + ADD CURSORX,R0 ; ADVANCE CURSOR + +DRAW_CHAR: + LDS XPIXEL,CHAR_X + LDS LINE_CNT,CHAR_Y + + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE ; Y OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 + +Y_OFFSET_DONE: + SBRS X_SIZE,7 + RJMP X_OFFSET_DONE ; X OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$03 + RCALL LPMS + ADD XPIXEL,R0 + +X_OFFSET_DONE: + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + ADIW YL,$01 + RCALL LPMS ; GET R0 = Y LINES FOR CHARACTER + MOV Y_SIZE,R0 + + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +FIND_CHAR: + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + STS CHAR_PTR,YL + STS CHAR_PTR+1,YH + RET + +CHAR_WIDTH: + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + RCALL LPMS + MOV X_SIZE,R0 + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP LPMS ; PROPORTIONAL WIDTH IS PRESENT + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RJMP LPMS ; NO PROPORTIONAL WIDTH, USE CELL WIDTH + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + ; LET'S BE SAFE + ANDI A,$7F + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +GO_SELECT_XPAGE: + RJMP SELECT_XPAGE + +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +GO_EXT_INT0: + RJMP EXT_INT0 + +GO_EXT_INT1: + RJMP EXT_INT1 + +GO_TIM2_OVF: + RJMP TIM2_OVF + +GO_T1_OVERFLOW: + RJMP T1_OVERFLOW + +GO_T0_OVERFLOW: + RJMP T0_OVERFLOW + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +; ----------------------------------------------------------------------------- + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +; ----------------------------------------------------------------------------- + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR CURSORX ; HOME CURSOR + CLR CURSORY + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE +CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE CLEAR_DISPLAY_LOOP + RET + +; ----------------------------------------------------------------------------- + +EXT_INT0: +;**: +RETI +;** IN SR,SREG ; MEASURE VCC +;** SBI DDRD,2 +;** IN C,TCNT1L +;** IN D,TCNT1H +;** STS VCCH,D +;** STS VCCL,C +;** RJMP EXT_INT_RET + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP EXT_INT_RET + +T1_OVERFLOW: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDI D,$70 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, TOGGLE OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + LDS C,CLOCKING_PTR +; TST C ; START OF 4 LINE BLOCK? (1 BASED) + lds d,CLOCKING_PTR+1 + andi d,1 + or c,d ; checks for start of an 8 line block +; rjmp BREAK0 ; temporary (prevents switching off via power switch) + BRNE BREAK0 ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK1 ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION +GO_SLEEP_ENTRY: + RJMP SLEEP_ENTRY + +BREAK0: NOP + NOP + NOP + NOP + NOP + NOP + NOP +BREAK1: SBI DDRD,3 ; PRECHARGE TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D ; STOP TIMER1 + OUT TCNT1H,D ; AND CLEAR COUNT + OUT TCNT1L,D + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + LDS D,LATCH10_SAV + OUT PORTA,D + SBI PORTB,4 + SBI PORTA,5 ; PULSE CL1 + CBI PORTA,5 + CBI PORTB,4 + NOP ; EQUALIZE DELAY + NOP + NOP + NOP + NOP + NOP + RJMP L04F9 + +L04E6: LDS D,LATCH10_SAV + ORI D,$80 ; RAISE FLM + ORI D,$20 ; RAISE CL1 + OUT PORTA,D + + SBI PORTB,4 + LDI C,$60 ; TOGGLE M AND CL1 + EOR D,C + OUT PORTA,D + ANDI D,$7F ; DROP FLM + OUT PORTA,D + CBI PORTB,4 + STS LATCH10_SAV,D + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D + +; LDI D,1 ; TO CLOCK AT 5.5/2 MHZ + OUT OCR1AL,D ; TO CLOCK AT 7.3/2 MHZ + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + +;!!! LDI D,$7A ; WAIT FOR 32uSEC +; LDI D,58 ;$7A ; WAIT FOR 32uSEC GOOD + LDI D,60 ; WAIT FOR 32uSEC +; LDI D,61 ;$7A ; WAIT FOR 32uSEC +; LDI D,62 ;$7A ; WAIT FOR 32uSEC GOOD + +L050E: DEC D + BRNE L050E + + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + LDI D,$01 ; KILL CLR ON COMPARE MATCH + NOP ; !WITH OC1A LEFT IN LOW STATE + OUT TCCR1B,D + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0536 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + RJMP L0536 + +L0535: NOP ; EQUALIZE DELAYS + NOP + NOP + NOP +L0536: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VEEL + LDS D,VEEH + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + NOP + NOP + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,2 ; SET TIME FOR START OF LED PULSE + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_DELAY_0 ; 54uSEC + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,3 ; START TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + + RJMP T1_OVERFLOW_RET + +T0_OVERFLOW: + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + PUSH ZH + PUSH ZL + PUSH R0 + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_STATE + INC D + STS SCAN_STATE,D + DEC D + BREQ SCAN_START ; IF SCAN_STATE WAS = 0 + DEC D + BREQ SCAN_BEEPER ; IF SCAN_STATE WAS = 1 + ; IMPLEMENT ENTRY POINT FOR SCAN_PULSE_LED HERE + DEC D + RJEQ SCAN_PHOTO ; IF SCAN_STATE WAS = 2 + +T0_OVERFLOW_RET: + POP R0 + POP ZL + POP ZH + +T1_OVERFLOW_RET: + POP D ; RESTORE STATE OF THE WORLD + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +EXT_INT_RET: + OUT SREG,SR + RETI + +SCAN_START: + LDI D,3 ;5 + OUT TCCR0,D ; PRESCALE=CK/1024 + LDI D,-TK_DELAY_1 ;TK_DELAY_2 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + RJMP L0617_RESET + +SCAN_BEEPER: + LDS D,BUZZ_TIME + TST D + BREQ SCAN_PULSE_LED + LDS D,BUZZ_PERIOD + SUBI D,$10 + BRLO BUZZ_TOGGLE + STS BUZZ_PERIOD,D + RJMP SCAN_PULSE_LED +BUZZ_TOGGLE: ; ASSUME D = $F0 + PERIOD-1 + MOV C,D ; EG. C = $F3 FOR PERIOD = 4 + SWAP C ; EG. C = $3F FOR PERIOD = 4 + AND D,C ; EG. D = $33 FOR PERIOD = 4 + STS BUZZ_PERIOD,D + LDS C,LATCH12_SAV + SBRS C,3 ; TEST PREVIOUS SPEAKER STATE + RJMP BEEPER_SPKHI + LDS D,BUZZ_TIME + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP SCAN_PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP SCAN_PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +SCAN_PULSE_LED: + LDS D,LATCH5_SAV +;**: + SBRS D,7 ; ARE WE INSIDE SLEEP_LOOP? +;** SBRC D,7 + RJMP SCAN_PULSE_LED_OK ; YES, KEEP TIMER 0 TO RETAIN CONTROL + + LDI D,1<<7 + EOR FLAGS,D + BRPL SCAN_PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP T0_OVERFLOW_RET ; AND WASTE EVERY REMAINING CYCLE + +SCAN_PULSE_LED_OK: + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + + ;LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM ; R0 = LED DRIVE VALUE + LDI D,13*4 + CP SCAN,D + BRSH L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + RJMP T0_OVERFLOW_RET + +SCAN_PHOTO: + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + CLC + SBRC D,6 + RJMP L0593 ; ROW/COLUMN IS INACTIVE + + ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF + IN C,SREG + + LDI D,13*4 + CP SCAN,D + BRSH L05A8 + + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS ZL,ROW_BITMAP + LDS ZH,ROW_BITMAP+1 + ROL ZL + ROL ZH + STS ROW_BITMAP,ZL + STS ROW_BITMAP+1,ZH + RJMP L05F9 + +L05A8: ; WE HAVE A COLUMN STATUS +; LDS D,LATCH5_SAV +;;**: +; SBRS D,7 ; TURNED OFF? +;;** SBRC D,7 +; RJMP L05F9 ; YES, NO FURTHER PROCESSING + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRCS L05AB + RJMP L05F9 + +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 + +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS ZH,ROW_BITMAP+1 + LDS ZL,ROW_BITMAP + + LDS D,ROW_INDEX + TST D + BREQ ROW_BITMAP_LOOP + + MOV C,D +ROW_BITMAP_SKIP: + ROR ZH + ROR ZL + SUBI C,4 + BRNE ROW_BITMAP_SKIP + +ROW_BITMAP_LOOP: + SUBI D,-4 + ROR ZH + ROR ZL + BRCS FOUND_INTERSECTION +ROW_BITMAP_LOOPE: + CPI D,13*4 + BRLO ROW_BITMAP_LOOP + + ; NO FURTHER INTERSECTING ROWS FOUND + RJMP L05F9 + +FOUND_INTERSECTION: + ; FOUND AN INTERSECTING ROW FOR COLUMN + STS ROW_INDEX,D + + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + TST R0 + BRNE VALID_INTERSECTION + + ; INTERSECTION IS NULL, GO ON TO NEXT + LDS D,ROW_INDEX + CPI D,13*4 + BRSH L05F9 ; DONE LAST ROW, GO ON TO NEXT COLUMN +GO_L0617: + RJMP L0617 ; GO ON TO NEXT ROW, SAME COLUMN + +VALID_INTERSECTION: + ; INTERSECTION IS VALID, WE HAVE KEY MAKE + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,54 ;43 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + + MOV D,TX_COUNT + CPI D,TX_SIZE-1 + BRSH L05F9 + + PUSH A + MOV A,R0 + RCALL TX_CHAR + CPI A,$1B + BRNE TX_CONT + RCALL TX_CHAR +TX_CONT: + POP A + +L05F9: + LDI D,4 ; SCAN TO NEXT LED / PHOTODIODE PAIR + ADD SCAN,D + + LDS D,LATCH5_SAV + SBRC D,7 + RJMP TURNED_ON + + LDI D,3 + OUT TCCR0,D ; PRESCALE=CK/64 + LDI D,-TK_DELAY_1 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI C,13*4 + CP SCAN,C + BRLO GO_L0617 + + ; KEEP VDD ON, TO AVOID THE LONG TK_DELAY_2 + ;LDS D,LATCH5_SAV + ;ANDI D,$BF ; BIT 6 = 0 VDD OFF + ;STS LATCH5_SAV,D + ;PHOTO D ; READY TO SLEEP FOR ANOTHER 0.25 SEC + + LDI D,0 + OUT TCCR0,D ; STOP TIMER SINCE COMPLETE SCAN DONE + ;RJMP T0_OVERFLOW_RET + + ;LDI D,$05 + ;OUT UBRR,D + ;LDI D,$18 + ;OUT UCR,D + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + ;OUT UDR,C + ;OUT UDR,D + OR C,D ; HAVE WE SOME ACTIVITY? + + LDS D,TURNON_COUNT + CPI D,4 + BRSH TURNON_BREAK ; WAITING FOR BREAK + CPI D,1 + BRSH TURNON_MAKE ; WAITING FOR MAKE +GO_T0_OVERFLOW_RET: + RJMP T0_OVERFLOW_RET ; ALREADY HAD MAKE, NOT TURNED ON YET + +TURNON_BREAK: + TST C ; HAD SOME ACTIVITY? + BREQ TURNON_SAVE ; NO, COUNT DOWN TO BREAK + LDI D,4+1 ; YES, RESTART COUNTDOWN TO BREAK + RJMP TURNON_SAVE +TURNON_MAKE: + TST C ; HAD SOME ACTIVITY? + BRNE TURNON_SAVE ; YES, COUNT DOWN TO MAKE + LDI D,3+1 ; NO, RESTART COUNTDOWN TO MAKE +TURNON_SAVE: + DEC D ; COUNT DOWN TO MAKE OR BREAK + STS TURNON_COUNT,D + BRNE GO_T0_OVERFLOW_RET ; NOT READY TO TRY TURNON YET + + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + CBI DDRD,2 ; D2 = TRI-STATE, VSWT ON + RJMP GO_SLEEP_ENTRY ; WE WILL NOW WAIT FOR TURNON COMMAND + +TURNED_ON: + LDI D,0 ; STOP TIMER, WE WILL REGAIN + OUT TCCR0,D ; CONTROL VIA NEXT CLOCKING INTERRUPT + STS ROW_INDEX,D + + LDI C,50*4 + CP SCAN,C + BRLO L0617 + + LDS D,DEBOUNCE ; COMPLETED ENTIRE SCAN, START NEW SCAN + TST D + BREQ L0617_RESET + DEC D + STS DEBOUNCE,D + BRNE L0617_RESET + + LDS D,ACTIVE_ZONE + TST D + BREQ L0617_RESET + + MOV D,TX_COUNT + CPI D,TX_SIZE + BRSH L0617_RESET + + PUSH A + LDI A,0 + RCALL TX_CHAR + POP A + +L0617_RESET: + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + ;LDIZ SCAN_TBL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$80 ; BIT 7 = PRESERVED, LCD ON/OFF STATUS + ORI D,$40 ; BIT 6 = 1 VDD ON + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + RJMP T0_OVERFLOW_RET + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP CLEAR_DISPLAY_LOOP + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_XPAGE: + A14_A18 A + RET + +; HOW MANY SECS/6553600 PER 4HZ INTERRUPT ? +; EACH TIME THROUGH ADD 1638400 SECS/6553600 = 1/4 SEC +; OSCILLATOR IS SLOW SO WE WILL ADD 1 PART IN 10000 +; HENCE EACH TIME THROUGH ADD 1638400+164 = 1638564 UNITS TO COUNT + +TIM2_OVF: + IN SR,SREG + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +;!! LDI A,$10 ; DIAGNOSTIC +;!! STS BUZZ_TIME,A ; SHORT BEEP + + LDS D,TIME_HSEC_64K + SUBI D,LOW(-1638564) + STS TIME_HSEC_64K,D + + LDS D,TIME_HSEC_256 + SBCI D,HIGH(-1638564) + STS TIME_HSEC_256,D + + LDS D,TIME_HSEC + SBCI D,HIGH(-1638564>>8) + CPI D,100 + BRSH TIM2_CARRY + STS TIME_HSEC,D + +TIM2_END: + OUT SREG,SR + SBRS FLAGS,6 ; IF WE TURNED OFF VIA COMMAND, + RETI ; START A NEW SCAN, OTHERWISE DONE + + LDI D,0 + STS SCAN_STATE,D ; WE WILL EXECUTE SCAN_START ROUTINE + RJMP T0_OVERFLOW ; GO AND TURN VDD ON + +GO_TX_CHAR: + RJMP TX_CHAR + +TIM2_CARRY: + LDI D,0 + STS TIME_HSEC,D + + LDS D,TIME_SECOND + INC D + CPI D,60 + BRLO TIM2_SECOND + + LDS D,TIME_MINUTE + INC D + CPI D,60 + BRLO TIM2_MINUTE + + LDS D,TIME_HOUR + INC D + CPI D,24 + BRLO TIM2_HOUR + + PUSH ZL + PUSH ZH + PUSH R0 + LDI ZL,LOW(MONTH_TABLE*2-1) + LDI ZH,HIGH(MONTH_TABLE*2-1) + LDS E,DATE_MONTH + ADD ZL,E + LDI E,0 + ADC ZH,E + LPM + MOV E,R0 + CPI E,28 + BRNE FEBRUARY_OK + LDS E,DATE_YEAR + ANDI E,3 + LDI E,28 + BRNE FEBRUARY_OK + LDI E,29 +FEBRUARY_OK: + POP R0 + POP ZH + POP ZL + + LDS D,DATE_DAY + CP D,E + BRLO TIM2_DAY + + LDS D,DATE_MONTH + CPI D,12 + BRLO TIM2_MONTH + + LDS D,DATE_YEAR + INC D + STS DATE_YEAR,D + CLR D +TIM2_MONTH: + INC D + STS DATE_MONTH,D + CLR D +TIM2_DAY: + INC D + STS DATE_DAY,D + CLR D +TIM2_HOUR: + STS TIME_HOUR,D + CLR D +TIM2_MINUTE: + STS TIME_MINUTE,D + CLR D +TIM2_SECOND: + STS TIME_SECOND,D + +TIM2_SEND: + MOV D,TX_COUNT + CPI D,TX_SIZE-7 + BRSH TIM2_SEND_SKIP + + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'T' + RCALL TX_CHAR +; LDS A,VCCL +; RCALL TX_CHAR +; LDS A,VCCH +; RCALL TX_CHAR +; LDS A,VEEL +; RCALL TX_CHAR +; LDS A,VEEH +; RCALL TX_CHAR +; LDI A,$0D +; RCALL TX_CHAR + LDS A,TIME_HOUR + RCALL GO_TX_CHAR + LDS A,TIME_MINUTE + RCALL GO_TX_CHAR + LDS A,TIME_SECOND + RCALL GO_TX_CHAR + LDS A,DATE_MONTH + RCALL GO_TX_CHAR + LDS A,DATE_DAY + RCALL GO_TX_CHAR + LDS A,DATE_YEAR + RCALL GO_TX_CHAR + POP A + +TIM2_SEND_SKIP: + RJMP TIM2_END + +; ----------------------------------------------------------------------------- + +MONTH_TABLE: + .DB 31,28,31,30,31,30,31,31,30,31,30,31 + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: +.INCLUDE "CHSET00.INC" +CHSET00_END: + +; ----------------------------------------------------------------------------- + +GET_CLEAR_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL CLEAR_FRAME_RECT + RJMP MAIN_LOOP + +GET_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FRAME_RECT + RJMP MAIN_LOOP + +GET_CLEAR_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL CLEAR_HALFTONE_RECT + RJMP MAIN_LOOP + +GET_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL HALFTONE_RECT + RJMP MAIN_LOOP + +NO_GOX: RET + +CLEAR_FRAME_RECT: + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS F,RECTNC_YY + STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +FRAME_RECT: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GOX + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GOX + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CLEAR_HALFTONE_RECT: +; LDS F,RECTNC_X +; STS RECT_X,F +; LDS F,RECTNC_Y +; STS RECT_Y,F +; LDS F,RECTNC_XX +; STS RECT_XX,F +; LDS F,RECTNC_YY +; STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +HALFTONE_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LDI A,$55 + SBRS YH,0 + LDI A,$AA + MOV PATTERN,A + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP X03A3 +X039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +X03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ X03B0 + LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + TST XPIXEL + BREQ X03B0 +X03AD: LSR A + DEC XPIXEL + BRNE X03AD +X03B0: AND A,PATTERN + RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +X03B8: LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + BREQ X03D2 + AND A,PATTERN + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP X03B8 +X03C2: TST X_SIZE + BREQ X03D3 +X03C4: LSR A + DEC X_SIZE + BRNE X03C4 + COM A + TST XPIXEL + BREQ X03D2 + CLR B +X03CB: LSR A + ROR B + DEC XPIXEL + BRNE X03CB + AND A,PATTERN + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +X03D2: AND A,PATTERN + RCALL WR_DISP_MEM +X03D3: COM PATTERN + RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP X039A + RET + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/TSV4.HEX b/src/avr/TSV4.HEX new file mode 100644 index 00000000..4107a0d3 --- /dev/null +++ b/src/avr/TSV4.HEX @@ -0,0 +1,504 @@ +:020000020000FC +:100000000DC006C606C6189505C61895189518950C +:1000100002C602C61895EDC6D7C62EC702E00EBFAF +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300000935F01009360010093610100936201EE +:10004000009363010093640101E000936501009354 +:10005000660104E10093670108E002BD03E005BD0D +:1000600000E409BF00E00BBF08EB01BB02BB0FE1DE +:1000700007BB0FEF0ABB04BB00270BBB03E008BBA9 +:1000800000E105BBC29AC2980093190100E2B02EAC +:1000900017E119B910E91AB944245524222433244C +:1000A000EE246624CC2458E15BBBC49AC4985093D8 +:1000B000170155275093180150933B0150936A0143 +:1000C00050936B0150931001DD24D0921401D09213 +:1000D0001501D092160154EF509369015BBB50910A +:1000E000190155BBA89AC29AC298A898C29AC298F8 +:1000F0007894E2E0F9E1A2EEB0E0DBE1D0931A01FE +:1001000008D1D0E8C0ECDBBBC39AC398D0931801E8 +:10011000C5BBC89500240BBAC198C0980000C09A0E +:10012000C19AAA9541F03196C3951C2F1F7381F790 +:10013000C054D395E8CF10E3D9D2CF93DF93E4D264 +:10014000BF91AF915FD5212F1D2F129533D3121779 +:10015000B1F4119657D5212F1D2F2CD3121779F4F6 +:10016000119650D5212F1C2F129524D3121739F434 +:10017000119648D5212F1C2F1DD3121709F1E4EE3B +:10018000F9E1A6E6B3E0D9E1D0931A01C2D0D0E0FC +:10019000C0E4DBBBC39AC398D0931801C5BBC89514 +:1001A0000BBAC198C0980000C09AC19A119741F04B +:1001B0003196C3951C2F1F7389F7C054D395E9CF8F +:1001C00020E12093030120E42093040129E12093FE +:1001D0000501C0E0D0E218E118D520E82F93CF93B5 +:1001E000DF9320E211D5269622E00ED5DF91CF9144 +:1001F0002F91C05CDF4F2A9589F7B4D610E0109399 +:10020000110116E31093100110E01093680110E043 +:1002100010934C0110934D011EEF10930D011CEA39 +:1002200010930C0122E020D21C7F10930E0123E0DA +:100230001BD210930F0110910E0120910F011A3360 +:100240000DEF200720F01C3B0DEF200730F01DEFD5 +:1002500010930F0110E810930E011FEF19BD18E362 +:1002600018BD1CEF1DBD1EEC1CBD10E51FBD11E02F +:100270001EBD00E003BF05E008BF05E409BF0AE0BA +:1002800005BF00EC0ABF0BBF9EC202E00EBF0FE528 +:100290000DBF50E05FBD5EBD949A959850911701D7 +:1002A0005F7B5BBBC49AC4985093170154E7B6FEBA +:1002B00054E3509369015BBB5091190155BBA89A57 +:1002C000C29AC298A898C29AC29851E459BF50E005 +:1002D00053BF5BBF04E000936A0117E119B910E94D +:1002E0001AB94424552422243324EE246624CC2431 +:1002F000F89403B700230AE411F4809B0AE705BFD2 +:1003000078948895A89500916A01002389F7F8945C +:10031000A3CED0911A01C0911701C07EDC2BDBBBAC +:10032000C49AC498D0931701089578941FEDE122E0 +:1003300010E01EBB1FBBE2D21B3159F1B3FC0DC054 +:10034000103258F4183009F407C11D3009F41CC1EB +:100350001A3009F4C0C0173041F7B2FC18C010338E +:10036000B1F4C0910301D091040120910501CC5F4B +:10037000DD4FF894309117013227307E32273BBB96 +:10038000C49AC49878943093170193D5102DECD269 +:10039000CCCFB4D21B3109F31E3209F47CC11F3219 +:1003A00009F452C01F3309F491C1123409F45EC03C +:1003B000123609F45FC0133409F40BC1133609F483 +:1003C000C4CC143409F4F2C0153409F4DFC0163477 +:1003D00009F40FC1163609F4C4CC173409F4A1C0CE +:1003E000183409F4D6CC183609F4C7CC1B3409F4F8 +:1003F00096C01C3409F40AC41D3409F42EC01E34FE +:1004000009F403C1103509F49AC0123509F4E3C0A8 +:10041000133509F4D9C0143509F440C0153509F471 +:100420006BC2163519F410E2E12AFBC0173509F446 +:1004300063C2183509F4C4C11A3509F4EEC110338A +:1004400010F01A3310F171CF59D210FF03C014E02D +:10045000B12A6BCF1BEFB12268CF50D2103329F4F1 +:10046000F89400E4B02A8A9A10CF5FCF47D21F9346 +:1004700010E004C043D21F9341D21F7010931101AA +:100480001F911093100151CF39D230D1C0E1C093E8 +:100490000301D09304012093050147CF10E015BD5F +:1004A00010935F01109360011093610127D21093A4 +:1004B000640124D21093630121D2109362011ED2F1 +:1004C000109366011BD21093650118D21093670137 +:1004D00013E015BD2ACF01D028CF0F92C0910301A0 +:1004E000D091040120910501DE5FC395F89430910D +:1004F00017013227307E32273BBBC49AC4987894C8 +:1005000030931701D6D4182F100D100D1A951038EE +:1005100018F0C0D00F900895800D0F90089522D547 +:1005200004CFECD1103309F404C0113309F404C032 +:10053000FCCE07EFB022F9CE08E0B02AF6CEDED12D +:10054000103309F403C0113309F403C00FEEB022D5 +:10055000ECCE00E1B02AE9CEC0910301D0910401B4 +:1005600020910501DE5FF894309117013227307E2B +:1005700032273BBBC49AC49878943093170199D41E +:1005800070191FB712FFD1CE7727CFCEB7D111FD8B +:1005900007C010FD03C00FEDB022C7CE00E2B02AA5 +:1005A000002700933B01EAD2F1F7BFCEA7D1103369 +:1005B00009F404C0113309F404C0B7CE0EEFB02221 +:1005C000B4CE01E0B02AB1CE99D1712F97D1812F4D +:1005D000ACCE02E0B02A70935201809353018ED1C9 +:1005E000109354018BD11093550117D30DEFB02206 +:1005F0009CCE709356018093570180D1109358017F +:100600007DD1109359015ED390CE709356018093A3 +:10061000570174D11093580171D11093590177D3B8 +:1006200084CE6CD110FF0BC010910E0120910F01F0 +:100630001C5F2F4F1C3B0DEF2007A8F40AC0109140 +:100640000E0120910F01145020401A330DEF2007A6 +:1006500050F010930E0120930F0122E00DD0109165 +:100660000F0123E009D061CEE199FECF2EBB2227F6 +:100670002FBBE09A1DB30895E199FECFE5FEFFCFB1 +:100680002EBB22272FBB1DBBF894E5FEFFCFE29ABD +:10069000E19A189536C732D129D030D1A12F2ED169 +:1006A000B12F2CD1F894309117013227307E3227A8 +:1006B0003BBBC49AC498789430931701A4D2219676 +:1006C00011971A2F1B2B09F0ECCF2FCE17D10ED07C +:1006D0001F931AD01BE133D11FE331D11F91105D5D +:1006E0002ED11D2F60D01C2F5ED01FCEC0E0D0E0D9 +:1006F00024E61F701A3008F4210F2695D795269509 +:10070000D795D695D6950895A6E1B2E0AC0FBD1F5A +:10071000F894309117013227307E32273BBBC49AC0 +:10072000C4987894309317016DD2E12F11966AD254 +:10073000F12FAC2FBD2F1496CFEFDFEF3197FF7065 +:10074000349780F131965ED2119601E220E1D127F3 +:10075000CC0FDD1F10F4C027D227CC0FDD1F10F403 +:10076000C027D227CC0FDD1F10F4C027D227CC0F13 +:10077000DD1F10F4C027D227CC0FDD1F10F4C027D7 +:10078000D227CC0FDD1F10F4C027D227CC0FDD1FDE +:1007900010F4C027D227CC0FDD1F10F4C027D227BA +:1007A000319789F608951F93129504D0C8D01F91F0 +:1007B00001D0C5C01F7010631A3308F0195F089587 +:1007C0009DD010FD13C070936C0180936D01B092A9 +:1007D0006E011091030110936F01109104011093A9 +:1007E000700110910501109371019FCD70916C0102 +:1007F00080916D0110ECB12210916E011F73B12A2E +:1008000010916F0110930301109170011093040176 +:10081000109171011093050188CD70D010935A0189 +:100820006DD0C12F175F5DD020935B0167D0D12FB2 +:100830001C5F5CD020935C0161D01C0F1F5051D015 +:1008400020935D015BD01D0F115150D020935E01AC +:10085000D0915C0110915E011D1B08F441C0C09154 +:100860005B011C2F1D0F2D2F220F220F220F120FA5 +:10087000220F120FA0E0B0EE20E0A10FB21F2BE17B +:10088000F894309117013227307E32273BBBC49A4F +:10089000C49878943093170110915D011C1BF0F0FF +:1008A0003A2F3F7335BB3B2F330F330FA7FB31F983 +:1008B000A6FB30F93BBBF894C39AC3987894309365 +:1008C000180110915A011BBBF894C198C098000000 +:1008D000C09A7894C19A1196C395DECFD395BACFBA +:1008E00024CD2FEF23951A50E8F708952FEF239585 +:1008F0001D50E8F7089502D001D017CD10EC1093E9 +:100900006B01A89510E01EBB1FBB10EC80991093E3 +:100910006B01B5FC33D13320A1F310E010936B01D0 +:10092000CF93DF93C22DC058DD271881F8943A94F5 +:100930002394CFE72C227894DF91CF9108951F93D1 +:10094000A895152D1032E0F71F91CF93DF93DFB7F5 +:10095000F894C52DC40DDFBFCF71C05ADD271883B1 +:100960005394DF91CF910895D2D0EFD00027009318 +:100970001201B4FC0FC0C0910301D0910401DE5FED +:10098000F02C97D20F920F1808F4002406940092CE +:1009900012010F90B3FC08C0072F000D28F4772731 +:1009A0009CDD10910501B9D600911201070F00934B +:1009B0004E0180934F01700D60914E0190904F0158 +:1009C00086FE07C0C0915001D0915101229771D28B +:1009D000900C87FE07C0C0915001D0915101239720 +:1009E00068D2600D5AD260930201A0920001C091BA +:1009F0005001D091510121965CD2702C0FEF0ABBAF +:100A0000C09A0FE18022809201010027801201C06C +:100A10007DC0AA27B92DB695A795B695A795B05EC6 +:100A200007C09394A05CBF4F80900101A09000018B +:100A3000AA2A22272196109105016FD63AD21127B2 +:100A400060910201662339F08894079417956A959E +:100A5000E1F7022A212F08E1F8943091170130279D +:100A6000307E30273BBBC49AC498789430931701EA +:100A70003A2D3F7335BB3B2F330F330FA7FA31F9B4 +:100A8000A6FA30F93BBBF894C39AC3987894309394 +:100A9000180100270ABBF894C0980000C19809B358 +:100AA0000026B0FC002A0FEF0ABB0BBA0000C09A68 +:100AB0007894C19AA3948A9409F0BCCF222311F1AF +:100AC0003A2D3F7335BB3B2F330F330FA7FA31F964 +:100AD000A6FA30F93BBBF894C39AC3987894309344 +:100AE000180100270ABBF894C0980000C19809B308 +:100AF0002027B0FC202B0FEF0ABB2BBB0000C09AB5 +:100B00007894C19A31D07A9409F08BCF0895C12F8F +:100B1000DD27CC0FDD1F10910301C10F10910401DF +:100B2000D11F10910501F9D5C4D12196F02CC1D166 +:100B3000CF2DD02D10910301C10F10910401D11FB1 +:100B4000C0935001D09351010895C0915001D091AC +:100B50005101AFD1802C219785FCABC1C09103011D +:100B6000D0910401DE5FA5C1CF93DF93192D39D059 +:100B70001881122B1883DF91CF9108952F93CF9373 +:100B8000DF9310913B012DD01881122309F41FC06F +:100B900028812127288310E010936B01AF93BF9326 +:100BA000CC27D0913B01D695C795D695C795AC2F4C +:100BB000BD2FB05E18E1B1D520E26CD51297269614 +:100BC00022E068D5BF91AF9110EC10936B011091AA +:100BD0003B0113951F7710933B01DF91CF912F912C +:100BE0000895CCE3D1E01F77212F269526952695F1 +:100BF000C20F20E0D21F21E0177019F0220F1A95C2 +:100C0000E9F7089554C56FC54CC587C597C48DCB0A +:100C1000DFC1DFC18FC5E6C1C6C278949090530191 +:100C2000609152013AD160930201A092000170904C +:100C30005501CC27D92DD695C795D695C795D05EA9 +:100C400018E16BD507C0C05CDF4F9394609102013F +:100C5000A0900001AC2A1FEF8090540100E08016A4 +:100C600041F008E08016B8F0662319F016956A95F1 +:100C7000E9F73BD108E010910201011B801AA3940F +:100C80001FEF08E0801638F0B1F02FD11FEF08E019 +:100C9000801AA394F6CF882079F016958A94E9F704 +:100CA0001095662341F02227169527956A95E1F75E +:100CB0001CD1A394122F19D157DF7A9400277012F8 +:100CC000C2CF0895009158010A950230D0F30091E7 +:100CD00059010330B0F3009156010395009352017E +:100CE0000091570100935301809058018A948A948F +:100CF0008092540101E0009355018FDF009156016D +:100D00000093520180905801809254013AC00091A2 +:100D100058010A950230A8F200915901033088F277 +:100D200000915601039500935201009157010093E1 +:100D30005301809058018A948A948092540101E072 +:100D4000009355016ADF0091560100935201009112 +:100D50005701039500935301709059017A947A9446 +:100D60007092550101E00093540157DF80905801C3 +:100D700000915601080D0A950093520101E000937D +:100D8000540100915701039500935301709059014C +:100D90007A947A947092550140DF00915601039540 +:100DA00000935201809058018A948A948092540151 +:100DB0007090590100915701070D0A950093530156 +:100DC00001E00093550129CF1FB60F930FEDC02E00 +:100DD000EF93FF93E42DE05AFF270081FF91EF91FD +:100DE0000CB95A9443940FE140226A940AF04CC023 +:100DF00051C01FB60F930FEDC02E0CB15C993EC0D1 +:100E0000E7FC2CC0E6FC0EC0023031F400E009B96A +:100E1000539A00E4E02A3EC00A3A19F400E0009335 +:100E20006A0138C0602E00E803190AF40FE7662053 +:100E300012F4052D00680CB9061508F4602E062D75 +:100E40000F7739F000ECE02A6A9422F55798559A0A +:100E500021C00FEBE022569A5E9A1CC0EF93FF93DD +:100E6000E32DE20DEF77E058FF270083FF91EF912C +:100E700033946A947AF40CC01FB60F93539807E129 +:100E800009B90FEBE022CC2455985698579A0CB12B +:100E90000FE7E0220F911FBE1895AA2400EFA01AB9 +:100EA00067FFAA246F77685014F0A394FCCF685FA3 +:100EB00008953C2F3F7335BB3D2F330F330FC7FBD6 +:100EC00031F9C6FB30F93BBBF894C39AC3987894C8 +:100ED0003093180100270ABBF894C0980000C09A0C +:100EE00009B278940FEF0ABB08953A2D3F7335BBD2 +:100EF0003D2F330F330FA7FA31F9A6FA30F93BBB78 +:100F0000F894C39AC39878943093180100270ABBC9 +:100F1000F894C0980000C09AF9B278940FEF0ABB19 +:100F2000B1FE03C01095F12203C0F126B0FCF12AF6 +:100F30003A2D3F7335BB3D2F330F330FA7FA31F9ED +:100F4000A6FA30F93BBBF894C39AC39878943093CF +:100F50001801FBBAF894C198C0980000C09A789420 +:100F6000C19A0895772788279924C0E0D0E218E134 +:100F7000D4D3AA24A0920001109100011C2B312F80 +:100F80003F7335BB3D2F330F330F17FB31F916FB82 +:100F900030F93BBBF894C39AC39878943093180106 +:100FA00000E00BBBF894C198C0980000C09A7894F8 +:100FB000C19AA39400E2A01619F0A0920001DCCF20 +:100FC000D3DD9394C05CDF4FD03409F0D2CF0895C5 +:100FD00018951FB68B9A4CB55DB550930901409397 +:100FE000080114C11FB65AB35F935BB35F9355B347 +:100FF0005F93509118015F935FEF5ABB50E75FBD5D +:101000004CB55DB5485F5F4F5BBD4ABD59BD48BD3E +:1010100040914C0150914D015170452B49F4509134 +:101020006B01539550936B0151F45FEBB5222DC9C1 +:1010300000000000000000000000000000008B9A8B +:10104000939A55275EBD5DBD5CBD50914D01542BFB +:1010500071F0509117015BBBC49ADD9ADD98C4987A +:101060000000000000000000000000000EC05091D1 +:101070001701506850625BBBC49A40E654275BBBC3 +:101080005F775BBBC49850931701509117015F9332 +:10109000EF93FF93E0914C01F0914D01E05CFF4F25 +:1010A000FF713F933E2F3F7335BB3F2F330F330FFD +:1010B000E7FB31F9E6FB30F93BBBC39AC398F093E9 +:1010C000180130911701F7FB31F9F6FB30F93BBB02 +:1010D000C49AC498309317013F91C198C19A9798C8 +:1010E00044274ABB40EC44BBC09855275BBD5ABD62 +:1010F00059E05EBDE0934C01F0934D01FF91EF91FB +:101100005CE35A95F1F7C09A5FEF5ABB979A54BBCC +:101110008D98959851E000005EBD5BE05A95F1F71F +:1011200050910D0140910C018D9A859907C04A3369 +:101130009DEF590752F0415050400BC0453D9FEF85 +:1011400059071AF44F5F5F4F04C000000000000011 +:10115000000050930D0140930C015BBD4ABD4091CE +:101160000C0150910D0190910E01491B90910F01BE +:10117000590B1AF445ED5FEF04C04CEA5EEF000036 +:10118000000059BD48BD52E053BF5DEE52BF51E073 +:10119000509368015DEF5DBD54E35CBD8B989398FF +:1011A00050EE5FBD21C01FB65AB35F935BB35F9330 +:1011B00055B35F93509118015F93509117015F935E +:1011C000FF93EF930F925FEF5ABB509168015395D5 +:1011D000509368015A95E1F05A9511F15A9509F426 +:1011E00089C00F90EF91FF915F915BBBC49AC49847 +:1011F000509317015F915BBBC39AC398509318013A +:101200005F9155BB5F915BBB5F915ABB1FBE189549 +:1012100053E053BF50EF52BF51E05093680153C1A8 +:1012200050911001552399F150911101505118F02E +:10123000509311012CC0452F429554235093110116 +:101240004091190143FF10C0509110015A955093DD +:101250001001A1F050911901577F546055BBC29AFB +:10126000C2985093190113C05091190158605B7FC7 +:1012700055BBC29AC2985093190109C050911901E7 +:10128000577F5B7F55BBC29AC2985093190150910A +:10129000690157FF06C050E8B5261AF4552753BF19 +:1012A000A0CF52E053BF52EF52BFEAE3F8E1552717 +:1012B000ED0DF51FC89554E3D51648F4509119016A +:1012C0005F7E55BBC29AC2985093190108C05091D5 +:1012D0001901506155BBC29AC298509319010BBABB +:1012E0000090190105BAA99AC29AC298A998C29AFF +:1012F000C29877CF50B340EE4BBB4091190145BB2C +:10130000A99AC29AC298A998C29AC298889456FD7E +:1013100008C050911301552319F054E05093130164 +:1013200008944FB754E3D51660F44FBFE091150110 +:10133000F0911601EE1FFF1FE0931501F0931601C7 +:101340007BC04FBF08F078C050911301552321F0A6 +:1013500054E05093130170C0F0911601E091150113 +:1013600050911401552329F0452FF795E7954450E6 +:10137000E1F75C5FF795E79518F05433D0F35CC064 +:101380005093140144E3451BECE3F8E15527E40FC7 +:10139000F51FC895402D000C000C000C400D000CF2 +:1013A000400DECE3F8E15527ED0DF51FC895400D14 +:1013B000E0E0F0EE5527E40FF51F3F933E2F3F731B +:1013C00035BB3F2F330F330FE7FB31F9E6FB30F925 +:1013D0003BBBC39AC398F093180130911701F7FBF8 +:1013E00031F9F6FB30F93BBBC49AC498309317012E +:1013F0003F910F9300270ABBC0980000C09A09B222 +:101400000FEF0ABB0F91002029F4509114015433BF +:1014100098F45EC054E0509313010092070156E324 +:1014200050931001552D5F3138F41F93102D8DDA34 +:101430001B3109F48ADA1F9154E0D50E50916901ED +:1014400057FD27C053E053BF50EF52BF51E05093B8 +:10145000680144E3D416E8F250E053BF50911601FE +:1014600040911501452B50916A01543018F45130C8 +:1014700028F4B7CE442329F055E003C0442309F4EF +:1014800054E05A9550936A01A1F75FEBB5228A9810 +:10149000CECD50E053BF5093140148ECD416C0F0A9 +:1014A00050911301552379F05A955093130159F433 +:1014B00050910701552339F0552D503220F41F93D8 +:1014C00010E043DA1F91DD24D0921501D09216016D +:1014D000EAE3F8E131965527ED0DF51FC8955091D7 +:1014E0006901507850645029509369015BBB509159 +:1014F000190155BBA89AC29AC298A898C29AC298D4 +:1015000070CE9924C0E0D0E2A0E0B0E218E105D1AD +:10151000A05CBF4F0A94E1F720E22F93C8D0E3D03C +:10152000A395C3952F912A9509F0F7CF1DDB9394CE +:10153000A0969096B03409F0EFCF1BCDDFD91F9362 +:10154000DDD910937201DAD916951695169509F41E +:1015500010E210937501D2D910937601172F1695CA +:1015600016951695109373018093740118E1D5D0E8 +:101570001F9110FD46C0CC27D09174019D2ED695A9 +:10158000C795D695C79510917301C10FD05E209174 +:10159000760110917201121720F5211BAA27B09134 +:1015A0007401B10FB695A795B695A79510917301E3 +:1015B000A10FB05E2F93AF93BF93CF93DF93209192 +:1015C000750168D0D1DADF91CF91BF91AF912F91A2 +:1015D0009394A05CBF4FC05CDF4F2A9559F72091D0 +:1015E00072012F93CF93DF93209175015AD0BCDA0B +:1015F000DF91CF912F919394C05CDF4F2A9589F7AB +:1016000006CBCC27D091740100917601D00F9D2E8E +:10161000D695C795D695C79510917301C10FD05E29 +:10162000202F10917201121728F5211BAA27B091C3 +:101630007401B00FB11BB695A795B695A7951091FB +:101640007301A10FB05E9A94A054B040C054D04032 +:101650002F93AF93BF93CF93DF93209175011AD04F +:1016600083DADF91CF91BF91AF912F912A9559F7EE +:10167000209172019A94C054D0402F93CF93DF935E +:10168000209175010ED070DADF91CF912F912A95BC +:1016900089F7BDCA0CD0119626D021962A95D1F78C +:1016A000089510E020D021962A95E1F708953A2F69 +:1016B0003F7335BB3B2F330F330FA7FB31F9A6FB2D +:1016C00030F93BBBF894C39AC398789430931801CF +:1016D00000270ABBF894C0980000C09A19B3789408 +:1016E0000FEF0ABB08953C2F3F7335BB3D2F330FDF +:1016F000330FC7FB31F9C6FB30F93BBBF894C39AF3 +:10170000C3987894309318011BBBF894C198C09883 +:101710000000C09A7894C19A0895F8943091170106 +:101720003127307E31273BBBC49AC49878943093DC +:10173000170108951FB650915F015C5550935F01EA +:10174000509160015F4F5093600150916101564E7E +:10175000543650F4509361011FBEB6FE189550E008 +:101760005093680120CDF1C850E050936101509131 +:10177000620153955C33E8F15091630153955C33FA +:10178000A8F1509164015395583168F1EF93FF939C +:101790000F92EDE2F8E190916601E90F90E0F91FF8 +:1017A000C895902D9C3131F49091670193709CE124 +:1017B00009F49DE10F90FF91EF9150916501591748 +:1017C00070F0509166015C3030F050916701539594 +:1017D00050936701552753955093660155275395AC +:1017E0005093650155275093640155275093630129 +:1017F000552750936201552D5931C0F41F931BE1B9 +:10180000A4D814E5A2D810916401ADDF1091630152 +:10181000AADF10916201A7DF10916601A4DF109189 +:101820006501A1DF109167019EDF1F9195CF1F1CFD +:101830001F1E1F1E1F1F1E1F1E1FF0340000E83436 +:101840000100F0330100E8330200E4330300E83222 +:101850000300E4320400E2320500E4310500E23125 +:101860000600E1310700E2300700E1300800C12A3C +:101870000000C22A0100C12B0100C22B0200C42BB0 +:101880000300C22C0300C42C0400C82C0500C4189B +:101890000500C8180600D0180700C8190700D0199D +:1018A0000800A1190900D01A0900A11A0A00A21AF9 +:1018B0000B00A11B0B00A21B0C00A41B0D00A21C03 +:1018C0000D00A41C0E00A81C0F00A41D0F00A81DD5 +:1018D0001000B01D1100A81E1100B01E1200611EE4 +:1018E0001300B01F1300611F1400621F1500612850 +:1018F0001500622816006428170062291700642961 +:1019000018000000000000000000000000000000BF +:1019100000000000000000000808080000000000AF +:1019200000000000000000000000000000000000B7 +:10193000000000007E00310032003300340035002A +:10194000360037003800390030002D003D0000001F +:101950000000000000000000000000000000000087 +:1019600000000000000051005700450052005400E4 +:101970005900550049004F0050005B005D005C00BD +:101980000000000000000000000000000000000057 +:101990000000000000000000410053004400460029 +:1019A000470048004A004B004C003B0027000D0D4B +:1019B0000D0000000000000000000000000000001A +:1019C0000000000000000000000000005A00580065 +:1019D0004300560042004E004D002C002E002F0008 +:1019E0000000000046323444303331393033313274 +:1019F000313730394C034C034C034C034C034C033C +:101A00004C034C034C034C034C034C034C034C035E +:101A10004C034C034C034C034C034C034C034C034E +:101A20004C034C034C034C034C034C034C034C033E +:101A30004C034C0300014C034C034C034C034C037C +:101A40004C034C034C034C034C034C034C03030169 +:101A50004C034C0306010F01180121012A01330137 +:101A60003C0145014E0157014C034C034C034C0310 +:101A70004C034C034C036001690172017B0184013A +:101A80008D0196019F01A901B201BB01C401CD01E5 +:101A9000D601DF01E801F101080211021A02230256 +:101AA0002C0235023E02470250024C034C034C0309 +:101AB0004C034C034C03590262026B0274027D0218 +:101AC00086028F029902A302AD02B802C202CB02C3 +:101AD000D402DD02E602F002FC0203030C0315034C +:101AE0001E0327033003390343034C034C034C0309 +:101AF0004C034C030003066101F80107708898A8A5 +:101B0000C88870010720602020202070010770889D +:101B100008102040F80107F810201008887001070D +:101B200010305090F810100107F880F00808887005 +:101B30000107304080F08888700107F808102040C5 +:101B40004040010770888870888870010770888815 +:101B500078081060010770888888F888880107F085 +:101B60008888F08888F001077088808080887001FC +:101B700007E09088888890E00107F88080F08080F6 +:101B8000F80107F88080F08080800107708880B8B5 +:101B90008888780107888888F888888802210780E3 +:101BA000808080808080010708080808088870010C +:101BB000078890A0C0A090880107808080808080E6 +:101BC000F8010788D8A8A888888801078888C8A845 +:101BD0009888880107708888888888700107F0884D +:101BE00088F0808080010770888888A890684C03FE +:101BF0004C034C03060801014F0065030107F08800 +:101C000088F0A090880107708880700888700107AC +:101C1000F820202020202001078888888888887064 +:101C20000107888888888850200107888888A8A8A4 +:101C3000A850010788885020508888010788888824 +:101C4000502020200107F80810204080F8010700EC +:101C500000700878887801078080F0888888F00113 +:101C600007000078808080780107080878888888D5 +:101C700078010700007088F8807001071820F820AC +:101C800020202001080000788888780870010780EB +:101C900080B0C8888888022107800080808080808A +:101CA0000521081000101010109060052107808099 +:101CB00090A0C0A090032107C04040404040400198 +:101CC000070000F0A8A8A8A801070000B0C88888ED +:101CD0008801070000708888887001080000F0887B +:101CE00088F080800108000078888878080802055C +:101CF0006105B0C08080800107000078807008F026 +:101D000001072020F820202018010700008888887B +:101D10009868010700008888885020010700008823 +:101D200088A8A850010700008850205088010800AA +:101D30000088888878087001070000F8102040F8B3 +:101D40000107F8F8F8F8F8F8F80070935601809356 +:101D50005701D4D510935801D1D51093590126D0ED +:101D6000E4C27093560180935701C8D5109358016F +:101D7000C5D5109359012FD0D8C2709352018093CA +:101D80005301BCD510935401B9D51093550178D0A7 +:101D9000CCC27093520180935301B0D5109354017B +:101DA000ADD51093550171D0C0C208950091560170 +:101DB0000093520100915701009353010091580183 +:101DC00000935401009159010093550102E0B02A9B +:101DD00024D70DEFB022009158010A95023028F364 +:101DE00000915901033008F300915601009352010C +:101DF0000091570100935301009158010093540141 +:101E000001E00093550109D700915601009352015A +:101E1000009157010395009353010091590102501D +:101E20000093550101E000935401F7D680905801CA +:101E300000915601080D0A950093520101E00093AC +:101E400054010091570103950093530100915901EA +:101E5000025000935501E1D60091560100935201C2 +:101E6000009158010093540170905901009157015D +:101E7000070D0A950093530101E000935501CDC66B +:101E800002E0B02ACAD60DEFB022789490905301A8 +:101E90006091520102D860930201A09200017090FB +:101EA0005501CC27D92D15E5D0FF1AEA012ED6957C +:101EB000C795D695C795D05E18E12FDC07C0C05CEA +:101EC000DF4F939460910201A0900001AC2A1FEFB4 +:101ED0008090540100E0801641F008E08016C8F0C0 +:101EE000662319F016956A95E9F71021FED708E0E8 +:101EF00010910201011B801AA3941FEF08E08016C5 +:101F000040F0C1F01021F1D71FEF08E0801AA39430 +:101F1000F5CF882089F016958A94E9F71095662305 +:101F200049F02227169527956A95E1F71021DDD70C +:101F3000A394122F1021D9D7009416D67A94002793 +:061F40007012BDCF0895F0 +:0220000002419B +:00000001FF diff --git a/src/avr/WPO15V1.HEX b/src/avr/WPO15V1.HEX new file mode 100644 index 00000000..4f579fba --- /dev/null +++ b/src/avr/WPO15V1.HEX @@ -0,0 +1,132 @@ +:020000020000FC +:020000000EC030 +:06001200DCC1A3C270C1B5 +:10001C0064C302E00EBF0FE50DBF00E808B9A89558 +:10002C000FE001BD0AE50093CC0000E00DB90AB960 +:10003C000FEF04BBC79ABE9AD79A8E9A929A939A4C +:10004C00959A8D9ADE98D69897988F9A94988C9AC0 +:10005C00C398BB9A9198899A07E00DD106E00BD111 +:10006C0005E009D104E007D101E005D100E003D19E +:10007C000FE509B908E10AB92AD10AEA0CB90CB999 +:10008C0029D1949A27D1949825D1949A0027E0E607 +:10009C00FF27019301930193EFEB019301930193DC +:1000AC00019301930193019301930093BC0000937E +:1000BC00CA000093BD000093BE0000E4008300E082 +:1000CC000093C80004E00093C9004427662711245C +:1000DC0088249924AA2455246624772402E00093CA +:1000EC00B70001E00093B3000093B4000093B50097 +:1000FC000093B6000093B8000093B9000093CB00B6 +:10010C0000E00093BA000093BB0000EF202E00EF3C +:10011C00402E02E003BF01E009BF0EB10FB108EEA3 +:10012C000DB900E00DBD0CBD0BBD0ABD01EC0FBD42 +:10013C0001E00EBD05E007B90EED06B9789402E0BA +:10014C001EE1E2E6F7E0A8D00091CC000A3509F0F8 +:10015C0066C041FD6FC043FD7AC040FFF5CF0091F2 +:10016C00CB00033041F0023091F002E01FE0EEE9E9 +:10017C00F7E092D006C002E01FE0EEEDF7E08CD085 +:10018C0000C003E01EE1E0E8F7E086D00FC002E01B +:10019C001CE0EEEAF7E080D003E01EE1E2E6F7E0D7 +:1001AC007BD003E01CE0EEEAF7E076D01CD00B31FC +:1001BC0009F0FCCF18D0043409F0F8CF14D0037038 +:1001CC0039F0013039F0023039F0033039F0EECF2C +:1001DC00969A05C0969803C0DF9A01C0DF9810E389 +:1001EC00100FE4CF78940091CC000A35C1F441FD96 +:1001FC0021C043FD2CC0F8949920A1F30091B300C9 +:10020C00093081F7EF93FF93E82DED59FF2700811B +:10021C009A948394EFE38E22FF91EF91189502E06C +:10022C001EE1E2E6F7E038D002E01FE0EEEEF7E088 +:10023C0033D00AC002E01EE1E2E6F7E02DD002E086 +:10024C001FE0EAEBF7E028D043FD01C0FDCF02E050 +:10025C001EE1E2E6F7E020D002E01FE0EAECF7E076 +:10026C001BD00AEF37D00A95E9F702E013E0EAED6C +:10027C00F7E012D0F6CFC39802FF919802FD919A45 +:10028C0029D001FF919801FD919A26D000FF9198F9 +:10029C0000FD919AC39A22C078940000F894AA2089 +:1002AC00D9F70093B400C895002D04D031961A9557 +:1002BC00D1F71895EF93FF93E92DEA0DE80DEF7345 +:1002CC00ED59FF270083FF91EF91A3940895E0EF80 +:1002DC00FAE006C0E8EC03C0E4E101C0E2E0F0E0C3 +:1002EC0020E02A95F1F73197E1F70895FFB666FD06 +:1002FC0022C03CB13125F2F0312552F0EF93FF933F +:10030C00EEEBF091B300EF0FFF273083FF91EF91ED +:10031C00131608F0132E6F7E6064312D3F7741F079 +:10032C0011202AF157986F7D3FEF232E606146C054 +:10033C0038EF40C03EC03091B600313019F031E09A +:10034C003093BB003CB1EF93FF93E62DE70DE50D29 +:10035C00EF70ED55FF273083E091B500F091B600BA +:10036C00EF1711F4639401C07394FF91EF913FEF79 +:10037C00232E1A940AF530EF232E60611FC0EF93E1 +:10038C00FF93EEEBF091B300EF0FFF2730813A951E +:10039C003083E82DED59FF273081FF91EF913CB967 +:1003AC003FEF232E9A9483943FE383221A9431F4E3 +:1003BC0003C030EF232E6F7E57986F79FFBE1895D0 +:1003CC00FFB63091BD007091BE00732B49F03150D7 +:1003DC003093BD003091BE0030403093BE0091F0A0 +:1003EC00442051F0439441F430E03DB93EB13FB16B +:1003FC0038EE3DB9D69A687F222011F02394B9F0DB +:10040C00FFBE189506CE67FD18C0890C3FE383220A +:10041C0099249092BA00EF93FF93EEEBF091B30016 +:10042C00EF0FFF2730E43083FF91EF9106C065FD9D +:10043C00EACF66FDA4CF64FD7AC038EF232E30914D +:10044C00BC00332359F03A953093BC0031F0C3987B +:10045C009198899A30E03AB9B1CFDBCD57983FE506 +:10046C0039B93091BA0039293A2939F43091B800A8 +:10047C003A9549F03093B80037C03091B9003A95AD +:10048C0091F03093B90030E13093B800992030915D +:10049C00B30041F4AA2041F09A2CAA243091B40064 +:1004AC003093B300393001F16F779920B9F4AA2059 +:1004BC0059F43091BA003A9542F43091B300339527 +:1004CC00393048F031E007C031E03093BA009A2C53 +:1004DC00AA243091B4003093B30025C031E030939E +:1004EC00BA003091B3001FC030E13093B90060689E +:1004FC003091BB00332331F03A953093BB003091EF +:10050C00B60011C03091B600772069F47091B70035 +:10051C003093B700372F313021F03395393008F054 +:10052C0032E03093B6003CB960616F7947CF30EF61 +:10053C00232E33E039B9392D67FF04C030E1361969 +:10054C00371930683CB9132E579A3CB1606236CFDC +:10055C00FFB6D6983FB162FD8EC060FD5EC061FDF6 +:10056C0057C03A3090F1303899F0313899F0313930 +:10057C00A1F0323991F0333981F0353A99F03A3AA9 +:10058C00E1F0353CD9F030E03DB944244260A3C0E1 +:10059C0097989FC04160979A9CC030593093CB007C +:1005AC00416097C03FEF3093BC0030E03DB9949868 +:1005BC003FEF70E07BBD3ABD8CC02BCD38EE309355 +:1005CC00BD0033E03093BE0084C0332379F46860FF +:1005DC00662049F47720C1F0672C77243090B60060 +:1005EC003092B50012C03090B5000FC0677F332E2B +:1005FC00AA2021F03091B400331531F431E030935E +:10060C00BA003092B40001C033243FB8626061C0BC +:10061C006D7F332009F061605CC0332E6E7F332018 +:10062C0063FF05C05AF5362D30681FC051C0F2F378 +:10063C00EF93FF93EEEBF091B400EF0FFF273081B7 +:10064C00E091B300F091B400EF1731F0E0E4E91958 +:10065C003E1730F03E2F04C0303408F030E4391926 +:10066C003A19FF91EF910AF43FE7331508F4332E52 +:10067C003FB964602EC033208AF43A944AF5616025 +:10068C00EF93FF93E52DED55FF2730813FB9FF9197 +:10069C00EF916A9453943FE053221BC060FF14C047 +:1006AC00EF93FF93E92DEA0DE80DEF73ED59FF275A +:1006BC003083E091B300F091B400EF1711F49394F0 +:1006CC0001C0A394FF91EF913A9412F0616001C0C4 +:1006DC006B7F30EF432EFFBE1895FFB6A89534B153 +:1006EC00532F35B1379557953795579544FD12C013 +:1006FC0040613091BC00332331F530E070E05C5147 +:10070C0000F130E670E05038E0F45695352F5695F0 +:10071C00350F17C04F7E5093CA00583A30E074E042 +:10072C0058F43091C8007091C9003150704021F4D8 +:10073C0030E03DB9442448603093C8007093C90040 +:10074C0002C07BBD3ABD34E044FF35E037B93EED25 +:10075C0036B9FFBE18951B44301B47301B50311B5C +:10076C0045301B4B1B301B2F301B5300001B4E0006 +:10077C00801B45311B44301B47301B50311B45300F +:10078C001B4B1B301B2F301B5300001B4EF0401B10 +:10079C0045311B53100D48595445434820313030D6 +:1007AC0030001B53100D57504F33302056351B5310 +:1007BC00100D42414420434F4D4D414E44001B53BC +:1007CC00100D42415454455259204C4F57001B4D6B +:1007DC0030001B53100D48595445434820313530D7 +:1007EC0030001B53100D535441434B204F56455270 +:0407FC00464C4F57C1 +:042000000041BFAC30 +:00000001FF diff --git a/src/avr/WPOV0.HEX b/src/avr/WPOV0.HEX new file mode 100644 index 00000000..ef6e47ff --- /dev/null +++ b/src/avr/WPOV0.HEX @@ -0,0 +1,135 @@ +:020000020000FC +:020000000BC033 +:06000C00DBC1A2C26DC1C0 +:1000160063C30FED0DBF00E808B9A8950FE001BD59 +:100026000AE50093CD0000E00DB90AB9C59ABC9A5D +:100036008D9A8E9AAC9A929A939AC19AB99AC098C6 +:10004600B89897988F9A94988C9AAA98A29A919809 +:10005600899A07E00CD106E00AD105E008D104E050 +:1000660006D101E004D100E002D10FE809B908E1A8 +:100076000AB929D10AEA0CB90CB928D1949A0027F1 +:10008600E0E6FF27019301930193EFEB01930193C0 +:100096000193019301930193019301930093BC0093 +:1000A6000093CB000093BD000093BE0000E40083E4 +:1000B60000E00093C80004E00093C90000E100934B +:1000C600CA0044276627112488249924AA24552483 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CC0000E00093BA0000938F +:10010600BB0007EE202E07EE402E02E003BF02E002 +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1EEE8F7E0A8D0ED +:100146000091CD000A3509F066C041FD6FC043FD40 +:100156007AC040FFF5CF0091CC00033041F0023069 +:1001660091F002E01FE0EAECF7E092D006C002E070 +:100176001FE0EAE0F8E08CD000C003E01EE1ECEA04 +:10018600F7E086D00FC002E01CE0EAEDF7E080D091 +:1001960003E01EE1EEE8F7E07BD003E01CE0EAEDC9 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CD000A35C1F441FD21C043FD2CC0F89471 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1EEE8F7E038D085 +:1002260002E01FE0EAE1F8E033D00AC002E01EE196 +:10023600EEE8F7E02DD002E01FE0E6EEF7E028D08A +:1002460043FD01C0FDCF02E01EE1EEE8F7E020D05D +:1002560002E01FE0E6EFF7E01BD00AEF37D00A9581 +:10026600E9F702E013E0E6E0F8E012D0F6CFAA984C +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A27D000FF919800FD919AAA9A23C0CF +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895ECEDFFE007C0E2E2F1E0C0 +:1002D60004C0EDE101C0E3E0F0E020E02A95F1F78B +:1002E6003197E1F70895FFB666FD22C03CB131258E +:1002F600F2F0312552F0EF93FF93EEEBF091B3005D +:10030600EF0FFF273083FF91EF91131608F0132E9E +:100316006F7E6064312D3F7741F011202AF15798A6 +:100326006F7D3FEF232E606148C033EF42C040C06F +:100336003091B600313019F031E03093BB003CB15A +:10034600EF93FF93E62DE70DE50DEF70ED55FF27D3 +:100356003083E091B500F091B600EF1711F4639485 +:1003660001C07394FF91EF913EEF232E1A941AF574 +:1003760037EE232E606121C0EF93FF93EEEBF091F1 +:10038600B300EF0FFF2730813A953083E82DED5902 +:10039600FF273081FF91EF913CB93695330B3A95A3 +:1003A600232E9A9483943FE383221A9431F403C054 +:1003B60037EE232E6F7E57986F79FFBE1895FFB6DE +:1003C6003091BD007091BE00732B49F031503093CF +:1003D600BD003091BE0030403093BE0091F0442005 +:1003E60051F0439441F430E03DB93EB13FB138EEAF +:1003F6003DB9B89A687F222011F02394B9F0FFBE68 +:10040600189507CE67FD18C0890C3FE3832299240F +:100416009092BA00EF93FF93EEEBF091B300EF0FDB +:10042600FF2730E43083FF91EF9106C065FDEACFE8 +:1004360066FDA2CF64FD7AC033EF232E3091BC0057 +:10044600332359F03A953093BC0031F0AA9891982D +:10045600899A30E03AB9B1CFDCCD57983FE839B93F +:100466003091BA0039293A2939F43091B8003A95D1 +:1004760049F03093B80037C03091B9003A9591F001 +:100486003093B90030E13093B80099203091B30031 +:1004960041F4AA2041F09A2CAA243091B40030935A +:1004A600B300393001F16F779920B9F4AA2059F4D5 +:1004B6003091BA003A9542F43091B3003395393011 +:1004C60048F031E007C031E03093BA009A2CAA24F4 +:1004D6003091B4003093B30025C031E03093BA00B8 +:1004E6003091B3001FC030E13093B900606830919D +:1004F600BB00332331F03A953093BB003091B60000 +:1005060011C03091B600772069F47091B70030932E +:10051600B700372F313021F03395393008F032E00B +:100526003093B6003CB960616F7947CF37EE232E22 +:1005360035E039B9392D67FF04C030E1361937196E +:1005460030683CB9132E579A3CB1606236CFFFB67D +:10055600B8983FB162FD8EC060FD5EC061FD57C0B8 +:100566003A3090F1303899F0313899F03139A1F0BC +:10057600323991F0333981F0353A99F03A3AE1F06F +:10058600353CD9F030E03DB944244260A3C0979889 +:100596009FC04160979A9CC030593093CC0041600F +:1005A60097C03FEF3093BC0030E03DB994983FEFE1 +:1005B60070E07BBD3ABD8CC02CCD38EE3093BD00CB +:1005C60033E03093BE0084C0332379F4686066203C +:1005D60049F47720C1F0672C77243090B60030922A +:1005E600B50012C03090B5000FC0677F332EAA2029 +:1005F60021F03091B400331531F431E03093BA0074 +:100606003092B40001C033243FB8626061C06D7F90 +:10061600332009F061605CC0332E6E7F332063FFA8 +:1006260005C05AF5362D30681FC051C0F2F3EF935E +:10063600FF93EEEBF091B400EF0FFF273081E091CE +:10064600B300F091B400EF1731F0E0E4E9193E177A +:1006560030F03E2F04C0303408F030E439193A192E +:10066600FF91EF910AF43FE7331508F4332E3FB9B3 +:1006760064602EC033208AF43A944AF56160EF93A1 +:10068600FF93E52DED55FF2730813FB9FF91EF919F +:100696006A9453943FE053221BC060FF14C0EF934B +:1006A600FF93E92DEA0DE80DEF73ED59FF2730832F +:1006B600E091B300F091B400EF1711F4939401C0E8 +:1006C600A394FF91EF913A9412F0616001C06B7FA1 +:1006D60037EE432EFFBE1895FFB6A89534B1532FBB +:1006E60035B1379557953795579544FD12C04061FA +:1006F6003091BC003323C9F430E070E05C51C0F1A6 +:1007060030E670E05038A0F55695352F5695350FE2 +:100716002FC04F7E45FD0DC0583F40F03091CA00B6 +:100726003A953093CA0031F5406224C030E13093E7 +:10073600CA005093CB00593330E074E058F0309142 +:10074600C8007091C9003150704021F430E03DB9C5 +:10075600442448603093C8007093C900563450F062 +:100766003FEF3093BC0030E03DB994983FEF70E026 +:100776007BBD3ABD35E445FF34E044FF35E037B98B +:100786003EED36B9FFBE18951B44301B47301B5053 +:10079600311B45301B4B1B301B2F301B5300001BDE +:1007A6004E00801B45311B44301B47301B50311B0C +:1007B60045301B4B1B301B2F301B5300001B4EF0CC +:1007C600401B45311B53100D4859544543482031B1 +:1007D600303030001B53100D57504F3330205635F4 +:1007E6001B53100D42414420434F4D4D414E440092 +:1007F6001B53100D42415454455259204C4F57003B +:100806001B4D30001B53100D4859544543482031A9 +:10081600353030001B53100D535441434B204F5677 +:060826004552464C4F57FD +:042000000041B4AC3B +:00000001FF diff --git a/src/avr/WPOV1.HEX b/src/avr/WPOV1.HEX new file mode 100644 index 00000000..52ed13d4 --- /dev/null +++ b/src/avr/WPOV1.HEX @@ -0,0 +1,135 @@ +:020000020000FC +:020000000BC033 +:06000C00DBC1A2C26DC1C0 +:1000160063C30FED0DBF00E808B9A8950FE001BD59 +:100026000AE50093CD0000E00DB90AB9C59ABC9A5D +:100036008D9A8E9AAC9A929A939AC19AB99AC098C6 +:10004600B89897988F9A94988C9AAA98A29A919809 +:10005600899A07E00CD106E00AD105E008D104E050 +:1000660006D101E004D100E002D10FE809B908E1A8 +:100076000AB929D10AEA0CB90CB928D1949A0027F1 +:10008600E0E6FF27019301930193EFEB01930193C0 +:100096000193019301930193019301930093BC0093 +:1000A6000093CB000093BD000093BE0000E40083E4 +:1000B60000E00093C80004E00093C90000E100934B +:1000C600CA0044276627112488249924AA24552483 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CC0000E00093BA0000938F +:10010600BB0007EE202E07EE402E02E003BF02E002 +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1EEE8F7E0A8D0ED +:100146000091CD000A3509F066C041FD6FC043FD40 +:100156007AC040FFF5CF0091CC00033041F0023069 +:1001660091F002E01FE0EAECF7E092D006C002E070 +:100176001FE0EAE0F8E08CD000C003E01EE1ECEA04 +:10018600F7E086D00FC002E01CE0EAEDF7E080D091 +:1001960003E01EE1EEE8F7E07BD003E01CE0EAEDC9 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CD000A35C1F441FD21C043FD2CC0F89471 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1EEE8F7E038D085 +:1002260002E01FE0EAE1F8E033D00AC002E01EE196 +:10023600EEE8F7E02DD002E01FE0E6EEF7E028D08A +:1002460043FD01C0FDCF02E01EE1EEE8F7E020D05D +:1002560002E01FE0E6EFF7E01BD00AEF37D00A9581 +:10026600E9F702E013E0E6E0F8E012D0F6CFAA984C +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A27D000FF919800FD919AAA9A23C0CF +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895ECEDFFE007C0E2E2F1E0C0 +:1002D60004C0EDE101C0E3E0F0E020E02A95F1F78B +:1002E6003197E1F70895FFB666FD22C03CB131258E +:1002F600F2F0312552F0EF93FF93EEEBF091B3005D +:10030600EF0FFF273083FF91EF91131608F0132E9E +:100316006F7E6064312D3F7741F011202AF15798A6 +:100326006F7D3FEF232E606148C033EF42C040C06F +:100336003091B600313019F031E03093BB003CB15A +:10034600EF93FF93E62DE70DE50DEF70ED55FF27D3 +:100356003083E091B500F091B600EF1711F4639485 +:1003660001C07394FF91EF913EEF232E1A941AF574 +:1003760037EE232E606121C0EF93FF93EEEBF091F1 +:10038600B300EF0FFF2730813A953083E82DED5902 +:10039600FF273081FF91EF913CB93695330B3A95A3 +:1003A600232E9A9483943FE383221A9431F403C054 +:1003B60037EE232E6F7E57986F79FFBE1895FFB6DE +:1003C6003091BD007091BE00732B49F031503093CF +:1003D600BD003091BE0030403093BE0091F0442005 +:1003E60051F0439441F430E03DB93EB13FB138EEAF +:1003F6003DB9B89A687F222011F02394B9F0FFBE68 +:10040600189507CE67FD18C0890C3FE3832299240F +:100416009092BA00EF93FF93EEEBF091B300EF0FDB +:10042600FF2730E43083FF91EF9106C065FDEACFE8 +:1004360066FDA2CF64FD7AC033EF232E3091BC0057 +:10044600332359F03A953093BC0031F0AA9891982D +:10045600899A30E03AB9B1CFDCCD57983FE839B93F +:100466003091BA0039293A2939F43091B8003A95D1 +:1004760049F03093B80037C03091B9003A9591F001 +:100486003093B90030E13093B80099203091B30031 +:1004960041F4AA2041F09A2CAA243091B40030935A +:1004A600B300393001F16F779920B9F4AA2059F4D5 +:1004B6003091BA003A9542F43091B3003395393011 +:1004C60048F031E007C031E03093BA009A2CAA24F4 +:1004D6003091B4003093B30025C031E03093BA00B8 +:1004E6003091B3001FC030E13093B900606830919D +:1004F600BB00332331F03A953093BB003091B60000 +:1005060011C03091B600772069F47091B70030932E +:10051600B700372F313021F03395393008F032E00B +:100526003093B6003CB960616F7947CF37EE232E22 +:1005360035E039B9392D67FF04C030E1361937196E +:1005460030683CB9132E579A3CB1606236CFFFB67D +:10055600B8983FB162FD8EC060FD5EC061FD57C0B8 +:100566003A3090F1303899F0313899F03139A1F0BC +:10057600323991F0333981F0353A99F03A3AE1F06F +:10058600353CD9F030E03DB944244260A3C0979889 +:100596009FC04160979A9CC030593093CC0041600F +:1005A60097C03FEF3093BC0030E03DB994983FEFE1 +:1005B60070E07BBD3ABD8CC02CCD38EE3093BD00CB +:1005C60033E03093BE0084C0332379F4686066203C +:1005D60049F47720C1F0672C77243090B60030922A +:1005E600B50012C03090B5000FC0677F332EAA2029 +:1005F60021F03091B400331531F431E03093BA0074 +:100606003092B40001C033243FB8626061C06D7F90 +:10061600332009F061605CC0332E6E7F332063FFA8 +:1006260005C05AF5362D30681FC051C0F2F3EF935E +:10063600FF93EEEBF091B400EF0FFF273081E091CE +:10064600B300F091B400EF1731F0E0E4E9193E177A +:1006560030F03E2F04C0303408F030E439193A192E +:10066600FF91EF910AF43FE7331508F4332E3FB9B3 +:1006760064602EC033208AF43A944AF56160EF93A1 +:10068600FF93E52DED55FF2730813FB9FF91EF919F +:100696006A9453943FE053221BC060FF14C0EF934B +:1006A600FF93E92DEA0DE80DEF73ED59FF2730832F +:1006B600E091B300F091B400EF1711F4939401C0E8 +:1006C600A394FF91EF913A9412F0616001C06B7FA1 +:1006D60037EE432EFFBE1895FFB6A89534B1532FBB +:1006E60035B1379557953795579544FD12C04061FA +:1006F6003091BC003323C9F430E070E05C51C0F1A6 +:1007060030E670E05038A0F55695352F5695350FE2 +:100716002FC04F7E45FD0DC0583F40F03091CA00B6 +:100726003A953093CA0031F5406224C030E13093E7 +:10073600CA005093CB00593330E074E058F0309142 +:10074600C8007091C9003150704021F430E03DB9C5 +:10075600442448603093C8007093C900563450F062 +:100766003FEF3093BC0030E03DB994983FEF70E026 +:100776007BBD3ABD35E445FF34E044FF35E037B98B +:100786003EED36B9FFBE18951B44301B47301B5053 +:10079600311B45301B4B1B301B2F301B5300001BDE +:1007A6004E00801B45311B44301B47301B50311B0C +:1007B60045301B4B1B301B2F301B5300001B4EF0CC +:1007C600401B45311B53100D4859544543482031B1 +:1007D600303030001B53100D57504F3330205635F4 +:1007E6001B53100D42414420434F4D4D414E440092 +:1007F6001B53100D42415454455259204C4F57003B +:100806001B4D30001B53100D4859544543482031A9 +:10081600353030001B53100D535441434B204F5677 +:060826004552464C4F57FD +:042000000041BCAC33 +:00000001FF diff --git a/src/avr/WPOV2.HEX b/src/avr/WPOV2.HEX new file mode 100644 index 00000000..3a2161e2 --- /dev/null +++ b/src/avr/WPOV2.HEX @@ -0,0 +1,131 @@ +:020000020000FC +:020000000BC033 +:06000C00D8C19FC26CC1C7 +:1000160060C30FED0DBF00E808B9A8950FE001BD5C +:100026000AE50093CC0000E00DB90AB9C59ABC9A5E +:100036008D9A8E9A929A939AC19AB99AC098B898BC +:1000460097988F9A94988C9AAA98A29A9198899A36 +:1000560007E00DD106E00BD105E009D104E007D198 +:1000660001E005D100E003D10FE509B908E10AB9BD +:100076002AD10AEA0CB90CB929D1949A27D19498B5 +:1000860025D1949A0027E0E6FF2701930193019377 +:10009600EFEB019301930193019301930193019374 +:1000A60001930093BC000093CA000093BD00009327 +:1000B600BE0000E4008300E00093C80004E0009363 +:1000C600C90044276627112488249924AA24552484 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CB0000E00093BA00009390 +:10010600BB0000EF202E00EF402E02E003BF02E00E +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1E4E5F7E0A8D0FA +:100146000091CC000A3509F066C041FD6FC043FD41 +:100156007AC040FFF5CF0091CB00033041F002306A +:1001660091F002E01FE0E0E9F7E092D006C002E07D +:100176001FE0E0EDF7E08CD000C003E01EE1E2E70F +:10018600F7E086D00FC002E01CE0E0EAF7E080D09E +:1001960003E01EE1E4E5F7E07BD003E01CE0E0EAE3 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CC000A35C1F441FD21C043FD2CC0F89472 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1E4E5F7E038D092 +:1002260002E01FE0E0EEF7E033D00AC002E01EE194 +:10023600E4E5F7E02DD002E01FE0ECEAF7E028D095 +:1002460043FD01C0FDCF02E01EE1E4E5F7E020D06A +:1002560002E01FE0ECEBF7E01BD00AEF37D00A957F +:10026600E9F702E013E0ECECF7E012D0F6CFAA983B +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A26D000FF919800FD919AAA9A22C0D1 +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895E0EFFAE006C0E8EC03C0CE +:1002D600E4E101C0E2E0F0E020E02A95F1F7319791 +:1002E600E1F70895FFB666FD22C03CB13125F2F074 +:1002F600312552F0EF93FF93EEEBF091B300EF0F41 +:10030600FF273083FF91EF91131608F0132E6F7EAF +:100316006064312D3F7741F011202AF157986F7DA7 +:100326003FEF232E606146C038EF40C03EC030919B +:10033600B600313019F031E03093BB003CB1EF9399 +:10034600FF93E62DE70DE50DEF70ED55FF273083A2 +:10035600E091B500F091B600EF1711F4639401C077 +:100366007394FF91EF913FEF232E1A940AF530EF25 +:10037600232E60611FC0EF93FF93EEEBF091B30065 +:10038600EF0FFF2730813A953083E82DED59FF278F +:100396003081FF91EF913CB93FEF232E9A948394DD +:1003A6003FE383221A9431F403C030EF232E6F7E8D +:1003B60057986F79FFBE1895FFB63091BD007091C2 +:1003C600BE00732B49F031503093BD003091BE0012 +:1003D60030403093BE0091F0442051F0439441F4F4 +:1003E60030E03DB93EB13FB138EE3DB9B89A687FCD +:1003F600222011F02394B9F0FFBE18950ACE67FDAE +:1004060018C0890C3FE3832299249092BA00EF9397 +:10041600FF93EEEBF091B300EF0FFF2730E430834C +:10042600FF91EF9106C065FDEACF66FDA4CF64FD9E +:100436007AC038EF232E3091BC00332359F03A9519 +:100446003093BC0031F0AA989198899A30E03AB975 +:10045600B1CFDFCD57983FE539B93091BA00392988 +:100466003A2939F43091B8003A9549F03093B800FA +:1004760037C03091B9003A9591F03093B90030E128 +:100486003093B80099203091B30041F4AA2041F08E +:100496009A2CAA243091B4003093B300393001F17C +:1004A6006F779920B9F4AA2059F43091BA003A9599 +:1004B60042F43091B3003395393048F031E007C04B +:1004C60031E03093BA009A2CAA243091B4003093CC +:1004D600B30025C031E03093BA003091B3001FC09D +:1004E60030E13093B90060683091BB00332331F0BE +:1004F6003A953093BB003091B60011C03091B600EA +:10050600772069F47091B7003093B700372F3130F8 +:1005160021F03395393008F032E03093B6003CB91B +:1005260060616F7947CF30EF232E33E039B9392D2B +:1005360067FF04C030E13619371930683CB9132E0D +:10054600579A3CB1606236CFFFB6B8983FB162FDAC +:100556008EC060FD5EC061FD57C03A3090F1303804 +:1005660099F0313899F03139A1F0323991F03339B7 +:1005760081F0353A99F03A3AE1F0353CD9F030E07D +:100586003DB944244260A3C097989FC04160979AA2 +:100596009CC030593093CB00416097C03FEF3093F9 +:1005A600BC0030E03DB994983FEF70E07BBD3ABDAA +:1005B6008CC02FCD38EE3093BD0033E03093BE00B3 +:1005C60084C0332379F46860662049F47720C1F04B +:1005D600672C77243090B6003092B50012C0309068 +:1005E600B5000FC0677F332EAA2021F03091B400EA +:1005F600331531F431E03093BA003092B40001C0C3 +:1006060033243FB8626061C06D7F332009F06160BA +:100616005CC0332E6E7F332063FF05C05AF5362D3E +:1006260030681FC051C0F2F3EF93FF93EEEBF091E9 +:10063600B400EF0FFF273081E091B300F091B400D2 +:10064600EF1731F0E0E4E9193E1730F03E2F04C011 +:10065600303408F030E439193A19FF91EF910AF471 +:100666003FE7331508F4332E3FB964602EC03320BC +:100676008AF43A944AF56160EF93FF93E52DED55C0 +:10068600FF2730813FB9FF91EF916A9453943FE081 +:1006960053221BC060FF14C0EF93FF93E92DEA0DB0 +:1006A600E80DEF73ED59FF273083E091B300F09129 +:1006B600B400EF1711F4939401C0A394FF91EF9146 +:1006C6003A9412F0616001C06B7F30EF432EFFBE9B +:1006D6001895FFB6A89534B1532F35B13795579570 +:1006E6003795579544FD12C040613091BC003323C5 +:1006F60031F530E070E05C5100F130E670E05038E2 +:10070600E0F45695352F5695350F17C04F7E50930A +:10071600CA00583A30E074E058F43091C80070913D +:10072600C9003150704021F430E03DB9442448609E +:100736003093C8007093C90002C07BBD3ABD34E057 +:1007460044FF35E037B93EED36B9FFBE18951B4478 +:10075600301B47301B50311B45301B4B1B301B2FAA +:10076600301B5300001B4E00801B45311B44301BC1 +:1007760047301B50311B45301B4B1B301B2F301B8A +:100786005300001B4EF0401B45311B53100D4859BA +:10079600544543482031303030001B53100D57501C +:1007A6004F33302056351B53100D42414420434FE2 +:1007B6004D4D414E44001B53100D42415454455279 +:1007C60059204C4F57001B4D30001B53100D4859F4 +:1007D600544543482031353030001B53100D5354D7 +:0C07E60041434B204F564552464C4F57A4 +:042000000041BCAC33 +:00000001FF diff --git a/src/avr/WPOV3.ASM b/src/avr/WPOV3.ASM new file mode 100644 index 00000000..0db9f332 --- /dev/null +++ b/src/avr/WPOV3.ASM @@ -0,0 +1,2502 @@ +; WPOV2.ASM +; COPIED FROM WPO15V1.ASM ON 20JUN02 + +; LOOK FOR BIGBODGE TO SEE CEC'S CHANGES TO FIX STARTUP PROBLEM +; AND TO SKIP VOLTAGE MEASURING + +; REVISED 17DEC01 TO SUPPORT NEW HARDWARE TYPE 3 FOR HYT1500 + +; REVISED 18DEC01 TO TRY A CONSERVATIVE 4.5 VOLT SHUTDOWN, LOW BATTERY +; THIS DOESN'T PROTECT AGAINST REBOOTING WHILE PRINTING, TOO BAD + +; REVISED 18DEC01 TO TRY AN AGGRESSIVE 5.5 VOLT SHUTDOWN, LOW BATTERY +; ALSO ENABLED THE 4.5 VOLT IMMEDIATE RESET, DUE TO UNRELIABLE OPERATION +; NOW TRYING 5.0 VOLT IMMEDIATE RESET, CEC SAYS IT WAS MARGINAL ANYWAY + +; NOW DISABLED THE IMMEDIATE RESET DUE TO TESTING RESULTS OF 08JAN02 +; NOT SURE IF THAT WAS REALLY THE PROBLEM - BUT WISH TO BE CONSERVATIVE + +; REVISED 01FEB02 FOR NEW 7.3728 MHZ XTAL, PREVIOUSLY 11.0592 MHZ, 2/3 +; LOOK FOR ;! TO SEE CHANGES FOR 7.3728 MHZ XTAL, ADDED COMMENTS ALSO + +; ----------------------------------------------------------------------------- + +.EQU LARGE =0 + +;IF LARGE +;.INCLUDE "8535DEF.INC" +;ELSE +.INCLUDE "4433DEF.INC" +;ENDIF + +; ----------------------------------------------------------------------------- +; API BUS TIMING CALCULATIONS: + +; 115200 BITS/SEC = 11520 BYTES/SEC = 86.8 US/BYTE +; 460800 BITS/SEC = 46080 BYTES/SEC = 21.7 US/BYTE + +; FOR MASTER API BUS TX, SEND 1 BYTE PER 9+12 BIT-TIMES, 24 TO BE SAFE +; SO THE CORRECT TX RATE = 86.8 * 2.4 = 208.3 US/BYTE = 4800 BYTES/SEC +; SO THE CORRECT TX RATE = 21.7 * 2.4 = 52.1 US/BYTE = 19200 BYTES/SEC + +; A SUBTLE OPTIMISATION IS POSSIBLE WHEN THE PREVIOUS TRANSMITTED LSB IS 0, +; AS WE CAN THEN GUARANTEE THE 4800 BPS RECEIVERS WILL SEE FALSE START BIT: + +; FOR MASTER API BUS TX EVEN, SEND 1 BYTE PER 2+12 BIT-TIMES, 16 TO BE SAFE +; SO THE CORRECT TX RATE EVEN = 86.8 * 1.6 = 138.9 US/BYTE = 7200 BYTES/SEC +; SO THE CORRECT TX RATE EVEN = 21.7 * 1.6 = 34.7 US/BYTE = 28800 BYTES/SEC + +; OLD: TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ = APPROX 278 US +; NEW: TCK0 ROLLOVER = 256 / 7.3728 MHZ = APPROX 34.7 US +; THUS ALL THE TIMEOUT VALUES BELOW HAVE BEEN INCREASED TO 2* ORIGINAL + +.EQU RAM =$60 ; START OF SRAM + +; note: these are in 34.7us units: +.EQU API_TIMEOUT =6 ; 5 doesn't work +.EQU API_TIMEOUT_TS =16 ;8 ; 7 doesn't work +.EQU API_TIME_IDLE =4 ; 3 doesn't work +.EQU API_TIME_SLOW =18 ; 16 doesn't work (16 is theoretically correct) +.EQU API_TIME_FIRST =1 ; should always be 1 to synchronise with timer +;.EQU API_TIME_FAST =2 ; not used if doing the tx even/odd optimisation +.EQU API_TIME_FAST_TS=16 ;4 ; overrides the tx optimisation for touchscreen + +.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS +.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS + +; note: this is in 278us units: +.EQU SPI_TIMEOUT =1 ; 24mar03 16 ; 12 doesn't work + +;.def drem16uL =R0 ; remainder low +;.def drem16uH =R1 ; remainder high +;.def dres16uL =R2 ; result low DON'T use as general purpose +;.def dres16uH =R3 ; result high DON'T use as general purpose +;.def dd16uL =R2 ; dividend low +;.def dd16uH =R3 ; dividend high +;.def dv16uL =R4 ; divisor low +;.def dv16uH =R5 ; divisor high +; +;.DEF SPI_REMAIN =R6 +; +;.def mc16uL =R7 ;multiplicand low byte +;.def mc16uH =R8 ;multiplicand high byte +;.def mp16uL =R9 ;multiplier low byte +;.def mp16uH =R10 ;multiplier high byte +;.def m16u0 =R9 ;result byte 0 (LSB) +;.def m16u1 =R10 ;result byte 1 +;.def m16u2 =R11 ;result byte 2 +;.def m16u3 =R12 ;result byte 3 (MSB) +; +;.DEF RX_PTR =R13 +;.DEF RX_COUNT0 =R14 + +.DEF API_REMAIN =R1 +.DEF API_WATCHDOG =R2 +.DEF SPI_REMAIN =R3 +.DEF SPI_WATCHDOG =R4 +.DEF RX_PTR =R5 +.DEF RX_COUNT0 =R6 +.DEF RX_COUNT1 =R7 +.DEF TX_PTR =R8 +.DEF TX_COUNT0 =R9 +.DEF TX_COUNT1 =R10 +.DEF TCK0_DIVIDE_8 =R11 + +.DEF SR =R15 +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R23 +.DEF G =R24 + +.DEF FLAGS =R20 +;.def counter =R20 ;loop counter + +.DEF ATOD =R21 ; SO YOU CAN USE SBCI, SUBI, CPI ETC + +.DEF API_STATE =R22 + +;.DEF TX_PTR =R25 +;.DEF API_WATCHDOG =R26 +;.DEF API_REMAIN =R27 +;.DEF SPI_WATCHDOG =R28 +;.DEF TX_COUNT0 =R29 + +.EQU TX_SIZE =$20 ; 09mar03 $40 +.EQU RX_SIZE =$20 ; 09mar03 $10 + + .DSEG + .ORG $60 + +VSWTS: .BYTE 1 ; RETAIN ORDERING % +VCHGS: .BYTE 1 +NEGVS: .BYTE 1 + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +TX_ADDRESS0: .BYTE 1 ; DEST FOR TX_COUNT0 BYTES AT HEAD +TX_ADDRESS1: .BYTE 1 ; DEST FOR TX_COUNT1 BYTES AT TAIL + +RX_ADDRESS0: .BYTE 1 ; SOURCE FOR RX_COUNT0 BYTES AT HEAD +RX_ADDRESS1: .BYTE 1 ; SOURCE FOR RX_COUNT1 BYTES AT TAIL + +; 09mar03 now done by RX_MODULUS and RX_PRIORITY $ +;RX_ADDRESS2: .BYTE 1 ; ALTERNATE VALUE FOR RX_ADDRESS1 +; ; SCAN IS 1,2,1,3,1,4,1,5,1,6,1,7,1,8 +; $ + +TX_OVERRIDE: .BYTE 1 ; COUNTER TO TRANSMIT 1 TIME IN 16 +RX_OVERRIDE: .BYTE 1 ; COUNTER TO RECEIVE 1 TIME IN 16 + +TX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME TX DEVICE +RX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME RX DEVICE + +;ABSENT_COUNT: .BYTE 1 + +TURNOFF_COUNT: .BYTE 1 +WATCHDOG_COUNT: .BYTE 2 + +TX_LIMIT: .BYTE 9 ; MAX Z180 BYTES TO ACCEPT, PER DEVICE +; 09mar03 now got individual priorities per device $ +RX_MODULUS: .BYTE 8 ; 09mar03 cumulative value per device +RX_PRIORITY: .BYTE 8 ; 09mar03 separate increment per device +; $ + +BATTERY_COUNT: .BYTE 2 ; COUNT 1024 ADC READINGS TO POWER DOWN + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +;LM385_COUNT: .BYTE 1 ; COUNT $10 ADC READINGS TO MISSING REF +VOLTAGE_VSWT: .BYTE 1 ; MOST RECENT ADC READING FROM REF + +HARDWARE_TYPE: .BYTE 1 ; COMES SOMEWHAT BEFORE RSEL HI COMMAND + +STACK_GUARD: .BYTE 1 ; DETECTS IF STACK COMES DOWN TO HERE + +; ----------------------------------------------------------------------------- + +; API_STATE DEFINITIONS +.EQU SPISIZE =0 ; SET IF EXPECTING SPI DATA SIZE CMD +.EQU SPIWAIT =1 ; SET IF SENDING SPI ADDRESS RESPONSE +.EQU SPIDATA =2 ; SET IF TRANSFERRING SPI DATA TX/RX +.EQU SPIDIRN =3 ; SET IF TX, BASED ON ADDRESS COMMAND +.EQU APISIZE =4 ; SET IF NEED TO SEND API DATA SIZE CMD +.EQU APIWAIT =5 ; SET IF WAITING FOR API DATA SIZE RESP +.EQU APIDATA =6 ; SET IF TRANSFERRING API DATA TX/RX +.EQU APIDIRN =7 ; SET IF TX, TOGGLED ON NULL TRANSFER + +; ----------------------------------------------------------------------------- + +;IF LARGE +; +;.EQU IRQ =6 +;.EQU IRQ_PORT =PORTA +;.EQU IRQ_DDR =DDRA +; +;.EQU PRG =3 +;.EQU PRG_PORT =PORTB +;.EQU PRG_DDR =DDRB +; +;.EQU OC1 =5 +;.EQU OC1_PORT =PORTD +;.EQU OC1_DDR =DDRD +; +;.EQU OCR1H =OCR1AH +;.EQU OCR1L =OCR1AL +; +;.EQU COM10 =COM1A0 +;.EQU COM11 =COM1A1 +; +;ELSE + +.EQU IRQ =0 +.EQU IRQ_PORT =PORTB +.EQU IRQ_DDR =DDRB + +.EQU PRG =2 +.EQU PRG_PORT =PORTC +.EQU PRG_DDR =DDRC + +.EQU OC1 =1 +.EQU OC1_PORT =PORTB +.EQU OC1_DDR =DDRB + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +;ENDIF + +; ----------------------------------------------------------------------------- + + .CSEG + + RJMP RESET_ENTRY + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER 0 OVERFLOW HANDLER + + .ORG SPIADDR + RJMP SPI_COMPLETE ; SPI TRANSFER COMPLETE HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + + .ORG ADCCaddr + RJMP ADC_COMPLETE + +; ----------------------------------------------------------------------------- + +RESET_ENTRY: + ; INITIALISE AVR +;IF LARGE +; LDI A,HIGH(RAMEND) +; OUT SPH,A +;ENDIF + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + ; INITIALISE STACK GUARD + LDI A,$5A + STS STACK_GUARD,A + + ; INITIALISE PORTS + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + LDI A,0 + OUT SPCR,A ; DISABLE SPI WHILE RESETTING Z180 + OUT UCR,A ; DISABLE UART WHILE RESETTING SLAVES + +;IF LARGE +; LDI A,$FF +; OUT DDRC,A ; PORTC CONFIGURED AS OUTPUT +; +; SBI PORTB,7 ; PB7/SCK CONFIGURED AS PULLED UP INPUT +; SBI DDRB,6 ; PB6/MISO CONFIGURED AS OUTPUT +; +; SBI DDRA,7 ; A7 CONFIGURED AS OUTPUT FOR DTR1 +; SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 +; +;; 18DEC01 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +;; SBI PORTA,4 ; A4 PULLED UP TO DETECT MISSING LM385 +;ELSE + SBI PORTB,5 ; PB5/SCK CONFIGURED AS PULLED UP INPUT + SBI DDRB,4 ; PB4/MISO CONFIGURED AS OUTPUT + + SBI DDRD,5 ; D5 CONFIGURED AS OUTPUT FOR DTR1 + SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 + +; 20JUN02 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +; SBI PORTC,4 ; C4 PULLED UP TO DETECT MISSING LM385 +;ENDIF + + SBI PORTD,2 ; D2 CONFIGURED AS PULL UP FOR IBM CLK + SBI PORTD,3 ; D3 CONFIGURED AS PULL UP FOR IBM DATA + + SBI OC1_PORT,OC1 + SBI OC1_DDR,OC1 ; OUTPUT OC1 = 1, PWM TRANSISTOR OFF + + CBI IRQ_PORT,IRQ + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + CBI PORTD,7 + SBI DDRD,7 ; OUTPUT RSEL = 0 + + CBI PORTD,4 + SBI DDRD,4 ; OUTPUT RES = 0 + + ; HARD RESET API BUS DEVICES + CBI PRG_PORT,PRG + SBI PRG_DDR,PRG ; OUTPUT PRG = 0 + + CBI PORTD,1 + SBI DDRD,1 ; OUTPUT TXD = 0 + + LDI A,7 + RCALL PRG_RESET ; SPECIFIC RESET SPARE + + LDI A,6 + RCALL PRG_RESET ; SPECIFIC RESET M192 RECEIPT PRINTER + + LDI A,5 + RCALL PRG_RESET ; SPECIFIC RESET M192 LABEL PRINTER + + LDI A,4 + RCALL PRG_RESET ; SPECIFIC RESET MT102 RECEIPT PRINTER + + ;LDI A,3 + ;RCALL PRG_RESET ; SPECIFIC RESET SPARE + ; THE ABOVE SHOULD BE OK - WHY NOT ?? 16FEB01 + + ;LDI A,2 + ;RCALL PRG_RESET ; SPECIFIC RESET TOUCHSCREEN + + LDI A,1 + RCALL PRG_RESET ; SPECIFIC RESET CUSTOMER DISPLAY + + LDI A,0 + RCALL PRG_RESET ; REMOVE RESET PULSE + + ; LOADCELL HAS BEEN IN RESET UNTIL NOW, AND WILL START IN 10 MS + + ;SBI PORTD,1 ; OUTPUT TXD = 1 + + LDI A,API_RATE_SLOW ; 4800 BAUD + OUT UBRR,A ; SET BAUD RATE + LDI A,$18 + OUT UCR,A ; ENABLE TX AND RX (OUTPUTS TXD = 1) + + RCALL PRG_DELAY_280_MS ; DELAY FOR TOUCHSCREEN TO REENTER IDLE + + LDI A,$AA + OUT UDR,A ; SEND SLOW TURNON COMMAND + OUT UDR,A ; AND AGAIN FOR EXTRA SAFETY + + RCALL PRG_DELAY_20_MS ; DELAY TO ALLOW DEVICES TO INITIALISE + + ; ALLOW Z180 TO START + SBI PORTD,4 ; OUTPUT RES = 1 + ;CBI DDRD,4 ; OUTPUT RES = TRI-STATE + +; BIGBODGE FOR ANOTHER RESET PULSE!!!! +RCALL PRG_DELAY_20_MS +CBI PORTD,4 ; RES=0 +RCALL PRG_DELAY_20_MS +SBI PORTD,4 ; OUTPUT RES = 1 + + ; INITIALISE VARIABLES + CLR A + LDI ZL,VSWTS + CLR ZH + ST Z+,A + ST Z+,A + ST Z+,A + LDI ZL,TX_LIMIT + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A ; CAREFUL - Z WILL BE USED AGAIN BELOW + STS TURNOFF_COUNT,A + STS VOLTAGE_VSWT,A + + ;LDI A,LOW(1000) + STS WATCHDOG_COUNT,A + ;LDI A,HIGH(1000) ; 100 MS + STS WATCHDOG_COUNT+1,A + + LDI A,TX_SIZE + ST Z+,A ; 09mar03 Z ; RX_LIMIT FOR 9TH (INTERNAL) DEVICE + +; 09mar03 initialise RX_MODULUS and RX_PRIORITY $ + clr a ; modulus value doesn't matter! + st z+,a ; RX_MODULUS, array of 8 values + st z+,a + st z+,a + st z+,a + st z+,a + st z+,a + st z+,a + st z+,a + ldi a,15 ; priority value can't be zero + st z+,a ; RX_PRIORITY, array of 8 values + st z+,a + st z+,a + st z+,a + st z+,a + st z+,a + st z+,a + st z,a +; $ + + LDI A,LOW(1024) + STS BATTERY_COUNT,A + LDI A,HIGH(1024) + STS BATTERY_COUNT+1,A + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI A,$10 ; START COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,A + + CLR FLAGS + + CLR API_STATE + CLR API_REMAIN + + CLR TX_PTR + CLR TX_COUNT0 + CLR TX_COUNT1 + + CLR RX_PTR + CLR RX_COUNT0 + CLR RX_COUNT1 + +; LDI A,4 +; STS ABSENT_COUNT,A ; TOP UP ABSENT COUNTER FOR TX_ADDRESS + + ; START COMMUNICATIONS TASK +; 09mar03 now done by RX_MODULUS and RX_PRIORITY $ +; LDI A,2 +; STS RX_ADDRESS2,A ; ALTERNATE VALUE FOR RX_ADDRESS1 +; $ + + LDI A,1 + STS TX_ADDRESS0,A + STS TX_ADDRESS1,A + STS RX_ADDRESS0,A + STS RX_ADDRESS1,A + STS TX_OVERRIDE,A + STS RX_OVERRIDE,A + STS HARDWARE_TYPE,A ; AS FOR OLD ALGORITHM WITH FLAGS,2 = 0 + + LDI A,0 + STS TX_STICKY,A + STS RX_STICKY,A + + LDI A,-API_TIME_IDLE ; 10mar03 -API_TIMEOUT + MOV API_WATCHDOG,A ; SET UP TIME TO FIRST API BUS POLL + LDI A,-SPI_TIMEOUT + MOV SPI_WATCHDOG,A ; SET UP TIME TO FIRST SPI BUS POLL + +; 10mar03 we now have a faster interrupt and finer control over timing $ + ldi a,$01 ; TCK0 = CK + mov TCK0_DIVIDE_8,a +; else +; LDI A,$02 ; TCK0 = CK/8 +; $ + OUT TCCR0,A ; TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ + ; = APPROX 278 US + ;!TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ + ;! = APPROX 185 US +;IF LARGE +; LDI A,$01 +;ELSE + LDI A,$02 +;ENDIF + OUT TIMSK,A ; ENABLE TIMER 0 OVERFLOW INTERRUPTS + + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + IN A,SPSR + IN A,SPDR ; CLEAR SPI INTERRUPT PENDING FLAG + LDI A,$E8 + OUT SPCR,A ; SPI SLAVE, SAMPLE ON SCK FALLING EDGE + + ; START -5V GENERATOR TASK + LDI A,0 + OUT TCNT1H,A + OUT TCNT1L,A + OUT OCR1H,A + OUT OCR1L,A ; ASSUME NO LOAD TO BEGIN WITH + + LDI A,1< 0 + OR E,TX_COUNT0 + OR E,TX_COUNT1 + BRNE API_TRY_TX + +API_TRY_RX: ; 09mar03 + LDS E,TX_OVERRIDE + DEC E + BREQ API_DIRECTION_TX ; FORCED TRANSMIT EVERY SO OFTEN + STS TX_OVERRIDE,E + RJMP API_DIRECTION_RX + +API_TRY_TX: + LDS E,RX_OVERRIDE + DEC E + BREQ BREQ_API_DIRECTION_RX ; FORCED RECEIVE EVERY SO OFTEN + STS RX_OVERRIDE,E + +API_DIRECTION_TX: + LDI E,$10 + STS TX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + ; SUSPEND TX OPERATIONS WHEN 9TH (INTERNAL) DEVICE ADDRESSED % + TST TX_COUNT0 ; ANY BYTES AT HEAD ? + LDS E,TX_ADDRESS0 + BRNE API_SUSPEND_TX0 ; YES, GO AND CHECK HEAD DEVICE + + TST TX_COUNT1 ; ANY BYTES AT TAIL ? + BREQ API_SUSPEND_TX1 ; NO, GO AND PERFORM TX OPERATION + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE TX_COUNT1 BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 + STS TX_ADDRESS0,E ; ADOPT TAIL DEVICE FOR BYTES AT HEAD + +API_SUSPEND_TX0: + CPI E,9 +BREQ_API_DIRECTION_RX: + BREQ API_DIRECTION_RX + +API_SUSPEND_TX1: + ; % + +; LDS E,ABSENT_COUNT +; TST E +; BRNE API_DEVICE_PRESENT +; +;;API_DEVICE_ABSENT: +; ADD TX_PTR,TX_COUNT0 ; SKIP TX_COUNT0 BYTES AT HEAD +; LDI E,TX_SIZE-1 +; AND TX_PTR,E +; +; CLR TX_COUNT0 ; ABANDON TX_COUNT0 DATA IN TX_BUF +; STS TX_STICKY,TX_COUNT0 ; DO NOT GO STICKY ON ABSENT DEVICE +; +; PUSH ZL +; PUSH ZH +; LDI ZL,TX_LIMIT-1 +; LDS ZH,TX_ADDRESS0 +; ADD ZL,ZH +; CLR ZH +; ;ST Z,TX_COUNT0 ; SAVE MAX BYTES TO ACCEPT, PER DEVICE +; LDI E,TX_SIZE +; ST Z,E ; SO THAT WE WILL GOBBLE UP DATA FOR ABSENT DEVICES +; POP ZH +; POP ZL +; +; LDI E,4 +; STS ABSENT_COUNT,E ; TOP UP ABSENT COUNTER FOR NEXT DEVICE +; +;API_DEVICE_PRESENT: + CBR API_STATE,1< 0 + DEC E + BRPL API_TX_ADDRESS_STICKY ; STAYING STICKY, ADOPT NEW DEVICE + + LDS E,TX_ADDRESS0 + INC E ; BUMP TX_ADDRESS BEFORE USING IT + CPI E,9 + BRLO API_TX_ADDRESS_SAVE + LDI E,1 + RJMP API_TX_ADDRESS_SAVE + +API_TX_ADDRESS_ADOPT: + LDI E,3 ; 09mar03 1 +API_TX_ADDRESS_STICKY: + STS TX_STICKY,E ; DECREMENT, OR TOP UP, STICKY COUNT + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 ; DEST FOR TX_COUNT1 BYTES AT HEAD +API_TX_ADDRESS_SAVE: + STS TX_ADDRESS0,E ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_TX_ADDRESS_SAME: + LDI E,3 ; 09mar03 1 + STS TX_STICKY,E ; TOP UP STICKY COUNT + + LDS E,TX_ADDRESS0 ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_DIRECTION_RX: + LDI E,$10 + STS RX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + SBR API_STATE,1< 0th + cpi e,9 + brsh spi_bad_command ; device needs to be < 9th (internal) + + swap f + andi f,$07 ; priority must be valid (from 1 to 7) + cpi f,4 + brlo spi_priority_save ; values 1,2,3 saved without change + inc f + cpi f,6 + brlo spi_priority_save ; value 4 translated to 5 + inc f + cpi f,8 + brlo spi_priority_save ; value 5 translated to 7 + subi f,-3 + cpi f,12 + brlo spi_priority_save ; value 6 translated to 11 + ldi f,15 ; value 7 translated to 15 + +spi_priority_save: + push zl + push zh + ldi zl,RX_PRIORITY-1 + add zl,e ; find device entry in priority array + clr zh + st z,f ; save priority for device + pop zh + pop zl + + rjmp SPI_DONE ; await a new command (timeout???) +; $ + +SPI_COMPLETE: + IN SR,SREG + + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + IN E,SPDR + + SBRC API_STATE,SPIDATA + RJMP SPI_DATA + + SBRC API_STATE,SPISIZE + RJMP SPI_RESPOND + + SBRC API_STATE,SPIWAIT + RJMP SPI_WAIT + +;SPI_ADDRESS: + CPI E,10 ; VALID ADDRESSES ARE 1-9 + BRLO SPI_SELECT + CPI E,$80 +; 09mar03 now got individual priorities per device $ + brlo spi_priority ; accept command to set device priority +; $ + BREQ SPI_RSEL_LO + CPI E,$81 + BREQ SPI_RSEL_HI + CPI E,$91 + BREQ SPI_HARDWARE ; HYTECH 1000 + CPI E,$92 + BREQ SPI_HARDWARE ; WPO30 V5 + CPI E,$93 + BREQ SPI_HARDWARE ; HYTECH 1500 + CPI E,$A5 + BREQ SPI_TURNOFF + CPI E,$AA + BREQ SPI_RESET + CPI E,$C5 + BREQ SPI_WATCHDOG_RESET + +; 09mar03 now got individual priorities per device $ +spi_bad_command: +; $ + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<1 ; HAD WRONG COMMAND + RJMP SPI_DONE_ENTRY ; RETURN LEAVING SPI_WATCHDOG = 0 + +SPI_RSEL_LO: + CBI PORTD,7 + RJMP SPI_DONE + +SPI_RSEL_HI: + SBR FLAGS,1<<0 ; SHOW MESSAGE - FOR COMPATIBILITY + SBI PORTD,7 + RJMP SPI_DONE + +SPI_HARDWARE: ;_HYT1000 + SUBI E,$90 ; THE MAGIC CRACKER + STS HARDWARE_TYPE,E ; IT WAS PREVIOUSLY 1 FOR COMPATIBILITY + + ;CBR FLAGS,1<<2 ; HARDWARE TYPE IS HYTECH 1000 + SBR FLAGS,1<<0 ; SHOW MESSAGE + RJMP SPI_DONE + +;SPI_HARDWARE_WPO30: +; SBR FLAGS,1<<2 | 1<<0 ; HARDWARE TYPE IS WPO30, SHOW MESSAGE +; RJMP SPI_DONE + +SPI_TURNOFF: + LDI E,$FF + STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 + + CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM + + LDI E,$FF + LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + RJMP SPI_DONE + +SPI_RESET: + RJMP RESET_ENTRY + +SPI_WATCHDOG_RESET: + LDI E,LOW(1000) + STS WATCHDOG_COUNT,E + LDI E,HIGH(1000) ; 0.1 SECOND + STS WATCHDOG_COUNT+1,E + RJMP SPI_DONE + +SPI_SELECT: + ; RECEIVED ADDRESS COMMAND + TST E ; TEST DIRECTION FROM ADDRESS COMMAND + BRNE SPI_SELECT_TX + +;SPI_SELECT_RX: + ; HAD ENQUIRY, SEND ACTIVE DEVICE + SBR API_STATE,1< $10 + ;MOV E,ATOD + ;LSL ATOD ; $01 HALF SCALE -> $20 + ;ADD E,ATOD ; $01 HALF SCALE -> $30 HALF WIDTH + + LSR ATOD ; $40 HALF SCALE -> $20 + MOV E,ATOD + LSR ATOD ; $40 HALF SCALE -> $10 + ADD E,ATOD ; $40 HALF SCALE -> $30 HALF WIDTH + RJMP ADC_PULSE + +ADC_REFERENCE: + CBR FLAGS,1<<4 ; SAY NEXT RESULT WILL BE -5V GENERATOR + + ;STS VOLTAGE_VSWT,ATOD + ;RJMP ADC_DONE + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; SBRC FLAGS,5 ; CURRENT REFERENCE IS BANDGAP ? +; RJMP ADC_BANDGAP +; +; ; CURRENT REFERENCE IS LM385 (18DEC01 IT'S NOW A 100K/100K DIVIDER) +; CPI ATOD,$F8 ; IF =>$F8 ASSUME WE HAVE PULLUP ONLY +; BRLO ADC_LM385 +; +; LDS E,LM385_COUNT +; DEC E ; COUNT DOWN TO MISSING LM385 +; STS LM385_COUNT,E +; BRNE ADC_DONE ; KEEP TRYING LM385 +; +; SBR FLAGS,1<<5 ; SAY WE HAVE SWITCHED TO BANDGAP +;GO_ADC_DONE: +; RJMP ADC_DONE +; +;ADC_LM385: +; LDI E,$10 ; TOP UP COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,E +; +;; LSR ATOD ; LM385 VOLTAGE = APPROX 2*BANDGAP +; ; USE LM385Z-1.2 +; +;ADC_BANDGAP: + STS VOLTAGE_VSWT,ATOD + + ; 18DEC01 USE 5.5 VOLTS AS FOR THE ORIGINAL HYTECH 1000 SYSTEM + ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC + ;CPI ATOD,137 ; 256*0.5*4.5/4.2 + ;CPI ATOD,152 ; 256*0.5*5.0/4.2 + CPI ATOD,168 ; 256*0.5*5.5/4.2 + +; ;CPI ATOD,70 ; 256*1.22/4.5 +; ;CPI ATOD,63 ; 256*1.22/5.0 +; CPI ATOD,57 ; 256*1.22/5.5 + + LDI E,LOW(1024) + LDI F,HIGH(1024) + ; 18DEC01 FOR HYT1500 REVERSED THE SENSE DUE TO NEW 100K/100K DIVIDER + ;BRLO ADC_BATTERY_SAVE + BRSH ADC_BATTERY_SAVE + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 THIS IS NOW DONE FURTHER DOWN, AFTER LOW BATTERY TEST +;RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + + ; VSWT < 5.5 VOLTS, STABILISE READING FOR BATTERY LOW + LDS E,BATTERY_COUNT + LDS F,BATTERY_COUNT+1 + SUBI E,LOW(1) + SBCI F,HIGH(1) + BRNE ADC_BATTERY_SAVE ; COUNT 1024 LOW BATTERY READINGS + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<3 ; SHOW BATTERY MESSAGE AND POWER DOWN + +ADC_BATTERY_SAVE: + STS BATTERY_COUNT,E + STS BATTERY_COUNT+1,F + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 WE'LL ALSO COMMENT THE WHOLE THING OUT FOR NEATNESS +RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + +; ; 18DEC01 USE 5.0 VOLTS, MORE AGGRESSIVE THAN HYTECH 1000 SYSTEM +; ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC +; ;CPI ATOD,137 ; 256*0.5*4.5/4.2 +; CPI ATOD,152 ; 256*0.5*5.0/4.2 +; ;CPI ATOD,168 ; 256*0.5*5.5/4.2 +; BRSH ADC_DONE +; +;; ;CPI ATOD,90 ; 256*1.22/3.5 +;; ;CPI ATOD,79 ; 256*1.22/4.0 +;; CPI ATOD,70 ; 256*1.22/4.5 +;; BRLO ADC_DONE +; +; ; 18DEC01 VSWT < 5.0 VOLTS, RESET MAIN PROCESSOR IMMEDIATELY +; LDI E,$FF +; STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON +; +; LDI E,0 +; OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 +; +; CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM +; +; LDI E,$FF +; LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT + +ADC_PULSE: + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + +ADC_DONE: +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI E,$45 ; START MEASURING BANDGAP +; SBRS FLAGS,5 + LDI E,$04 ; START MEASURING LM385 + SBRS FLAGS,4 + LDI E,$05 ; START MEASURING -5V GENERATOR + OUT ADMUX,E + LDI E,$DE + OUT ADCSR,E ; ENABLE A/D, START, SINGLE CONVERSION + + OUT SREG,SR + RETI + +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 5 +; RCALL MULTIPLY +;DIAG_VOLTS_AT_A5: +; ;OUT PORTC,M16U1 ; res in byte 2(ignore ls,byte),volts pin 5 +; MOV A,B ; get saved VSWT +; SUB A,M16U1 ; voltage 47K = VSWT-Voltage at pin 35 +; MOV D,A ; which is 1/3 of total supply ie +V+(-V) +; ADD A,D +; ADD A,D ; TOTAL SUPPLY +; SUB A,B ; TOTAL SUPPLY-VSWT=NEG SUPPLY +;DIAG_NEG: +; ;OUT PORTC,A +; +; LDI A,4 +; OUT ADMUX,A ; NEXT TIME READ VCHG +;ADC_DONE: +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI + +;VSWT: ;OUT PORTC,ATOD ; count value for 2.5 V ref +; LDI A,$FF +; MOV DD16UH,A ; divide by full scale ie VSWT +; SUB DD16UL,DD16UL ; clear low reg +; SUB DV16UH,DV16UH ; clear high reg divisor +; MOV DV16UL,ATOD ; use ATOD value as divisor +; ;OUT PORTC,ATOD +; RCALL DIVIDE ; ***** NOTE AN FF RESULT IS NO INPUT ******* +; MOV MC16UH,DRES16UH ; load multiplicand high from result high +; MOV MC16UL,DRES16UL ; load multiplicand low from result low +; SUB MP16UH,MP16UH ; clear high byte in multiplier reg +; LDI A,25 +; MOV MP16UL,A ; mult by zener ref voltage (2.5V) +; RCALL MULTIPLY +;DIAG_VOLT_VSWT: +;xi: +; LDS A,VSWTS ; previous value of VSWT +; MOV B,MP16UL ; new value of VSWT +; ;RCALL SMOOTH +; STS VSWTS,B +; LDS B,VSWTS +; +; ;OUT PORTC,B;M16U1 ; VSWT IN 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; +; ;STS VSWTS,B ; SAVE NEW SMOOTHED VALUE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; MOV B,M16U1 ; save copy of VSWT for neg 5V routine +; MOV DD16UH,M16U1 +; SUB DD16UL,DD16UL +; LDI A,255 ; calculate the atod volts per division +; MOV DV16UL,A +; SUB DV16UH,DV16UH +; RCALL DIVIDE ; result to be found in dres high & low +; +; LDI A,3 +; OUT ADMUX,A ; NEXT TIME READ VCHG +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;VCHG: +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 37 (1/3 VCHG) +; RCALL MULTIPLY +; MOV A,M16U1 +; ADD M16U1,A ; B\C A3 IS 1/3 VCHG +; ADD M16U1,A +;DIAG_VOLT_VHG: +; ;OUT PORTC,M16U1 ; REUSULT 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; LDI A,5 +; OUT ADMUX,A ; NEXT TIME READ VSWT +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;;*************************************************************************** +;;* +;;* "div16u" - 16/16 Bit Unsigned Division +;;* +;;* This subroutine divides the two 16-bit numbers +;;* "dd8uH:dd8uL" (dividend) and "dv16uH:dv16uL" (divisor). +;;* The result is placed in "dres16uH:dres16uL" and the remainder in +;;* "drem16uH:drem16uL". +;;* +;;* Number of words :19 +;;* Number of cycles :235/251 (Min/Max) +;;* Low registers used :2 (drem16uL,drem16uH) +;;* High registers used :5 (dres16uL/dd16uL,dres16uH/dd16uH,dv16uL,dv16uH, +;;* dcnt16u) +;;* +;;*************************************************************************** +;divide: +;div16u: clr drem16uL ;clear remainder Low byte +; sub drem16uH,drem16uH ;clear remainder High byte and carry +; ldi counter,17 ;init loop counter +;d16u_1: rol dd16uL ;shift left dividend +; rol dd16uH +; dec counter ;decrement counter +; brne d16u_2 ;if done +; ret ; return +;d16u_2: rol drem16uL ;shift dividend into remainder +; rol drem16uH +; sub drem16uL,dv16uL ;remainder = remainder - divisor +; sbc drem16uH,dv16uH ; +; brcc d16u_3 ;if result negative +; add drem16uL,dv16uL ; restore remainder +; adc drem16uH,dv16uH +; clc ; clear carry to be shifted into result +; rjmp d16u_1 ;else +;d16u_3: sec ; set carry to be shifted into result +; rjmp d16u_1 +; +;;********* 16 X 16 multiplication routine from app note avr200 ************* +;;* +;;* "mpy16u" - 16x16 Bit Unsigned Multiplication +;;* +;;* This subroutine multiplies the two 16-bit register variables +;;* mp16uH:mp16uL and mc16uH:mc16uL. +;;* The result is placed in m16u3:m16u2:m16u1:m16u0. +;;* +;;* Number of words :14 + return +;;* Number of cycles :153 + return +;;* Low registers used :None +;;* High registers used :7 (mp16uL,mp16uH,mc16uL/m16u0,mc16uH/m16u1,m16u2, +;;* m16u3,mcnt16u) +;;* +;;*************************************************************************** +;multiply: +;mpy16u: clr m16u3 ;clear high byte of result +; sub m16u2,m16u2 ;clear result byte 2 and carry +; clr m16u2 +; ldi counter,16 ;init loop counter +; lsr mp16uH +; ror mp16uL +; +;m16u_1: brcc noad8 ;if bit 0 of multiplier set +; add m16u2,mc16uL ;add multiplicand Low to byte 2 of res +; adc m16u3,mc16uH ;add multiplicand high to byte 3 of res +;noad8: ror m16u3 ;shift right result byte 3 +; ror m16u2 ;rotate right result byte 2 +; ror m16u1 ;rotate result byte 1 and multiplier High +; ror m16u0 ;rotate result byte 0 and multiplier Low +; dec counter ;decrement loop counter +; brne m16u_1 ;if not done, loop more +; ret +;;************************* Exponential smoothing routine ******************** +;;Receives : Previous value in A +;; : New value in B +;;Passes : Smoothed result back in B reg +;;Uses : d reg +; +;Smooth: +; mov d,a ; save a copy of previous value +; lsr a +; lsr a +; lsr b +; lsr b ; prev.ave - prev.ave + new.data +; sub d,a ; -------- -------- +; add b,d ; n n +; ret + +; ----------------------------------------------------------------------------- + +MESSAGE_0: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',0,128,$1B + .DB 'E','1' + +MESSAGE_1: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',240,64,$1B + .DB 'E','1' + +MESSAGE_2: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','0','0','0',0 + +MESSAGE_3: + .DB $1B,'S',16,13 + .DB 'W','P','O','3','0',' ','V','5' + +MESSAGE_4: + .DB $1B,'S',16,13 + .DB 'B','A','D',' ','C','O','M','M','A','N','D',0 + +MESSAGE_5: + .DB $1B,'S',16,13 + .DB 'B','A','T','T','E','R','Y',' ','L','O','W',0 + +MESSAGE_6: + .DB $1B,'M','0',0 + +MESSAGE_7: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','5','0','0',0 + +MESSAGE_8: + .DB $1B,'S',16,13 + .DB 'S','T','A','C','K',' ','O','V','E','R','F','L','O','W' + +; ----------------------------------------------------------------------------- + + .ORG $1000 + +;IF LARGE (THE ORIGINAL WPO15V1.HEX SETTINGS) +; .DW $4100 ; SELECT ADDRESS COMMAND +; ; FSTRT = 0 FOR 1.1 MS R/C STARTUP DELAY +; ;.DW $ACBE ; WRITE FUSE BITS COMMAND +;; BIGBODGE (NOT REALLY - JUST IN CASE TYPE OF CHANGE) +;; FSTRT = 1 FOR 16 MS R/C STARTUP DELAY +; .DW $ACBF ; WRITE FUSE BITS COMMAND +;ELSE + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 100 FOR 16K * 11MHZ STARTUP DELAY (NO R/C STARTUP DELAY) + + .DW $4100 ; SELECT ADDRESS COMMAND + .DW $ACBC ; WRITE FUSE BITS COMMAND +;ENDIF + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/WPOV3.HEX b/src/avr/WPOV3.HEX new file mode 100644 index 00000000..81259fa7 --- /dev/null +++ b/src/avr/WPOV3.HEX @@ -0,0 +1,146 @@ +:020000020000FC +:020000000BC033 +:06000C00F7C118C37EC11C +:10001600DAC30FED0DBF00E808B9A8950FE001BDE2 +:100026000AE50093CB0000E00DB90AB9C59ABC9A5F +:100036008D9A8E9A929A939AC19AB99AC098B898BC +:1000460097988F9A94988C9AAA98A29A9198899A36 +:1000560007E01DD106E01BD105E019D104E017D158 +:1000660001E015D100E013D107E109B908E10AB9A9 +:100076003CD10AEA0CB90CB93BD1949A39D194987F +:1000860037D1949A0027E0E6FF2701930193019365 +:10009600EEEA019301930193019301930193019376 +:1000A60001930093AB000093C9000093AC0000934A +:1000B600AD0000E2019300270193019301930193A0 +:1000C60001930193019301930FE00193019301932F +:1000D6000193019301930193008300E00093C7000D +:1000E60004E00093C8004427662711248824992435 +:1000F600AA2455246624772401E00093A3000093E4 +:10010600A4000093A5000093A6000093A700009307 +:10011600A8000093CA0000E00093A9000093AA007B +:100126000CEF202E0FEF402E01E0B02E03BF02E0B1 +:1001360009BF0EB10FB108EE0DB900E00DBD0CBD43 +:100146000BBD0ABD01EC0FBD01E00EBD05E007B910 +:100156000EED06B9789402E01EE1E8E4F8E0A8D0D6 +:100166000091CB000A3509F066C041FD6FC043FD22 +:100176007AC040FFF5CF0091CA00033041F002304B +:1001860091F002E01FE0E4E8F8E092D006C002E059 +:100196001FE0E4ECF8E08CD000C003E01EE1E6E6E8 +:1001A600F8E086D00FC002E01CE0E4E9F8E080D079 +:1001B60003E01EE1E8E4F8E07BD003E01CE0E4E9BC +:1001C600F8E076D01CD00B3109F0FCCF18D00434FF +:1001D60009F0F8CF14D0037039F0013039F002304D +:1001E60039F0033039F0EECF969A05C0969803C0E1 +:1001F600959A01C0959810E3100FE4CF789400917A +:10020600CB000A35C1F441FD21C043FD2CC0F89452 +:100216009920A1F30091A300093081F7EF93FF9392 +:10022600E82DED59FF2700819A948394EFE18E2201 +:10023600FF91EF91189502E01EE1E8E4F8E038D06E +:1002460002E01FE0E4EDF8E033D00AC002E01EE170 +:10025600E8E4F8E02DD002E01FE0E0EAF8E028D07C +:1002660043FD01C0FDCF02E01EE1E8E4F8E020D046 +:1002760002E01FE0E0EBF8E01BD00AEF39D00A9568 +:10028600E9F702E013E0E0ECF8E012D0F6CFAA9826 +:1002960002FF919802FD919A2BD001FF919801FDE2 +:1002A600919A28D000FF919800FD919AAA9A24C0AD +:1002B60078940000F8949920D9F7AA20C9F70093FA +:1002C600A400C895002D04D031961A95D1F718953B +:1002D600EF93FF93E92DEA0DE80DEF71ED59FF2736 +:1002E6000083FF91EF91A3940895E0EFFAE006C032 +:1002F600E8EC03C0E4E101C0E2E0F0E020E02A958A +:10030600F1F73197E1F70895FFB666FD22C03CB1DB +:100316003125F2F0312552F0EF93FF93EDEAF0919B +:10032600A300EF0FFF273083FF91EF91131608F01C +:10033600132E6F7E6064312D3F7741F011202AF134 +:1003460057986F7D3FEF232E606153C03CEF4DC041 +:100356004BC03091A600313019F033E03093AA003B +:100366003CB1EF93FF93E62DE70DE50DEF71ED57E9 +:10037600FF273083E091A500F091A600EF1711F456 +:10038600639401C07394FF91EF913FEF232E1A946B +:1003960072F53091A600323030EF09F03AEF232E95 +:1003A600606127C033E03093A900EF93FF93EDEA35 +:1003B6007091A300E70FFF2730813A953083E82D2F +:1003C600ED59FF273081FF91EF913CB93695330BFC +:1003D6003A95723009F430EF232E9A9483943FE1D4 +:1003E60083221A9431F403C03AEF232E6F7E579876 +:1003F6006F79FFBE1895FFB630E032BF32E038BFE6 +:10040600BA94B1F438E0B32E3091AC007091AD00DF +:10041600732B49F031503093AC003091AD00304031 +:100426003093AD0059F0442019F0439409F4B89A7A +:10043600222011F0239419F1FFBE1895EACD67FD2D +:1004460012C0890C3FE1832299249092A900EF9370 +:10045600FF93EDEAF091A300EF0FFF2730E2308320 +:10046600FF91EF9112C0EF93FF93EEEBF091A60090 +:10047600EF0FFF273FE03083FF91EF9106C065FD48 +:10048600DECF66FD8FCF64FD8CC03EEE232E30910D +:10049600AB00332359F03A953093AB0031F0AA986C +:1004A6009198899A30E03AB9A4CFB3CD579837E1FD +:1004B60039B93091AA00332329F43091A90039299A +:1004C6003A2939F43091A7003A9549F03093A700BC +:1004D60037C03091A8003A9591F03093A80030E1EA +:1004E6003093A70099203091A30041F4AA2041F04F +:1004F6009A2CAA243091A4003093A300393001F13C +:100506006F779920B9F4AA2059F43091A9003A9549 +:1005160042F43091A3003395393048F031E007C0FA +:1005260033E03093A9009A2CAA243091A40030938A +:10053600A30033C033E03093A9003091A3002DC04F +:1005460030E13093A80060683091A600772029F545 +:100556007091AA00772321F07A957093AA001DC0A6 +:10056600EF93FF93E7EBFF273191E093A60071919C +:1005760073171AF4372FE093A6007FEBE713F7CF34 +:10058600E091A600379670813897370F30833E2F5B +:10059600365BFF91EF913093A6003CB960616F79AD +:1005A60028CF30E039B967FD13C07091A3007230CF +:1005B60030EF09F03AEF232E392D723011F07730F3 +:1005C60031F4332321F0305108F430E0339513C071 +:1005D6007091A600723030EF09F03AEF232E30E228 +:1005E60036193719773031F4332321F0305108F4B6 +:1005F60030E0339530683CB9132E579A3CB16062AF +:10060600F8CE732F3F70A9F1393098F5729577704F +:10061600743050F07395763038F07395783020F05A +:100626007D5F7C3008F07FE0EF93FF93EEEBE30F06 +:10063600FF277083FF91EF91C2C0FFB6B8983FB114 +:1006460062FD8FC060FD5FC061FD58C03A3098F111 +:100656003038B8F299F0313899F03139A1F03239A1 +:1006660091F0333981F0353A99F03A3AE1F0353C78 +:10067600D9F030E03DB944244260A3C097989FC0AA +:100686004160979A9CC030593093CA00416097C028 +:100696003FEF3093AB0030E03DB994983FEF70E008 +:1006A6007BBD3ABD8CC0B5CC38EE3093AC0033E0A0 +:1006B6003093AD0084C0332379F46860662049F432 +:1006C6007720C1F0672C77243090A6003092A500E1 +:1006D60012C03090A5000FC0677F332EAA2021F0EC +:1006E6003091A400331531F433E03093A9003092F1 +:1006F600A40001C033243FB8626061C06D7F33201F +:1007060009F061605CC0332E6E7F332063FF05C045 +:100716005AF5362D30681FC051C0F2F3EF93FF93A0 +:10072600EDEAF091A400EF0FFF273081E091A300DE +:10073600F091A400EF1731F0E0E2E9193E1730F02E +:100746003E2F04C0303208F030E239193A19FF91D1 +:10075600EF910AF43FE7331508F4332E3FB964608E +:100766002EC033208AF43A944AF56160EF93FF93E2 +:10077600E52DED57FF2730813FB9FF91EF916A9440 +:1007860053943FE153221BC060FF14C0EF93FF93C5 +:10079600E92DEA0DE80DEF71ED59FF273083E09161 +:1007A600A300F091A400EF1711F4939401C0A39451 +:1007B600FF91EF913A9412F0616001C06B7F3FEFB9 +:1007C600432EFFBE1895FFB6A89534B1532F35B109 +:1007D600379557953795579544FD12C0406130912E +:1007E600AB00332331F530E070E05C5100F130E6C8 +:1007F60070E05038E0F45695352F5695350F17C0F2 +:100806004F7E5093C900583A30E074E058F4309166 +:10081600C7007091C8003150704021F430E03DB9F6 +:10082600442448603093C7007093C80002C07BBD63 +:100836003ABD34E044FF35E037B93EED36B9FFBE88 +:1008460018951B44301B47301B50311B45301B4B42 +:100856001B301B2F301B5300001B4E00801B4531E5 +:100866001B44301B47301B50311B45301B4B1B3084 +:100876001B2F301B5300001B4EF0401B45311B53F2 +:10088600100D4859544543482031303030001B5331 +:10089600100D57504F33302056351B53100D424123 +:1008A6004420434F4D4D414E44001B53100D4241D1 +:1008B6005454455259204C4F57001B4D30001B5382 +:1008C600100D4859544543482031353030001B53EC +:1008D600100D535441434B204F564552464C4F57EB +:042000000041BCAC33 +:00000001FF diff --git a/src/avr/a.bat b/src/avr/a.bat new file mode 100644 index 00000000..b19434ec --- /dev/null +++ b/src/avr/a.bat @@ -0,0 +1 @@ +tavrasm -a %1.asm -e %1.lst diff --git a/src/avr/a_avra.bat b/src/avr/a_avra.bat new file mode 100644 index 00000000..ab516ae2 --- /dev/null +++ b/src/avr/a_avra.bat @@ -0,0 +1 @@ +avra -fI %1.asm diff --git a/src/avr/a_orig.bat b/src/avr/a_orig.bat new file mode 100644 index 00000000..479cc0e2 --- /dev/null +++ b/src/avr/a_orig.bat @@ -0,0 +1 @@ +AVRASM %1.ASM %1.LST %1.HEX diff --git a/src/avr/aa.bat b/src/avr/aa.bat new file mode 100644 index 00000000..24781e5c --- /dev/null +++ b/src/avr/aa.bat @@ -0,0 +1 @@ +c:\bin\diff --ignore-case --ignore-file-name-case --ignore-tab-expansion --ignore-space-change --ignore-blank-lines --text --unified --minimal --new-file --speed-large-files %1.asm %2.asm > %1-%2.diff \ No newline at end of file diff --git a/src/avr/api.inc b/src/avr/api.inc new file mode 100644 index 00000000..92a8af6f --- /dev/null +++ b/src/avr/api.inc @@ -0,0 +1,270 @@ +; API.INC + +; ----------------------------------------------------------------------------- +; API BUS FOREGROUND TASK + +.MACRO INT_HANDLERS + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER +.ENDMACRO + +.MACRO INIT_API_BUS + LDI A,API_RATE_SLOW ; 4800 BPS + OUT UBRR,A ; SET UART RATE + + LDI A,$90 ; ENABLE RX WITH INTERRUPTS + OUT UCR,A + ;SBI UCR,TXEN ; TX ENABLE + + CLR TX_PTR + CLR TX_COUNT + + CLR RX_PTR + CLR RX_COUNT + + CLR API_STATE + CLR API_REMAIN + CLR API_WATCHDOG +.ENDMACRO + +.MACRO MRX_WAIT + TST RX_COUNT + BREQ RX_WAIT +.ENDMACRO + +.MACRO MRX_CHAR + PUSH YL + PUSH YH + + MOV YL,RX_PTR + SUBI YL,-RX_BUF + CLR YH + LD A,Y + + CLI + DEC RX_COUNT + INC RX_PTR + LDI YL,RX_SIZE-1 + AND RX_PTR,YL + SEI + + POP YH + POP YL + RET +; FALL INTO MTX_WAIT FOR LOOPBACK TEST +.ENDMACRO + +.MACRO MTX_WAIT + PUSH A +TX_WAIT_LOOP: + MOV A,TX_COUNT + CPI A,TX_SIZE + BRSH TX_WAIT_LOOP + POP A +.ENDMACRO + +.MACRO MTX_CHAR + PUSH YL + PUSH YH + IN YH,SREG + CLI + MOV YL,TX_COUNT + ADD YL,TX_PTR + OUT SREG,YH ;SEI + ANDI YL,TX_SIZE-1 + SUBI YL,-TX_BUF + CLR YH + ST Y,A + + INC TX_COUNT + + POP YH + POP YL + RET +.ENDMACRO + +; ----------------------------------------------------------------------------- +; API BUS BACKGROUND TASK + +.MACRO MTX_EMPTY + IN SR,SREG + PUSH F + + LDI F,-API_TIMEOUT ; FEED TX/RX WATCHDOG + MOV API_WATCHDOG,F + + PUSH ZL + PUSH ZH + MOV ZL,TX_PTR + SUBI ZL,-TX_BUF + CLR ZH + LD F,Z ; GET CHARACTER FROM TX BUFFER + POP ZH + POP ZL + + OUT UDR,F + + DEC TX_COUNT + INC TX_PTR + LDI F,TX_SIZE-1 + AND TX_PTR,F + + DEC API_REMAIN ; MORE TO SEND? + BRMI GO_API_DONE1 ; YES, AWAIT NEXT TX EMPTY INTERRUPT + RJMP API_REINIT ; NO, AWAIT NEXT DATA SIZE COMMAND +GO_API_DONE1: + RJMP API_DONE +.ENDMACRO + +.MACRO MRX_COMPLETE + IN SR,SREG + PUSH F + + LDI F,-API_TIMEOUT ; FEED TX/RX WATCHDOG + MOV API_WATCHDOG,F + + IN F,UDR + SBIC USR,FE ; BREAK DETECTED? + RJMP API_FRAMING_ERROR + + SBRC API_STATE,APIDATA + RJMP API_RX_DATA ; WITH F = CHARACTER + SBRC API_STATE,APISIZE + RJMP API_DATA_SIZE ; WITH F = CHARACTER + + ; RECEIVED 4800 BPS ADDRESS COMMAND + CPI F,API_ADDRESS ; CHARACTER = MY ADDRESS? + BRNE API_ADDRESS_DONE + + LDI F,API_RATE_FAST ; 115200 BPS + OUT UBRR,F ; SET UART RATE + + SBI UCR,TXEN ; ENABLE UART TX AND TXD PIN + + LDI F,1< INCR TO 18 CYCLES PER + +; ALSO FOUND EXCESSIVE JITTER IN TEMP MEASUREMENT PARTLY DUE TO SERVO +; ONTO SIGNAL EDGE AND PARTLY TO 33MHZ NOISE ON THERMISTOR => FIX TIMING, +; AND PACE DATA OUTPUT (SOME PROBLEM STILL REMAINS) + +; ALSO HAD STACK OVERFLOW => REORDER SRAM VARIABLES + + +.INCLUDE "4433DEF.INC" ; FOR AVR ASSEMBLER +;.INCLUDE "4433DEFX.INC" ; FOR NICK ASSEMBLER +.INCLUDE "MACLC.INC" +;.INCLUDE "APILC.INC" +.INCLUDE "TERLC.INC" + +; WE SHOULD CHANGE THE CODE TO USE UCSRA AND UCSRB +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU RAM =$60 ; START OF SRAM +.EQU CR =$0D +.EQU LF =$0A +.EQU RX_SIZE =1 +.EQU TX_SIZE =8 ; LEAVES 10 BYTES FREE +.EQU API_ADDRESS =$01 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU CYC_MAX =256 ; MAXIMUM WEIGHING CYCLE TIME +.EQU CYC_MIN =160 ; MINIMUM WEIGHING CYCLE TIME > 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +;MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 +DSPRES: .BYTE 4 +ZROGMS: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +DSPGMS: .BYTE 4 ; MOVED 02JUL01 +LSTGMS: .BYTE 4 ; MOVED 17MAY01 +LSTDEV: .BYTE 4 ; MOVED 17MAY01 +AVESTD: .BYTE 4 ; MOVED 17MAY01 +AVEGMS: .BYTE 4 ; MOVED 17MAY01 + +.ESEG +.ORG $000 ; ALL CONSTANTS IN IEEE754 FORMAT +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 DEFAULT TO 1 +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +;K0: .DB $00,$00 ; 0.000000E+00 +;K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 DON'T MOVE! +;K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 +HYSCNF: ;.DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 +;K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +CNFHYS: ;.DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +;K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K228: .DB $39,$8E,$63,$43 ; 2.275556E+02 = 256*16/18 REVISED 17MAY01 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +; CHARACTERIZE ONLY % +K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +FMAT3: .DB 6,0 + .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: + OUTI SPL,RAMEND ; INIT STACK POINTER + OUTI ACSR,$80 ; POWER DOWN ANALOG COMPARATOR + +; SBI DDRB,5 ; SET SK TO OUTPUT FOR DIAGNOSTICS + + SBI DDRD,2 ; SET BIT 2 TO OUTPUT FOR TEMP SENSOR + SBI DDRD,3 ; SET BIT 3 TO OUTPUT FOR TILT SENSOR + + OUTI TCCR1B,1 ; SET COUNTER1 TO CLOCK AT 11.0592 MHZ + ; AND INPUT CAPTURE ON FALLING EDGE +; OUTI MCUCR,2 ; SET INT0 FALLING EDGE FOR TEMP SENSOR + OUTI MCUCR,0 ; SET INT0 LOW SENSE FOR TEMP SENSOR + ; 17MAY01 BOMBS GRACEFULLY AT EACH EXTREME + + CLR CYC_0 + CLR CYC_1 + + CLR A + STS RANGE,A + RCALL STS_STATUS_A + STS STARTUP,A + STS TMP_PHASE,A + + ;LDER A,EEMODE +; CHARACTERIZE ONLY % + LDI A,$F0 +; % + STS MODE,A + +; WEIGHING ONLY % +; LDI A,1 +; STS MODE_CYCLE,A +; % + + FLDF K1 + FST DSPRES + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST LSTGMS + FST LSTDEV + FST AVEGMS + FST AVESTD + FST INTGMS +; CHARACTERIZE ONLY % + FST WGTFRQ ; MAY NOT BE NECESSARY + FST REF_30MHZ ; NECESSARY +; % + + INIT_API_BUS ; SET UART RATE AND CLEAR FLAGS/PTRS + + IN A,TIMSK + ORI A,8 ; ENABLE INTERRUPT ON T1 INPUT CAPTURE + OUT TIMSK,A + + WDR ; RESET WATCHDOG + OUTI WDTCR,1< E +; RCALL SNDSTR + +LOOP: ; MAIN PROGRAM + ; IF THE INTERRUPT ALREADY CAME, + ; THROW AWAY THE DATA AND WAIT FOR A NEW ONE + CBR FLAGS,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) + FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD +; WEIGHING ONLY % +; LDI F,AVESTD +; % RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST + FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST INTGMS ; INTGMS=0 + RCALL LDS_A_STATUS + CBR A,1<= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE + FML DSPRES ; DISPLAY RESOLUTION + ; % +; WEIGHING ONLY % +; FST DSPGMS + +STB5: +; ;LDS A,MODE ; IF NOT WEIGHING MODE +; ;SBRS A,DSPGMS_FLG +; ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS +; +; LDI E,CYC_MIN*2/3 +; RCALL TX_WAIT_EMPTY +; BRCS FMT +; RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE +; +;FMT: RCALL LDS_A_STATUS +; SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? +; RJMP SKIP_SN +; +; CBR A,1<=0 +; BRPL FMT2 ; THEN CONTINUE +;; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) +; INC E ; INC " -LO-" COUNTER (STARTUP) +; CPI E,CYC_START+8 ; IF STARTUP E +; ;RCALL SNDSTR +; ;LDI A,'0' +; ;RCALL TX_WAIT +; ;RJMP DSP8 +; ; % +; RJMP DSP7 +;FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" +; BRCS FMT3 +; LDI E,CYC_START ; THEN STARTUP=CYC_START +; STS STARTUP,E +;FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX +; BRCS FMT4 +; SBR F,1< E +; LDFL D,FMAT0 ; " 0.000" +; ADIW ZL,2 +;DSP2: CP F,D +; BRCC DSP4 +;DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 +; BREQ DSP8 ; WHEN ALL DONE +; CPI D,4 +; BRNE DSP2 +; DEC F ; TO COMPENSATE FOR EXTRA DEC C +; RJMP DSP3 ; DO DECIMAL PT +;DSP4: +; ; FOR TENTHS OF GRAMS % +; ;INC F +; ; % +; RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +;DSP5: DEC F +; BREQ DSP8 +; CPI F,4 +; ; FOR TENTHS OF GRAMS % +; ;CPI F,5 +; ; % +; BRNE DSP6 +; LDI A,'.' +; RCALL TX_WAIT +; DEC F +;DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP DSP5 +;DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR +;DSP8: +;; ASCII STABILITY INDICATION FOR TESTING % +;; LDI A,' ' +;; RCALL TX_WAIT +;; RCALL LDS_A_STATUS +;; ANDI A,1< 1 SECOND ? + BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION + + FSBF K33M + FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE + + SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL STS_FA ; AND SAVE +SMTH0: RET + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % +; INC FA3 ; CHECK FOR NAN +; BRNE SND0 +; DEC FA3 ; TO COMPLY WITH IEEE754 +;SND0: DEC FA3 +; ROL FA2 ; CONVERT TO IEEE754 +; ROR FA3 +; ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % +; LDS B,MODE_CYCLE +; AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + +; WEIGHING ONLY % +; LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL TX_WAIT_EMPTY +; BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM +; % + +SNDFPX: +; CHARACTERIZE ONLY % + SBRS FLAGS,SNDDAT + RET + CPI A,$80 + LDI A,$0A + BRNE SEPOK + LDI A,$0D +SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % +; LDI A,$1B +; RCALL TX_WAIT +; MOV A,F ; INDICATE WHICH DATA IS BEING SENT +; RCALL TX_WAIT +;;SND_FA: +; LDI XL,FA ; LOAD TX BUFFER +; LDI D,4 +;SND1: LD A,X+ +; RCALL TX_WAIT ; LS BYTE FIRST +; DEC D +; BRNE SND1 +; RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -48 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION < +16 + BRLO CORRECTION_OK + PUSH A + LDS A,TX_COUNT + CPI A,TX_SIZE + BRSH SKIP_DOLLAR + LDI A,'$' + RCALL TX_CHAR +SKIP_DOLLAR: + POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + + CLI ; 17MAY01 + LDS G,TMP_PHASE ; START TEMPERATURE MEASUREMENT % + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT TO SYNCHRONISE SUBSEQUENT INT0 + BRNE TMP0 + +; CLI + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT + IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + ; 17MAY01 MOVED: +; SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO +; SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT +; LDI G,$40 ; SHIFTED TO LATER +; OUT GIFR,G ; CLEAR PENDING INT0 RESULTING FROM +; OUT GIMSK,G ; ACTIVITY ON PIN, AND ENABLE INT0 + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP +; CBI PORTB,5 ; FOR TESTING ONLY + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA:LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA:LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +SNDEXP: + PUSH A ; SEPARATOR + FMLF K30M ; CONVERT TO HERTZ + RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +EXP5: FCPF KR0001 ; IF N<.0001 + BRCC EXP6 + FMLF K100K ; THEN N=N*100K + SUBI F,5 ; E=E-5 + RJMP EXP5 +EXP6: FCPF K1 ; IF N<1 + BRCC EXP7 + FMLF K10 ; THEN N=N*10 + SUBI F,1 ; E=E-1 + RJMP EXP6 +EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 + RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 + RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT + LDI A,'.' + RCALL TX_WAIT + LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + DEC E + BRNE EXP8 + LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY + RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION + LDI A,'0' + RCALL TX_WAIT + LDI A,'E' ; NOW FOR THE EXPONENT + RCALL TX_WAIT + LDI A,'+' ; SEND SIGN + TST F + BRPL EXP9 + LDI A,'-' + NEG F ; ABS(E) +EXP9: RCALL TX_WAIT + LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +EXP10: INC A + SUBI F,10 + BRPL EXP10 + RCALL TX_WAIT + LDI A,'0'+10 ; NOW LS DIGIT + ADD A,F + RCALL TX_WAIT + POP A + RCALL TX_WAIT ; SEPARATOR +EXP11: FLD F0 ; AND RESTORE FA + RET + +EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 + LDI A,' ' ; SEND SIGN (SPACE FOR +) + TST FA2 + BRPL EXP1 + LDI A,'-' +EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT +; FMLF K_1 ; LET'S BE SAFE KILLED 17MAY01 +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS + RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1< INCR TO 18 CYCLES PER + +; ALSO FOUND EXCESSIVE JITTER IN TEMP MEASUREMENT PARTLY DUE TO SERVO +; ONTO SIGNAL EDGE AND PARTLY TO 33MHZ NOISE ON THERMISTOR => FIX TIMING, +; AND PACE DATA OUTPUT (SOME PROBLEM STILL REMAINS) + +; ALSO HAD STACK OVERFLOW => REORDER SRAM VARIABLES + +; ATmega8: +.INCLUDE "MEGA8DEF.INC" ; FOR AVR ASSEMBLER +;.INCLUDE "4433DEFX.INC" ; FOR NICK ASSEMBLER +.INCLUDE "MACLC.INC" +;.INCLUDE "APILC.INC" +; ATmega8: +.INCLUDE "TERLC8.INC" + +; WE SHOULD CHANGE THE CODE TO USE UCSRA AND UCSRB +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU RAM =$60 ; START OF SRAM +.EQU CR =$0D +.EQU LF =$0A +.EQU RX_SIZE =1 +.EQU TX_SIZE =8 ; LEAVES 10 BYTES FREE +.EQU API_ADDRESS =$01 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU CYC_MAX =256 ; MAXIMUM WEIGHING CYCLE TIME +.EQU CYC_MIN =160 ; MINIMUM WEIGHING CYCLE TIME > 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +;MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 +DSPRES: .BYTE 4 +ZROGMS: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +DSPGMS: .BYTE 4 ; MOVED 02JUL01 +LSTGMS: .BYTE 4 ; MOVED 17MAY01 +LSTDEV: .BYTE 4 ; MOVED 17MAY01 +AVESTD: .BYTE 4 ; MOVED 17MAY01 +AVEGMS: .BYTE 4 ; MOVED 17MAY01 + +.ESEG +.ORG $000 ; ALL CONSTANTS IN IEEE754 FORMAT +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 DEFAULT TO 1 +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR ; NOT USED IN CHARACTERIZE MODE + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +;K0: .DB $00,$00 ; 0.000000E+00 +;K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 DON'T MOVE! +;K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 +HYSCNF: ;.DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 +;K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +CNFHYS: ;.DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +;K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K228: .DB $39,$8E,$63,$43 ; 2.275556E+02 = 256*16/18 REVISED 17MAY01 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +; CHARACTERIZE ONLY % +K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +FMAT3: .DB 6,0 + .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: +; ATmega8: + OUTI SPL,LOW(RAMEND) ; INIT STACK POINTER + OUTI SPH,HIGH(RAMEND) + OUTI ACSR,$80 ; POWER DOWN ANALOG COMPARATOR + +; SBI DDRB,5 ; SET SK TO OUTPUT FOR DIAGNOSTICS + + SBI DDRD,2 ; SET BIT 2 TO OUTPUT FOR TEMP SENSOR + SBI DDRD,3 ; SET BIT 3 TO OUTPUT FOR TILT SENSOR + + OUTI TCCR1B,1 ; SET COUNTER1 TO CLOCK AT 11.0592 MHZ + ; AND INPUT CAPTURE ON FALLING EDGE + OUTI MCUCR,0 ; SET INT0 LOW SENSE FOR TEMP SENSOR + ; 17MAY01 BOMBS GRACEFULLY AT EACH EXTREME + + CLR CYC_0 + CLR CYC_1 + + CLR A + STS RANGE,A + RCALL STS_STATUS_A + STS STARTUP,A + STS TMP_PHASE,A + + ;LDER A,EEMODE +; CHARACTERIZE ONLY % + LDI A,$F0 +; % + STS MODE,A + +; WEIGHING ONLY % +; LDI A,1 +; STS MODE_CYCLE,A +; % + + FLDF K1 + FST DSPRES + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST LSTGMS + FST LSTDEV + FST AVEGMS + FST AVESTD + FST INTGMS +; CHARACTERIZE ONLY % + FST WGTFRQ ; MAY NOT BE NECESSARY + FST REF_30MHZ ; NECESSARY +; % + + INIT_API_BUS ; SET UART RATE AND CLEAR FLAGS/PTRS + + IN A,TIMSK +; ATmega8: +; ORI A,8 ; ENABLE INTERRUPT ON T1 INPUT CAPTURE + SBR A,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) + FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD +; WEIGHING ONLY % +; LDI F,AVESTD +; % RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST + FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST INTGMS ; INTGMS=0 + RCALL LDS_A_STATUS + CBR A,1<= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE + FML DSPRES ; DISPLAY RESOLUTION + ; % +; WEIGHING ONLY % +; FST DSPGMS + +STB5: +; ;LDS A,MODE ; IF NOT WEIGHING MODE +; ;SBRS A,DSPGMS_FLG +; ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS +; +; LDI E,CYC_MIN*2/3 +; RCALL TX_WAIT_EMPTY +; BRCS FMT +; RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE +; +;FMT: RCALL LDS_A_STATUS +; SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? +; RJMP SKIP_SN +; +; CBR A,1<=0 +; BRPL FMT2 ; THEN CONTINUE +;; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) +; INC E ; INC " -LO-" COUNTER (STARTUP) +; CPI E,CYC_START+8 ; IF STARTUP E +; ;RCALL SNDSTR +; ;LDI A,'0' +; ;RCALL TX_WAIT +; ;RJMP DSP8 +; ; % +; RJMP DSP7 +;FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" +; BRCS FMT3 +; LDI E,CYC_START ; THEN STARTUP=CYC_START +; STS STARTUP,E +;FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX +; BRCS FMT4 +; SBR F,1< E +; LDFL D,FMAT0 ; " 0.000" +; ADIW ZL,2 +;DSP2: CP F,D +; BRCC DSP4 +;DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 +; BREQ DSP8 ; WHEN ALL DONE +; CPI D,4 +; BRNE DSP2 +; DEC F ; TO COMPENSATE FOR EXTRA DEC C +; RJMP DSP3 ; DO DECIMAL PT +;DSP4: +; ; FOR TENTHS OF GRAMS % +; ;INC F +; ; % +; RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +;DSP5: DEC F +; BREQ DSP8 +; CPI F,4 +; ; FOR TENTHS OF GRAMS % +; ;CPI F,5 +; ; % +; BRNE DSP6 +; LDI A,'.' +; RCALL TX_WAIT +; DEC F +;DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP DSP5 +;DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR +;DSP8: +;; ASCII STABILITY INDICATION FOR TESTING % +;; LDI A,' ' +;; RCALL TX_WAIT +;; RCALL LDS_A_STATUS +;; ANDI A,1< 1 SECOND ? + BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION + + FSBF K33M + FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE + + SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL STS_FA ; AND SAVE +SMTH0: RET + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % +; INC FA3 ; CHECK FOR NAN +; BRNE SND0 +; DEC FA3 ; TO COMPLY WITH IEEE754 +;SND0: DEC FA3 +; ROL FA2 ; CONVERT TO IEEE754 +; ROR FA3 +; ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % +; LDS B,MODE_CYCLE +; AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + +; WEIGHING ONLY % +; LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL TX_WAIT_EMPTY +; BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM +; % + +SNDFPX: +; CHARACTERIZE ONLY % + SBRS FLAGS,SNDDAT + RET + CPI A,$80 + LDI A,$0A + BRNE SEPOK + LDI A,$0D +SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % +; LDI A,$1B +; RCALL TX_WAIT +; MOV A,F ; INDICATE WHICH DATA IS BEING SENT +; RCALL TX_WAIT +;;SND_FA: +; LDI XL,FA ; LOAD TX BUFFER +; LDI D,4 +;SND1: LD A,X+ +; RCALL TX_WAIT ; LS BYTE FIRST +; DEC D +; BRNE SND1 +; RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -16 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION > +5 + BRLO CORRECTION_OK + PUSH A + LDS A,TX_COUNT + CPI A,TX_SIZE + BRSH SKIP_DOLLAR + LDI A,'$' + RCALL TX_CHAR +SKIP_DOLLAR: + POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + +; ATmega8: + POP J + POP K + + CLI ; 17MAY01 + LDS G,TMP_PHASE ; START TEMPERATURE MEASUREMENT % + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT TO SYNCHRONISE SUBSEQUENT INT0 + BRNE TMP0 + +; CLI + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT +; ATmega8: +; IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + IN G,GICR ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + ; 17MAY01 MOVED: +; SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO +; SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT +; LDI G,$40 ; SHIFTED TO LATER +; OUT GIFR,G ; CLEAR PENDING INT0 RESULTING FROM +; OUT GIMSK,G ; ACTIVITY ON PIN, AND ENABLE INT0 + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP +; CBI PORTB,5 ; FOR TESTING ONLY + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA: + CLR YH + LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA: + CLR YH + LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +SNDEXP: + PUSH A ; SEPARATOR + FMLF K30M ; CONVERT TO HERTZ + RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +EXP5: FCPF KR0001 ; IF N<.0001 + BRCC EXP6 + FMLF K100K ; THEN N=N*100K + SUBI F,5 ; E=E-5 + RJMP EXP5 +EXP6: FCPF K1 ; IF N<1 + BRCC EXP7 + FMLF K10 ; THEN N=N*10 + SUBI F,1 ; E=E-1 + RJMP EXP6 +EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 + RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 + RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT + LDI A,'.' + RCALL TX_WAIT + LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + DEC E + BRNE EXP8 + LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY + RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION + LDI A,'0' + RCALL TX_WAIT + LDI A,'E' ; NOW FOR THE EXPONENT + RCALL TX_WAIT + LDI A,'+' ; SEND SIGN + TST F + BRPL EXP9 + LDI A,'-' + NEG F ; ABS(E) +EXP9: RCALL TX_WAIT + LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +EXP10: INC A + SUBI F,10 + BRPL EXP10 + RCALL TX_WAIT + LDI A,'0'+10 ; NOW LS DIGIT + ADD A,F + RCALL TX_WAIT + POP A + RCALL TX_WAIT ; SEPARATOR +EXP11: FLD F0 ; AND RESTORE FA + RET + +EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 + LDI A,' ' ; SEND SIGN (SPACE FOR +) + TST FA2 + BRPL EXP1 + LDI A,'-' +EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT +; FMLF K_1 ; LET'S BE SAFE KILLED 17MAY01 +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS + RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1<0FH + +PUBLIC CHKLIN + +CHKLIN: PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + PUSH DS + PUSH ES + PUSHF + + LDS SI,[BP+6] ; DS:SI -> FLAG% + SUB AX,AX + XCHG AX,[SI] ; AX = FLAG%, FLAG% = 0 + MOV DX,640/8 + MUL DX + XCHG DI,AX + MOV AX,0A000H + MOV ES,AX ; ES:DI -> SCREEN LINE + + MOV DX,GC_ADDR + MOV AL,2 + CALL READ_REG + PUSH AX + MOV AH,0FH + OUT DX,AX ; SET UP COLOUR COMPARE WITH 0FH + MOV AL,5 + CALL READ_REG + PUSH AX + OR AH,8 + OUT DX,AX ; SET UP COLOUR COMPARE MODE + + MOV AL,0FFH ; CHECK FOR BLANK (WHITE 0FH -> TRUE) + MOV CX,80 + REPZ SCASB ; MUST HAVE A LINE'S WORTH + JZ GOT_FLAG + + DEC W [SI] ; FLAG%=-1 + JMP GOT_FLAG + +READ_REG: + OUT DX,AL + INC DX + XCHG AL,AH + IN AL,DX + XCHG AL,AH + DEC DX + RET + +GOT_FLAG: + POP AX + OUT DX,AX ; RESTORE GC MODE REG + POP AX + OUT DX,AX ; RESTORE COLOUR COMPARE REG + + POPF + POP ES + POP DS + POP DI + POP SI + POP BP + RETF 4 + +CODE ENDS + END + \ No newline at end of file diff --git a/src/avr/chset00.inc b/src/avr/chset00.inc new file mode 100644 index 00000000..d584841a --- /dev/null +++ b/src/avr/chset00.inc @@ -0,0 +1,58 @@ +; chset00.inc generated from chset00.win, do not edit! + + .db $46,$32,$34,$44,$30,$33,$31,$39,$30,$33,$31,$32,$31,$37,$30,$39 + .db $4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $00,$01,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$03,$01,$4c,$03,$4c,$03 + .db $06,$01,$0f,$01,$18,$01,$21,$01,$2a,$01,$33,$01,$3c,$01,$45,$01 + .db $4e,$01,$57,$01,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$60,$01,$69,$01,$72,$01,$7b,$01,$84,$01,$8d,$01,$96,$01 + .db $9f,$01,$a9,$01,$b2,$01,$bb,$01,$c4,$01,$cd,$01,$d6,$01,$df,$01 + .db $e8,$01,$f1,$01,$08,$02,$11,$02,$1a,$02,$23,$02,$2c,$02,$35,$02 + .db $3e,$02,$47,$02,$50,$02,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $4c,$03,$59,$02,$62,$02,$6b,$02,$74,$02,$7d,$02,$86,$02,$8f,$02 + .db $99,$02,$a3,$02,$ad,$02,$b8,$02,$c2,$02,$cb,$02,$d4,$02,$dd,$02 + .db $e6,$02,$f0,$02,$fc,$02,$03,$03,$0c,$03,$15,$03,$1e,$03,$27,$03 + .db $30,$03,$39,$03,$43,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03,$4c,$03 + .db $00,$03,$06,$61,$01,$f8,$01,$07,$70,$88,$98,$a8,$c8,$88,$70,$01 + .db $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .db $f8,$01,$07,$f8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .db $f8,$10,$10,$01,$07,$f8,$80,$f0,$08,$08,$88,$70,$01,$07,$30,$40 + .db $80,$f0,$88,$88,$70,$01,$07,$f8,$08,$10,$20,$40,$40,$40,$01,$07 + .db $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .db $01,$07,$70,$88,$88,$88,$f8,$88,$88,$01,$07,$f0,$88,$88,$f0,$88 + .db $88,$f0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$e0,$90,$88 + .db $88,$88,$90,$e0,$01,$07,$f8,$80,$80,$f0,$80,$80,$f8,$01,$07,$f8 + .db $80,$80,$f0,$80,$80,$80,$01,$07,$70,$88,$80,$b8,$88,$88,$78,$01 + .db $07,$88,$88,$88,$f8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .db $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$a0 + .db $c0,$a0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$f8,$01,$07,$88 + .db $d8,$a8,$a8,$88,$88,$88,$01,$07,$88,$88,$c8,$a8,$98,$88,$88,$01 + .db $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$f0,$88,$88,$f0,$80,$80 + .db $80,$01,$07,$70,$88,$88,$88,$a8,$90,$68,$4c,$03,$4c,$03,$4c,$03 + .db $06,$08,$01,$01,$4f,$00,$65,$03,$01,$07,$f0,$88,$88,$f0,$a0,$90 + .db $88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$f8,$20,$20,$20 + .db $20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07,$88,$88 + .db $88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$a8,$a8,$a8,$50,$01,$07 + .db $88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20,$20,$20 + .db $01,$07,$f8,$08,$10,$20,$40,$80,$f8,$01,$07,$00,$00,$70,$08,$78 + .db $88,$78,$01,$07,$80,$80,$f0,$88,$88,$88,$f0,$01,$07,$00,$00,$78 + .db $80,$80,$80,$78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00 + .db $00,$70,$88,$f8,$80,$70,$01,$07,$18,$20,$f8,$20,$20,$20,$20,$01 + .db $08,$00,$00,$78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$b0,$c8,$88 + .db $88,$88,$02,$21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10 + .db $00,$10,$10,$10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$a0,$c0,$a0 + .db $90,$03,$21,$07,$c0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$f0 + .db $a8,$a8,$a8,$a8,$01,$07,$00,$00,$b0,$c8,$88,$88,$88,$01,$07,$00 + .db $00,$70,$88,$88,$88,$70,$01,$08,$00,$00,$f0,$88,$88,$f0,$80,$80 + .db $01,$08,$00,$00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$b0,$c0 + .db $80,$80,$80,$01,$07,$00,$00,$78,$80,$70,$08,$f0,$01,$07,$20,$20 + .db $f8,$20,$20,$20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07 + .db $00,$00,$88,$88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$a8,$a8,$50 + .db $01,$07,$00,$00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88 + .db $78,$08,$70,$01,$07,$00,$00,$f8,$10,$20,$40,$f8,$01,$07,$f8,$f8 + .db $f8,$f8,$f8,$f8,$f8,$00 + diff --git a/src/avr/chtest.asm b/src/avr/chtest.asm new file mode 100644 index 00000000..c47cfdee --- /dev/null +++ b/src/avr/chtest.asm @@ -0,0 +1,2411 @@ +; CHTEST.ASM +; CHARACTERIZE MODE + +.INCLUDE "4433DEF.INC" ; FOR AVR ASSEMBLER +;.INCLUDE "4433DEFX.INC" ; FOR NICK ASSEMBLER +.INCLUDE "MACLC.INC" +;.INCLUDE "APILC.INC" +.INCLUDE "TERLC.INC" + +; WE SHOULD CHANGE THE CODE TO USE UCSRA AND UCSRB +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU RAM =$60 ; START OF SRAM +.EQU CR =$0D +.EQU LF =$0A +.EQU RX_SIZE =1 +.EQU TX_SIZE =8 ; LEAVES 10 BYTES FREE +.EQU API_ADDRESS =$01 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU CYC_MAX =256 ; MAXIMUM WEIGHING CYCLE TIME +.EQU CYC_MIN =160 ; MINIMUM WEIGHING CYCLE TIME > 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +LSTGMS: .BYTE 4 +LSTDEV: .BYTE 4 +AVEGMS: .BYTE 4 +AVESTD: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +;MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 +DSPGMS: .BYTE 4 +ZROGMS: .BYTE 4 +;DSPRES: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +.ESEG +.ORG $000 +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 DEFAULT TO 1 +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD + +CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 +CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) + +CNFHYS: .DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +HYSCNF: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +K0: .DB $00,$00 ; 0.000000E+00 +K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 DON'T MOVE! +K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 +K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +;K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +; CHARACTERIZE ONLY % +K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +FMAT3: .DB 6,0 + .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: + OUTI SPL,RAMEND ; INIT STACK POINTER + OUTI ACSR,$80 ; POWER DOWN ANALOG COMPARATOR + +; SBI DDRB,5 ; SET SK TO OUTPUT FOR DIAGNOSTICS + + SBI DDRD,2 ; SET BIT 2 TO OUTPUT FOR TEMP SENSOR + SBI DDRD,3 ; SET BIT 3 TO OUTPUT FOR TILT SENSOR + + OUTI TCCR1B,1 ; SET COUNTER1 TO CLOCK AT 11.0592 MHZ + ; AND INPUT CAPTURE ON FALLING EDGE + OUTI MCUCR,2 ; SET INT0 FALLING EDGE FOR TEMP SENSOR + + CLR CYC_0 + CLR CYC_1 + + CLR A + STS RANGE,A + RCALL STS_STATUS_A + STS STARTUP,A + STS TMP_PHASE,A + + ;LDE A,EEMODE +; CHARACTERIZE ONLY % + LDI A,$F0 +; % + STS MODE,A + +; WEIGHING ONLY % +; LDI A,1 +; STS MODE_CYCLE,A +; % + + FLDF K1 +; FST DSPRES + FST COUNT + FLDF K0 + FST LSTGMS + FST LSTDEV + FST AVEGMS + FST AVESTD + FST INTGMS +; CHARACTERIZE ONLY % + FST WGTFRQ ; MAY NOT BE NECESSARY + FST REF_30MHZ ; NECESSARY +; % + + INIT_API_BUS ; SET UART RATE AND CLEAR FLAGS/PTRS + + IN A,TIMSK + ORI A,8 ; ENABLE INTERRUPT ON T1 INPUT CAPTURE + OUT TIMSK,A + +; WEIGHING ONLY % +; WDR ; RESET WATCHDOG +; LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT +; OUT WDTCR,A +; % + + ; START FOREGROUND TASK + SEI + +; LDFL D,SIGNON ; SEND SIGNON MESSAGE +; LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR + +LOOP: ; MAIN PROGRAM + ; IF THE INTERRUPT ALREADY CAME, + ; THROW AWAY THE DATA AND WAIT FOR A NEW ONE + CBR FLAGS,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) +; FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD + LDI F,AVESTD + RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST +; FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT + FLDF K0 ; INTGMS=0 + FST INTGMS + RCALL LDS_A_STATUS + CBR A,1<= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE +; FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE +; FML DSPRES ; DISPLAY RESOLUTION + ; % + FST DSPGMS + +STB5: +; WEIGHING ONLY % +; ;LDS A,MODE ; IF NOT WEIGHING MODE +; ;SBRS A,DSPGMS_FLG +; ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS +; +; LDI E,CYC_MIN*2/3 +; RCALL TX_WAIT_EMPTY +; BRCS FMT +; RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE +; +;FMT: RCALL LDS_A_STATUS +; SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? +; RJMP SKIP_SN +; +; CBR A,1<=0 +; BRPL FMT2 ; THEN CONTINUE +;; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) +; INC E ; INC " -LO-" COUNTER (STARTUP) +; CPI E,CYC_START+8 ; IF STARTUP E +; ;RCALL SNDSTR +; ;LDI A,'0' +; ;RCALL TX_WAIT +; ;RJMP DSP8 +; ; % +; RJMP DSP7 +;FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" +; BRCS FMT3 +; LDI E,CYC_START ; THEN STARTUP=CYC_START +; STS STARTUP,E +;FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX +; BRCS FMT4 +; SBR F,1< E +; LDFL D,FMAT0 ; " 0.000" +; ADIW ZL,2 +;DSP2: CP F,D +; BRCC DSP4 +;DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 +; BREQ DSP8 ; WHEN ALL DONE +; CPI D,4 +; BRNE DSP2 +; DEC F ; TO COMPENSATE FOR EXTRA DEC C +; RJMP DSP3 ; DO DECIMAL PT +;DSP4: +; ; FOR TENTHS OF GRAMS % +; ;INC F +; ; % +; RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +;DSP5: DEC F +; BREQ DSP8 +; CPI F,4 +; ; FOR TENTHS OF GRAMS % +; ;CPI F,5 +; ; % +; BRNE DSP6 +; LDI A,'.' +; RCALL TX_WAIT +; DEC F +;DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP DSP5 +;DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR +;DSP8: +;; ASCII STABILITY INDICATION FOR TESTING % +;; LDI A,' ' +;; RCALL TX_WAIT +;; RCALL LDS_A_STATUS +;; ANDI A,1< 1 SECOND ? + BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION + + FSBF K33M + FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE + + SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL STS_FA ; AND SAVE +SMTH0: RET + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % +; INC FA3 ; CHECK FOR NAN +; BRNE SND0 +; DEC FA3 ; TO COMPLY WITH IEEE754 +;SND0: DEC FA3 +; ROL FA2 ; CONVERT TO IEEE754 +; ROR FA3 +; ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % +; LDS B,MODE_CYCLE +; AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + + LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E + RCALL TX_WAIT_EMPTY + BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM + +SNDFPX: +; CHARACTERIZE ONLY % + SBRS FLAGS,SNDDAT + RET + CPI A,$80 + LDI A,$0A + BRNE SEPOK + LDI A,$0D +SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % +; LDI A,$1B +; RCALL TX_WAIT +; MOV A,F ; INDICATE WHICH DATA IS BEING SENT +; RCALL TX_WAIT +;;SND_FA: +; LDI XL,FA ; LOAD TX BUFFER +; LDI D,4 +;SND1: LD A,X+ +; RCALL TX_WAIT ; LS BYTE FIRST +; DEC D +; BRNE SND1 +; RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -16 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION > +5 + BRLO CORRECTION_OK + PUSH A + LDS A,TX_COUNT + CPI A,TX_SIZE + BRSH SKIP_DOLLAR + LDI A,'$' + RCALL TX_CHAR +SKIP_DOLLAR: + POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + ; WARNING CANNOT CORRUPT H, I, J % +;TEMPERATURE: ; START TEMPERATURE MEASUREMENT + LDS G,TMP_PHASE ; LIMIT TO 25uSEC (HALF PERIOD 20KHZ) + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT FOR HIGH ON WGT TO SYNCHRONISE + BRNE TMP0 + + CLI +; SBI PORTB,5 ; FOR TESTING ONLY + IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT + LDI G,$40 + OUT GIFR,G ; CLEAR PENDING INT0 RESULTING FROM + OUT GIMSK,G ; ACTIVITY ON PIN, AND ENABLE INT0 + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + ; % + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA:LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA:LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +SNDEXP: + PUSH A ; SEPARATOR + RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +EXP5: FCPF KR0001 ; IF N<.0001 + BRCC EXP6 + FMLF K100K ; THEN N=N*100K + SUBI F,5 ; E=E-5 + RJMP EXP5 +EXP6: FCPF K1 ; IF N<1 + BRCC EXP7 + FMLF K10 ; THEN N=N*10 + SUBI F,1 ; E=E-1 + RJMP EXP6 +EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 + RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 + RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT + LDI A,'.' + RCALL TX_WAIT + LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + DEC E + BRNE EXP8 + LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY + RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION + LDI A,'0' + RCALL TX_WAIT + LDI A,'E' ; NOW FOR THE EXPONENT + RCALL TX_WAIT + LDI A,'+' ; SEND SIGN + TST F + BRPL EXP9 + LDI A,'-' + NEG F ; ABS(E) +EXP9: RCALL TX_WAIT + LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +EXP10: INC A + SUBI F,10 + BRPL EXP10 + RCALL TX_WAIT + LDI A,'0'+10 ; NOW LS DIGIT + ADD A,F + RCALL TX_WAIT + POP A + RCALL TX_WAIT ; SEPARATOR +EXP11: FLD F0 ; AND RESTORE FA + RET + +EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 + LDI A,' ' ; SEND SIGN (SPACE FOR +) + TST FA2 + BRPL EXP1 + LDI A,'-' +EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT + FMLF K_1 ; LET'S BE SAFE +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS + RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1< BUFFER + ; RETURN WITH + ; NEW CRC IN BX + + CLD + MOV DX,1021H +@@L1: LODSB + XOR BH,AL + REPT 8 + SHL BX,1 + JNC $+4 + XOR BX,DX + ENDM + LOOP @@L1 + + LDS SI,[BP+10] + MOV [SI],BX ; CRC% + +@@L0: POP DS + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- + +CODE ENDS + +; ----------------------------------------------------------------------------- + +DATA SEGMENT +DATA ENDS + +; ----------------------------------------------------------------------------- + + END diff --git a/src/avr/crcsubx.inc b/src/avr/crcsubx.inc new file mode 100644 index 00000000..d8d04bc2 --- /dev/null +++ b/src/avr/crcsubx.inc @@ -0,0 +1,10 @@ +' CRCSUBX.INC + +' ----------------------------------------------------------------------------- + +$LINK "CRCSUBX.OBJ" + +DECLARE SUB CRC_CALCULATE(INTEGER,STRING) + +' ----------------------------------------------------------------------------- + diff --git a/src/avr/cs128v0.asm b/src/avr/cs128v0.asm new file mode 100644 index 00000000..ff82c2fb --- /dev/null +++ b/src/avr/cs128v0.asm @@ -0,0 +1,3076 @@ +; CS128V0.ASM + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "API.INC" + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS + BST @0,1 ; A15 + BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFC0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FD80 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =4 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_CNT: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $0000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RJMP GO_TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + +RESTART_ENTRY: + ;LDI F,8 + ;OUT ASSR,F ; TIMER 2 CLOCKED BY 32 KHZ XTAL + ;LDI F,1 + ;OUT TCCR2,F ; TIMER 2 DIVIDE BY 1 + LDI F,$00 ;$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + ;LDI F,$00 + OUT GIMSK,F + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + ;OUT PORTC,F + ;SBI PORTB,2 + ;CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + +; LDI D,$18 ; A18|A17|A16|A15|A14=11000 +; OUT PORTA,D ; CL1=M=FLM=0 +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + +;RTNCDE: LDIZ RTN_CODE ; POINT Z TO FLASH +; LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER +; LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +;CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +;CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM +; LPM ; GET DATA FROM FLASH +; CLR R0 ; TEMPORARY CLEAR KB +; RAMWRX R0 ; WRITE DATA TO DSPRAM +; DEC XL +; BREQ RTNCDE_END ; CHECK IF ALL DONE +; ADIW ZL,$01 ; INC FLASH ADDRESS +; INC YL ; INC ADDRESS L FOR DSPRAM +; MOV A,YL ; +; ANDI A,$3F ;YL,$3F +; BRNE CDE1 +; SUBI YL,$40 ; +; INC YH ; INC ADDRESS H (ON L ROLLOVER) +; RJMP CDE0 +;RTNCDE_END: + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,$10 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + CLR A + STS SCAN_CNT,A ; START ON FIRST LED / PHOTODIODE PAIR + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; DROP CL2 + + IN D,PORTD ;LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTD,D ;PORTA,D + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,D + + LDI D,$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + RCALL RX_WAIT + + CPI A,$1B + BREQ ESC_SEQUENCE + + SBRC FLAGS,3 + RJMP REGULAR_CHAR + CPI A,$20 + BRSH REGULAR_CHAR + + CPI A,$08 + RJEQ BACK_SPACE + CPI A,$0D + RJEQ CR + CPI A,$0A + RJEQ LF + CPI A,7 + BRNE MAIN_LOOP + +REGULAR_CHAR: + SBRC FLAGS,2 ; CROSSED ZEROS ON? + RJMP L013B ; YES, DON'T BOTHER TESTING FOR ZERO + CPI A,'0' + BRNE L013B + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YL,LOW(-$204) + SBCI YH,HIGH(-$204) + A14_A18 B + RCALL LPMS + MOV A,R0 +L013B: RCALL DRAW_CHAR_TTY + RJMP MAIN_LOOP + +ESC_SEQUENCE: + RCALL RX_WAIT + CPI A,$1B + BREQ REGULAR_CHAR + CPI A,'.' + RJEQ CHARACTER_SET_DOWNLOAD + CPI A,'/' + RJEQ CROSSED_ZEROS + CPI A,'?' + RJEQ CHARACTER_SET_QUERY + CPI A,'A' + RJEQ SET_BACKLIGHT + CPI A,'B' + RJEQ BUZZER + CPI A,'C' + RJEQ CLEAR_RECTANGLE + CPI A,'D' + RJEQ DRAW_MODE + CPI A,'E' + RJEQ ENABLE_CNTRL + CPI A,'F' + RJEQ GET_FILLED_RECTNC_SIZE + CPI A,'G' + RJEQ INTERPRET_MODE + CPI A,'K' + RJEQ CLR_DISP + CPI A,'L' + RJEQ GO_SCROLL_REGION + CPI A,'M' + RJEQ MOSFET_CONTROL + CPI A,'N' + RJEQ GET_RECTNC_SIZE + CPI A,'P' + RJEQ PROP_FIXED_MODE + CPI A,'R' + RJEQ GET_RECT_SIZE + CPI A,'S' + RJEQ SET_CURSOR + CPI A,'U' + RJEQ NULLSUB + CPI A,'V' + RJEQ CONTRAST_CONTROL + CPI A,'W' + RJEQ NULLSUB + CPI A,'X' + RJEQ SAVE_STATE + CPI A,'Z' + RJEQ TOUCH_ZONE + CPI A,'0' + BRLO ESC_SEQUENCE_ABORT + CPI A,'9'+1 + BRLO SET_CHSET_A +ESC_SEQUENCE_ABORT: + RJMP MAIN_LOOP + +CROSSED_ZEROS: + RCALL RX_WAIT + SBRS A,0 + RJMP CROSSED_ZEROS_OFF + LDI A,1<<2 + OR FLAGS,A + RJMP MAIN_LOOP +CROSSED_ZEROS_OFF: + LDI A,~(1<<2) + AND FLAGS,A + RJMP MAIN_LOOP + +MOSFET_CONTROL: + RCALL RX_WAIT + CPI A,$30 ; DO NOT TURN OFF BY ACCIDENT + BRNE MOSFET_CONTROL_DONE + CLI + LDI F,1<<6 + OR FLAGS,F ; SAY WE TURNED OFF VIA COMMAND + RJMP SLEEP_ENTRY ; GO AND SHUT DOWN DISPLAY +MOSFET_CONTROL_DONE: + RJMP MAIN_LOOP + +BUZZER: RCALL RX_WAIT + STS BUZZ_TIME,A ; SAVE REQUESTED DURATION + RJMP MAIN_LOOP + +SET_CHSET: + RCALL RX_WAIT +SET_CHSET_A: + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT +; ANDI A,1 +; BRNE SET_BACKLIGHT_ON +; LDI A,~(1<<7) +; AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION +; CBI PORTC,7 +; CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT +; RJMP MAIN_LOOP +;SET_BACKLIGHT_ON: +; LDI A,1<<7 +; OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + CLI + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_TIM0_OVF: + RJMP TIM0_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRSH DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRSH DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_PAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS C,CLOCKING_PTR + TST C ; START OF 4 LINE BLOCK? (1 BASED) + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D + OUT TCNT1H,D + OUT TCNT1L,D + CBI PORTD,5 ; DROP CL2 + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + ;LDS D,LATCH10_SAV + ;OUT PORTA,D + ;SBI PORTB,4 + SBI PORTB,2 ;PORTA,5 ; PULSE CL1 + CBI PORTB,2 ;PORTA,5 + ;CBI PORTB,4 + RJMP L04F9 + +L04E6: IN D,PORTB ;LDS D,LATCH10_SAV + ORI D,$10 ;$80 ; RAISE FLM + ORI D,$04 ;$20 ; RAISE CL1 + OUT PORTB,D ;PORTA,D + ANDI D,$FB ; ; DROP CL1 + OUT PORTB,D ; + + IN D,PORTD ;SBI PORTB,4 + LDI C,$40 ;$60 ; TOGGLE M (FORMERLY CL1 ALSO) + EOR D,C + OUT PORTD,D ;OUT PORTA,D + IN D,PORTB ; + ANDI D,$EF ;$7F ; DROP FLM + OUT PORTB,D ;PORTA,D + ;CBI PORTB,4 + ;STS LATCH10_SAV,D + +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D + OUT OCR1AL,D + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + + LDI D,$39 ; WAIT FOR 16uSEC +L050E: DEC D + BRNE L050E + + LDI D,$01 + OUT TCCR1B,D + SBI PORTD,5 ; CL2 HIGH + + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VCCL + LDS D,VCCH + LDI E,LOW(VCC_NOMINAL) + SUB C,E + LDI E,HIGH(VCC_NOMINAL) + SBC D,E + + ROR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +; PUSH D +; PUSH C + ASR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +; POP E +; ADD C,E +; POP E +; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + + LDS E,VEEL + ADD C,E + LDS E,VEEH + ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,$02 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,$C8 ;$B8 ; 54uSEC + OUT TCNT0,D + CLR D + STS SCAN_CNT,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + RJMP END_INT + +TIM0_OVF: + RETI + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_CNT + INC D + STS SCAN_CNT,D + DEC D + BREQ BEEPER ; IF SCAN_CNT WAS = 0 + DEC D + RJEQ PHOTO ; IF SCAN_CNT WAS = 1 + +END_INT: + POP D ; RESTORE STATE OF THE WORLD + ;OUT PORTA,D + ;SBI PORTB,4 + ;CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +BEEPER: LDS D,BUZZ_TIME + TST D + BREQ PULSE_LED + LDS C,LATCH12_SAV + SBRS C,3 + RJMP BEEPER_SPKHI + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +PULSE_LED: + LDI D,1<<7 + EOR FLAGS,D + BRPL PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP END_INT ; AND WASTE EVERY REMAINING CYCLE + +PULSE_LED_OK: + LDI D,$E2 ; 22uSEC + OUT TCNT0,D + PUSH ZH + PUSH ZL + PUSH R0 + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDI D,$E0 + CP R0,D + BRLO L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + POP R0 + POP ZL + POP ZH + RJMP END_INT + +PHOTO: CLR D ; STOP TIMER SINCE + OUT TCCR0,D ; WANT INTERRUPT EVERY 2ND CYCLE + + PUSH ZH + PUSH ZL + PUSH R0 + + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + SBRS D,6 + RJMP L058A + + ; ROW/COLUMN IS INACTIVE + CLC + IN C,SREG + RJMP L0593 + +L058A: ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + IN C,SREG + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF AND C + + ; MOV D,TX_COUNT + ; CPI D,TX_SIZE + ; BRSH L0617X + ; PUSH A + ; LDS A,ROW_COLUMN + ; OUT SREG,C + ; ROL A + ; SBRS A,7 + ; RJMP L0617XX + ; RCALL TX_CHAR + ; LDI A,1 + ;L0617XX: + ; STS ROW_COLUMN,A + ; POP A + ;L0617X: + + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDI D,$E0 + CP R0,D + BRLO L05A8 + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS D,ROW_BITMAP + ROL D + STS ROW_BITMAP,D + LDS D,ROW_BITMAP+1 + ROL D + STS ROW_BITMAP+1,D + RJMP L05F9 +L05A8: ; WE HAVE A COLUMN STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRLO L05AB + RJMP L05F9 +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + PUSH A + LDI A,$38 +L05B9: SUBI A,$04 + RJEQ L05F8 ;BREQ L05F8 + ROR D + ROR C + BRSH L05B9 + ; WE FOUND AN INTERSECTION + PUSH D + PUSH C + + LDS D,LATCH5_SAV + SBRS D,7 + RJMP ALREADY_ON + + ;LDS D,TURNON_COUNT + ;TST D + ;BREQ TURNON_OK + ;DEC D + ;STS TURNON_COUNT,D + ;BRNE TURNON_OK + + LDI D,~(1<<6) + AND FLAGS,D ; RESET TURNOFF REQUEST + +;TURNON_OK: + RJMP L05F8 + +ALREADY_ON: + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + MOV C,A + SUBI C,$04 + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + POP C + POP D + TST R0 + RJEQ L05B9 ; NULL INTERSECTION, FIND ANOTHER + + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,$10 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + MOV D,TX_COUNT + CPI D,TX_SIZE-2 + BRSH L05F8 + LDI A,$1B + RCALL TX_CHAR + LDI A,'Z' + RCALL TX_CHAR + MOV A,R0 + RCALL TX_CHAR + +L05F8: ; SCAN TO NEXT LED / PHOTODIODE PAIR + POP A +L05F9: LDI D,$04 + ADD SCAN,D + LDI C,$C8 + CP SCAN,C + BRLO L0617 + + ; MOV D,TX_COUNT + ; CPI D,TX_SIZE-1 + ; BRSH L0617Y + ; PUSH A + ; LDS A,ROW_COLUMN + ; LSR A + ;L0617YY: + ; ROL A + ; SBRS A,7 + ; RJMP L0617YY + ; RCALL TX_CHAR + ; LDI A,1 + ; STS ROW_COLUMN,A + ; LDI A,$0D + ; RCALL TX_CHAR + ; POP A + ;L0617Y: + + ; COMPLETED ENTIRE SCAN, START NEW SCAN +; SBI DDRC,7 +; SBI PORTC,7 ; DIAGNOSTIC SYNC FOR LED SCAN +; CBI PORTC,7 + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + LDS D,DEBOUNCE + TST D + BREQ L0617 + DEC D + STS DEBOUNCE,D + BRNE L0617 + LDS D,ACTIVE_ZONE + TST D + BREQ L0617 + MOV D,TX_COUNT + CPI D,TX_SIZE-2 + BRSH L0617 + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'Z' + RCALL TX_CHAR + LDI A,0 + RCALL TX_CHAR + POP A +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + LDIZ SCAN_TBL + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$C0 + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + POP R0 + POP ZL + POP ZH +; SBI PORTC,6 ; DIAGNOSTIC DURATION FOR PHOTO ROUTINE +; CBI PORTC,6 + RJMP END_INT + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/cs64v0.asm b/src/avr/cs64v0.asm new file mode 100644 index 00000000..8e6c256e --- /dev/null +++ b/src/avr/cs64v0.asm @@ -0,0 +1,3076 @@ +; CS64V0.ASM + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "API.INC" ; DIDN'T CHANGE THIS TO APICS.INC SINCE NO WDR IN CS64V0.ASM + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS + BST @0,1 ; A15 + BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFC0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FD80 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_CNT: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $0000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RJMP GO_TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + +RESTART_ENTRY: + ;LDI F,8 + ;OUT ASSR,F ; TIMER 2 CLOCKED BY 32 KHZ XTAL + ;LDI F,1 + ;OUT TCCR2,F ; TIMER 2 DIVIDE BY 1 + LDI F,$00 ;$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + ;LDI F,$00 + OUT GIMSK,F + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + ;OUT PORTC,F + ;SBI PORTB,2 + ;CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + +; LDI D,$18 ; A18|A17|A16|A15|A14=11000 +; OUT PORTA,D ; CL1=M=FLM=0 +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + +;RTNCDE: LDIZ RTN_CODE ; POINT Z TO FLASH +; LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER +; LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +;CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +;CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM +; LPM ; GET DATA FROM FLASH +; CLR R0 ; TEMPORARY CLEAR KB +; RAMWRX R0 ; WRITE DATA TO DSPRAM +; DEC XL +; BREQ RTNCDE_END ; CHECK IF ALL DONE +; ADIW ZL,$01 ; INC FLASH ADDRESS +; INC YL ; INC ADDRESS L FOR DSPRAM +; MOV A,YL ; +; ANDI A,$3F ;YL,$3F +; BRNE CDE1 +; SUBI YL,$40 ; +; INC YH ; INC ADDRESS H (ON L ROLLOVER) +; RJMP CDE0 +;RTNCDE_END: + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,$10 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + CLR A + STS SCAN_CNT,A ; START ON FIRST LED / PHOTODIODE PAIR + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; DROP CL2 + + IN D,PORTD ;LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTD,D ;PORTA,D + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,D + + LDI D,$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + RCALL RX_WAIT + + CPI A,$1B + BREQ ESC_SEQUENCE + + SBRC FLAGS,3 + RJMP REGULAR_CHAR + CPI A,$20 + BRSH REGULAR_CHAR + + CPI A,$08 + RJEQ BACK_SPACE + CPI A,$0D + RJEQ CR + CPI A,$0A + RJEQ LF + CPI A,7 + BRNE MAIN_LOOP + +REGULAR_CHAR: + SBRC FLAGS,2 ; CROSSED ZEROS ON? + RJMP L013B ; YES, DON'T BOTHER TESTING FOR ZERO + CPI A,'0' + BRNE L013B + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YL,LOW(-$204) + SBCI YH,HIGH(-$204) + A14_A18 B + RCALL LPMS + MOV A,R0 +L013B: RCALL DRAW_CHAR_TTY + RJMP MAIN_LOOP + +ESC_SEQUENCE: + RCALL RX_WAIT + CPI A,$1B + BREQ REGULAR_CHAR + CPI A,'.' + RJEQ CHARACTER_SET_DOWNLOAD + CPI A,'/' + RJEQ CROSSED_ZEROS + CPI A,'?' + RJEQ CHARACTER_SET_QUERY + CPI A,'A' + RJEQ SET_BACKLIGHT + CPI A,'B' + RJEQ BUZZER + CPI A,'C' + RJEQ CLEAR_RECTANGLE + CPI A,'D' + RJEQ DRAW_MODE + CPI A,'E' + RJEQ ENABLE_CNTRL + CPI A,'F' + RJEQ GET_FILLED_RECTNC_SIZE + CPI A,'G' + RJEQ INTERPRET_MODE + CPI A,'K' + RJEQ CLR_DISP + CPI A,'L' + RJEQ GO_SCROLL_REGION + CPI A,'M' + RJEQ MOSFET_CONTROL + CPI A,'N' + RJEQ GET_RECTNC_SIZE + CPI A,'P' + RJEQ PROP_FIXED_MODE + CPI A,'R' + RJEQ GET_RECT_SIZE + CPI A,'S' + RJEQ SET_CURSOR + CPI A,'U' + RJEQ NULLSUB + CPI A,'V' + RJEQ CONTRAST_CONTROL + CPI A,'W' + RJEQ NULLSUB + CPI A,'X' + RJEQ SAVE_STATE + CPI A,'Z' + RJEQ TOUCH_ZONE + CPI A,'0' + BRLO ESC_SEQUENCE_ABORT + CPI A,'9'+1 + BRLO SET_CHSET_A +ESC_SEQUENCE_ABORT: + RJMP MAIN_LOOP + +CROSSED_ZEROS: + RCALL RX_WAIT + SBRS A,0 + RJMP CROSSED_ZEROS_OFF + LDI A,1<<2 + OR FLAGS,A + RJMP MAIN_LOOP +CROSSED_ZEROS_OFF: + LDI A,~(1<<2) + AND FLAGS,A + RJMP MAIN_LOOP + +MOSFET_CONTROL: + RCALL RX_WAIT + CPI A,$30 ; DO NOT TURN OFF BY ACCIDENT + BRNE MOSFET_CONTROL_DONE + CLI + LDI F,1<<6 + OR FLAGS,F ; SAY WE TURNED OFF VIA COMMAND + RJMP SLEEP_ENTRY ; GO AND SHUT DOWN DISPLAY +MOSFET_CONTROL_DONE: + RJMP MAIN_LOOP + +BUZZER: RCALL RX_WAIT + STS BUZZ_TIME,A ; SAVE REQUESTED DURATION + RJMP MAIN_LOOP + +SET_CHSET: + RCALL RX_WAIT +SET_CHSET_A: + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT +; ANDI A,1 +; BRNE SET_BACKLIGHT_ON +; LDI A,~(1<<7) +; AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION +; CBI PORTC,7 +; CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT +; RJMP MAIN_LOOP +;SET_BACKLIGHT_ON: +; LDI A,1<<7 +; OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + CLI + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_TIM0_OVF: + RJMP TIM0_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRSH DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRSH DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_PAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,30 + RCALL COPY_BYTES ; 240 PIXELS, SKIP 16 FOR SAMSUNG + + ;SBIW XL,2 + ;ADIW YL,6 + ;LDI B,2 + ;RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS C,CLOCKING_PTR + TST C ; START OF 4 LINE BLOCK? (1 BASED) + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D + OUT TCNT1H,D + OUT TCNT1L,D + CBI PORTD,5 ; DROP CL2 + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + ;LDS D,LATCH10_SAV + ;OUT PORTA,D + ;SBI PORTB,4 + SBI PORTB,2 ;PORTA,5 ; PULSE CL1 + CBI PORTB,2 ;PORTA,5 + ;CBI PORTB,4 + RJMP L04F9 + +L04E6: IN D,PORTB ;LDS D,LATCH10_SAV + ORI D,$10 ;$80 ; RAISE FLM + ORI D,$04 ;$20 ; RAISE CL1 + OUT PORTB,D ;PORTA,D + ANDI D,$FB ; ; DROP CL1 + OUT PORTB,D ; + + IN D,PORTD ;SBI PORTB,4 + LDI C,$40 ;$60 ; TOGGLE M (FORMERLY CL1 ALSO) + EOR D,C + OUT PORTD,D ;OUT PORTA,D + IN D,PORTB ; + ANDI D,$EF ;$7F ; DROP FLM + OUT PORTB,D ;PORTA,D + ;CBI PORTB,4 + ;STS LATCH10_SAV,D + +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$E0 ;$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D + OUT OCR1AL,D ; TO CLOCK AT 5.5 MHZ + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + + LDI D,$AB ;$39 ; WAIT FOR 16uSEC +L050E: DEC D + BRNE L050E + + LDI D,$01 + OUT TCCR1B,D + SBI PORTD,5 ; CL2 HIGH + + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VCCL + LDS D,VCCH + LDI E,LOW(VCC_NOMINAL) + SUB C,E + LDI E,HIGH(VCC_NOMINAL) + SBC D,E + + ROR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +; PUSH D +; PUSH C + ASR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +; POP E +; ADD C,E +; POP E +; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + + LDS E,VEEL + ADD C,E + LDS E,VEEH + ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,$02 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,$C8 ;$B8 ; 54uSEC + OUT TCNT0,D + CLR D + STS SCAN_CNT,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + RJMP END_INT + +TIM0_OVF: + RETI + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_CNT + INC D + STS SCAN_CNT,D + DEC D + BREQ BEEPER ; IF SCAN_CNT WAS = 0 + DEC D + RJEQ PHOTO ; IF SCAN_CNT WAS = 1 + +END_INT: + POP D ; RESTORE STATE OF THE WORLD + ;OUT PORTA,D + ;SBI PORTB,4 + ;CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +BEEPER: LDS D,BUZZ_TIME + TST D + BREQ PULSE_LED + LDS C,LATCH12_SAV + SBRS C,3 + RJMP BEEPER_SPKHI + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +PULSE_LED: + LDI D,1<<7 + EOR FLAGS,D + BRPL PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP END_INT ; AND WASTE EVERY REMAINING CYCLE + +PULSE_LED_OK: + LDI D,$E2 ; 22uSEC + OUT TCNT0,D + PUSH ZH + PUSH ZL + PUSH R0 + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDI D,$E0 + CP R0,D + BRLO L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + POP R0 + POP ZL + POP ZH + RJMP END_INT + +PHOTO: CLR D ; STOP TIMER SINCE + OUT TCCR0,D ; WANT INTERRUPT EVERY 2ND CYCLE + + PUSH ZH + PUSH ZL + PUSH R0 + + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + SBRS D,6 + RJMP L058A + + ; ROW/COLUMN IS INACTIVE + CLC + IN C,SREG + RJMP L0593 + +L058A: ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + IN C,SREG + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF AND C + + ; MOV D,TX_COUNT + ; CPI D,TX_SIZE + ; BRSH L0617X + ; PUSH A + ; LDS A,ROW_COLUMN + ; OUT SREG,C + ; ROL A + ; SBRS A,7 + ; RJMP L0617XX + ; RCALL TX_CHAR + ; LDI A,1 + ;L0617XX: + ; STS ROW_COLUMN,A + ; POP A + ;L0617X: + + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDI D,$E0 + CP R0,D + BRLO L05A8 + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS D,ROW_BITMAP + ROL D + STS ROW_BITMAP,D + LDS D,ROW_BITMAP+1 + ROL D + STS ROW_BITMAP+1,D + RJMP L05F9 +L05A8: ; WE HAVE A COLUMN STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRLO L05AB + RJMP L05F9 +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + PUSH A + LDI A,$38 +L05B9: SUBI A,$04 + RJEQ L05F8 ;BREQ L05F8 + ROR D + ROR C + BRSH L05B9 + ; WE FOUND AN INTERSECTION + PUSH D + PUSH C + + LDS D,LATCH5_SAV + SBRS D,7 + RJMP ALREADY_ON + + ;LDS D,TURNON_COUNT + ;TST D + ;BREQ TURNON_OK + ;DEC D + ;STS TURNON_COUNT,D + ;BRNE TURNON_OK + + LDI D,~(1<<6) + AND FLAGS,D ; RESET TURNOFF REQUEST + +;TURNON_OK: + RJMP L05F8 + +ALREADY_ON: + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + MOV C,A + SUBI C,$04 + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + POP C + POP D + TST R0 + RJEQ L05B9 ; NULL INTERSECTION, FIND ANOTHER + + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,$10 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + MOV D,TX_COUNT + CPI D,TX_SIZE-2 + BRSH L05F8 + LDI A,$1B + RCALL TX_CHAR + LDI A,'Z' + RCALL TX_CHAR + MOV A,R0 + RCALL TX_CHAR + +L05F8: ; SCAN TO NEXT LED / PHOTODIODE PAIR + POP A +L05F9: LDI D,$04 + ADD SCAN,D + LDI C,$C8 + CP SCAN,C + BRLO L0617 + + ; MOV D,TX_COUNT + ; CPI D,TX_SIZE-1 + ; BRSH L0617Y + ; PUSH A + ; LDS A,ROW_COLUMN + ; LSR A + ;L0617YY: + ; ROL A + ; SBRS A,7 + ; RJMP L0617YY + ; RCALL TX_CHAR + ; LDI A,1 + ; STS ROW_COLUMN,A + ; LDI A,$0D + ; RCALL TX_CHAR + ; POP A + ;L0617Y: + + ; COMPLETED ENTIRE SCAN, START NEW SCAN +; SBI DDRC,7 +; SBI PORTC,7 ; DIAGNOSTIC SYNC FOR LED SCAN +; CBI PORTC,7 + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + LDS D,DEBOUNCE + TST D + BREQ L0617 + DEC D + STS DEBOUNCE,D + BRNE L0617 + LDS D,ACTIVE_ZONE + TST D + BREQ L0617 + MOV D,TX_COUNT + CPI D,TX_SIZE-2 + BRSH L0617 + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'Z' + RCALL TX_CHAR + LDI A,0 + RCALL TX_CHAR + POP A +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + LDIZ SCAN_TBL + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$C0 + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + POP R0 + POP ZL + POP ZH +; SBI PORTC,6 ; DIAGNOSTIC DURATION FOR PHOTO ROUTINE +; CBI PORTC,6 + RJMP END_INT + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/cs64v1.asm b/src/avr/cs64v1.asm new file mode 100644 index 00000000..a8e77d97 --- /dev/null +++ b/src/avr/cs64v1.asm @@ -0,0 +1,2912 @@ +; CS64V1.ASM +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APICS.INC" ; NOT API.INC BECAUSE APICS.INC HAS WDR IN TX_WAIT_LOOP + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL +; THIS WILL CORRUPT BACKLIGHT + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 + ANDI R19,$80 + EOR R19,@0 + SEI + OUT PORTC,R19 +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @0,1 ; A15 +; BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @1,7 ; A15 +; BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,2 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,2 + CBI PORTB,1 + NOP + SBI PORTB,1 + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SEI + SBI PORTB,2 + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SBI PORTB,2 + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFF0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FD60 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +TEMP: .BYTE 1 ; 10C + +LATCH11_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 2 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +BACKLIGHT_COUNT: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RETI ; TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + +RESTART_ENTRY: + LDI F,$00 + OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED + OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F ; D6 = LOW TO RESET T6963C + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$07 ; CS, RD, WR HI, LEs ALL LO + OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT + + LDI F,$00 + OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT + + LDI F,$20 ;$A0 NO BACKLIGHT INVERSION INITIALLY + MOV FLAGS,F ; START WITH DISPLAY ON + + INIT_API_BUS + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT+1,D ; KLUDGE FOR EXTRA 2 BITS OF RESOLUTION + + ; INITIALISE T6963C DISPLAY CONTROLLER + SBI PORTD,6 ; COME OUT OF RESET + + LDI ZL,0 + LDI ZH,0 +RESET_DELAY: + WDR ; 10OCT02 RESET WATCHDOG + SBIW ZL,1 + BRNE RESET_DELAY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOP: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + CLR A + STS BACKLIGHT_COUNT,A ; ENSURE BACKLIGHT COUNT IS IN RANGE + + CLR ZL + CLR ZH ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$04 ;$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +WRITE_COMMAND: + RCALL WAIT_STATUS ; LEAVES C/D = 1 + RJMP WRITE_ENTRY +WRITE_COMMAND_AUTO: + RCALL WAIT_AUTO ; LEAVES C/D = 1 + RJMP WRITE_ENTRY + +WRITE_DATA: + RCALL WAIT_STATUS + RJMP WRITE_DATA_ENTRY +WRITE_DATA_AUTO: + RCALL WAIT_AUTO +WRITE_DATA_ENTRY: + CBI PORTC,0 ; C/D = 0 +WRITE_ENTRY: + OUT PORTA,F + NOP + NOP + NOP + CLI + CBI PORTB,1 ; WR = 0 + NOP + NOP + NOP + SEI + SBI PORTB,1 ; WR = 1 + RET + +WAIT_AUTO: + PUSH F +WAIT_AUTO_LOOP: + RCALL READ_STATUS + SBRS F,3 + RJMP WAIT_AUTO_LOOP + POP F + RET + +WAIT_STATUS: + PUSH F +WAIT_STATUS_LOOP: + RCALL READ_STATUS + SBRC F,0 + SBRS F,1 + RJMP WAIT_STATUS_LOOP + POP F + RET + +READ_STATUS: + SBI PORTC,0 ; C/D = 1 + LDI F,0 + OUT DDRA,F ; D0-D7 = INPUTS + CLI + CBI PORTB,0 ; RD = 0 + NOP + NOP + NOP + NOP + SBI PORTB,0 ; RD = 1 + IN F,PINA ; READ DATA BEFORE RD COMES UP + SEI + PUSH F + LDI F,$FF + OUT DDRA,F ; D0-D7 = OUTPUTS + POP F + RET + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; TURN OFF VEE MEASURING + + SBI PORTB,2 ; SRAM SELECT = 1 + CBI PORTD,6 ; T6963C RESET = 0 + CBI PORTD,7 ; T6963C SELECT = 0 + CBI PORTB,0 ; RD = 0 + CBI PORTB,1 ; WR = 0 + + LDI D,$FF + OUT DDRA,D ; D0-D7 = OUTPUTS + LDI D,0 + OUT PORTA,D ; D0-D7 = 0 + + LDI D,0 ;$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + ;LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$1F ; WATCHDOG TURN OFF ENABLE = 1 + OUT WDTCR,D + LDI D,$17 ; WATCHDOG ENABLE = 0 + OUT WDTCR,D + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: +; CLI ; FOR BEST SAFETY +; +; LDI F,$00 +; OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED +; OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED +; +; LDI F,$F8 ; INIT_PORTS +; OUT DDRD,F +; LDI F,$B8 ;$F8 +; OUT PORTD,F ; D6 = LOW TO RESET T6963C +; LDI F,$1F +; OUT DDRB,F +; LDI F,$FF +; OUT DDRA,F +; OUT DDRC,F +; +; CLR F +; OUT PORTA,F +; +;; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO +;; LDI F,$03 ; CS, RD, WR HI, LEs ALL LO +; IN F,PORTB +; ANDI F,$10 ; PRESERVE B4 FOR BACKLIGHT +; ORI F,$03 ; CS, RD, WR HI, LEs ALL LO +; OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT +; +;; LDI F,$00 +; IN F,PORTC +; ANDI F,$80 ; PRESERVE C7 FOR BACKLIGHT +; OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT +; +; SEI ; FOR BEST SAFETY +; CBI PORTD,6 ; SEE OUT PORTD,F ABOVE +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYX: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYX +; +; ; INITIALISE T6963C DISPLAY CONTROLLER +; SBI PORTD,6 ; COME OUT OF RESET +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYY: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOPZ: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOPZ + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + +; CLI ; FOR BEST SAFETY +; +; LDI A,HIGH(CONTRAST_MID) +; OUT OCR1BH,A +; LDI A,LOW(CONTRAST_MID) +; OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH +; +; LDI A,HIGH(T1_INIT) +; OUT TCNT1H,A +; LDI A,LOW(T1_INIT) +; OUT TCNT1L,A +; +; LDI A,$50 +; OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH +; LDI A,$01 +; OUT TCCR1B,A ; TIMER 1 RUNNING +; +; LDI F,$00 +; OUT TCCR0,F ; TIMER 0 NOT RUNNING YET +; +; LDI F,$04 ;$05 +; OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS +; OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS +; +; LDI F,$0A +; OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE +; LDI F,$C0 +; OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS +; OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 +; +; SEI ; FOR BEST SAFETY + + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT + ANDI A,1 + BRNE SET_BACKLIGHT_ON + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + RJMP MAIN_LOOP +SET_BACKLIGHT_ON: + LDI A,1<<7 + OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + +; LDS A,CONTRASTL +; RCALL TX_WAIT +; LDS A,CONTRASTH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 1 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_PAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + LDI XL,LOW(ROWBUF) + LDI XH,HIGH(ROWBUF) ; X -> SINGLE LINE BUFFER IN AVR SRAM + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,30 ; BYTES TO COPY +DO_MORE: + A0_A13 YL,YH + RAMRD A + ST X+,A + INC YL + DEC B + RJNE DO_MORE ;BRNE DO_MORE + + POP XH + POP XL + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> SINGLE LINE IN T6963C BUFFER + + CBI PORTD,7 ; CS0 = 0 + MOV F,YL + RCALL WRITE_DATA + MOV F,YH + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI B,30 + LDI YL,LOW(ROWBUF) + LDI YH,HIGH(ROWBUF) ; Y -> SINGLE LINE BUFFER IN AVR SRAM +NICK_SUB2_LOOP: + LD F,Y+ + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + DEC B + BRNE NICK_SUB2_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + SBI PORTD,7 ; CS0 = 1 + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +; SBI DDRB,7 +; IN D,PORTB +; SUBI D,$80 +; OUT PORTB,D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + SBRS FLAGS,7 + RJMP BACKLIGHT_SKIP + LDS D,BACKLIGHT_COUNT + INC D +; LDS C,CONTRASTL +; LSL C +; CP D,C + CPI D,62 ;64 ; 64 COUNTS = 150 HZ + BRSH BACKLIGHT_EVEN +; LSR C +; CP D,C + CPI D,31 ;32 + BRNE BACKLIGHT_SAVE +;BACKLIGHT_ODD: + CBI PORTC,7 + SBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 + RJMP BACKLIGHT_CONT +BACKLIGHT_EVEN: + SBI PORTC,7 + CBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + LDI D,0 +BACKLIGHT_CONT: + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 +BACKLIGHT_SAVE: + STS BACKLIGHT_COUNT,D +BACKLIGHT_SKIP: + + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS D,BREAK_COUNT+1 ; WORD IS STORED IN REVERSE ORDER + SUBI D,-$40 + STS BREAK_COUNT+1,D ; START OF 4 INTERRUPT BLOCK? + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + LDI D,$B0 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, CLR OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD + LDI D,$0B+$AB ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VCCL + LDS D,VCCH + LDI E,LOW(VCC_NOMINAL) + SUB C,E + LDI E,HIGH(VCC_NOMINAL) + SBC D,E + + ROR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +; PUSH D +; PUSH C + ASR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +; POP E +; ADD C,E +; POP E +; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + +; CLR D +; CLR C + + LDS E,VEEL + ADD C,E + LDS E,VEEH + ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH WE ARE NO LONGER SETTING TIMER 0 + NOP + NOP + NOP + NOP + NOP + NOP + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + +;END_INT: + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/cs64v1a.asm b/src/avr/cs64v1a.asm new file mode 100644 index 00000000..fd75aab1 --- /dev/null +++ b/src/avr/cs64v1a.asm @@ -0,0 +1,2913 @@ +; CS64V1A.ASM +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APICS.INC" ; NOT API.INC BECAUSE APICS.INC HAS WDR IN TX_WAIT_LOOP + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL +; THIS WILL CORRUPT BACKLIGHT + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 + ANDI R19,$80 + EOR R19,@0 + SEI + OUT PORTC,R19 +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @0,1 ; A15 +; BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @1,7 ; A15 +; BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,2 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,2 + CBI PORTB,1 + NOP + SBI PORTB,1 + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + SBI PORTB,2 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SEI + SBI PORTB,2 + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,2 + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SBI PORTB,2 + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFF0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FD60 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$5F ;$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ;$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +TEMP: .BYTE 1 ; 10C + +LATCH11_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 2 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +BACKLIGHT_COUNT: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RETI ; TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + +RESTART_ENTRY: + LDI F,$00 + OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED + OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F ; D6 = LOW TO RESET T6963C + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$07 ; CS, RD, WR HI, LEs ALL LO + OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT + + LDI F,$00 + OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT + + LDI F,$20 ;$A0 NO BACKLIGHT INVERSION INITIALLY + MOV FLAGS,F ; START WITH DISPLAY ON + + INIT_API_BUS + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT+1,D ; KLUDGE FOR EXTRA 2 BITS OF RESOLUTION + + ; INITIALISE T6963C DISPLAY CONTROLLER + SBI PORTD,6 ; COME OUT OF RESET + + LDI ZL,0 + LDI ZH,0 +RESET_DELAY: + WDR ; 10OCT02 RESET WATCHDOG + SBIW ZL,1 + BRNE RESET_DELAY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOP: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + CLR A + STS BACKLIGHT_COUNT,A ; ENSURE BACKLIGHT COUNT IS IN RANGE + + CLR ZL + CLR ZH ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$04 ;$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +WRITE_COMMAND: + RCALL WAIT_STATUS ; LEAVES C/D = 1 + RJMP WRITE_ENTRY +WRITE_COMMAND_AUTO: + RCALL WAIT_AUTO ; LEAVES C/D = 1 + RJMP WRITE_ENTRY + +WRITE_DATA: + RCALL WAIT_STATUS + RJMP WRITE_DATA_ENTRY +WRITE_DATA_AUTO: + RCALL WAIT_AUTO +WRITE_DATA_ENTRY: + CBI PORTC,0 ; C/D = 0 +WRITE_ENTRY: + OUT PORTA,F + NOP + NOP + NOP + CLI + CBI PORTB,1 ; WR = 0 + NOP + NOP + NOP + SEI + SBI PORTB,1 ; WR = 1 + RET + +WAIT_AUTO: + PUSH F +WAIT_AUTO_LOOP: + RCALL READ_STATUS + SBRS F,3 + RJMP WAIT_AUTO_LOOP + POP F + RET + +WAIT_STATUS: + PUSH F +WAIT_STATUS_LOOP: + RCALL READ_STATUS + SBRC F,0 + SBRS F,1 + RJMP WAIT_STATUS_LOOP + POP F + RET + +READ_STATUS: + SBI PORTC,0 ; C/D = 1 + LDI F,0 + OUT DDRA,F ; D0-D7 = INPUTS + CLI + CBI PORTB,0 ; RD = 0 + NOP + NOP + NOP + NOP + SBI PORTB,0 ; RD = 1 + IN F,PINA ; READ DATA BEFORE RD COMES UP + SEI + PUSH F + LDI F,$FF + OUT DDRA,F ; D0-D7 = OUTPUTS + POP F + RET + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; TURN OFF VEE MEASURING + + SBI PORTB,2 ; SRAM SELECT = 1 + CBI PORTD,6 ; T6963C RESET = 0 + CBI PORTD,7 ; T6963C SELECT = 0 + CBI PORTB,0 ; RD = 0 + CBI PORTB,1 ; WR = 0 + + LDI D,$FF + OUT DDRA,D ; D0-D7 = OUTPUTS + LDI D,0 + OUT PORTA,D ; D0-D7 = 0 + + LDI D,0 ;$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + ;LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$1F ; WATCHDOG TURN OFF ENABLE = 1 + OUT WDTCR,D + LDI D,$17 ; WATCHDOG ENABLE = 0 + OUT WDTCR,D + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: +; CLI ; FOR BEST SAFETY +; +; LDI F,$00 +; OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED +; OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED +; +; LDI F,$F8 ; INIT_PORTS +; OUT DDRD,F +; LDI F,$B8 ;$F8 +; OUT PORTD,F ; D6 = LOW TO RESET T6963C +; LDI F,$1F +; OUT DDRB,F +; LDI F,$FF +; OUT DDRA,F +; OUT DDRC,F +; +; CLR F +; OUT PORTA,F +; +;; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO +;; LDI F,$03 ; CS, RD, WR HI, LEs ALL LO +; IN F,PORTB +; ANDI F,$10 ; PRESERVE B4 FOR BACKLIGHT +; ORI F,$03 ; CS, RD, WR HI, LEs ALL LO +; OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT +; +;; LDI F,$00 +; IN F,PORTC +; ANDI F,$80 ; PRESERVE C7 FOR BACKLIGHT +; OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT +; +; SEI ; FOR BEST SAFETY +; CBI PORTD,6 ; SEE OUT PORTD,F ABOVE +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYX: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYX +; +; ; INITIALISE T6963C DISPLAY CONTROLLER +; SBI PORTD,6 ; COME OUT OF RESET +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYY: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOPZ: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOPZ + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + +; CLI ; FOR BEST SAFETY +; +; LDI A,HIGH(CONTRAST_MID) +; OUT OCR1BH,A +; LDI A,LOW(CONTRAST_MID) +; OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH +; +; LDI A,HIGH(T1_INIT) +; OUT TCNT1H,A +; LDI A,LOW(T1_INIT) +; OUT TCNT1L,A +; +; LDI A,$50 +; OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH +; LDI A,$01 +; OUT TCCR1B,A ; TIMER 1 RUNNING +; +; LDI F,$00 +; OUT TCCR0,F ; TIMER 0 NOT RUNNING YET +; +; LDI F,$04 ;$05 +; OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS +; OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS +; +; LDI F,$0A +; OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE +; LDI F,$C0 +; OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS +; OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 +; +; SEI ; FOR BEST SAFETY + + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT + ANDI A,1 + BRNE SET_BACKLIGHT_ON + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + RJMP MAIN_LOOP +SET_BACKLIGHT_ON: + LDI A,1<<7 + OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + +; LDS A,CONTRASTL +; RCALL TX_WAIT +; LDS A,CONTRASTH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 1 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_PAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + LDI XL,LOW(ROWBUF) + LDI XH,HIGH(ROWBUF) ; X -> SINGLE LINE BUFFER IN AVR SRAM + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,30 ; BYTES TO COPY +DO_MORE: + A0_A13 YL,YH + RAMRD A + ST X+,A + INC YL + DEC B + RJNE DO_MORE ;BRNE DO_MORE + + POP XH + POP XL + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> SINGLE LINE IN T6963C BUFFER + + CBI PORTD,7 ; CS0 = 0 + MOV F,YL + RCALL WRITE_DATA + MOV F,YH + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI B,30 + LDI YL,LOW(ROWBUF) + LDI YH,HIGH(ROWBUF) ; Y -> SINGLE LINE BUFFER IN AVR SRAM +NICK_SUB2_LOOP: + LD F,Y+ + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + DEC B + BRNE NICK_SUB2_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + SBI PORTD,7 ; CS0 = 1 + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +; SBI DDRB,7 +; IN D,PORTB +; SUBI D,$80 +; OUT PORTB,D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + SBRS FLAGS,7 + RJMP BACKLIGHT_SKIP + LDS D,BACKLIGHT_COUNT + INC D +; LDS C,CONTRASTL +; LSL C +; CP D,C + CPI D,37 ;62 ;64 ; 64 COUNTS = 150 HZ + BRSH BACKLIGHT_EVEN +; LSR C +; CP D,C + CPI D,18 ;31 ;32 + BRNE BACKLIGHT_SAVE +;BACKLIGHT_ODD: + CBI PORTC,7 + SBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 + RJMP BACKLIGHT_CONT +BACKLIGHT_EVEN: + SBI PORTC,7 + CBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + LDI D,0 +BACKLIGHT_CONT: + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 +BACKLIGHT_SAVE: + STS BACKLIGHT_COUNT,D +BACKLIGHT_SKIP: + + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS D,BREAK_COUNT+1 ; WORD IS STORED IN REVERSE ORDER + SUBI D,-$40 + STS BREAK_COUNT+1,D ; START OF 4 INTERRUPT BLOCK? + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + LDI D,$B0 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, CLR OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD + LDI D,$0B+$AB ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VCCL + LDS D,VCCH + LDI E,LOW(VCC_NOMINAL) + SUB C,E + LDI E,HIGH(VCC_NOMINAL) + SBC D,E + + ROR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +; PUSH D +; PUSH C + ASR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +; POP E +; ADD C,E +; POP E +; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + +; CLR D +; CLR C + + LDS E,VEEL + ADD C,E + LDS E,VEEH + ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH WE ARE NO LONGER SETTING TIMER 0 + NOP + NOP + NOP + NOP + NOP + NOP + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + +;END_INT: + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/cs64v2.asm b/src/avr/cs64v2.asm new file mode 100644 index 00000000..2de7eabb --- /dev/null +++ b/src/avr/cs64v2.asm @@ -0,0 +1,2928 @@ +; CS64V2.ASM +; 22NOV01 REVISE FOR OPERATION FROM VCC INSTEAD OF VBAT +; INVERT SENSE OF SRAM CHIP SELECT +; STILL NEED TO REMOVE VCC COMPENSATION CODE + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APICS.INC" ; NOT API.INC BECAUSE APICS.INC HAS WDR IN TX_WAIT_LOOP + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL +; THIS WILL CORRUPT BACKLIGHT + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 + ANDI R19,$80 + EOR R19,@0 + SEI + OUT PORTC,R19 +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @0,1 ; A15 +; BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @1,7 ; A15 +; BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFF0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FD60 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +TEMP: .BYTE 1 ; 10C + +LATCH11_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 2 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +BACKLIGHT_COUNT: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RETI ; TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + +RESTART_ENTRY: + LDI F,$00 + OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED + OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F ; D6 = LOW TO RESET T6963C + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + +; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO + LDI F,$03 ; CS, RD, WR HI, LEs ALL LO + OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT + + LDI F,$00 + OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT + + LDI F,$20 ;$A0 NO BACKLIGHT INVERSION INITIALLY + MOV FLAGS,F ; START WITH DISPLAY ON + + INIT_API_BUS + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT+1,D ; KLUDGE FOR EXTRA 2 BITS OF RESOLUTION + + ; INITIALISE T6963C DISPLAY CONTROLLER + SBI PORTD,6 ; COME OUT OF RESET + + LDI ZL,0 + LDI ZH,0 +RESET_DELAY: + WDR ; 10OCT02 RESET WATCHDOG + SBIW ZL,1 + BRNE RESET_DELAY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOP: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + CLR A + STS BACKLIGHT_COUNT,A ; ENSURE BACKLIGHT COUNT IS IN RANGE + + CLR ZL + CLR ZH ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$04 ;$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +WRITE_COMMAND: + RCALL WAIT_STATUS ; LEAVES C/D = 1 + RJMP WRITE_ENTRY +WRITE_COMMAND_AUTO: + RCALL WAIT_AUTO ; LEAVES C/D = 1 + RJMP WRITE_ENTRY + +WRITE_DATA: + RCALL WAIT_STATUS + RJMP WRITE_DATA_ENTRY +WRITE_DATA_AUTO: + RCALL WAIT_AUTO +WRITE_DATA_ENTRY: + CBI PORTC,0 ; C/D = 0 +WRITE_ENTRY: + OUT PORTA,F + NOP + NOP + NOP + CLI + CBI PORTB,1 ; WR = 0 + NOP + NOP + NOP + SEI + SBI PORTB,1 ; WR = 1 + RET + +WAIT_AUTO: + PUSH F +WAIT_AUTO_LOOP: + RCALL READ_STATUS + SBRS F,3 + RJMP WAIT_AUTO_LOOP + POP F + RET + +WAIT_STATUS: + PUSH F +WAIT_STATUS_LOOP: + RCALL READ_STATUS + SBRC F,0 + SBRS F,1 + RJMP WAIT_STATUS_LOOP + POP F + RET + +READ_STATUS: + SBI PORTC,0 ; C/D = 1 + LDI F,0 + OUT DDRA,F ; D0-D7 = INPUTS + CLI + CBI PORTB,0 ; RD = 0 + NOP + NOP + NOP + NOP + SBI PORTB,0 ; RD = 1 + IN F,PINA ; READ DATA BEFORE RD COMES UP + SEI + PUSH F + LDI F,$FF + OUT DDRA,F ; D0-D7 = OUTPUTS + POP F + RET + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; TURN OFF VEE MEASURING + + CBI PORTB,2 ; REMOVE WEAK PULL UP (SRAM SELECT = 1) + SBI DDRB,2 ; NOW DRIVE LOW + CBI PORTD,6 ; T6963C RESET = 0 + CBI PORTD,7 ; T6963C SELECT = 0 + CBI PORTB,0 ; RD = 0 + CBI PORTB,1 ; WR = 0 + + LDI D,$FF + OUT DDRA,D ; D0-D7 = OUTPUTS + LDI D,0 + OUT PORTA,D ; D0-D7 = 0 + + LDI D,0 ;$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + ;LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$1F ; WATCHDOG TURN OFF ENABLE = 1 + OUT WDTCR,D + LDI D,$17 ; WATCHDOG ENABLE = 0 + OUT WDTCR,D + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: +; CLI ; FOR BEST SAFETY +; +; LDI F,$00 +; OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED +; OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED +; +; LDI F,$F8 ; INIT_PORTS +; OUT DDRD,F +; LDI F,$B8 ;$F8 +; OUT PORTD,F ; D6 = LOW TO RESET T6963C +; LDI F,$1F +; OUT DDRB,F +; LDI F,$FF +; OUT DDRA,F +; OUT DDRC,F +; +; CLR F +; OUT PORTA,F +; +;; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO +;; LDI F,$03 ; CS, RD, WR HI, LEs ALL LO +; IN F,PORTB +; ANDI F,$10 ; PRESERVE B4 FOR BACKLIGHT +; ORI F,$03 ; CS, RD, WR HI, LEs ALL LO +; OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT +; +;; LDI F,$00 +; IN F,PORTC +; ANDI F,$80 ; PRESERVE C7 FOR BACKLIGHT +; OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT +; +; SEI ; FOR BEST SAFETY +; CBI PORTD,6 ; SEE OUT PORTD,F ABOVE +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYX: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYX +; +; ; INITIALISE T6963C DISPLAY CONTROLLER +; SBI PORTD,6 ; COME OUT OF RESET +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYY: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOPZ: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOPZ + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + +; CLI ; FOR BEST SAFETY +; +; LDI A,HIGH(CONTRAST_MID) +; OUT OCR1BH,A +; LDI A,LOW(CONTRAST_MID) +; OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH +; +; LDI A,HIGH(T1_INIT) +; OUT TCNT1H,A +; LDI A,LOW(T1_INIT) +; OUT TCNT1L,A +; +; LDI A,$50 +; OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH +; LDI A,$01 +; OUT TCCR1B,A ; TIMER 1 RUNNING +; +; LDI F,$00 +; OUT TCCR0,F ; TIMER 0 NOT RUNNING YET +; +; LDI F,$04 ;$05 +; OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS +; OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS +; +; LDI F,$0A +; OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE +; LDI F,$C0 +; OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS +; OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 +; +; SEI ; FOR BEST SAFETY + + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT + ANDI A,1 + BRNE SET_BACKLIGHT_ON + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + RJMP MAIN_LOOP +SET_BACKLIGHT_ON: + LDI A,1<<7 + OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + +; LDS A,CONTRASTL +; RCALL TX_WAIT +; LDS A,CONTRASTH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 1 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_PAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + LDI XL,LOW(ROWBUF) + LDI XH,HIGH(ROWBUF) ; X -> SINGLE LINE BUFFER IN AVR SRAM + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,30 ; BYTES TO COPY +DO_MORE: + A0_A13 YL,YH + RAMRD A + ST X+,A + INC YL + DEC B + RJNE DO_MORE ;BRNE DO_MORE + + POP XH + POP XL + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> SINGLE LINE IN T6963C BUFFER + + CBI PORTD,7 ; CS0 = 0 + MOV F,YL + RCALL WRITE_DATA + MOV F,YH + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI B,30 + LDI YL,LOW(ROWBUF) + LDI YH,HIGH(ROWBUF) ; Y -> SINGLE LINE BUFFER IN AVR SRAM +NICK_SUB2_LOOP: + LD F,Y+ + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + DEC B + BRNE NICK_SUB2_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + SBI PORTD,7 ; CS0 = 1 + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +; SBI DDRB,7 +; IN D,PORTB +; SUBI D,$80 +; OUT PORTB,D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + SBRS FLAGS,7 + RJMP BACKLIGHT_SKIP + LDS D,BACKLIGHT_COUNT + INC D +; LDS C,CONTRASTL +; LSL C +; CP D,C + CPI D,62 ;64 ; 64 COUNTS = 150 HZ + BRSH BACKLIGHT_EVEN +; LSR C +; CP D,C + CPI D,31 ;32 + BRNE BACKLIGHT_SAVE +;BACKLIGHT_ODD: + CBI PORTC,7 + SBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 + RJMP BACKLIGHT_CONT +BACKLIGHT_EVEN: + SBI PORTC,7 + CBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + LDI D,0 +BACKLIGHT_CONT: + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 +BACKLIGHT_SAVE: + STS BACKLIGHT_COUNT,D +BACKLIGHT_SKIP: + + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS D,BREAK_COUNT+1 ; WORD IS STORED IN REVERSE ORDER + SUBI D,-$40 + STS BREAK_COUNT+1,D ; START OF 4 INTERRUPT BLOCK? + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + LDI D,$B0 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, CLR OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD + LDI D,$0B+$AB ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VCCL + LDS D,VCCH + LDI E,LOW(VCC_NOMINAL) + SUB C,E + LDI E,HIGH(VCC_NOMINAL) + SBC D,E + + ROR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +; PUSH D +; PUSH C + ASR D + ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +; POP E +; ADD C,E +; POP E +; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + +; CLR D +; CLR C + + LDS E,VEEL + ADD C,E + LDS E,VEEH + ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH WE ARE NO LONGER SETTING TIMER 0 + NOP + NOP + NOP + NOP + NOP + NOP + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + +;END_INT: + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/cs64v4-cs64v5.diff b/src/avr/cs64v4-cs64v5.diff new file mode 100644 index 00000000..8c3c2156 --- /dev/null +++ b/src/avr/cs64v4-cs64v5.diff @@ -0,0 +1,625 @@ +--- cs64v4.asm 2003-03-18 12:26:48.000000000 +1100 ++++ cs64v5.asm 2003-03-20 16:55:20.000000000 +1100 +@@ -1,4 +1,4 @@ +-; CS64V4.ASM ++; CS64V5.ASM + + ; 01FEB02 REVISE FOR 7.3728MHz XTAL + ; 22NOV01 REVISE FOR OPERATION FROM VCC INSTEAD OF VBAT +@@ -15,8 +15,8 @@ + .LISTMAC + .MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) +- STS PAGE,YH +- RCALL ADRYP ; AND SET PAGE ++ STS XPAGE,YH ++ RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) + .ENDMACRO +@@ -285,12 +285,13 @@ + + .EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS + .EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +-.EQU API_RATE_SLOW =$5F ;$8F ; DIVISOR FOR 4800 BPS +-.EQU API_RATE_FAST =$03 ;$05 ; DIVISOR FOR 115200 BPS ++.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS ++.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS + .EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM + .EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD + .EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + ++.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE + .DEF SR =R1 + .DEF RX_PTR =R2 + .DEF RX_COUNT =R3 +@@ -355,7 +356,7 @@ + TEMP: .BYTE 1 ; 10C + + LATCH11_SAV: .BYTE 1 +-PAGE: .BYTE 1 ++XPAGE: .BYTE 1 + ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + + LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +@@ -572,9 +573,15 @@ + BREQ CHARACTER_SET_INIT_DONE + + CHARACTER_SET_INIT: +- LDIZ CHSET00 ; POINT Z TO FLASH +- LDIX CHSET00_END-CHSET00 ; BYTE COUNTER +- LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE ++; LDIZ CHSET00 ; POINT Z TO FLASH ++ LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++; LDIX CHSET00_END-CHSET00 ; BYTE COUNTER ++ LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER ++ LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++ LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE + CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT + CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM +@@ -612,11 +619,11 @@ + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + +- LDI B,EE_CONTRAST*2 ++ LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A +- LDI B,EE_CONTRAST*2+1 ++ LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + +@@ -808,7 +815,7 @@ + ; ----------------------------------------------------------------------------- + + ADRYP: +-; LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM ++; LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM + ; LDS YL,LATCH10_SAV + ; ANDI YL,$E0 + ; OR YH,YL +@@ -822,10 +829,10 @@ + ; CLR YL + ; INC YH + ; BRNE INCRET +-; LDS YH,PAGE ++; LDS YH,XPAGE + ; INC YH + ; ANDI YH,$1F +-; STS PAGE,YH ++; STS XPAGE,YH + ; CLR YH + ;INCRET: RET + +@@ -892,14 +899,22 @@ + RJEQ NULLSUB + CPI A,'C' + RJEQ CLEAR_RECTANGLE ++ CPI A,'c' ++ RJEQ GET_CLEAR_FRAME_RECT_SIZE + CPI A,'D' + RJEQ DRAW_MODE + CPI A,'E' + RJEQ ENABLE_CNTRL + CPI A,'F' + RJEQ GET_FILLED_RECTNC_SIZE ++ CPI A,'f' ++ RJEQ GET_FRAME_RECT_SIZE + CPI A,'G' + RJEQ INTERPRET_MODE ++ CPI A,'H' ++ RJEQ GET_HALFTONE_RECT_SIZE ++ CPI A,'h' ++ RJEQ GET_CLEAR_HALFTONE_RECT_SIZE + CPI A,'K' + RJEQ CLR_DISP + CPI A,'L' +@@ -1320,10 +1335,10 @@ + ; LDI A,$0D + ; RCALL TX_WAIT + +- LDI B,EE_CONTRAST*2 ++ LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH +- LDI B,EE_CONTRAST*2+1 ++ LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + + CONTRAST_DONE: +@@ -1702,7 +1717,7 @@ + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 +@@ -1772,7 +1787,7 @@ + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + POP B + POP A + OK_LINE: +@@ -1823,7 +1838,7 @@ + + MORE_X: ADIW YL,$01 + LDS A,PTR+2 +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RCALL LPMS + + CLR A +@@ -1910,7 +1925,7 @@ + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + LDI B,30 ; BYTES TO COPY + DO_MORE: +@@ -2089,7 +2104,7 @@ + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RJMP L03A3 + L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) +@@ -2285,7 +2300,7 @@ + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE + L065C: LDS A,XBYTE_SAV +@@ -2439,12 +2454,13 @@ + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + +- ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN +- ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD +- LDI D,$0B+$AB ; WAIT FOR 3uSEC +-SETTLE_CL2: +- DEC D +- BRNE SETTLE_CL2 ++; 10mar03 for better API bus performance (let the chips fall where they may) ++; ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN ++; ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD ++; LDI D,$0B+$AB ; WAIT FOR 3uSEC ++;SETTLE_CL2: ++; DEC D ++; BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL +@@ -2474,31 +2490,31 @@ + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + +- LDS C,VCCL +- LDS D,VCCH +- LDI E,LOW(VCC_NOMINAL) +- SUB C,E +- LDI E,HIGH(VCC_NOMINAL) +- SBC D,E +- +- ROR D +- ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +-; PUSH D +-; PUSH C +- ASR D +- ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +-; POP E ++; LDS C,VCCL ++; LDS D,VCCH ++; LDI E,LOW(VCC_NOMINAL) ++; SUB C,E ++; LDI E,HIGH(VCC_NOMINAL) ++; SBC D,E ++; ++; ROR D ++; ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 ++;; PUSH D ++;; PUSH C ++; ASR D ++; ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 ++;; POP E ++;; ADD C,E ++;; POP E ++;; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 ++; ++;; CLR D ++;; CLR C ++; ++; LDS E,VEEL + ; ADD C,E +-; POP E +-; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 +- +-; CLR D +-; CLR C +- +- LDS E,VEEL +- ADD C,E +- LDS E,VEEH +- ADC D,E ++; LDS E,VEEH ++; ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH +@@ -2562,7 +2578,7 @@ + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) +@@ -2614,7 +2630,7 @@ + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 +@@ -2815,113 +2831,244 @@ + RAMWR A + RET + +-SELECT_PAGE: ++SELECT_XPAGE: + A14_A18 A + RET + + ; ----------------------------------------------------------------------------- + + CHSET00: +- .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 +- .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 +- .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 +- .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 +- .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 +- .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 +- .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 +- .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 +- .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 +- .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 +- .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 +- .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 +- .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 +- .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 +- .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 +- .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 +- .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 +- .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 +- .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 +- .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 +- .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 +- .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 +- .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 +- .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 +- .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 +- .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 +- .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 +- .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 +- .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 +- .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 +- .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 +- .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 +- .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 +- .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 +- .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 +- .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 +- .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 +- .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 +- .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 +- .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 +- .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 +- .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 +- .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 +- .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 +- .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 +- .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 +- .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 +- .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 +- .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 +- .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 +- .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 +- .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 +- .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 +- .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 +- .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 +- .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 +- .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 +- .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 +- .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 +- .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 +- .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 +- .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 +- .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 +- .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 +- .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 +- .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 +- .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 +- .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 +- .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 +- .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 +- .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A ++.INCLUDE "CHSET00.INC" + CHSET00_END: + + ; ----------------------------------------------------------------------------- + ++GET_CLEAR_FRAME_RECT_SIZE: ++ STS RECTNC_X,CURSORX ++ STS RECTNC_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECTNC_XX,A ++ RCALL RX_WAIT ++ STS RECTNC_YY,A ++ RCALL CLEAR_FRAME_RECT ++ RJMP MAIN_LOOP ++ ++GET_FRAME_RECT_SIZE: ++ STS RECTNC_X,CURSORX ++ STS RECTNC_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECTNC_XX,A ++ RCALL RX_WAIT ++ STS RECTNC_YY,A ++ RCALL FRAME_RECT ++ RJMP MAIN_LOOP ++ ++GET_CLEAR_HALFTONE_RECT_SIZE: ++ STS RECT_X,CURSORX ++ STS RECT_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECT_XX,A ++ RCALL RX_WAIT ++ STS RECT_YY,A ++ RCALL CLEAR_HALFTONE_RECT ++ RJMP MAIN_LOOP ++ ++GET_HALFTONE_RECT_SIZE: ++ STS RECT_X,CURSORX ++ STS RECT_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECT_XX,A ++ RCALL RX_WAIT ++ STS RECT_YY,A ++ RCALL HALFTONE_RECT ++ RJMP MAIN_LOOP ++ ++NO_GOX: RET ++ ++CLEAR_FRAME_RECT: ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ STS RECT_Y,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDS F,RECTNC_YY ++ STS RECT_YY,F ++ ++ LDI F,$02 ++ OR FLAGS,F ++ ++ RCALL DRAW_RECT ++ ++ LDI F,$FD ++ AND FLAGS,F ++ ++FRAME_RECT: ++ LDS F,RECTNC_XX ++ DEC F ++ CPI F,2 ++ BRLO NO_GOX ++ LDS F,RECTNC_YY ++ CPI F,3 ++ BRLO NO_GOX ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ STS RECT_Y,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDI F,$01 ++ STS RECT_YY,F ++ RCALL DRAW_RECT ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ INC F ++ STS RECT_Y,F ++ LDS F,RECTNC_YY ++ SUBI F,2 ++ STS RECT_YY,F ++ LDI F,$01 ++ STS RECT_XX,F ++ RCALL DRAW_RECT ++ ++ LDS X_SIZE,RECTNC_XX ++ LDS F,RECTNC_X ++ ADD F,X_SIZE ++ DEC F ++ STS RECT_X,F ++ LDI F,$01 ++ STS RECT_XX,F ++ LDS F,RECTNC_Y ++ INC F ++ STS RECT_Y,F ++ LDS F,RECTNC_YY ++ SUBI F,2 ++ STS RECT_YY,F ++ RCALL DRAW_RECT ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDS Y_SIZE,RECTNC_YY ++ LDS F,RECTNC_Y ++ ADD F,Y_SIZE ++ DEC F ++ STS RECT_Y,F ++ LDI F,$01 ++ STS RECT_YY,F ++ RJMP DRAW_RECT ++ ++CLEAR_HALFTONE_RECT: ++; LDS F,RECTNC_X ++; STS RECT_X,F ++; LDS F,RECTNC_Y ++; STS RECT_Y,F ++; LDS F,RECTNC_XX ++; STS RECT_XX,F ++; LDS F,RECTNC_YY ++; STS RECT_YY,F ++ ++ LDI F,$02 ++ OR FLAGS,F ++ ++ RCALL DRAW_RECT ++ ++ LDI F,$FD ++ AND FLAGS,F ++ ++HALFTONE_RECT: ++ SEI ++ LDS LINE_CNT,RECT_Y ++ LDS XPIXEL,RECT_X ++ RCALL CALCULATE_XBYTE ++ STS XPIXEL_SAV,XPIXEL ++ STS XBYTE_SAV,XBYTE ++ LDS Y_SIZE,RECT_YY ++ CLR YL ++ MOV YH,LINE_CNT ++ LDI A,$55 ++ SBRS YH,0 ++ LDI A,$AA ++ MOV PATTERN,A ++ LSR YH ++ ROR YL ++ LSR YH ++ ROR YL ++ SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER ++ LDI A,HIGH(DRAW_DSPRAM>>6) ++ RCALL SELECT_XPAGE ++ RJMP X03A3 ++X039A: SUBI YL,LOW(-$40) ++ SBCI YH,HIGH(-$40) ++ INC LINE_CNT ++ LDS XPIXEL,XPIXEL_SAV ++ LDS XBYTE,XBYTE_SAV ++X03A3: OR XBYTE,YL ++ LDI A,$FF ++ LDS X_SIZE,RECT_XX ++ LDI F,$00 ++ CP X_SIZE,F ++ BREQ X03B0 ++ LDI F,$08 ++ CP X_SIZE,F ++ BRLO X03C2 ++ TST XPIXEL ++ BREQ X03B0 ++X03AD: LSR A ++ DEC XPIXEL ++ BRNE X03AD ++X03B0: AND A,PATTERN ++ RCALL WR_DISP_MEM ++ LDI F,$08 ++ LDS A,XPIXEL_SAV ++ SUB F,A ++ SUB X_SIZE,F ++ INC XBYTE ++ LDI A,$FF ++X03B8: LDI F,$08 ++ CP X_SIZE,F ++ BRLO X03C2 ++ BREQ X03D2 ++ AND A,PATTERN ++ RCALL WR_DISP_MEM ++ LDI A,$FF ++ LDI F,$08 ++ SUB X_SIZE,F ++ INC XBYTE ++ RJMP X03B8 ++X03C2: TST X_SIZE ++ BREQ X03D3 ++X03C4: LSR A ++ DEC X_SIZE ++ BRNE X03C4 ++ COM A ++ TST XPIXEL ++ BREQ X03D2 ++ CLR B ++X03CB: LSR A ++ ROR B ++ DEC XPIXEL ++ BRNE X03CB ++ AND A,PATTERN ++ RCALL WR_DISP_MEM ++ INC XBYTE ++ MOV A,B ++X03D2: AND A,PATTERN ++ RCALL WR_DISP_MEM ++X03D3: COM PATTERN ++ RCALL NICK_SUB1 ++ DEC Y_SIZE ++ CLR F ++ CPSE Y_SIZE,F ++ RJMP X039A ++ RET ++ ++; ----------------------------------------------------------------------------- ++ + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND diff --git a/src/avr/cs64v4.asm b/src/avr/cs64v4.asm new file mode 100644 index 00000000..f1c9a503 --- /dev/null +++ b/src/avr/cs64v4.asm @@ -0,0 +1,3077 @@ +; CS64V4.ASM + +; 01FEB02 REVISE FOR 7.3728MHz XTAL +; 22NOV01 REVISE FOR OPERATION FROM VCC INSTEAD OF VBAT +; INVERT SENSE OF SRAM CHIP SELECT +; STILL NEED TO REMOVE VCC COMPENSATION CODE + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APICS.INC" ; NOT API.INC BECAUSE APICS.INC HAS WDR IN TX_WAIT_LOOP + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS XPAGE,YH + RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL +; THIS WILL CORRUPT BACKLIGHT + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 + ANDI R19,$80 + EOR R19,@0 + SEI + OUT PORTC,R19 +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + CLI + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + SEI + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 ;@1 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @0,1 ; A15 +; BLD R19,7 ;1 + BST @0,0 ; A14 + BLD R19,6 ;0 + SEI + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + IN R19,PORTC ;MOV R19,@0 + EOR R19,@0 ; + ANDI R19,$C0 ;$3F + EOR R19,@0 ; + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,R19 ;@1 + ;POP @1 + + IN R19,PORTC ;LDS R19,LATCH10_SAV ; AND THIS +; REMOVE TO AVOID CORRUPTING BACKLIGHT +; BST @1,7 ; A15 +; BLD R19,7 ;1 + BST @1,6 ; A14 + BLD R19,6 ;0 + OUT PORTC,R19 ;PORTA,R19 + ;SBI PORTB,4 + ;CBI PORTB,4 + ;STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,1 + NOP + SBI PORTB,1 + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + CBI PORTB,1 + NOP + SBI PORTB,1 + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + SEI + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + SBI PORTB,2 ; DRIVE HIGH + CBI DDRB,2 ; NOW SWITCH TO WEAK PULL UP + CBI PORTB,0 + NOP + SBI PORTB,0 + IN @0,PINA ; READ DATA + CBI PORTB,2 ; REMOVE WEAK PULL UP + SBI DDRB,2 ; NOW DRIVE LOW + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO +.ENDMACRO + +.MACRO LED +.ENDMACRO + +.MACRO LEDLO +.ENDMACRO + +.MACRO LEDHI +.ENDMACRO + +.MACRO SPKHI +.ENDMACRO + +.MACRO SPKLO +.ENDMACRO + +.MACRO SPKOFF +.ENDMACRO + +.EQU T1_INIT =-818 ;$FB35 +.EQU T1_FULL_SCALE =-651 ;$FC2F + +.EQU VEE_MIN =-640 ;$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX = -43 ;$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =-341 ;$FE00 + +.EQU CONTRAST_LONG =-640 ;$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT = -11 ;$FFF0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =-341 ;$FE00 + +.EQU VCC_NOMINAL =-536 ;$FCDC + +; WITH VCC = $FCDC FOR 6.0V: +;.EQU CONTRAST_MIN =$FD18 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FD78 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FD48 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +.EQU CONTRAST_MIN =-630 ;$FC80 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX = -85 ;$FF80 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =-448 ;$FD60 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$61000 ;$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$62000 ;$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$40 +.EQU CHARACTER_SETS =6 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$10 +.EQU RX_SIZE =$80 + +.EQU API_ADDRESS =$03 ; CUSTOMER DISPLAY ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$5F ;$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ;$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF BOXSIZEX =R7 ; ASSIGNED TWICE +.DEF BOXSIZEY =R8 ; ASSIGNED TWICE +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 0=BACKLIGHT INVERSION OFF 1=BACKLIGHT INVERSION ON +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +TEMP: .BYTE 1 ; 10C + +LATCH11_SAV: .BYTE 1 +XPAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +; MUST CONVERT TO USE DRAW_CHAR_TTY ROUTINE +;CHAR_X: .BYTE 1 +;CHAR_Y: .BYTE 1 +;CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 2 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +BACKLIGHT_COUNT: .BYTE 1 + +AVECNT: .BYTE 1 +AVEVCC: .BYTE 1 +AVEVCCL: .BYTE 1 +AVEVCCH: .BYTE 1 +AVEVEE: .BYTE 1 +AVEVEEL: .BYTE 1 +AVEVEEH: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RETI ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_TIM1_OVF + RETI ; TIM0_OVF + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + +RESTART_ENTRY: + LDI F,$00 + OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED + OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED + + LDI F,$F8 ; INIT_PORTS + OUT DDRD,F + LDI F,$B8 ;$F8 + OUT PORTD,F ; D6 = LOW TO RESET T6963C + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + +; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO + LDI F,$03 ; CS, RD, WR HI, LEs ALL LO + OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT + + LDI F,$00 + OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT + + LDI F,$20 ;$A0 NO BACKLIGHT INVERSION INITIALLY + MOV FLAGS,F ; START WITH DISPLAY ON + + INIT_API_BUS + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT+1,D ; KLUDGE FOR EXTRA 2 BITS OF RESOLUTION + + ; INITIALISE T6963C DISPLAY CONTROLLER + SBI PORTD,6 ; COME OUT OF RESET + + LDI ZL,0 + LDI ZH,0 +RESET_DELAY: + WDR ; 10OCT02 RESET WATCHDOG + SBIW ZL,1 + BRNE RESET_DELAY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOP: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: +; LDIZ CHSET00 ; POINT Z TO FLASH + LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + +; LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + ; ADRL MACRO WILL CORRUPT BACKLIGHT +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + CLR A + STS BACKLIGHT_COUNT,A ; ENSURE BACKLIGHT COUNT IS IN RANGE + + CLR ZL + CLR ZH ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$04 ;$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +WRITE_COMMAND: + RCALL WAIT_STATUS ; LEAVES C/D = 1 + RJMP WRITE_ENTRY +WRITE_COMMAND_AUTO: + RCALL WAIT_AUTO ; LEAVES C/D = 1 + RJMP WRITE_ENTRY + +WRITE_DATA: + RCALL WAIT_STATUS + RJMP WRITE_DATA_ENTRY +WRITE_DATA_AUTO: + RCALL WAIT_AUTO +WRITE_DATA_ENTRY: + CBI PORTC,0 ; C/D = 0 +WRITE_ENTRY: + OUT PORTA,F + NOP + NOP + NOP + CLI + CBI PORTB,1 ; WR = 0 + NOP + NOP + NOP + SEI + SBI PORTB,1 ; WR = 1 + RET + +WAIT_AUTO: + PUSH F +WAIT_AUTO_LOOP: + RCALL READ_STATUS + SBRS F,3 + RJMP WAIT_AUTO_LOOP + POP F + RET + +WAIT_STATUS: + PUSH F +WAIT_STATUS_LOOP: + RCALL READ_STATUS + SBRC F,0 + SBRS F,1 + RJMP WAIT_STATUS_LOOP + POP F + RET + +READ_STATUS: + SBI PORTC,0 ; C/D = 1 + LDI F,0 + OUT DDRA,F ; D0-D7 = INPUTS + CLI + CBI PORTB,0 ; RD = 0 + NOP + NOP + NOP + NOP + SBI PORTB,0 ; RD = 1 + IN F,PINA ; READ DATA BEFORE RD COMES UP + SEI + PUSH F + LDI F,$FF + OUT DDRA,F ; D0-D7 = OUTPUTS + POP F + RET + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + CBI PORTD,4 ; TURN TRANSISTOR ON (PULL DOWN VSWT) + CBI PORTD,5 ; TURN OFF VEE MEASURING + + CBI PORTB,2 ; REMOVE WEAK PULL UP (SRAM SELECT = 1) + SBI DDRB,2 ; NOW DRIVE LOW + CBI PORTD,6 ; T6963C RESET = 0 + CBI PORTD,7 ; T6963C SELECT = 0 + CBI PORTB,0 ; RD = 0 + CBI PORTB,1 ; WR = 0 + + LDI D,$FF + OUT DDRA,D ; D0-D7 = OUTPUTS + LDI D,0 + OUT PORTA,D ; D0-D7 = 0 + + LDI D,0 ;$40 + OUT TIMSK,D ; DISABLE TIMER 0 / 1 INTERRUPTS + + ;LDI D,0 + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + +; LDI F,$18 +; STS TURNON_COUNT,F ; .1 SECOND TO BREAK, .2 SECOND TO MAKE +; +; SEI +; +;SLEEP_LOOP: +; SLEEP +; +; LDS F,TURNON_COUNT +; TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? +; BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP +; +; CLI +; RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + + LDI D,$1F ; WATCHDOG TURN OFF ENABLE = 1 + OUT WDTCR,D + LDI D,$17 ; WATCHDOG ENABLE = 0 + OUT WDTCR,D + + LDI D,$6A + OUT MCUCR,D ; SE=0 SM1:SM0=10 FOR POWER DOWN MODE + SLEEP ; WE WILL NEVER WAKE UP + +; ----------------------------------------------------------------------------- + +ADRYP: +; LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM +; LDS YL,LATCH10_SAV +; ANDI YL,$E0 +; OR YH,YL +; OUT PORTA,YH +; SBI PORTB,4 +; CBI PORTB,4 +; STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,XPAGE +; INC YH +; ANDI YH,$1F +; STS XPAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: +; CLI ; FOR BEST SAFETY +; +; LDI F,$00 +; OUT TIMSK,F ; TIMER 0 / 1 / 2 INTERRUPTS DISABLED +; OUT GIMSK,F ; THERMISTOR / VCC INTERRUPTS DISABLED +; +; LDI F,$F8 ; INIT_PORTS +; OUT DDRD,F +; LDI F,$B8 ;$F8 +; OUT PORTD,F ; D6 = LOW TO RESET T6963C +; LDI F,$1F +; OUT DDRB,F +; LDI F,$FF +; OUT DDRA,F +; OUT DDRC,F +; +; CLR F +; OUT PORTA,F +; +;; LDI F,$07 ; CS, RD, WR HI, LEs ALL LO +;; LDI F,$03 ; CS, RD, WR HI, LEs ALL LO +; IN F,PORTB +; ANDI F,$10 ; PRESERVE B4 FOR BACKLIGHT +; ORI F,$03 ; CS, RD, WR HI, LEs ALL LO +; OUT PORTB,F ; INITIALISE B4 FOR BACKLIGHT +; +;; LDI F,$00 +; IN F,PORTC +; ANDI F,$80 ; PRESERVE C7 FOR BACKLIGHT +; OUT PORTC,F ; INITIALISE C7 FOR BACKLIGHT +; +; SEI ; FOR BEST SAFETY +; CBI PORTD,6 ; SEE OUT PORTD,F ABOVE +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYX: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYX +; +; ; INITIALISE T6963C DISPLAY CONTROLLER +; SBI PORTD,6 ; COME OUT OF RESET +; +; LDI ZL,0 +; LDI ZH,0 +;RESET_DELAYY: +; WDR ; RESET WATCHDOG +; SBIW ZL,1 +; BRNE RESET_DELAYY + + CBI PORTD,7 ; CS0 = 0 + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$42 + RCALL WRITE_COMMAND ; SET GRAPHIC HOME ADDRESS + LDI F,$20 + RCALL WRITE_DATA + LDI F,$00 + RCALL WRITE_DATA + LDI F,$43 + RCALL WRITE_COMMAND ; SET GRAPHIC AREA + LDI F,$80 + RCALL WRITE_COMMAND ; OR MODE + LDI F,$90 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS OFF + + LDI F,$00 + RCALL WRITE_DATA + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI ZL,LOW($800) + LDI ZH,HIGH($800) +CLEAR_LOOPZ: + LDI F,$00 + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + SBIW ZL,1 + BRNE CLEAR_LOOPZ + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + + LDI F,$98 + RCALL WRITE_COMMAND ; CURSOR OFF, TEXT OFF, GRAPHICS ON + SBI PORTD,7 ; CS0 = 1 + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + +; CLI ; FOR BEST SAFETY +; +; LDI A,HIGH(CONTRAST_MID) +; OUT OCR1BH,A +; LDI A,LOW(CONTRAST_MID) +; OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH +; +; LDI A,HIGH(T1_INIT) +; OUT TCNT1H,A +; LDI A,LOW(T1_INIT) +; OUT TCNT1L,A +; +; LDI A,$50 +; OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH +; LDI A,$01 +; OUT TCCR1B,A ; TIMER 1 RUNNING +; +; LDI F,$00 +; OUT TCCR0,F ; TIMER 0 NOT RUNNING YET +; +; LDI F,$04 ;$05 +; OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS +; OUT TIMSK,F ; TURN ON TIMER 0, 1 INTERRUPTS +; +; LDI F,$0A +; OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE +; LDI F,$C0 +; OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS +; OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 +; +; SEI ; FOR BEST SAFETY + + RJMP MAIN_LOOP + +SET_BACKLIGHT: + RCALL RX_WAIT + ANDI A,1 + BRNE SET_BACKLIGHT_ON + LDI A,~(1<<7) + AND FLAGS,A ; DISABLE INTERRUPT BACKLIGHT INVERSION + CBI PORTC,7 + CBI PORTB,4 ; EXPLICITLY TURN OFF BACKLIGHT + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 + RJMP MAIN_LOOP +SET_BACKLIGHT_ON: + LDI A,1<<7 + OR FLAGS,A ; ENABLE INTERRUPT BACKLIGHT INVERSION + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: RCALL CARRIAGE_RET + RJMP MAIN_LOOP + +CARRIAGE_RET: + CLR CURSORX + RET + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + +; LDS A,CONTRASTL +; RCALL TX_WAIT +; LDS A,CONTRASTH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +GO_EXT_INT0: + RJMP EXT_INT0 +GO_EXT_INT1: + RJMP EXT_INT1 +GO_TIM1_OVF: + RJMP TIM1_OVF +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT + RCALL RX_WAIT +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +;NICK_REPORT: +; LDI A,~(1<<7) +; AND FLAGS,A +; +; PUSH B +; +; CLI +; LDS A,AVEVCC +; LDS B,VCCL +; ADD A,B +; STS AVEVCC,A +; LDS A,AVEVCCL +; LDS B,VCCH +; SEI +; ADC A,B +; STS AVEVCCL,A +; LDS A,AVEVCCH +; LDI B,0 +; ADC A,B +; STS AVEVCCH,A +; +; CLI +; LDS A,AVEVEE +; LDS B,VEEL +; ADD A,B +; STS AVEVEE,A +; LDS A,AVEVEEL +; LDS B,VEEH +; SEI +; ADC A,B +; STS AVEVEEL,A +; LDS A,AVEVEEH +; LDI B,0 +; ADC A,B +; STS AVEVEEH,A +; +; POP B +; +; LDS A,AVECNT +; INC A +; STS AVECNT,A +; BRNE NICK_REPORT_DONE +; +; LDS A,AVEVCCL +; RCALL TX_WAIT +; LDS A,AVEVCCH +; RCALL TX_WAIT +; LDS A,AVEVEEL +; RCALL TX_WAIT +; LDS A,AVEVEEH +; RCALL TX_WAIT +; LDI A,$0D +; RCALL TX_WAIT +; +; CLR A +; STS AVEVCC,A +; STS AVEVCCL,A +; STS AVEVCCH,A +; STS AVEVEE,A +; STS AVEVEEL,A +; STS AVEVEEH,A +;NICK_REPORT_DONE: +; RET + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 1 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + +; SBRC FLAGS,7 +; RCALL NICK_REPORT + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + SEI + CLR F + STS TEMP,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + RCALL LPMS + MOV X_SIZE,R0 + MOV A,YL + MOV B,YH + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP PROP_WIDTH + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS + RJMP PROP_MODE + +PROP_WIDTH: + RCALL LPMS + SBRC FLAGS,4 + RJMP PROP_MODE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS + SUB R0,W + BRSH NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + MOV XPIXEL,CURSORX + ADD XPIXEL,R0 + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RCALL LPMS +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE + MOV F,CURSORX + ADD F,R0 + BRLO CR_LF + RJMP OK_LINE + +CR_LF: PUSH A + PUSH B + RCALL CARRIAGE_RET + RCALL LINE_FEED + LDS F,TEMP + ADD CURSORX,F + MOV LINE_CNT,CURSORY + MOV XPIXEL,CURSORX + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS F,TEMP + SUB CURSORX,F + LDS A,PTR+2 + RCALL SELECT_XPAGE + POP B + POP A +OK_LINE: + ADD CURSORX,R0 + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE + MOV YL,A + MOV YH,B + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 +Y_OFFSET_DONE: + MOV YL,A + MOV YH,B + ADIW YL,$01 + RCALL LPMS + MOV Y_SIZE,R0 + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS WHY ?? + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + LDI XL,LOW(ROWBUF) + LDI XH,HIGH(ROWBUF) ; X -> SINGLE LINE BUFFER IN AVR SRAM + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y -> SINGLE LINE FROM DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + LDI B,30 ; BYTES TO COPY +DO_MORE: + A0_A13 YL,YH + RAMRD A + ST X+,A + INC YL + DEC B + RJNE DO_MORE ;BRNE DO_MORE + + POP XH + POP XL + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> SINGLE LINE IN T6963C BUFFER + + CBI PORTD,7 ; CS0 = 0 + MOV F,YL + RCALL WRITE_DATA + MOV F,YH + RCALL WRITE_DATA + LDI F,$24 + RCALL WRITE_COMMAND ; SET ADDRESS POINTER + LDI F,$B0 + RCALL WRITE_COMMAND ; SET DATA AUTO WRITE + LDI B,30 + LDI YL,LOW(ROWBUF) + LDI YH,HIGH(ROWBUF) ; Y -> SINGLE LINE BUFFER IN AVR SRAM +NICK_SUB2_LOOP: + LD F,Y+ + RCALL WRITE_DATA_AUTO ; FILL DISPLAY RAM + DEC B + BRNE NICK_SUB2_LOOP + LDI F,$B2 + RCALL WRITE_COMMAND_AUTO ; AUTO RESET + SBI PORTD,7 ; CS0 = 1 + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE +L0659: CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L0659 +; BRNE L0659 + CLR CURSORX ; HOME CURSOR + CLR CURSORY + RET + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +EXT_INT0: + IN SR,SREG ; MEASURE VCC + SBI DDRD,2 + IN C,TCNT1L + IN D,TCNT1H + STS VCCH,D + STS VCCL,C + RJMP END_EXT_INT + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP END_EXT_INT + +TIM1_OVF: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +; SBI DDRB,7 +; IN D,PORTB +; SUBI D,$80 +; OUT PORTB,D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + SBRS FLAGS,7 + RJMP BACKLIGHT_SKIP + LDS D,BACKLIGHT_COUNT + INC D +; LDS C,CONTRASTL +; LSL C +; CP D,C + CPI D,37 ;62 ;64 ; 64 COUNTS = 150 HZ + BRSH BACKLIGHT_EVEN +; LSR C +; CP D,C + CPI D,18 ;31 ;32 + BRNE BACKLIGHT_SAVE +;BACKLIGHT_ODD: + CBI PORTC,7 + SBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 + RJMP BACKLIGHT_CONT +BACKLIGHT_EVEN: + SBI PORTC,7 + CBI PORTB,4 ; PROVIDE COMPLEMENTARY INPUTS TO AC573 +; LDI D,1<<7 +; OR FLAGS,D ; FOR NICK_REPORT + LDI D,0 +BACKLIGHT_CONT: + LDS C,LATCH11_SAV + OUT PORTA,C ; JUST TO AVOID CLOBBERING HC573 + SBI PORTB,3 + CBI PORTB,3 ; PROVIDE LATCH PULSE, HC573 AND AC573 +BACKLIGHT_SAVE: + STS BACKLIGHT_COUNT,D +BACKLIGHT_SKIP: + + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + +; SBRC FLAGS,6 ; TURNOFF REQUESTED? +; RJMP SLEEP_ENTRY ; YES, SKIP CLOCKING AND SHUT DOWN + + LDS D,BREAK_COUNT+1 ; WORD IS STORED IN REVERSE ORDER + SUBI D,-$40 + STS BREAK_COUNT+1,D ; START OF 4 INTERRUPT BLOCK? + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + RJMP SLEEP_ENTRY +BREAK_CONT: + + LDI D,$B0 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, CLR OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + SBI DDRD,2 ; PRECHARGE VCC AND + SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + +; 10mar03 for better API bus performance (let the chips fall where they may) +; ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN +; ; REMAIN THE SAME ALTHOUGH THERE IS NOW NO CLOCKING PERIOD +; LDI D,$0B+$AB ; WAIT FOR 3uSEC +;SETTLE_CL2: +; DEC D +; BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + +; LDS C,VCCL +; LDS D,VCCH +; LDI E,LOW(VCC_NOMINAL) +; SUB C,E +; LDI E,HIGH(VCC_NOMINAL) +; SBC D,E +; +; ROR D +; ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +;; PUSH D +;; PUSH C +; ASR D +; ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +;; POP E +;; ADD C,E +;; POP E +;; ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 +; +;; CLR D +;; CLR C +; +; LDS E,VEEL +; ADD C,E +; LDS E,VEEH +; ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + ; ULTRA BODGY EXTRA DELAY SO THAT VCC COMPENSATION CAN + ; REMAIN THE SAME ALTHOUGH WE ARE NO LONGER SETTING TIMER 0 + NOP + NOP + NOP + NOP + NOP + NOP + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,2 ; START VCC AND + CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + +;END_INT: + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +END_EXT_INT: + OUT SREG,SR + RETI + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP L0659 + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_XPAGE: + A14_A18 A + RET + +; ----------------------------------------------------------------------------- + +CHSET00: +.INCLUDE "CHSET00.INC" +CHSET00_END: + +; ----------------------------------------------------------------------------- + +GET_CLEAR_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL CLEAR_FRAME_RECT + RJMP MAIN_LOOP + +GET_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FRAME_RECT + RJMP MAIN_LOOP + +GET_CLEAR_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL CLEAR_HALFTONE_RECT + RJMP MAIN_LOOP + +GET_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL HALFTONE_RECT + RJMP MAIN_LOOP + +NO_GOX: RET + +CLEAR_FRAME_RECT: + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS F,RECTNC_YY + STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +FRAME_RECT: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GOX + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GOX + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CLEAR_HALFTONE_RECT: +; LDS F,RECTNC_X +; STS RECT_X,F +; LDS F,RECTNC_Y +; STS RECT_Y,F +; LDS F,RECTNC_XX +; STS RECT_XX,F +; LDS F,RECTNC_YY +; STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +HALFTONE_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LDI A,$55 + SBRS YH,0 + LDI A,$AA + MOV PATTERN,A + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP X03A3 +X039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +X03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ X03B0 + LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + TST XPIXEL + BREQ X03B0 +X03AD: LSR A + DEC XPIXEL + BRNE X03AD +X03B0: AND A,PATTERN + RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +X03B8: LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + BREQ X03D2 + AND A,PATTERN + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP X03B8 +X03C2: TST X_SIZE + BREQ X03D3 +X03C4: LSR A + DEC X_SIZE + BRNE X03C4 + COM A + TST XPIXEL + BREQ X03D2 + CLR B +X03CB: LSR A + ROR B + DEC XPIXEL + BRNE X03CB + AND A,PATTERN + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +X03D2: AND A,PATTERN + RCALL WR_DISP_MEM +X03D3: COM PATTERN + RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP X039A + RET + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4103 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/dos.asm b/src/avr/dos.asm new file mode 100644 index 00000000..9c0d0ca1 --- /dev/null +++ b/src/avr/dos.asm @@ -0,0 +1,366 @@ +; DOS.ASM + +; ----------------------------------------------------------------------------- + +EXTRN GETSTRLOC:FAR +EXTRN GETSTRALLOC:FAR +EXTRN RLSSTRALLOC:FAR + +EXTRN DOS_READY:WORD +EXTRN DOS_ERROR:WORD +EXTRN DOS_COUNT:WORD + +CODE SEGMENT + + ASSUME CS:CODE,DS:CODE + +B EQU BYTE PTR +W EQU WORD PTR +D EQU DWORD PTR + + JUMPS + LOCALS + +; ----------------------------------------------------------------------------- + +PUBLIC DOS_PRINT + +DOS_PRINT: ; DOS_DATA$ + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+6] ; DOS_DATA$ + CALL STRING_PTR_DS_DX ; DS:DX -> CX BYTE STRING + + MOV AH,40H + MOV BX,1 ; STDOUT + INT 21H + + CALL DOS_DONE ; SET UP COUNT/ERROR/READY + + POP DI + POP SI + POP DS + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + + PUBLIC DOS_PRINT_LINE + +DOS_PRINT_LINE: ; DOS_DATA$ + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+6] ; DOS_DATA$ + CALL STRING_PTR_DS_SI + PUSH DS + PUSH SI + PUSH CX + + PUSH CS + POP DS + MOV SI,OFFSET DOS_BUF + MOV AX,CX + ADD AX,2 + PUSH AX + CALL STRING_ALLOC ; ALLOCATE LEN(DOS_DATA$)+2 BYTES + + CALL STRING_PTR_ES_DI + POP AX + MOV DX,DI + MOV BX,ES + + POP CX + POP SI + POP DS + REP MOVSB ; COPY USER STRING TO TEMPORARY BUFFER + + MOV DS,BX ; DS:DX -> TEMPORARY BUFFER + XCHG CX,AX + + MOV AX,0A0DH + STOSW ; ADD CR/LF + + MOV AH,40H + MOV BX,1 ; STDOUT + INT 21H + + CALL DOS_DONE ; SET UP COUNT/ERROR/READY + + PUSH CS + POP DS + MOV SI,OFFSET DOS_BUF + CALL STRING_FREE + + POP DI + POP SI + POP DS + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + + PUBLIC DOS_GET_DATE ; YEAR%, MONTH%, DAY% + +DOS_GET_DATE: + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,2AH + INT 21H ; GET DATE + + LES DI,[BP+14] ; YEAR% + XCHG AX,CX + STOSW + + LES DI,[BP+10] ; MONTH% + MOV AL,DH + SUB AH,AH + STOSW + + LES DI,[BP+6] ; DAY% + MOV AL,DL + STOSW + + CALL DOS_OK ; SET DOS_COUNT% DOS_READY% DOS_ERROR% + + POP DI + POP SI + POP DS + POP BP + RETF 12 + +; ----------------------------------------------------------------------------- + + PUBLIC DOS_GET_TIME ; HOUR%, MINUTE%, SECOND%, HSEC% + +DOS_GET_TIME: + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,2CH + INT 21H ; GET TIME + + LES DI,[BP+18] ; HOUR% + MOV AL,CH + SUB AH,AH + STOSW + + LES DI,[BP+14] ; MINUTE% + MOV AL,CL + STOSW + + LES DI,[BP+10] ; SECOND% + MOV AL,DH + STOSW + + LES DI,[BP+6] ; HSEC% + MOV AL,DL + STOSW + + CALL DOS_OK ; SET DOS_COUNT% DOS_READY% DOS_ERROR% + + POP DI + POP SI + POP DS + POP BP + RETF 16 + +; ----------------------------------------------------------------------------- + + PUBLIC BIOS_KEY + +BIOS_KEY: ; K% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + PUSH [BP+8] + PUSH [BP+6] + PUSH CS + CALL BIOS_KEY_TEST ; BIOS_KEY_TEST K% + + LDS SI,[BP+6] + CMP W [SI],0 + JZ @@DONE ; IF K% THEN + + PUSH [BP+8] + PUSH [BP+6] + PUSH CS + CALL BIOS_KEY_WAIT ; BIOS_KEY_WAIT K% + +@@DONE: POP DI + POP SI + POP DS + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + + PUBLIC BIOS_KEY_TEST + +BIOS_KEY_TEST: ; K% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LES DI,[BP+6] + SUB AX,AX + STOSW ; K% = 0 + + SUB AX,AX + MOV DS,AX + MOV AX,DS:[41AH] + CMP AX,DS:[41CH] + JZ @@DONE ; DON'T GIVE UP A TIME SLICE + + MOV AH,1 + INT 16H ; TEST FOR KEY + JZ @@DONE + + LES DI,[BP+6] + TEST AL,AL + JZ @@EXTD + SUB AH,AH +@@EXTD: STOSW ; K% = RETURNED AX + +@@DONE: POP DI + POP SI + POP DS + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + + PUBLIC BIOS_KEY_WAIT + +BIOS_KEY_WAIT: ; K% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + SUB AH,AH + INT 16H ; WAIT FOR KEY + + LES DI,[BP+6] + TEST AL,AL + JZ @@EXTD + SUB AH,AH +@@EXTD: STOSW ; K% = RETURNED AX + + POP DI + POP SI + POP DS + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + +DOS_DONE: + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [DOS_COUNT],AX + MOV W [DOS_ERROR],0 + MOV W [DOS_READY],-1 + RET + +@@BAD: MOV W [DOS_COUNT],0 + MOV W [DOS_ERROR],AX + MOV W [DOS_READY],0 + RET + +; ----------------------------------------------------------------------------- + +DOS_OK: + MOV SI,DATA + MOV DS,SI + + MOV W [DOS_COUNT],0 + MOV W [DOS_ERROR],0 + MOV W [DOS_READY],-1 + RET + +; ----------------------------------------------------------------------------- + +STRING_PTR_DS_DX: + PUSH [SI] + CALL GETSTRLOC + + MOV DS,DX + XCHG DX,AX ; DS:DX -> CX BYTE STRING + RET + +STRING_PTR_DS_SI: + PUSH [SI] + CALL GETSTRLOC + + MOV DS,DX + XCHG SI,AX ; DS:SI -> CX BYTE STRING + RET + +STRING_PTR_ES_DI: + PUSH [SI] + CALL GETSTRLOC + + MOV ES,DX + XCHG DI,AX ; ES:DI -> CX BYTE STRING + RET + +STRING_FREE: + CMP W [SI],0 + JZ @@RET + + PUSH [SI] + MOV W [SI],0 + CALL RLSSTRALLOC +@@RET: RET + +STRING_ALLOC: + PUSH DS + PUSH SI + + PUSH AX + CALL GETSTRALLOC + + POP SI + POP DS + MOV [SI],AX + RET + +; ----------------------------------------------------------------------------- + +DOS_BUF DW 0 + +; ----------------------------------------------------------------------------- + +CODE ENDS + +; ----------------------------------------------------------------------------- + +DATA SEGMENT +DATA ENDS + +; ----------------------------------------------------------------------------- + + END diff --git a/src/avr/dos.inc b/src/avr/dos.inc new file mode 100644 index 00000000..081aa3a9 --- /dev/null +++ b/src/avr/dos.inc @@ -0,0 +1,20 @@ +' DOS.INC + +' ----------------------------------------------------------------------------- + +$LINK "DOS.OBJ" + +PUBLIC DOS_READY% +PUBLIC DOS_COUNT% +PUBLIC DOS_ERROR% + +DECLARE SUB DOS_PRINT(STRING) +DECLARE SUB DOS_PRINT_LINE(STRING) +DECLARE SUB DOS_GET_TIME(INTEGER,INTEGER,INTEGER,INTEGER) +DECLARE SUB DOS_GET_DATE(INTEGER,INTEGER,INTEGER) +DECLARE SUB BIOS_KEY(INTEGER) +DECLARE SUB BIOS_KEY_TEST(INTEGER) +DECLARE SUB BIOS_KEY_WAIT(INTEGER) + +' ----------------------------------------------------------------------------- + diff --git a/src/avr/file.asm b/src/avr/file.asm new file mode 100644 index 00000000..f1bdf71c --- /dev/null +++ b/src/avr/file.asm @@ -0,0 +1,3040 @@ +; FILE.ASM + +; ----------------------------------------------------------------------------- + +EXTRN GETSTRLOC:FAR +EXTRN GETSTRALLOC:FAR +EXTRN RLSSTRALLOC:FAR + +EXTRN FILE_ERROR:WORD +EXTRN FILE_COUNT:WORD +EXTRN FILE_POINTER:DWORD +EXTRN FILE_DRIVES:WORD + +EXTRN FILE_BOMB_OUT:FAR + +CODE SEGMENT + + ASSUME CS:CODE,DS:CODE + +B EQU BYTE PTR +W EQU WORD PTR +D EQU DWORD PTR + + JUMPS + LOCALS + +BLOCK_SIZE EQU 400H ;1000H +LINE_SIZE EQU 400H ;1000H + +; HANDLE_STRING ENTRIES: + +BUF_FLAG EQU 0 +BUF_STRING EQU 2 +BUF_OFFSET EQU 4 +BUF_COUNT EQU 6 +BUF_SIZE EQU 8 + +BUF_FLAG_READ EQU 1 +BUF_FLAG_WRITE EQU 2 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_OPEN + +FILE_OPEN: ; HANDLE%, FILE_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AX,3D02H ; TRY TO OPEN FOR READ/WRITE + MOV DX,OFFSET BUF_NAME + INT 21H + JNC @@OK + + MOV AX,3D00H ; TRY TO OPEN FOR READ + MOV DX,OFFSET BUF_NAME + INT 21H + +@@OK: MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LES DI,[BP+14] ; HANDLE% + STOSW + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_CREATE + +FILE_CREATE: ; HANDLE%, FILE_NAME$, ATTR%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + LDS SI,[BP+10] ; ATTR% + MOV CX,[SI] + + PUSH CS + POP DS + + MOV AH,3CH + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LES DI,[BP+18] ; HANDLE% + STOSW + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_CLOSE + +FILE_CLOSE: ; HANDLE%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + + SUB AX,AX ; 0 = NO BUFFER WANTED + CALL BUF_SETUP ; SET BUFFER DIRECTION OR KILL + CALL BUF_FREE ; FREE UP BUFFER STRING + + LDS SI,[BP+10] ; HANDLE% + MOV BX,[SI] + + MOV AH,3EH + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_READ + +FILE_READ: ; HANDLE%, FILE_DATA$, COUNT%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; COUNT% + CALL USER_ALLOC ; ALLOCATE USER BUFFER + MOV SI,OFFSET USER_STRING + CALL STRING_PTR_DS_DX ; DS:DX -> USER BUFFER + + LES DI,[BP+18] ; HANDLE% + MOV BX,ES:[DI] + LES DI,[BP+10] ; COUNT% + MOV CX,ES:[DI] + + MOV AH,3FH + INT 21H + + LES DI,[BP+14] ; FILE_DATA$ + LDS SI,[BP+10] ; COUNT% + MOV BX,AX ; BYTES TRANSFERRED + CALL READ_DONE ; RETURN USER BUFFER IN FILE_DATA$ + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_READ_BUF + +FILE_READ_BUF: ; HANDLE%, FILE_DATA$, COUNT%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; COUNT% + CALL USER_ALLOC ; ALLOCATE BUFFER, SET UP USER_PTR + + LDS SI,[BP+18] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + CALL HANDLE_ALLOC ; ENSURE WE HAVE A HANDLE_STRING ENTRY + + MOV AX,BUF_FLAG_READ ; 1 = DIRECTION + CALL BUF_SETUP ; SET BUFFER DIRECTION + CALL BUF_ALLOC ; ENSURE WE HAVE A BUF_STRING ENTRY + + MOV AX,ES:[DI+BUF_OFFSET] + CMP AX,ES:[DI+BUF_COUNT] + JAE @@MORE + +@@LOOP: CALL READ_COPY ; COPY OUT TO USER BUFFER + MOV AX,[USER_OFFSET] + CMP AX,[USER_COUNT] + JAE @@DONE ; NC, GOT ENOUGH + +@@MORE: CALL READ_MORE ; GET MORE INTO READ BUFFER + JC @@DONE + TEST AX,AX + JNZ @@LOOP + +@@DONE: MOV AX,[USER_OFFSET] ; CF = ERROR STATUS FROM READ + ; AX/CF NOW SET UP AS FOR RETURN FROM INT 21H + + LES DI,[BP+14] ; FILE_DATA$ + LDS SI,[BP+10] ; COUNT% + MOV BX,AX ; BYTES TRANSFERRED + CALL READ_DONE ; RETURN USER BUFFER IN FILE_DATA$ + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_READ_LINE + +FILE_READ_LINE: ; HANDLE%, FILE_DATA$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + PUSH CS + POP DS + MOV SI,OFFSET READ_LINE_MAX ; COUNT% + CALL USER_ALLOC ; ALLOCATE BUFFER, SET UP USER_PTR + + MOV W [READ_LINE_CR],0 + MOV W [READ_SKIP_COUNT],0 + + LDS SI,[BP+14] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + CALL HANDLE_ALLOC ; ENSURE WE HAVE A HANDLE_STRING ENTRY + + MOV AX,BUF_FLAG_READ ; 1 = DIRECTION + CALL BUF_SETUP ; SET BUFFER DIRECTION + CALL BUF_ALLOC ; ENSURE WE HAVE A BUF_STRING ENTRY + + MOV AX,ES:[DI+BUF_OFFSET] + CMP AX,ES:[DI+BUF_COUNT] + JAE @@MORE + +@@LOOP: CALL READ_SCAN ; CHECK READ BUFFER FOR CR + CALL READ_COPY ; COPY OUT TO USER BUFFER + MOV AX,[USER_OFFSET] + CMP AX,[USER_COUNT] + JAE @@SKIP ; GOT ENOUGH, SKIP TO CR/LF + +@@MORE: CALL READ_MORE ; GET MORE INTO READ BUFFER + JC @@DONE + TEST AX,AX + JZ @@DONE ; NC, DON'T WORRY ABOUT CR/LF IF EOF + JMP @@LOOP + +@@SKIP: CALL READ_SKIP ; SCAN READ BUFFER FOR CR/LF AND SKIP + CMP W [READ_LINE_CR],2 + JAE @@DONE + + CALL READ_MORE ; GET MORE INTO READ BUFFER + JC @@DONE + TEST AX,AX + JNZ @@SKIP + +@@DONE: MOV AX,[USER_OFFSET] ; CF = ERROR STATUS FROM READ + ; AX/CF NOW SET UP AS FOR RETURN FROM INT 21H + + PUSHF + MOV BX,AX ; BYTES TRANSFERRED + ADD BX,[READ_SKIP_COUNT] ; INCLUDING CR/LF + POPF + + LES DI,[BP+10] ; FILE_DATA$ + PUSH CS + POP DS + MOV SI,OFFSET READ_LINE_MAX ; COUNT% + CALL READ_DONE ; RETURN USER BUFFER IN FILE_DATA$ + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_READ_DIRECT + +FILE_READ_DIRECT: ; HANDLE%, POINTER, COUNT%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+18] ; HANDLE% + MOV BX,[SI] + LDS SI,[BP+10] ; COUNT% + MOV CX,[SI] + LDS SI,[BP+14] ; POINTER + LDS DX,[SI] + + MOV AH,3FH + INT 21H + + CALL WRITE_DONE ; SET UP READY% FILE_COUNT% FILE_ERROR% + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_WRITE + +FILE_WRITE: ; HANDLE%, FILE_DATA$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; FILE_DATA$ + CALL STRING_PTR_DS_DX ; DS:DX -> CX BYTE STRING + + LES DI,[BP+14] ; HANDLE% + MOV BX,ES:[DI] + + MOV AH,40H + INT 21H + + CALL WRITE_DONE ; SET UP READY% FILE_COUNT% FILE_ERROR% + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_WRITE_BUF + +FILE_WRITE_BUF: ; HANDLE%, FILE_DATA$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; FILE_DATA$ + CALL USER_PTR_SETUP ; USER_PTR, USER COUNT, USER OFFSET + + LDS SI,[BP+14] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + CALL HANDLE_ALLOC ; ENSURE WE HAVE A HANDLE_STRING ENTRY + + MOV AX,BUF_FLAG_WRITE ; 2 = DIRECTION + CALL BUF_SETUP ; SET BUFFER DIRECTION + CALL BUF_ALLOC ; ENSURE WE HAVE A BUF_STRING ENTRY + + MOV AX,ES:[DI+BUF_OFFSET] + CMP AX,BLOCK_SIZE + JAE @@FLSH + +@@LOOP: CALL WRITE_COPY ; COPY OUT TO WRITE BUFFER + MOV AX,[USER_OFFSET] + CMP AX,[USER_COUNT] + JAE @@DONE ; NC, WRITTEN ENOUGH + +@@FLSH: CALL WRITE_FLUSH ; FREE UP WRITE BUFFER + JC @@DONE + TEST AX,AX + JNZ @@LOOP + +@@DONE: MOV AX,[USER_OFFSET] ; CF = ERROR STATUS FROM WRITE + ; AX/CF NOW SET UP AS FOR RETURN FROM INT 21H + + CALL WRITE_DONE ; SET UP READY% FILE_COUNT% FILE_ERROR% + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_WRITE_LINE + +FILE_WRITE_LINE: ; HANDLE%, FILE_DATA$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + PUSH [BP+16] + PUSH [BP+14] ; HANDLE% + PUSH [BP+12] + PUSH [BP+10] ; FILE_DATA$ + PUSH [BP+8] + PUSH [BP+6] ; READY% + PUSH CS + CALL FILE_WRITE_BUF + + LDS SI,[BP+6] ; READY% + CMP W [SI],0 + JZ @@RET + + MOV SI,DATA + MOV DS,SI + PUSH [FILE_COUNT] + + PUSH CS + POP DS + + MOV AX,2 + MOV SI,OFFSET CRLF_STRING + CALL STRING_ALLOC + CALL STRING_PTR_ES_DI + + MOV AX,0A0DH + STOSW + + PUSH [BP+16] + PUSH [BP+14] ; HANDLE% + MOV DI,OFFSET CRLF_STRING + PUSH CS + PUSH DI ; CHR$(&HD,&HA) + PUSH [BP+8] + PUSH [BP+6] ; READY% + PUSH CS + CALL FILE_WRITE_BUF + + MOV SI,OFFSET CRLF_STRING + CALL STRING_FREE + + MOV SI,DATA + MOV DS,SI + + POP AX + ADD [FILE_COUNT],AX + + PUSH CS + POP DS + + MOV AX,[CURRENT_PSP] + TEST AX,AX + JNZ @@NPSP + + MOV AH,51H + INT 21H + XCHG AX,BX + MOV [CURRENT_PSP],AX + +@@NPSP: LDS SI,[BP+14] ; HANDLE% + MOV BX,[SI] + + MOV DS,AX + LDS SI,D DS:[34H] ; HANDLE TABLE + CMP B DS:[BX+SI],1 ; DOES HANDLE BX REFER TO CON? + JNZ @@RET + + PUSH [BP+16] + PUSH [BP+14] ; HANDLE% + PUSH [BP+8] + PUSH [BP+6] ; READY% + PUSH CS + CALL FILE_FLUSH ; ENSURE IMMEDIATE DISPLAY + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_WRITE_DIRECT + +FILE_WRITE_DIRECT: ; HANDLE%, POINTER, COUNT%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+18] ; HANDLE% + MOV BX,[SI] + LDS SI,[BP+10] ; COUNT% + MOV CX,[SI] + LDS SI,[BP+14] ; POINTER + LDS DX,[SI] + + MOV AH,40H + INT 21H + + CALL WRITE_DONE ; SET UP READY% FILE_COUNT% FILE_ERROR% + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SEEK +PUBLIC FILE_SEEK_REL +PUBLIC FILE_SEEK_END + +FILE_SEEK_END: ; HANDLE%, POINTER&, READY% +; CALL TEST_HANDLE_STRING + MOV AL,2 + JMP FILE_SEEK_ENTRY + +FILE_SEEK_REL: ; HANDLE%, POINTER&, READY% +; CALL TEST_HANDLE_STRING + MOV AL,1 + JMP FILE_SEEK_ENTRY + +FILE_SEEK: ; HANDLE%, POINTER&, READY% +; CALL TEST_HANDLE_STRING + SUB AL,AL + ;JMP FILE_SEEK_ENTRY + +FILE_SEEK_ENTRY: + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + PUSH AX + LDS SI,[BP+14] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + + SUB AX,AX ; 0 = NO BUFFER WANTED + CALL BUF_SETUP ; SET BUFFER DIRECTION OR KILL + POP AX + + LDS SI,[BP+10] ; POINTER& + MOV DX,[SI] + MOV CX,[SI+2] + + LDS SI,[BP+14] ; HANDLE% + MOV BX,[SI] + + MOV AH,42H + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_POINTER],AX + MOV W [FILE_POINTER+2],DX + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SEEK_GET + +FILE_SEEK_GET: ; HANDLE%, POINTER&, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + + CALL BUF_ADJUST ; SET UP FILE_PTR_ADJUST USING AX + + SUB CX,CX + SUB DX,DX + + LDS SI,[BP+14] ; HANDLE% + MOV BX,[SI] + + MOV AX,4201H + INT 21H ; SEEK RELATIVE BY 0 BYTES + JC @@BAD + + PUSH CS + POP DS + ADD AX,[FILE_PTR_ADJUST] + ADC DX,[FILE_PTR_ADJUST+2] + + LDS SI,[BP+10] + MOV [SI],AX + MOV [SI+2],DX + + MOV SI,DATA + MOV DS,SI + + MOV W [FILE_POINTER],AX + MOV W [FILE_POINTER+2],DX + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV SI,DATA + MOV DS,SI + + MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_PRINT + +FILE_PRINT: ; FILE_DATA$ +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV DI,OFFSET PRINT_HANDLE + PUSH CS + PUSH DI + LDS SI,[BP+6] ; FILE_DATA$ + PUSH DS + PUSH SI + MOV DI,OFFSET PRINT_READY + PUSH CS + PUSH DI + PUSH CS + CALL FILE_WRITE_LINE + +IF 0 + MOV DI,OFFSET PRINT_HANDLE + PUSH CS + PUSH DI + MOV DI,OFFSET PRINT_READY + PUSH CS + PUSH DI + PUSH CS + CALL FILE_FLUSH +ENDIF + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 4 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_FLUSH + +FILE_FLUSH: ; HANDLE%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; HANDLE% + CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + + SUB AX,AX ; 0 = NO BUFFER WANTED + CALL BUF_SETUP ; SET BUFFER DIRECTION OR KILL + + CALL WRITE_DONE ; SET UP READY% FILE_COUNT% FILE_ERROR% + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +FILE_DUPLICATE_HANDLE: ; HANDLE%, HANDLE_NEW%, READY% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; HANDLE% + MOV BX,[SI] + + MOV AH,45H + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LES DI,[BP+10] ; HANDLE_NEW% + STOSW + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +FILE_REDIRECT_HANDLE: ; HANDLE%, HANDLE_NEW%, READY% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; HANDLE% + MOV BX,[SI] + + LDS SI,[BP+10] ; HANDLE% + MOV CX,[SI] + + MOV AH,46H + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_GET_DATE_TIME + +FILE_GET_DATE_TIME: ; HANDLE%, DOS_DATE%, DOS_TIME%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+18] ; HANDLE% + MOV BX,[SI] + + MOV AX,5700H + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LDS SI,[BP+14] ; DOS_DATE% + MOV [SI],DX + + LDS SI,[BP+10] ; DOS_TIME% + MOV [SI],CX + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SET_DATE_TIME + +FILE_SET_DATE_TIME: ; HANDLE%, DOS_DATE%, DOS_TIME%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+18] ; HANDLE% + MOV BX,[SI] + + LDS SI,[BP+14] ; DOS_DATE% + MOV DX,[SI] + + LDS SI,[BP+10] ; DOS_TIME% + MOV CX,[SI] + + MOV AX,5701H + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_GET_ATTRIBUTES + +FILE_GET_ATTRIBUTES: ; FILE_NAME$, ATTR%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AX,4300H + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LDS SI,[BP+10] ; ATTR% + MOV [SI],CX + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SET_ATTRIBUTES + +FILE_SET_ATTRIBUTES: ; FILE_NAME$, ATTR%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + LDS SI,[BP+10] ; ATTR% + MOV CX,[SI] + + PUSH CS + POP DS + + MOV AX,4301H + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_RENAME + +FILE_RENAME: ; FILE_NAME$, FILE_NEW$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + LDS SI,[BP+10] ; FILE_NEW$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NEW + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NEW + + PUSH CS + POP DS + PUSH CS + POP ES + + MOV AH,56H + MOV DX,OFFSET BUF_NAME + MOV DI,OFFSET BUF_NEW + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_DELETE + +FILE_DELETE: ; FILE_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AH,41H + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- +; CALL FILE_SEARCH_FIRST(FILE_MASK$,ATTR%,DTA$,READY%) + +PUBLIC FILE_SEARCH_FIRST + +FILE_SEARCH_FIRST: +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,2FH + INT 21H + PUSH ES + PUSH BX ; SAVE DTA + + PUSH CS + POP DS + + MOV AH,1AH + MOV DX,OFFSET BUF_DTA + INT 21H ; SET DTA + + LDS SI,[BP+18] ; FILE_MASK$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + LDS SI,[BP+14] ; ATTR% + MOV CX,[SI] + + PUSH CS + POP DS + + MOV AH,4EH + MOV DX,OFFSET BUF_NAME + INT 21H ; SEARCH FIRST + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + PUSH CS + POP ES + MOV DI,OFFSET BUF_DTA+1EH + SUB AL,AL + MOV CX,13 ;11 + REPNZ SCASB + MOV AX,1EH+12 ;10 + SUB AX,CX ; AX = LENGTH OF RETURNED DTA + + LDS SI,[BP+10] ; DTA$ + CALL STRING_REALLOC + CALL STRING_PTR_ES_DI ; ES:DI -> NEW CX BYTE STRING + + PUSH CS + POP DS + MOV SI,OFFSET BUF_DTA + REP MOVSB + JMP @@RET + +@@BAD: MOV [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DX + POP DS + MOV AH,1AH + INT 21H ; RESTORE DTA + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 16 + +; ----------------------------------------------------------------------------- +; CALL FILE_SEARCH_NEXT(DTA$,READY%) + +PUBLIC FILE_SEARCH_NEXT + +FILE_SEARCH_NEXT: +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,2FH + INT 21H + PUSH ES + PUSH BX ; SAVE DTA + + PUSH CS + POP DS + + MOV AH,1AH + MOV DX,OFFSET BUF_DTA + INT 21H ; SET DTA + + LDS SI,[BP+10] ; DTA$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_DTA + MOV AX,1EH+11 + CALL STRING_COPY ; COPY STRING TO DTA AREA + + MOV AH,4FH + INT 21H ; SEARCH NEXT + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + PUSH CS + POP ES + MOV DI,OFFSET BUF_DTA+1EH + SUB AL,AL + MOV CX,13 ;11 + REPNZ SCASB + MOV AX,1EH+12 ;10 + SUB AX,CX ; AX = LENGTH OF RETURNED DTA + + LDS SI,[BP+10] ; DTA$ + CALL STRING_REALLOC + CALL STRING_PTR_ES_DI ; ES:DI -> NEW CX BYTE STRING + + PUSH CS + POP DS + MOV SI,OFFSET BUF_DTA + REP MOVSB + JMP @@RET + +@@BAD: MOV [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DX + POP DS + MOV AH,1AH + INT 21H ; RESTORE DTA + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_CREATE_DIRECTORY + +FILE_CREATE_DIRECTORY: ; DIRECTORY_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; DIRECTORY_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AH,39H + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_DELETE_DIRECTORY + +FILE_DELETE_DIRECTORY: ; DIRECTORY_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; DIRECTORY_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AH,3AH + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_GET_DIRECTORY + +FILE_GET_DIRECTORY: ; DRIVE%, DIRECTORY_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; DRIVE% + MOV DL,[SI] + + PUSH CS + POP DS + + MOV AH,47H + MOV SI,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + SUB AL,AL + MOV CX,128 + REPNZ SCASB + MOV AX,127 + SUB AX,CX ; AX = LENGTH OF RETURNED STRING + + LDS SI,[BP+10] ; FILE_DATA$ + CALL STRING_REALLOC + CALL STRING_PTR_ES_DI + + PUSH CS + POP DS + MOV SI,OFFSET BUF_NAME + REP MOVSB ; COPY STRING TO USER + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SET_DIRECTORY + +FILE_SET_DIRECTORY: ; DIRECTORY_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; DIRECTORY_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + PUSH CS + POP DS + + MOV AH,3BH + MOV DX,OFFSET BUF_NAME + INT 21H + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_GET_DRIVE + +FILE_GET_DRIVE: ; DRIVE%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,19H + INT 21H + + LES DI,[BP+10] ; DRIVE% + SUB AH,AH + STOSW + + MOV SI,DATA + MOV DS,SI + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SET_DRIVE + +FILE_SET_DRIVE: ; DRIVE%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+10] ; DRIVE% + MOV DL,[SI] + + MOV AH,0EH + INT 21H + + PUSH CS + POP DS + SUB AH,AH + MOV [FILE_DRIVES],AX + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_GET_DRIVE_INFO + +FILE_GET_DRIVE_INFO: ; DRIVE%, BYTES_SECTOR%, +; CALL TEST_HANDLE_STRING + ; SECTORS_CLUSTER%, AVAIL_CLUSTERS%, + ; TOTAL_CLUSTERS%, READY% + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+26] ; DRIVE% + MOV DL,[SI] + + MOV AH,36H + INT 21H + + MOV SI,DATA + MOV DS,SI + CMP AX,-1 + JZ @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + LDS SI,[BP+22] ; BYTES_SECTOR% + MOV [SI],CX + + LES DI,[BP+18] ; SECTORS_CLUSTER% + STOSW + + LDS SI,[BP+14] ; AVAIL_CLUSTERS% + MOV [SI],BX + + LDS SI,[BP+10] ; TOTAL_CLUSTERS% + MOV [SI],DX + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 24 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_COPY + +FILE_COPY: ; FILE_NAME$, FILE_NEW$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + + PUSH CS + POP DS + MOV W [TEMP_STRING],0 + + MOV DI,OFFSET TEMP_SOURCE ; HANDLE + PUSH CS + PUSH DI + LES DI,[BP+14] ; FILE_NAME$ + PUSH ES + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_OPEN ; OPEN SOURCE FILE + CMP W [TEMP_READY],0 + JZ @@BAD2 + + ; SHOULD GET FILE SIZE AND CHECK DISK SPACE + + MOV DI,OFFSET TEMP_DEST ; HANDLE + PUSH CS + PUSH DI + LES DI,[BP+10] ; FILE_NEW$ + PUSH ES + PUSH DI + MOV DI,OFFSET TEMP_ATTR ; ATTR% = 0 + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_CREATE ; CREATE DESTINATION FILE + CMP W [TEMP_READY],0 + JZ @@BAD1 + +@@LOOP: MOV DI,OFFSET TEMP_SOURCE ; HANDLE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_STRING ; BUF$ + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_COUNT ; COUNT% = &H1000 + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_READ ; READ SOURCE FILE + CMP W [TEMP_READY],0 + JZ @@BAD0 + + MOV SI,OFFSET TEMP_STRING ; DID WE GET ANYTHING? + CALL STRING_PTR_ES_DI ; CX = COUNT + JCXZ @@DONE ; NO, DONE + + MOV DI,OFFSET TEMP_DEST ; HANDLE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_STRING ; BUF$ + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_WRITE ; WRITE DESTINATION FILE + CMP W [TEMP_READY],0 + JZ @@BAD0 + + MOV SI,OFFSET TEMP_STRING + CALL STRING_PTR_ES_DI ; CX = COUNT + CMP CX,BLOCK_SIZE ; DID WE GET A FULL BLOCK? + JAE @@LOOP ; YES, TRY FOR MORE + +@@DONE: MOV DI,OFFSET TEMP_SOURCE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_DATE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_TIME + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY + PUSH CS + PUSH DI + PUSH CS + CALL FILE_GET_DATE_TIME + CMP W [TEMP_READY],0 + JZ @@BAD0 + + MOV DI,OFFSET TEMP_DEST + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_DATE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_TIME + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY + PUSH CS + PUSH DI + PUSH CS + CALL FILE_SET_DATE_TIME + CMP W [TEMP_READY],0 + JZ @@BAD0 + + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + +@@BAD0: PUSH CS + POP DS + MOV SI,OFFSET TEMP_STRING + CALL STRING_FREE + + MOV SI,DATA + MOV DS,SI + PUSH [FILE_ERROR] + + MOV DI,OFFSET TEMP_DEST ; HANDLE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_CLOSE ; CLOSE DESTINATION FILE + + ; SHOULD DELETE FILE HERE IF ERROR + + POP W [FILE_ERROR] + +@@BAD1: MOV SI,DATA + MOV DS,SI + PUSH [FILE_ERROR] + + MOV DI,OFFSET TEMP_SOURCE ; HANDLE + PUSH CS + PUSH DI + MOV DI,OFFSET TEMP_READY ; READY% + PUSH CS + PUSH DI + PUSH CS + CALL FILE_CLOSE ; CLOSE SOURCE FILE + + POP W [FILE_ERROR] + +@@BAD2: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_INVOCATION + +FILE_INVOCATION: ; FILE_NAME$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AH,62H + INT 21H ; GET CURRENT PSP + MOV DS,BX + + SUB AL,AL ; ASCIZ SEARCH + + MOV ES,DS:[2CH] + SUB DI,DI + MOV CX,-1 ; ES:DI -> ENVIRONMENT (MAX FFFF BYTES) + +@@LOOP: REPNZ SCASB + JNZ @@BAD + SCASB + JZ @@ENVE + DEC DI + JMP @@LOOP + +@@ENVE: INC DI ; GOT ENVIRONMENT END + INC DI + + PUSH ES + PUSH DI ; -> INVOCATION NAME + + MOV CX,128 + REPNZ SCASB + MOV AX,127 + SUB AX,CX ; AX = LENGTH OF INVOCATION STRING + PUSH AX + + LDS SI,[BP+10] ; FILE_NAME$ + CALL STRING_REALLOC + CALL STRING_PTR_ES_DI + + POP CX + POP SI + POP DS + +@@CPY0: LODSB ; COPY STRING TO USER, UPPERCASE + CMP AL,'a' + JB @@CPY1 + CMP AL,'z' + JA @@CPY1 + AND AL,0DFH +@@CPY1: STOSB + LOOP @@CPY0 + + MOV SI,DATA + MOV DS,SI + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV SI,DATA + MOV DS,SI + + MOV W [FILE_ERROR],-1 + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SET_HANDLES + +FILE_SET_HANDLES: ; HANDLES%, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + MOV AX,5800H + INT 21H ; GET ALLOCATION STRATEGY + JC @@BAD + XCHG DI,AX + MOV AX,5801H + MOV BX,2 ; LAST FIT + INT 21H ; SET ALLOCATION STRATEGY + JC @@BAD + + LDS SI,[BP+10] ; HANDLES% + MOV BX,[SI] ; REQUESTED NUMBER OF HANDLES + + MOV AH,67H + INT 21H ; TRY TO ALLOCATE HANDLES + + PUSHF + MOV AX,5801H + MOV BX,DI + INT 21H ; TRY TO RESTORE ALLOCATION STRATEGY + POPF + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 8 + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_SHELL + +FILE_SHELL: ; FILE_NAME$, COMMAND_LINE$, READY% +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LDS SI,[BP+14] ; FILE_NAME$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NAME + MOV AX,128 + CALL STRING_COPY ; COPY STRING TO BUF_NAME + + LDS SI,[BP+10] ; COMMAND_LINE$ + PUSH CS + POP ES + MOV DI,OFFSET BUF_NEW+1 + MOV AX,126 + CALL STRING_COPY ; COPY STRING TO BUF_NEW+1 + MOV DI,OFFSET BUF_NEW + XCHG AX,CX + STOSB ; LENGTH BYTE + ADD DI,AX + MOV AL,0DH + STOSB ; TRAILING CR + + PUSH CS + POP DS + + MOV AX,4B00H + MOV DX,OFFSET BUF_NAME + MOV BX,OFFSET EXEC_PARAMS + MOV [BX+4],CS + INT 21H ; EXECUTE PROGRAM + + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV AH,4DH + INT 21H ; GET RETURN CODE + SUB AH,AH + MOV W [FILE_ERROR],AX + + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + JMP @@RET + +@@BAD: MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + +@@RET: POP DI + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 12 + +; ----------------------------------------------------------------------------- + +STRING_LEN: + PUSH [SI] + CALL GETSTRLOC + RET + +STRING_PTR_DS_DX: + PUSH [SI] + CALL GETSTRLOC + + MOV DS,DX + XCHG DX,AX ; DS:DX -> CX BYTE STRING + RET + +STRING_PTR_DS_SI: + PUSH [SI] + CALL GETSTRLOC + + MOV DS,DX + XCHG SI,AX ; DS:SI -> CX BYTE STRING + RET + +STRING_PTR_ES_DI: + PUSH [SI] + CALL GETSTRLOC + + MOV ES,DX + XCHG DI,AX ; ES:DI -> CX BYTE STRING + RET + +STRING_PTR_SETUP: + PUSH [SI] + CALL GETSTRLOC + + STOSW + XCHG AX,DX + STOSW ; MEMORY PTR -> CX BYTE STRING + RET + +STRING_FREE: + CMP W [SI],0 + JZ @@RET + + PUSH [SI] + MOV W [SI],0 + CALL RLSSTRALLOC +@@RET: RET + +STRING_REALLOC: + PUSH DS + PUSH SI + PUSH AX + CALL STRING_FREE + POP AX + POP SI + POP DS + ;JMP STRING_ALLOC + +STRING_ALLOC: + TEST AX,AX + JZ @@NONE + + PUSH DS + PUSH SI + PUSH AX + CALL GETSTRALLOC + POP SI + POP DS + + TEST AX,AX + JZ ERROR_STRING_ALLOC + +@@NONE: MOV [SI],AX + RET + +STRING_RESIZE: + PUSH DS + + PUSH [SI] + PUSH AX + PUSH DS + PUSH SI + CALL STRING_ALLOC + POP SI + POP DS + CALL STRING_PTR_ES_DI + POP AX ; ES:DI -> AX BYTE NEW STRING + POP BX ; BX = OLD STRING HANDLE + + PUSH CS + POP DS + MOV SI,OFFSET OLD_STRING + MOV [SI],BX + CALL STRING_COPY + MOV SI,OFFSET OLD_STRING + CALL STRING_FREE + + POP DS + RET + +STRING_COPY: + PUSH DS + + PUSH ES + PUSH DI + PUSH AX + CALL STRING_PTR_DS_SI + POP AX + POP DI + POP ES + + CMP CX,AX + JBE @@FITS + MOV CX,AX + +@@FITS: PUSH CX + + SUB AX,CX + REP MOVSB + XCHG CX,AX ; LEAVES AL = 0 + REP STOSB + + POP CX + POP DS + RET + +; ----------------------------------------------------------------------------- + +ERROR_STRING_ALLOC: + MOV SI,OFFSET MESS_STRING_ALLOC + +ERROR_HANDLER: + PUSH CS + POP DS + PUSH CS + POP ES + MOV [ERROR_MESS_PTR],SI + + MOV AH,2AH + INT 21H ; GET DATE + + MOV DI,OFFSET MESS_DATE_TIME+2 + MOV AL,DL + CALL ERROR_DECIMAL + MOV AL,DH + SUB AH,AH + MOV SI,OFFSET ERROR_MONTHS + ADD SI,AX + ADD SI,AX + ADD SI,AX + MOVSW + MOVSB + MOV AX,CX + SUB AX,2000 + JNC @@OK + ADD AX,100 +@@OK: CALL ERROR_DECIMAL + INC DI + + MOV AH,2CH + INT 21H + + MOV AL,CH + CALL ERROR_DECIMAL + INC DI + MOV AL,CL + CALL ERROR_DECIMAL + INC DI + MOV AL,DH + CALL ERROR_DECIMAL + + MOV AH,2 + SUB BH,BH + MOV DX,24*100H + INT 10H ; SET CURSOR POSITION + + MOV SI,OFFSET MESS_DATE_TIME + CALL ERROR_BIOS_PRINT + MOV SI,[ERROR_MESS_PTR] + CALL ERROR_BIOS_PRINT + + MOV AH,62H + INT 21H ; GET CURRENT PSP + MOV DS,BX + + SUB AL,AL ; ASCIZ SEARCH + MOV ES,DS:[2CH] + SUB DI,DI + MOV CX,-1 ; ES:DI -> ENVIRONMENT (MAX FFFF BYTES) + +@@SRCH: REPNZ SCASB + JNZ @@BAD + SCASB + JZ @@ENVE + DEC DI + JMP @@SRCH + +@@BAD: PUSH CS + POP ES + MOV DI,OFFSET ERROR_LOG_PATH + JMP @@CONT + +@@ENVE: INC DI ; GOT ENVIRONMENT END + INC DI + + PUSH ES + POP DS + MOV SI,DI + + PUSH CS + POP ES + MOV DI,OFFSET ERROR_LOG_PATH + + MOV CX,64 + MOV BX,DI ; WHERE LAST \ FOUND +@@COPY: LODSB + STOSB + CMP AL,'\' + JNZ @@COPE + MOV BX,DI +@@COPE: TEST AL,AL + LOOPNZ @@COPY + MOV DI,BX + +@@CONT: PUSH CS + POP DS + MOV SI,OFFSET ERROR_LOG_NAME + MOV CX,10 ; ERROR.LOG + REP MOVSB + + MOV AX,3D02H + MOV DX,OFFSET ERROR_LOG_PATH + INT 21H ; TRY TO OPEN EXISTING ERROR.LOG + JC ERROR_LOG_CREATE + XCHG BX,AX + + MOV AX,4202H + SUB CX,CX + SUB DX,DX + INT 21H ; SEEK TO END OF ERROR.LOG + JMP ERROR_LOG_WRITE + +ERROR_LOG_CREATE: + MOV AH,3CH + SUB CX,CX + MOV DX,OFFSET ERROR_LOG_PATH + INT 21H ; CREATE NEW ZERO LENGTH ERROR.LOG + JC ERROR_HANDLER_DONE + XCHG BX,AX + +ERROR_LOG_WRITE: + MOV SI,OFFSET MESS_DATE_TIME + CALL ERROR_FILE_PRINT + MOV SI,[ERROR_MESS_PTR] + CALL ERROR_FILE_PRINT + MOV SI,OFFSET MESS_CRLF + CALL ERROR_FILE_PRINT + + MOV AH,3EH + INT 21H ; CLOSE ERROR.LOG + +ERROR_HANDLER_DONE: + MOV AX,DATA + MOV DS,AX + JMP FILE_BOMB_OUT + +ERROR_DECIMAL: + SUB AH,AH + MOV BL,10 + DIV BL ; AL = TENS, AH = UNITS + OR AX,3030H + STOSW + RET + +ERROR_BIOS_PRINT: + PUSH SI + LODSW + XCHG CX,AX +@@LOOP: LODSB + PUSH CX + PUSH SI + MOV AH,0EH + MOV BX,7 + INT 10H + POP SI + POP CX + LOOP @@LOOP + POP SI + RET + +ERROR_FILE_PRINT: + MOV AH,40H + MOV CX,[SI] + LEA DX,[SI+2] + INT 21H ; WRITE TO ERROR.LOG + RET + +ERROR_MESS_PTR DW 0 +ERROR_LOG_NAME DB 'ERROR.LOG',0 +ERROR_LOG_PATH DB 129 DUP (?) + +ERROR_MONTHS DB '???JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' + +MESS_DATE_TIME DW 17 + DB '01JAN80 00:00:00 ' + +MESS_STRING_ALLOC DW 29 + DB 'FILE.ASM: Out of string space' + +MESS_CRLF DW 2 + DB 0DH,0AH + +; ----------------------------------------------------------------------------- +; SET UP USER BUFFER + +USER_ALLOC: + PUSH [SI] ; COUNT% + CALL GETSTRALLOC + + PUSH CS + POP DS + MOV SI,OFFSET USER_STRING + MOV [SI],AX + ;JMP USER_PTR_SETUP + +USER_PTR_SETUP: + PUSH CS + POP ES + MOV DI,OFFSET USER_PTR + CALL STRING_PTR_SETUP + + PUSH CS + POP DS + MOV [USER_COUNT],CX + MOV W [USER_OFFSET],0 + RET + +; ----------------------------------------------------------------------------- +; FREE UP READ BUFFER + +READ_FLUSH: + MOV DX,ES:[DI+BUF_OFFSET] + SUB DX,ES:[DI+BUF_COUNT] ; DX = -BYTES LEFT IN READ BUFFER + JAE @@DONE ; NC FOR CALLER + + MOV AX,4201H + MOV BX,[BUF_HANDLE] + MOV CX,-1 + INT 21H ; SEEK RELATIVE + ; ERRORS HANDLED BY CALLER + +@@DONE: MOV W ES:[DI+BUF_COUNT],0 + MOV W ES:[DI+BUF_OFFSET],0 + RET + +; ----------------------------------------------------------------------------- +; SCAN USER BUFFER FOR CR + +READ_SCAN: + MOV BX,[USER_COUNT] + SUB BX,[USER_OFFSET] ; BX = USER BYTES LEFT + + MOV CX,ES:[DI+BUF_COUNT] + SUB CX,ES:[DI+BUF_OFFSET] ; CX = NATIVE BYTES LEFT + + CMP CX,BX + JB @@SCAN + MOV CX,BX +@@SCAN: JCXZ @@RET + + LDS SI,D [BUF_PTR] + ADD SI,ES:[DI+BUF_OFFSET] ; DS:SI -> NATIVE BUFFER + MOV BX,SI ; TO CALCULATE LENGTH + +@@LOOP: LODSB + CMP AL,1AH + JZ @@DONE + CMP AL,0DH + LOOPNZ @@LOOP + JNZ @@RET + +@@DONE: PUSH CS + POP DS + + DEC SI + SUB SI,BX + ADD SI,[USER_OFFSET] + MOV [USER_COUNT],SI ; MAKE THE REQUEST SHORTER + RET + +@@RET: PUSH CS + POP DS + RET + +; ----------------------------------------------------------------------------- +; SCAN USER BUFFER FOR CR/LF AND SKIP + +READ_SKIP: + MOV CX,ES:[DI+BUF_COUNT] + SUB CX,ES:[DI+BUF_OFFSET] ; CX = NATIVE BYTES LEFT + JZ @@RET + + LDS SI,D [BUF_PTR] + ADD SI,ES:[DI+BUF_OFFSET] ; DS:SI -> NATIVE BUFFER + MOV BX,SI ; TO CALCULATE LENGTH + + CMP W CS:[READ_LINE_CR],1 ; ALREADY FOUND CR? + JZ @@LF + +@@CR: LODSB + CMP AL,1AH + JZ @@BACK + CMP AL,0DH + LOOPNZ @@CR + JNZ @@RET + + MOV W CS:[READ_LINE_CR],1 ; SAY WE FOUND CR + JCXZ @@RET ; NO NEED TO UPDATE BUF_OFFSET, DODGY + +@@LF: LODSB + CMP AL,0AH + JZ @@DONE + +@@BACK: DEC SI +@@DONE: MOV W CS:[READ_LINE_CR],2 ; SAY WE FOUND LF + +@@RET: PUSH CS + POP DS + + SUB SI,BX + ADD [READ_SKIP_COUNT],SI + ADD ES:[DI+BUF_OFFSET],SI ; SKIP THE BYTES + RET + +; ----------------------------------------------------------------------------- +; COPY OUT TO USER BUFFER + +READ_COPY: + PUSH ES + PUSH DI + + MOV BX,[USER_COUNT] + SUB BX,[USER_OFFSET] ; BX = USER BYTES LEFT + + MOV CX,ES:[DI+BUF_COUNT] + SUB CX,ES:[DI+BUF_OFFSET] ; CX = NATIVE BYTES LEFT + + LDS SI,D [BUF_PTR] + ADD SI,ES:[DI+BUF_OFFSET] ; DS:SI -> NATIVE BUFFER + + LES DI,D CS:[USER_PTR] + ADD DI,CS:[USER_OFFSET] ; ES:DI -> USER BUFFER + + CMP CX,BX + JB @@COPY + MOV CX,BX + +@@COPY: MOV AX,CX + REP MOVSB + + POP DI + POP ES + ADD ES:[DI+BUF_OFFSET],AX + + PUSH CS + POP DS + ADD [USER_OFFSET],AX + RET + +; ----------------------------------------------------------------------------- +; GET MORE INTO READ BUFFER + +READ_MORE: + MOV AX,ES:[DI+BUF_COUNT] + CMP AX,ES:[DI+BUF_OFFSET] + JB @@RET + + MOV AH,3FH + MOV BX,[BUF_HANDLE] + MOV CX,BLOCK_SIZE + LDS DX,D [BUF_PTR] + INT 21H + PUSH CS + POP DS + ; ERRORS HANDLED BY CALLER + + MOV W ES:[DI+BUF_OFFSET],0 + MOV W ES:[DI+BUF_COUNT],0 + JC @@RET + MOV ES:[DI+BUF_COUNT],AX +@@RET: RET + +; ----------------------------------------------------------------------------- +; RETURN USER BUFFER IN FILE_DATA$ + +READ_DONE: + MOV CX,[SI] ; CX = COUNT% + + PUSH CS + POP DS + MOV [FILE_DATA_PTR],DI + MOV [FILE_DATA_PTR+2],ES + + MOV SI,DATA + MOV DS,SI + JC @@BAD ; ERROR OCCURRED, DEALLOCATE BUF + + MOV W [FILE_COUNT],BX ; BX = BYTES TRANSFERRED, INC CR/LF + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + + CMP AX,CX ; AX = BYTES TRANSFERRED, NO CR/LF + JAE @@DONE + + ; ONLY PARTIALLY FILLED, TRUNCATE BUF + + PUSH CS + POP DS + MOV SI,OFFSET USER_STRING + CALL STRING_RESIZE ; RESIZE USER BUFFER TO AX BYTES + +@@DONE: ; SUCCESSFUL, DEALLOCATE FILE_DATA$ AND REPLACE WITH BUF + + PUSH CS + POP DS + LDS SI,D [FILE_DATA_PTR] ; FILE_DATA$ + CALL STRING_FREE + + PUSH CS + POP DS + MOV SI,OFFSET USER_STRING + + LES DI,D [FILE_DATA_PTR] ; FILE_DATA$ + SUB AX,AX + XCHG AX,[SI] + STOSW + RET + +@@BAD: ; ERROR OCCURRED, DEALLOCATE BUF + + MOV W [FILE_COUNT],0 + + MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + + PUSH CS + POP DS + MOV SI,OFFSET USER_STRING + JMP STRING_FREE + +; ----------------------------------------------------------------------------- +; FREE UP WRITE BUFFER + +WRITE_FLUSH: + CMP W ES:[DI+BUF_OFFSET],0 + JZ @@DONE ; NC FOR CALLER + + MOV AH,40H + MOV BX,BUF_HANDLE + MOV CX,ES:[DI+BUF_OFFSET] + LDS DX,D [BUF_PTR] + INT 21H ; WRITE OUT WRITE BUFFER + PUSH CS + POP DS + ; ERRORS HANDLED BY CALLER + +@@DONE: MOV W ES:[DI+BUF_COUNT],0 + MOV W ES:[DI+BUF_OFFSET],0 + RET + +; ----------------------------------------------------------------------------- +; COPY OUT TO WRITE BUFFER + +WRITE_COPY: + PUSH ES + PUSH DI + + MOV CX,BLOCK_SIZE + SUB CX,ES:[DI+BUF_OFFSET] ; CX = NATIVE BYTES LEFT + + MOV BX,[USER_COUNT] + SUB BX,[USER_OFFSET] ; BX = USER BYTES LEFT + + MOV DX,ES:[DI+BUF_OFFSET] + LES DI,D [BUF_PTR] + ADD DI,DX ; ES:DI -> NATIVE BUFFER + + LDS SI,D [USER_PTR] + ADD SI,CS:[USER_OFFSET] ; DS:SI -> USER BUFFER + + CMP CX,BX + JB @@COPY + MOV CX,BX + +@@COPY: MOV AX,CX + REP MOVSB + + POP DI + POP ES + ADD ES:[DI+BUF_OFFSET],AX + + PUSH CS + POP DS + ADD [USER_OFFSET],AX + RET + +; ----------------------------------------------------------------------------- +; SET UP READY% FILE_COUNT% FILE_ERROR% + +WRITE_DONE: + MOV SI,DATA + MOV DS,SI + JC @@BAD + + MOV W [FILE_COUNT],AX + + MOV W [FILE_ERROR],0 + LDS SI,[BP+6] ; READY% + MOV W [SI],-1 + RET + +@@BAD: MOV W [FILE_COUNT],0 + + MOV W [FILE_ERROR],AX + LDS SI,[BP+6] ; READY% + MOV W [SI],0 + RET + +; ----------------------------------------------------------------------------- +; USAGE OF HANDLE_ AND BUF_ ROUTINES: + +; CALLERS WANTING TO INTERROGATE BUFFER SITUATION SHOULD USE: + +; LDS SI,[BP+14] ; HANDLE% +; CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + +; CALL BUF_ADJUST ; RETURN FILE_PTR_ADJUST + +; CALLERS WANTING TO FLUSH BUFFERS TRANSPARENTLY SHOULD USE: + +; LDS SI,[BP+14] ; HANDLE% +; CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS + +; SUB AX,AX ; 0 = NO BUFFER WANTED +; CALL BUF_SETUP ; SET BUFFER DIRECTION OR KILL + +; CALLERS WANTING TO SET UP BUFFERS SHOULD USE: + +; LDS SI,[BP+14] ; HANDLE% +; CALL HANDLE_SETUP ; SAVE HANDLE AND SET UP POINTERS +; CALL HANDLE_ALLOC ; ENSURE WE HAVE A HANDLE_STRING ENTRY + +; MOV AX,BUF_FLAG_READ ; 1,2 = DIRECTION +; CALL BUF_SETUP ; SET BUFFER DIRECTION OR KILL +; CALL BUF_ALLOC ; ENSURE WE HAVE A BUF_STRING ENTRY + +; AFTER HANDLE_SETUP: + +; DS = CS, PRESERVE +; HANDLE_STRING ENTRY IS ACCESSED FROM ES:DI, PRESERVE +; FILE HANDLE IS ACCESSED FROM BUF_HANDLE + +; ----------------------------------------------------------------------------- +; ENSURE THERE IS AN INITIALISED ENTRY IN HANDLE_STRING FOR HANDLE% + +HANDLE_ALLOC: + MOV AX,[HANDLE_OFFSET] + CMP AX,[HANDLE_LEN] + JB @@RET + + MOV SI,OFFSET HANDLE_STRING + ADD AX,BUF_SIZE + CALL STRING_RESIZE ; MAKE IT BIGGER + + JMP HANDLE_PTR_SETUP + +@@RET: RET + +; ----------------------------------------------------------------------------- +; SAVE HANDLE, SET UP ES:DI AND HANDLE_LEN + +HANDLE_SETUP: + LODSW ; HANDLE% + PUSH CS + POP DS + MOV [BUF_HANDLE],AX ; AX = HANDLE TO USE FOR BUF_FLUSH ETC + + SHL AX,1 + SHL AX,1 + SHL AX,1 + MOV [HANDLE_OFFSET],AX ; AX = OFFSET INTO HANDLE_STRING + ;JMP HANDLE_PTR_SETUP + +HANDLE_PTR_SETUP: + PUSH CS + POP DS + + SUB CX,CX + CMP CX,[HANDLE_STRING] + JZ @@DONE + + MOV SI,OFFSET HANDLE_STRING + CALL STRING_PTR_ES_DI + ADD DI,[HANDLE_OFFSET] + +@@DONE: MOV [HANDLE_LEN],CX + RET + +; ----------------------------------------------------------------------------- +; RETURN BUFFER DIRECTION IN AX, OR NO BUFFER IF AX = 0 + +BUF_TEST: + SUB AX,AX + + MOV BX,[HANDLE_OFFSET] + CMP BX,[HANDLE_LEN] + JAE @@RET ; NO HANDLE ALLOCATED + + MOV AX,ES:[DI+BUF_FLAG] +@@RET: RET + +; ----------------------------------------------------------------------------- + +BUF_ADJUST: + CALL BUF_TEST ; RETURNS AX = BUFFER DIRECTION + + MOV W [FILE_PTR_ADJUST],0 + MOV W [FILE_PTR_ADJUST+2],0 + + CMP AX,BUF_FLAG_READ + JNZ @@CONT + + MOV AX,ES:[DI+BUF_OFFSET] + SUB AX,ES:[DI+BUF_COUNT] ; AX = -BYTES LEFT IN READ BUFFER + JNC @@RET + + MOV W [FILE_PTR_ADJUST+2],-1 + JMP @@DONE + +@@CONT: CMP AX,BUF_FLAG_WRITE + JNZ @@RET + + MOV AX,ES:[DI+BUF_OFFSET] +@@DONE: MOV [FILE_PTR_ADJUST],AX +@@RET: RET + +; ----------------------------------------------------------------------------- +; SET BUFFER DIRECTION FROM AX, OR KILL BUFFER IF AX = 0 + +BUF_SETUP: + MOV BX,[HANDLE_OFFSET] + CMP BX,[HANDLE_LEN] + JAE @@NULL ; NO HANDLE ALLOCATED + + PUSH AX + CALL BUF_PTR_SETUP + POP AX + + CMP AX,ES:[DI+BUF_FLAG] + JZ @@NULL ; ALREADY SET UP, OR ALREADY DEAD + + PUSH AX + CALL BUF_FLUSH + POP AX + + MOV ES:[DI+BUF_FLAG],AX + MOV W ES:[DI+BUF_OFFSET],0 + MOV W ES:[DI+BUF_COUNT],0 +@@RET: RET + +@@NULL: SUB AX,AX ; NC + RET + +; ----------------------------------------------------------------------------- + +BUF_PTR_SETUP: + CMP W ES:[DI+BUF_STRING],0 + JZ @@RET + + PUSH ES + PUSH DI + + PUSH ES + POP DS + LEA SI,[DI+BUF_STRING] + PUSH CS + POP ES + MOV DI,OFFSET BUF_PTR + CALL STRING_PTR_SETUP + PUSH CS + POP DS + + POP DI + POP ES +@@RET: RET + +; ----------------------------------------------------------------------------- + +BUF_ALLOC: + CMP W ES:[DI+BUF_STRING],0 + JNZ @@RET + + PUSH ES + POP DS + LEA SI,[DI+BUF_STRING] + MOV AX,BLOCK_SIZE + CALL STRING_ALLOC + PUSH CS + POP DS + + CALL BUF_PTR_SETUP + + MOV W ES:[DI+BUF_COUNT],0 + MOV W ES:[DI+BUF_OFFSET],0 +@@RET: RET + +; ----------------------------------------------------------------------------- + +BUF_FREE: + MOV BX,[HANDLE_OFFSET] + CMP BX,[HANDLE_LEN] + JAE @@RET ; NO HANDLE ALLOCATED + + PUSH ES + POP DS + LEA SI,[DI+BUF_STRING] + CALL STRING_FREE + PUSH CS + POP DS + + MOV W ES:[DI+BUF_COUNT],0 + MOV W ES:[DI+BUF_OFFSET],0 +@@RET: RET + +; ----------------------------------------------------------------------------- + +BUF_FLUSH: + MOV AX,ES:[DI+BUF_FLAG] + CMP AX,BUF_FLAG_READ + JNZ @@CONT + + CALL READ_FLUSH + JMP @@DONE + +@@CONT: CMP AX,BUF_FLAG_WRITE + JNZ @@NULL + + CALL WRITE_FLUSH +@@DONE: MOV W ES:[DI+BUF_FLAG],0 + RET + +@@NULL: SUB AX,AX ; NC + RET + +; ----------------------------------------------------------------------------- + +PUBLIC FILE_DIAG + +FILE_DIAG: +; CALL TEST_HANDLE_STRING + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + LDS SI,[BP+6] + MOV AX,CS:[HANDLE_STRING] + MOV [SI],AX + POP SI + POP DS + POP BP +; CALL SAVE_HANDLE_STRING + RETF 4 + +; ----------------------------------------------------------------------------- + +IF 0 +TEST_HANDLE_STRING: + PUSHF + CLD + PUSH DS + PUSH ES + PUSH SI + PUSH DI + + PUSH CS + POP DS + MOV SI,OFFSET HANDLE_STRING + SUB CX,CX + CMP CX,[SI] + JZ TEST_NO_HANDLE_STRING + CALL STRING_PTR_ES_DI + +TEST_NO_HANDLE_STRING: + CMP CX,[SAVED_HANDLE_LEN] + JNZ ERROR_HANDLE_STRING + JCXZ OK_HANDLE_STRING + + MOV SI,OFFSET SAVED_HANDLE_STRING + REPZ CMPSB + JNZ ERROR_HANDLE_STRING + + ; CHECK FOR DUPLICATE BUF HANDLES + JMP OK_HANDLE_STRING + +ERROR_HANDLE_STRING: + MOV AX,3C00H + SUB CX,CX + MOV DX,OFFSET NAME_FILE_LOG + INT 21H + JC OK_HANDLE_STRING + + XCHG BX,AX + MOV AH,3EH + INT 21H + +OK_HANDLE_STRING: + POP DI + POP SI + POP ES + POP DS + POPF + RET + +SAVE_HANDLE_STRING: + PUSHF + CLD + PUSH DS + PUSH ES + PUSH SI + PUSH DI + + PUSH CS + POP DS + MOV SI,OFFSET HANDLE_STRING + SUB CX,CX + CMP CX,[SI] + JZ SAVE_NO_HANDLE_STRING + CALL STRING_PTR_DS_SI + +SAVE_NO_HANDLE_STRING: + MOV CS:[SAVED_HANDLE_LEN],CX + + PUSH CS + POP ES + MOV DI,OFFSET SAVED_HANDLE_STRING + REP MOVSB + + POP DI + POP SI + POP ES + POP DS + POPF + RET + +SAVED_HANDLE_LEN DW 0 +SAVED_HANDLE_STRING DB 100H*8 DUP (0) + +NAME_FILE_LOG DB 'C:\JRNXL\FILE.LOG',0 +ENDIF + +; ----------------------------------------------------------------------------- + +EXEC_PARAMS DW 0 ; SEGMENT OF ENVIRONMENT + DW BUF_NEW,0 ; DWORD -> COMMAND LINE + DD -1,-1 + +CURRENT_PSP DW 0 + +PRINT_HANDLE DW 0 +PRINT_READY DW 0 + +BUF_HANDLE DW 0 +BUF_PTR DW 0,0 +BUF_SEEK_PTR DW 0,0 + +;HANDLE_PTR DW 0,0 +HANDLE_OFFSET DW 0 +HANDLE_LEN DW 0 +HANDLE_STRING DW 0 + +FILE_PTR_ADJUST DW 0,0 +FILE_DATA_PTR DW 0,0 + +CRLF_STRING DW 0 ; STRING HANDLE FOR CHR$(&HD,&HA) + +READ_LINE_MAX DW LINE_SIZE +READ_LINE_CR DW 0 ; 0=NOTHING, 1=CR FOUND, 2=CR/LF OR EOF +READ_SKIP_COUNT DW 0 + +USER_STRING DW 0 ; STRING HANDLE FOR DYNAMIC FILE BUFFER + +USER_PTR DW 0,0 +USER_OFFSET DW 0 +USER_COUNT DW 0 + +TEMP_SOURCE DW 0 ; FOR FILE_COPY % +TEMP_DEST DW 0 +TEMP_STRING DW 0 +TEMP_ATTR DW 0 +TEMP_DATE DW 0 +TEMP_TIME DW 0 +TEMP_READY DW 0 ; % + +TEMP_COUNT DW BLOCK_SIZE ; VARIOUS + +OLD_STRING DW 0 ; FOR STRING_RESIZE + +BUF_DTA DB 2BH DUP (0) + +BUF_NAME DB 129 DUP (0) +BUF_NEW DB 129 DUP (0) + +; ----------------------------------------------------------------------------- + +CODE ENDS + +; ----------------------------------------------------------------------------- + +DATA SEGMENT +DATA ENDS + +; ----------------------------------------------------------------------------- + + END diff --git a/src/avr/file.inc b/src/avr/file.inc new file mode 100644 index 00000000..7816f1b3 --- /dev/null +++ b/src/avr/file.inc @@ -0,0 +1,58 @@ +' FILE.INC + +' ----------------------------------------------------------------------------- + +$LINK "FILE.OBJ" + +DECLARE SUB FILE_OPEN(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_CREATE(INTEGER,STRING,INTEGER,INTEGER) +DECLARE SUB FILE_CLOSE(INTEGER,INTEGER) +DECLARE SUB FILE_READ(INTEGER,STRING,INTEGER,INTEGER) +DECLARE SUB FILE_READ_BUF(INTEGER,STRING,INTEGER,INTEGER) +DECLARE SUB FILE_READ_LINE(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_READ_DIRECT(INTEGER,POINTER,INTEGER,INTEGER) +DECLARE SUB FILE_WRITE(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_WRITE_BUF(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_WRITE_LINE(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_WRITE_DIRECT(INTEGER,POINTER,INTEGER,INTEGER) +DECLARE SUB FILE_SEEK(INTEGER,LONG,INTEGER) +DECLARE SUB FILE_SEEK_REL(INTEGER,LONG,INTEGER) +DECLARE SUB FILE_SEEK_END(INTEGER,LONG,INTEGER) +DECLARE SUB FILE_SEEK_GET(INTEGER,LONG,INTEGER) +DECLARE SUB FILE_PRINT(STRING) +DECLARE SUB FILE_FLUSH(INTEGER,INTEGER) +DECLARE SUB FILE_DUPLICATE_HANDLE(INTEGER,INTEGER,INTEGER) +DECLARE SUB FILE_REDIRECT_HANDLE(INTEGER,INTEGER,INTEGER) +DECLARE SUB FILE_GET_DATE_TIME(INTEGER,INTEGER,INTEGER,INTEGER) +DECLARE SUB FILE_SET_DATE_TIME(INTEGER,INTEGER,INTEGER,INTEGER) +DECLARE SUB FILE_GET_ATTRIBUTES(STRING,INTEGER,INTEGER) +DECLARE SUB FILE_SET_ATTRIBUTES(STRING,INTEGER,INTEGER) +DECLARE SUB FILE_RENAME(STRING,STRING,INTEGER) +DECLARE SUB FILE_DELETE(STRING,INTEGER) +DECLARE SUB FILE_SEARCH_FIRST(STRING,INTEGER,STRING,INTEGER) +DECLARE SUB FILE_SEARCH_NEXT(STRING,INTEGER) +DECLARE SUB FILE_CREATE_DIRECTORY(STRING,INTEGER) +DECLARE SUB FILE_DELETE_DIRECTORY(STRING,INTEGER) +DECLARE SUB FILE_GET_DIRECTORY(INTEGER,STRING,INTEGER) +DECLARE SUB FILE_SET_DIRECTORY(STRING,INTEGER) +DECLARE SUB FILE_GET_DRIVE(INTEGER,INTEGER) +DECLARE SUB FILE_SET_DRIVE(INTEGER,INTEGER) +DECLARE SUB FILE_GET_DRIVE_INFO(INTEGER,INTEGER,INTEGER,INTEGER,INTEGER, _ + INTEGER) +DECLARE SUB FILE_COPY(STRING,STRING,INTEGER) +DECLARE SUB FILE_INVOCATION(STRING,INTEGER) +DECLARE SUB FILE_SET_HANDLES(INTEGER,INTEGER) +DECLARE SUB FILE_SHELL(STRING,STRING,INTEGER) +DECLARE SUB FILE_DIAG(INTEGER) + +PUBLIC FILE_ERROR% +PUBLIC FILE_COUNT% +PUBLIC FILE_POINTER& +PUBLIC FILE_DRIVES% + +SUB FILE_BOMB_OUT + END +END SUB + +' ----------------------------------------------------------------------------- + diff --git a/src/avr/iocall.asm b/src/avr/iocall.asm new file mode 100644 index 00000000..4b1fcbe7 --- /dev/null +++ b/src/avr/iocall.asm @@ -0,0 +1,1015 @@ +; IOCALL.ASM + +EXTRN GETSTRLOC:FAR +EXTRN GETSTRALLOC:FAR +EXTRN RLSSTRALLOC:FAR + +EXTRN IO_READY:WORD + +; ----------------------------------------------------------------------------- + +CODE SEGMENT + + ASSUME CS:CODE,DS:DATA + +B EQU BYTE PTR +W EQU WORD PTR +D EQU DWORD PTR + + JUMPS + LOCALS + +; ----------------------------------------------------------------------------- +; IO_TEST +; IF IO_READY%=0 THEN PRINT "OSCAR IO NOT INSTALLED":END + +PUBLIC IO_TEST + +IO_TEST: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + MOV AX,35F8H + INT 21H + LEA DI,[BX-8] ; ES:DI -> 8 BYTES BEFORE INT + + MOV SI,OFFSET OSCAR_IO ; DS:SI -> COMPARISON STRING + + MOV CX,4 + REPZ CMPSW ; CHECK THE BASTARD + JNZ @@BAD + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF + +; ----------------------------------------------------------------------------- +; ID$="90000 RECALIBRATION 3072 "+ _ +; "AUS SW:04APR97 0000 PC SYS:0.000 "+ _ +; MKI$(MODEM_PORT%)+MKI$(LOOP_PORT%)+CHR$(ESCAPE_CHAR%) +; IO_TEACH_ID ID$ + +PUBLIC IO_TEACH_ID + +IO_TEACH_ID: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; ES:SI -> ID$ DESCRIPTOR + CALL STRING_PTR + MOV CX,DX ; CX:AX -> ID$ DATA + + MOV BX,76H ; TEACH ID + INT 0F8H + + POP DI + POP SI + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- +; IO_INIT PORT%, RATE& + +PUBLIC IO_INIT + +IO_INIT: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] ; DX = PORT + + LES SI,[BP+6] ; RATE% + MOV DI,ES:[SI+2] + MOV SI,ES:[SI] ; DI:SI = RATE DWORD + + MOV AX,4D01H ; D8PN, SET DTR/RTS ON + MOV BX,26H ; NEW SET PORT PARAMETERS + INT 0F8H ; ALSO CLEARS ADLC MODE, AUTOS OFF + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_INIT_D7PE PORT%, RATE& + +PUBLIC IO_INIT_D7PE + +IO_INIT_D7PE: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] ; DX = PORT + + LES SI,[BP+6] ; RATE% + MOV DI,ES:[SI+2] + MOV SI,ES:[SI] ; DI:SI = RATE DWORD + + MOV AX,7901H ; D7PE, SET DTR/RTS ON + MOV BX,26H ; NEW SET PORT PARAMETERS + INT 0F8H ; ALSO CLEARS ADLC MODE, AUTOS OFF + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_INIT_PRESERVE PORT%, RATE& + +PUBLIC IO_INIT_PRESERVE + +IO_INIT_PRESERVE: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] ; DX = PORT + + LES SI,[BP+6] ; RATE% + MOV DI,ES:[SI+2] + MOV SI,ES:[SI] ; DI:SI = RATE DWORD + + MOV AX,4D02H ; D8PN, PRESERVE DTR/RTS + MOV BX,26H ; NEW SET PORT PARAMETERS + INT 0F8H ; ALSO CLEARS ADLC MODE, AUTOS OFF + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_REINIT PORT%, RATE& + +PUBLIC IO_REINIT + +IO_REINIT: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] ; DX = PORT + + LES SI,[BP+6] ; RATE% + MOV DI,ES:[SI+2] + MOV SI,ES:[SI] ; DI:SI = RATE DWORD + + MOV AX,4D03H ; D8PN, JUST SET PARAMETERS + MOV BX,26H ; NEW SET PORT PARAMETERS + INT 0F8H ; ALSO CLEARS ADLC MODE, AUTOS OFF + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_REINIT_WAIT PORT%, RATE& + +PUBLIC IO_REINIT_WAIT + +IO_REINIT_WAIT: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] ; DX = PORT + + LES SI,[BP+6] ; RATE% + MOV DI,ES:[SI+2] + MOV SI,ES:[SI] ; DI:SI = RATE DWORD + + MOV AX,4D04H ; D8PN, JUST SET PARAMETERS, WAIT TX + MOV BX,26H ; NEW SET PORT PARAMETERS + INT 0F8H ; ALSO CLEARS ADLC MODE, AUTOS OFF + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_FLUSH PORT% + +PUBLIC IO_FLUSH + +IO_FLUSH: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; PORT% + MOV DX,ES:[SI] + + SUB BX,BX ; FLUSH RECEIVER + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- +; IO_FLUSH_ADLC PORT% + +PUBLIC IO_FLUSH_ADLC + +IO_FLUSH_ADLC: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; PORT% + MOV DX,ES:[SI] + + MOV BX,7AH ; FLUSH ADLC BUFFERS + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- +; IO_TX PORT%, CHAR% + +PUBLIC IO_TX + +IO_TX: PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; CHAR% + LODS B ES:[SI] + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,0AH ; SEND BYTE IF READY + INT 0F8H + JZ @@BAD + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_TX_WAIT PORT%, CHAR% + +PUBLIC IO_TX_WAIT + +IO_TX_WAIT: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; CHAR% + LODS B ES:[SI] + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,0CH ; WAIT TO SEND BYTE + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_TX_STATUS PORT%, FLAG% + +PUBLIC IO_TX_STATUS + +IO_TX_STATUS: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,8 ; TX STATUS + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_TX_COMPLETE PORT%, FLAG% + +PUBLIC IO_TX_COMPLETE + +IO_TX_COMPLETE: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,8EH ; TX COMPLETE + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; FRAME$=CMD$+DAT$ +; CALL IO_TX_ADLC PORT%, DEST$, FRAME$ + +PUBLIC IO_TX_ADLC + +IO_TX_ADLC: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+14] + MOV DX,ES:[SI] ; DX = PORT% + + MOV BX,8 ; TX STATUS + INT 0F8H + JNZ @@BAD + MOV [POOL_PTR],AX + MOV [POOL_PTR+2],CX ; POOL_PTR -> RESERVED FRAME + + LES SI,[BP+6] ; FRAME$ + CALL STRING_PTR ; DX:AX -> FRAME$ DATA SPACE + JCXZ @@BAD + MOV [FRAME_LEN],CX ; FRAME_LEN = LEN(FRAME$) + MOV [FRAME_PTR],AX + MOV [FRAME_PTR+2],DX ; FRAME_PTR -> FRAME$ DATA SPACE + + LES SI,[BP+10] ; DEST$ + CALL STRING_PTR ; DX:AX -> DEST$ DATA SPACE + CMP CX,5 + JNZ @@BAD + MOV [DEST_PTR],AX + MOV [DEST_PTR+2],DX ; DEST_PTR -> DEST$ DATA SPACE + + LES DI,D [POOL_PTR] + INC DI ; DI -> CHN THEN START XMITTED PART + + MOV AL,2 ; ??? + STOSB + + MOV AL,1+1+1+5+5+1+1+2 + ADD AL,B [FRAME_LEN] + STOSB ; LEN + + PUSH DS + LDS SI,[BP+14] ; PORT% + MOV AX,301H ; ??? + ADD AL,B [SI] + POP DS + STOSW ; CHN, RAT + + PUSH DS + LDS SI,D [DEST_PTR] ; DS:SI -> DEST$ DATA + MOV CX,5 + REP MOVSB ; DESTINATION ADDRESS + POP DS + + ADD DI,5 + XCHG AX,CX ; AX = 0 + STOSW + + PUSH DS + MOV CX,[FRAME_LEN] + LDS SI,D [FRAME_PTR] + REP MOVSB + POP DS + + MOV AX,[POOL_PTR] + MOV CX,[POOL_PTR+2] + + LES SI,[BP+14] + MOV DX,ES:[SI] ; DX = PORT% + + MOV BX,0EH ; TX + INT 0F8H + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 12 + +; ----------------------------------------------------------------------------- +; CALL IO_RX PORT%, CHAR% + +PUBLIC IO_RX + +IO_RX: PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,W ES:[SI] + + MOV BX,4 ; RECEIVE BYTE IF READY + INT 0F8H + JZ @@BAD + + LES DI,[BP+6] ; CHAR% + SUB AH,AH + STOSW + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_RX_WAIT PORT%, CHAR% + +PUBLIC IO_RX_WAIT + +IO_RX_WAIT: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,W ES:[SI] + + MOV BX,6 ; WAIT TO RECEIVE BYTE + INT 0F8H + + LES DI,[BP+6] ; CHAR% + SUB AH,AH + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_RX_ADLC PORT%, SOURCE$, FRAME$ +; IF IO_READY% THEN +; CMD%=ASC(FRAME$) +; DAT$=MID$(FRAME$, 2) +; END IF + +PUBLIC IO_RX_ADLC + +IO_RX_ADLC: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+14] ; PORT% + MOV DX,ES:[SI] + + MOV BX,4 ; RX STATUS + INT 0F8H + JZ @@BAD + MOV [POOL_PTR],AX + MOV [POOL_PTR+2],CX + + XCHG SI,AX + MOV ES,CX + MOV AL,ES:[SI+2] + SUB AH,AH ; CX = RECEIVED FRAME LENGTH + SUB AX,1+1+1+5+5+1+1+2 + MOV [FRAME_LEN],AX + + XCHG CX,AX + LES SI,[BP+6] ; FRAME$ + CALL STRING_REALLOC + CALL STRING_PTR ; DX:AX -> FRAME$ DATA SPACE + MOV [FRAME_PTR],AX + MOV [FRAME_PTR+2],DX ; FRAME_PTR -> FRAME$ DATA SPACE + + MOV CX,5 + LES SI,[BP+10] ; SOURCE$ + CALL STRING_REALLOC + CALL STRING_PTR ; DX:AX -> SOURCE$ DATA SPACE + + MOV CX,5 + XCHG DI,AX + MOV ES,DX ; ES:DI -> SOURCE$ DATA SPACE + + PUSH DS + LDS SI,D [POOL_PTR] + ADD SI,2+1+1+1+5 ; DS:SI -> SOURCE ADDRESS IN POOL + REP MOVSB + POP DS + + MOV CX,[FRAME_LEN] + LES DI,D [FRAME_PTR] ; ES:DI -> FRAME$ DATA SPACE + + PUSH DS + LDS SI,D [POOL_PTR] + PUSH SI + ADD SI,2+1+1+1+5+5+2 ; DS:SI -> COMMAND + DATA IN POOL + REP MOVSB + POP SI ; SI -> FRAME FLAG + AND B [SI],11111101B ; CLEAR BIT 1 + POP DS + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 12 + +; ----------------------------------------------------------------------------- +; IO_SET_DTR PORT%, FLAG% + +PUBLIC IO_SET_DTR + +IO_SET_DTR: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; FLAG% + LODSW + OR AL,AH + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,10H ; DTR ON/OFF + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_SET_RTS PORT%, FLAG% + +PUBLIC IO_SET_RTS + +IO_SET_RTS: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; FLAG% + LODSW + OR AL,AH + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,12H ; RTS ON/OFF + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_SET_BREAK PORT%, FLAG% + +PUBLIC IO_SET_BREAK + +IO_SET_BREAK: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; FLAG% + LODSW + OR AL,AH + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,28H ; BREAK ON/OFF + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_SET_ADLC PORT%, FLAG% + +PUBLIC IO_SET_ADLC + +IO_SET_ADLC: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; FLAG% + LODSW + OR AL,AH + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,74H ; ADLC ON/OFF + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_SET_AUTOS PORT%, FLAG% + +PUBLIC IO_SET_AUTOS + +IO_SET_AUTOS: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+6] ; FLAG% + LODSW + OR AL,AH + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,14H ; AUTOS ON/OFF + INT 0F8H + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_READ_DCD PORT%, FLAG% + +PUBLIC IO_READ_DCD + +IO_READ_DCD: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,16H ; DCD STATUS + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_READ_DSR PORT%, FLAG% + +PUBLIC IO_READ_DSR + +IO_READ_DSR: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,18H ; DSR STATUS + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_READ_CTS PORT%, FLAG% + +PUBLIC IO_READ_CTS + +IO_READ_CTS: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,1AH ; CTS STATUS + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; IO_READ_RI PORT%, FLAG% + +PUBLIC IO_READ_RI + +IO_READ_RI: + PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + + LES SI,[BP+10] ; PORT% + MOV DX,ES:[SI] + + MOV BX,1CH ; RI STATUS + INT 0F8H + + MOV AX,0 + JZ @@NULL + DEC AX +@@NULL: LES DI,[BP+6] ; FLAG% + STOSW + + MOV W [IO_READY],-1 + + POP DI + POP SI + POP BP + RETF 8 + +; ----------------------------------------------------------------------------- +; QUEUE$="STUFF THIS" +; IO_QUEUE QUEUE$ + +PUBLIC IO_QUEUE + +IO_QUEUE: + PUSH BP + MOV BP,SP + PUSH DS + PUSH SI + PUSH DI + + LES SI,[BP+6] ; QUEUE$ + CALL STRING_PTR + MOV [QUEUE_LEN],CX + MOV [QUEUE_PTR],AX + MOV [QUEUE_PTR+2],DX + + INC CX + INC CX + PUSH DS + POP ES + MOV SI,OFFSET STRING_TEMP + CALL STRING_ALLOC + CALL STRING_PTR ; DX:AX -> TEMPORARY DATA SPACE + + MOV CX,[QUEUE_LEN] + XCHG DI,AX + MOV ES,DX + + PUSH DS + LDS SI,D [QUEUE_PTR] + REP MOVSB + POP DS + + MOV AX,[QUEUE_LEN] + STOSW + + DEC DI + DEC DI + XCHG AX,DI + MOV CX,ES ; CX:AX -> LENGTH WORD IN COPIED STRING + + MOV BX,62H ; ADD TO QUEUE, BUFFERED + INT 0F8H + + PUSHF + PUSH DS + POP ES + MOV SI,OFFSET STRING_TEMP + CALL STRING_FREE + POPF + JZ @@BAD + + MOV W [IO_READY],-1 + JMP @@RET + +@@BAD: MOV W [IO_READY],0 + +@@RET: POP DI + POP SI + POP BP + RETF 4 + +; ----------------------------------------------------------------------------- + +STRING_PTR: + PUSH ES + PUSH SI + PUSH W ES:[SI] + CALL GETSTRLOC + POP SI + POP ES + RET + +STRING_FREE: + CMP W ES:[SI],0 + JZ @@RET + PUSH ES + PUSH SI + PUSH ES:[SI] + CALL RLSSTRALLOC + POP SI + POP ES + MOV W ES:[SI],0 +@@RET: RET + +STRING_REALLOC: + PUSH CX + CALL STRING_FREE + POP CX +STRING_ALLOC: + PUSH ES + PUSH SI + PUSH CX + CALL GETSTRALLOC + POP SI + POP ES + MOV ES:[SI],AX + RET + +; ----------------------------------------------------------------------------- + +CODE ENDS + +; ----------------------------------------------------------------------------- + +DATA SEGMENT + +OSCAR_IO DB 'OSCAR IO' + + EVENDATA + +STRING_TEMP DW ? + +QUEUE_LEN DW ? +QUEUE_PTR DW ? + +FRAME_LEN DW ? +FRAME_PTR DW ?,? + +POOL_PTR DW ?,? +DEST_PTR DW ?,? + +DATA ENDS + +; ----------------------------------------------------------------------------- + + END diff --git a/src/avr/iocall.inc b/src/avr/iocall.inc new file mode 100644 index 00000000..b148e3cb --- /dev/null +++ b/src/avr/iocall.inc @@ -0,0 +1,44 @@ +' IOCALL.INC + +' ----------------------------------------------------------------------------- + +PUBLIC IO_READY% + +$LINK "IOCALL.OBJ" + +DECLARE SUB IO_TEST() +DECLARE SUB IO_TEACH_ID(STRING) + +DECLARE SUB IO_INIT(INTEGER,LONG) +DECLARE SUB IO_INIT_D7PE(INTEGER,LONG) +DECLARE SUB IO_INIT_PRESERVE(INTEGER,LONG) +DECLARE SUB IO_REINIT(INTEGER,LONG) +DECLARE SUB IO_REINIT_WAIT(INTEGER,LONG) +DECLARE SUB IO_FLUSH(INTEGER) +DECLARE SUB IO_FLUSH_ADLC(INTEGER) + +DECLARE SUB IO_TX(INTEGER,INTEGER) +DECLARE SUB IO_TX_WAIT(INTEGER,INTEGER) +DECLARE SUB IO_TX_STATUS(INTEGER,INTEGER) +DECLARE SUB IO_TX_COMPLETE(INTEGER,INTEGER) +DECLARE SUB IO_TX_ADLC(INTEGER,STRING,STRING) + +DECLARE SUB IO_RX(INTEGER,INTEGER) +DECLARE SUB IO_RX_WAIT(INTEGER,INTEGER) +DECLARE SUB IO_RX_ADLC(INTEGER,STRING,STRING) + +DECLARE SUB IO_SET_DTR(INTEGER,INTEGER) +DECLARE SUB IO_SET_RTS(INTEGER,INTEGER) +DECLARE SUB IO_SET_BREAK(INTEGER,INTEGER) +DECLARE SUB IO_SET_ADLC(INTEGER,INTEGER) +DECLARE SUB IO_SET_AUTOS(INTEGER,INTEGER) + +DECLARE SUB IO_READ_DCD(INTEGER,INTEGER) +DECLARE SUB IO_READ_DSR(INTEGER,INTEGER) +DECLARE SUB IO_READ_CTS(INTEGER,INTEGER) +DECLARE SUB IO_READ_RI(INTEGER,INTEGER) + +DECLARE SUB IO_QUEUE(INTEGER) + +' ----------------------------------------------------------------------------- + diff --git a/src/avr/lcter.asm b/src/avr/lcter.asm new file mode 100644 index 00000000..892cb1f2 --- /dev/null +++ b/src/avr/lcter.asm @@ -0,0 +1,2398 @@ +; LC.ASM +; WEIGHING MODE + +.INCLUDE "4433DEF.INC" ; FOR AVR ASSEMBLER +;.INCLUDE "4433DEFX.INC" ; FOR NICK ASSEMBLER +.INCLUDE "MACLC.INC" +;.INCLUDE "APILC.INC" +.INCLUDE "TERLC.INC" + +; WE SHOULD CHANGE THE CODE TO USE UCSRA AND UCSRB +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU RAM =$60 ; START OF SRAM +.EQU CR =$0D +.EQU LF =$0A +.EQU RX_SIZE =1 +.EQU TX_SIZE =8 ; LEAVES 10 BYTES FREE +.EQU API_ADDRESS =$01 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU CYC_MAX =256 ; MAXIMUM WEIGHING CYCLE TIME +.EQU CYC_MIN =160 ; MINIMUM WEIGHING CYCLE TIME > 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +LSTGMS: .BYTE 4 +LSTDEV: .BYTE 4 +AVEGMS: .BYTE 4 +AVESTD: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +;WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +;REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 ; CAREFUL +DSPGMS: .BYTE 4 +ZROGMS: .BYTE 4 +DSPRES: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +.ESEG +.ORG $000 +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 SPAN FOR MELB/DELAWARE +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD +;SPAN: .DB $6C,$21,$80,$3F ; 1.0010200E+00 SPAN FOR QATAR + +;CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +;CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) + +CNFHYS: .DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +HYSCNF: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +;K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 +;K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 COULD PERHAPS USE KR0001 INSTEAD +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 COULD PERHAPS ELIMINATE THIS +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +;K0: .DB $00,$00 ; 0.000000E+00 DON'T MOVE! +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 ! +;K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +;K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K228: .DB $39,$8E,$63,$43 ; 2.275556E+02 = 256*16/18 REVISED 17MAY01 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 SHOULD PUT ZERO RANGE IN EEPROM +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +; CHARACTERIZE ONLY % +;K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +;K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +;K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +;FMAT3: .DB 6,0 +; .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: + OUTI SPL,RAMEND ; INIT STACK POINTER + OUTI ACSR,$80 ; POWER DOWN ANALOG COMPARATOR + +; SBI DDRB,5 ; SET SK TO OUTPUT FOR DIAGNOSTICS + + SBI DDRD,2 ; SET BIT 2 TO OUTPUT FOR TEMP SENSOR + SBI DDRD,3 ; SET BIT 3 TO OUTPUT FOR TILT SENSOR + + OUTI TCCR1B,1 ; SET COUNTER1 TO CLOCK AT 11.0592 MHZ + ; AND INPUT CAPTURE ON FALLING EDGE +; OUTI MCUCR,2 ; SET INT0 FALLING EDGE FOR TEMP SENSOR + OUTI MCUCR,0 ; SET INT0 LOW SENSE FOR TEMP SENSOR + ; 17MAY01 BOMBS GRACEFULLY AT EACH EXTREME + + CLR CYC_0 + CLR CYC_1 + + CLR A + STS RANGE,A + RCALL STS_STATUS_A + STS STARTUP,A + STS TMP_PHASE,A + + ;LDER A,EEMODE +; CHARACTERIZE ONLY % +; LDI A,$F0 +; % + STS MODE,A + +; WEIGHING ONLY % + LDI A,1 + STS MODE_CYCLE,A +; % + + FLDF K1 + FST DSPRES + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST LSTGMS + FST LSTDEV + FST AVEGMS + FST AVESTD + FST INTGMS +; CHARACTERIZE ONLY % +; FST WGTFRQ ; MAY NOT BE NECESSARY +; FST REF_30MHZ ; NECESSARY +; % + + INIT_API_BUS ; SET UART RATE AND CLEAR FLAGS/PTRS + + IN A,TIMSK + ORI A,8 ; ENABLE INTERRUPT ON T1 INPUT CAPTURE + OUT TIMSK,A + +; WEIGHING ONLY % + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A +; % + + ; START FOREGROUND TASK + SEI + +; LDFL D,SIGNON ; SEND SIGNON MESSAGE +; LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR + +LOOP: ; MAIN PROGRAM + ; IF THE INTERRUPT ALREADY CAME, + ; THROW AWAY THE DATA AND WAIT FOR A NEW ONE + CBR FLAGS,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) + FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD + LDI F,AVESTD + RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST + FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST INTGMS ; INTGMS=0 + RCALL LDS_A_STATUS + CBR A,1<LDER) GET RANGE COUNT + LDI ZL,RANGE1*2 ; POINT TO FIRST RANGE BOUNDARY +RNGE: RCALL CPE_FA ; COMPARE FA WITH BOUNDARY + BRCS GOTRNG + ADIW ZL,4 ; POINT TO NEXT RNG + DEC E + BRNE RNGE + SBIW ZL,4 ; POINT BACK TO PREVIOUS RESOLUTION +GOTRNG: RCALL LDE_FA ; GET DISPLAY RESOLUTION FOR THIS RANGE + FST DSPRES + +; STABILIZE DISPLAYED WEIGHT USING HYSTERESIS +STAB: FLD F0 + MOV F,FA2 ; SAVE SIGN BIT + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + FST F2 + RCALL FIX_FA ; TRUNCATE TO 3 BYTE INTEGER + RCALL LD3 ; CONVERT BACK TO FP FORMAT + FST F0 ; INTEGER PART + FLD F2 + FSB F0 ; FA = FRACTIONAL PART + FCPF HSTRSL + BRCS STB2 ; FRACTION < HSTRSL, ROUND DOWN + FCPF HSTRSH + BRCC STB1 ; FRACTION >= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE + FML DSPRES ; DISPLAY RESOLUTION + ; % + FST DSPGMS + +STB5: ;LDS A,MODE ; IF NOT WEIGHING MODE + ;SBRS A,DSPGMS_FLG + ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS + + LDI E,CYC_MIN*2/3 + RCALL TX_WAIT_EMPTY + BRCS FMT + RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE + +FMT: RCALL LDS_A_STATUS + SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? + RJMP SKIP_SN + + CBR A,1<=0 + BRPL FMT2 ; THEN CONTINUE +; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) + INC E ; INC " -LO-" COUNTER (STARTUP) + CPI E,CYC_START+8 ; IF STARTUP E + ;RCALL SNDSTR + ;LDI A,'0' + ;RCALL TX_WAIT + ;RJMP DSP8 + ; % + RJMP DSP7 +FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" + BRCS FMT3 + LDI E,CYC_START ; THEN STARTUP=CYC_START + STS STARTUP,E +FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX + BRCS FMT4 + SBR F,1< E + LDFL D,FMAT0 ; " 0.000" + ADIW ZL,2 +DSP2: CP F,D + BRCC DSP4 +DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 + BREQ DSP8 ; WHEN ALL DONE + CPI D,4 + BRNE DSP2 + DEC F ; TO COMPENSATE FOR EXTRA DEC C + RJMP DSP3 ; DO DECIMAL PT +DSP4: + ; FOR TENTHS OF GRAMS % + ;INC F + ; % + RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +DSP5: DEC F + BREQ DSP8 + CPI F,4 + ; FOR TENTHS OF GRAMS % + ;CPI F,5 + ; % + BRNE DSP6 + LDI A,'.' + RCALL TX_WAIT + DEC F +DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + RJMP DSP5 +DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E + RCALL SNDSTR +DSP8: +; ASCII STABILITY INDICATION FOR TESTING % +; LDI A,' ' +; RCALL TX_WAIT +; RCALL LDS_A_STATUS +; ANDI A,1< 1 SECOND ? +; BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION +; +; FSBF K33M +; FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE +; +; SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RJMP STS_FA ; AND SAVE + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % + INC FA3 ; CHECK FOR NAN + BRNE SND0 + DEC FA3 ; TO COMPLY WITH IEEE754 +SND0: DEC FA3 + ROL FA2 ; CONVERT TO IEEE754 + ROR FA3 + ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % + LDS B,MODE_CYCLE + AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + +; WEIGHING ONLY % + LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E + RCALL TX_WAIT_EMPTY + BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM +; % + +SNDFPX: +; CHARACTERIZE ONLY % +; SBRS FLAGS,SNDDAT +; RET +; CPI A,$80 +; LDI A,$0A +; BRNE SEPOK +; LDI A,$0D +;SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % + LDI A,$1B + RCALL TX_WAIT + MOV A,F ; INDICATE WHICH DATA IS BEING SENT + RCALL TX_WAIT +;SND_FA: + LDI XL,FA ; LOAD TX BUFFER + LDI D,4 +SND1: LD A,X+ + RCALL TX_WAIT ; LS BYTE FIRST + DEC D + BRNE SND1 + RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -16 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION > +5 + BRLO CORRECTION_OK +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_DOLLAR +; LDI A,'$' +; RCALL TX_CHAR +;SKIP_DOLLAR: +; POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + + CLI ; 17MAY01 + LDS G,TMP_PHASE ; START TEMPERATURE MEASUREMENT % + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT TO SYNCHRONISE SUBSEQUENT INT0 + BRNE TMP0 + + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT + IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA:LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA:LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +;SNDEXP: +; PUSH A ; SEPARATOR +; RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +;EXP5: FCPF KR0001 ; IF N<.0001 +; BRCC EXP6 +; FMLF K100K ; THEN N=N*100K +; SUBI F,5 ; E=E-5 +; RJMP EXP5 +;EXP6: FCPF K1 ; IF N<1 +; BRCC EXP7 +; FMLF K10 ; THEN N=N*10 +; SUBI F,1 ; E=E-1 +; RJMP EXP6 +;EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 +; RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +; LDI A,'.' +; RCALL TX_WAIT +; LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +;EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; DEC E +; BRNE EXP8 +; LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY +; RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION +; LDI A,'0' +; RCALL TX_WAIT +; LDI A,'E' ; NOW FOR THE EXPONENT +; RCALL TX_WAIT +; LDI A,'+' ; SEND SIGN +; TST F +; BRPL EXP9 +; LDI A,'-' +; NEG F ; ABS(E) +;EXP9: RCALL TX_WAIT +; LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +;EXP10: INC A +; SUBI F,10 +; BRPL EXP10 +; RCALL TX_WAIT +; LDI A,'0'+10 ; NOW LS DIGIT +; ADD A,F +; RCALL TX_WAIT +; POP A +; RCALL TX_WAIT ; SEPARATOR +;EXP11: FLD F0 ; AND RESTORE FA +; RET +; +;EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 +; LDI A,' ' ; SEND SIGN (SPACE FOR +) +; TST FA2 +; BRPL EXP1 +; LDI A,'-' +;EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +;EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT + ;;FMLF K_1 ; LET'S BE SAFE ;; LET'S NOT +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS +EXP4: RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1< 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +LSTGMS: .BYTE 4 +LSTDEV: .BYTE 4 +AVEGMS: .BYTE 4 +AVESTD: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +;WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +;REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 ; CAREFUL +DSPGMS: .BYTE 4 +ZROGMS: .BYTE 4 +DSPRES: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +.ESEG +.ORG $000 +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 SPAN FOR MELB/DELAWARE +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD +;SPAN: .DB $6C,$21,$80,$3F ; 1.0010200E+00 SPAN FOR QATAR + +;CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +;CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) + +CNFHYS: .DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +HYSCNF: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +;K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 +;K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 COULD PERHAPS USE KR0001 INSTEAD +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 COULD PERHAPS ELIMINATE THIS +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +;K0: .DB $00,$00 ; 0.000000E+00 DON'T MOVE! +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 ! +;K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +;K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K228: .DB $39,$8E,$63,$43 ; 2.275556E+02 = 256*16/18 REVISED 17MAY01 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 SHOULD PUT ZERO RANGE IN EEPROM +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +; CHARACTERIZE ONLY % +;K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +;K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +;K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +;FMAT3: .DB 6,0 +; .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: + OUTI SPL,RAMEND ; INIT STACK POINTER + OUTI ACSR,$80 ; POWER DOWN ANALOG COMPARATOR + +; SBI DDRB,5 ; SET SK TO OUTPUT FOR DIAGNOSTICS + + SBI DDRD,2 ; SET BIT 2 TO OUTPUT FOR TEMP SENSOR + SBI DDRD,3 ; SET BIT 3 TO OUTPUT FOR TILT SENSOR + + OUTI TCCR1B,1 ; SET COUNTER1 TO CLOCK AT 11.0592 MHZ + ; AND INPUT CAPTURE ON FALLING EDGE +; OUTI MCUCR,2 ; SET INT0 FALLING EDGE FOR TEMP SENSOR + OUTI MCUCR,0 ; SET INT0 LOW SENSE FOR TEMP SENSOR + ; 17MAY01 BOMBS GRACEFULLY AT EACH EXTREME + + CLR CYC_0 + CLR CYC_1 + + CLR A + STS RANGE,A + RCALL STS_STATUS_A + STS STARTUP,A + STS TMP_PHASE,A + + ;LDER A,EEMODE +; CHARACTERIZE ONLY % +; LDI A,$F0 +; % + STS MODE,A + +; WEIGHING ONLY % + LDI A,1 + STS MODE_CYCLE,A +; % + + FLDF K1 + FST DSPRES + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST LSTGMS + FST LSTDEV + FST AVEGMS + FST AVESTD + FST INTGMS +; CHARACTERIZE ONLY % +; FST WGTFRQ ; MAY NOT BE NECESSARY +; FST REF_30MHZ ; NECESSARY +; % + + INIT_API_BUS ; SET UART RATE AND CLEAR FLAGS/PTRS + + IN A,TIMSK + ORI A,8 ; ENABLE INTERRUPT ON T1 INPUT CAPTURE + OUT TIMSK,A + +; WEIGHING ONLY % + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A +; % + + ; START FOREGROUND TASK + SEI + +; LDFL D,SIGNON ; SEND SIGNON MESSAGE +; LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E +; RCALL SNDSTR + +LOOP: ; MAIN PROGRAM + ; IF THE INTERRUPT ALREADY CAME, + ; THROW AWAY THE DATA AND WAIT FOR A NEW ONE + CBR FLAGS,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) + FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD + LDI F,AVESTD + RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST + FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST INTGMS ; INTGMS=0 + RCALL LDS_A_STATUS + CBR A,1<LDER) GET RANGE COUNT + LDI ZL,RANGE1*2 ; POINT TO FIRST RANGE BOUNDARY +RNGE: RCALL CPE_FA ; COMPARE FA WITH BOUNDARY + BRCS GOTRNG + ADIW ZL,4 ; POINT TO NEXT RNG + DEC E + BRNE RNGE + SBIW ZL,4 ; POINT BACK TO PREVIOUS RESOLUTION +GOTRNG: RCALL LDE_FA ; GET DISPLAY RESOLUTION FOR THIS RANGE + FST DSPRES + +; STABILIZE DISPLAYED WEIGHT USING HYSTERESIS +STAB: FLD F0 + MOV F,FA2 ; SAVE SIGN BIT + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + FST F2 + RCALL FIX_FA ; TRUNCATE TO 3 BYTE INTEGER + RCALL LD3 ; CONVERT BACK TO FP FORMAT + FST F0 ; INTEGER PART + FLD F2 + FSB F0 ; FA = FRACTIONAL PART + FCPF HSTRSL + BRCS STB2 ; FRACTION < HSTRSL, ROUND DOWN + FCPF HSTRSH + BRCC STB1 ; FRACTION >= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE + FML DSPRES ; DISPLAY RESOLUTION + ; % + FST DSPGMS + +STB5: ;LDS A,MODE ; IF NOT WEIGHING MODE + ;SBRS A,DSPGMS_FLG + ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS + + LDI E,CYC_MIN*2/3 + RCALL TX_WAIT_EMPTY + BRCS FMT + RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE + +FMT: RCALL LDS_A_STATUS + SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? + RJMP SKIP_SN + + CBR A,1<=0 + BRPL FMT2 ; THEN CONTINUE +; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) + INC E ; INC " -LO-" COUNTER (STARTUP) + CPI E,CYC_START+8 ; IF STARTUP E + ;RCALL SNDSTR + ;LDI A,'0' + ;RCALL TX_WAIT + ;RJMP DSP8 + ; % + RJMP DSP7 +FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" + BRCS FMT3 + LDI E,CYC_START ; THEN STARTUP=CYC_START + STS STARTUP,E +FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX + BRCS FMT4 + SBR F,1< E + LDFL D,FMAT0 ; " 0.000" + ADIW ZL,2 +DSP2: CP F,D + BRCC DSP4 +DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 + BREQ DSP8 ; WHEN ALL DONE + CPI D,4 + BRNE DSP2 + DEC F ; TO COMPENSATE FOR EXTRA DEC C + RJMP DSP3 ; DO DECIMAL PT +DSP4: + ; FOR TENTHS OF GRAMS % + ;INC F + ; % + RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +DSP5: DEC F + BREQ DSP8 + CPI F,4 + ; FOR TENTHS OF GRAMS % + ;CPI F,5 + ; % + BRNE DSP6 + LDI A,'.' + RCALL TX_WAIT + DEC F +DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + RJMP DSP5 +DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E + RCALL SNDSTR +DSP8: +; ASCII STABILITY INDICATION FOR TESTING % +; LDI A,' ' +; RCALL TX_WAIT +; RCALL LDS_A_STATUS +; ANDI A,1< 1 SECOND ? +; BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION +; +; FSBF K33M +; FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE +; +; SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RJMP STS_FA ; AND SAVE + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % + INC FA3 ; CHECK FOR NAN + BRNE SND0 + DEC FA3 ; TO COMPLY WITH IEEE754 +SND0: DEC FA3 + ROL FA2 ; CONVERT TO IEEE754 + ROR FA3 + ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % + LDS B,MODE_CYCLE + AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + +; WEIGHING ONLY % + LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E + RCALL TX_WAIT_EMPTY + BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM +; % + +SNDFPX: +; CHARACTERIZE ONLY % +; SBRS FLAGS,SNDDAT +; RET +; CPI A,$80 +; LDI A,$0A +; BRNE SEPOK +; LDI A,$0D +;SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % + LDI A,$1B + RCALL TX_WAIT + MOV A,F ; INDICATE WHICH DATA IS BEING SENT + RCALL TX_WAIT +;SND_FA: + LDI XL,FA ; LOAD TX BUFFER + LDI D,4 +SND1: LD A,X+ + RCALL TX_WAIT ; LS BYTE FIRST + DEC D + BRNE SND1 + RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -16 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION > +5 + BRLO CORRECTION_OK +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_DOLLAR +; LDI A,'$' +; RCALL TX_CHAR +;SKIP_DOLLAR: +; POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + + CLI ; 17MAY01 + LDS G,TMP_PHASE ; START TEMPERATURE MEASUREMENT % + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT TO SYNCHRONISE SUBSEQUENT INT0 + BRNE TMP0 + + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT + IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA:LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA:LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +;SNDEXP: +; PUSH A ; SEPARATOR +; RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +;EXP5: FCPF KR0001 ; IF N<.0001 +; BRCC EXP6 +; FMLF K100K ; THEN N=N*100K +; SUBI F,5 ; E=E-5 +; RJMP EXP5 +;EXP6: FCPF K1 ; IF N<1 +; BRCC EXP7 +; FMLF K10 ; THEN N=N*10 +; SUBI F,1 ; E=E-1 +; RJMP EXP6 +;EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 +; RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +; LDI A,'.' +; RCALL TX_WAIT +; LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +;EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; DEC E +; BRNE EXP8 +; LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY +; RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION +; LDI A,'0' +; RCALL TX_WAIT +; LDI A,'E' ; NOW FOR THE EXPONENT +; RCALL TX_WAIT +; LDI A,'+' ; SEND SIGN +; TST F +; BRPL EXP9 +; LDI A,'-' +; NEG F ; ABS(E) +;EXP9: RCALL TX_WAIT +; LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +;EXP10: INC A +; SUBI F,10 +; BRPL EXP10 +; RCALL TX_WAIT +; LDI A,'0'+10 ; NOW LS DIGIT +; ADD A,F +; RCALL TX_WAIT +; POP A +; RCALL TX_WAIT ; SEPARATOR +;EXP11: FLD F0 ; AND RESTORE FA +; RET +; +;EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 +; LDI A,' ' ; SEND SIGN (SPACE FOR +) +; TST FA2 +; BRPL EXP1 +; LDI A,'-' +;EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +;EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT + ;;FMLF K_1 ; LET'S BE SAFE ;; LET'S NOT +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS +EXP4: RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1< 6 + ; < 210 ELSE OVERFLOW FOR FREQ < 27KHZ + +.EQU CYC_ZERO =16 ; INITIAL ZEROING COUNT +.EQU CYC_START =32 ; INITIAL SMOOTHING COUNT + + ; BITS IN RANGE +.EQU RNG =$0F ; RANGE BITS 0-3 +.EQU RND =6 ; ROUND UP (FOR HYSTERESIS) +.EQU SGN =7 ; SIGN (FOR HYSTERESIS) + ; SGN MUST BE BIT 7 FOR EOR INSTRUCTION + + ; BITS IN STATUS +.EQU OUCHFLG =0 ; OVERLOAD +.EQU LOWFLG =1 ; UNDERLOAD +.EQU UNSTBL =2 ; UNSTABLE +.EQU VSTBL =3 ; VERY STABLE +.EQU ZROFLG =4 ; DISPLAY SHOWS ZERO +.EQU TRYZRO =5 ; TRYING TO SET ZERO +.EQU SEND_SN =6 ; TRYING TO SEND S/N MESSAGE +.EQU SEND_SPAN =7 ; TRYING TO SEND SPAN MESSAGE + + ; BITS IN FLAGS +.EQU SNDDAT =0 ; SEND CHARACTERIZE DATA +.EQU ESC =1 ; SET AFTER RECEIVING ESC +.EQU ESCM =2 ; SET AFTER RECEIVING ESC M +.EQU BOMB =3 ; SET DURING TILT MEASUREMENT +.EQU NEWDAT =4 ; NEW SCALE DATA AVAILABLE +.EQU DIR =5 ; DIRECTION OF CHANGE IN WGT +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + + ; BITS IN MODE +.EQU ABSGMS_FLG =0 ; ABSOLUTE WEIGHT IN FP FORMAT +.EQU ZROGMS_FLG =1 ; ZERO REGISTER IN FP FORMAT +.EQU TMPDEG_FLG =2 ; TEMPERATURE (DEGREES) IN FP FORMAT +.EQU TLTBUB_FLG =3 ; TILT BUBBLE POSITION IN INT FORMAT +.EQU WGTFRQ_FLG =4 ; WEIGHT FREQUENCY IN FP FORMAT +.EQU TMPFRQ_FLG =5 ; TEMPERATURE FREQUENCY IN FP FORMAT +.EQU TLRFRQ_FLG =6 ; TILT LEFT/RIGHT IN FP FORMAT +.EQU TFBFRQ_FLG =7 ; TILT FRONT/BACK IN FP FORMAT + +.DEF FC0 =R0 ; AUXILLIARY FP ACCUMULATOR +.DEF FC1 =R1 +.DEF FC2 =R2 + +.EQU FB =$03 +.DEF FB0 =R3 ; ARGUMENT FP ACCUMULATOR +.DEF FB1 =R4 +.DEF FB2 =R5 +.DEF FB3 =R6 + +.EQU FA =$07 +.DEF FA0 =R7 ; PRINCIPAL FP ACCUMULATOR +.DEF FA1 =R8 +.DEF FA2 =R9 +.DEF FA3 =R10 + +.DEF CYC_0 =R11 +.DEF CYC_1 =R12 + +.DEF WT_0 =R13 ; RUNNING COUNT FOR 16 WEIGHT CYCLES +.DEF WT_1 =R14 ; TIMER1 INPUT CAPTURE LOW +.DEF WT_2 =R15 ; TIMER1 INPUT CAPTURE HIGH + +.DEF A =R17 ; GLOBAL REGISTERS +.DEF B =R18 +.DEF D =R19 +.DEF E =R20 +.DEF F =R21 + +.DEF SR =R22 ; SECONDARY REGISTER SET +.DEF G =R23 +.DEF H =R24 +.DEF I =R25 +.DEF J =R27 ; XH +.DEF K =R29 ; YH + +.DEF FLAGS =R16 ; MUST BE REGISTER, FOR ATOMIC ACCESS + +.DSEG +.ORG RAM + +STARTUP: .BYTE 1 ; SMOOTHING COUNT FOR INITIAL STARTUP +F3: +TLTL_BUF: .BYTE 2 ; DATA OUTPUT BUFFERS +TLTR_BUF: .BYTE 2 +F4: +TLTF_BUF: .BYTE 2 +TLTB_BUF: .BYTE 2 +WGT: .BYTE 3 ; ACCUMULATOR FOR 64 GROUPS OF 16 +TMP: .BYTE 3 ; ACCUMULATOR FOR 256 TEMPERATURE +TLTL: .BYTE 2 ; ACCUMULATOR FOR 64 TILT CYCLES (TLT0) +TLTR: .BYTE 2 +TLTF: .BYTE 2 ; (TLT1) +TLTB: .BYTE 2 +DTMP: .BYTE 2 ; DIFFERENCE COUNT FOR CURRENT TEMP CYC +WGTLST: .BYTE 3 ; VALUE OF ADDITION TO WGT ON LAST CYC +TL: .BYTE 4 ; AVERAGED TLTLR +TF: .BYTE 4 ; AVERAGED TLTFB +TMPFRQ: .BYTE 4 ; TEMPERATURE FREQUENCY CYCLES/30MHZ +GMS: .BYTE 4 +LSTGMS: .BYTE 4 +LSTDEV: .BYTE 4 +AVEGMS: .BYTE 4 +AVESTD: .BYTE 4 +INTGMS: .BYTE 4 +COUNT: .BYTE 4 + +F0: .BYTE 4 ; FLOATING POINT REGISTERS +F1: .BYTE 4 +F2: .BYTE 4 +RANGE: .BYTE 1 +STATUS: .BYTE 1 +MODE: .BYTE 1 +MODE_CYCLE: .BYTE 1 ; WEIGHING ONLY +;WGTFRQ: .BYTE 4 ; CHARACTERIZE ONLY +;REF_30MHZ: .BYTE 4 ; CHARACTERIZE ONLY +TMP_PHASE: .BYTE 1 ; CAREFUL +DSPGMS: .BYTE 4 +ZROGMS: .BYTE 4 +DSPRES: .BYTE 4 + +API_REMAIN: .BYTE 1 +RX_PTR: .BYTE 1 +RX_COUNT: .BYTE 1 +RX_BUF: .BYTE RX_SIZE +TX_PTR: .BYTE 1 +TX_COUNT: .BYTE 1 +TX_BUF: .BYTE TX_SIZE ; CAREFUL - COULD BE CLOBBERED BY STACK + +.ESEG +.ORG $000 +VOID: .DB $00,$00 ; DON'T USE ADDR $000 +;EEMODE: .DB $00,$00 ; SEND ASCII WEIGHT DATA ONLY + +;SPAN: .DB $00,$00,$80,$3F ; 1.0000000E+00 SPAN FOR MELB/DELAWARE +SPAN: .DB $1B,$BA,$7F,$3F ; 0.9989335E+00 SPAN FOR JSY/NLD +;SPAN: .DB $6C,$21,$80,$3F ; 1.0010200E+00 SPAN FOR QATAR + +;CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +;CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +;CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +RANGES: .DB $04,$00 ; OIML APO30 +RANGE1: .DB $00,$40,$1C,$45 ; 2500 + .DB $00,$00,$80,$3F ; 1 + .DB $00,$40,$9C,$45 ; 5000 + .DB $00,$00,$A0,$40 ; 5 + .DB $00,$40,$1C,$46 ; 10000 + .DB $00,$00,$20,$41 ; 10 +RNGMAX: .DB $00,$D8,$EA,$46 ; 30060 + .DB $00,$00,$A0,$41 ; 20 + +.CSEG + + .ORG 0 + RJMP RESET_ENTRY + + .ORG INT0ADDR + RJMP TMP_INT ; INT0 HANDLER FOR TEMPERATURE MEASUREMENT + + .ORG ICP1ADDR + RJMP WGT_INT ; TIMER1 CAPTURE HANDLER + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER + +.INCLUDE "PRM.INC" ; LOAD CELL CHARACTERIZE PARAMETERS + +TLT2: .DB $C7,$75,$41,$AF ;-1.759509E-10 TILT LINEARISATION PARAMETERS +TLT1: .DB $25,$7E,$0B,$35 ; 5.196510E-07 +TLT0: .DB $04,$31,$E3,$39 ; 4.333333E-04 + +TICKS: .DB $AE,$11,$8D,$45 ; 4.514210E+03 = 4096*33.06306M/30M + +HSTRSL: .DB $33,$33,$B3,$3E ; 3.500000E-01 = (0.5-0.15) +HSTRSH: .DB $66,$66,$26,$3F ; 6.500000E-01 = (0.5+0.15) + +CNFHYS: .DB $00,$00,$A0,$41 ; 2.000000E+01 = 3/.15 +HYSCNF: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 = .3/3 +QUANT: .DB $CD,$CC,$4C,$3E ; 2.000000E-01 + +;K_1: .DB $00,$00,$80,$BF ;-1.000000E+00 +;K_R5: .DB $00,$00,$00,$BF ;-5.000000E-01 +KR0001: .DB $17,$B7,$D1,$38 ; 1.000000E-04 +KR005: .DB $0A,$D7,$A3,$3B ; 5.000000E-03 COULD PERHAPS USE KR0001 INSTEAD +KR1: .DB $CD,$CC,$CC,$3D ; 1.000000E-01 +KR3: .DB $9A,$99,$99,$3E ; 3.000000E-01 COULD PERHAPS ELIMINATE THIS +KR5: .DB $00,$00,$00,$3F ; 5.000000E-01 +;K0: .DB $00,$00 ; 0.000000E+00 DON'T MOVE! +K1: .DB $00,$00,$80,$3F ; 1.000000E+00 ! +;K2: .DB $00,$00,$00,$40 ; 2.000000E+00 +K3: .DB $00,$00,$40,$40 ; 3.000000E+00 +K4: .DB $00,$00,$80,$40 ; 4.000000E+00 +K10: .DB $00,$00,$20,$41 ; 1.000000E+01 +K16: .DB $00,$00,$80,$41 ; 1.600000E+01 +K20: .DB $00,$00,$A0,$41 ; 2.000000E+01 +K30: .DB $00,$00,$F0,$41 ; 3.000000E+01 +K64: .DB $00,$00,$80,$42 ; 6.400000E+01 +;K100: .DB $00,$00,$C8,$42 ; 1.000000E+02 +;K256: .DB $00,$00,$80,$43 ; 2.560000E+02 +K228: .DB $39,$8E,$63,$43 ; 2.275556E+02 = 256*16/18 REVISED 17MAY01 +K400: .DB $00,$00,$C8,$43 ; 4.000000E+02 +K450: .DB $00,$00,$E1,$43 ; 4.500000E+02 SHOULD PUT ZERO RANGE IN EEPROM +;K1450: .DB $00,$40,$B5,$44 ; 1.450000E+03 +;K10K: .DB $00,$40,$1C,$46 ; 1.000000E+04 +; CHARACTERIZE ONLY % +;K100K: .DB $00,$50,$C3,$47 ; 1.000000E+05 +;K30M: .DB $C0,$E1,$E4,$4B ; 3.000000E+07 +;K33M: .DB $00,$20,$FD,$4B ; 3.317760E+07 +; % + +; PUT THIS IN EEPROM: +;SIGNON: .DB 3,0 ; MUST HAVE EVEN NUMBER OF CHARS +; .DB "LC" +; .DB $0D,$0A +FMAT0: .DB 6,0 + .DB " 0.000" +FMAT1: .DB 6,0 + .DB "-OUCH " +FMAT2: .DB 6,0 + .DB " -LO- " +;FMAT3: .DB 6,0 +; .DB "HELLO " +;FMAT4: .DB 6,0 +; .DB "Error " +FMAT5: .DB 6,0 + .DB " " +FMAT6: .DB 2,0 + .DB $0D,$0A +;FMAT6: .DB 3,0 +; .DB $20,$0D,$0A,0 + +;------------------------------------------------------------------------------ + +RESET_ENTRY: +; ATmega8: + OUTI SPL,LOW(RAMEND) ; INIT STACK POINTER + OUTI SPH,HIGH(RAMEND) +; OUTI SPL,RAMEND ; INIT STACK POINTER + OUTI ACSR,1< E +; RCALL SNDSTR + +LOOP: ; MAIN PROGRAM + ; IF THE INTERRUPT ALREADY CAME, + ; THROW AWAY THE DATA AND WAIT FOR A NEW ONE + CBR FLAGS,1< QUANT) + FST F0 ; ELSE STD=ABS(DEV) (APPROX STD DEV) + + ; SET AVERAGING PERIOD +AV1: FLD COUNT ; IF STD/AVESTD > CNT/(CNT+1) + FML AVESTD ; (STILL TOO NOISY) + FST F1 + FLD COUNT + FADF K1 + FST F2 + FML F0 + FCP F1 + BRCS AV2 + FLD F2 ; THEN INCR CNT (EXTEND AVERAGE) + FST COUNT +AV2: FLD AVESTD ; MAXCNT=(AVESTD/DSPRES)*(CONF/HYST) + FDV DSPRES + FMLF CNFHYS + FST F1 + FCP COUNT ; IF CNT > MAXCNT + BRCC AV3 ; (UNTIL STD DEV < HYST) + RCALL LDS_A_STATUS ; THEN VERY STABLE=1 + SBR A,1< MAXCNT + BRCC AV4 + FLD F1 ; THEN CNT=MAXCNT + FST COUNT + + ; AVERAGE THE DEVIATION +AV4: FLD COUNT ; NN=CNT (WEIGHTING FOR AVESTD) + FST F1 + FLD F0 ; IF STD*3 < AVESTD (VERY QUIET) + FMLF K3 + FCP AVESTD + BRCC AV5 + FLD F1 ; THEN IF NN>10 THEN NN=10 + FCPF K10 ; (ADAPT LOWER QUICKLY) + BRCS AV5 + FLDF K10 + FST F1 ; NN +AV5: FLD F0 ; STD + LDI F,AVESTD + RCALL SMOOTH_FP ; AVESTD=(STD+AVESTD*(NN-1))/NN + FLD COUNT ; IF AVESTD < CNT*DSPRES*HYST + FML DSPRES ; (NO DISPLAY FLICKER) + FMLF HYSCNF + FCP AVESTD + BRCS AV6 + RCALL LDS_A_STATUS ; THEN UNSTABLE=0 (STABLE) + CBR A,1<64 (JUMP CONDITION) + FCPF K64 + BRCS AV13 + FLDF K1 ; THEN CNT=1 + FST COUNT +; FLDF K0 + FCLR ; 17MAY01 + FST INTGMS ; INTGMS=0 + RCALL LDS_A_STATUS + CBR A,1<LDER) GET RANGE COUNT + LDI ZL,RANGE1*2 ; POINT TO FIRST RANGE BOUNDARY +RNGE: RCALL CPE_FA ; COMPARE FA WITH BOUNDARY + BRCS GOTRNG + ADIW ZL,4 ; POINT TO NEXT RNG + DEC E + BRNE RNGE + SBIW ZL,4 ; POINT BACK TO PREVIOUS RESOLUTION +GOTRNG: RCALL LDE_FA ; GET DISPLAY RESOLUTION FOR THIS RANGE + FST DSPRES + +; STABILIZE DISPLAYED WEIGHT USING HYSTERESIS +STAB: FLD F0 + MOV F,FA2 ; SAVE SIGN BIT + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + FST F2 + RCALL FIX_FA ; TRUNCATE TO 3 BYTE INTEGER + RCALL LD3 ; CONVERT BACK TO FP FORMAT + FST F0 ; INTEGER PART + FLD F2 + FSB F0 ; FA = FRACTIONAL PART + FCPF HSTRSL + BRCS STB2 ; FRACTION < HSTRSL, ROUND DOWN + FCPF HSTRSH + BRCC STB1 ; FRACTION >= HSTRSH, ROUND UP + + LDS A,RANGE ; PREVIOUS RANGE, RND, SGN + MOV B,A + EOR B,F ; COMPARE WITH CURRENT SIGN (BIT 7) + BRMI STB2 ; JUST CHANGED SIGN, ROUND DOWN + ANDI A,RNG ; PREVIOUS RANGE + CP A,E ; COMPARE WITH CURRENT RANGE + BRCS STB1 ; JUST GONE TO LOWER RANGE, ROUND UP + BRNE STB2 ; JUST GONE TO HIGHER RANGE, ROUND DOWN + + FLD DSPGMS ; RECALCULATE VALUE FROM LAST TIME + LDI A,$7F + AND FA2,A ; ABS + ; FOR TENTHS OF GRAMS % + ;FDVF KR1 + ; ELSE + FDV DSPRES ; DISPLAY RESOLUTION + ; % + LDS A,RANGE ; PREVIOUS STATE + SBRS A,RND ; IF ROUNDED UP LAST TIME + RJMP STB0 + FSBF K1 ; THEN DECREMENT +STB0: FST F2 ; CORRESPONDING VALUE FROM LAST TIME + FCP F0 + BRCS STB2 ; GONE TO HIGHER VALUE, ROUND DOWN + FLD F0 + FCP F2 + BRCS STB1 ; GONE TO LOWER VALUE, ROUND UP + RJMP STB5 ; ELSE RETAIN EXISTING DSPGMS + +STB1: FLD F0 ; ROUND UPWARDS + FADF K1 + SBR E,1<0 + BREQ STB4 + BLD FA2,7 ; THEN RESTORE SIGN +STB4: BLD E,SGN ; SUPERIMPOSE ON CURRENT RANGE + STS RANGE,E ; SAVE CURRENT RANGE, RND, SGN + ; FOR TENTHS OF GRAMS % + ;FMLF KR1 + ; ELSE + FML DSPRES ; DISPLAY RESOLUTION + ; % + FST DSPGMS + +STB5: ;LDS A,MODE ; IF NOT WEIGHING MODE + ;SBRS A,DSPGMS_FLG + ;RJMP DSP9 ; THEN SKIP OUTPUT IN GRAMS + + LDI E,CYC_MIN*2/3 + RCALL TX_WAIT_EMPTY + BRCS FMT + RJMP DSP9 ; NO TX_BUFFER TO SEND ITEM THIS CYCLE + +FMT: RCALL LDS_A_STATUS + SBRS A,SEND_SN ; NEED TO SEND S/N MESSAGE ? + RJMP SKIP_SN + + CBR A,1<=0 + BRPL FMT2 ; THEN CONTINUE +; FSBF KR005 ; ELIMINATE TRUNCATION ERROR (- VALUES) + INC E ; INC " -LO-" COUNTER (STARTUP) + CPI E,CYC_START+8 ; IF STARTUP E + ;RCALL SNDSTR + ;LDI A,'0' + ;RCALL TX_WAIT + ;RJMP DSP8 + ; % + RJMP DSP7 +FMT1: SBR F,1<CYC_START ' CLEAR " -LO-" + BRCS FMT3 + LDI E,CYC_START ; THEN STARTUP=CYC_START + STS STARTUP,E +FMT3: FCPE RNGMAX ; IF DSPGMS>RNGMAX + BRCS FMT4 + SBR F,1< E + LDFL D,FMAT0 ; " 0.000" + ADIW ZL,2 +DSP2: CP F,D + BRCC DSP4 +DSP3: RCALL STR1 ; GET NEXT CHARACTER FROM FMAT0 + BREQ DSP8 ; WHEN ALL DONE + CPI D,4 + BRNE DSP2 + DEC F ; TO COMPENSATE FOR EXTRA DEC C + RJMP DSP3 ; DO DECIMAL PT +DSP4: + ; FOR TENTHS OF GRAMS % + ;INC F + ; % + RCALL DGT0 ; CONVERT TO ASCII & SEND FIRST DIGIT +DSP5: DEC F + BREQ DSP8 + CPI F,4 + ; FOR TENTHS OF GRAMS % + ;CPI F,5 + ; % + BRNE DSP6 + LDI A,'.' + RCALL TX_WAIT + DEC F +DSP6: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT + RJMP DSP5 +DSP7: ;LDI E,CYC_MIN-10 ; TIMEOUT IS WHEN CYC_1 => E + RCALL SNDSTR +DSP8: +; ASCII STABILITY INDICATION FOR TESTING % +; LDI A,' ' +; RCALL TX_WAIT +; RCALL LDS_A_STATUS +; ANDI A,1< 1 SECOND ? +; BRLO LOOP_END ; NO, CONTINUE CURRENT INTEGRATION +; +; FSBF K33M +; FST REF_30MHZ ; WRAP ELAPSED TIME FOR NEW CYCLE +; +; SBR FLAGS,1<AVERAGE + TST A ; IF N=0 NOTE: CLOBBERS F0, F1 + BREQ SMTH0 ; THEN DO NOTHING + FST F0 ; SAVE CURRENT DATA + MOV FA0,A ; CONVERT N + CLR FA1 + CLR FA2 + RCALL LD3_FA ; TO FP FORMAT + FST F1 ; AND SAVE + FLD F0 ; RETRIEVE CURRENT DATA +SMOOTH_FP: ; ENTRY POINT WITH F1=N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL SUB_FA + FDV F1 ; N + MOV YL,F ; POINT TO EXISTING AVERAGE + RCALL ADD_FA + MOV YL,F ; POINT TO EXISTING AVERAGE + RJMP STS_FA ; AND SAVE + +LIN_TLT: + RCALL LDS2_FA ; CONVERT 2 BYTE TILT COUNT TO FP + MOV F,YL ; TEMP SAVE + FST F0 ; TLTL + MOV YL,F + RCALL LDS2_FA ; CONVERT OPPOSING TILT COUNT TO FP + FDV F2 + FMLF K16 + FST F1 ; TLTR + FML F1 ; TLTR^2 + FST F3 + FLD F0 + FDV F2 + FMLF K16 + FST F0 ; TLTL + FML F0 ; TLTL^2 + FSB F3 ; TLTL^2-TLTR^2 + FMLF TLT2 + FST F3 + FLD F1 + FSB F0 ; TLTR-TLTL + FMLF TLT1 + FSB F3 + FADF TLT0 +SNDFP2: RET + +SNDFP: +; WEIGHING ONLY % + INC FA3 ; CHECK FOR NAN + BRNE SND0 + DEC FA3 ; TO COMPLY WITH IEEE754 +SND0: DEC FA3 + ROL FA2 ; CONVERT TO IEEE754 + ROR FA3 + ROR FA2 +; % + + TST A + BREQ SNDFPX ; ITEM MUST ALWAYS BE SENT + +SNDFPE: LDS B,MODE ; SEND DIAGNOSTIC DATA + AND A,B ; MODE BIT FOR THIS DATA ITEM SET? +; WEIGHING ONLY % + LDS B,MODE_CYCLE + AND A,B ; ROUND ROBIN UP TO THIS DATA ITEM YET? +; % + BREQ SNDFP2 ; DO NOT SEND THIS DATA ITEM THIS CYCLE + +; WEIGHING ONLY % + LDI E,0 ; TIMEOUT IS WHEN CYC_1 => E + RCALL TX_WAIT_EMPTY + BRCC SNDFP2 ; NO TX_BUFFER SPACE TO SEND ITEM +; % + +SNDFPX: +; CHARACTERIZE ONLY % +; SBRS FLAGS,SNDDAT +; RET +; CPI A,$80 +; LDI A,$0A +; BRNE SEPOK +; LDI A,$0D +;SEPOK: RJMP SNDEXP +; % + +; WEIGHING ONLY % + LDI A,$1B + RCALL TX_WAIT + MOV A,F ; INDICATE WHICH DATA IS BEING SENT + RCALL TX_WAIT +;SND_FA: + LDI XL,FA ; LOAD TX BUFFER +; ATmega8: + CLR XH + LDI D,4 +SND1: LD A,X+ + RCALL TX_WAIT ; LS BYTE FIRST + DEC D + BRNE SND1 + RET +; % + +; ----------------------------------------------------------------------------- + +PROCESS_ESC: + SBRC FLAGS,ESCM + RJMP PROCESS_ESC_M1 + + CPI A,'#' + BREQ PROCESS_ESC_HASH + CPI A,'M' + BREQ PROCESS_ESC_M0 +; CPI A,'S' +; BREQ PROCESS_ESC_S + CPI A,'Z' + BREQ PROCESS_ESC_Z + +PROCESS_ESC_DONE: + CBR FLAGS,1< H|I|J + ADC I,I + ADC J,J + ADD H,G + ADC I,K + CLR G + ADC J,G + + MOV G,I + MOV K,J + LSR K + ROR G + + ; ALLOW +/-128 COUNTS OF ERROR DUE TO XTAL TOLERANCES (-60 TYP) + + POP G ; RETRIEVE HC590 DIFFERENCE COUNT + SUB G,H ; CALCULATE AMOUNT TO ADJUST H|I|J +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_COUNT +; MOV A,G +; RCALL TX_CHAR +;SKIP_COUNT: +; POP A + LDS K,STARTUP ; CHANGED 26MAR01 TO ALLOW FOR + TST K ; NEW BATCH OF 11MHZ XTALS + BREQ CORRECTION_OK + CPI G,-48 ; ASSUME NORMAL CORRECTION > -16 + BRSH CORRECTION_OK + CPI G,16 ; OR CORRECTION > +5 + BRLO CORRECTION_OK +; PUSH A +; LDS A,TX_COUNT +; CPI A,TX_SIZE +; BRSH SKIP_DOLLAR +; LDI A,'$' +; RCALL TX_CHAR +;SKIP_DOLLAR: +; POP A + SUB WT_0,G + LDI G,-12 ; BUT TYPICALLY -12 + ADD WT_0,G +CORRECTION_OK: + LDI K,0 + TST G + BRPL SIGN_EXTEND + LDI K,$FF ; IF NEG +SIGN_EXTEND: + ADD H,G + ADC I,K + ADC J,K ; ADD INTO H|I|J + + LDS G,WGTLST ; TEST DIRECTION OF CHANGE + CP H,G ; DIFFERENCE NOW IN H|I|J + LDS G,WGTLST+1 + CPC I,G + LDS G,WGTLST+2 + CPC J,G + + STS WGTLST,H ; AND SAVE SAMPLE FOR NEXT CYCLE + STS WGTLST+1,I + STS WGTLST+2,J + +; ATmega8: + POP J + POP K + + CLI ; 17MAY01 + LDS G,TMP_PHASE ; START TEMPERATURE MEASUREMENT % + INC G +TMP0: RJMP TMP1 +TMP1: DEC G ; WAIT TO SYNCHRONISE SUBSEQUENT INT0 + BRNE TMP0 + + SBI PORTD,2 ; ENGAGE PULLUP SO TEMP OUTPUT WILL GO + SBI DDRD,2 ; HIGH, AND SET BIT 2 TO OUTPUT + +; ATmega8: + IN G,GICR ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) +; IN G,GIMSK ; IF PREV INT0 DIDN'T HAPPEN (STILL ON) + SBRC G,INT0 + RCALL TMP_INT00 ; THEN WE MUST PROCESS ANYWAY + CBI DDRD,2 ; SET BIT 2 TO INPUT TO START DISCHARGE + CBI PORTD,2 ; AND REMOVE PULLUP + IN G,TCNT1L ; GET STARTING COUNT FROM TIMER1 + STS DTMP,G + IN G,TCNT1H ; NOW HIGH BYTE + STS DTMP+1,G + SEI + + MOV G,CYC_1 ; CYCLE COUNT, NOT INCLUDING CURRENT + INC CYC_1 ; INCLUDE CURRENT CYCLE + BRCS DEC0 ; NOW LOOK AT CHANGE + CBR FLAGS,1<=24 THEN RETURN + CPI A,24 ; IF EXPONENT<0 + BRCC GO_MIN_FA ; THEN FA=0 + RCALL SGN_FA ; SAVE SIGN & INSERT IMPLICIT BIT +FIX2: LSR FA2 ; SHIFT MANTISSA RIGHT + ROR FA1 + ROR FA0 + DEC A ; (24-EXPONENT) BITS + BRNE FIX2 +FIX0: RET + +GO_MIN_FA: + RJMP MIN_FA + +; REMOVED TO SAVE FLASH % +;CHSS: LDD B,Y+2 ; CHANGE SIGN OF SRAM ARGUMENT +; LDI A,$80 +; EOR B,A ; TOGGLE SIGN BIT +; STD Y+2,B ; AND SAVE +; RET +; % + +LDS2_FA: +; ATmega8: + CLR YH + LD FA0,Y+ ; LOAD FA WITH 2 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + CLR FA2 + RJMP LD3_FA +LDS3_FA: +; ATmega8: + CLR YH + LD FA0,Y+ ; LOAD FA WITH 3 BYTE POSITIVE INTEGER + LD FA1,Y+ ; Y POINTS TO SOURCE + LD FA2,Y+ +LD3_FA: CLT ; SET SIGN POSITIVE +LD3: LDI A,23+BIAS ; SET EXPONENT AND FALL INTO NORMALIZE + MOV FA3,A + +NRM_FA: MOV A,FA0 ; NORMALIZE FA REGISTER + OR A,FA1 + OR A,FA2 + BREQ NRM3 ; IF ZERO THEN CLEAR EXPONENT & EXIT +NRM0: TST FA2 +NRM1: BRMI NRM2 ; IF MANTISSA DENORMALIZED + DEC FA3 ; THEN ADJUST EXPONENT + BREQ MIN_FA ; IF UNDERFLOW THEN RETURN MIN + RCALL LSL_FA ; ELSE SHIFT MANTISSA LEFT + RJMP NRM1 +NRM2: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT + RET +NRM3: CLR FA3 + RET + +;------------------------------------------------------------------------------ + +ADD_FA: RCALL LDS_FB ; ADD SRAM ARGUMENT TO FA REGISTER +ADD0: TST FB3 ; IF FB=0 + BREQ RET0 ; THEN DO NOTHING + TST FA3 ; IF FA=0 + BREQ SWP_FA ; THEN SWAP FA,FB AND EXIT + MOV D,FB2 ; GET SIGN OF ARGUMENT + EOR D,FA2 ; BIT 7 SET IF SIGNS DIFFERENT + MOV A,FA3 + SUB A,FB3 ; IF FA EXPONENT < ARG EXPONENT + BRCC ADD1 + NEG A ; THEN (EXP DIFF)=-(EXP DIFF) + RCALL SWP_FA ; SWAP FA,FB +ADD1: CPI A,24 ; IF EXP DIFFERENCE >= 24 + BRCC RET0 ; THEN DO NOTHING + RCALL SGN_FA ; ELSE SAVE SIGN & INSERT IMPLICIT BIT + OR FB2,B ; INSERT IMPLICIT BIT IN FB ALSO + TST A +ADD2: BREQ ADD3 + LSR FB2 ; SHIFT FB RIGHT TO ALIGN + ROR FB1 + ROR FB0 + DEC A + RJMP ADD2 +ADD3: TST D ; IF SIGNS SAME + BRMI ADD5 + RCALL ADD_FB ; THEN FA=FA+FB + BRCC ADD4 ; IF CARRY + RCALL ROR_FA ; THEN RIGHT SHIFT + INC FA3 ; INC EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +ADD4: BLD FA2,7 ; ELSE OVERLAY WITH SIGN BIT +RET0: RET +ADD5: RCALL SUB_FB ; ELSE FA=FA-FB + BREQ NRM3 ; IF ZERO THEN CLEAR EXP & EXIT + BRCC NRM0 ; IF CARRY + RCALL COM_FA ; THEN FA=-FA + LDI A,-1 + SUB FA0,A + SBC FA1,A + SBC FA2,A + BLD A,7 ; TOGGLE SIGN BIT + COM A + BST A,7 + RJMP NRM0 ; NORMALIZE + +ADDE_FA:RCALL LDE_FB ; ADD EEPROM CONSTANT TO FA REGISTER + RJMP ADD0 + +ADDF_FA:RCALL LDF_FB ; ADD FLASH CONSTANT TO FA REGISTER + RJMP ADD0 + +SUB_FA: RCALL LDS_FB ; SUBTRACT SRAM ARGUMENT FROM FA REG +SUB0: LDI A,$80 + EOR FB2,A ; TOGGLE SIGN + RJMP ADD0 + +SUBE_FA:RCALL LDE_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +SUBF_FA:RCALL LDF_FB ; SUBTRACT FLASH CONSTANT FROM FP REG + RJMP SUB0 + +;------------------------------------------------------------------------------ + +; VARIOUS SUBROUTINES + +MIN_FA: CLR FA3 ; FA=0 +CLR_FA: CLR FA2 ; CLEAR FA + CLR FA1 + CLR FA0 + RET + +SWP_FA: RCALL SWP0 ; SWAP CONTENTS OF FA & FB + RCALL SWP1 +SWP0: EOR FA0,FB0 + EOR FA1,FB1 + EOR FA2,FB2 + EOR FA3,FB3 + RET +SWP1: EOR FB0,FA0 + EOR FB1,FA1 + EOR FB2,FA2 + EOR FB3,FA3 + RET + +OUTRNG: BRPL MIN_FA ; UNDERFLOW +; RJMP MAX_FA ; OVERFLOW + +; UNDERFLOW BY A LITTLE: $80 + $FF = $7F POSITIVE +; -128 - 1 = -129 +; UNDERFLOW BY A LOT: $80 + $80 = $00 POSITIVE +; -128 - 128 = -256 +; OVERFLOW BY A LITTLE: $7F + $0F = $80 NEGATIVE +; 127 + 1 = 128 +; OVERFLOW BY A LOT: $7F + $7F = $FE NEGATIVE +; 127 + 127 = 254 + +MAX_FA: CLR FA3 ; FA=MAX + COM FA3 + MOV FA2,FA3 + MOV FA1,FA3 + MOV FA0,FA3 + BLD FA2,7 ; SET SIGN + RET + + +;------------------------------------------------------------------------------ + +MUL_FA: RCALL LDS_FB ; MULTIPLY FA REGISTER BY SRAM ARGUMENT +MUL0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + TST FB3 ; IF FB=0 + BREQ MIN_FA ; THEN FA=0 + RCALL SGNS ; PROCESS SIGN OF RESULT & REMOVE BIAS + ADD FA3,FB3 ; ADD EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; ELSE RESTORE BIAS + MOV FC0,FA0 ; FC=FA + MOV FC1,FA1 + MOV FC2,FA2 + RCALL CLR_FA ; FA=0 + CLC + LDI A,24 ; LOOP COUNTER +MUL1: RCALL ROR_FA ; RIGHT SHIFT + LSR FC2 + ROR FC1 + ROR FC0 + BRCC MUL2 + RCALL ADD_FB ; FA=FA+FB +MUL2: DEC A + BRNE MUL1 + BRCC MUL3 ; IF CARRY + RCALL ROR_FA ; THEN NORMALIZE BY 1 BIT + INC FA3 ; ADJUST EXPONENT + BREQ MAX_FA ; IF OVERFLOW RETURN MAX +MUL3: BLD FA2,7 ; ELSE RESTORE SIGN +RET1: RET + +MULE_FA:RCALL LDE_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +MULF_FA:RCALL LDF_FB ; FP MULTIPLY BY FLASH CONSTANT + RJMP MUL0 + +DIV_FA: RCALL LDS_FB ; DIVIDE FA REGISTER BY SRAM ARGUMENT +DIV0: TST FA3 ; IF FA=0 + BREQ RET1 ; THEN DO NOTHING + BST FA2,7 ; GET SIGN OF FA + TST FB3 ; IF FB=0 + BREQ MAX_FA ; THEN RETURN MAX + RCALL SGNS ; PROCESS SIGN OF RESULT + SUB FA3,FB3 ; SUBTRACT EXPONENTS + BRVS OUTRNG ; IF UNDER/OVERFLOW RETURN MIN/MAX + LDI A,BIAS + ADD FA3,A ; RESTORE BIAS + LSR FA2 ; DENORMALIZE SO THAT CARRY IS NOT LOST + ROR FA1 ; DURING SUBTRACTION AND SUBSEQUENT ADD + ROR FA0 + LSR FB2 + ROR FB1 + ROR FB0 + LDI A,24 ; LOOP COUNTER +DIV1: RCALL SUB_FB ; FA=FA-FB + BRCC DIV2 + RCALL ADD_FB ; FA=FA+FB +DIV2: ROL FC0 ; SHIFT CARRY INTO LSB + ROL FC1 + ROL FC2 + RCALL LSL_FA + DEC A + BRNE DIV1 + MOV FA0,FC0 ; FA=FC + MOV FA1,FC1 + MOV FA2,FC2 + RCALL COM_FA ; SINCE CARRY WAS WRONG SENSE + RJMP NRM0 ; NORMALIZE & RESTORE SIGN + +DIVE_FA:RCALL LDE_FB ; DIVIDE FA REGISTER BY EEPROM CONSTANT + RJMP DIV0 + +DIVF_FA:RCALL LDF_FB ; DIVIDE FA REGISTER BY FLASH CONSTANT + RJMP DIV0 + +CP_FA: RCALL LDS_FB ; COMPARE FA WITH SRAM ARGUMENT +CP0: MOV A,FA3 ; FIRST CHECK FOR SPECIAL ZERO CASE + OR A,FB3 + BREQ CP6 ; FA=0, FB=0 + MOV A,FA2 ; NOW, IF SIGNS DIFFERENT + EOR A,FB2 + BRMI CP3 ; THEN ANSWER DETERMINED BY THE SIGNS + BST FA2,7 ; ELSE SAVE SIGN FOR LATER + SUB FB3,FA3 ; TEST EXPONENT WITHOUT CORRUPTING FA + BRCS CP2 ; IF EXP FA > EXP FB + BRNE CP1 ; IF EXP FA < EXP FB + SUB FB0,FA0 ; IF EXPS EQUAL, MUST TEST MANTISSA + SBC FB1,FA1 + SBC FB2,FA2 + BRCS CP2 + BREQ CP6 +CP1: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP4 ; THEN CLEAR CARRY + RJMP CP5 ; ELSE SET CARRY +CP2: BLD A,7 ; RETRIEVE SIGN + TST A ; IF BOTH NEGATIVE + BRMI CP5 ; THEN SET CARRY + RJMP CP4 ; ELSE CLEAR CARRY +CP3: TST FA2 ; CHECK SIGN + BRMI CP5 +CP4: CLC ; FA > FB + CLZ + RET +CP5: SEC ; FA < FB + CLZ +CP6: RET ; FA = FB + +CPF_FA: RCALL LDF_FB ; COMPARE FA WITH FLASH CONSTANT + RJMP CP0 + +CPE_FA: RCALL LDE_FB ; COMPARE FA WITH EEPROM CONSTANT + RJMP CP0 + +;------------------------------------------------------------------------------ + +SNDSTR: ADIW ZL,2 ; OUTPUT STRING FROM FLASH +STR0: RCALL STR1 ; RETRIEVE MESSAGE + BRNE STR0 + RET +STR1: LPM ; GET NEXT CHARACTER + MOV A,R0 + RCALL TX_WAIT + ADIW ZL,1 + DEC D + RET + +;------------------------------------------------------------------------------ + +;SNDASC: +; RCALL EXP0 ; SEND IN ASCII FORMAT +; INC F ; DIGITS TO LEFT OF DECIMAL POINT +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +;ASC0: DEC F +; BREQ EXP11 +; RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; RJMP ASC0 + +; CHARACTERIZE ONLY % +;SNDEXP: +; PUSH A ; SEPARATOR +; RCALL EXP0 ; SEND EXPONENTIAL FORMAT +N.NNNNNNE+^^ +;EXP5: FCPF KR0001 ; IF N<.0001 +; BRCC EXP6 +; FMLF K100K ; THEN N=N*100K +; SUBI F,5 ; E=E-5 +; RJMP EXP5 +;EXP6: FCPF K1 ; IF N<1 +; BRCC EXP7 +; FMLF K10 ; THEN N=N*10 +; SUBI F,1 ; E=E-1 +; RJMP EXP6 +;EXP7: FADF TLT1 ; BY MEREST COINCIDENCE CLOSE TO 5.0E-7 +; RCALL EXP3 ; IN CASE WE JUMPED UP TO 10.000000 +; RCALL DGT0 ; CONVERT TO ASCII & SEND DIGIT +; LDI A,'.' +; RCALL TX_WAIT +; LDI E,6 ; 7 SIGNIFICANT DIGITS IN ALL +;EXP8: RCALL DGTN ; *10 THEN CONVERT TO ASCII, SEND DIGIT +; DEC E +; BRNE EXP8 +; LDI A,'0' ; 2 TRAILING ZEROS FOR COMPATIBILITY +; RCALL TX_WAIT ; WITH PREVIOUS CHARACTERIZE VERSION +; LDI A,'0' +; RCALL TX_WAIT +; LDI A,'E' ; NOW FOR THE EXPONENT +; RCALL TX_WAIT +; LDI A,'+' ; SEND SIGN +; TST F +; BRPL EXP9 +; LDI A,'-' +; NEG F ; ABS(E) +;EXP9: RCALL TX_WAIT +; LDI A,'0'-1 ; CONVERT MS DIGIT TO ASCII +;EXP10: INC A +; SUBI F,10 +; BRPL EXP10 +; RCALL TX_WAIT +; LDI A,'0'+10 ; NOW LS DIGIT +; ADD A,F +; RCALL TX_WAIT +; POP A +; RCALL TX_WAIT ; SEPARATOR +;EXP11: FLD F0 ; AND RESTORE FA +; RET +; +;EXP0: FST F0 ; ADJUST EXPONENT FOR ABS(N)>1 +; LDI A,' ' ; SEND SIGN (SPACE FOR +) +; TST FA2 +; BRPL EXP1 +; LDI A,'-' +;EXP1: RCALL TX_WAIT +; % + +DIGN: LDI A,$7F + AND FA2,A ; ABS(N) + CLR F ; HOLDS ADJUSTED EXPONENT FOR 110K + BRCS EXP3 + FMLF KR0001 ; THEN N=N/10K + ADDI F,4 ; E=E+4 + RJMP EXP2 +EXP3: FCPF K10 ; IF N>10 + BRCS EXP4 + FMLF KR1 ; THEN N=N/10 + SUBI F,-1 ; E=E+1 + RJMP EXP3 +;EXP4: RET + +DGTN: FSB F1 ; N=(N-I)*10 + FMLF K10 ; REALLY N=(I-N)*10, SIGN UNIMPORTANT + ;;FMLF K_1 ; LET'S BE SAFE ;; LET'S NOT +DGT0: FST F1 ; N (ADJUSTED) + RCALL FIX_FA ; I=INT(N) + MOV B,FA0 ; SAVE LS DIGIT + RCALL LD3 ; CONVERT BACK TO FP FORMAT + LDI A,'0' + ADD A,B ; A = LS DIGIT IN ASCII + RJMP TX_WAIT + +;------------------------------------------------------------------------------ + +LDS_A_STATUS: + LDS A,STATUS +EXP4: RET + +SET_TRYZRO: + LDS A,STATUS ; THEN SET ZERO + SBR A,1< LOW + + SBRS D,2 + RJMP TP_SEARCH + + ; RSW FALLING EDGE DETECTED + SBIC PORTC,4 ; MOTOR ON? + RJMP TP_FEED ; YES, GO AND PRINT + + ; WE STOPPED THE MOTOR, MONITOR RSW WHILE IT SLOWS DOWN + CLR TP_COUNT ; REPLENISH COUNT OF TP EDGES TO RSW + + TST FEEDS + BREQ TP_SEARCH + DEC FEEDS ; DECREMENT FEEDS TO MINIMUM OF 0 + RJMP TP_SEARCH + +TP_COAST: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + MOV D,TP_COUNT + CPI D,3 + BRSH TP_PAPER_SKIP ; ON LAST OR 2ND LAST TP EDGE, + + SBIC PORTB,2 + RJMP TP_PAPER_SKIP ; WITH TP GENERATOR IN KNOWN STATE, + +;T0_PAPER_SETUP: + LDI A,0 + OUT GIMSK,A ; DISABLE INT 1 INTERRUPTS + + ;CBI PORTB,2 ; SET TP GENERATOR TO KNOWN STATE + SBI PORTB,1 ; MUST BE OPPOSITE TO PORTB,2 STATE + SBI DDRB,1 ; D1 = HIGH / LOW TO LIGHT LED + + LDI D,-3 + OUT TCNT0,D ; TEST PAPER IN 2 * 0.1 MS = 0.2 MS + +TP_PAPER_SKIP: + DEC TP_COUNT ; COUNT EDGES/2 TO PRINTABLE AREA-4 + BRNE TP_COAST + +TP_FEED: + ;SBRS STATUS,PAPER ; PAPER IN? + ;RJMP TP_BRAKE_NOW ; NO, STOP PRINTING IMMEDIATELY + + MOV D,FLAGS + ANDI D,(1< 3 INTERNAL FEEDS + CPI D,1 + BRSH TP_FEED_SLOW ; COAST IF => 1 INTERNAL FEED + + SBRC FLAGS,IMAGE + RJMP TP_PRINT_IMAGE ; PRINT IF GRAPHICS WAITING + + RJMP TP_PRINT_TEXT ; OTHERWISE ASSUME TEXT IS WAITING + +TP_BRAKE: + MOV D,FEEDS + CPI D,3+FEED_INITIAL + BRSH TP_FEED_FAST ; TRIGGER IF => 3+n INTERNAL FEEDS + CPI D,1+FEED_INITIAL + BRSH TP_FEED_SLOW ; COAST IF => 1+n INTERNAL FEED + +TP_BRAKE_NOW: +; TST FEEDS ; JUST MISSED RSW -> 0, COMPENSATE +; BREQ TP_BRAKE_NOW_CONT +; DEC FEEDS ; DECREMENT TO MINIMUM OF 0 +;TP_BRAKE_NOW_CONT: + CLR FEEDS + RJMP TP_KILL ; GO AND KILL MOTOR + +TP_FEED_SLOW: + DEC FEEDS + + LDI D,150 + MOV TP_COUNT,D + RJMP TP_COAST + +TP_FEED_FAST: ; AT PRINTABLE AREA-2 + SUBI D,3 + MOV FEEDS,D + + SBI PORTB,0 ; APPLY TRIGGER SOLENOID + + LDI D,9 + MOV TP_COUNT,D +TP_TRIGGERING: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + DEC TP_COUNT + BRNE TP_TRIGGERING + + CBI PORTB,0 ; CLEAR TRIGGER SOLENOID + + LDI D,150-9 + MOV TP_COUNT,D + RJMP TP_COAST + +; ----------------------------------------------------------------------------- +; TP INTERRUPT ROUTINES FOR TEXT PRINTING + +; TP_TEXT_START DOES NOT RE-ENABLE ACCESS TO FEEDS. +; FEEDS IS USED AS A COUNTER FOR DESCENDER PRINTING, +; SO WE RELY ON TIMER_COPY TO RESET NOFEED, AFTER THE +; LINE HAS BEEN CHECKED FOR DESCENDERS AND IS ABOUT TO +; BE CLOBBERED BY NEW DATA. + +TP_PRINT_TEXT: + LDI D,2 + MOV TEXT_MASK,D + MOV FEEDS,SPACING ; SET UP STANDARD FEED AFTER TEXT LINE + +TP_PRINT_TEXT_START: + LDI E,0 ; CURRENT CHARACTER FOR PRINT HEAD, 0-4 + +TP_PRINT_TEXT_CHAR: + LDI F,0 ; CURRENT PIXEL FOR CHARACTER, 0-5 + +TP_PRINT_TEXT_PIXEL: + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-30 ; E = CURRENT CHARACTER + 30 + RCALL TP_TEXT_FIRE2 + SUBI E,15 ; E = CURRENT CHARACTER + 15 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH0 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-35 ; E = CURRENT CHARACTER + 35 + RCALL TP_TEXT_FIRE1 + SUBI E,15 ; E = CURRENT CHARACTER + 20 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 5 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH1 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-20 ; E = CURRENT CHARACTER + 25 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 10 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH2 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + SUBI E,10 ; E = CURRENT CHARACTER + + INC F ; NEXT PIXEL FOR CHARACTER + CPI F,6 ; GONE PAST LAST PIXEL FOR CHARACTER? + BRLO TP_PRINT_TEXT_PIXEL ; REPEAT UNLESS ALL PIXELS DONE + + INC E ; NEXT CHARACTER FOR PRINT HEAD + CPI E,5 ; GONE PAST LAST CHAR FOR PRINT HEAD? + BRLO TP_PRINT_TEXT_CHAR ; REPEAT UNLESS ALL CHARACTERS DONE + + CLR H + RCALL TP_LATCH0 ; CLEAR D4-D7 AND C0-C3 + + SBRC TEXT_MASK,7 ; LAST DOT LINE FOR CHARACTER LINE? + CBR FLAGS,1< CHARACTER SET SLICE IN FLASH + + LPM ; R0 = CORRECT VERTICAL SLICE OF CHAR + RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + LSL ZL ; ZL = CHARACTER DEFINITION * 8 + SUB ZL,D ; ZL = CHARACTER DEFINITION * 7 + ;CLR ZH + + SUBI ZL,-(EE_COUNT*2+2) ; PAST CRC, COUNT, AND CHARACTER CODE + ADD ZL,F ; ZL = BASE + CHAR * 6 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN R0,EEDR ; GET LATCHED DATA BYTE + RET + +; ----------------------------------------------------------------------------- +; FOREGROUND ROUTINES FOR API BUS + +RX_WAIT: + SBRC FLAGS,BOMB + RJMP TEXT_RESET + + SBRS STATUS,NOTIFY + RJMP RX_WAIT_TEST + + MOV A,TX_COUNT + CPI A,TX_SIZE ;-2 + BRSH RX_WAIT_TEST + + CLR NOTIFY_COUNT ; 6.5536 SECONDS TO NEXT NOTIFICATION + CBR STATUS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + +; ----------------------------------------------------------------------------- + +TEXT_RESET: + ; ENTRY POINT FROM RX_WAIT + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + +TEXT_RECEIVE: + ; NEXT LINE STARTS WITH RECEIVED CHAR + CLR CHAR_SAVE + + CLR ABORT_COUNT ; NO NEED TO ABORT ESC SEQUENCE + CBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI XL,$21 + LDI XH,$10 ; X = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,XL + EOR YH,XH +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +WAIT_ADD_FEEDS: + PUSH A + ADD A,FEEDS + POP A + BRCS WAIT_ADD_FEEDS + + ADD FEEDS,A + +MOTOR_START: + ;SBRS STATUS,PAPER + ;RET + + SBIC PORTC,4 + RET + + CBR FLAGS,1< ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$00,$9E,$00,$00,$00 + .DB $00,$0E,$00,$0E,$00,$00 + .DB $28,$FE,$28,$FE,$28,$00 + .DB $4C,$92,$FF,$92,$64,$00 + .DB $46,$26,$10,$C8,$C4,$00 + .DB $6C,$92,$AA,$44,$A0,$00 + .DB $00,$0B,$07,$00,$00,$00 + .DB $00,$38,$44,$82,$00,$00 + .DB $00,$82,$44,$38,$00,$00 + .DB $28,$10,$7C,$10,$28,$00 + .DB $10,$10,$7C,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $10,$10,$10,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $40,$20,$10,$08,$04,$00 + .DB $7C,$A2,$92,$8A,$7C,$00 + .DB $00,$84,$FE,$80,$00,$00 + .DB $84,$C2,$A2,$92,$8C,$00 + .DB $42,$82,$8A,$96,$62,$00 + .DB $30,$28,$24,$FE,$20,$00 + .DB $4E,$8A,$8A,$8A,$72,$00 + .DB $78,$94,$92,$92,$60,$00 + .DB $02,$E2,$12,$0A,$06,$00 + .DB $6C,$92,$92,$92,$6C,$00 + .DB $0C,$92,$92,$52,$3C,$00 + .DB $00,$6C,$6C,$00,$00,$00 + .DB $00,$6C,$EC,$00,$00,$00 + .DB $10,$28,$44,$82,$00,$00 + .DB $28,$28,$28,$28,$28,$00 + .DB $00,$82,$44,$28,$10,$00 + .DB $04,$02,$A2,$12,$0C,$00 + .DB $7C,$82,$BA,$AA,$3C,$00 + .DB $FC,$22,$22,$22,$FC,$00 + .DB $FE,$92,$92,$92,$6C,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $FE,$82,$82,$44,$38,$00 + .DB $FE,$92,$92,$92,$82,$00 + .DB $FE,$12,$12,$12,$02,$00 + .DB $7C,$82,$92,$92,$F4,$00 + .DB $FE,$10,$10,$10,$FE,$00 + .DB $00,$82,$FE,$82,$00,$00 + .DB $40,$80,$82,$7E,$02,$00 + .DB $FE,$10,$28,$44,$82,$00 + .DB $FE,$80,$80,$80,$80,$00 + .DB $FE,$04,$18,$04,$FE,$00 + .DB $FE,$08,$10,$20,$FE,$00 + .DB $7C,$82,$82,$82,$7C,$00 + .DB $FE,$12,$12,$12,$0C,$00 + .DB $7C,$82,$A2,$42,$BC,$00 + .DB $FE,$12,$32,$52,$8C,$00 + .DB $4C,$92,$92,$92,$64,$00 + .DB $02,$02,$FE,$02,$02,$00 + .DB $7E,$80,$80,$80,$7E,$00 + .DB $3E,$40,$80,$40,$3E,$00 + .DB $7E,$80,$70,$80,$7E,$00 + .DB $C6,$28,$10,$28,$C6,$00 + .DB $0E,$10,$E0,$10,$0E,$00 + .DB $C2,$A2,$92,$8A,$86,$00 + .DB $00,$FE,$82,$82,$00,$00 + .DB $04,$08,$10,$20,$40,$00 + .DB $00,$82,$82,$FE,$00,$00 + .DB $08,$04,$02,$04,$08,$00 + .DB $80,$80,$80,$80,$80,$00 + .DB $00,$00,$0E,$0D,$00,$00 + .DB $40,$A8,$A8,$A8,$F0,$00 + .DB $FE,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$88,$88,$88,$FE,$00 + .DB $70,$A8,$A8,$A8,$30,$00 + .DB $08,$08,$FC,$0A,$0A,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $FE,$10,$08,$08,$F0,$00 + .DB $00,$88,$FA,$80,$00,$00 + .DB $00,$00,$08,$FA,$00,$00 + .DB $FE,$20,$50,$88,$00,$00 + .DB $00,$82,$FE,$80,$00,$00 + .DB $F8,$08,$F8,$08,$F0,$00 + .DB $F8,$10,$08,$08,$F0,$00 + .DB $70,$88,$88,$88,$70,$00 + .DB $F8,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $F8,$10,$08,$08,$00,$00 + .DB $90,$A8,$A8,$A8,$48,$00 + .DB $08,$08,$7E,$88,$88,$00 + .DB $78,$80,$80,$40,$F8,$00 + .DB $38,$40,$80,$40,$38,$00 + .DB $78,$80,$60,$80,$78,$00 + .DB $88,$50,$20,$50,$88,$00 + .DB $78,$80,$80,$80,$F8,$00 + .DB $88,$C8,$A8,$98,$88,$00 + .DB $10,$6C,$82,$82,$00,$00 + .DB $00,$00,$EE,$00,$00,$00 + .DB $00,$82,$82,$6C,$10,$00 + .DB $04,$02,$04,$08,$04,$00 + .DB $E0,$90,$88,$90,$E0,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $7A,$80,$80,$40,$FA,$00 + .DB $70,$A8,$AA,$A9,$30,$00 + .DB $40,$AA,$A9,$AA,$F0,$00 + .DB $42,$A8,$A8,$A8,$F2,$00 + .DB $40,$A9,$AA,$A8,$F0,$00 + .DB $40,$AE,$AA,$AE,$F0,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$AA,$A9,$AA,$30,$00 + .DB $72,$A8,$A8,$A8,$32,$00 + .DB $70,$A9,$AA,$A8,$30,$00 + .DB $02,$88,$F8,$80,$02,$00 + .DB $00,$8A,$F9,$82,$00,$00 + .DB $00,$89,$FA,$80,$00,$00 + .DB $F9,$24,$24,$24,$F9,$00 + .DB $F8,$27,$25,$27,$F8,$00 + .DB $F8,$A8,$AA,$A9,$88,$00 + .DB $68,$A8,$F8,$A8,$B0,$00 + .DB $FC,$12,$FE,$92,$92,$00 + .DB $70,$8A,$89,$8A,$70,$00 + .DB $72,$88,$88,$88,$72,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$82,$81,$42,$F8,$00 + .DB $78,$81,$82,$40,$F8,$00 + .DB $7A,$80,$80,$80,$FA,$00 + .DB $79,$84,$84,$84,$79,$00 + .DB $7D,$80,$80,$80,$7D,$00 + .DB $70,$88,$88,$FC,$88,$00 + .DB $90,$7C,$92,$92,$C4,$00 + .DB $52,$54,$F8,$54,$52,$00 + .DB $82,$82,$44,$44,$28,$28 + .DB $10,$10,$28,$54,$54,$28 + .DB $40,$A8,$AA,$A9,$F0,$00 + .DB $00,$8A,$F9,$80,$00,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$80,$82,$41,$F8,$00 + .DB $FA,$11,$0A,$09,$F0,$00 + .DB $FA,$11,$22,$41,$F8,$00 + .DB $90,$AA,$AA,$AA,$BC,$00 + .DB $9C,$A2,$A2,$A2,$9C,$00 + .DB $60,$90,$8A,$80,$40,$00 + .DB $FE,$02,$02,$02,$02,$02 + .DB $02,$02,$02,$02,$02,$FE + .DB $2F,$10,$48,$24,$C0,$00 + .DB $2F,$90,$48,$E4,$00,$00 + .DB $00,$00,$F2,$00,$00,$00 + .DB $FE,$80,$80,$80,$80,$80 + .DB $80,$80,$80,$80,$80,$FE + .DB $00,$80,$00,$00,$80,$00 + .DB $55,$AA,$55,$AA,$55,$AA + .DB $33,$CC,$33,$CC,$33,$CC + .DB $00,$00,$FF,$00,$00,$00 + .DB $10,$10,$FF,$00,$00,$00 + .DB $28,$28,$FF,$00,$00,$00 + .DB $10,$FF,$00,$FF,$00,$00 + .DB $10,$F0,$10,$F0,$00,$00 + .DB $28,$28,$F8,$00,$00,$00 + .DB $28,$EF,$00,$FF,$00,$00 + .DB $00,$FF,$00,$FF,$00,$00 + .DB $28,$E8,$08,$F8,$00,$00 + .DB $28,$2F,$20,$3F,$00,$00 + .DB $10,$1F,$10,$1F,$00,$00 + .DB $28,$28,$3F,$00,$00,$00 + .DB $10,$10,$F0,$00,$00,$00 + .DB $00,$00,$1F,$10,$10,$10 + .DB $10,$10,$1F,$10,$10,$10 + .DB $10,$10,$F0,$10,$10,$10 + .DB $00,$00,$FF,$10,$10,$10 + .DB $10,$10,$10,$10,$10,$10 + .DB $10,$10,$FF,$10,$10,$10 + .DB $00,$00,$FF,$28,$28,$28 + .DB $00,$FF,$00,$FF,$10,$10 + .DB $00,$3F,$20,$2F,$28,$28 + .DB $00,$F8,$08,$E8,$28,$28 + .DB $28,$2F,$20,$2F,$28,$28 + .DB $28,$E8,$08,$E8,$28,$28 + .DB $00,$FF,$00,$EF,$28,$28 + .DB $28,$28,$28,$28,$28,$28 + .DB $28,$EF,$00,$EF,$28,$28 + .DB $28,$28,$2F,$28,$28,$28 + .DB $10,$1F,$10,$1F,$10,$10 + .DB $28,$28,$E8,$28,$28,$28 + .DB $10,$F0,$10,$F0,$10,$10 + .DB $00,$1F,$10,$1F,$10,$10 + .DB $00,$00,$3F,$28,$28,$28 + .DB $00,$00,$F8,$28,$28,$28 + .DB $00,$F0,$10,$F0,$10,$10 + .DB $10,$FF,$10,$FF,$10,$10 + .DB $28,$28,$FF,$28,$28,$28 + .DB $10,$10,$1F,$00,$00,$00 + .DB $00,$00,$F0,$10,$10,$10 + .DB $FF,$FF,$FF,$FF,$FF,$FF + .DB $E0,$E0,$E0,$E0,$E0,$E0 + .DB $FF,$FF,$FF,$00,$00,$00 + .DB $00,$00,$00,$FF,$FF,$FF + .DB $1F,$1F,$1F,$1F,$1F,$1F + .DB $70,$88,$88,$70,$88,$00 + .DB $FC,$02,$92,$92,$6C,$00 + .DB $FE,$02,$02,$02,$06,$00 + .DB $08,$F8,$08,$F8,$08,$00 + .DB $C6,$AA,$92,$82,$C6,$00 + .DB $70,$88,$88,$78,$08,$00 + .DB $00,$F8,$80,$80,$78,$00 + .DB $10,$08,$F0,$08,$00,$00 + .DB $10,$AA,$EE,$AA,$10,$00 + .DB $7C,$92,$92,$92,$7C,$00 + .DB $9C,$E2,$02,$E2,$9C,$00 + .DB $60,$94,$9A,$92,$60,$00 + .DB $70,$88,$70,$88,$70,$00 + .DB $70,$88,$FC,$88,$70,$00 + .DB $38,$54,$92,$92,$00,$00 + .DB $FC,$02,$02,$02,$FC,$00 + .DB $54,$54,$54,$54,$54,$00 + .DB $88,$88,$BE,$88,$88,$00 + .DB $A2,$A2,$94,$94,$88,$00 + .DB $88,$94,$94,$A2,$A2,$00 + .DB $00,$00,$F8,$04,$08,$00 + .DB $40,$80,$7F,$00,$00,$00 + .DB $10,$10,$54,$10,$10,$00 + .DB $48,$24,$48,$24,$00,$00 + .DB $0C,$12,$12,$0C,$00,$00 + .DB $00,$18,$18,$00,$00,$00 + .DB $00,$00,$10,$00,$00,$00 + .DB $20,$40,$FF,$01,$01,$00 + .DB $1F,$02,$01,$1E,$00,$00 + .DB $00,$12,$19,$16,$00,$00 + .DB $00,$38,$38,$38,$00,$00 + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$02,$02,$02,$01,$00 + .DB $01,$02,$02,$01,$00,$00 + .DB $03,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$03,$00 + .DB $00,$00,$02,$03,$02,$00 + .DB $00,$01,$01,$03,$01,$00 + .DB $00,$00,$01,$00,$00,$00 + .DB $00,$00,$00,$01,$00,$00 + .DB $02,$01,$00,$00,$00,$00 + .DB $00,$02,$01,$00,$00,$00 + .DB $00,$00,$02,$01,$00,$00 + .DB $00,$01,$00,$00,$00,$00 + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4106 ; HARDWARE ADDRESS COMMAND + .DW $4204 ; SOFTWARE ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/m192ter.asm b/src/avr/m192ter.asm new file mode 100644 index 00000000..ae477c3c --- /dev/null +++ b/src/avr/m192ter.asm @@ -0,0 +1,1685 @@ +; M192TER.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +;.INCLUDE "API.INC" +.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =6 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ;$11 ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ;$11 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =30 ; 240 / 8 = 30 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =40 ; 240 / 6 = 40 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =5 ; 40 / 8 = 5 TEXT WIDTH FLAGS + +.EQU TIME_EMERGENCY =1000 ; 1000 * 0.1 MS = APPROX 100 MS + +.EQU FEED_INITIAL =2 ; LINES ALLOWED FOR MOTOR SLOWDOWN +.EQU FEED_SPACING =3 ; LINES TO FEED IN BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF TP_COUNT =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF NOTIFY_COUNT =R14 ; COUNTER TO SEND EVERY 6.5536 SECONDS +.DEF ABORT_COUNT =R15 ; COUNTER TO ABORT ESC AFTER 0.1 SECS + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF SR =R23 +.DEF FLAGS =R24 +.DEF STATUS =R25 + +.EQU TX_SIZE =2 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_CHARS+WIDTH_FLAGS +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU RSWSAVE =2 ; SET IF RSW HI, MUST BE BIT POSITION 2 +.EQU IMAGE =3 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =4 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +;.EQU NODESC =5 ; SET BY FG WHILE PRINTING TOP 7 DOTS +;.EQU BIGDESC =6 ; SET BY FG WHILE PRINTING LOWER 2 DOTS +.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY FG JUST PRIOR TO NOTIFICATION +.EQU TP_ERROR =2 ; SET BY BG IF WE HAVE TIMEOUT ON TP +.EQU RSW_ERROR =3 ; SET BY BG IF WE HAVE TIMEOUT ON RSW +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; NODESC + +; FLAG RESET BY FOREGROUND AFTER DESCENDER TRANSLATION, IF DESCENDERS PRESENT. +; FLAG SET BY FOREGROUND AFTER DESCENDERS FINISHED AND BUFFER CLOBBERED. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE, FOR SPECIAL DESCENDER +; PROCESSING. + +; BIGDESC + +; FLAG SET UP BY FOREGROUND DURING DESCENDER TRANSLATION. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE IN COMBINATION WITH +; TEXT_MASK, TO CONTINUE DESCENDER OR REVERT TO FEEDS. + +; NOWFAST + +; FLAG SET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 115200 BPS. +; FLAG RESET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 4800 BPS. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG INT1ADDR + RJMP TP_EDGE ; EXTERNAL INT 1 HANDLER + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','1','9','2',' ' +; .DB 'P','R','I','N','T','E','R',$0D + +; ----------------------------------------------------------------------------- +; TP EDGE INTERRUPT HANDLER + +TP_EDGE: + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + IN SR,SREG ; SAVE FLAGS + + IN D,MCUCR + SBRS D,ISC10 + CBI PORTB,2 ; IF WE WERE LOOKING FOR A FALLING EDGE + SBRC D,ISC10 + SBI PORTB,2 ; IF WE WERE LOOKING FOR A RISING EDGE + LDI G,1< LOW + + SBRS D,2 + RJMP TP_SEARCH + + ; RSW FALLING EDGE DETECTED + SBIC PORTC,4 ; MOTOR ON? + RJMP TP_FEED ; YES, GO AND PRINT + + ; WE STOPPED THE MOTOR, MONITOR RSW WHILE IT SLOWS DOWN + CLR TP_COUNT ; REPLENISH COUNT OF TP EDGES TO RSW + + TST FEEDS + BREQ TP_SEARCH + DEC FEEDS ; DECREMENT FEEDS TO MINIMUM OF 0 + RJMP TP_SEARCH + +TP_COAST: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + MOV D,TP_COUNT + CPI D,3 + BRSH TP_PAPER_SKIP ; ON LAST OR 2ND LAST TP EDGE, + + SBIC PORTB,2 + RJMP TP_PAPER_SKIP ; WITH TP GENERATOR IN KNOWN STATE, + +;T0_PAPER_SETUP: + LDI A,0 + OUT GIMSK,A ; DISABLE INT 1 INTERRUPTS + + ;CBI PORTB,2 ; SET TP GENERATOR TO KNOWN STATE + SBI PORTB,1 ; MUST BE OPPOSITE TO PORTB,2 STATE + SBI DDRB,1 ; D1 = HIGH / LOW TO LIGHT LED + + LDI D,-3 + OUT TCNT0,D ; TEST PAPER IN 2 * 0.1 MS = 0.2 MS + +TP_PAPER_SKIP: + DEC TP_COUNT ; COUNT EDGES/2 TO PRINTABLE AREA-4 + BRNE TP_COAST + +TP_FEED: + ;SBRS STATUS,PAPER ; PAPER IN? + ;RJMP TP_BRAKE_NOW ; NO, STOP PRINTING IMMEDIATELY + + MOV D,FLAGS + ANDI D,(1< 3 INTERNAL FEEDS + CPI D,1 + BRSH TP_FEED_SLOW ; COAST IF => 1 INTERNAL FEED + + SBRC FLAGS,IMAGE + RJMP TP_PRINT_IMAGE ; PRINT IF GRAPHICS WAITING + + RJMP TP_PRINT_TEXT ; OTHERWISE ASSUME TEXT IS WAITING + +TP_BRAKE: + MOV D,FEEDS + CPI D,3+FEED_INITIAL + BRSH TP_FEED_FAST ; TRIGGER IF => 3+n INTERNAL FEEDS + CPI D,1+FEED_INITIAL + BRSH TP_FEED_SLOW ; COAST IF => 1+n INTERNAL FEED + +TP_BRAKE_NOW: +; TST FEEDS ; JUST MISSED RSW -> 0, COMPENSATE +; BREQ TP_BRAKE_NOW_CONT +; DEC FEEDS ; DECREMENT TO MINIMUM OF 0 +;TP_BRAKE_NOW_CONT: + CLR FEEDS + RJMP TP_KILL ; GO AND KILL MOTOR + +TP_FEED_SLOW: + DEC FEEDS + + LDI D,150 + MOV TP_COUNT,D + RJMP TP_COAST + +TP_FEED_FAST: ; AT PRINTABLE AREA-2 + SUBI D,3 + MOV FEEDS,D + + SBI PORTB,0 ; APPLY TRIGGER SOLENOID + + LDI D,9 + MOV TP_COUNT,D +TP_TRIGGERING: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + DEC TP_COUNT + BRNE TP_TRIGGERING + + CBI PORTB,0 ; CLEAR TRIGGER SOLENOID + + LDI D,150-9 + MOV TP_COUNT,D + RJMP TP_COAST + +; ----------------------------------------------------------------------------- +; TP INTERRUPT ROUTINES FOR TEXT PRINTING + +; TP_TEXT_START DOES NOT RE-ENABLE ACCESS TO FEEDS. +; FEEDS IS USED AS A COUNTER FOR DESCENDER PRINTING, +; SO WE RELY ON TIMER_COPY TO RESET NOFEED, AFTER THE +; LINE HAS BEEN CHECKED FOR DESCENDERS AND IS ABOUT TO +; BE CLOBBERED BY NEW DATA. + +TP_PRINT_TEXT: + LDI D,2 + MOV TEXT_MASK,D + MOV FEEDS,SPACING ; SET UP STANDARD FEED AFTER TEXT LINE + +TP_PRINT_TEXT_START: + LDI E,0 ; CURRENT CHARACTER FOR PRINT HEAD, 0-4 + +TP_PRINT_TEXT_CHAR: + LDI F,0 ; CURRENT PIXEL FOR CHARACTER, 0-5 + +TP_PRINT_TEXT_PIXEL: + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-30 ; E = CURRENT CHARACTER + 30 + RCALL TP_TEXT_FIRE2 + SUBI E,15 ; E = CURRENT CHARACTER + 15 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH0 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-35 ; E = CURRENT CHARACTER + 35 + RCALL TP_TEXT_FIRE1 + SUBI E,15 ; E = CURRENT CHARACTER + 20 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 5 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH1 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-20 ; E = CURRENT CHARACTER + 25 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 10 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH2 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + SUBI E,10 ; E = CURRENT CHARACTER + + INC F ; NEXT PIXEL FOR CHARACTER + CPI F,6 ; GONE PAST LAST PIXEL FOR CHARACTER? + BRLO TP_PRINT_TEXT_PIXEL ; REPEAT UNLESS ALL PIXELS DONE + + INC E ; NEXT CHARACTER FOR PRINT HEAD + CPI E,5 ; GONE PAST LAST CHAR FOR PRINT HEAD? + BRLO TP_PRINT_TEXT_CHAR ; REPEAT UNLESS ALL CHARACTERS DONE + + CLR H + RCALL TP_LATCH0 ; CLEAR D4-D7 AND C0-C3 + + SBRC TEXT_MASK,7 ; LAST DOT LINE FOR CHARACTER LINE? + CBR FLAGS,1< CHARACTER SET SLICE IN FLASH + + LPM ; R0 = CORRECT VERTICAL SLICE OF CHAR + RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + LSL ZL ; ZL = CHARACTER DEFINITION * 8 + SUB ZL,D ; ZL = CHARACTER DEFINITION * 7 + ;CLR ZH + + SUBI ZL,-(EE_COUNT*2+2) ; PAST CRC, COUNT, AND CHARACTER CODE + ADD ZL,F ; ZL = BASE + CHAR * 6 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN R0,EEDR ; GET LATCHED DATA BYTE + RET + +; ----------------------------------------------------------------------------- +; FOREGROUND ROUTINES FOR API BUS + +RX_WAIT: + SBRC FLAGS,BOMB + RJMP TEXT_RESET + + SBRS STATUS,NOTIFY + RJMP RX_WAIT_TEST + + MOV A,TX_COUNT + CPI A,TX_SIZE ;-2 + BRSH RX_WAIT_TEST + + CLR NOTIFY_COUNT ; 6.5536 SECONDS TO NEXT NOTIFICATION + CBR STATUS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + +; ----------------------------------------------------------------------------- + +TEXT_RESET: + ; ENTRY POINT FROM RX_WAIT + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + +TEXT_RECEIVE: + ; NEXT LINE STARTS WITH RECEIVED CHAR + CLR CHAR_SAVE + + CLR ABORT_COUNT ; NO NEED TO ABORT ESC SEQUENCE + CBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI XL,$21 + LDI XH,$10 ; X = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,XL + EOR YH,XH +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +WAIT_ADD_FEEDS: + PUSH A + ADD A,FEEDS + POP A + BRCS WAIT_ADD_FEEDS + + ADD FEEDS,A + +MOTOR_START: + ;SBRS STATUS,PAPER + ;RET + + SBIC PORTC,4 + RET + + CBR FLAGS,1< ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$00,$9E,$00,$00,$00 + .DB $00,$0E,$00,$0E,$00,$00 + .DB $28,$FE,$28,$FE,$28,$00 + .DB $4C,$92,$FF,$92,$64,$00 + .DB $46,$26,$10,$C8,$C4,$00 + .DB $6C,$92,$AA,$44,$A0,$00 + .DB $00,$0B,$07,$00,$00,$00 + .DB $00,$38,$44,$82,$00,$00 + .DB $00,$82,$44,$38,$00,$00 + .DB $28,$10,$7C,$10,$28,$00 + .DB $10,$10,$7C,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $10,$10,$10,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $40,$20,$10,$08,$04,$00 + .DB $7C,$A2,$92,$8A,$7C,$00 + .DB $00,$84,$FE,$80,$00,$00 + .DB $84,$C2,$A2,$92,$8C,$00 + .DB $42,$82,$8A,$96,$62,$00 + .DB $30,$28,$24,$FE,$20,$00 + .DB $4E,$8A,$8A,$8A,$72,$00 + .DB $78,$94,$92,$92,$60,$00 + .DB $02,$E2,$12,$0A,$06,$00 + .DB $6C,$92,$92,$92,$6C,$00 + .DB $0C,$92,$92,$52,$3C,$00 + .DB $00,$6C,$6C,$00,$00,$00 + .DB $00,$6C,$EC,$00,$00,$00 + .DB $10,$28,$44,$82,$00,$00 + .DB $28,$28,$28,$28,$28,$00 + .DB $00,$82,$44,$28,$10,$00 + .DB $04,$02,$A2,$12,$0C,$00 + .DB $7C,$82,$BA,$AA,$3C,$00 + .DB $FC,$22,$22,$22,$FC,$00 + .DB $FE,$92,$92,$92,$6C,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $FE,$82,$82,$44,$38,$00 + .DB $FE,$92,$92,$92,$82,$00 + .DB $FE,$12,$12,$12,$02,$00 + .DB $7C,$82,$92,$92,$F4,$00 + .DB $FE,$10,$10,$10,$FE,$00 + .DB $00,$82,$FE,$82,$00,$00 + .DB $40,$80,$82,$7E,$02,$00 + .DB $FE,$10,$28,$44,$82,$00 + .DB $FE,$80,$80,$80,$80,$00 + .DB $FE,$04,$18,$04,$FE,$00 + .DB $FE,$08,$10,$20,$FE,$00 + .DB $7C,$82,$82,$82,$7C,$00 + .DB $FE,$12,$12,$12,$0C,$00 + .DB $7C,$82,$A2,$42,$BC,$00 + .DB $FE,$12,$32,$52,$8C,$00 + .DB $4C,$92,$92,$92,$64,$00 + .DB $02,$02,$FE,$02,$02,$00 + .DB $7E,$80,$80,$80,$7E,$00 + .DB $3E,$40,$80,$40,$3E,$00 + .DB $7E,$80,$70,$80,$7E,$00 + .DB $C6,$28,$10,$28,$C6,$00 + .DB $0E,$10,$E0,$10,$0E,$00 + .DB $C2,$A2,$92,$8A,$86,$00 + .DB $00,$FE,$82,$82,$00,$00 + .DB $04,$08,$10,$20,$40,$00 + .DB $00,$82,$82,$FE,$00,$00 + .DB $08,$04,$02,$04,$08,$00 + .DB $80,$80,$80,$80,$80,$00 + .DB $00,$00,$0E,$0D,$00,$00 + .DB $40,$A8,$A8,$A8,$F0,$00 + .DB $FE,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$88,$88,$88,$FE,$00 + .DB $70,$A8,$A8,$A8,$30,$00 + .DB $08,$08,$FC,$0A,$0A,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $FE,$10,$08,$08,$F0,$00 + .DB $00,$88,$FA,$80,$00,$00 + .DB $00,$00,$08,$FA,$00,$00 + .DB $FE,$20,$50,$88,$00,$00 + .DB $00,$82,$FE,$80,$00,$00 + .DB $F8,$08,$F8,$08,$F0,$00 + .DB $F8,$10,$08,$08,$F0,$00 + .DB $70,$88,$88,$88,$70,$00 + .DB $F8,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $F8,$10,$08,$08,$00,$00 + .DB $90,$A8,$A8,$A8,$48,$00 + .DB $08,$08,$7E,$88,$88,$00 + .DB $78,$80,$80,$40,$F8,$00 + .DB $38,$40,$80,$40,$38,$00 + .DB $78,$80,$60,$80,$78,$00 + .DB $88,$50,$20,$50,$88,$00 + .DB $78,$80,$80,$80,$F8,$00 + .DB $88,$C8,$A8,$98,$88,$00 + .DB $10,$6C,$82,$82,$00,$00 + .DB $00,$00,$EE,$00,$00,$00 + .DB $00,$82,$82,$6C,$10,$00 + .DB $04,$02,$04,$08,$04,$00 + .DB $E0,$90,$88,$90,$E0,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $7A,$80,$80,$40,$FA,$00 + .DB $70,$A8,$AA,$A9,$30,$00 + .DB $40,$AA,$A9,$AA,$F0,$00 + .DB $42,$A8,$A8,$A8,$F2,$00 + .DB $40,$A9,$AA,$A8,$F0,$00 + .DB $40,$AE,$AA,$AE,$F0,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$AA,$A9,$AA,$30,$00 + .DB $72,$A8,$A8,$A8,$32,$00 + .DB $70,$A9,$AA,$A8,$30,$00 + .DB $02,$88,$F8,$80,$02,$00 + .DB $00,$8A,$F9,$82,$00,$00 + .DB $00,$89,$FA,$80,$00,$00 + .DB $F9,$24,$24,$24,$F9,$00 + .DB $F8,$27,$25,$27,$F8,$00 + .DB $F8,$A8,$AA,$A9,$88,$00 + .DB $68,$A8,$F8,$A8,$B0,$00 + .DB $FC,$12,$FE,$92,$92,$00 + .DB $70,$8A,$89,$8A,$70,$00 + .DB $72,$88,$88,$88,$72,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$82,$81,$42,$F8,$00 + .DB $78,$81,$82,$40,$F8,$00 + .DB $7A,$80,$80,$80,$FA,$00 + .DB $79,$84,$84,$84,$79,$00 + .DB $7D,$80,$80,$80,$7D,$00 + .DB $70,$88,$88,$FC,$88,$00 + .DB $90,$7C,$92,$92,$C4,$00 + .DB $52,$54,$F8,$54,$52,$00 + .DB $82,$82,$44,$44,$28,$28 + .DB $10,$10,$28,$54,$54,$28 + .DB $40,$A8,$AA,$A9,$F0,$00 + .DB $00,$8A,$F9,$80,$00,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$80,$82,$41,$F8,$00 + .DB $FA,$11,$0A,$09,$F0,$00 + .DB $FA,$11,$22,$41,$F8,$00 + .DB $90,$AA,$AA,$AA,$BC,$00 + .DB $9C,$A2,$A2,$A2,$9C,$00 + .DB $60,$90,$8A,$80,$40,$00 + .DB $FE,$02,$02,$02,$02,$02 + .DB $02,$02,$02,$02,$02,$FE + .DB $2F,$10,$48,$24,$C0,$00 + .DB $2F,$90,$48,$E4,$00,$00 + .DB $00,$00,$F2,$00,$00,$00 + .DB $FE,$80,$80,$80,$80,$80 + .DB $80,$80,$80,$80,$80,$FE + .DB $00,$80,$00,$00,$80,$00 + .DB $55,$AA,$55,$AA,$55,$AA + .DB $33,$CC,$33,$CC,$33,$CC + .DB $00,$00,$FF,$00,$00,$00 + .DB $10,$10,$FF,$00,$00,$00 + .DB $28,$28,$FF,$00,$00,$00 + .DB $10,$FF,$00,$FF,$00,$00 + .DB $10,$F0,$10,$F0,$00,$00 + .DB $28,$28,$F8,$00,$00,$00 + .DB $28,$EF,$00,$FF,$00,$00 + .DB $00,$FF,$00,$FF,$00,$00 + .DB $28,$E8,$08,$F8,$00,$00 + .DB $28,$2F,$20,$3F,$00,$00 + .DB $10,$1F,$10,$1F,$00,$00 + .DB $28,$28,$3F,$00,$00,$00 + .DB $10,$10,$F0,$00,$00,$00 + .DB $00,$00,$1F,$10,$10,$10 + .DB $10,$10,$1F,$10,$10,$10 + .DB $10,$10,$F0,$10,$10,$10 + .DB $00,$00,$FF,$10,$10,$10 + .DB $10,$10,$10,$10,$10,$10 + .DB $10,$10,$FF,$10,$10,$10 + .DB $00,$00,$FF,$28,$28,$28 + .DB $00,$FF,$00,$FF,$10,$10 + .DB $00,$3F,$20,$2F,$28,$28 + .DB $00,$F8,$08,$E8,$28,$28 + .DB $28,$2F,$20,$2F,$28,$28 + .DB $28,$E8,$08,$E8,$28,$28 + .DB $00,$FF,$00,$EF,$28,$28 + .DB $28,$28,$28,$28,$28,$28 + .DB $28,$EF,$00,$EF,$28,$28 + .DB $28,$28,$2F,$28,$28,$28 + .DB $10,$1F,$10,$1F,$10,$10 + .DB $28,$28,$E8,$28,$28,$28 + .DB $10,$F0,$10,$F0,$10,$10 + .DB $00,$1F,$10,$1F,$10,$10 + .DB $00,$00,$3F,$28,$28,$28 + .DB $00,$00,$F8,$28,$28,$28 + .DB $00,$F0,$10,$F0,$10,$10 + .DB $10,$FF,$10,$FF,$10,$10 + .DB $28,$28,$FF,$28,$28,$28 + .DB $10,$10,$1F,$00,$00,$00 + .DB $00,$00,$F0,$10,$10,$10 + .DB $FF,$FF,$FF,$FF,$FF,$FF + .DB $E0,$E0,$E0,$E0,$E0,$E0 + .DB $FF,$FF,$FF,$00,$00,$00 + .DB $00,$00,$00,$FF,$FF,$FF + .DB $1F,$1F,$1F,$1F,$1F,$1F + .DB $70,$88,$88,$70,$88,$00 + .DB $FC,$02,$92,$92,$6C,$00 + .DB $FE,$02,$02,$02,$06,$00 + .DB $08,$F8,$08,$F8,$08,$00 + .DB $C6,$AA,$92,$82,$C6,$00 + .DB $70,$88,$88,$78,$08,$00 + .DB $00,$F8,$80,$80,$78,$00 + .DB $10,$08,$F0,$08,$00,$00 + .DB $10,$AA,$EE,$AA,$10,$00 + .DB $7C,$92,$92,$92,$7C,$00 + .DB $9C,$E2,$02,$E2,$9C,$00 + .DB $60,$94,$9A,$92,$60,$00 + .DB $70,$88,$70,$88,$70,$00 + .DB $70,$88,$FC,$88,$70,$00 + .DB $38,$54,$92,$92,$00,$00 + .DB $FC,$02,$02,$02,$FC,$00 + .DB $54,$54,$54,$54,$54,$00 + .DB $88,$88,$BE,$88,$88,$00 + .DB $A2,$A2,$94,$94,$88,$00 + .DB $88,$94,$94,$A2,$A2,$00 + .DB $00,$00,$F8,$04,$08,$00 + .DB $40,$80,$7F,$00,$00,$00 + .DB $10,$10,$54,$10,$10,$00 + .DB $48,$24,$48,$24,$00,$00 + .DB $0C,$12,$12,$0C,$00,$00 + .DB $00,$18,$18,$00,$00,$00 + .DB $00,$00,$10,$00,$00,$00 + .DB $20,$40,$FF,$01,$01,$00 + .DB $1F,$02,$01,$1E,$00,$00 + .DB $00,$12,$19,$16,$00,$00 + .DB $00,$38,$38,$38,$00,$00 + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$02,$02,$02,$01,$00 + .DB $01,$02,$02,$01,$00,$00 + .DB $03,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$03,$00 + .DB $00,$00,$02,$03,$02,$00 + .DB $00,$01,$01,$03,$01,$00 + .DB $00,$00,$01,$00,$00,$00 + .DB $00,$00,$00,$01,$00,$00 + .DB $02,$01,$00,$00,$00,$00 + .DB $00,$02,$01,$00,$00,$00 + .DB $00,$00,$02,$01,$00,$00 + .DB $00,$01,$00,$00,$00,$00 + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4107 ; HARDWARE ADDRESS COMMAND + .DW $4206 ; SOFTWARE ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/m192v0.asm b/src/avr/m192v0.asm new file mode 100644 index 00000000..904f1f21 --- /dev/null +++ b/src/avr/m192v0.asm @@ -0,0 +1,1685 @@ +; M192V0.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =6 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ;$11 ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ;$11 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =30 ; 240 / 8 = 30 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =40 ; 240 / 6 = 40 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =5 ; 40 / 8 = 5 TEXT WIDTH FLAGS + +.EQU TIME_EMERGENCY =1000 ; 1000 * 0.1 MS = APPROX 100 MS + +.EQU FEED_INITIAL =2 ; LINES ALLOWED FOR MOTOR SLOWDOWN +.EQU FEED_SPACING =3 ; LINES TO FEED IN BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF TP_COUNT =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF NOTIFY_COUNT =R14 ; COUNTER TO SEND EVERY 6.5536 SECONDS +.DEF ABORT_COUNT =R15 ; COUNTER TO ABORT ESC AFTER 0.1 SECS + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF SR =R23 +.DEF FLAGS =R24 +.DEF STATUS =R25 + +.EQU TX_SIZE =2 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_CHARS+WIDTH_FLAGS +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU RSWSAVE =2 ; SET IF RSW HI, MUST BE BIT POSITION 2 +.EQU IMAGE =3 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =4 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +;.EQU NODESC =5 ; SET BY FG WHILE PRINTING TOP 7 DOTS +;.EQU BIGDESC =6 ; SET BY FG WHILE PRINTING LOWER 2 DOTS +.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY FG JUST PRIOR TO NOTIFICATION +.EQU TP_ERROR =2 ; SET BY BG IF WE HAVE TIMEOUT ON TP +.EQU RSW_ERROR =3 ; SET BY BG IF WE HAVE TIMEOUT ON RSW +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; NODESC + +; FLAG RESET BY FOREGROUND AFTER DESCENDER TRANSLATION, IF DESCENDERS PRESENT. +; FLAG SET BY FOREGROUND AFTER DESCENDERS FINISHED AND BUFFER CLOBBERED. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE, FOR SPECIAL DESCENDER +; PROCESSING. + +; BIGDESC + +; FLAG SET UP BY FOREGROUND DURING DESCENDER TRANSLATION. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE IN COMBINATION WITH +; TEXT_MASK, TO CONTINUE DESCENDER OR REVERT TO FEEDS. + +; NOWFAST + +; FLAG SET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 115200 BPS. +; FLAG RESET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 4800 BPS. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG INT1ADDR + RJMP TP_EDGE ; EXTERNAL INT 1 HANDLER + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','1','9','2',' ' +; .DB 'P','R','I','N','T','E','R',$0D + +; ----------------------------------------------------------------------------- +; TP EDGE INTERRUPT HANDLER + +TP_EDGE: + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + IN SR,SREG ; SAVE FLAGS + + IN D,MCUCR + SBRS D,ISC10 + CBI PORTB,2 ; IF WE WERE LOOKING FOR A FALLING EDGE + SBRC D,ISC10 + SBI PORTB,2 ; IF WE WERE LOOKING FOR A RISING EDGE + LDI G,1< LOW + + SBRS D,2 + RJMP TP_SEARCH + + ; RSW FALLING EDGE DETECTED + SBIC PORTC,4 ; MOTOR ON? + RJMP TP_FEED ; YES, GO AND PRINT + + ; WE STOPPED THE MOTOR, MONITOR RSW WHILE IT SLOWS DOWN + CLR TP_COUNT ; REPLENISH COUNT OF TP EDGES TO RSW + + TST FEEDS + BREQ TP_SEARCH + DEC FEEDS ; DECREMENT FEEDS TO MINIMUM OF 0 + RJMP TP_SEARCH + +TP_COAST: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + MOV D,TP_COUNT + CPI D,3 + BRSH TP_PAPER_SKIP ; ON LAST OR 2ND LAST TP EDGE, + + SBIC PORTB,2 + RJMP TP_PAPER_SKIP ; WITH TP GENERATOR IN KNOWN STATE, + +;T0_PAPER_SETUP: + LDI A,0 + OUT GIMSK,A ; DISABLE INT 1 INTERRUPTS + + ;CBI PORTB,2 ; SET TP GENERATOR TO KNOWN STATE + SBI PORTB,1 ; MUST BE OPPOSITE TO PORTB,2 STATE + SBI DDRB,1 ; D1 = HIGH / LOW TO LIGHT LED + + LDI D,-3 + OUT TCNT0,D ; TEST PAPER IN 2 * 0.1 MS = 0.2 MS + +TP_PAPER_SKIP: + DEC TP_COUNT ; COUNT EDGES/2 TO PRINTABLE AREA-4 + BRNE TP_COAST + +TP_FEED: + ;SBRS STATUS,PAPER ; PAPER IN? + ;RJMP TP_BRAKE_NOW ; NO, STOP PRINTING IMMEDIATELY + + MOV D,FLAGS + ANDI D,(1< 3 INTERNAL FEEDS + CPI D,1 + BRSH TP_FEED_SLOW ; COAST IF => 1 INTERNAL FEED + + SBRC FLAGS,IMAGE + RJMP TP_PRINT_IMAGE ; PRINT IF GRAPHICS WAITING + + RJMP TP_PRINT_TEXT ; OTHERWISE ASSUME TEXT IS WAITING + +TP_BRAKE: + MOV D,FEEDS + CPI D,3+FEED_INITIAL + BRSH TP_FEED_FAST ; TRIGGER IF => 3+n INTERNAL FEEDS + CPI D,1+FEED_INITIAL + BRSH TP_FEED_SLOW ; COAST IF => 1+n INTERNAL FEED + +TP_BRAKE_NOW: +; TST FEEDS ; JUST MISSED RSW -> 0, COMPENSATE +; BREQ TP_BRAKE_NOW_CONT +; DEC FEEDS ; DECREMENT TO MINIMUM OF 0 +;TP_BRAKE_NOW_CONT: + CLR FEEDS + RJMP TP_KILL ; GO AND KILL MOTOR + +TP_FEED_SLOW: + DEC FEEDS + + LDI D,150 + MOV TP_COUNT,D + RJMP TP_COAST + +TP_FEED_FAST: ; AT PRINTABLE AREA-2 + SUBI D,3 + MOV FEEDS,D + + SBI PORTB,0 ; APPLY TRIGGER SOLENOID + + LDI D,9 + MOV TP_COUNT,D +TP_TRIGGERING: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + DEC TP_COUNT + BRNE TP_TRIGGERING + + CBI PORTB,0 ; CLEAR TRIGGER SOLENOID + + LDI D,150-9 + MOV TP_COUNT,D + RJMP TP_COAST + +; ----------------------------------------------------------------------------- +; TP INTERRUPT ROUTINES FOR TEXT PRINTING + +; TP_TEXT_START DOES NOT RE-ENABLE ACCESS TO FEEDS. +; FEEDS IS USED AS A COUNTER FOR DESCENDER PRINTING, +; SO WE RELY ON TIMER_COPY TO RESET NOFEED, AFTER THE +; LINE HAS BEEN CHECKED FOR DESCENDERS AND IS ABOUT TO +; BE CLOBBERED BY NEW DATA. + +TP_PRINT_TEXT: + LDI D,2 + MOV TEXT_MASK,D + MOV FEEDS,SPACING ; SET UP STANDARD FEED AFTER TEXT LINE + +TP_PRINT_TEXT_START: + LDI E,0 ; CURRENT CHARACTER FOR PRINT HEAD, 0-4 + +TP_PRINT_TEXT_CHAR: + LDI F,0 ; CURRENT PIXEL FOR CHARACTER, 0-5 + +TP_PRINT_TEXT_PIXEL: + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-30 ; E = CURRENT CHARACTER + 30 + RCALL TP_TEXT_FIRE2 + SUBI E,15 ; E = CURRENT CHARACTER + 15 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH0 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-35 ; E = CURRENT CHARACTER + 35 + RCALL TP_TEXT_FIRE1 + SUBI E,15 ; E = CURRENT CHARACTER + 20 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 5 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH1 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-20 ; E = CURRENT CHARACTER + 25 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 10 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH2 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + SUBI E,10 ; E = CURRENT CHARACTER + + INC F ; NEXT PIXEL FOR CHARACTER + CPI F,6 ; GONE PAST LAST PIXEL FOR CHARACTER? + BRLO TP_PRINT_TEXT_PIXEL ; REPEAT UNLESS ALL PIXELS DONE + + INC E ; NEXT CHARACTER FOR PRINT HEAD + CPI E,5 ; GONE PAST LAST CHAR FOR PRINT HEAD? + BRLO TP_PRINT_TEXT_CHAR ; REPEAT UNLESS ALL CHARACTERS DONE + + CLR H + RCALL TP_LATCH0 ; CLEAR D4-D7 AND C0-C3 + + SBRC TEXT_MASK,7 ; LAST DOT LINE FOR CHARACTER LINE? + CBR FLAGS,1< CHARACTER SET SLICE IN FLASH + + LPM ; R0 = CORRECT VERTICAL SLICE OF CHAR + RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + LSL ZL ; ZL = CHARACTER DEFINITION * 8 + SUB ZL,D ; ZL = CHARACTER DEFINITION * 7 + ;CLR ZH + + SUBI ZL,-(EE_COUNT*2+2) ; PAST CRC, COUNT, AND CHARACTER CODE + ADD ZL,F ; ZL = BASE + CHAR * 6 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN R0,EEDR ; GET LATCHED DATA BYTE + RET + +; ----------------------------------------------------------------------------- +; FOREGROUND ROUTINES FOR API BUS + +RX_WAIT: + SBRC FLAGS,BOMB + RJMP TEXT_RESET + + SBRS STATUS,NOTIFY + RJMP RX_WAIT_TEST + + MOV A,TX_COUNT + CPI A,TX_SIZE ;-2 + BRSH RX_WAIT_TEST + + CLR NOTIFY_COUNT ; 6.5536 SECONDS TO NEXT NOTIFICATION + CBR STATUS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + +; ----------------------------------------------------------------------------- + +TEXT_RESET: + ; ENTRY POINT FROM RX_WAIT + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + +TEXT_RECEIVE: + ; NEXT LINE STARTS WITH RECEIVED CHAR + CLR CHAR_SAVE + + CLR ABORT_COUNT ; NO NEED TO ABORT ESC SEQUENCE + CBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI XL,$21 + LDI XH,$10 ; X = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,XL + EOR YH,XH +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +WAIT_ADD_FEEDS: + PUSH A + ADD A,FEEDS + POP A + BRCS WAIT_ADD_FEEDS + + ADD FEEDS,A + +MOTOR_START: + ;SBRS STATUS,PAPER + ;RET + + SBIC PORTC,4 + RET + + CBR FLAGS,1< ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$00,$9E,$00,$00,$00 + .DB $00,$0E,$00,$0E,$00,$00 + .DB $28,$FE,$28,$FE,$28,$00 + .DB $4C,$92,$FF,$92,$64,$00 + .DB $46,$26,$10,$C8,$C4,$00 + .DB $6C,$92,$AA,$44,$A0,$00 + .DB $00,$0B,$07,$00,$00,$00 + .DB $00,$38,$44,$82,$00,$00 + .DB $00,$82,$44,$38,$00,$00 + .DB $28,$10,$7C,$10,$28,$00 + .DB $10,$10,$7C,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $10,$10,$10,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $40,$20,$10,$08,$04,$00 + .DB $7C,$A2,$92,$8A,$7C,$00 + .DB $00,$84,$FE,$80,$00,$00 + .DB $84,$C2,$A2,$92,$8C,$00 + .DB $42,$82,$8A,$96,$62,$00 + .DB $30,$28,$24,$FE,$20,$00 + .DB $4E,$8A,$8A,$8A,$72,$00 + .DB $78,$94,$92,$92,$60,$00 + .DB $02,$E2,$12,$0A,$06,$00 + .DB $6C,$92,$92,$92,$6C,$00 + .DB $0C,$92,$92,$52,$3C,$00 + .DB $00,$6C,$6C,$00,$00,$00 + .DB $00,$6C,$EC,$00,$00,$00 + .DB $10,$28,$44,$82,$00,$00 + .DB $28,$28,$28,$28,$28,$00 + .DB $00,$82,$44,$28,$10,$00 + .DB $04,$02,$A2,$12,$0C,$00 + .DB $7C,$82,$BA,$AA,$3C,$00 + .DB $FC,$22,$22,$22,$FC,$00 + .DB $FE,$92,$92,$92,$6C,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $FE,$82,$82,$44,$38,$00 + .DB $FE,$92,$92,$92,$82,$00 + .DB $FE,$12,$12,$12,$02,$00 + .DB $7C,$82,$92,$92,$F4,$00 + .DB $FE,$10,$10,$10,$FE,$00 + .DB $00,$82,$FE,$82,$00,$00 + .DB $40,$80,$82,$7E,$02,$00 + .DB $FE,$10,$28,$44,$82,$00 + .DB $FE,$80,$80,$80,$80,$00 + .DB $FE,$04,$18,$04,$FE,$00 + .DB $FE,$08,$10,$20,$FE,$00 + .DB $7C,$82,$82,$82,$7C,$00 + .DB $FE,$12,$12,$12,$0C,$00 + .DB $7C,$82,$A2,$42,$BC,$00 + .DB $FE,$12,$32,$52,$8C,$00 + .DB $4C,$92,$92,$92,$64,$00 + .DB $02,$02,$FE,$02,$02,$00 + .DB $7E,$80,$80,$80,$7E,$00 + .DB $3E,$40,$80,$40,$3E,$00 + .DB $7E,$80,$70,$80,$7E,$00 + .DB $C6,$28,$10,$28,$C6,$00 + .DB $0E,$10,$E0,$10,$0E,$00 + .DB $C2,$A2,$92,$8A,$86,$00 + .DB $00,$FE,$82,$82,$00,$00 + .DB $04,$08,$10,$20,$40,$00 + .DB $00,$82,$82,$FE,$00,$00 + .DB $08,$04,$02,$04,$08,$00 + .DB $80,$80,$80,$80,$80,$00 + .DB $00,$00,$0E,$0D,$00,$00 + .DB $40,$A8,$A8,$A8,$F0,$00 + .DB $FE,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$88,$88,$88,$FE,$00 + .DB $70,$A8,$A8,$A8,$30,$00 + .DB $08,$08,$FC,$0A,$0A,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $FE,$10,$08,$08,$F0,$00 + .DB $00,$88,$FA,$80,$00,$00 + .DB $00,$00,$08,$FA,$00,$00 + .DB $FE,$20,$50,$88,$00,$00 + .DB $00,$82,$FE,$80,$00,$00 + .DB $F8,$08,$F8,$08,$F0,$00 + .DB $F8,$10,$08,$08,$F0,$00 + .DB $70,$88,$88,$88,$70,$00 + .DB $F8,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $F8,$10,$08,$08,$00,$00 + .DB $90,$A8,$A8,$A8,$48,$00 + .DB $08,$08,$7E,$88,$88,$00 + .DB $78,$80,$80,$40,$F8,$00 + .DB $38,$40,$80,$40,$38,$00 + .DB $78,$80,$60,$80,$78,$00 + .DB $88,$50,$20,$50,$88,$00 + .DB $78,$80,$80,$80,$F8,$00 + .DB $88,$C8,$A8,$98,$88,$00 + .DB $10,$6C,$82,$82,$00,$00 + .DB $00,$00,$EE,$00,$00,$00 + .DB $00,$82,$82,$6C,$10,$00 + .DB $04,$02,$04,$08,$04,$00 + .DB $E0,$90,$88,$90,$E0,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $7A,$80,$80,$40,$FA,$00 + .DB $70,$A8,$AA,$A9,$30,$00 + .DB $40,$AA,$A9,$AA,$F0,$00 + .DB $42,$A8,$A8,$A8,$F2,$00 + .DB $40,$A9,$AA,$A8,$F0,$00 + .DB $40,$AE,$AA,$AE,$F0,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$AA,$A9,$AA,$30,$00 + .DB $72,$A8,$A8,$A8,$32,$00 + .DB $70,$A9,$AA,$A8,$30,$00 + .DB $02,$88,$F8,$80,$02,$00 + .DB $00,$8A,$F9,$82,$00,$00 + .DB $00,$89,$FA,$80,$00,$00 + .DB $F9,$24,$24,$24,$F9,$00 + .DB $F8,$27,$25,$27,$F8,$00 + .DB $F8,$A8,$AA,$A9,$88,$00 + .DB $68,$A8,$F8,$A8,$B0,$00 + .DB $FC,$12,$FE,$92,$92,$00 + .DB $70,$8A,$89,$8A,$70,$00 + .DB $72,$88,$88,$88,$72,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$82,$81,$42,$F8,$00 + .DB $78,$81,$82,$40,$F8,$00 + .DB $7A,$80,$80,$80,$FA,$00 + .DB $79,$84,$84,$84,$79,$00 + .DB $7D,$80,$80,$80,$7D,$00 + .DB $70,$88,$88,$FC,$88,$00 + .DB $90,$7C,$92,$92,$C4,$00 + .DB $52,$54,$F8,$54,$52,$00 + .DB $82,$82,$44,$44,$28,$28 + .DB $10,$10,$28,$54,$54,$28 + .DB $40,$A8,$AA,$A9,$F0,$00 + .DB $00,$8A,$F9,$80,$00,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$80,$82,$41,$F8,$00 + .DB $FA,$11,$0A,$09,$F0,$00 + .DB $FA,$11,$22,$41,$F8,$00 + .DB $90,$AA,$AA,$AA,$BC,$00 + .DB $9C,$A2,$A2,$A2,$9C,$00 + .DB $60,$90,$8A,$80,$40,$00 + .DB $FE,$02,$02,$02,$02,$02 + .DB $02,$02,$02,$02,$02,$FE + .DB $2F,$10,$48,$24,$C0,$00 + .DB $2F,$90,$48,$E4,$00,$00 + .DB $00,$00,$F2,$00,$00,$00 + .DB $FE,$80,$80,$80,$80,$80 + .DB $80,$80,$80,$80,$80,$FE + .DB $00,$80,$00,$00,$80,$00 + .DB $55,$AA,$55,$AA,$55,$AA + .DB $33,$CC,$33,$CC,$33,$CC + .DB $00,$00,$FF,$00,$00,$00 + .DB $10,$10,$FF,$00,$00,$00 + .DB $28,$28,$FF,$00,$00,$00 + .DB $10,$FF,$00,$FF,$00,$00 + .DB $10,$F0,$10,$F0,$00,$00 + .DB $28,$28,$F8,$00,$00,$00 + .DB $28,$EF,$00,$FF,$00,$00 + .DB $00,$FF,$00,$FF,$00,$00 + .DB $28,$E8,$08,$F8,$00,$00 + .DB $28,$2F,$20,$3F,$00,$00 + .DB $10,$1F,$10,$1F,$00,$00 + .DB $28,$28,$3F,$00,$00,$00 + .DB $10,$10,$F0,$00,$00,$00 + .DB $00,$00,$1F,$10,$10,$10 + .DB $10,$10,$1F,$10,$10,$10 + .DB $10,$10,$F0,$10,$10,$10 + .DB $00,$00,$FF,$10,$10,$10 + .DB $10,$10,$10,$10,$10,$10 + .DB $10,$10,$FF,$10,$10,$10 + .DB $00,$00,$FF,$28,$28,$28 + .DB $00,$FF,$00,$FF,$10,$10 + .DB $00,$3F,$20,$2F,$28,$28 + .DB $00,$F8,$08,$E8,$28,$28 + .DB $28,$2F,$20,$2F,$28,$28 + .DB $28,$E8,$08,$E8,$28,$28 + .DB $00,$FF,$00,$EF,$28,$28 + .DB $28,$28,$28,$28,$28,$28 + .DB $28,$EF,$00,$EF,$28,$28 + .DB $28,$28,$2F,$28,$28,$28 + .DB $10,$1F,$10,$1F,$10,$10 + .DB $28,$28,$E8,$28,$28,$28 + .DB $10,$F0,$10,$F0,$10,$10 + .DB $00,$1F,$10,$1F,$10,$10 + .DB $00,$00,$3F,$28,$28,$28 + .DB $00,$00,$F8,$28,$28,$28 + .DB $00,$F0,$10,$F0,$10,$10 + .DB $10,$FF,$10,$FF,$10,$10 + .DB $28,$28,$FF,$28,$28,$28 + .DB $10,$10,$1F,$00,$00,$00 + .DB $00,$00,$F0,$10,$10,$10 + .DB $FF,$FF,$FF,$FF,$FF,$FF + .DB $E0,$E0,$E0,$E0,$E0,$E0 + .DB $FF,$FF,$FF,$00,$00,$00 + .DB $00,$00,$00,$FF,$FF,$FF + .DB $1F,$1F,$1F,$1F,$1F,$1F + .DB $70,$88,$88,$70,$88,$00 + .DB $FC,$02,$92,$92,$6C,$00 + .DB $FE,$02,$02,$02,$06,$00 + .DB $08,$F8,$08,$F8,$08,$00 + .DB $C6,$AA,$92,$82,$C6,$00 + .DB $70,$88,$88,$78,$08,$00 + .DB $00,$F8,$80,$80,$78,$00 + .DB $10,$08,$F0,$08,$00,$00 + .DB $10,$AA,$EE,$AA,$10,$00 + .DB $7C,$92,$92,$92,$7C,$00 + .DB $9C,$E2,$02,$E2,$9C,$00 + .DB $60,$94,$9A,$92,$60,$00 + .DB $70,$88,$70,$88,$70,$00 + .DB $70,$88,$FC,$88,$70,$00 + .DB $38,$54,$92,$92,$00,$00 + .DB $FC,$02,$02,$02,$FC,$00 + .DB $54,$54,$54,$54,$54,$00 + .DB $88,$88,$BE,$88,$88,$00 + .DB $A2,$A2,$94,$94,$88,$00 + .DB $88,$94,$94,$A2,$A2,$00 + .DB $00,$00,$F8,$04,$08,$00 + .DB $40,$80,$7F,$00,$00,$00 + .DB $10,$10,$54,$10,$10,$00 + .DB $48,$24,$48,$24,$00,$00 + .DB $0C,$12,$12,$0C,$00,$00 + .DB $00,$18,$18,$00,$00,$00 + .DB $00,$00,$10,$00,$00,$00 + .DB $20,$40,$FF,$01,$01,$00 + .DB $1F,$02,$01,$1E,$00,$00 + .DB $00,$12,$19,$16,$00,$00 + .DB $00,$38,$38,$38,$00,$00 + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$02,$02,$02,$01,$00 + .DB $01,$02,$02,$01,$00,$00 + .DB $03,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$03,$00 + .DB $00,$00,$02,$03,$02,$00 + .DB $00,$01,$01,$03,$01,$00 + .DB $00,$00,$01,$00,$00,$00 + .DB $00,$00,$00,$01,$00,$00 + .DB $02,$01,$00,$00,$00,$00 + .DB $00,$02,$01,$00,$00,$00 + .DB $00,$00,$02,$01,$00,$00 + .DB $00,$01,$00,$00,$00,$00 + +; ----------------------------------------------------------------------------- + + ; BODEN = 0 ENABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4107 ; HARDWARE ADDRESS COMMAND + .DW $4206 ; SOFTWARE ADDRESS COMMAND + .DW $ACB2 ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/m192v1.asm b/src/avr/m192v1.asm new file mode 100644 index 00000000..1bf5b239 --- /dev/null +++ b/src/avr/m192v1.asm @@ -0,0 +1,1685 @@ +; M192V1.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =6 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ;$11 ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ;$11 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =30 ; 240 / 8 = 30 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =40 ; 240 / 6 = 40 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =5 ; 40 / 8 = 5 TEXT WIDTH FLAGS + +.EQU TIME_EMERGENCY =1000 ; 1000 * 0.1 MS = APPROX 100 MS + +.EQU FEED_INITIAL =2 ; LINES ALLOWED FOR MOTOR SLOWDOWN +.EQU FEED_SPACING =3 ; LINES TO FEED IN BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF TP_COUNT =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF NOTIFY_COUNT =R14 ; COUNTER TO SEND EVERY 6.5536 SECONDS +.DEF ABORT_COUNT =R15 ; COUNTER TO ABORT ESC AFTER 0.1 SECS + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF SR =R23 +.DEF FLAGS =R24 +.DEF STATUS =R25 + +.EQU TX_SIZE =2 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_CHARS+WIDTH_FLAGS +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU RSWSAVE =2 ; SET IF RSW HI, MUST BE BIT POSITION 2 +.EQU IMAGE =3 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =4 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +;.EQU NODESC =5 ; SET BY FG WHILE PRINTING TOP 7 DOTS +;.EQU BIGDESC =6 ; SET BY FG WHILE PRINTING LOWER 2 DOTS +.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY FG JUST PRIOR TO NOTIFICATION +.EQU TP_ERROR =2 ; SET BY BG IF WE HAVE TIMEOUT ON TP +.EQU RSW_ERROR =3 ; SET BY BG IF WE HAVE TIMEOUT ON RSW +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; NODESC + +; FLAG RESET BY FOREGROUND AFTER DESCENDER TRANSLATION, IF DESCENDERS PRESENT. +; FLAG SET BY FOREGROUND AFTER DESCENDERS FINISHED AND BUFFER CLOBBERED. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE, FOR SPECIAL DESCENDER +; PROCESSING. + +; BIGDESC + +; FLAG SET UP BY FOREGROUND DURING DESCENDER TRANSLATION. +; FLAG SAMPLED BY BACKGROUND AT END OF DOT LINE IN COMBINATION WITH +; TEXT_MASK, TO CONTINUE DESCENDER OR REVERT TO FEEDS. + +; NOWFAST + +; FLAG SET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 115200 BPS. +; FLAG RESET BY BACKGROUND COMMS TASK WHEN UART IS PROGRAMMED TO 4800 BPS. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG INT1ADDR + RJMP TP_EDGE ; EXTERNAL INT 1 HANDLER + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','1','9','2',' ' +; .DB 'P','R','I','N','T','E','R',$0D + +; ----------------------------------------------------------------------------- +; TP EDGE INTERRUPT HANDLER + +TP_EDGE: + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + IN SR,SREG ; SAVE FLAGS + + IN D,MCUCR + SBRS D,ISC10 + CBI PORTB,2 ; IF WE WERE LOOKING FOR A FALLING EDGE + SBRC D,ISC10 + SBI PORTB,2 ; IF WE WERE LOOKING FOR A RISING EDGE + LDI G,1< LOW + + SBRS D,2 + RJMP TP_SEARCH + + ; RSW FALLING EDGE DETECTED + SBIC PORTC,4 ; MOTOR ON? + RJMP TP_FEED ; YES, GO AND PRINT + + ; WE STOPPED THE MOTOR, MONITOR RSW WHILE IT SLOWS DOWN + CLR TP_COUNT ; REPLENISH COUNT OF TP EDGES TO RSW + + TST FEEDS + BREQ TP_SEARCH + DEC FEEDS ; DECREMENT FEEDS TO MINIMUM OF 0 + RJMP TP_SEARCH + +TP_COAST: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + MOV D,TP_COUNT + CPI D,3 + BRSH TP_PAPER_SKIP ; ON LAST OR 2ND LAST TP EDGE, + + SBIC PORTB,2 + RJMP TP_PAPER_SKIP ; WITH TP GENERATOR IN KNOWN STATE, + +;T0_PAPER_SETUP: + LDI A,0 + OUT GIMSK,A ; DISABLE INT 1 INTERRUPTS + + ;CBI PORTB,2 ; SET TP GENERATOR TO KNOWN STATE + SBI PORTB,1 ; MUST BE OPPOSITE TO PORTB,2 STATE + SBI DDRB,1 ; D1 = HIGH / LOW TO LIGHT LED + + LDI D,-3 + OUT TCNT0,D ; TEST PAPER IN 2 * 0.1 MS = 0.2 MS + +TP_PAPER_SKIP: + DEC TP_COUNT ; COUNT EDGES/2 TO PRINTABLE AREA-4 + BRNE TP_COAST + +TP_FEED: + ;SBRS STATUS,PAPER ; PAPER IN? + ;RJMP TP_BRAKE_NOW ; NO, STOP PRINTING IMMEDIATELY + + MOV D,FLAGS + ANDI D,(1< 3 INTERNAL FEEDS + CPI D,1 + BRSH TP_FEED_SLOW ; COAST IF => 1 INTERNAL FEED + + SBRC FLAGS,IMAGE + RJMP TP_PRINT_IMAGE ; PRINT IF GRAPHICS WAITING + + RJMP TP_PRINT_TEXT ; OTHERWISE ASSUME TEXT IS WAITING + +TP_BRAKE: + MOV D,FEEDS + CPI D,3+FEED_INITIAL + BRSH TP_FEED_FAST ; TRIGGER IF => 3+n INTERNAL FEEDS + CPI D,1+FEED_INITIAL + BRSH TP_FEED_SLOW ; COAST IF => 1+n INTERNAL FEED + +TP_BRAKE_NOW: +; TST FEEDS ; JUST MISSED RSW -> 0, COMPENSATE +; BREQ TP_BRAKE_NOW_CONT +; DEC FEEDS ; DECREMENT TO MINIMUM OF 0 +;TP_BRAKE_NOW_CONT: + CLR FEEDS + RJMP TP_KILL ; GO AND KILL MOTOR + +TP_FEED_SLOW: + DEC FEEDS + + LDI D,150 + MOV TP_COUNT,D + RJMP TP_COAST + +TP_FEED_FAST: ; AT PRINTABLE AREA-2 + SUBI D,3 + MOV FEEDS,D + + SBI PORTB,0 ; APPLY TRIGGER SOLENOID + + LDI D,9 + MOV TP_COUNT,D +TP_TRIGGERING: + RCALL TP_DONE ; RETURNS NEXT TP EDGE + DEC TP_COUNT + BRNE TP_TRIGGERING + + CBI PORTB,0 ; CLEAR TRIGGER SOLENOID + + LDI D,150-9 + MOV TP_COUNT,D + RJMP TP_COAST + +; ----------------------------------------------------------------------------- +; TP INTERRUPT ROUTINES FOR TEXT PRINTING + +; TP_TEXT_START DOES NOT RE-ENABLE ACCESS TO FEEDS. +; FEEDS IS USED AS A COUNTER FOR DESCENDER PRINTING, +; SO WE RELY ON TIMER_COPY TO RESET NOFEED, AFTER THE +; LINE HAS BEEN CHECKED FOR DESCENDERS AND IS ABOUT TO +; BE CLOBBERED BY NEW DATA. + +TP_PRINT_TEXT: + LDI D,2 + MOV TEXT_MASK,D + MOV FEEDS,SPACING ; SET UP STANDARD FEED AFTER TEXT LINE + +TP_PRINT_TEXT_START: + LDI E,0 ; CURRENT CHARACTER FOR PRINT HEAD, 0-4 + +TP_PRINT_TEXT_CHAR: + LDI F,0 ; CURRENT PIXEL FOR CHARACTER, 0-5 + +TP_PRINT_TEXT_PIXEL: + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-30 ; E = CURRENT CHARACTER + 30 + RCALL TP_TEXT_FIRE2 + SUBI E,15 ; E = CURRENT CHARACTER + 15 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH0 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-35 ; E = CURRENT CHARACTER + 35 + RCALL TP_TEXT_FIRE1 + SUBI E,15 ; E = CURRENT CHARACTER + 20 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 5 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH1 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + PUSH ZL + PUSH ZH + PUSH R0 + + SUBI E,-20 ; E = CURRENT CHARACTER + 25 + RCALL TP_TEXT_FIRE3 + SUBI E,15 ; E = CURRENT CHARACTER + 10 + RCALL TP_TEXT_FIRE3 + RCALL TP_LATCH2 + + POP R0 + POP ZH + POP ZL + + RCALL TP_DONE ; RETURNS NEXT TP EDGE + + SUBI E,10 ; E = CURRENT CHARACTER + + INC F ; NEXT PIXEL FOR CHARACTER + CPI F,6 ; GONE PAST LAST PIXEL FOR CHARACTER? + BRLO TP_PRINT_TEXT_PIXEL ; REPEAT UNLESS ALL PIXELS DONE + + INC E ; NEXT CHARACTER FOR PRINT HEAD + CPI E,5 ; GONE PAST LAST CHAR FOR PRINT HEAD? + BRLO TP_PRINT_TEXT_CHAR ; REPEAT UNLESS ALL CHARACTERS DONE + + CLR H + RCALL TP_LATCH0 ; CLEAR D4-D7 AND C0-C3 + + SBRC TEXT_MASK,7 ; LAST DOT LINE FOR CHARACTER LINE? + CBR FLAGS,1< CHARACTER SET SLICE IN FLASH + + LPM ; R0 = CORRECT VERTICAL SLICE OF CHAR + RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + LSL ZL ; ZL = CHARACTER DEFINITION * 8 + SUB ZL,D ; ZL = CHARACTER DEFINITION * 7 + ;CLR ZH + + SUBI ZL,-(EE_COUNT*2+2) ; PAST CRC, COUNT, AND CHARACTER CODE + ADD ZL,F ; ZL = BASE + CHAR * 6 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN R0,EEDR ; GET LATCHED DATA BYTE + RET + +; ----------------------------------------------------------------------------- +; FOREGROUND ROUTINES FOR API BUS + +RX_WAIT: + SBRC FLAGS,BOMB + RJMP TEXT_RESET + + SBRS STATUS,NOTIFY + RJMP RX_WAIT_TEST + + MOV A,TX_COUNT + CPI A,TX_SIZE ;-2 + BRSH RX_WAIT_TEST + + CLR NOTIFY_COUNT ; 6.5536 SECONDS TO NEXT NOTIFICATION + CBR STATUS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + +; ----------------------------------------------------------------------------- + +TEXT_RESET: + ; ENTRY POINT FROM RX_WAIT + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + +TEXT_RECEIVE: + ; NEXT LINE STARTS WITH RECEIVED CHAR + CLR CHAR_SAVE + + CLR ABORT_COUNT ; NO NEED TO ABORT ESC SEQUENCE + CBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI XL,$21 + LDI XH,$10 ; X = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,XL + EOR YH,XH +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +WAIT_ADD_FEEDS: + PUSH A + ADD A,FEEDS + POP A + BRCS WAIT_ADD_FEEDS + + ADD FEEDS,A + +MOTOR_START: + ;SBRS STATUS,PAPER + ;RET + + SBIC PORTC,4 + RET + + CBR FLAGS,1< ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$00,$9E,$00,$00,$00 + .DB $00,$0E,$00,$0E,$00,$00 + .DB $28,$FE,$28,$FE,$28,$00 + .DB $4C,$92,$FF,$92,$64,$00 + .DB $46,$26,$10,$C8,$C4,$00 + .DB $6C,$92,$AA,$44,$A0,$00 + .DB $00,$0B,$07,$00,$00,$00 + .DB $00,$38,$44,$82,$00,$00 + .DB $00,$82,$44,$38,$00,$00 + .DB $28,$10,$7C,$10,$28,$00 + .DB $10,$10,$7C,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $10,$10,$10,$10,$10,$00 + .DB $00,$C0,$C0,$00,$00,$00 + .DB $40,$20,$10,$08,$04,$00 + .DB $7C,$A2,$92,$8A,$7C,$00 + .DB $00,$84,$FE,$80,$00,$00 + .DB $84,$C2,$A2,$92,$8C,$00 + .DB $42,$82,$8A,$96,$62,$00 + .DB $30,$28,$24,$FE,$20,$00 + .DB $4E,$8A,$8A,$8A,$72,$00 + .DB $78,$94,$92,$92,$60,$00 + .DB $02,$E2,$12,$0A,$06,$00 + .DB $6C,$92,$92,$92,$6C,$00 + .DB $0C,$92,$92,$52,$3C,$00 + .DB $00,$6C,$6C,$00,$00,$00 + .DB $00,$6C,$EC,$00,$00,$00 + .DB $10,$28,$44,$82,$00,$00 + .DB $28,$28,$28,$28,$28,$00 + .DB $00,$82,$44,$28,$10,$00 + .DB $04,$02,$A2,$12,$0C,$00 + .DB $7C,$82,$BA,$AA,$3C,$00 + .DB $FC,$22,$22,$22,$FC,$00 + .DB $FE,$92,$92,$92,$6C,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $FE,$82,$82,$44,$38,$00 + .DB $FE,$92,$92,$92,$82,$00 + .DB $FE,$12,$12,$12,$02,$00 + .DB $7C,$82,$92,$92,$F4,$00 + .DB $FE,$10,$10,$10,$FE,$00 + .DB $00,$82,$FE,$82,$00,$00 + .DB $40,$80,$82,$7E,$02,$00 + .DB $FE,$10,$28,$44,$82,$00 + .DB $FE,$80,$80,$80,$80,$00 + .DB $FE,$04,$18,$04,$FE,$00 + .DB $FE,$08,$10,$20,$FE,$00 + .DB $7C,$82,$82,$82,$7C,$00 + .DB $FE,$12,$12,$12,$0C,$00 + .DB $7C,$82,$A2,$42,$BC,$00 + .DB $FE,$12,$32,$52,$8C,$00 + .DB $4C,$92,$92,$92,$64,$00 + .DB $02,$02,$FE,$02,$02,$00 + .DB $7E,$80,$80,$80,$7E,$00 + .DB $3E,$40,$80,$40,$3E,$00 + .DB $7E,$80,$70,$80,$7E,$00 + .DB $C6,$28,$10,$28,$C6,$00 + .DB $0E,$10,$E0,$10,$0E,$00 + .DB $C2,$A2,$92,$8A,$86,$00 + .DB $00,$FE,$82,$82,$00,$00 + .DB $04,$08,$10,$20,$40,$00 + .DB $00,$82,$82,$FE,$00,$00 + .DB $08,$04,$02,$04,$08,$00 + .DB $80,$80,$80,$80,$80,$00 + .DB $00,$00,$0E,$0D,$00,$00 + .DB $40,$A8,$A8,$A8,$F0,$00 + .DB $FE,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$88,$88,$88,$FE,$00 + .DB $70,$A8,$A8,$A8,$30,$00 + .DB $08,$08,$FC,$0A,$0A,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $FE,$10,$08,$08,$F0,$00 + .DB $00,$88,$FA,$80,$00,$00 + .DB $00,$00,$08,$FA,$00,$00 + .DB $FE,$20,$50,$88,$00,$00 + .DB $00,$82,$FE,$80,$00,$00 + .DB $F8,$08,$F8,$08,$F0,$00 + .DB $F8,$10,$08,$08,$F0,$00 + .DB $70,$88,$88,$88,$70,$00 + .DB $F8,$88,$88,$88,$70,$00 + .DB $70,$88,$88,$88,$F8,$00 + .DB $F8,$10,$08,$08,$00,$00 + .DB $90,$A8,$A8,$A8,$48,$00 + .DB $08,$08,$7E,$88,$88,$00 + .DB $78,$80,$80,$40,$F8,$00 + .DB $38,$40,$80,$40,$38,$00 + .DB $78,$80,$60,$80,$78,$00 + .DB $88,$50,$20,$50,$88,$00 + .DB $78,$80,$80,$80,$F8,$00 + .DB $88,$C8,$A8,$98,$88,$00 + .DB $10,$6C,$82,$82,$00,$00 + .DB $00,$00,$EE,$00,$00,$00 + .DB $00,$82,$82,$6C,$10,$00 + .DB $04,$02,$04,$08,$04,$00 + .DB $E0,$90,$88,$90,$E0,$00 + .DB $7C,$82,$82,$82,$44,$00 + .DB $7A,$80,$80,$40,$FA,$00 + .DB $70,$A8,$AA,$A9,$30,$00 + .DB $40,$AA,$A9,$AA,$F0,$00 + .DB $42,$A8,$A8,$A8,$F2,$00 + .DB $40,$A9,$AA,$A8,$F0,$00 + .DB $40,$AE,$AA,$AE,$F0,$00 + .DB $70,$88,$88,$88,$88,$00 + .DB $70,$AA,$A9,$AA,$30,$00 + .DB $72,$A8,$A8,$A8,$32,$00 + .DB $70,$A9,$AA,$A8,$30,$00 + .DB $02,$88,$F8,$80,$02,$00 + .DB $00,$8A,$F9,$82,$00,$00 + .DB $00,$89,$FA,$80,$00,$00 + .DB $F9,$24,$24,$24,$F9,$00 + .DB $F8,$27,$25,$27,$F8,$00 + .DB $F8,$A8,$AA,$A9,$88,$00 + .DB $68,$A8,$F8,$A8,$B0,$00 + .DB $FC,$12,$FE,$92,$92,$00 + .DB $70,$8A,$89,$8A,$70,$00 + .DB $72,$88,$88,$88,$72,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$82,$81,$42,$F8,$00 + .DB $78,$81,$82,$40,$F8,$00 + .DB $7A,$80,$80,$80,$FA,$00 + .DB $79,$84,$84,$84,$79,$00 + .DB $7D,$80,$80,$80,$7D,$00 + .DB $70,$88,$88,$FC,$88,$00 + .DB $90,$7C,$92,$92,$C4,$00 + .DB $52,$54,$F8,$54,$52,$00 + .DB $82,$82,$44,$44,$28,$28 + .DB $10,$10,$28,$54,$54,$28 + .DB $40,$A8,$AA,$A9,$F0,$00 + .DB $00,$8A,$F9,$80,$00,$00 + .DB $70,$88,$8A,$89,$70,$00 + .DB $78,$80,$82,$41,$F8,$00 + .DB $FA,$11,$0A,$09,$F0,$00 + .DB $FA,$11,$22,$41,$F8,$00 + .DB $90,$AA,$AA,$AA,$BC,$00 + .DB $9C,$A2,$A2,$A2,$9C,$00 + .DB $60,$90,$8A,$80,$40,$00 + .DB $FE,$02,$02,$02,$02,$02 + .DB $02,$02,$02,$02,$02,$FE + .DB $2F,$10,$48,$24,$C0,$00 + .DB $2F,$90,$48,$E4,$00,$00 + .DB $00,$00,$F2,$00,$00,$00 + .DB $FE,$80,$80,$80,$80,$80 + .DB $80,$80,$80,$80,$80,$FE + .DB $00,$80,$00,$00,$80,$00 + .DB $55,$AA,$55,$AA,$55,$AA + .DB $33,$CC,$33,$CC,$33,$CC + .DB $00,$00,$FF,$00,$00,$00 + .DB $10,$10,$FF,$00,$00,$00 + .DB $28,$28,$FF,$00,$00,$00 + .DB $10,$FF,$00,$FF,$00,$00 + .DB $10,$F0,$10,$F0,$00,$00 + .DB $28,$28,$F8,$00,$00,$00 + .DB $28,$EF,$00,$FF,$00,$00 + .DB $00,$FF,$00,$FF,$00,$00 + .DB $28,$E8,$08,$F8,$00,$00 + .DB $28,$2F,$20,$3F,$00,$00 + .DB $10,$1F,$10,$1F,$00,$00 + .DB $28,$28,$3F,$00,$00,$00 + .DB $10,$10,$F0,$00,$00,$00 + .DB $00,$00,$1F,$10,$10,$10 + .DB $10,$10,$1F,$10,$10,$10 + .DB $10,$10,$F0,$10,$10,$10 + .DB $00,$00,$FF,$10,$10,$10 + .DB $10,$10,$10,$10,$10,$10 + .DB $10,$10,$FF,$10,$10,$10 + .DB $00,$00,$FF,$28,$28,$28 + .DB $00,$FF,$00,$FF,$10,$10 + .DB $00,$3F,$20,$2F,$28,$28 + .DB $00,$F8,$08,$E8,$28,$28 + .DB $28,$2F,$20,$2F,$28,$28 + .DB $28,$E8,$08,$E8,$28,$28 + .DB $00,$FF,$00,$EF,$28,$28 + .DB $28,$28,$28,$28,$28,$28 + .DB $28,$EF,$00,$EF,$28,$28 + .DB $28,$28,$2F,$28,$28,$28 + .DB $10,$1F,$10,$1F,$10,$10 + .DB $28,$28,$E8,$28,$28,$28 + .DB $10,$F0,$10,$F0,$10,$10 + .DB $00,$1F,$10,$1F,$10,$10 + .DB $00,$00,$3F,$28,$28,$28 + .DB $00,$00,$F8,$28,$28,$28 + .DB $00,$F0,$10,$F0,$10,$10 + .DB $10,$FF,$10,$FF,$10,$10 + .DB $28,$28,$FF,$28,$28,$28 + .DB $10,$10,$1F,$00,$00,$00 + .DB $00,$00,$F0,$10,$10,$10 + .DB $FF,$FF,$FF,$FF,$FF,$FF + .DB $E0,$E0,$E0,$E0,$E0,$E0 + .DB $FF,$FF,$FF,$00,$00,$00 + .DB $00,$00,$00,$FF,$FF,$FF + .DB $1F,$1F,$1F,$1F,$1F,$1F + .DB $70,$88,$88,$70,$88,$00 + .DB $FC,$02,$92,$92,$6C,$00 + .DB $FE,$02,$02,$02,$06,$00 + .DB $08,$F8,$08,$F8,$08,$00 + .DB $C6,$AA,$92,$82,$C6,$00 + .DB $70,$88,$88,$78,$08,$00 + .DB $00,$F8,$80,$80,$78,$00 + .DB $10,$08,$F0,$08,$00,$00 + .DB $10,$AA,$EE,$AA,$10,$00 + .DB $7C,$92,$92,$92,$7C,$00 + .DB $9C,$E2,$02,$E2,$9C,$00 + .DB $60,$94,$9A,$92,$60,$00 + .DB $70,$88,$70,$88,$70,$00 + .DB $70,$88,$FC,$88,$70,$00 + .DB $38,$54,$92,$92,$00,$00 + .DB $FC,$02,$02,$02,$FC,$00 + .DB $54,$54,$54,$54,$54,$00 + .DB $88,$88,$BE,$88,$88,$00 + .DB $A2,$A2,$94,$94,$88,$00 + .DB $88,$94,$94,$A2,$A2,$00 + .DB $00,$00,$F8,$04,$08,$00 + .DB $40,$80,$7F,$00,$00,$00 + .DB $10,$10,$54,$10,$10,$00 + .DB $48,$24,$48,$24,$00,$00 + .DB $0C,$12,$12,$0C,$00,$00 + .DB $00,$18,$18,$00,$00,$00 + .DB $00,$00,$10,$00,$00,$00 + .DB $20,$40,$FF,$01,$01,$00 + .DB $1F,$02,$01,$1E,$00,$00 + .DB $00,$12,$19,$16,$00,$00 + .DB $00,$38,$38,$38,$00,$00 + .DB $00,$00,$00,$00,$00,$00 + .DB $00,$02,$02,$02,$01,$00 + .DB $01,$02,$02,$01,$00,$00 + .DB $03,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$03,$00 + .DB $00,$00,$02,$03,$02,$00 + .DB $00,$01,$01,$03,$01,$00 + .DB $00,$00,$01,$00,$00,$00 + .DB $00,$00,$00,$01,$00,$00 + .DB $02,$01,$00,$00,$00,$00 + .DB $00,$02,$01,$00,$00,$00 + .DB $00,$00,$02,$01,$00,$00 + .DB $00,$01,$00,$00,$00,$00 + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4107 ; HARDWARE ADDRESS COMMAND + .DW $4206 ; SOFTWARE ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mac.inc b/src/avr/mac.inc new file mode 100644 index 00000000..f2f9930a --- /dev/null +++ b/src/avr/mac.inc @@ -0,0 +1,195 @@ +; MAC.INC +; MACROS FOR THE AVR PROCESSOR + +.MACRO RJEQ + BRNE LOCAL + RJMP @0 +LOCAL: +.ENDMACRO + +.MACRO RJNE + BREQ LOCAL + RJMP @0 +LOCAL: +.ENDMACRO + +.MACRO OUTI @0,@1 + LDI A,@1 ; OUT IMMEDIATE TO PORT + OUT @0,A +.ENDMACRO + +.MACRO ADDI @0,@1 + SUBI @0,-@1 ; ADD IMMEDIATE +.ENDMACRO + +.MACRO EORI @0,@1 + LDI A,@1 ; EOR IMMEDIATE + EOR @0,A +.ENDMACRO + +.MACRO STI @0,@1 + LDI A,@1 ; STORE IMMEDIATE + ST @0,A +.ENDMACRO + +.MACRO ADDIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + ADD @0,A +.ENDMACRO + +.MACRO SUBIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + SUB @0,A +.ENDMACRO + +.MACRO ANDIL @0,@1 + LDI A,@1 ; AND IMMEDIATE LOWER REGISTER SET + AND @0,A +.ENDMACRO + +.MACRO LDIL @0,@1 + LDI A,@1 ; LOAD IMMEDIATE LOWER REGISTER SET + MOV @0,A +.ENDMACRO + +.MACRO LDIX @0 ; LOAD IMMEDIATE XL, XH WITH FLASH ADDRESS + LDI XL,LOW((@0)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((@0)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION +.ENDMACRO + +.MACRO LDIZ @0 ; LOAD IMMEDIATE ZL, ZH WITH FLASH ADDRESS + LDI ZL,LOW((@0)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((@0)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION +.ENDMACRO + +.MACRO LDE @0,@1 ; LOAD REGISTER FROM EEPROM + RCALL LDE1 + LDI @0,LOW(@1*2) ; POINT TO EEPROM CONSTANT + OUT EEAR,@0 ; SET UP ADDRESS + SBI EECR,EERE ; ASSERT READ STROBE + IN @0,EEDR +.ENDMACRO + +.MACRO LDFL @0,@1 ; LOAD REGISTER FROM FLASH LOW BYTE + LDI ZL,LOW(@1*2) + LDI ZH,HIGH(@1*2) + LPM + MOV @0,R0 +.ENDMACRO + +.MACRO LDFH @0,@1 ; LOAD REGISTER FROM FLASH HIGH BYTE + LDI ZL,LOW(@1*2+1) + LDI ZH,HIGH(@1*2+1) + LPM + MOV @0,R0 +.ENDMACRO + +;.MACRO LDF @0,@1 ; LOAD REGISTER FROM FLASH +; LDI ZL,@1 ; POINT TO FLASH CONSTANT +; LPM +; MOV @0,R0 +;.ENDMACRO + +;------------------------------------------------------------------------------ + +.MACRO FLD @0 ; LOAD FA REGISTER FROM SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL LDS_FA +.ENDMACRO + +.MACRO FLDF @0 ; LOAD FA REGISTER FROM FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL LDF_FA +.ENDMACRO + +.MACRO FLDE @0 ; LOAD FA REGISTER FROM EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL LDE_FA +.ENDMACRO + +.MACRO FLD3 @0 ; LOAD FA REGISTER WITH 3 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS3_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FLD2 @0 ; LOAD FA REGISTER WITH 2 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS2_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FST @0 ; STORE FP REGISTER TO FP ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL STS_FA +.ENDMACRO + +.MACRO FCHS @0 ; CHANGE SIGN OF SRAM ARGUMENT + LDI YL,LOW(@0) + RCALL CHSS +.ENDMACRO + +.MACRO FAD @0 ; ADD SRAM ARGUMENT TO FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL ADD_FA +.ENDMACRO + +.MACRO FADF @0 ; ADD FLASH CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL ADDF_FA +.ENDMACRO + +.MACRO FADE @0 ; ADD EEPROM CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL ADDE_FA +.ENDMACRO + +.MACRO FSB @0 ; SUBTRACT SRAM ARGUMENT FROM FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL SUB_FA +.ENDMACRO + +.MACRO FSBF @0 ; SUBTRACT FLASH CONSTANT FROM FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL SUBF_FA +.ENDMACRO + +.MACRO FML @0 ; MULTIPLY FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL MUL_FA +.ENDMACRO + +.MACRO FMLF @0 ; MULTIPLY FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL MULF_FA +.ENDMACRO + +.MACRO FDV @0 ; DIVIDE FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL DIV_FA +.ENDMACRO + +.MACRO FDVF @0 ; DIVIDE FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL DIVF_FA +.ENDMACRO + +.MACRO FCP @0 ; COMPARE FA REGISTER WITH SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL CP_FA +.ENDMACRO + +.MACRO FCPF @0 ; COMPARE FA REGISTER WITH FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL CPF_FA +.ENDMACRO + +.MACRO FCPE @0 ; COMPARE FA REGISTER WITH EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + RCALL CPE_FA +.ENDMACRO + diff --git a/src/avr/maclc.inc b/src/avr/maclc.inc new file mode 100644 index 00000000..7e378ad8 --- /dev/null +++ b/src/avr/maclc.inc @@ -0,0 +1,242 @@ +; MACLC.INC +; MACROS FOR THE AVR PROCESSOR + +.LISTMAC + +.MACRO OUTI @0,@1 + LDI A,@1 ; sends immediate data out port eg outi porta,$0f + OUT @0,A +.ENDMACRO + +.MACRO PUL_H @0,@1 + SBI @0,@1 ; pulses bit in port high eg pul_h portb,1 + CBI @0,@1 +.ENDMACRO + +.MACRO PUL_L @0,@1 + CBI @0,@1 ; pulses bit in port low eg pul_l portb,1 + SBI @0,@1 +.ENDMACRO + +.MACRO RAMW @0 + CBI PORTD,WE + CBI PORTD,CS + LDI A,@0 ; writes immed data to static ram eg ramw $34 + OUT PORTA,A + SBI PORTD,CS + SBI PORTD,WE ; NOT PORTABLE -USED FOR LCD CONTROL +.ENDMACRO + +.MACRO RAMWR @0 + CBI PORTD,WE + CBI PORTD,CS + MOV A,@0 ; writes REG data to static ram eg ramw R21 + OUT PORTA,A + SBI PORTD,CS + SBI PORTD,WE ; NOT PORTABLE -USED FOR LCD CONTROL +.ENDMACRO + +.MACRO ADDI @0,@1 + SUBI @0,-@1 ; add immediate data to reg +.ENDMACRO + +.MACRO EORI @0,@1 + LDI A,@1 ; EOR IMMEDIATE + EOR @0,A +.ENDMACRO + +.MACRO STI @0,@1 + LDI A,@1 ; STORE IMMEDIATE + ST @0,A +.ENDMACRO + +.MACRO ADDIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + ADD @0,A +.ENDMACRO + +.MACRO SUBIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + SUB @0,A +.ENDMACRO + +.MACRO ANDIL @0,@1 + LDI A,@1 ; AND IMMEDIATE LOWER REGISTER SET + AND @0,A +.ENDMACRO + +.MACRO LDIL @0,@1 + LDI A,@1 ; LOAD IMMEDIATE LOWER REGISTER SET + MOV @0,A +.ENDMACRO + +.MACRO LDIZ @0 ; LOAD IMMEDIATE ZL, ZH WITH FLASH ADDRESS + LDI ZL,LOW(@0*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH(@0*2) +.ENDMACRO + +.MACRO LDE @0,@1 ; LOAD REGISTER FROM EEPROM + RCALL LDE1 + LDI @0,LOW(@1*2) ; POINT TO EEPROM CONSTANT + OUT EEAR,@0 ; SET UP ADDRESS + SBI EECR,EERE ; ASSERT READ STROBE + IN @0,EEDR +.ENDMACRO + +.MACRO LDER @0,@1 ; LOAD REGISTER FROM EEPROM 17MAY01 +; RCALL LDE1 + LDI @0,LOW(@1*2) ; POINT TO EEPROM CONSTANT + OUT EEAR,@0 ; SET UP ADDRESS + SBI EECR,EERE ; ASSERT READ STROBE + IN @0,EEDR +.ENDMACRO + +.MACRO LDFL @0,@1 ; LOAD REGISTER FROM FLASH LOW BYTE + LDI ZL,LOW(@1*2) + LDI ZH,HIGH(@1*2) + LPM + MOV @0,R0 +.ENDMACRO + +.MACRO LDFH @0,@1 ; LOAD REGISTER FROM FLASH HIGH BYTE + LDI ZL,LOW(@1*2+1) + LDI ZH,HIGH(@1*2+1) + LPM + MOV @0,R0 +.ENDMACRO + +;.MACRO LDF @0,@1 ; LOAD REGISTER FROM FLASH +; LDI ZL,@1 ; POINT TO FLASH CONSTANT +; LPM +; MOV @0,R0 +;.ENDMACRO + +;.MACRO FDVI @0,@1 ; DIVIDE FLASH CONSTANT BY 3 BYTE SRAM INTEGER +; LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT +; LDI YL,LOW(@1) ; POINT TO SRAM INTEGER +; RCALL FP_DIVI +;.ENDMACRO + + +;------------------------------------------------------------------------------ + +.MACRO FLD @0 ; LOAD FA REGISTER FROM SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL LDS_FA +.ENDMACRO + +.MACRO FLDF @0 ; LOAD FA REGISTER FROM FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL LDF_FA +.ENDMACRO + +.MACRO FLDE @0 ; LOAD FA REGISTER FROM EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL LDE_FA +.ENDMACRO + +.MACRO FLD3 @0 ; LOAD FA REGISTER WITH 3 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS3_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FLD2 @0 ; LOAD FA REGISTER WITH 2 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS2_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FST @0 ; STORE FP REGISTER TO FP ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL STS_FA +.ENDMACRO + +.MACRO FCHS @0 ; CHANGE SIGN OF SRAM ARGUMENT + LDI YL,LOW(@0) + RCALL CHSS +.ENDMACRO + +.MACRO FAD @0 ; ADD SRAM ARGUMENT TO FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL ADD_FA +.ENDMACRO + +.MACRO FADE @0 ; ADD EEPROM CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL ADDE_FA +.ENDMACRO + +.MACRO FADF @0 ; ADD FLASH CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL ADDF_FA +.ENDMACRO + +.MACRO FSB @0 ; SUBTRACT SRAM ARGUMENT FROM FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL SUB_FA +.ENDMACRO + +.MACRO FSBE @0 ; SUBTRACT EEPROM CONSTANT FROM FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL SUBE_FA +.ENDMACRO + +.MACRO FSBF @0 ; SUBTRACT FLASH CONSTANT FROM FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL SUBF_FA +.ENDMACRO + +.MACRO FML @0 ; MULTIPLY FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL MUL_FA +.ENDMACRO + +.MACRO FMLE @0 ; MULTIPLY FA REGISTER BY EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL MULE_FA +.ENDMACRO + +.MACRO FMLF @0 ; MULTIPLY FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL MULF_FA +.ENDMACRO + +.MACRO FDV @0 ; DIVIDE FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL DIV_FA +.ENDMACRO + +.MACRO FDVE @0 ; DIVIDE FA REGISTER BY EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL DIVE_FA +.ENDMACRO + +.MACRO FDVF @0 ; DIVIDE FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL DIVF_FA +.ENDMACRO + +.MACRO FCP @0 ; COMPARE FA REGISTER WITH SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL CP_FA +.ENDMACRO + +.MACRO FCPE @0 ; COMPARE FA REGISTER WITH EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + RCALL CPE_FA +.ENDMACRO + +.MACRO FCPF @0 ; COMPARE FA REGISTER WITH FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL CPF_FA +.ENDMACRO + +.MACRO FCLR ; CLEAR FA REGISTER 17MAY01 + RCALL MIN_FA +.ENDMACRO + diff --git a/src/avr/makchr.bas b/src/avr/makchr.bas new file mode 100644 index 00000000..143c1fa2 --- /dev/null +++ b/src/avr/makchr.bas @@ -0,0 +1,650 @@ + ' MAKCHR.BAS + ' POWERBASIC VERSION + +' ----------------------------------------------------------------------------- + +$LIB VGA + +$LINK "PUTPCX.OBJ" +DECLARE SUB PUTPCX(STRING) + +$LINK "CHKLIN.OBJ" +DECLARE SUB CHKLIN(INTEGER) + + $INCLUDE "CRCSUBX.INC" + +' ----------------------------------------------------------------------------- + + DIM BLANKT%(300),BLANKB%(300) + DIM DIG%(18,3,4) + DIM BYTES%(16),PREFIX$(255) + + DEF FNH$(N%,L%)=RIGHT$("000"+HEX$(N%),L%) + + FOR D%=0 TO 18 + FOR Y%=0 TO 4 + FOR X%=0 TO 2 + READ Z% + IF Z%=0 THEN DIG%(D%,X%,Y%)=15 + NEXT X% + DIG%(D%,X%,Y%)=15 + NEXT Y% + NEXT D% + INDEX%=0 + + F$=LTRIM$(RTRIM$(COMMAND$)) + I%=INSTR(F$," ") + IF I% THEN + OUTFIL$=LTRIM$(MID$(F$,I%)) + F$=RTRIM$(LEFT$(F$,I%)) + END IF + IF LEN(F$) THEN NO.QUESTION + + CLS + INTERACTIVE%=-1 + INPUT "Filename: [SET00.PCX] ",F$ + +NO.QUESTION: + IF LEN(F$)=0 THEN F$="SET00" + I%=INSTR(F$,".") + IF I% THEN + F0$=LEFT$(F$,I%-1) + F1$=MID$(F$,I%) + ELSE + F0$=F$ + F1$=".PCX" + END IF + + DAT$="" + IDX$=STRING$(512,0) + OVL$="" ' OVERLAYS CHARACTERS 60-FE INCLUSIVE + + IF LEN(F0$)<=5 THEN + COUNTRY$=LEFT$(UCASE$(ENVIRON$("CSC")),3) + F$=F0$+COUNTRY$+F1$ + GOSUB LOAD.PCX + IF PCX.ERROR.FLAG%=0 THEN COUNTRY.SPECIFIC + END IF + F$=F0$+F1$ + GOSUB LOAD.PCX + IF PCX.ERROR.FLAG% THEN + IF CSRLIN=25 THEN PRINT:LOCATE 24,1 + PRINT "FILE NOT FOUND" + END + END IF +COUNTRY.SPECIFIC: + + ' DEFAULTS FOR HEX INFO + XCELL%=5 + YCELL%=7 + ICS%=1 + ILS%=1 + XL0%=&H4F + + ' INTERPRET HEX INFO + Y%=0 +BODGELOOP: + BYT%=0 + X%=0 +BYTLOOP: + FOR II%=0 TO 4 + GOSUB GETHEX + IF DIGITS% THEN BYTES%(BYT%)=HEXNUM%:INCR BYT%:GOTO BYTLOOP + INCR X% + NEXT II% + IF BYT% THEN + LINE (0,Y%)-(X%-1,Y%+4),,BF + IF Y%=0 THEN + IF LEN(OUTFIL$)=0 THEN OUTFIL$="CHSET"+FNH$(BYTES%(0),2)+".WIN" + IF BYT%>1 THEN XCELL%=BYTES%(1) + IF BYT%>2 THEN YCELL%=BYTES%(2) + IF BYT%>3 THEN ICS%=BYTES%(3) + IF BYT%>4 THEN ILS%=BYTES%(4) + IF BYT%>5 THEN XL0%=BYTES%(5) + ELSE + FOR II%=1 TO BYT%-1 + PREFIX$(BYTES%(0))=PREFIX$(BYTES%(0))+CHR$(BYTES%(II%)) + NEXT II% + END IF + INCR Y%,6 + GOTO BODGELOOP + END IF + + IF INTERACTIVE% THEN K$=INPUT$(1) + + ' FIND BLOCKS OF =>3 BLANK LINES IN PICTURE + BSIZ%=0 + BLANKT%(0)=-3 + LAST.FLAG%=0 + FOR Y%=0 TO 479 + FLAG%=Y% + CALL CHKLIN(FLAG%) + IF FLAG%<>LAST.FLAG% THEN + IF LAST.FLAG% THEN + BLANKT%(BSIZ%)=Y% + ELSE + BLANKB%(BSIZ%)=Y% + IF BLANKB%(BSIZ%)-BLANKT%(BSIZ%)=>3 THEN INCR BSIZ% + END IF + END IF + LAST.FLAG%=FLAG% + NEXT Y% + IF LAST.FLAG% THEN BLANKT%(BSIZ%)=480 + BLANKB%(BSIZ%)=483 + INCR BSIZ% + + ' CHECK FOR 1 SET OF CHAR DEFINITIONS BETWEEN EACH PAIR OF BLANKS + FOR BL%=0 TO BSIZ%-3 + YT%=BLANKB%(BL%) + YB%=BLANKT%(BL%+1)-1 + ASCII.FLAG%=0 + FOR XL%=0 TO 639 + IF POINT(XL%,YT%)=0 THEN GOTL + NEXT XL% + ' SHOULD NEVER GET HERE +GOTL: + IF POINT(XL%+1,YT%)=0 THEN SKIP + IF POINT(XL%,YB%) THEN + IF YB%-YT%<8 THEN SKIP ' NO ROOM FOR ASCII + FLAG%=YB%-5 + CALL CHKLIN(FLAG%) + IF FLAG% THEN SKIP ' NO BLANK LINE PRECEDING ASCII + FOR J%=YB%-4 TO YB% + FLAG%=J% + CALL CHKLIN(FLAG%) + IF FLAG%=0 THEN SKIP ' BLANK LINE IN ASCII REGION + NEXT J% + YB%=YB%-6 + ASCII.FLAG%=-1 + XASC%=0 + IF POINT(XL%,YB%) THEN SKIP + END IF + IF POINT(XL%+1,YB%)=0 THEN SKIP + + FLAG%=YT%+1 + CALL CHKLIN(FLAG%) + IF FLAG% THEN SKIP ' NO BLANK LINE BELOW TOP + FLAG%=YB%-1 + CALL CHKLIN(FLAG%) + IF FLAG% THEN SKIP ' NO BLANK LINE ABOVE BOT + + FOR XR%=639 TO 0 STEP -1 + IF POINT(XR%,YT%)=0 THEN GOTR + NEXT XR% + ' SHOULD NEVER GET HERE +GOTR: + IF XR%-XL%<2 THEN SKIP + FOR YY%=YT% TO YB% + IF POINT(XL%,YY%)<>POINT(XR%,YY%) THEN SKIP + NEXT YY% + BREAKS%=0 + FOR YY%=YT%+2 TO YB%-2 + IF POINT(XL%,YY%) THEN INCR BREAKS% + NEXT YY% + IF BREAKS%>2 THEN SKIP + + ASCEND.FLAG%=0 + DESCEND.FLAG%=0 + IF BREAKS% THEN + FOR YY%=YB%-2 TO YT%+2 STEP -1 + IF POINT(XL%,YY%) THEN DESCEND.FLAG%=YB%-YY%-1:GOTO GOTDES + NEXT YY% + END IF +GOTDES: + IF BREAKS%>1 THEN + FOR YY%=YT%+2 TO YB%-2 + IF POINT(XL%,YY%) THEN ASCEND.FLAG%=YY%-YT%-1:GOTO GOTAS + NEXT YY% + END IF +GOTAS: + HEIGHT%=YB%-YT%-3-ASCEND.FLAG%-DESCEND.FLAG% + + Y0%=YT%+2 + Y1%=YB%-2 + FOR XX%=XL%+2 TO XR%-2 + IF POINT(XX%,YT%)=0 OR POINT(XX%,YB%)=0 THEN + X0%=XX% + FOR XX%=XX% TO XR%-3 + IF POINT(XX%+1,YT%) AND POINT(XX%+1,YB%) THEN GOTX1 + NEXT XX% +GOTX1: + X1%=XX% + GOSUB CHAR + END IF + NEXT XX% + +SKIP: + NEXT BL% + + IDX_20$=MID$(IDX$,&H20*2+1,2) + IDX_30$=MID$(IDX$,&H30*2+1,2) + IDX_4F$=MID$(IDX$,&H4F*2+1,2) + IDX_FF$=MID$(IDX$,&HFF*2+1,2) + + FOR CHK%=0 TO 254 + IDX_CHK$=MID$(IDX$,CHK%*2+1,2) + IF IDX_CHK$=MKI$(0) THEN + IF LEN(PREFIX$(CHK%)) THEN + INDEX%=CHK% + P$="" + D$="" + XB%=0 + GOSUB ADDCHR + ELSE + IF CHK%=&H30 THEN IDX_CHK$=IDX_4F$ + IF CHK%=&H4F THEN IDX_CHK$=IDX_30$ + IF IDX_CHK$=MKI$(0) THEN IDX_CHK$=IDX_FF$ + IF IDX_CHK$=MKI$(0) THEN IDX_CHK$=IDX_20$ + MID$(IDX$,CHK%*2+1,2)=IDX_CHK$ + END IF + END IF + NEXT CHK% + + MID$(IDX$, 1+&H100)=OVL$ ' OVERLAYS CHARACTERS 80-FF INCLUSIVE + + ' SEARCH FOR &H208 IF ADD ANYTHING HERE + IDX$=IDX$+CHR$(XCELL%+ICS%)+CHR$(YCELL%+ILS%)+ _ + CHR$(ICS%)+CHR$(ILS%)+ _ + CHR$(XL0%)+CHR$(0)+MKI$(0) ' SPARE BYTE, FILE LENGTH WORD + + IF LEN(OUTFIL$) THEN + L0%=LEN(IDX$)+LEN(DAT$)+16 + L1%=L0% ' TSV4 (L0%+&H7F) AND &HFF80 + PAD$=STRING$(L1%-L0%, &H1A) + MID$(IDX$, 1+&H206)=MKI$(L1%) + + TT$=TIME$ + DD$=DATE$ + TD$=RIGHT$(DD$,2)+MID$(DD$,4,2)+LEFT$(DD$,2) + TD$=TD$+LEFT$(TT$,2)+MID$(TT$,4,2)+RIGHT$(TT$,2) + CRC%=-1 + CRC_CALCULATE CRC%, TD$ + CRC_CALCULATE CRC%, IDX$ + CRC_CALCULATE CRC%, DAT$ + CRC_CALCULATE CRC%, PAD$ + TD$=FNH$(CRC%,4)+TD$ + + ON ERROR GOTO HUJ + KILL OUTFIL$ + ON ERROR GOTO 0 +HUJU: + OPEN OUTFIL$ FOR BINARY AS #1 + PUT$ #1,TD$ + PUT$ #1,IDX$ + PUT$ #1,DAT$ + PUT$ #1,PAD$ + CLOSE #1 + END IF + + OPEN "MAKCHR.LOG" FOR OUTPUT AS #1 + FOR I%=0 TO &H5F '&HFF + P%=CVI(MID$(IDX$,I%*2+1,2)) + IF P% THEN + L$="CHR="+FNH$(I%,2)+" PTR="+FNH$(P%,4)+" " + P%=P%+1 ' TSV4 -LEN(IDX$)+1 + XS%=ASC(MID$(IDX$+DAT$,P%,1)) ' TSV4 DAT$,P%,1)) + IF (XS% AND &H1F) THEN + L$=L$+"XB="+USING$("####",XS% AND &H1F)+" " + YS%=ASC(MID$(IDX$+DAT$,P%+1,1)) ' TSV4 DAT$,P%+1,1)) + L$=L$+"YB="+USING$("####",YS%)+" " + ELSE + L$=L$+SPACE$(16) + END IF + IF (XS% AND &H80) THEN + XO%=ASC(MID$(IDX$+DAT$,P%-3,1)) ' TSV4 DAT$,P%-3,1)) + L$=L$+"XO="+USING$("####",XO%)+" " + ELSE + L$=L$+SPACE$(8) + END IF + IF (XS% AND &H40) THEN + YO%=ASC(MID$(IDX$+DAT$,P%-2,1)) ' TSV4 DAT$,P%-2,1)) + L$=L$+"YO="+USING$("####",YO%)+" " + ELSE + L$=L$+SPACE$(8) + END IF + IF (XS% AND &H20) THEN + PW%=ASC(MID$(IDX$+DAT$,P%-1,1)) ' TSV4 DAT$,P%-1,1)) + L$=L$+"PW="+USING$("####",PW%)+" " + ELSE + L$=L$+SPACE$(8) + END IF + PRINT #1,RTRIM$(L$) + END IF + NEXT I% + + IF INTERACTIVE% THEN K$=INPUT$(1) + SCREEN 0 + END + +HUJ: + RESUME HUJU + +' ----------------------------------------------------------------------------- + +CHAR: + ' CHECK FOR ASCII CODE BENEATH MATRIX + IF ASCII.FLAG% AND X0%=>XASC% THEN + X%=X0% + Y%=YB%+2 + FOR YY%=Y% TO Y%+4 + IF POINT(X%,YY%)=0 THEN + GOSUB GETHEX + IF DIGITS% THEN + INDEX%=HEXNUM% ':PRINT " " HEX$(INDEX%); + XASC%=X% + END IF + GOTO GOTINDEX + END IF + NEXT YY% + END IF +GOTINDEX: + + ' SET VERTICAL ANCHOR + IF BREAKS% THEN + YA%=Y0%+ASCEND.FLAG%+HEIGHT%-YCELL% + ELSE + YA%=Y0% + END IF + + ' INTERPRET TOP GUARD BAR (FIRST PIXEL GIVES HORIZONTAL ANCHOR) + FOR XA%=X0% TO X1% + IF POINT(XA%,YT%)=0 THEN GOTANCHOR + NEXT XA% +GOTANCHOR: + ' INTERPRET BOTTOM GUARD BAR (LAST PIXEL GIVES WIDTH) + FOR X%=X1% TO XA% STEP -1 + IF POINT(X%,YB%)=0 THEN GOTWID + NEXT X% +GOTWID: + WID%=X%+1-XA% + IF WID%>0 THEN WID%=WID%+ICS% + P$="" + D$="" + + ' FIND CHAR EXTENTS + XMIN%=999:XMAX%=-1 + YMIN%=999:YMAX%=-1 + FOR X%=X0% TO X1% + FOR Y%=Y0% TO Y1% + IF POINT(X%,Y%)=0 THEN + IF X%XMAX% THEN XMAX%=X% + IF Y%YMAX% THEN YMAX%=Y% + END IF + NEXT Y% + NEXT X% + XS%=XMAX%+1-XMIN% + YS%=YMAX%+1-YMIN% + IF XS%<=0 OR YS%<=0 THEN XB%=0:GOTO BLANKCHR + + XB%=INT((XS%+7)/8) + + ' ELIMINATE X/Y OFFSETS IF MORE ECONOMICAL + FIXED%=0 + IF WID%<>XCELL%+ICS% THEN FIXED%=1 + ' TRY WITHOUT Y OFFSET, BUT ONLY TO SET FIXED% YMIN2% YS2% + YMIN2%=YMIN%:YS2%=YS% + IF YMIN2%>YA% THEN + YS3%=YMAX%+1-YA% + IF (XB%*YS3%+FIXED%)<=(XB%*YS%+2) THEN YMIN2%=YA%:YS2%=YS3% + END IF + IF YMIN2%<>YA% THEN FIXED%=2 + ' TRY WITHOUT X OFFSET + IF XMIN%>XA% THEN + XS2%=XMAX%+1-XA% + XB2%=INT((XS2%+7)/8) + IF (XB2%*YS2%+FIXED%)<=(XB%*YS%+3) THEN XMIN%=XA%:XS%=XS2%:XB%=XB2% + END IF + IF XMIN%=XA% THEN YMIN%=YMIN2%:YS%=YS2% + + ' ENCODE CHARACTER + D$=CHR$(YS%) + XMAX%=XMIN%+XB%*8-1 + IF XMAX%>X1% THEN XMAX%=X1% + FOR Y%=YMIN% TO YMAX% + C%=0 + O%=&H80 + BG%=7 '9 + FOR X%=XMIN% TO XMAX% + IF POINT(X%,Y%)=0 THEN C%=C% OR O% ELSE PSET (X%,Y%),BG% + O%=INT(O%/2) + IF O%=0 THEN + D$=D$+CHR$(C%) + C%=0 + O%=&H80 + ' BG%=BG% XOR 8 + END IF + NEXT X% + IF O%<>&H80 THEN D$=D$+CHR$(C%) + NEXT Y% + IF XA%<>XMIN% THEN XOFF + IF YA%<>YMIN% THEN YOFF +BLANKCHR: + IF WID%<>XCELL%+ICS% THEN WD + GOTO ADDCHR + +XOFF: + P$=CHR$((XMIN%-XA%) AND &HFF) + XB%=XB% OR &H80 +YOFF: + P$=P$+CHR$((YMIN%-YA%) AND &HFF) + XB%=XB% OR &H40 +WD: + P$=P$+CHR$(WID%) + XB%=XB% OR &H20 + +ADDCHR: + I%=LEN(PREFIX$(INDEX%)) + IF I%>LEN(P$) THEN + P$=PREFIX$(INDEX%) + XB%=XB% OR &H20 + IF I%=>2 THEN XB%=XB% OR &H40 + IF I%=>3 THEN XB%=XB% OR &H80 + ELSEIF I%>0 THEN + P$=LEFT$(P$,LEN(P$)-I%)+PREFIX$(INDEX%) + END IF + PD$=P$+CHR$(XB%)+D$ + I%=INSTR(OVL$,PD$) ' TSV4 + IF I%=0 THEN + IF LEN(OVL$)+LEN(PD$)>&HFE THEN ' OVERLAYS CHARACTERS 80-FE INCLUSIVE + I%=INSTR(DAT$,PD$) + IF I%=0 THEN I%=LEN(DAT$)+1:DAT$=DAT$+PD$ + MID$(IDX$,INDEX%*2+1,2)=MKI$(I%+LEN(P$)+&H208-1) + INCR INDEX% + RETURN + END IF + I%=LEN(OVL$)+1:OVL$=OVL$+PD$ + END IF + MID$(IDX$,INDEX%*2+1,2)=MKI$(I%+LEN(P$)+&H100-1) + INCR INDEX% + RETURN + + ' IF ASCEND.FLAG% THEN LINE (X0%,YT%+2)-(X1%,YT%+1+ASCEND.FLAG%),4,BF + ' LINE (X0%,YT%+2+ASCEND.FLAG%)-(X1%,YB%-2-DESCEND.FLAG%),12,BF + ' IF DESCEND.FLAG% THEN LINE (X0%,YB%-1-DESCEND.FLAG%)-(X1%,YB%-2),4,BF + ' RETURN + +' ----------------------------------------------------------------------------- + +LOAD.PCX: + ON ERROR GOTO PCX.ERROR + OPEN F$ FOR INPUT AS #1 + CLOSE #1 + ON ERROR GOTO 0 + OPEN F$ FOR BINARY AS #1 + GET$ #1,32700,A$ + CLOSE + IF LEN(A$)=0 THEN KILL F$:RETURN + SCREEN 12 + CALL PUTPCX(A$) + A$="" + PCX.ERROR.FLAG%=0 + RETURN + +PCX.ERROR: + PCX.ERROR.FLAG%=-1 + RESUME PCX.ERROR.2 +PCX.ERROR.2: + RETURN + +' ----------------------------------------------------------------------------- + +GETHEX: + DIGITS%=0 + HEXNUM%=0 +HEXLOOP: + FOR D%=0 TO 18 + IF D%=16 THEN WID%=2 ELSE WID%=4 + FOR XH%=0 TO WID%-1 + FOR YH%=0 TO 4 + IF POINT(X%+XH%,Y%+YH%)<>DIG%(D%,XH%,YH%) THEN NOTDIG + NEXT YH% + NEXT XH% + IF D%=16 THEN D%=1 + IF D%=17 THEN D%=6 + IF D%=18 THEN D%=9 + HEXNUM%=HEXNUM%*16+D% + INCR DIGITS% + INCR X%,WID% + IF DIGITS%=>2 THEN RETURN ' BYTES ONLY + GOTO HEXLOOP +NOTDIG: + NEXT D% + RETURN + + ' 0 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,0,1 + DATA 1,0,1 + DATA 1,1,1 + + ' 1 + DATA 0,0,1 + DATA 0,0,1 + DATA 0,0,1 + DATA 0,0,1 + DATA 0,0,1 + + ' 2 + DATA 1,1,1 + DATA 0,0,1 + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + + ' 3 + DATA 1,1,1 + DATA 0,0,1 + DATA 1,1,1 + DATA 0,0,1 + DATA 1,1,1 + + ' 4 + DATA 1,0,1 + DATA 1,0,1 + DATA 1,1,1 + DATA 0,0,1 + DATA 0,0,1 + + ' 5 + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + DATA 0,0,1 + DATA 1,1,1 + + ' 6 + DATA 1,0,0 + DATA 1,0,0 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + + ' 7 + DATA 1,1,1 + DATA 0,0,1 + DATA 0,0,1 + DATA 0,0,1 + DATA 0,0,1 + + ' 8 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + + ' 9 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + DATA 0,0,1 + DATA 0,0,1 + + ' A + DATA 0,1,0 + DATA 1,0,1 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,0,1 + + ' B + DATA 1,1,0 + DATA 1,0,1 + DATA 1,1,0 + DATA 1,0,1 + DATA 1,1,0 + + ' C + DATA 0,1,0 + DATA 1,0,1 + DATA 1,0,0 + DATA 1,0,1 + DATA 0,1,0 + + ' D + DATA 1,1,0 + DATA 1,0,1 + DATA 1,0,1 + DATA 1,0,1 + DATA 1,1,0 + + ' E + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + + ' F + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + DATA 1,0,0 + DATA 1,0,0 + + ' 1 ALTERNATE + DATA 1,0,0 + DATA 1,0,0 + DATA 1,0,0 + DATA 1,0,0 + DATA 1,0,0 + + ' 6 ALTERNATE + DATA 1,1,1 + DATA 1,0,0 + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + + ' 9 ALTERNATE + DATA 1,1,1 + DATA 1,0,1 + DATA 1,1,1 + DATA 0,0,1 + DATA 1,1,1 + +' ----------------------------------------------------------------------------- + diff --git a/src/avr/makchr.exe b/src/avr/makchr.exe new file mode 100644 index 00000000..4386ca75 Binary files /dev/null and b/src/avr/makchr.exe differ diff --git a/src/avr/mega8def.inc b/src/avr/mega8def.inc new file mode 100644 index 00000000..7b096969 --- /dev/null +++ b/src/avr/mega8def.inc @@ -0,0 +1,380 @@ +; MEGA8DEF.INC +; Register/Bit Definitions for the ATmega8 +; 17JUN02 + +; When including this file in the assembly program file, all I/O register +; names and I/O register bit names appearing in the data book can be used. +; In addition, the six registers forming the three data pointers X, Y and +; Z have been assigned names XL - ZH. Highest RAM address for Internal +; SRAM is also defined. +; +; The Register names are represented by their hexadecimal address. +; The Register Bit names are represented by their bit number (0-7). +; +; Please observe the difference in using the bit names with instructions +; such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" +; (skip if bit in register set/cleared). The following example illustrates +; this: +; +; in r16,PORTB ;read PORTB latch +; sbr r16,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + +; ----------------------------------------------------------------------------- + +;TEXT_RESET: +; ; ENTRY POINT FROM RX_WAIT +; LDI A,LOW(RAMEND) +; OUT SPL,A ; INIT STACK POINTER + +TEXT_RECEIVE: + ; NEXT LINE STARTS WITH RECEIVED CHAR + CLR CHAR_SAVE + +; CLR ABORT_COUNT ; NO NEED TO ABORT ESC SEQUENCE +; CBR FLAGS,1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT*2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mt102v0.asm b/src/avr/mt102v0.asm new file mode 100644 index 00000000..a9902eaf --- /dev/null +++ b/src/avr/mt102v0.asm @@ -0,0 +1,1831 @@ +; MT102V0.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =5 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =48 ; 384 / 8 = 48 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =42 ; 384 / 9 = 42 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =6 ; (42+7) / 8 = 6 WIDTH FLAG BYTES + +.EQU TIME_STEP =72 ; 72 * 25 US = APPROX 1.8 MS +.EQU TIME_CLOCK =2 ; 2 * 25 US = APPROX 50 US + +.EQU TIME_STROBE =24 ; 24 * 25 US = APPROX 600 US +.EQU TIME_HOLD_PWM =1 ; DELAY UNIT FOR ABOVE = APPROX 25 US + +.EQU TIME_PAPER_OUT =12 ; 12 * 25 US = APPROX 300 US + +.EQU TIME_DEBOUNCE0 =1000 ; 1000 * 100 US = APPROX 100.0 MS +;.EQU TIME_DEBOUNCE1 =1 ; 10 * 100 US = APPROX 1.0 MS +.EQU TIME_SHORTING =1000 ; 1000 * 100 US = APPROX 100.0 MS +.EQU TIME_CUTTER =20000 ; 20000 * 100 US = APPROX 2.0 S +.EQU TIME_SAMPLE =4 ; DELAY UNIT FOR ABOVE = APPROX 100 US + +;.EQU FEED_INITIAL =2 ; LINES WASTED STARTING MOTOR +.EQU FEED_SPACING =3 ; LINES TO FEED BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF MOTOR_STATE =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF STATUS =R14 +.DEF SR =R15 + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF FLAGS =R23 + +.DEF DOTS_ON_LO =R24 +.DEF DOTS_ON_HI =R25 ; COUNT OF DOTS ON FOR LINE + +.EQU TX_SIZE =1 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_IMAGE +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE +SCALE_TEXT: .BYTE 1 +SCALE_IMAGE: .BYTE 1 +NOTIFY_COUNT: .BYTE 1 + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU IMAGE =2 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =3 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU CUT =4 ; SET BY FG FOR BG TO OPERATE CUTTER +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +.EQU ASCEND =7 ; SET BY FG, ASCENDER ALLOWED NEXT LINE +;.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY BG TO NOTIFY MOTOR RUN STATUS +.EQU CUTTER =2 ; SET BY BG TO NOTIFY CUTTER RUN STATUS +.EQU HEADUP =3 ; SET BY BG TO NOTIFY HEAD UP STATUS +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE PROCESSING ESC . CMD +; UPPER 2 BITS ARE USED TO COUNT 4 * 256 * 25 US = 25.6 MS BETWEEN PAPER TESTS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','T','1','0','2' +; .DB 'A',' ','P','R','I','N','T','E' +; .DB 'R',$0D + +; ----------------------------------------------------------------------------- +; TIMER 0 OVERFLOW INTERRUPT HANDLER + +T0_OVERFLOW: + IN SR,SREG ; SAVE FLAGS + + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + + LDI G,-TIME_STEP + OUT TCNT0,G ; DEFAULT DELAY TO NEXT STEP INTERRUPT + + WDR ; FEED WATCHDOG + RET ; VECTOR TO INTERRUPT SERVICE ROUTINE + +T0_DONE: + POP H + POP G ; RETRIEVE INTERRUPT SERVICE VECTOR + +T0_RET: + OUT SREG,SR ; RESTORE FLAGS + RETI + +; ----------------------------------------------------------------------------- + +T0_FEED: + DEC FEEDS + + RCALL T0_STEP_EVEN ; OUTPUT NEXT MOTOR STATE + + RCALL T0_DONE + + RCALL T0_STEP_ODD ; OUTPUT NEXT MOTOR STATE + +T0_MAIN: + RCALL T0_DONE + +T0_MAIN_ENTRY: + ;MOV D,FEEDS + ;CPI D,1+FEED_INITIAL + ;BRSH T0_PRINT ; WE HAVE SOMETHING TO PRINT + TST FEEDS + BRNE T0_PRINT ; WE HAVE SOMETHING TO PRINT + + MOV D,FLAGS + ANDI D,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT+2) ; 06apr03 tavrasm (EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC ; 06apr03 tavrasm *2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + LDI A,~(1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT ; 06apr03 tavrasm *2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 0 ENABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACB2 ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mt102v1.asm b/src/avr/mt102v1.asm new file mode 100644 index 00000000..2d1247d3 --- /dev/null +++ b/src/avr/mt102v1.asm @@ -0,0 +1,1831 @@ +; MT102V1.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =5 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =48 ; 384 / 8 = 48 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =42 ; 384 / 9 = 42 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =6 ; (42+7) / 8 = 6 WIDTH FLAG BYTES + +.EQU TIME_STEP =72 ; 72 * 25 US = APPROX 1.8 MS +.EQU TIME_CLOCK =2 ; 2 * 25 US = APPROX 50 US + +.EQU TIME_STROBE =24 ; 24 * 25 US = APPROX 600 US +.EQU TIME_HOLD_PWM =1 ; DELAY UNIT FOR ABOVE = APPROX 25 US + +.EQU TIME_PAPER_OUT =12 ; 12 * 25 US = APPROX 300 US + +.EQU TIME_DEBOUNCE0 =1000 ; 1000 * 100 US = APPROX 100.0 MS +;.EQU TIME_DEBOUNCE1 =1 ; 10 * 100 US = APPROX 1.0 MS +.EQU TIME_SHORTING =1000 ; 1000 * 100 US = APPROX 100.0 MS +.EQU TIME_CUTTER =20000 ; 20000 * 100 US = APPROX 2.0 S +.EQU TIME_SAMPLE =4 ; DELAY UNIT FOR ABOVE = APPROX 100 US + +;.EQU FEED_INITIAL =2 ; LINES WASTED STARTING MOTOR +.EQU FEED_SPACING =3 ; LINES TO FEED BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF MOTOR_STATE =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF STATUS =R14 +.DEF SR =R15 + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF FLAGS =R23 + +.DEF DOTS_ON_LO =R24 +.DEF DOTS_ON_HI =R25 ; COUNT OF DOTS ON FOR LINE + +.EQU TX_SIZE =1 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_IMAGE +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE +SCALE_TEXT: .BYTE 1 +SCALE_IMAGE: .BYTE 1 +NOTIFY_COUNT: .BYTE 1 + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU IMAGE =2 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =3 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU CUT =4 ; SET BY FG FOR BG TO OPERATE CUTTER +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +.EQU ASCEND =7 ; SET BY FG, ASCENDER ALLOWED NEXT LINE +;.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY BG TO NOTIFY MOTOR RUN STATUS +.EQU CUTTER =2 ; SET BY BG TO NOTIFY CUTTER RUN STATUS +.EQU HEADUP =3 ; SET BY BG TO NOTIFY HEAD UP STATUS +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE PROCESSING ESC . CMD +; UPPER 2 BITS ARE USED TO COUNT 4 * 256 * 25 US = 25.6 MS BETWEEN PAPER TESTS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','T','1','0','2' +; .DB 'A',' ','P','R','I','N','T','E' +; .DB 'R',$0D + +; ----------------------------------------------------------------------------- +; TIMER 0 OVERFLOW INTERRUPT HANDLER + +T0_OVERFLOW: + IN SR,SREG ; SAVE FLAGS + + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + + LDI G,-TIME_STEP + OUT TCNT0,G ; DEFAULT DELAY TO NEXT STEP INTERRUPT + + WDR ; FEED WATCHDOG + RET ; VECTOR TO INTERRUPT SERVICE ROUTINE + +T0_DONE: + POP H + POP G ; RETRIEVE INTERRUPT SERVICE VECTOR + +T0_RET: + OUT SREG,SR ; RESTORE FLAGS + RETI + +; ----------------------------------------------------------------------------- + +T0_FEED: + DEC FEEDS + + RCALL T0_STEP_EVEN ; OUTPUT NEXT MOTOR STATE + + RCALL T0_DONE + + RCALL T0_STEP_ODD ; OUTPUT NEXT MOTOR STATE + +T0_MAIN: + RCALL T0_DONE + +T0_MAIN_ENTRY: + ;MOV D,FEEDS + ;CPI D,1+FEED_INITIAL + ;BRSH T0_PRINT ; WE HAVE SOMETHING TO PRINT + TST FEEDS + BRNE T0_PRINT ; WE HAVE SOMETHING TO PRINT + + MOV D,FLAGS + ANDI D,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT+2) ; 06apr03 tavrasm (EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC ; 06apr03 tavrasm *2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + LDI A,~(1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT ; 06apr03 tavrasm *2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mt102v1.asm.orig b/src/avr/mt102v1.asm.orig new file mode 100644 index 00000000..aaffef07 --- /dev/null +++ b/src/avr/mt102v1.asm.orig @@ -0,0 +1,1831 @@ +; MT102V1.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =5 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$47 ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$23 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$11 ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =48 ; 384 / 8 = 48 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =42 ; 384 / 9 = 42 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =6 ; (42+7) / 8 = 6 WIDTH FLAG BYTES + +.EQU TIME_STEP =72 ; 72 * 25 US = APPROX 1.8 MS +.EQU TIME_CLOCK =2 ; 2 * 25 US = APPROX 50 US + +.EQU TIME_STROBE =24 ; 24 * 25 US = APPROX 600 US +.EQU TIME_HOLD_PWM =1 ; DELAY UNIT FOR ABOVE = APPROX 25 US + +.EQU TIME_PAPER_OUT =12 ; 12 * 25 US = APPROX 300 US + +.EQU TIME_DEBOUNCE0 =1000 ; 1000 * 100 US = APPROX 100.0 MS +;.EQU TIME_DEBOUNCE1 =1 ; 10 * 100 US = APPROX 1.0 MS +.EQU TIME_SHORTING =1000 ; 1000 * 100 US = APPROX 100.0 MS +.EQU TIME_CUTTER =20000 ; 20000 * 100 US = APPROX 2.0 S +.EQU TIME_SAMPLE =4 ; DELAY UNIT FOR ABOVE = APPROX 100 US + +;.EQU FEED_INITIAL =2 ; LINES WASTED STARTING MOTOR +.EQU FEED_SPACING =3 ; LINES TO FEED BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF MOTOR_STATE =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF STATUS =R14 +.DEF SR =R15 + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF FLAGS =R23 + +.DEF DOTS_ON_LO =R24 +.DEF DOTS_ON_HI =R25 ; COUNT OF DOTS ON FOR LINE + +.EQU TX_SIZE =1 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_IMAGE +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE +SCALE_TEXT: .BYTE 1 +SCALE_IMAGE: .BYTE 1 +NOTIFY_COUNT: .BYTE 1 + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU IMAGE =2 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =3 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU CUT =4 ; SET BY FG FOR BG TO OPERATE CUTTER +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +.EQU ASCEND =7 ; SET BY FG, ASCENDER ALLOWED NEXT LINE +;.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY BG TO NOTIFY MOTOR RUN STATUS +.EQU CUTTER =2 ; SET BY BG TO NOTIFY CUTTER RUN STATUS +.EQU HEADUP =3 ; SET BY BG TO NOTIFY HEAD UP STATUS +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE PROCESSING ESC . CMD +; UPPER 2 BITS ARE USED TO COUNT 4 * 256 * 25 US = 25.6 MS BETWEEN PAPER TESTS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','T','1','0','2' +; .DB 'A',' ','P','R','I','N','T','E' +; .DB 'R',$0D + +; ----------------------------------------------------------------------------- +; TIMER 0 OVERFLOW INTERRUPT HANDLER + +T0_OVERFLOW: + IN SR,SREG ; SAVE FLAGS + + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + + LDI G,-TIME_STEP + OUT TCNT0,G ; DEFAULT DELAY TO NEXT STEP INTERRUPT + + WDR ; FEED WATCHDOG + RET ; VECTOR TO INTERRUPT SERVICE ROUTINE + +T0_DONE: + POP H + POP G ; RETRIEVE INTERRUPT SERVICE VECTOR + +T0_RET: + OUT SREG,SR ; RESTORE FLAGS + RETI + +; ----------------------------------------------------------------------------- + +T0_FEED: + DEC FEEDS + + RCALL T0_STEP_EVEN ; OUTPUT NEXT MOTOR STATE + + RCALL T0_DONE + + RCALL T0_STEP_ODD ; OUTPUT NEXT MOTOR STATE + +T0_MAIN: + RCALL T0_DONE + +T0_MAIN_ENTRY: + ;MOV D,FEEDS + ;CPI D,1+FEED_INITIAL + ;BRSH T0_PRINT ; WE HAVE SOMETHING TO PRINT + TST FEEDS + BRNE T0_PRINT ; WE HAVE SOMETHING TO PRINT + + MOV D,FLAGS + ANDI D,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + LDI A,~(1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT*2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACBA ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mt102v2.asm b/src/avr/mt102v2.asm new file mode 100644 index 00000000..c285aadd --- /dev/null +++ b/src/avr/mt102v2.asm @@ -0,0 +1,1831 @@ +; MT102V2.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =5 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$5F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$2F ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$17 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$0B ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$03 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =48 ; 384 / 8 = 48 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =42 ; 384 / 9 = 42 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =6 ; (42+7) / 8 = 6 WIDTH FLAG BYTES + +.EQU TIME_STEP =72 ; 72 * 25 US = APPROX 1.8 MS +.EQU TIME_CLOCK =2 ; 2 * 25 US = APPROX 50 US + +.EQU TIME_STROBE =24 ; 24 * 25 US = APPROX 600 US +.EQU TIME_HOLD_PWM =1 ; DELAY UNIT FOR ABOVE = APPROX 25 US + +.EQU TIME_PAPER_OUT =12 ; 12 * 25 US = APPROX 300 US + +.EQU TIME_DEBOUNCE0 =1000 ; 1000 * 100 US = APPROX 100.0 MS +;.EQU TIME_DEBOUNCE1 =1 ; 10 * 100 US = APPROX 1.0 MS +.EQU TIME_SHORTING =1000 ; 1000 * 100 US = APPROX 100.0 MS +.EQU TIME_CUTTER =20000 ; 20000 * 100 US = APPROX 2.0 S +.EQU TIME_SAMPLE =4 ; DELAY UNIT FOR ABOVE = APPROX 100 US + +;.EQU FEED_INITIAL =2 ; LINES WASTED STARTING MOTOR +.EQU FEED_SPACING =3 ; LINES TO FEED BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF MOTOR_STATE =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF STATUS =R14 +.DEF SR =R15 + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF FLAGS =R23 + +.DEF DOTS_ON_LO =R24 +.DEF DOTS_ON_HI =R25 ; COUNT OF DOTS ON FOR LINE + +.EQU TX_SIZE =1 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_IMAGE +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE +SCALE_TEXT: .BYTE 1 +SCALE_IMAGE: .BYTE 1 +NOTIFY_COUNT: .BYTE 1 + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU IMAGE =2 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =3 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU CUT =4 ; SET BY FG FOR BG TO OPERATE CUTTER +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +.EQU ASCEND =7 ; SET BY FG, ASCENDER ALLOWED NEXT LINE +;.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY BG TO NOTIFY MOTOR RUN STATUS +.EQU CUTTER =2 ; SET BY BG TO NOTIFY CUTTER RUN STATUS +.EQU HEADUP =3 ; SET BY BG TO NOTIFY HEAD UP STATUS +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE PROCESSING ESC . CMD +; UPPER 2 BITS ARE USED TO COUNT 4 * 256 * 25 US = 25.6 MS BETWEEN PAPER TESTS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','T','1','0','2' +; .DB 'A',' ','P','R','I','N','T','E' +; .DB 'R',$0D + +; ----------------------------------------------------------------------------- +; TIMER 0 OVERFLOW INTERRUPT HANDLER + +T0_OVERFLOW: + IN SR,SREG ; SAVE FLAGS + + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + + LDI G,-TIME_STEP + OUT TCNT0,G ; DEFAULT DELAY TO NEXT STEP INTERRUPT + + WDR ; FEED WATCHDOG + RET ; VECTOR TO INTERRUPT SERVICE ROUTINE + +T0_DONE: + POP H + POP G ; RETRIEVE INTERRUPT SERVICE VECTOR + +T0_RET: + OUT SREG,SR ; RESTORE FLAGS + RETI + +; ----------------------------------------------------------------------------- + +T0_FEED: + DEC FEEDS + + RCALL T0_STEP_EVEN ; OUTPUT NEXT MOTOR STATE + + RCALL T0_DONE + + RCALL T0_STEP_ODD ; OUTPUT NEXT MOTOR STATE + +T0_MAIN: + RCALL T0_DONE + +T0_MAIN_ENTRY: + ;MOV D,FEEDS + ;CPI D,1+FEED_INITIAL + ;BRSH T0_PRINT ; WE HAVE SOMETHING TO PRINT + TST FEEDS + BRNE T0_PRINT ; WE HAVE SOMETHING TO PRINT + + MOV D,FLAGS + ANDI D,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT+2) ; 06apr03 tavrasm (EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC ; 06apr03 tavrasm *2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + LDI A,~(1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT ; 06apr03 tavrasm *2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 0 ENABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACB2 ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/mt102v2.asm.orig b/src/avr/mt102v2.asm.orig new file mode 100644 index 00000000..84db6f95 --- /dev/null +++ b/src/avr/mt102v2.asm.orig @@ -0,0 +1,1831 @@ +; MT102V2.ASM + +; ----------------------------------------------------------------------------- + +.INCLUDE "4433DEF.INC" +.INCLUDE "API.INC" +;.INCLUDE "TER.INC" + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_ADDRESS =5 ; MY ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 US = APPROX 5.0 MS +.EQU API_RATE_SLOW =$5F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ; DIVISOR FOR 115200 BPS +;.EQU TER_RATE =$2F ; DIVISOR FOR 9600 BPS +;.EQU TER_RATE =$17 ; DIVISOR FOR 19200 BPS +;.EQU TER_RATE =$0B ; DIVISOR FOR 38400 BPS +.EQU TER_RATE =$03 ; DIVISOR FOR 115200 BPS + +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.EQU DEFINABLE_CHARS =32 ; REALLY ONLY 22 + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +.EQU WIDTH_IMAGE =48 ; 384 / 8 = 48 IMAGE BYTES ACROSS +.EQU WIDTH_CHARS =42 ; 384 / 9 = 42 TEXT CHARACTERS ACROSS +.EQU WIDTH_FLAGS =6 ; (42+7) / 8 = 6 WIDTH FLAG BYTES + +.EQU TIME_STEP =72 ; 72 * 25 US = APPROX 1.8 MS +.EQU TIME_CLOCK =2 ; 2 * 25 US = APPROX 50 US + +.EQU TIME_STROBE =24 ; 24 * 25 US = APPROX 600 US +.EQU TIME_HOLD_PWM =1 ; DELAY UNIT FOR ABOVE = APPROX 25 US + +.EQU TIME_PAPER_OUT =12 ; 12 * 25 US = APPROX 300 US + +.EQU TIME_DEBOUNCE0 =1000 ; 1000 * 100 US = APPROX 100.0 MS +;.EQU TIME_DEBOUNCE1 =1 ; 10 * 100 US = APPROX 1.0 MS +.EQU TIME_SHORTING =1000 ; 1000 * 100 US = APPROX 100.0 MS +.EQU TIME_CUTTER =20000 ; 20000 * 100 US = APPROX 2.0 S +.EQU TIME_SAMPLE =4 ; DELAY UNIT FOR ABOVE = APPROX 100 US + +;.EQU FEED_INITIAL =2 ; LINES WASTED STARTING MOTOR +.EQU FEED_SPACING =3 ; LINES TO FEED BETWEEN TEXT LINES +.EQU FEED_TAKE_UP =120 ; LINES TO FEED WHEN PAPER INSERTED + +.DEF RX_PTR =R01 +.DEF RX_COUNT =R02 +.DEF TX_PTR =R03 +.DEF TX_COUNT =R04 +.DEF API_STATE =R05 +.DEF API_REMAIN =R06 +.DEF API_WATCHDOG =R07 +.DEF CHAR_SAVE =R08 +.DEF BUF_PTR =R09 ; BYTES NOT YET COMMITTED FOR PRINT +.DEF MOTOR_STATE =R10 ; TIMING PULSE COUNT +.DEF FEEDS =R11 ; INTERNAL FEED COUNT +.DEF SPACING =R12 ; SET WITH ESC A +.DEF TEXT_MASK =R13 ; MASK FOR CURRENT DOT LINE +.DEF STATUS =R14 +.DEF SR =R15 + +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R20 +.DEF G =R21 +.DEF H =R22 +.DEF FLAGS =R23 + +.DEF DOTS_ON_LO =R24 +.DEF DOTS_ON_HI =R25 ; COUNT OF DOTS ON FOR LINE + +.EQU TX_SIZE =1 +.EQU RX_SIZE =$40 + + .DSEG + .ORG $60 + +PRINT_BUF: .BYTE WIDTH_IMAGE +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE +SCALE_TEXT: .BYTE 1 +SCALE_IMAGE: .BYTE 1 +NOTIFY_COUNT: .BYTE 1 + +; ----------------------------------------------------------------------------- + + .ESEG + + .DB 0,0 ; DON'T USE ADDRESS 0 +EE_CRC: .DB 0,0 +EE_LENGTH: .DB 0,0 +EE_COUNT: .DB 0,0 + +; ----------------------------------------------------------------------------- + +; FLAGS DEFINITIONS +.EQU NARROW =0 ; SET IF SAVING NARROW CHARACTERS +.EQU WHITE =1 ; SET IF LINE IS WHITE SPACE SO FAR +.EQU IMAGE =2 ; SET BY FG FOR BG TO PRINT IMAGE LINE +.EQU TEXT =3 ; SET BY FG FOR BG TO PRINT TEXT LINE +.EQU CUT =4 ; SET BY FG FOR BG TO OPERATE CUTTER +.EQU RXFULL =5 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =6 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED +.EQU ASCEND =7 ; SET BY FG, ASCENDER ALLOWED NEXT LINE +;.EQU BOMB =7 ; SET BY BG FOR FG TO BOMB OUT / RESET + +; STATUS DEFINITIONS +.EQU PAPER =0 ; SET BY BG TO DETECT CHANGE IN STATUS +.EQU MOTOR =1 ; SET BY BG TO NOTIFY MOTOR RUN STATUS +.EQU CUTTER =2 ; SET BY BG TO NOTIFY CUTTER RUN STATUS +.EQU HEADUP =3 ; SET BY BG TO NOTIFY HEAD UP STATUS +.EQU NOTIFY =4 ; SET BY BG FOR FG TO REPORT STATUS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE PROCESSING ESC . CMD +; UPPER 2 BITS ARE USED TO COUNT 4 * 256 * 25 US = 25.6 MS BETWEEN PAPER TESTS + +; NARROW + +; FLAG SET BY FOREGROUND WHEN COMPRESSED COMMAND RECEIVED. +; FLAG RESET BY FOREGROUND WHEN DOUBLE-WIDTH COMMAND RECEIVED. + +; WHITE + +; FLAG SET BY FOREGROUND AT START OF PROCESSING FOR TEXT OR IMAGE LINE. +; FLAG RESET BY FOREGROUND IF NON-BLANK BYTE ENCOUNTERED DURING PROCESSING. +; IF FLAG STILL SET WHEN READY TO PRINT, FEEDING INITIATED INSTEAD. + +; IMAGE + +; FLAG SET BY FOREGROUND IF BUFFER CONTAINS IMAGE DATA, RESET IF TEXT DATA +; FLAG SAMPLED AT PRINTABLE AREA TO INSTALL FIRST PRINT INTERRUPT HANDLER +; FLAG MUST BE SET UP BEFORE COMMITTING DATA FOR PRINT. + +; ----------------------------------------------------------------------------- + +.CSEG + + RJMP RESET_ENTRY + + .ORG OVF1ADDR + RJMP T1_OVERFLOW ; TIMER1 OVERFLOW HANDLER + RJMP T0_OVERFLOW ; TIMER0 OVERFLOW HANDLER + + .ORG URXCADDR + INT_HANDLERS ; API BUS + +;IDENTIFY_MESS: +; .DB 17,$1B,'I','M','T','1','0','2' +; .DB 'A',' ','P','R','I','N','T','E' +; .DB 'R',$0D + +; ----------------------------------------------------------------------------- +; TIMER 0 OVERFLOW INTERRUPT HANDLER + +T0_OVERFLOW: + IN SR,SREG ; SAVE FLAGS + + PUSH G + PUSH H ; SAVE INTERRUPT SERVICE VECTOR + + LDI G,-TIME_STEP + OUT TCNT0,G ; DEFAULT DELAY TO NEXT STEP INTERRUPT + + WDR ; FEED WATCHDOG + RET ; VECTOR TO INTERRUPT SERVICE ROUTINE + +T0_DONE: + POP H + POP G ; RETRIEVE INTERRUPT SERVICE VECTOR + +T0_RET: + OUT SREG,SR ; RESTORE FLAGS + RETI + +; ----------------------------------------------------------------------------- + +T0_FEED: + DEC FEEDS + + RCALL T0_STEP_EVEN ; OUTPUT NEXT MOTOR STATE + + RCALL T0_DONE + + RCALL T0_STEP_ODD ; OUTPUT NEXT MOTOR STATE + +T0_MAIN: + RCALL T0_DONE + +T0_MAIN_ENTRY: + ;MOV D,FEEDS + ;CPI D,1+FEED_INITIAL + ;BRSH T0_PRINT ; WE HAVE SOMETHING TO PRINT + TST FEEDS + BRNE T0_PRINT ; WE HAVE SOMETHING TO PRINT + + MOV D,FLAGS + ANDI D,(1< CHARACTER SET SLICE IN FLASH + + MOV H,R0 + LPM ; R0 = CORRECT HORIZONTAL SLICE OF CHAR + MOV D,R0 + MOV R0,H + RJMP LOOKUP_CHAR_DONE ;RET + +LOOKUP_EEPROM: + MOV ZL,D + LSL ZL ; ZL = CHARACTER DEFINITION * 2 + LSL ZL ; ZL = CHARACTER DEFINITION * 4 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 5 + LSL ZL ; ZL = CHARACTER DEFINITION * 10 + ADD ZL,D ; ZL = CHARACTER DEFINITION * 11 + + SUBI ZL,-(EE_COUNT*2+2) ;+3) ; PAST CRC, COUNT, CHARACTER CODE + MOV D,TEXT_MASK + ANDI D,$0F + ADD ZL,D ;TEXT_MASK ; ZL = BASE + CHAR * 11 + SLICE INDEX + +LOOKUP_EEPROM_WAIT: + SBIC EECR,EEWE + RJMP LOOKUP_EEPROM_WAIT ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN D,EEDR ; GET LATCHED DATA BYTE +LOOKUP_CHAR_DONE: + ;RET + + POP ZH + POP ZL + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; F*1 PIXELS PADDING FROM D = 0 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + SBRC F,7 + LDI G,-TIME_CLOCK + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + SBRC F,7 + INC E + CPI E,WIDTH_CHARS ; GONE PAST LAST CHARACTER FOR LINE? + ;BRLO T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE + BRSH T0_PRINT_TEXT_SETUP_DONE + RJMP T0_PRINT_TEXT_SETUP_LINE ; REPEAT UNLESS ALL CHARACTERS DONE +T0_PRINT_TEXT_SETUP_DONE: + + LDI D,0 + LDI F,6 + LDI H,1 + RCALL SETUP_SLICE_ENTRY ; 6 PIXELS PADDING FROM D = 0 + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D + CPI D,$80 + BRSH T0_PRINT_TEXT_MORE_TEST + INC D +T0_PRINT_TEXT_MORE_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRLO T0_PRINT_TEXT_MORE + + CBR FLAGS,1<> 4 ITERATIONS + BRSH T0_PRINT_TEXT_STEP_LOOP ; APPLY VERTICAL SCALE FACTOR + + MOV D,TEXT_MASK + CPI D,$C0 + BRSH T0_MAIN_TEST + INC D + CPI D,$80 + BRSH T0_MAIN_TEST + INC D +T0_MAIN_TEST: + ANDI D,$0F + CPI D,9 ;6 + BRSH GO_T0_MAIN + + INC TEXT_MASK ; UPDATE MASK FOR NEXT LOWER DOT LINE + RJMP T0_PRINT_TEXT_SETUP ; REPEAT UNLESS ALL DOT LINES DONE + +GO_T0_MAIN: + RJMP T0_MAIN + +; ----------------------------------------------------------------------------- + +T0_PRINT_IMAGE: + LDI D,-TIME_CLOCK/2 + OUT TCNT0,D ; SHORT DELAY TO NEXT CLOCKING INT + + LDI XL,LOW(384) + LDI XH,HIGH(384) ; COUNT OF DOTS REMAINING + LDI DOTS_ON_LO,0 + LDI DOTS_ON_HI,0 ; COUNT OF DOTS ON FOR LINE + + LDI E,0 ; BYTE INDEX FOR DOT LINE + +T0_PRINT_IMAGE_SETUP_LINE: + PUSH ZL + + MOV ZL,E + SUBI ZL,-PRINT_BUF + ;CLR ZH + LD D,Z ; ZL = IMAGE BYTE + + POP ZL + + LDS F,SCALE_IMAGE ; IMAGE X/Y SCALE FACTORS + ANDI F,$0F ; EXTRACT HORIZONTAL SCALE FACTOR-1 + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + RCALL SETUP_SLICE ; F*8 PIXELS DATA FROM D + + RCALL T0_DONE ; BREAK TO ALLOW COMMS TRAFFIC + + LDI G,-TIME_CLOCK/2 + OUT TCNT0,G ; SHORT DELAY TO NEXT CLOCKING INT + + INC E + CPI E,WIDTH_IMAGE ; GONE PAST LAST BYTE FOR LINE? + BRLO T0_PRINT_IMAGE_SETUP_LINE ; REPEAT UNLESS ALL BYTES DONE + + CBR FLAGS,1< STORED CRC WORD FROM EEPROM + RCALL EE_READ + CP A,YL + BRNE CHARACTER_SET_INIT + INC ZL + RCALL EE_READ + CP A,YH + BREQ CHARACTER_SET_INIT_DONE + DEC ZL + +CHARACTER_SET_INIT: + LDI A,$AC + RCALL EE_WRITE + INC ZL + LDI A,$FB + RCALL EE_WRITE + INC ZL + LDI A,1 + RCALL EE_WRITE + INC ZL + LDI A,0 + RCALL EE_WRITE + INC ZL + RCALL EE_WRITE + ;RCALL CHARACTER_SET_CRC + ;LDI ZL,EE_CRC*2 + ;MOV A,YL + ;RCALL EE_WRITE + ;INC ZL + ;MOV A,YH + ;RCALL EE_WRITE + +CHARACTER_SET_INIT_DONE: + LDI A,~(1<> 4 ITERATIONS + BRSH REVERSE_FEED_ENTRY ; APPLY VERTICAL SCALE FACTOR + + SBRC FLAGS,ASCEND ; NEED AN EXTRA FEED FOR ASCENDERS ? +REVERSE_FEED_DONE: + RJMP TEXT_RECEIVE ; NO, WE ARE DONE + + SBR FLAGS,1< LENGTH FOLLOWED BY DATA BLOCK + RCALL EE_READ + MOV ZH,A ; ZH = DATA LENGTH + SUBI ZH,-2 ; ZH = DATA LENGTH INCL LENGTH WORD + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + LDI B,$21 + MOV R0,B + LDI B,$10 ; B:R0 = CRC POLYNOMIAL + +CHARACTER_SET_CRC_BYTE: + RCALL EE_READ + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + INC ZL + + LDI A,8 +CHARACTER_SET_CRC_BIT: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,R0 + EOR YH,B +CHARACTER_SET_CRC_BIT0: + DEC A + BRNE CHARACTER_SET_CRC_BIT + + DEC ZH + BRNE CHARACTER_SET_CRC_BYTE + RET + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + OUT EEAR,ZL + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RETI + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + CLI ; IN CASE ACCESSED VIA INTERRUPT + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEAR,ZL + OUT EEDR,A ; LATCH NEW VALUE + + SBRS STATUS,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +; ----------------------------------------------------------------------------- + +PAPER_CUT: + SBR FLAGS,1<> 4 ITERATIONS + BRSH WAIT_ADD_FEEDS_ENTRY ; APPLY VERTICAL SCALE FACTOR + + RET + +; ----------------------------------------------------------------------------- + +TEXT_SAVE: + MOV YL,A + LDI YH,0 + + LDI ZL,EE_COUNT*2 + ;CLR ZH + RCALL EE_READ + MOV ZH,A ; ZH = COUNT OF CHARACTER DEFINITIONS + INC ZL + +TEXT_SAVE_SEARCH: + RCALL EE_READ ; READ CHARACTER CODE FOR DEFINITION + CP A,YL + BREQ TEXT_SAVE_FOUND ; WITH YL = CHARACTER CODE, TRANSLATED + SUBI ZL,-11 + + INC YH + DEC ZH + BRNE TEXT_SAVE_SEARCH + + MOV YH,YL ; YL = CHARACTER CODE, NOT TRANSLATED + +TEXT_SAVE_FOUND: + MOV ZL,BUF_PTR + SUBI ZL,-(PRINT_BUF+WIDTH_FLAGS) + ;CLR ZH + ST Z,YH + + MOV ZL,BUF_PTR + LSR ZL + LSR ZL + LSR ZL + SUBI ZL,-PRINT_BUF + ;CLR ZH ; Z -> ONE OF WIDTH_FLAGS FLAG BYTES + + INC BUF_PTR + + LD A,Z + LSR A ; PREPARE TO STORE WIDE FLAG + RET + +; ----------------------------------------------------------------------------- + +IMAGE_SAVE: + MOV ZL,BUF_PTR + SUBI ZL,-PRINT_BUF + ;CLR ZH + ST Z,A + + INC BUF_PTR + RET + +; ----------------------------------------------------------------------------- + +CHARACTER_SET: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 20 + .DB $00,$18,$18,$18,$18,$18,$00,$18,$00,$00 ; 21 ! + .DB $00,$E7,$63,$C6,$00,$00,$00,$00,$00,$00 ; 22 " + .DB $00,$66,$66,$FF,$66,$FF,$66,$66,$00,$00 ; 23 # + .DB $18,$7E,$DB,$D8,$7E,$1B,$DB,$7E,$18,$00 ; 24 $ + .DB $00,$E3,$E6,$0C,$18,$30,$67,$C7,$00,$00 ; 25 % + .DB $00,$78,$CC,$D8,$73,$DE,$CC,$7B,$00,$00 ; 26 & + .DB $00,$3C,$0C,$18,$00,$00,$00,$00,$00,$00 ; 27 ' + .DB $00,$0C,$18,$30,$30,$30,$18,$0C,$00,$00 ; 28 ( + .DB $00,$30,$18,$0C,$0C,$0C,$18,$30,$00,$00 ; 29 ) + .DB $00,$18,$DB,$7E,$3C,$7E,$DB,$18,$00,$00 ; 2A * + .DB $00,$00,$18,$18,$FF,$18,$18,$00,$00,$00 ; 2B + + .DB $00,$00,$00,$00,$00,$00,$3C,$0C,$18,$00 ; 2C , + .DB $00,$00,$00,$00,$FF,$00,$00,$00,$00,$00 ; 2D - + .DB $00,$00,$00,$00,$00,$00,$3C,$3C,$00,$00 ; 2E . + .DB $00,$03,$06,$0C,$18,$30,$60,$C0,$00,$00 ; 2F / + .DB $00,$7E,$C7,$CF,$DB,$F3,$E3,$7E,$00,$00 ; 30 0 + .DB $00,$0C,$1C,$3C,$0C,$0C,$0C,$0C,$00,$00 ; 31 1 + .DB $00,$7E,$C3,$03,$0E,$38,$60,$FF,$00,$00 ; 32 2 + .DB $00,$7E,$C3,$03,$3E,$03,$C3,$7E,$00,$00 ; 33 3 + .DB $00,$1C,$3C,$6C,$CC,$FF,$0C,$0C,$00,$00 ; 34 4 + .DB $00,$FF,$C0,$FE,$03,$03,$C3,$7E,$00,$00 ; 35 5 + .DB $00,$3E,$60,$C0,$FE,$C3,$C3,$7E,$00,$00 ; 36 6 + .DB $00,$FF,$03,$06,$0C,$18,$18,$18,$00,$00 ; 37 7 + .DB $00,$7E,$C3,$C3,$7E,$C3,$C3,$7E,$00,$00 ; 38 8 + .DB $00,$7E,$C3,$C3,$7F,$03,$06,$7C,$00,$00 ; 39 9 + .DB $00,$00,$3C,$3C,$00,$3C,$3C,$00,$00,$00 ; 3A : + .DB $00,$00,$3C,$3C,$00,$3C,$0C,$18,$00,$00 ; 3B ; + .DB $00,$0C,$18,$30,$60,$30,$18,$0C,$00,$00 ; 3C < + .DB $00,$00,$00,$FF,$00,$FF,$00,$00,$00,$00 ; 3D = + .DB $00,$30,$18,$0C,$06,$0C,$18,$30,$00,$00 ; 3E > + .DB $00,$7E,$C3,$03,$0E,$18,$00,$18,$00,$00 ; 3F ? + .DB $00,$7E,$C3,$DB,$DB,$DF,$C0,$7C,$00,$00 ; 40 @ + .DB $00,$3C,$66,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 41 A + .DB $00,$FE,$C3,$C3,$FE,$C3,$C3,$FE,$00,$00 ; 42 B + .DB $00,$7E,$C3,$C0,$C0,$C0,$C3,$7E,$00,$00 ; 43 C + .DB $00,$FC,$C6,$C3,$C3,$C3,$C6,$FC,$00,$00 ; 44 D + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$FF,$00,$00 ; 45 E + .DB $00,$FF,$C0,$C0,$FE,$C0,$C0,$C0,$00,$00 ; 46 F + .DB $00,$7E,$C3,$C0,$C0,$CF,$C3,$7F,$00,$00 ; 47 G + .DB $00,$C3,$C3,$C3,$FF,$C3,$C3,$C3,$00,$00 ; 48 H + .DB $00,$18,$18,$18,$18,$18,$18,$18,$00,$00 ; 49 I + .DB $00,$03,$03,$03,$03,$03,$C3,$7E,$00,$00 ; 4A J + .DB $00,$C3,$C6,$CC,$F8,$CC,$C6,$C3,$00,$00 ; 4B K + .DB $00,$C0,$C0,$C0,$C0,$C0,$C0,$FF,$00,$00 ; 4C L + .DB $00,$C3,$E7,$FF,$DB,$C3,$C3,$C3,$00,$00 ; 4D M + .DB $00,$C3,$E3,$F3,$DB,$CF,$C7,$C3,$00,$00 ; 4E N + .DB $00,$7E,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 4F O + .DB $00,$FE,$C3,$C3,$FE,$C0,$C0,$C0,$00,$00 ; 50 P + .DB $00,$7E,$C3,$C3,$C3,$C3,$CF,$7E,$03,$00 ; 51 Q + .DB $00,$FE,$C3,$C3,$FE,$CC,$C6,$C3,$00,$00 ; 52 R + .DB $00,$7E,$C3,$C0,$7E,$03,$C3,$7E,$00,$00 ; 53 S + .DB $00,$FF,$18,$18,$18,$18,$18,$18,$00,$00 ; 54 T + .DB $00,$C3,$C3,$C3,$C3,$C3,$C3,$7E,$00,$00 ; 55 U + .DB $00,$C3,$C3,$C3,$C3,$66,$3C,$18,$00,$00 ; 56 V + .DB $00,$C3,$C3,$C3,$C3,$DB,$FF,$66,$00,$00 ; 57 W + .DB $00,$C3,$66,$3C,$18,$3C,$66,$C3,$00,$00 ; 58 X + .DB $00,$C3,$C3,$66,$3C,$18,$18,$18,$00,$00 ; 59 Y + .DB $00,$FF,$06,$0C,$18,$30,$60,$FF,$00,$00 ; 5A Z + .DB $00,$3C,$30,$30,$30,$30,$30,$3C,$00,$00 ; 5B [ + .DB $00,$C0,$60,$30,$18,$0C,$06,$03,$00,$00 ; 5C \ + .DB $00,$3C,$0C,$0C,$0C,$0C,$0C,$3C,$00,$00 ; 5D ] + .DB $18,$3C,$66,$C3,$00,$00,$00,$00,$00,$00 ; 5E ^ + .DB $00,$00,$00,$00,$00,$00,$00,$FF,$00,$00 ; 5F _ + .DB $0C,$18,$1E,$00,$00,$00,$00,$00,$00,$00 ; 60 ` + .DB $00,$00,$00,$7E,$03,$7F,$C3,$7F,$00,$00 ; 61 a + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$FE,$00,$00 ; 62 b + .DB $00,$00,$00,$7E,$C3,$C0,$C3,$7E,$00,$00 ; 63 c + .DB $00,$03,$03,$7F,$C3,$C3,$C3,$7F,$00,$00 ; 64 d + .DB $00,$00,$00,$7E,$C3,$FF,$C0,$7E,$00,$00 ; 65 e + .DB $00,$1E,$33,$30,$FC,$30,$30,$30,$00,$00 ; 66 f + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$7E ; 67 g + .DB $00,$C0,$C0,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 68 h + .DB $00,$18,$00,$18,$18,$18,$18,$18,$00,$00 ; 69 i + .DB $00,$06,$00,$06,$06,$06,$06,$06,$06,$7C ; 6A j + .DB $00,$C0,$C0,$C6,$CC,$F8,$CC,$C6,$00,$00 ; 6B k + .DB $00,$30,$30,$30,$30,$30,$30,$1C,$00,$00 ; 6C l + .DB $00,$00,$00,$FE,$DB,$DB,$DB,$DB,$00,$00 ; 6D m + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$C3,$00,$00 ; 6E n + .DB $00,$00,$00,$7E,$C3,$C3,$C3,$7E,$00,$00 ; 6F o + .DB $00,$00,$00,$FE,$C3,$C3,$C3,$FE,$C0,$C0 ; 70 p + .DB $00,$00,$00,$7F,$C3,$C3,$C3,$7F,$03,$03 ; 71 q + .DB $00,$00,$00,$FE,$C3,$C0,$C0,$C0,$00,$00 ; 72 r + .DB $00,$00,$00,$7E,$C0,$7E,$03,$7E,$00,$00 ; 73 s + .DB $00,$18,$18,$7E,$18,$18,$18,$0E,$00,$00 ; 74 t + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$00,$00 ; 75 u + .DB $00,$00,$00,$C3,$C3,$66,$3C,$18,$00,$00 ; 76 v + .DB $00,$00,$00,$C3,$C3,$DB,$FF,$66,$00,$00 ; 77 w + .DB $00,$00,$00,$C3,$66,$3C,$66,$C3,$00,$00 ; 78 x + .DB $00,$00,$00,$C3,$C3,$C3,$C3,$7F,$03,$7E ; 79 y + .DB $00,$00,$00,$FF,$0C,$18,$30,$FF,$00,$00 ; 7A z + .DB $00,$0E,$18,$18,$70,$18,$18,$0E,$00,$00 ; 7B { + .DB $00,$18,$18,$18,$00,$18,$18,$18,$00,$00 ; 7C | + .DB $00,$70,$18,$18,$0E,$18,$18,$70,$00,$00 ; 7D } + .DB $00,$76,$DC,$00,$00,$00,$00,$00,$00,$00 ; 7E ~ + .DB $00,$00,$00,$18,$3C,$66,$C3,$FF,$00,$00 ; 7F  + +; ----------------------------------------------------------------------------- + + ; BODEN = 0 ENABLED + ; BODLEVEL = 1 FOR 2.7V + ; PAPER CUTTER DOESN'T WORK WITH BODLEVEL = 0 FOR 4.0V + + ; CKSEL = 010 FOR 64 MS R/C + 16K * 11 MHZ STARTUP DELAY + + .ORG $1000 + + .DW $4105 ; SELECT ADDRESS COMMAND + .DW $ACB2 ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/prm.inc b/src/avr/prm.inc new file mode 100644 index 00000000..f4efc1b3 --- /dev/null +++ b/src/avr/prm.inc @@ -0,0 +1,104 @@ +SN: .DB 6,0,$1B,'#' + .DW 3 ; THE EVENT COUNTER, IT WILL BE < 1000 + .DW 5594 ; THE SERIAL NUMBER, IT WILL BE => 1000 + +SEGS1: ; NUMBER OF PARABOLIC SEGMENTS-1 +DEGS: .DB $03,$06 ; POLYNOMIAL DEGREE FOR THERMAL CORRECTION + +SEG1: .DB $2F,$BE,$B1,$B6 ;-5.2971513E-06 POLY SEGS FOR CONV TO GMS +D21: .DB $F5,$02,$FB,$D1 ;-1.3476080E+11 +D11: .DB $BE,$0C,$A1,$CD ;-3.3774586E+08 +D01: .DB $16,$D8,$8B,$BF ;-1.0925319E+00 +SEG2: .DB $D3,$4F,$8B,$B8 ;-6.6429049E-05 +D22: .DB $C7,$16,$E6,$D1 ;-1.2352808E+11 +D12: .DB $6B,$EF,$A0,$CD ;-3.3750563E+08 +D02: .DB $E6,$8C,$0A,$BE ;-1.3530311E-01 +SEG3: .DB $7F,$45,$BB,$B8 ;-8.9297995E-05 +D23: .DB $1F,$46,$EE,$D1 ;-1.2792233E+11 +D13: .DB $80,$85,$A1,$CD ;-3.3873510E+08 +D03: .DB $8B,$A9,$79,$C2 ;-6.2415569E+01 +D24: .DB $22,$DA,$52,$D3 ;-9.0560279E+11 +D14: .DB $08,$2D,$E6,$CD ;-4.8271386E+08 +D04: .DB $D7,$F0,$D1,$C5 ;-6.7181050E+03 + + .ESEG + +CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 RECALIBRATION COEFFICENTS +CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +A11: .DB $FF,$A8,$22,$C3 ;-1.6266014E+02 THERMAL COMP AT 0 GMS +A10: .DB $45,$5F,$32,$43 ; 1.7837215E+02 +A9: .DB $34,$A9,$0E,$42 ; 3.5665237E+01 +A8: .DB $51,$4F,$93,$C2 ;-7.3654915E+01 +A7: .DB $62,$52,$E3,$C1 ;-2.8415226E+01 +A6: .DB $C1,$3D,$A2,$41 ; 2.0280153E+01 +A5: .DB $00,$00,$94,$29 ; 6.5725203E-14 + +K500: .DB $00,$00,$FA,$43 ; 5.0000000E+02 +A18: .DB $9F,$B9,$4C,$42 ; 5.1181271E+01 THERMAL COMP AT 500 GMS +A17: .DB $5C,$B2,$02,$C2 ;-3.2674179E+01 +A16: .DB $02,$A1,$97,$C1 ;-1.8953617E+01 +A15: .DB $BD,$21,$42,$41 ; 1.2133237E+01 +A14: .DB $E4,$90,$A5,$3F ; 1.2934842E+00 +A13: .DB $54,$F9,$87,$3D ; 6.6393524E-02 +A12: .DB $00,$00,$40,$A6 ;-6.6613381E-16 + +K1K5: .DB $00,$80,$BB,$44 ; 1.5000000E+03 +K2K: .DB $00,$00,$FA,$44 ; 2.0000000E+03 +A25: .DB $8F,$4B,$D5,$41 ; 2.6661894E+01 THERMAL COMP AT 2000 GMS +A24: .DB $C0,$A3,$3D,$42 ; 4.7409912E+01 +A23: .DB $26,$A4,$1F,$C2 ;-3.9910301E+01 +A22: .DB $BA,$57,$BE,$C0 ;-5.9482088E+00 +A21: .DB $6C,$2E,$A9,$40 ; 5.2869167E+00 +A20: .DB $C5,$29,$14,$40 ; 2.3150494E+00 +A19: .DB $00,$00,$00,$25 ; 1.1102230E-16 + +K8K: .DB $00,$00,$FA,$45 ; 8.0000000E+03 +K10K: .DB $00,$40,$1C,$46 ; 1.0000000E+04 +A32: .DB $A5,$41,$8B,$43 ; 2.7851285E+02 THERMAL COMP AT 10000 GMS +A31: .DB $5F,$55,$E3,$C2 ;-1.1366674E+02 +A30: .DB $3F,$41,$25,$C3 ;-1.6525487E+02 +A29: .DB $9E,$B2,$6B,$42 ; 5.8924431E+01 +A28: .DB $72,$A6,$E6,$41 ; 2.8831272E+01 +A27: .DB $AC,$22,$0C,$41 ; 8.7584648E+00 +A26: .DB $00,$00,$40,$A9 ;-4.2632564E-14 + +K15K: .DB $00,$60,$6A,$46 ; 1.5000000E+04 +_WREF: .DB $E7,$60,$84,$BA ;-1.0099680E-03 +A39: .DB $AD,$CA,$1B,$C3 ;-1.5579170E+02 THERMAL COMP AT 15000 GMS +A38: .DB $B6,$D9,$C8,$41 ; 2.5106304E+01 +A37: .DB $6B,$3F,$5F,$42 ; 5.5811932E+01 +A36: .DB $CE,$F9,$45,$41 ; 1.2373487E+01 +A35: .DB $D1,$75,$2E,$40 ; 2.7259409E+00 +A34: .DB $3F,$0E,$06,$42 ; 3.3513912E+01 +A33: .DB $00,$00,$30,$A8 ;-9.7699626E-15 + +C3: .DB $F6,$CC,$B3,$58 ; 1.5815431E+15 POLY CONV TO NORM TEMP +C2: .DB $C0,$DE,$18,$D1 ;-4.1035760E+10 +C1: .DB $BD,$2F,$D5,$48 ; 4.3660591E+05 +C0: .DB $51,$2F,$9E,$BF ;-1.2358190E+00 + + .CSEG + +TLTA21: .DB $D8,$E1,$CB,$49 ; 1.6702030E+06 TILT FB POSITION +TLTA11: .DB $56,$84,$21,$C5 ;-2.5842710E+03 +TLTA01: .DB $12,$F5,$49,$3F ; 7.8889573E-01 +TLTA31: .DB $2F,$FD,$86,$42 ; 6.7494499E+01 + +TLTA20: .DB $36,$91,$56,$49 ; 8.7886738E+05 TILT LR POSITION +TLTA10: .DB $2D,$62,$79,$43 ; 2.4938350E+02 +TLTA00: .DB $BF,$60,$87,$BE ;-2.6440999E-01 +TLTA30: .DB $8B,$5A,$C8,$41 ; 2.5044210E+01 + +TLTC21: .DB $9F,$05,$FC,$3E ; 4.9223039E-01 TILT SPAN +TLTC11: .DB $61,$B7,$E9,$3A ; 1.7831140E-03 +TLTC20: .DB $F0,$0C,$02,$3F ; 5.0800991E-01 +TLTC10: .DB $82,$F3,$C8,$3B ; 6.1325440E-03 + +TLTB21: .DB $1B,$23,$90,$44 ; 1.1530970E+03 TILT ZERO +TLTB11: .DB $82,$A9,$5B,$C0 ;-3.4322209E+00 +TLTB20: .DB $B0,$AA,$96,$44 ; 1.2053340E+03 +TLTB10: .DB $0A,$92,$DE,$C0 ;-6.9553270E+00 + diff --git a/src/avr/prm0.inc b/src/avr/prm0.inc new file mode 100644 index 00000000..7dcae6ca --- /dev/null +++ b/src/avr/prm0.inc @@ -0,0 +1,103 @@ +SN: .DB 4,0,$1B,'#' + .DW 5594 ; THE SERIAL NUMBER, IT WILL BE => 1000 + +SEGS1: ; NUMBER OF PARABOLIC SEGMENTS-1 +DEGS: .DB $03,$06 ; POLYNOMIAL DEGREE FOR THERMAL CORRECTION + +SEG1: .DB $2F,$BE,$B1,$B6 ;-5.2971513E-06 POLY SEGS FOR CONV TO GMS +D21: .DB $F5,$02,$FB,$D1 ;-1.3476080E+11 +D11: .DB $BE,$0C,$A1,$CD ;-3.3774586E+08 +D01: .DB $16,$D8,$8B,$BF ;-1.0925319E+00 +SEG2: .DB $D3,$4F,$8B,$B8 ;-6.6429049E-05 +D22: .DB $C7,$16,$E6,$D1 ;-1.2352808E+11 +D12: .DB $6B,$EF,$A0,$CD ;-3.3750563E+08 +D02: .DB $E6,$8C,$0A,$BE ;-1.3530311E-01 +SEG3: .DB $7F,$45,$BB,$B8 ;-8.9297995E-05 +D23: .DB $1F,$46,$EE,$D1 ;-1.2792233E+11 +D13: .DB $80,$85,$A1,$CD ;-3.3873510E+08 +D03: .DB $8B,$A9,$79,$C2 ;-6.2415569E+01 +D24: .DB $22,$DA,$52,$D3 ;-9.0560279E+11 +D14: .DB $08,$2D,$E6,$CD ;-4.8271386E+08 +D04: .DB $D7,$F0,$D1,$C5 ;-6.7181050E+03 + + .ESEG + +CAL3: .DB $00,$00,$00,$00 ; 0.0000000E+00 RECALIBRATION COEFFICENTS +CAL2: .DB $00,$00,$00,$00 ; 0.0000000E+00 +CAL1: .DB $00,$00,$80,$3F ; 1.0000000E+00 +CAL0: .DB $00,$00,$00,$00 ; 0.0000000E+00 + +A11: .DB $FF,$A8,$22,$C3 ;-1.6266014E+02 THERMAL COMP AT 0 GMS +A10: .DB $45,$5F,$32,$43 ; 1.7837215E+02 +A9: .DB $34,$A9,$0E,$42 ; 3.5665237E+01 +A8: .DB $51,$4F,$93,$C2 ;-7.3654915E+01 +A7: .DB $62,$52,$E3,$C1 ;-2.8415226E+01 +A6: .DB $C1,$3D,$A2,$41 ; 2.0280153E+01 +A5: .DB $00,$00,$94,$29 ; 6.5725203E-14 + +K500: .DB $00,$00,$FA,$43 ; 5.0000000E+02 +A18: .DB $9F,$B9,$4C,$42 ; 5.1181271E+01 THERMAL COMP AT 500 GMS +A17: .DB $5C,$B2,$02,$C2 ;-3.2674179E+01 +A16: .DB $02,$A1,$97,$C1 ;-1.8953617E+01 +A15: .DB $BD,$21,$42,$41 ; 1.2133237E+01 +A14: .DB $E4,$90,$A5,$3F ; 1.2934842E+00 +A13: .DB $54,$F9,$87,$3D ; 6.6393524E-02 +A12: .DB $00,$00,$40,$A6 ;-6.6613381E-16 + +K1K5: .DB $00,$80,$BB,$44 ; 1.5000000E+03 +K2K: .DB $00,$00,$FA,$44 ; 2.0000000E+03 +A25: .DB $8F,$4B,$D5,$41 ; 2.6661894E+01 THERMAL COMP AT 2000 GMS +A24: .DB $C0,$A3,$3D,$42 ; 4.7409912E+01 +A23: .DB $26,$A4,$1F,$C2 ;-3.9910301E+01 +A22: .DB $BA,$57,$BE,$C0 ;-5.9482088E+00 +A21: .DB $6C,$2E,$A9,$40 ; 5.2869167E+00 +A20: .DB $C5,$29,$14,$40 ; 2.3150494E+00 +A19: .DB $00,$00,$00,$25 ; 1.1102230E-16 + +K8K: .DB $00,$00,$FA,$45 ; 8.0000000E+03 +K10K: .DB $00,$40,$1C,$46 ; 1.0000000E+04 +A32: .DB $A5,$41,$8B,$43 ; 2.7851285E+02 THERMAL COMP AT 10000 GMS +A31: .DB $5F,$55,$E3,$C2 ;-1.1366674E+02 +A30: .DB $3F,$41,$25,$C3 ;-1.6525487E+02 +A29: .DB $9E,$B2,$6B,$42 ; 5.8924431E+01 +A28: .DB $72,$A6,$E6,$41 ; 2.8831272E+01 +A27: .DB $AC,$22,$0C,$41 ; 8.7584648E+00 +A26: .DB $00,$00,$40,$A9 ;-4.2632564E-14 + +K15K: .DB $00,$60,$6A,$46 ; 1.5000000E+04 +_WREF: .DB $E7,$60,$84,$BA ;-1.0099680E-03 +A39: .DB $AD,$CA,$1B,$C3 ;-1.5579170E+02 THERMAL COMP AT 15000 GMS +A38: .DB $B6,$D9,$C8,$41 ; 2.5106304E+01 +A37: .DB $6B,$3F,$5F,$42 ; 5.5811932E+01 +A36: .DB $CE,$F9,$45,$41 ; 1.2373487E+01 +A35: .DB $D1,$75,$2E,$40 ; 2.7259409E+00 +A34: .DB $3F,$0E,$06,$42 ; 3.3513912E+01 +A33: .DB $00,$00,$30,$A8 ;-9.7699626E-15 + +C3: .DB $F6,$CC,$B3,$58 ; 1.5815431E+15 POLY CONV TO NORM TEMP +C2: .DB $C0,$DE,$18,$D1 ;-4.1035760E+10 +C1: .DB $BD,$2F,$D5,$48 ; 4.3660591E+05 +C0: .DB $51,$2F,$9E,$BF ;-1.2358190E+00 + + .CSEG + +TLTA21: .DB $D8,$E1,$CB,$49 ; 1.6702030E+06 TILT FB POSITION +TLTA11: .DB $56,$84,$21,$C5 ;-2.5842710E+03 +TLTA01: .DB $12,$F5,$49,$3F ; 7.8889573E-01 +TLTA31: .DB $2F,$FD,$86,$42 ; 6.7494499E+01 + +TLTA20: .DB $36,$91,$56,$49 ; 8.7886738E+05 TILT LR POSITION +TLTA10: .DB $2D,$62,$79,$43 ; 2.4938350E+02 +TLTA00: .DB $BF,$60,$87,$BE ;-2.6440999E-01 +TLTA30: .DB $8B,$5A,$C8,$41 ; 2.5044210E+01 + +TLTC21: .DB $9F,$05,$FC,$3E ; 4.9223039E-01 TILT SPAN +TLTC11: .DB $61,$B7,$E9,$3A ; 1.7831140E-03 +TLTC20: .DB $F0,$0C,$02,$3F ; 5.0800991E-01 +TLTC10: .DB $82,$F3,$C8,$3B ; 6.1325440E-03 + +TLTB21: .DB $1B,$23,$90,$44 ; 1.1530970E+03 TILT ZERO +TLTB11: .DB $82,$A9,$5B,$C0 ;-3.4322209E+00 +TLTB20: .DB $B0,$AA,$96,$44 ; 1.2053340E+03 +TLTB10: .DB $0A,$92,$DE,$C0 ;-6.9553270E+00 + diff --git a/src/avr/product/CFLASHV0.HEX b/src/avr/product/CFLASHV0.HEX new file mode 100644 index 00000000..30751b36 --- /dev/null +++ b/src/avr/product/CFLASHV0.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F445E0EB +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE849B94FEB54227724559841 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE809B900E90AB933244424AA +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742B2ACEC +:00000001FF diff --git a/src/avr/product/CFLASHV1.HEX b/src/avr/product/CFLASHV1.HEX new file mode 100644 index 00000000..be960cc1 --- /dev/null +++ b/src/avr/product/CFLASHV1.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F445E0EB +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE849B94FEB54227724559841 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE809B900E90AB933244424AA +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742BAACE4 +:00000001FF diff --git a/src/avr/product/CFLASHV2.HEX b/src/avr/product/CFLASHV2.HEX new file mode 100644 index 00000000..a62f4788 --- /dev/null +++ b/src/avr/product/CFLASHV2.HEX @@ -0,0 +1,76 @@ +:020000020000FC +:02000000C7C077 +:02000C0004C02E +:1000100071C05BC0ACC0FFB67460FFBE1895A895F8 +:1000200072FF23C07B7FEE2019F0EA94F1F4DEC06A +:10003000DA9409F4726017E0A5D107FF04C070FDDF +:1000400072607E7F07C070FD05C082D18AD111F435 +:1000500093D1736071FF09C0042D003430F4DD24A6 +:100060007D7F072F017000631BD02220C1F2EE209C +:1000700011F005E1E02ECF93DF93C12DC056DD27AF +:100080000881F8942A941394CFE11C227894DF918C +:10009000CF9108950F93A895042D0034E0F70F91A8 +:1000A000EE2021F00F9305E1E02E0F91CF93DF9327 +:1000B000DFB7F894C42DC30DDFBFCF73C05ADD275F +:1000C00008834394DF91CF910895FFB64F934EEC90 +:1000D000742EEF93FF93E32DE05AFF274081FF91A9 +:1000E000EF914CB94A9433944FE334226A940AF066 +:1000F00046C04BC0FFB64F934EEC742E4CB15C998A +:1001000038C057FC26C056FC08C0473029F443E0ED +:1001100049B9539A40E4542A38C0642E40E2421947 +:100120000AF44FE7662012F4442D40684CB9461596 +:1001300008F4642E462D4F7739F040EC542A6A9427 +:1001400022F55798559A21C04FEB5422569A5E9A41 +:100150001CC0EF93FF93E22DE10DEF71E056FF27F6 +:100160004083FF91EF9123946A947AF40CC0FFB618 +:100170004F9353984FE549B94FEB54227724559844 +:100180005698579A4CB14FE754224F91FFBE18959D +:100190000FED0DBF00E808B9A8950FE001BD929AD8 +:1001A0008A9A939A8B9AAC9AA49AAD9AA59AB89A7D +:1001B000B99ABA9AA89AA99AAA9AAB9A949A959A2D +:1001C000969A979A0FE509B900E90AB933244424AD +:1001D00011242224552466247724772705E1D02E84 +:1001E00005E003BF22E028BF29BF78940FED0DBFC3 +:1001F000EE2415DF0B3109F0FBCF05E1E02E0FDF18 +:10020000093439F0043499F0023521F1073581F7CA +:1002100045C09ED0A6D031F4AFD00BE13BDF09E45E +:1002200039DFE6CF0BE136DF09E634DFE1CF00E06E +:1002300016E0C7D00CEE17E0C4D093D031F40BE138 +:1002400029DF04E427DF2FEF14C00BE123DF04E6EE +:1002500021DFCECF51D0E3DE0213CACF68D000E257 +:1002600017E0AFD07ED081F40BE114DF02E512DF9E +:1002700051D0E0E0F2E010E085D0201B0BDF319799 +:10028000D1F7022F07DFB4CF0BE104DF02E702DF73 +:1002900041D000E0FFDE022FFDDEAACF2DD047D0F7 +:1002A00000E317E08ED05DD079F7EFEFF1E0B7DE35 +:1002B000201B10E086D03197D1F7B1DE201B102F24 +:1002C000AEDE02137E7F021391CF012F10E079D0B2 +:1002D00048D041F40BE1DEDE07E5DCDE1BD0022F67 +:1002E000D9DE86CF0BE1D6DE07E7D4DE13D000E0FF +:1002F000D1DE022FCFDE7CCF2FEF91DE201BA02F8F +:100300008EDE201BB02F8BDE201BC02F88DE201B33 +:10031000D02F08950A2F2FEF201BBCDE0B2F201BA0 +:10032000B9DE0C2F201BB6DE0D2F201BB3CE01E053 +:1003300012E047D00A2F13E044D00B2F14E041D035 +:100340000C2F15E03ED00D2F0F70006E16E039C057 +:100350000EE016E065D000E00A95F1F70AE016E03D +:100360005FC0E0E0F0E017E00DD007FF02C031977A +:10037000D1F7007C0034089501E011E022D00FEEA7 +:1003800017E01FC018BB1FE215BB000000000000F3 +:100390000000000000000000000014EF12BB00008D +:1003A000000000000000000000000000000003B397 +:1003B00010B301270F7001271CEF12BB1FE315BB01 +:1003C000089518BB102F1F70106215BB1FE314BBDC +:1003D000102F107F1C6012BB1CEF11BB000000002F +:1003E00000000000000000000000000092980000E3 +:1003F0000000000000000000000000000000929AD1 +:1004000000000000000000000000000000000000EC +:1004100012BB1CE011BB1FE315BB10E314BB089516 +:1004200018BB102F1F70106115BB1FE314BB102FDA +:10043000107F1C6012BB1CEF11BB0000000000000D +:100440000000000000000000000092980000000082 +:10045000000000000000000000000000929A000070 +:10046000000000000000000000000000000012BBBF +:0E0470001CE011BB1FE315BB10E314BB089585 +:0620000006410742B2ACEC +:00000001FF diff --git a/src/avr/product/CS64V4.HEX b/src/avr/product/CS64V4.HEX new file mode 100644 index 00000000..e5b357b9 --- /dev/null +++ b/src/avr/product/CS64V4.HEX @@ -0,0 +1,385 @@ +:020000020000FC +:100000000DC087C387C3189518951895189518952E +:1000100082C31895189527C711C762C702E00EBFA3 +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300009BF0BBF08EF01BB08EB02BB0FE107BB19 +:100040000FEF0ABB04BB00270BBB03E008BB00E0BB +:1000500005BB00E2B02E1FE519B910E91AB9442416 +:10006000552422243324EE246624CC24552750938F +:100070000101509323015093430150934401509345 +:100080004501969AE0E0F0E0A8953197E9F7979856 +:1000900000E0B8D0B7D002E4B1D000E2B3D000E0C5 +:1000A000B1D003E4ABD000E8A9D000E9A7D000E0CC +:1000B000A9D0A8D004E2A2D000EBA0D0E0E0F8E004 +:1000C00000E0A2D03197E1F702EB9AD008E996D090 +:1000D000979A789410E3B9D2CF93DF93C4D2BF91AB +:1000E000AF911BD5212F1D2F12950DD31217B1F4EF +:1000F000119613D5212F1D2F06D3121779F41196BF +:100100000CD5212F1C2F1295FED2121739F41196FF +:1001100004D5212F1C2FF7D2121749F1E6E7F2E19F +:10012000A6E6B3E0D8E1D0930201C0D0D0E8C0E0A9 +:10013000DBBBC39AC398D0930101F89435B33C2735 +:1001400030783C27789435BBC8950BBAC29ABA98D8 +:10015000C1980000C19AC298BA9A119741F031969D +:10016000C3951C2F1F7349F7C054D395E1CF20E1ED +:100170002093F30020E22093F40028E12093F5007F +:1001800021D6112710935101EE27FF271EEF109360 +:10019000FD001BEA1093FC0022E01BD21C7F109391 +:1001A000FE0023E016D21093FF001091FE00209174 +:1001B000FF001A380DEF200720F01B3A0FEF200741 +:1001C00030F01EEF1093FF0010E41093FE001EEFBE +:1001D00019BD1BEA18BD1CEF1DBD1EEC1CBD10E5B2 +:1001E0001FBD11E01EBD00E003BF04E008BF09BF52 +:1001F0000AE005BF00EC0ABF0BBF92C219D006C0CF +:1002000011D004C015D001C00DD0A8980BBB0000C0 +:1002100000000000F894C1980000000000007894ED +:10022000C19A08950F930BD003FFFDCF0F9108954E +:100230000F9305D000FD01FFFCCF0F910895A89A00 +:1002400000E00ABBF894C098000000000000000025 +:10025000C09A09B378940F930FEF0ABB0F910895DA +:1002600002E00EBF0FE50DBF1FE7B122AF98C498A3 +:10027000409101014BBBC39AC39850E05FBD5EBD86 +:1002800094989598C298BA9A96989798C098C19859 +:100290005FEF5ABB50E05BBB50E059BF5BBF5FE113 +:1002A00051BD57E151BD5AE655BF889508957894E0 +:1002B0001FEDE12210E01EBB1FBB62D21B3129F1F2 +:1002C000B3FC0DC0103258F4183009F4FEC01D30D4 +:1002D00009F40DC11A3009F48BC0173041F7B2FC94 +:1002E00012C0103381F4C091F300D091F40020913A +:1002F000F500CC5FDD4FF89435B320FB36F97894E8 +:1003000035BBF1D4102D72D2D2CF3AD21B3139F392 +:100310001E3209F475C11F3209F44FC01F3309F4AE +:1003200084C1113409F4A6C0123409F427C213346D +:1003300009F404C1133609F451C9143409F4EBC0AB +:10034000153409F4D8C0163409F408C1163609F476 +:1003500051C9173409F49EC0183409F463C918361A +:1003600009F454C91B3409F461C01C3409F4D4C124 +:100370001D3409F42BC01E3409F4FCC0103509F4F7 +:1003800097C0123509F4DCC0133509F4D2C0153515 +:1003900009F4F4C1163519F410E2E12AF7C0173553 +:1003A00009F4ECC1183509F4B8C11A3509F4E2C1F1 +:1003B000103310F01A3398F07ACFE2D110FF03C057 +:1003C00014E0B12A74CF1BEFB12271CFD9D1103311 +:1003D00021F4F89400E4B02A43CF69CFD1D135D1CC +:1003E000C0E1C093F300D093F4002093F5005FCFF9 +:1003F00001D05DCF0F92C091F300D091F400209115 +:10040000F500DE5FC395F89435B320FB36F9789498 +:1004100035BB69D4182F100D100D1A95103418F033 +:10042000EED00F900895800D0F900895979800E0FA +:10043000E9DEE8DE02E4E2DE00E2E4DE00E0E2DE45 +:1004400003E4DCDE00E8DADE00E9D8DE00E0DADE34 +:10045000D9DE04E2D3DE00EBD1DEE0E0F8E000E03C +:10046000D3DE3197E1F702EBCBDE08E9C7DE979ADE +:10047000A9D41DCF85D1117051F41FE7B122AF98D7 +:10048000C498409101014BBBC39AC39810CF10E8A8 +:10049000B12A0DCF75D1103309F404C0113309F41A +:1004A00004C005CF07EFB02202CF08E0B02AFFCE8C +:1004B00067D1103309F403C0113309F403C00FEE00 +:1004C000B022F5CE00E1B02AF2CEC091F300D09177 +:1004D000F4002091F500DE5FF89435B320FB36F987 +:1004E000789435BB00D470191FB712FFE0CE01D04D +:1004F000DECE7727089544D111FD07C010FD03C05B +:100500000FEDB022D4CE00E2B02A002700932301E1 +:1005100082D2F1F7CCCE34D1103309F404C01133B8 +:1005200009F404C0C4CE0EEFB022C1CE01E0B02A5F +:10053000BECE26D1712F24D1812FB9CE02E0B02AB0 +:1005400070933401809335011BD11093360118D17B +:1005500010933701E5D20DEFB022A9CE7093380188 +:10056000809339010DD110933A010AD110933B01C8 +:100570002CD39DCE709338018093390101D1109313 +:100580003A01FED010933B0145D391CEF9D010FF34 +:100590000BC01091FE002091FF001C5F2F4F1B3AF3 +:1005A0000FEF2007A8F40AC01091FE002091FF0071 +:1005B000145020401A380DEF200750F01093FE0021 +:1005C0002093FF0022E00DD01091FF0023E009D01E +:1005D0006ECEE199FECF2EBB22272FBBE09A1DB332 +:1005E0000895E199FECFE5FEFFCF2EBB22272FBB5A +:1005F0001DBBF894E5FEFFCFE29AE19A18951AC563 +:10060000BFD023D0BDD0A12FBBD0B12FB9D0F8948B +:1006100035B320FB36F9789435BB80D221961197FB +:100620001A2F1B2B09F0F2CF42CEAAD00ED01F9367 +:100630001AD01BE1C6D01FE3C4D01F91105DC1D0FA +:100640001D2F5AD01C2F58D032CEC0E0D0E022E669 +:100650001F70163008F4210F2695D7952695D7954B +:10066000D695D6950895A6E1B2E0AC0FBD1FF894DB +:1006700035B320FB36F9789435BB4FD2E12F119674 +:100680004CD2F12FAC2FBD2F1496CFEFDFEF319767 +:10069000FF70349780F1319640D2119601E220E14B +:1006A000D127CC0FDD1F10F4C027D227CC0FDD1FC0 +:1006B00010F4C027D227CC0FDD1F10F4C027D2279B +:1006C000CC0FDD1F10F4C027D227CC0FDD1F10F494 +:1006D000C027D227CC0FDD1F10F4C027D227CC0FA4 +:1006E000DD1F10F4C027D227CC0FDD1F10F4C02768 +:1006F000D227319789F608951F93129504D061D0BF +:100700001F9101D05EC01F7010631A3308F0195F8B +:100710000895F7C3FFC307C4AAC432D010FD13C0A5 +:100720007093460180934701B09248011091F30005 +:10073000109349011091F40010934A011091F500B3 +:1007400010934B01B4CD709146018091470110EC9C +:10075000B122109148011F73B12A109149011093E1 +:10076000F30010914A011093F40010914B01109383 +:10077000F5009DCD05D004D003D002D001D097CD97 +:1007800010EC10934401A89510E01EBB1FBB10ECA9 +:10079000809910934401B5FC3ED13320A1F310E0C1 +:1007A00010934401CF93DF93C22DC059DD271881E8 +:1007B000F8943A942394CFE72C227894DF91CF9148 +:1007C00008951F93A895152D1031E0F71F91CF9331 +:1007D000DF93DFB7F894C52DC40DDFBFCF70C05ACB +:1007E000DD2718835394DF91CF91089578940027E3 +:1007F00000930001982E672F6AD26093F200A092B6 +:10080000F000C12FDD27CC0FDD1F1091F300C10FC9 +:100810001091F400D11F1091F50026D564D22196D5 +:10082000F02C61D2CF2DD02D1091F300C10F10917B +:10083000F400D11F58D2802C1C2F2D2F219785FC1E +:1008400007C0C091F300D091F400DE5F4CD21DC010 +:100850004AD2B4FC1AC0C091F300D091F400DE5F1C +:10086000F02C41D20F1808F40024069400920001E5 +:10087000672F600D2CD26093F200A092F000C0911F +:10088000F300D091F400DE5F2ED2B3FC1AC0072F24 +:10089000000D08F016C01F932F932BDEABDD0091E7 +:1008A0000001700F982E672F12D26093F200A09271 +:1008B000F00000910001701B1091F500D5D42F912C +:1008C0001F91700D86FE05C0C12FD22F22970BD22B +:1008D000900CC12FD22F219606D2702C0FEF0ABB9D +:1008E000C09A0FE180228092F1000027801201C09F +:1008F00087C0AA27B92DB695A795B695A795B05FDD +:1009000007C09394A05CBF4F8090F100A090F000CE +:10091000AA2A222721961091F500A6D4E4D1112706 +:100920006091F200662339F08894079417956A95D0 +:10093000E1F7022A212F08E1F89435B300FB36F9DC +:10094000789435BBF89435B33A25307C3A257894C1 +:1009500035BB3B2F330F330FA7FA31F9A6FA30F925 +:100960003BBBF894C39AC398789430930101002755 +:100970000ABBF894C29ABA98C0980000C09A09B30A +:100980000026B0FC002A0FEF0ABB0BBAC19800008A +:10099000C19A7894C298BA9AA3948A9409F0BACF6B +:1009A000222351F1F89435B33A25307C3A257894D6 +:1009B00035BB3B2F330F330FA7FA31F9A6FA30F9C5 +:1009C0003BBBF894C39AC3987894309301010027F5 +:1009D0000ABBF894C29ABA98C0980000C09A09B3AA +:1009E0002027B0FC202B0FEF0ABB2BBBC1980000C7 +:1009F000C19A7894C298BA9A04D07A9409F081CFB7 +:100A00000895CF93DF93192D78D01881122B188376 +:100A1000DF91CF9108952F93CF93DF93109123010E +:100A20006CD01881122309F45EC028812127288305 +:100A300010E010934401AF93BF93A3E0B1E0CC2743 +:100A4000D0912301D695C795D695C795D05F18E16B +:100A50000BD42EE1F89435B33C27307C3C277894B6 +:100A600035BB3D2F330F330FC7FB31F9C6FB30F9D0 +:100A70003BBBF894C39AC398789430930101002744 +:100A80000ABBF894C29ABA98C0980000C09A19B3E9 +:100A90007894C298BA9A0FEF0ABB1D93C3952A9512 +:100AA00009F0D8CFBF91AF91CC27D0912301D69533 +:100AB000C795D695C795D695C79597980C2FA2DB65 +:100AC0000D2FA0DB04E29ADB00EB98DB2EE1C3E004 +:100AD000D1E0099199DB2A95E1F702EB91DB979A36 +:100AE00010EC109344011091230113951F73109380 +:100AF0002301DF91CF912F910895C4E2D1E0212FFE +:100B0000269526952695C20F20E0D21F21E017706A +:100B100019F0220F1A95E9F7089562C385C3C7CB70 +:100B200078949090350160913401D1D06093F200B7 +:100B3000A092F00070903701CC27D92DD695C7959B +:100B4000D695C795D05F18E18FD307C0C05CDF4F43 +:100B500093946091F200A090F000AC2A1FEF809077 +:100B6000360100E0801641F008E08016B8F06623F8 +:100B700019F016956A95E9F7DAD008E01091F200BD +:100B8000011B801AA3941FEF08E0801638F0B1F023 +:100B9000CED01FEF08E0801AA394F6CF882079F01A +:100BA00016958A94E9F71095662341F02227169549 +:100BB00027956A95E1F7BBD0A394122FB8D021DF17 +:100BC0007A9400277012C2CF089500913A010A95D5 +:100BD0000230D0F300913B010330B0F300913801B3 +:100BE0000395009334010091390100933501809001 +:100BF0003A018A948A948092360101E00093370189 +:100C00008FDF009138010093340180903A01809287 +:100C100036013AC000913A010A950230A8F20091DB +:100C20003B01033088F200913801039500933401B1 +:100C3000009139010093350180903A018A948A9499 +:100C40008092360101E0009337016ADF009138019C +:100C500000933401009139010395009335017090A0 +:100C60003B017A947A947092370101E00093360147 +:100C700057DF80903A0100913801080D0A950093E2 +:100C8000340101E00093360100913901039500938E +:100C9000350170903B017A947A947092370140DF6D +:100CA0000091380103950093340180903A018A94B1 +:100CB0008A948092360170903B0100913901070DB2 +:100CC0000A950093350101E00093370129CFAA244A +:100CD00000EFA01A67FFAA246F77685014F0A3945E +:100CE000FCCF685F0895F89435B33C27307C3C27EF +:100CF000789435BB3D2F330F330FC7FB31F9C6FB5B +:100D000030F93BBBF894C39AC398789430930101AF +:100D100000270ABBF894C29ABA98C0980000C09AFB +:100D200009B27894C298BA9A0FEF0ABB0895F89462 +:100D300035B33A25307C3A25789435BB3D2F330FB7 +:100D4000330FA7FA31F9A6FA30F93BBBF894C39AEE +:100D5000C39878943093010100270ABBF894C29A93 +:100D6000BA98C0980000C09AF9B27894C298BA9A1A +:100D70000FEF0ABBB1FE03C01095F12203C0F126AC +:100D8000B0FCF12AF89435B33A25307C3A257894B2 +:100D900035BB3D2F330F330FA7FA31F9A6FA30F9DF +:100DA0003BBBF894C39AC398789430930101FBBA83 +:100DB000F894C29ABA98C1980000C19A7894C298DF +:100DC000BA9A08959924C0E0D0E118E14DD2AA243E +:100DD000A092F0001091F0001C2BF89435B331274D +:100DE000307C3127789435BB3D2F330F330F17FB01 +:100DF00031F916FB30F93BBBF894C39AC398789449 +:100E00003093010100E00BBBF894C29ABA98C198E4 +:100E10000000C19A7894C298BA9AA39400E2A016EE +:100E200019F0A092F000D6CFECDD9394C05CDF4FB8 +:100E3000D03209F0CCCF7727882708951FB60F93BB +:100E40000FEDC02EEF93FF93E42DE05AFF270081B2 +:100E5000FF91EF910CB95A9443940FE040226A94A9 +:100E60000AF046C04BC01FB60F930FEDC02E0CB159 +:100E70005C9938C0E7FC26C0E6FC08C0033029F4C2 +:100E800003E009B9539A00E4E02A38C0602E00E874 +:100E900003190AF40FE7662012F4052D00680CB957 +:100EA000061508F4602E062D0F7739F000ECE02AC5 +:100EB0006A9422F55798559A21C00FEBE022569A72 +:100EC0005E9A1CC0EF93FF93E32DE20DEF77E0599C +:100ED000FF270083FF91EF9133946A947AF40CC05A +:100EE0001FB60F9353980FE509B90FEBE022CC24FE +:100EF00055985698579A0CB10FE7E0220F911FBEF4 +:100F000018951FB68A9A4CB55DB55093FB00409377 +:100F1000FA008EC01FB68B9A4CB55DB55093F900A0 +:100F20004093F80085C01FB65AB35F935BB35F93DD +:100F30005FEF5ABBB7FE14C0509151015395553223 +:100F400028F4523159F4AF98C49A03C0AF9AC498A8 +:100F500050E0409101014BBBC39AC398509351019B +:100F600055B35F93509101015F9350914501505CDF +:100F70005093450149F450914401539550934401D5 +:100F800019F45FEBB5226CC950EB5FBD4CB55DB594 +:100F9000485F5F4F5BBD4ABD59BD48BD8A9A929A72 +:100FA0008B9A939A8D9895985091FD004091FC00F2 +:100FB0008D9A859907C040389DEF59074AF04150F6 +:100FC000504006C0453D9FEF590712F44F5F5F4FF9 +:100FD0005093FD004093FC005BBD4ABD9091FE0024 +:100FE000491B9091FF00590B1AF445EF5FEF02C0C7 +:100FF00040E85DEF59BD48BD000000000000000062 +:10100000000000005DEF5DBD55E75CBD8A989298D9 +:101010008B98939850EE5FBD5F915BBBC39AC3986A +:10102000509301015F9155BB5F915BBB5F915ABBD0 +:101030001FBE18959924C0E0D0E1A0E0B0E118E10E +:1010400013D1A05CBF4F0A94E1F720E22F93C8D0E0 +:10105000EBD0A395C3952F912A9509F0F7CFD1DC5A +:101060009394A0969096B03209F0EFCFB0CE88DB83 +:101070001F9386DB10934C0183DB1695169516950E +:1010800009F410E210934F017BDB10935001172FEE +:1010900016951695169510934D0180934E0118E103 +:1010A000E3D01F9110FD46C0CC27D0914E019D2E5C +:1010B000D695C795D695C79510914D01C10FD05FB4 +:1010C0002091500110914C01121720F5211BAA27E5 +:1010D000B0914E01B10FB695A795B695A795109111 +:1010E0004D01A10FB05F2F93AF93BF93CF93DF93C9 +:1010F00020914F0168D085DCDF91CF91BF91AF91F6 +:101100002F919394A05CBF4FC05CDF4F2A9559F795 +:1011100020914C012F93CF93DF9320914F015AD010 +:1011200070DCDF91CF912F919394C05CDF4F2A95B3 +:1011300089F7F5CCCC27D0914E0100915001D00F0A +:101140009D2ED695C795D695C79510914D01C10F87 +:10115000D05F202F10914C01121728F5211BAA27D0 +:10116000B0914E01B00FB11BB695A795B695A79556 +:1011700010914D01A10FB05F9A94A054B040C0549B +:10118000D0402F93AF93BF93CF93DF9320914F0124 +:101190001AD037DCDF91CF91BF91AF912F912A9573 +:1011A00059F720914C019A94C054D0402F93CF937B +:1011B000DF9320914F010ED024DCDF91CF912F914E +:1011C0002A9589F7ACCC0CD011962ED021962A9571 +:1011D000D1F7089510E028D021962A95E1F70895D7 +:1011E000F89435B33A27307C3A27789435BB3B2FB7 +:1011F000330F330FA7FB31F9A6FB30F93BBBF89453 +:10120000C39AC39878943093010100270ABBF894DD +:10121000C29ABA98C0980000C09A19B37894C2983C +:10122000BA9A0FEF0ABB0895F89435B33C27307C87 +:101230003C27789435BB3D2F330F330FC7FB31F973 +:10124000C6FB30F93BBBF894C39AC39878943093AB +:1012500001011BBBF894C29ABA98C1980000C19AC8 +:101260007894C298BA9A0895F89435B310FB36F979 +:10127000789435BB089546323444303331393033B5 +:101280003132313730394C034C034C034C034C039F +:101290004C034C034C034C034C034C034C034C03D6 +:1012A0004C034C034C034C034C034C034C034C03C6 +:1012B0004C034C034C034C034C034C034C034C03B6 +:1012C0004C034C034C0300014C034C034C034C03F4 +:1012D0004C034C034C034C034C034C034C034C0396 +:1012E00003014C034C0306010F01180121012A01DF +:1012F00033013C0145014E0157014C034C034C03A3 +:101300004C034C034C034C036001690172017B01E7 +:1013100084018D0196019F01A901B201BB01C401A5 +:10132000CD01D601DF01E801F101080211021A0224 +:1013300023022C0235023E02470250024C034C03AA +:101340004C034C034C034C03590262026B027402BF +:101350007D0286028F029902A302AD02B802C20288 +:10136000CB02D402DD02E602F002FC0203030C030E +:1013700015031E0327033003390343034C034C03B7 +:101380004C034C034C030003066101F8010770880D +:1013900098A8C888700107206020202020700107CD +:1013A000708808102040F80107F810201008887095 +:1013B000010710305090F810100107F880F008086D +:1013C00088700107304080F08888700107F80810A5 +:1013D000204040400107708888708888700107703D +:1013E000888878081060010770888888F8888801E4 +:1013F00007F08888F08888F00107708880808088EE +:10140000700107E09088888890E00107F88080F0FC +:101410008080F80107F88080F08080800107708864 +:1014200080B88888780107888888F88888880221A9 +:10143000078080808080808001070808080808886D +:101440007001078890A0C0A09088010780808080EC +:101450008080F8010788D8A8A8888888010788882C +:10146000C8A89888880107708888888888700107CC +:10147000F08888F0808080010770888888A890684C +:101480004C034C034C03060801014F0065030107A0 +:10149000F08888F0A09088010770888070088870B4 +:1014A0000107F820202020202001078888888888CC +:1014B0008870010788888888885020010788888874 +:1014C000A8A8A8500107888850205088880107885C +:1014D0008888502020200107F80810204080F8015B +:1014E000070000700878887801078080F088888875 +:1014F000F00107000078808080780107080878886C +:10150000888878010700007088F88070010718202B +:10151000F8202020200108000078888878087001D1 +:10152000078080B0C888888802210780008080807A +:101530008080052108100010101010906005210710 +:10154000808090A0C0A090032107C0404040404050 +:101550004001070000F0A8A8A8A801070000B0C833 +:10156000888888010700007088888870010800005A +:10157000F08888F080800108000078888878080862 +:1015800002056105B0C0808080010700007880708E +:1015900008F001072020F82020201801070000880B +:1015A0008888986801070000888888502001070013 +:1015B000008888A8A85001070000885020508801A2 +:1015C00008000088888878087001070000F810205B +:1015D00040F80107F8F8F8F8F8F8F80070933801C7 +:1015E00080933901CDD810933A01CAD810933B01AA +:1015F00026D05DC67093380180933901C1D810930D +:101600003A01BED810933B012FD051C670933401DC +:1016100080933501B5D810933601B2D810933701B5 +:1016200078D045C67093340180933501A9D81093C2 +:101630003601A6D81093370171D039C608950091AC +:101640003801009334010091390100933501009174 +:101650003A010093360100913B010093370102E00B +:10166000B02A5EDA0DEFB02200913A010A950230FD +:1016700028F300913B01033008F3009138010093F7 +:101680003401009139010093350100913A01009332 +:10169000360101E00093370143DA009138010093ED +:1016A00034010091390103950093350100913B010C +:1016B00002500093370101E00093360131DA809047 +:1016C0003A0100913801080D0A950093340101E0B8 +:1016D0000093360100913901039500933501009183 +:1016E0003B010250009337011BDA0091380100934F +:1016F000340100913A010093360170903B01009152 +:101700003901070D0A950093350101E00093370177 +:1017100007CA02E0B02A04DA0DEFB0227894909064 +:10172000350160913401D3DA6093F200A092F000A9 +:1017300070903701CC27D92D15E5D0FF1AEA012E7C +:10174000D695C795D695C795D05F18E18DDD07C0B2 +:10175000C05CDF4F93946091F200A090F000AC2A3F +:101760001FEF8090360100E0801641F008E08016FF +:10177000C8F0662319F016956A95E9F71021D7DAB3 +:1017800008E01091F200011B801AA3941FEF08E0FB +:10179000801640F0C1F01021CADA1FEF08E0801A6D +:1017A000A394F5CF882089F016958A94E9F71095CF +:1017B000662349F02227169527956A95E1F71021AF +:1017C000B6DAA394122F1021B2DA00941AD97A94BF +:0817D00000277012BDCF08953F +:0220000003419A +:00000001FF diff --git a/src/avr/product/MT102V0.HEX b/src/avr/product/MT102V0.HEX new file mode 100644 index 00000000..6263fea7 --- /dev/null +++ b/src/avr/product/MT102V0.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F445E049B9539A40E4542AFD +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE849B9B9 +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE809B900E90AB9B7 +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541B2AC38 +:00000001FF diff --git a/src/avr/product/MT102V1.HEX b/src/avr/product/MT102V1.HEX new file mode 100644 index 00000000..1e074a5a --- /dev/null +++ b/src/avr/product/MT102V1.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F445E049B9539A40E4542AFD +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE849B9B9 +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE809B900E90AB9B7 +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541BAAC30 +:00000001FF diff --git a/src/avr/product/MT102V2.HEX b/src/avr/product/MT102V2.HEX new file mode 100644 index 00000000..9d5f9c2b --- /dev/null +++ b/src/avr/product/MT102V2.HEX @@ -0,0 +1,191 @@ +:020000020000FC +:0200000033C209 +:04000A007CC104C0F1 +:10001000DDC1C7C118C2FFB65F936F9358EB52BFE3 +:10002000A89508956F915F91FFBE1895BA9494D0EA +:10003000F9DF90D0F7DFBB2019F4272F2C70B9F02F +:10004000E1FC06C022E1E22A89D0A298AA9AEADF5E +:10005000BB2061F773FF20C172FF82C0382D737F10 +:1000600079D0E0DF79D0DEDF3A95D1F7E4CFE1FE59 +:100070000BC0D8DF2DEFE22220E174FFE22A20E05E +:1000800022BBAA98A29AD6CF74FD38C020E022BF26 +:1000900020E4E20E78F69298A398A298AA9A20E714 +:1000A000E0FE20E822BFBEDF2091D30023952093FD +:1000B000D30011F420E1E22A33B3929AA39AAA98CA +:1000C000A29A33FD06C020E1E0FCE22A2EEFE222F4 +:1000D00004C0E0FC02C021E1E22A32FD0AC0E3FED6 +:1000E000A9CF28E7E0FCB22E20E1E22A27EFE222A6 +:1000F000A1CFE3FC9FCF28E1E22A9CCF7F7E24E1C1 +:10010000E22AA998A0E2BEE438EE43E0119779F024 +:100110002CEF22BF87DF9899F7CF31504040B1F7DD +:10012000119729F02CEF22BF7DDF989BF9CFA99A78 +:10013000A8EEB3E02CEF22BF75DF1197D9F72BEFB4 +:10014000E2222B2D222329F4272F2C7011F420E1F9 +:10015000E22A70CF20EA01C020E5A226A2BA0895C3 +:100160002FEF22BFDD0CDD0C20ECD22277FFD394E1 +:10017000A0E8B1E080E090E030E0EF93FF93E32F60 +:10018000E695E695E695E05A2081532F57705395F2 +:100190004091D1004F7026955A95E9F710F4440F1D +:1001A0004F57E32FEA5920812032C8F0E22FFF2772 +:1001B000EE0FFF1FEE0FFF1FE20F20E0F21FEE0F0A +:1001C000FF1F2D2D2F70E20F20E0F21F20EBE20F1A +:1001D00026E0F21F602DC895202D062E0FC0E22FBD +:1001E000EE0FEE0FE20FEE0FE20FE85F2D2D2F70F6 +:1001F000E20FE199FECFEEBBE09A2DB3FF91EF91B4 +:1002000011DF5FEF47FD5EEF52BF65D061E064D064 +:1002100009DF5FEF47FD5EEF52BF339547FD339532 +:100220003A3208F4AACF20E046E061E055D02D2D07 +:10023000203C20F42395203808F423952F70293092 +:1002400008F0777F4091D100939A9398EBDE84DF9A +:1002500027E028BBE7DE382F292F269537952695EE +:100260003795385E2A2D79DF5FEF52BFDBDE3A9596 +:10027000D1F7A22E20E028BB6DDF405138F72D2D9D +:10028000203C20F42395203808F423952F70293042 +:1002900010F4D3946DCFCECE2FEF22BFA0E8B1E003 +:1002A00080E090E030E0EF93E32FE05A2081EF917F +:1002B0004091D2004F70B6DE5FEF52BF0CD0B2DE7D +:1002C0005FEF52BF3395303370F37B7F2FEFD22E29 +:1002D0004091D200B9CF68E0AA2311F4BB2381F08A +:1002E000220F08F4AB9A542F5F77AD9AAB99019621 +:1002F0001197AD9829F05150C0F7AB986A9581F7E6 +:10030000AB9808952FE121BD27E121BD20E325BF52 +:1003100088950FEF0DBD00E00CBD00E808BF02E8B6 +:1003200009BF00E00EBB809B04C00FEF0DBD00E0D5 +:100330000CBDE4FE0FC0042D013060F400E000931A +:10034000D3000FEEE0220E2D0F7000630A3308F089 +:10035000095F18D0222029F302E009BFCF93DF9371 +:10036000C12DCF56DD270881F8942A941394CFE34A +:100370001C227894DF91CF9108950F93042D0130C2 +:10038000E8F70F91CF93DF93DFB7F894C42DC30D37 +:10039000DFBFC070C057DD2708834394DF91CF9142 +:1003A0000895FFB64F934EEC742EEF93FF93E32D19 +:1003B000E057FF274081FF91EF914CB94A94339465 +:1003C00040E034226A940AF046C04BC0FFB64F9317 +:1003D0004EEC742E4CB15C9938C057FC26C056FCCC +:1003E00008C0453029F443E049B9539A40E4542AFF +:1003F00038C0642E40E442190AF44FE7662012F434 +:10040000442D40684CB9461508F4642E462D4F77AC +:1004100039F040EC542A6A9422F55798559A21C035 +:100420004FEB5422569A5E9A1CC0EF93FF93E22D35 +:10043000E10DEF73EF56FF274083FF91EF91239477 +:100440006A947AF40CC0FFB64F9353984FE549B9BC +:100450004FEB5422772455985698579A4CB14FE752 +:1004600054224F91FFBE18950FED0DBF00E808B95B +:10047000A8950FE001BD929A8A9A8C9A8D9A8E9ACD +:100480008F9A8B9AA39AA59AB89AB99ABA9AA19A6E +:1004900003E005BB00E002BB0FE509B900E90AB9BA +:1004A000332444241124222455246624772471EC17 +:1004B00001E2E02E00E20093D10001E20093D200BD +:1004C00003E0C02EBB2400E6A02E5AE160E004E069 +:1004D00003BF08EB02BF02E008BF09BF00E00FBD89 +:1004E00004E00EBD78942CD1E2E041D10C1729F440 +:1004F000E3953DD10D1771F0EA950CEA3FD1E395F4 +:100500000BEF3CD1E39501E039D1E39500E036D122 +:10051000E39534D10FEDE02200E00EBB809BFECFCF +:100520008824726099240FEDE02200E00EBB082DB4 +:10053000003288F40B3119F1083191F3043149F09C +:100540000E3029F00D30F9F0E4DE802EECCF7E7F06 +:10055000FBCF7160F9CF70FD07C0092D0932A8F4F7 +:10056000082D27D10068008300E208117D7F082D47 +:1005700020D100838824092D0A3278F4E5CF092D93 +:10058000013018F42FC08824716071FD24C000E28E +:1005900010D10083092D0A32D0F371FD1CC00091E7 +:1005A00065000695069506950695069506950093B1 +:1005B00065000C2D043008F003E00295D02A786025 +:1005C00073FDFECF7F77CC2029F00C2D035008F06F +:1005D000E6D07068A6CF07E077FF06E0E0D0DED077 +:1005E00070689FCF96DE0E3219F400E2E02A7FC0D9 +:1005F0000F3309F491C0013479F0023481F00334EF +:1006000009F4C8C00A3419F10B34C9F1023579F084 +:10061000043549F17EDE84CF7CDEC02E81CF79DEC9 +:10062000002321F077FF0A95BAD0706879CF71DE88 +:10063000002349F01091D100802E7C6073FDFECF25 +:100640001051D0F777FD6CCF706801E0F3CF61DE19 +:100650000A950F70102F5DDE0A950F700295012B21 +:100660000093D2005DCF55DE0A950F70102F51DE3A +:100670000A950F700295012B0093D10051CF49DEEE +:10068000002E47DEC02F45DED02F0C2B002949F16C +:1006900001E077FD84D0726099243BDE802E00E07B +:1006A00008117D7F082D9FD0092D003348F40015D7 +:1006B000A0F371FD17C000E096D0092D0033D8F3E8 +:1006C00071FD10C0746072FDFECF21970C2F0D2BB1 +:1006D00011F77F77CC2029F00C2D015008F05FD066 +:1006E00070681ECF01E01091D2005BD0EECF11DE1A +:1006F000E2E00FDE43D0E3950CDE40D0E39509DE67 +:10070000F02F3CD0E39505DE39D0E39502DE36D0FC +:10071000E395FA95D9F704CFFCDD0BE12EDE0FE36C +:100720002CDE00E32ADEE2E022D027DEE3951FD0B4 +:1007300024DEE3951CD021DEE39519D01EDEF0CE39 +:10074000E4E015D0F02FFE5FCFEFDFEF11E2012ED6 +:1007500010E10DD0D027E39508E0CC0FDD1F10F499 +:10076000C025D1270A95C9F7FA9599F70895E19917 +:10077000FECFF894EEBBE09A0DB31895E199FECF49 +:10078000F894E5FEFFCFEEBB0DBBE5FEFFCFE29A8E +:10079000E19A1895706174FDFECFC2CE0C2D1091B8 +:1007A000D1000F930B0D0F91E0F3B00E1051C8F76D +:1007B0000895C02FD0E0E6E0DADFF02FE395D7DF31 +:1007C0000C1729F0E55FD395FA95C9F7DC2FE92DD1 +:1007D000EA59D083E92DE695E695E695E05A93949B +:1007E000008106950895E92DE05A008393940895B9 +:1007F0000000000000000000000000181818181881 +:100800000018000000E763C600000000000000665A +:1008100066FF66FF66660000187EDBD87E1BDB7E07 +:10082000180000E3E60C183067C700000078CCD849 +:1008300073DECC7B0000003C0C18000000000000C0 +:10084000000C18303030180C00000030180C0C0C64 +:10085000183000000018DB7E3C7EDB180000000032 +:100860001818FF18180000000000000000003C0CE1 +:10087000180000000000FF00000000000000000061 +:1008800000003C3C00000003060C183060C0000073 +:10089000007EC7CFDBF3E37E0000000C1C3C0C0C99 +:1008A0000C0C0000007EC3030E3860FF0000007EC9 +:1008B000C3033E03C37E0000001C3C6CCCFF0C0C49 +:1008C000000000FFC0FE0303C37E0000003E60C0C6 +:1008D000FEC3C37E000000FF03060C1818180000BA +:1008E000007EC3C37EC3C37E0000007EC3C37F03FC +:1008F000067C000000003C3C003C3C000000000086 +:100900003C3C003C0C180000000C18306030180C07 +:100910000000000000FF00FF000000000030180C85 +:10092000060C18300000007EC3030E1800180000EB +:10093000007EC3DBDBDFC07C0000003C66C3FFC37E +:10094000C3C3000000FEC3C3FEC3C3FE0000007E9D +:10095000C3C0C0C0C37E000000FCC6C3C3C3C6FC86 +:10096000000000FFC0C0FEC0C0FF000000FFC0C00C +:10097000FEC0C0C00000007EC3C0C0CFC37F000067 +:1009800000C3C3C3FFC3C3C300000018181818185E +:1009900018180000000303030303C37E000000C314 +:1009A000C6CCF8CCC6C3000000C0C0C0C0C0C0FFE9 +:1009B000000000C3E7FFDBC3C3C3000000C3E3F3D1 +:1009C000DBCFC7C30000007EC3C3C3C3C37E000028 +:1009D00000FEC3C3FEC0C0C00000007EC3C3C3C3CB +:1009E000CF7E030000FEC3C3FECCC6C30000007E62 +:1009F000C3C07E03C37E000000FF18181818181823 +:100A0000000000C3C3C3C3C3C37E000000C3C3C38D +:100A1000C3663C18000000C3C3C3C3DBFF6600000D +:100A200000C3663C183C66C3000000C3C3663C18A4 +:100A30001818000000FF060C183060FF0000003C92 +:100A400030303030303C000000C06030180C0603FD +:100A50000000003C0C0C0C0C0C3C0000183C66C365 +:100A600000000000000000000000000000FF000087 +:100A70000C181E000000000000000000007E037F34 +:100A8000C37F000000C0C0FEC3C3C3FE000000005F +:100A9000007EC3C0C37E00000003037FC3C3C37FC7 +:100AA00000000000007EC3FFC07E0000001E333047 +:100AB000FC30303000000000007FC3C3C37F037EE2 +:100AC00000C0C0FEC3C3C3C300000018001818183C +:100AD000181800000006000606060606067C00C080 +:100AE000C0C6CCF8CCC60000003030303030301CEE +:100AF0000000000000FEDBDBDBDB0000000000FE8E +:100B0000C3C3C3C300000000007EC3C3C37E000094 +:100B1000000000FEC3C3C3FEC0C00000007FC3C30B +:100B2000C37F0303000000FEC3C0C0C0000000007C +:100B3000007EC07E037E00000018187E1818180E74 +:100B40000000000000C3C3C3C37F0000000000C357 +:100B5000C3663C180000000000C3C3DBFF66000052 +:100B6000000000C3663C66C30000000000C3C3C3AE +:100B7000C37F037E000000FF0C1830FF0000000E52 +:100B800018187018180E00000018181800181818F7 +:100B90000000007018180E18187000000076DC00B5 +:100BA000000000000000000000183C66C3FF0000C9 +:042000000541B2AC38 +:00000001FF diff --git a/src/avr/product/TSV3.HEX b/src/avr/product/TSV3.HEX new file mode 100644 index 00000000..0b6e310f --- /dev/null +++ b/src/avr/product/TSV3.HEX @@ -0,0 +1,504 @@ +:020000020000FC +:100000000DC006C606C6189505C61895189518950C +:1000100002C602C61895EDC6D7C62EC702E00EBFAF +:100020000FE50DBF10E818B9A8951FE011BD00E05D +:1000300000935F01009360010093610100936201EE +:10004000009363010093640101E000936501009354 +:10005000660104E10093670108E002BD03E005BD0D +:1000600000E409BF00E00BBF08EB01BB02BB0FE1DE +:1000700007BB0FEF0ABB04BB00270BBB03E008BBA9 +:1000800000E105BBC29AC2980093190100E2B02EAC +:100090001FE519B910E91AB9442455242224332440 +:1000A000EE246624CC2458E15BBBC49AC4985093D8 +:1000B000170155275093180150933B0150936A0143 +:1000C00050936B0150931001DD24D0921401D09213 +:1000D0001501D092160154EF509369015BBB50910A +:1000E000190155BBA89AC29AC298A898C29AC298F8 +:1000F0007894E2E0F9E1A2EEB0E0DBE1D0931A01FE +:1001000008D1D0E8C0ECDBBBC39AC398D0931801E8 +:10011000C5BBC89500240BBAC198C0980000C09A0E +:10012000C19AAA9541F03196C3951C2F1F7381F790 +:10013000C054D395E8CF10E3D9D2CF93DF93E4D264 +:10014000BF91AF915FD5212F1D2F129533D3121779 +:10015000B1F4119657D5212F1D2F2CD3121779F4F6 +:10016000119650D5212F1C2F129524D3121739F434 +:10017000119648D5212F1C2F1DD3121709F1E4EE3B +:10018000F9E1A6E6B3E0D9E1D0931A01C2D0D0E0FC +:10019000C0E4DBBBC39AC398D0931801C5BBC89514 +:1001A0000BBAC198C0980000C09AC19A119741F04B +:1001B0003196C3951C2F1F7389F7C054D395E9CF8F +:1001C00020E12093030120E42093040129E12093FE +:1001D0000501C0E0D0E218E118D520E82F93CF93B5 +:1001E000DF9320E211D5269622E00ED5DF91CF9144 +:1001F0002F91C05CDF4F2A9589F7B4D610E0109399 +:10020000110116E31093100110E01093680110E043 +:1002100010934C0110934D011EEF10930D011CEA39 +:1002200010930C0122E020D21C7F10930E0123E0DA +:100230001BD210930F0110910E0120910F011A3360 +:100240000DEF200720F01C3B0DEF200730F01DEFD5 +:1002500010930F0110E810930E011FEF19BD18E362 +:1002600018BD1CEF1DBD1EEC1CBD10E51FBD11E02F +:100270001EBD00E003BF05E008BF05E409BF0AE0BA +:1002800005BF00EC0ABF0BBF9EC202E00EBF0FE528 +:100290000DBF50E05FBD5EBD949A959850911701D7 +:1002A0005F7B5BBBC49AC4985093170154E7B6FEBA +:1002B00054E3509369015BBB5091190155BBA89A57 +:1002C000C29AC298A898C29AC29851E459BF50E005 +:1002D00053BF5BBF04E000936A011FE519B910E941 +:1002E0001AB94424552422243324EE246624CC2431 +:1002F000F89403B700230AE411F4809B0AE705BFD2 +:1003000078948895A89500916A01002389F7F8945C +:10031000A3CED0911A01C0911701C07EDC2BDBBBAC +:10032000C49AC498D0931701089578941FEDE122E0 +:1003300010E01EBB1FBBE2D21B3159F1B3FC0DC054 +:10034000103258F4183009F407C11D3009F41CC1EB +:100350001A3009F4C0C0173041F7B2FC18C010338E +:10036000B1F4C0910301D091040120910501CC5F4B +:10037000DD4FF894309117013227307E32273BBB96 +:10038000C49AC49878943093170193D5102DECD269 +:10039000CCCFB4D21B3109F31E3209F47CC11F3219 +:1003A00009F452C01F3309F491C1123409F45EC03C +:1003B000123609F45FC0133409F40BC1133609F483 +:1003C000C4CC143409F4F2C0153409F4DFC0163477 +:1003D00009F40FC1163609F4C4CC173409F4A1C0CE +:1003E000183409F4D6CC183609F4C7CC1B3409F4F8 +:1003F00096C01C3409F40AC41D3409F42EC01E34FE +:1004000009F403C1103509F49AC0123509F4E3C0A8 +:10041000133509F4D9C0143509F440C0153509F471 +:100420006BC2163519F410E2E12AFBC0173509F446 +:1004300063C2183509F4C4C11A3509F4EEC110338A +:1004400010F01A3310F171CF59D210FF03C014E02D +:10045000B12A6BCF1BEFB12268CF50D2103329F4F1 +:10046000F89400E4B02A8A9A10CF5FCF47D21F9346 +:1004700010E004C043D21F9341D21F7010931101AA +:100480001F911093100151CF39D230D1C0E1C093E8 +:100490000301D09304012093050147CF10E015BD5F +:1004A00010935F01109360011093610127D21093A4 +:1004B000640124D21093630121D2109362011ED2F1 +:1004C000109366011BD21093650118D21093670137 +:1004D00013E015BD2ACF01D028CF0F92C0910301A0 +:1004E000D091040120910501DE5FC395F89430910D +:1004F00017013227307E32273BBBC49AC4987894C8 +:1005000030931701D6D4182F100D100D1A951038EE +:1005100018F0C0D00F900895800D0F90089522D547 +:1005200004CFECD1103309F404C0113309F404C032 +:10053000FCCE07EFB022F9CE08E0B02AF6CEDED12D +:10054000103309F403C0113309F403C00FEEB022D5 +:10055000ECCE00E1B02AE9CEC0910301D0910401B4 +:1005600020910501DE5FF894309117013227307E2B +:1005700032273BBBC49AC49878943093170199D41E +:1005800070191FB712FFD1CE7727CFCEB7D111FD8B +:1005900007C010FD03C00FEDB022C7CE00E2B02AA5 +:1005A000002700933B01EAD2F1F7BFCEA7D1103369 +:1005B00009F404C0113309F404C0B7CE0EEFB02221 +:1005C000B4CE01E0B02AB1CE99D1712F97D1812F4D +:1005D000ACCE02E0B02A70935201809353018ED1C9 +:1005E000109354018BD11093550117D30DEFB02206 +:1005F0009CCE709356018093570180D1109358017F +:100600007DD1109359015ED390CE709356018093A3 +:10061000570174D11093580171D11093590177D3B8 +:1006200084CE6CD110FF0BC010910E0120910F01F0 +:100630001C5F2F4F1C3B0DEF2007A8F40AC0109140 +:100640000E0120910F01145020401A330DEF2007A6 +:1006500050F010930E0120930F0122E00DD0109165 +:100660000F0123E009D061CEE199FECF2EBB2227F6 +:100670002FBBE09A1DB30895E199FECFE5FEFFCFB1 +:100680002EBB22272FBB1DBBF894E5FEFFCFE29ABD +:10069000E19A189536C732D129D030D1A12F2ED169 +:1006A000B12F2CD1F894309117013227307E3227A8 +:1006B0003BBBC49AC498789430931701A4D2219676 +:1006C00011971A2F1B2B09F0ECCF2FCE17D10ED07C +:1006D0001F931AD01BE133D11FE331D11F91105D5D +:1006E0002ED11D2F60D01C2F5ED01FCEC0E0D0E0D9 +:1006F00024E61F701A3008F4210F2695D795269509 +:10070000D795D695D6950895A6E1B2E0AC0FBD1F5A +:10071000F894309117013227307E32273BBBC49AC0 +:10072000C4987894309317016DD2E12F11966AD254 +:10073000F12FAC2FBD2F1496CFEFDFEF3197FF7065 +:10074000349780F131965ED2119601E220E1D127F3 +:10075000CC0FDD1F10F4C027D227CC0FDD1F10F403 +:10076000C027D227CC0FDD1F10F4C027D227CC0F13 +:10077000DD1F10F4C027D227CC0FDD1F10F4C027D7 +:10078000D227CC0FDD1F10F4C027D227CC0FDD1FDE +:1007900010F4C027D227CC0FDD1F10F4C027D227BA +:1007A000319789F608951F93129504D0C8D01F91F0 +:1007B00001D0C5C01F7010631A3308F0195F089587 +:1007C0009DD010FD13C070936C0180936D01B092A9 +:1007D0006E011091030110936F01109104011093A9 +:1007E000700110910501109371019FCD70916C0102 +:1007F00080916D0110ECB12210916E011F73B12A2E +:1008000010916F0110930301109170011093040176 +:10081000109171011093050188CD70D010935A0189 +:100820006DD0C12F175F5DD020935B0167D0D12FB2 +:100830001C5F5CD020935C0161D01C0F1F5051D015 +:1008400020935D015BD01D0F115150D020935E01AC +:10085000D0915C0110915E011D1B08F441C0C09154 +:100860005B011C2F1D0F2D2F220F220F220F120FA5 +:10087000220F120FA0E0B0EE20E0A10FB21F2BE17B +:10088000F894309117013227307E32273BBBC49A4F +:10089000C49878943093170110915D011C1BF0F0FF +:1008A0003A2F3F7335BB3B2F330F330FA7FB31F983 +:1008B000A6FB30F93BBBF894C39AC3987894309365 +:1008C000180110915A011BBBF894C198C098000000 +:1008D000C09A7894C19A1196C395DECFD395BACFBA +:1008E00024CD2FEF23951A50E8F708952FEF239585 +:1008F0001D50E8F7089502D001D017CD10EC1093E9 +:100900006B01A89510E01EBB1FBB10EC80991093E3 +:100910006B01B5FC33D13320A1F310E010936B01D0 +:10092000CF93DF93C22DC058DD271881F8943A94F5 +:100930002394CFE72C227894DF91CF9108951F93D1 +:10094000A895152D1032E0F71F91CF93DF93DFB7F5 +:10095000F894C52DC40DDFBFCF71C05ADD271883B1 +:100960005394DF91CF910895D2D0EFD00027009318 +:100970001201B4FC0FC0C0910301D0910401DE5FED +:10098000F02C97D20F920F1808F4002406940092CE +:1009900012010F90B3FC08C0072F000D28F4772731 +:1009A0009CDD10910501B9D600911201070F00934B +:1009B0004E0180934F01700D60914E0190904F0158 +:1009C00086FE07C0C0915001D0915101229771D28B +:1009D000900C87FE07C0C0915001D0915101239720 +:1009E00068D2600D5AD260930201A0920001C091BA +:1009F0005001D091510121965CD2702C0FEF0ABBAF +:100A0000C09A0FE18022809201010027801201C06C +:100A10007DC0AA27B92DB695A795B695A795B05EC6 +:100A200007C09394A05CBF4F80900101A09000018B +:100A3000AA2A22272196109105016FD63AD21127B2 +:100A400060910201662339F08894079417956A959E +:100A5000E1F7022A212F08E1F8943091170130279D +:100A6000307E30273BBBC49AC498789430931701EA +:100A70003A2D3F7335BB3B2F330F330FA7FA31F9B4 +:100A8000A6FA30F93BBBF894C39AC3987894309394 +:100A9000180100270ABBF894C0980000C19809B358 +:100AA0000026B0FC002A0FEF0ABB0BBA0000C09A68 +:100AB0007894C19AA3948A9409F0BCCF222311F1AF +:100AC0003A2D3F7335BB3B2F330F330FA7FA31F964 +:100AD000A6FA30F93BBBF894C39AC3987894309344 +:100AE000180100270ABBF894C0980000C19809B308 +:100AF0002027B0FC202B0FEF0ABB2BBB0000C09AB5 +:100B00007894C19A31D07A9409F08BCF0895C12F8F +:100B1000DD27CC0FDD1F10910301C10F10910401DF +:100B2000D11F10910501F9D5C4D12196F02CC1D166 +:100B3000CF2DD02D10910301C10F10910401D11FB1 +:100B4000C0935001D09351010895C0915001D091AC +:100B50005101AFD1802C219785FCABC1C09103011D +:100B6000D0910401DE5FA5C1CF93DF93192D39D059 +:100B70001881122B1883DF91CF9108952F93CF9373 +:100B8000DF9310913B012DD01881122309F41FC06F +:100B900028812127288310E010936B01AF93BF9326 +:100BA000CC27D0913B01D695C795D695C795AC2F4C +:100BB000BD2FB05E18E1B1D520E26CD51297269614 +:100BC00022E068D5BF91AF9110EC10936B011091AA +:100BD0003B0113951F7710933B01DF91CF912F912C +:100BE0000895CCE3D1E01F77212F269526952695F1 +:100BF000C20F20E0D21F21E0177019F0220F1A95C2 +:100C0000E9F7089554C56FC54CC587C597C48DCB0A +:100C1000DFC1DFC18FC5E6C1C6C278949090530191 +:100C2000609152013AD160930201A092000170904C +:100C30005501CC27D92DD695C795D695C795D05EA9 +:100C400018E16BD507C0C05CDF4F9394609102013F +:100C5000A0900001AC2A1FEF8090540100E08016A4 +:100C600041F008E08016B8F0662319F016956A95F1 +:100C7000E9F73BD108E010910201011B801AA3940F +:100C80001FEF08E0801638F0B1F02FD11FEF08E019 +:100C9000801AA394F6CF882079F016958A94E9F704 +:100CA0001095662341F02227169527956A95E1F75E +:100CB0001CD1A394122F19D157DF7A9400277012F8 +:100CC000C2CF0895009158010A950230D0F30091E7 +:100CD00059010330B0F3009156010395009352017E +:100CE0000091570100935301809058018A948A948F +:100CF0008092540101E0009355018FDF009156016D +:100D00000093520180905801809254013AC00091A2 +:100D100058010A950230A8F200915901033088F277 +:100D200000915601039500935201009157010093E1 +:100D30005301809058018A948A948092540101E072 +:100D4000009355016ADF0091560100935201009112 +:100D50005701039500935301709059017A947A9446 +:100D60007092550101E00093540157DF80905801C3 +:100D700000915601080D0A950093520101E000937D +:100D8000540100915701039500935301709059014C +:100D90007A947A947092550140DF00915601039540 +:100DA00000935201809058018A948A948092540151 +:100DB0007090590100915701070D0A950093530156 +:100DC00001E00093550129CF1FB60F930FEDC02E00 +:100DD000EF93FF93E42DE05AFF270081FF91EF91FD +:100DE0000CB95A9443940FE140226A940AF04CC023 +:100DF00051C01FB60F930FEDC02E0CB15C993EC0D1 +:100E0000E7FC2CC0E6FC0EC0023031F403E009B967 +:100E1000539A00E4E02A3EC00A3A19F400E0009335 +:100E20006A0138C0602E00E803190AF40FE7662053 +:100E300012F4052D00680CB9061508F4602E062D75 +:100E40000F7739F000ECE02A6A9422F55798559A0A +:100E500021C00FEBE022569A5E9A1CC0EF93FF93DD +:100E6000E32DE20DEF77E058FF270083FF91EF912C +:100E700033946A947AF40CC01FB60F9353980FE51D +:100E800009B90FEBE022CC2455985698579A0CB12B +:100E90000FE7E0220F911FBE1895AA2400EFA01AB9 +:100EA00067FFAA246F77685014F0A394FCCF685FA3 +:100EB00008953C2F3F7335BB3D2F330F330FC7FBD6 +:100EC00031F9C6FB30F93BBBF894C39AC3987894C8 +:100ED0003093180100270ABBF894C0980000C09A0C +:100EE00009B278940FEF0ABB08953A2D3F7335BBD2 +:100EF0003D2F330F330FA7FA31F9A6FA30F93BBB78 +:100F0000F894C39AC39878943093180100270ABBC9 +:100F1000F894C0980000C09AF9B278940FEF0ABB19 +:100F2000B1FE03C01095F12203C0F126B0FCF12AF6 +:100F30003A2D3F7335BB3D2F330F330FA7FA31F9ED +:100F4000A6FA30F93BBBF894C39AC39878943093CF +:100F50001801FBBAF894C198C0980000C09A789420 +:100F6000C19A0895772788279924C0E0D0E218E134 +:100F7000D4D3AA24A0920001109100011C2B312F80 +:100F80003F7335BB3D2F330F330F17FB31F916FB82 +:100F900030F93BBBF894C39AC39878943093180106 +:100FA00000E00BBBF894C198C0980000C09A7894F8 +:100FB000C19AA39400E2A01619F0A0920001DCCF20 +:100FC000D3DD9394C05CDF4FD03409F0D2CF0895C5 +:100FD00018951FB68B9A4CB55DB550930901409397 +:100FE000080114C11FB65AB35F935BB35F9355B347 +:100FF0005F93509118015F935FEF5ABB50E75FBD5D +:101000004CB55DB5485F5F4F5BBD4ABD59BD48BD3E +:1010100040914C0150914D015170452B49F4509134 +:101020006B01539550936B0151F45FEBB5222DC9C1 +:1010300000000000000000000000000000008B9A8B +:10104000939A55275EBD5DBD5CBD50914D01542BFB +:1010500071F0509117015BBBC49ADD9ADD98C4987A +:101060000000000000000000000000000EC05091D1 +:101070001701506850625BBBC49A40E654275BBBC3 +:101080005F775BBBC49850931701509117015F9332 +:10109000EF93FF93E0914C01F0914D01E05CFF4F25 +:1010A000FF713F933E2F3F7335BB3F2F330F330FFD +:1010B000E7FB31F9E6FB30F93BBBC39AC398F093E9 +:1010C000180130911701F7FB31F9F6FB30F93BBB02 +:1010D000C49AC498309317013F91C198C19A9798C8 +:1010E00044274ABB40EC44BBC09855275BBD5ABD62 +:1010F00059E05EBDE0934C01F0934D01FF91EF91FB +:101100005CE35A95F1F7C09A5FEF5ABB979A54BBCC +:101110008D98959851E000005EBD5BE05A95F1F71F +:1011200050910D0140910C018D9A859907C04A3369 +:101130009DEF590752F0415050400BC0453D9FEF85 +:1011400059071AF44F5F5F4F04C000000000000011 +:10115000000050930D0140930C015BBD4ABD4091CE +:101160000C0150910D0190910E01491B90910F01BE +:10117000590B1AF445ED5FEF04C04CEA5EEF000036 +:10118000000059BD48BD52E053BF5DEE52BF51E073 +:10119000509368015DEF5DBD54E35CBD8B989398FF +:1011A00050EE5FBD21C01FB65AB35F935BB35F9330 +:1011B00055B35F93509118015F93509117015F935E +:1011C000FF93EF930F925FEF5ABB509168015395D5 +:1011D000509368015A95E1F05A9511F15A9509F426 +:1011E00089C00F90EF91FF915F915BBBC49AC49847 +:1011F000509317015F915BBBC39AC398509318013A +:101200005F9155BB5F915BBB5F915ABB1FBE189549 +:1012100053E053BF50EF52BF51E05093680153C1A8 +:1012200050911001552399F150911101505118F02E +:10123000509311012CC0452F429554235093110116 +:101240004091190143FF10C0509110015A955093DD +:101250001001A1F050911901577F546055BBC29AFB +:10126000C2985093190113C05091190158605B7FC7 +:1012700055BBC29AC2985093190109C050911901E7 +:10128000577F5B7F55BBC29AC2985093190150910A +:10129000690157FF06C050E8B5261AF4552753BF19 +:1012A000A0CF52E053BF52EF52BFEAE3F8E1552717 +:1012B000ED0DF51FC89554E3D51648F4509119016A +:1012C0005F7E55BBC29AC2985093190108C05091D5 +:1012D0001901506155BBC29AC298509319010BBABB +:1012E0000090190105BAA99AC29AC298A998C29AFF +:1012F000C29877CF50B340EE4BBB4091190145BB2C +:10130000A99AC29AC298A998C29AC298889456FD7E +:1013100008C050911301552319F054E05093130164 +:1013200008944FB754E3D51660F44FBFE091150110 +:10133000F0911601EE1FFF1FE0931501F0931601C7 +:101340007BC04FBF08F078C050911301552321F0A6 +:1013500054E05093130170C0F0911601E091150113 +:1013600050911401552329F0452FF795E7954450E6 +:10137000E1F75C5FF795E79518F05433D0F35CC064 +:101380005093140144E3451BECE3F8E15527E40FC7 +:10139000F51FC895402D000C000C000C400D000CF2 +:1013A000400DECE3F8E15527ED0DF51FC895400D14 +:1013B000E0E0F0EE5527E40FF51F3F933E2F3F731B +:1013C00035BB3F2F330F330FE7FB31F9E6FB30F925 +:1013D0003BBBC39AC398F093180130911701F7FBF8 +:1013E00031F9F6FB30F93BBBC49AC498309317012E +:1013F0003F910F9300270ABBC0980000C09A09B222 +:101400000FEF0ABB0F91002029F4509114015433BF +:1014100098F45EC054E0509313010092070156E324 +:1014200050931001552D5F3138F41F93102D8DDA34 +:101430001B3109F48ADA1F9154E0D50E50916901ED +:1014400057FD27C053E053BF50EF52BF51E05093B8 +:10145000680144E3D416E8F250E053BF50911601FE +:1014600040911501452B50916A01543018F45130C8 +:1014700028F4B7CE442329F055E003C0442309F4EF +:1014800054E05A9550936A01A1F75FEBB5228A9810 +:10149000CECD50E053BF5093140148ECD416C0F0A9 +:1014A00050911301552379F05A955093130159F433 +:1014B00050910701552339F0552D503220F41F93D8 +:1014C00010E043DA1F91DD24D0921501D09216016D +:1014D000EAE3F8E131965527ED0DF51FC8955091D7 +:1014E0006901507850645029509369015BBB509159 +:1014F000190155BBA89AC29AC298A898C29AC298D4 +:1015000070CE9924C0E0D0E2A0E0B0E218E105D1AD +:10151000A05CBF4F0A94E1F720E22F93C8D0E3D03C +:10152000A395C3952F912A9509F0F7CF1DDB9394CE +:10153000A0969096B03409F0EFCF1BCDDFD91F9362 +:10154000DDD910937201DAD916951695169509F41E +:1015500010E210937501D2D910937601172F1695CA +:1015600016951695109373018093740118E1D5D0E8 +:101570001F9110FD46C0CC27D09174019D2ED695A9 +:10158000C795D695C79510917301C10FD05E209174 +:10159000760110917201121720F5211BAA27B09134 +:1015A0007401B10FB695A795B695A79510917301E3 +:1015B000A10FB05E2F93AF93BF93CF93DF93209192 +:1015C000750168D0D1DADF91CF91BF91AF912F91A2 +:1015D0009394A05CBF4FC05CDF4F2A9559F72091D0 +:1015E00072012F93CF93DF93209175015AD0BCDA0B +:1015F000DF91CF912F919394C05CDF4F2A9589F7AB +:1016000006CBCC27D091740100917601D00F9D2E8E +:10161000D695C795D695C79510917301C10FD05E29 +:10162000202F10917201121728F5211BAA27B091C3 +:101630007401B00FB11BB695A795B695A7951091FB +:101640007301A10FB05E9A94A054B040C054D04032 +:101650002F93AF93BF93CF93DF93209175011AD04F +:1016600083DADF91CF91BF91AF912F912A9559F7EE +:10167000209172019A94C054D0402F93CF93DF935E +:10168000209175010ED070DADF91CF912F912A95BC +:1016900089F7BDCA0CD0119626D021962A95D1F78C +:1016A000089510E020D021962A95E1F708953A2F69 +:1016B0003F7335BB3B2F330F330FA7FB31F9A6FB2D +:1016C00030F93BBBF894C39AC398789430931801CF +:1016D00000270ABBF894C0980000C09A19B3789408 +:1016E0000FEF0ABB08953C2F3F7335BB3D2F330FDF +:1016F000330FC7FB31F9C6FB30F93BBBF894C39AF3 +:10170000C3987894309318011BBBF894C198C09883 +:101710000000C09A7894C19A0895F8943091170106 +:101720003127307E31273BBBC49AC49878943093DC +:10173000170108951FB650915F015C5550935F01EA +:10174000509160015F4F5093600150916101564E7E +:10175000543650F4509361011FBEB6FE189550E008 +:101760005093680120CDF1C850E050936101509131 +:10177000620153955C33E8F15091630153955C33FA +:10178000A8F1509164015395583168F1EF93FF939C +:101790000F92EDE2F8E190916601E90F90E0F91FF8 +:1017A000C895902D9C3131F49091670193709CE124 +:1017B00009F49DE10F90FF91EF9150916501591748 +:1017C00070F0509166015C3030F050916701539594 +:1017D00050936701552753955093660155275395AC +:1017E0005093650155275093640155275093630129 +:1017F000552750936201552D5931C0F41F931BE1B9 +:10180000A4D814E5A2D810916401ADDF1091630152 +:10181000AADF10916201A7DF10916601A4DF109189 +:101820006501A1DF109167019EDF1F9195CF1F1CFD +:101830001F1E1F1E1F1F1E1F1E1FF0340000E83436 +:101840000100F0330100E8330200E4330300E83222 +:101850000300E4320400E2320500E4310500E23125 +:101860000600E1310700E2300700E1300800C12A3C +:101870000000C22A0100C12B0100C22B0200C42BB0 +:101880000300C22C0300C42C0400C82C0500C4189B +:101890000500C8180600D0180700C8190700D0199D +:1018A0000800A1190900D01A0900A11A0A00A21AF9 +:1018B0000B00A11B0B00A21B0C00A41B0D00A21C03 +:1018C0000D00A41C0E00A81C0F00A41D0F00A81DD5 +:1018D0001000B01D1100A81E1100B01E1200611EE4 +:1018E0001300B01F1300611F1400621F1500612850 +:1018F0001500622816006428170062291700642961 +:1019000018000000000000000000000000000000BF +:1019100000000000000000000808080000000000AF +:1019200000000000000000000000000000000000B7 +:10193000000000007E00310032003300340035002A +:10194000360037003800390030002D003D0000001F +:101950000000000000000000000000000000000087 +:1019600000000000000051005700450052005400E4 +:101970005900550049004F0050005B005D005C00BD +:101980000000000000000000000000000000000057 +:101990000000000000000000410053004400460029 +:1019A000470048004A004B004C003B0027000D0D4B +:1019B0000D0000000000000000000000000000001A +:1019C0000000000000000000000000005A00580065 +:1019D0004300560042004E004D002C002E002F0008 +:1019E0000000000046323444303331393033313274 +:1019F000313730394C034C034C034C034C034C033C +:101A00004C034C034C034C034C034C034C034C035E +:101A10004C034C034C034C034C034C034C034C034E +:101A20004C034C034C034C034C034C034C034C033E +:101A30004C034C0300014C034C034C034C034C037C +:101A40004C034C034C034C034C034C034C03030169 +:101A50004C034C0306010F01180121012A01330137 +:101A60003C0145014E0157014C034C034C034C0310 +:101A70004C034C034C036001690172017B0184013A +:101A80008D0196019F01A901B201BB01C401CD01E5 +:101A9000D601DF01E801F101080211021A02230256 +:101AA0002C0235023E02470250024C034C034C0309 +:101AB0004C034C034C03590262026B0274027D0218 +:101AC00086028F029902A302AD02B802C202CB02C3 +:101AD000D402DD02E602F002FC0203030C0315034C +:101AE0001E0327033003390343034C034C034C0309 +:101AF0004C034C030003066101F80107708898A8A5 +:101B0000C88870010720602020202070010770889D +:101B100008102040F80107F810201008887001070D +:101B200010305090F810100107F880F00808887005 +:101B30000107304080F08888700107F808102040C5 +:101B40004040010770888870888870010770888815 +:101B500078081060010770888888F888880107F085 +:101B60008888F08888F001077088808080887001FC +:101B700007E09088888890E00107F88080F08080F6 +:101B8000F80107F88080F08080800107708880B8B5 +:101B90008888780107888888F888888802210780E3 +:101BA000808080808080010708080808088870010C +:101BB000078890A0C0A090880107808080808080E6 +:101BC000F8010788D8A8A888888801078888C8A845 +:101BD0009888880107708888888888700107F0884D +:101BE00088F0808080010770888888A890684C03FE +:101BF0004C034C03060801014F0065030107F08800 +:101C000088F0A090880107708880700888700107AC +:101C1000F820202020202001078888888888887064 +:101C20000107888888888850200107888888A8A8A4 +:101C3000A850010788885020508888010788888824 +:101C4000502020200107F80810204080F8010700EC +:101C500000700878887801078080F0888888F00113 +:101C600007000078808080780107080878888888D5 +:101C700078010700007088F8807001071820F820AC +:101C800020202001080000788888780870010780EB +:101C900080B0C8888888022107800080808080808A +:101CA0000521081000101010109060052107808099 +:101CB00090A0C0A090032107C04040404040400198 +:101CC000070000F0A8A8A8A801070000B0C88888ED +:101CD0008801070000708888887001080000F0887B +:101CE00088F080800108000078888878080802055C +:101CF0006105B0C08080800107000078807008F026 +:101D000001072020F820202018010700008888887B +:101D10009868010700008888885020010700008823 +:101D200088A8A850010700008850205088010800AA +:101D30000088888878087001070000F8102040F8B3 +:101D40000107F8F8F8F8F8F8F80070935601809356 +:101D50005701D4D510935801D1D51093590126D0ED +:101D6000E4C27093560180935701C8D5109358016F +:101D7000C5D5109359012FD0D8C2709352018093CA +:101D80005301BCD510935401B9D51093550178D0A7 +:101D9000CCC27093520180935301B0D5109354017B +:101DA000ADD51093550171D0C0C208950091560170 +:101DB0000093520100915701009353010091580183 +:101DC00000935401009159010093550102E0B02A9B +:101DD00024D70DEFB022009158010A95023028F364 +:101DE00000915901033008F300915601009352010C +:101DF0000091570100935301009158010093540141 +:101E000001E00093550109D700915601009352015A +:101E1000009157010395009353010091590102501D +:101E20000093550101E000935401F7D680905801CA +:101E300000915601080D0A950093520101E00093AC +:101E400054010091570103950093530100915901EA +:101E5000025000935501E1D60091560100935201C2 +:101E6000009158010093540170905901009157015D +:101E7000070D0A950093530101E000935501CDC66B +:101E800002E0B02ACAD60DEFB022789490905301A8 +:101E90006091520102D860930201A09200017090FB +:101EA0005501CC27D92D15E5D0FF1AEA012ED6957C +:101EB000C795D695C795D05E18E12FDC07C0C05CEA +:101EC000DF4F939460910201A0900001AC2A1FEFB4 +:101ED0008090540100E0801641F008E08016C8F0C0 +:101EE000662319F016956A95E9F71021FED708E0E8 +:101EF00010910201011B801AA3941FEF08E08016C5 +:101F000040F0C1F01021F1D71FEF08E0801AA39430 +:101F1000F5CF882089F016958A94E9F71095662305 +:101F200049F02227169527956A95E1F71021DDD70C +:101F3000A394122F1021D9D7009416D67A94002793 +:061F40007012BDCF0895F0 +:0220000002419B +:00000001FF diff --git a/src/avr/product/WPO15V1.HEX b/src/avr/product/WPO15V1.HEX new file mode 100644 index 00000000..4f579fba --- /dev/null +++ b/src/avr/product/WPO15V1.HEX @@ -0,0 +1,132 @@ +:020000020000FC +:020000000EC030 +:06001200DCC1A3C270C1B5 +:10001C0064C302E00EBF0FE50DBF00E808B9A89558 +:10002C000FE001BD0AE50093CC0000E00DB90AB960 +:10003C000FEF04BBC79ABE9AD79A8E9A929A939A4C +:10004C00959A8D9ADE98D69897988F9A94988C9AC0 +:10005C00C398BB9A9198899A07E00DD106E00BD111 +:10006C0005E009D104E007D101E005D100E003D19E +:10007C000FE509B908E10AB92AD10AEA0CB90CB999 +:10008C0029D1949A27D1949825D1949A0027E0E607 +:10009C00FF27019301930193EFEB019301930193DC +:1000AC00019301930193019301930093BC0000937E +:1000BC00CA000093BD000093BE0000E4008300E082 +:1000CC000093C80004E00093C9004427662711245C +:1000DC0088249924AA2455246624772402E00093CA +:1000EC00B70001E00093B3000093B4000093B50097 +:1000FC000093B6000093B8000093B9000093CB00B6 +:10010C0000E00093BA000093BB0000EF202E00EF3C +:10011C00402E02E003BF01E009BF0EB10FB108EEA3 +:10012C000DB900E00DBD0CBD0BBD0ABD01EC0FBD42 +:10013C0001E00EBD05E007B90EED06B9789402E0BA +:10014C001EE1E2E6F7E0A8D00091CC000A3509F0F8 +:10015C0066C041FD6FC043FD7AC040FFF5CF0091F2 +:10016C00CB00033041F0023091F002E01FE0EEE9E9 +:10017C00F7E092D006C002E01FE0EEEDF7E08CD085 +:10018C0000C003E01EE1E0E8F7E086D00FC002E01B +:10019C001CE0EEEAF7E080D003E01EE1E2E6F7E0D7 +:1001AC007BD003E01CE0EEEAF7E076D01CD00B31FC +:1001BC0009F0FCCF18D0043409F0F8CF14D0037038 +:1001CC0039F0013039F0023039F0033039F0EECF2C +:1001DC00969A05C0969803C0DF9A01C0DF9810E389 +:1001EC00100FE4CF78940091CC000A35C1F441FD96 +:1001FC0021C043FD2CC0F8949920A1F30091B300C9 +:10020C00093081F7EF93FF93E82DED59FF2700811B +:10021C009A948394EFE38E22FF91EF91189502E06C +:10022C001EE1E2E6F7E038D002E01FE0EEEEF7E088 +:10023C0033D00AC002E01EE1E2E6F7E02DD002E086 +:10024C001FE0EAEBF7E028D043FD01C0FDCF02E050 +:10025C001EE1E2E6F7E020D002E01FE0EAECF7E076 +:10026C001BD00AEF37D00A95E9F702E013E0EAED6C +:10027C00F7E012D0F6CFC39802FF919802FD919A45 +:10028C0029D001FF919801FD919A26D000FF9198F9 +:10029C0000FD919AC39A22C078940000F894AA2089 +:1002AC00D9F70093B400C895002D04D031961A9557 +:1002BC00D1F71895EF93FF93E92DEA0DE80DEF7345 +:1002CC00ED59FF270083FF91EF91A3940895E0EF80 +:1002DC00FAE006C0E8EC03C0E4E101C0E2E0F0E0C3 +:1002EC0020E02A95F1F73197E1F70895FFB666FD06 +:1002FC0022C03CB13125F2F0312552F0EF93FF933F +:10030C00EEEBF091B300EF0FFF273083FF91EF91ED +:10031C00131608F0132E6F7E6064312D3F7741F079 +:10032C0011202AF157986F7D3FEF232E606146C054 +:10033C0038EF40C03EC03091B600313019F031E09A +:10034C003093BB003CB1EF93FF93E62DE70DE50D29 +:10035C00EF70ED55FF273083E091B500F091B600BA +:10036C00EF1711F4639401C07394FF91EF913FEF79 +:10037C00232E1A940AF530EF232E60611FC0EF93E1 +:10038C00FF93EEEBF091B300EF0FFF2730813A951E +:10039C003083E82DED59FF273081FF91EF913CB967 +:1003AC003FEF232E9A9483943FE383221A9431F4E3 +:1003BC0003C030EF232E6F7E57986F79FFBE1895D0 +:1003CC00FFB63091BD007091BE00732B49F03150D7 +:1003DC003093BD003091BE0030403093BE0091F0A0 +:1003EC00442051F0439441F430E03DB93EB13FB16B +:1003FC0038EE3DB9D69A687F222011F02394B9F0DB +:10040C00FFBE189506CE67FD18C0890C3FE383220A +:10041C0099249092BA00EF93FF93EEEBF091B30016 +:10042C00EF0FFF2730E43083FF91EF9106C065FD9D +:10043C00EACF66FDA4CF64FD7AC038EF232E30914D +:10044C00BC00332359F03A953093BC0031F0C3987B +:10045C009198899A30E03AB9B1CFDBCD57983FE506 +:10046C0039B93091BA0039293A2939F43091B800A8 +:10047C003A9549F03093B80037C03091B9003A95AD +:10048C0091F03093B90030E13093B800992030915D +:10049C00B30041F4AA2041F09A2CAA243091B40064 +:1004AC003093B300393001F16F779920B9F4AA2059 +:1004BC0059F43091BA003A9542F43091B300339527 +:1004CC00393048F031E007C031E03093BA009A2C53 +:1004DC00AA243091B4003093B30025C031E030939E +:1004EC00BA003091B3001FC030E13093B90060689E +:1004FC003091BB00332331F03A953093BB003091EF +:10050C00B60011C03091B600772069F47091B70035 +:10051C003093B700372F313021F03395393008F054 +:10052C0032E03093B6003CB960616F7947CF30EF61 +:10053C00232E33E039B9392D67FF04C030E1361969 +:10054C00371930683CB9132E579A3CB1606236CFDC +:10055C00FFB6D6983FB162FD8EC060FD5EC061FDF6 +:10056C0057C03A3090F1303899F0313899F0313930 +:10057C00A1F0323991F0333981F0353A99F03A3AA9 +:10058C00E1F0353CD9F030E03DB944244260A3C0E1 +:10059C0097989FC04160979A9CC030593093CB007C +:1005AC00416097C03FEF3093BC0030E03DB9949868 +:1005BC003FEF70E07BBD3ABD8CC02BCD38EE309355 +:1005CC00BD0033E03093BE0084C0332379F46860FF +:1005DC00662049F47720C1F0672C77243090B60060 +:1005EC003092B50012C03090B5000FC0677F332E2B +:1005FC00AA2021F03091B400331531F431E030935E +:10060C00BA003092B40001C033243FB8626061C0BC +:10061C006D7F332009F061605CC0332E6E7F332018 +:10062C0063FF05C05AF5362D30681FC051C0F2F378 +:10063C00EF93FF93EEEBF091B400EF0FFF273081B7 +:10064C00E091B300F091B400EF1731F0E0E4E91958 +:10065C003E1730F03E2F04C0303408F030E4391926 +:10066C003A19FF91EF910AF43FE7331508F4332E52 +:10067C003FB964602EC033208AF43A944AF5616025 +:10068C00EF93FF93E52DED55FF2730813FB9FF9197 +:10069C00EF916A9453943FE053221BC060FF14C047 +:1006AC00EF93FF93E92DEA0DE80DEF73ED59FF275A +:1006BC003083E091B300F091B400EF1711F49394F0 +:1006CC0001C0A394FF91EF913A9412F0616001C0C4 +:1006DC006B7F30EF432EFFBE1895FFB6A89534B153 +:1006EC00532F35B1379557953795579544FD12C013 +:1006FC0040613091BC00332331F530E070E05C5147 +:10070C0000F130E670E05038E0F45695352F5695F0 +:10071C00350F17C04F7E5093CA00583A30E074E042 +:10072C0058F43091C8007091C9003150704021F4D8 +:10073C0030E03DB9442448603093C8007093C90040 +:10074C0002C07BBD3ABD34E044FF35E037B93EED25 +:10075C0036B9FFBE18951B44301B47301B50311B5C +:10076C0045301B4B1B301B2F301B5300001B4E0006 +:10077C00801B45311B44301B47301B50311B45300F +:10078C001B4B1B301B2F301B5300001B4EF0401B10 +:10079C0045311B53100D48595445434820313030D6 +:1007AC0030001B53100D57504F33302056351B5310 +:1007BC00100D42414420434F4D4D414E44001B53BC +:1007CC00100D42415454455259204C4F57001B4D6B +:1007DC0030001B53100D48595445434820313530D7 +:1007EC0030001B53100D535441434B204F56455270 +:0407FC00464C4F57C1 +:042000000041BFAC30 +:00000001FF diff --git a/src/avr/product/WPOV0.HEX b/src/avr/product/WPOV0.HEX new file mode 100644 index 00000000..ef6e47ff --- /dev/null +++ b/src/avr/product/WPOV0.HEX @@ -0,0 +1,135 @@ +:020000020000FC +:020000000BC033 +:06000C00DBC1A2C26DC1C0 +:1000160063C30FED0DBF00E808B9A8950FE001BD59 +:100026000AE50093CD0000E00DB90AB9C59ABC9A5D +:100036008D9A8E9AAC9A929A939AC19AB99AC098C6 +:10004600B89897988F9A94988C9AAA98A29A919809 +:10005600899A07E00CD106E00AD105E008D104E050 +:1000660006D101E004D100E002D10FE809B908E1A8 +:100076000AB929D10AEA0CB90CB928D1949A0027F1 +:10008600E0E6FF27019301930193EFEB01930193C0 +:100096000193019301930193019301930093BC0093 +:1000A6000093CB000093BD000093BE0000E40083E4 +:1000B60000E00093C80004E00093C90000E100934B +:1000C600CA0044276627112488249924AA24552483 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CC0000E00093BA0000938F +:10010600BB0007EE202E07EE402E02E003BF02E002 +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1EEE8F7E0A8D0ED +:100146000091CD000A3509F066C041FD6FC043FD40 +:100156007AC040FFF5CF0091CC00033041F0023069 +:1001660091F002E01FE0EAECF7E092D006C002E070 +:100176001FE0EAE0F8E08CD000C003E01EE1ECEA04 +:10018600F7E086D00FC002E01CE0EAEDF7E080D091 +:1001960003E01EE1EEE8F7E07BD003E01CE0EAEDC9 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CD000A35C1F441FD21C043FD2CC0F89471 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1EEE8F7E038D085 +:1002260002E01FE0EAE1F8E033D00AC002E01EE196 +:10023600EEE8F7E02DD002E01FE0E6EEF7E028D08A +:1002460043FD01C0FDCF02E01EE1EEE8F7E020D05D +:1002560002E01FE0E6EFF7E01BD00AEF37D00A9581 +:10026600E9F702E013E0E6E0F8E012D0F6CFAA984C +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A27D000FF919800FD919AAA9A23C0CF +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895ECEDFFE007C0E2E2F1E0C0 +:1002D60004C0EDE101C0E3E0F0E020E02A95F1F78B +:1002E6003197E1F70895FFB666FD22C03CB131258E +:1002F600F2F0312552F0EF93FF93EEEBF091B3005D +:10030600EF0FFF273083FF91EF91131608F0132E9E +:100316006F7E6064312D3F7741F011202AF15798A6 +:100326006F7D3FEF232E606148C033EF42C040C06F +:100336003091B600313019F031E03093BB003CB15A +:10034600EF93FF93E62DE70DE50DEF70ED55FF27D3 +:100356003083E091B500F091B600EF1711F4639485 +:1003660001C07394FF91EF913EEF232E1A941AF574 +:1003760037EE232E606121C0EF93FF93EEEBF091F1 +:10038600B300EF0FFF2730813A953083E82DED5902 +:10039600FF273081FF91EF913CB93695330B3A95A3 +:1003A600232E9A9483943FE383221A9431F403C054 +:1003B60037EE232E6F7E57986F79FFBE1895FFB6DE +:1003C6003091BD007091BE00732B49F031503093CF +:1003D600BD003091BE0030403093BE0091F0442005 +:1003E60051F0439441F430E03DB93EB13FB138EEAF +:1003F6003DB9B89A687F222011F02394B9F0FFBE68 +:10040600189507CE67FD18C0890C3FE3832299240F +:100416009092BA00EF93FF93EEEBF091B300EF0FDB +:10042600FF2730E43083FF91EF9106C065FDEACFE8 +:1004360066FDA2CF64FD7AC033EF232E3091BC0057 +:10044600332359F03A953093BC0031F0AA9891982D +:10045600899A30E03AB9B1CFDCCD57983FE839B93F +:100466003091BA0039293A2939F43091B8003A95D1 +:1004760049F03093B80037C03091B9003A9591F001 +:100486003093B90030E13093B80099203091B30031 +:1004960041F4AA2041F09A2CAA243091B40030935A +:1004A600B300393001F16F779920B9F4AA2059F4D5 +:1004B6003091BA003A9542F43091B3003395393011 +:1004C60048F031E007C031E03093BA009A2CAA24F4 +:1004D6003091B4003093B30025C031E03093BA00B8 +:1004E6003091B3001FC030E13093B900606830919D +:1004F600BB00332331F03A953093BB003091B60000 +:1005060011C03091B600772069F47091B70030932E +:10051600B700372F313021F03395393008F032E00B +:100526003093B6003CB960616F7947CF37EE232E22 +:1005360035E039B9392D67FF04C030E1361937196E +:1005460030683CB9132E579A3CB1606236CFFFB67D +:10055600B8983FB162FD8EC060FD5EC061FD57C0B8 +:100566003A3090F1303899F0313899F03139A1F0BC +:10057600323991F0333981F0353A99F03A3AE1F06F +:10058600353CD9F030E03DB944244260A3C0979889 +:100596009FC04160979A9CC030593093CC0041600F +:1005A60097C03FEF3093BC0030E03DB994983FEFE1 +:1005B60070E07BBD3ABD8CC02CCD38EE3093BD00CB +:1005C60033E03093BE0084C0332379F4686066203C +:1005D60049F47720C1F0672C77243090B60030922A +:1005E600B50012C03090B5000FC0677F332EAA2029 +:1005F60021F03091B400331531F431E03093BA0074 +:100606003092B40001C033243FB8626061C06D7F90 +:10061600332009F061605CC0332E6E7F332063FFA8 +:1006260005C05AF5362D30681FC051C0F2F3EF935E +:10063600FF93EEEBF091B400EF0FFF273081E091CE +:10064600B300F091B400EF1731F0E0E4E9193E177A +:1006560030F03E2F04C0303408F030E439193A192E +:10066600FF91EF910AF43FE7331508F4332E3FB9B3 +:1006760064602EC033208AF43A944AF56160EF93A1 +:10068600FF93E52DED55FF2730813FB9FF91EF919F +:100696006A9453943FE053221BC060FF14C0EF934B +:1006A600FF93E92DEA0DE80DEF73ED59FF2730832F +:1006B600E091B300F091B400EF1711F4939401C0E8 +:1006C600A394FF91EF913A9412F0616001C06B7FA1 +:1006D60037EE432EFFBE1895FFB6A89534B1532FBB +:1006E60035B1379557953795579544FD12C04061FA +:1006F6003091BC003323C9F430E070E05C51C0F1A6 +:1007060030E670E05038A0F55695352F5695350FE2 +:100716002FC04F7E45FD0DC0583F40F03091CA00B6 +:100726003A953093CA0031F5406224C030E13093E7 +:10073600CA005093CB00593330E074E058F0309142 +:10074600C8007091C9003150704021F430E03DB9C5 +:10075600442448603093C8007093C900563450F062 +:100766003FEF3093BC0030E03DB994983FEF70E026 +:100776007BBD3ABD35E445FF34E044FF35E037B98B +:100786003EED36B9FFBE18951B44301B47301B5053 +:10079600311B45301B4B1B301B2F301B5300001BDE +:1007A6004E00801B45311B44301B47301B50311B0C +:1007B60045301B4B1B301B2F301B5300001B4EF0CC +:1007C600401B45311B53100D4859544543482031B1 +:1007D600303030001B53100D57504F3330205635F4 +:1007E6001B53100D42414420434F4D4D414E440092 +:1007F6001B53100D42415454455259204C4F57003B +:100806001B4D30001B53100D4859544543482031A9 +:10081600353030001B53100D535441434B204F5677 +:060826004552464C4F57FD +:042000000041B4AC3B +:00000001FF diff --git a/src/avr/product/WPOV1.HEX b/src/avr/product/WPOV1.HEX new file mode 100644 index 00000000..52ed13d4 --- /dev/null +++ b/src/avr/product/WPOV1.HEX @@ -0,0 +1,135 @@ +:020000020000FC +:020000000BC033 +:06000C00DBC1A2C26DC1C0 +:1000160063C30FED0DBF00E808B9A8950FE001BD59 +:100026000AE50093CD0000E00DB90AB9C59ABC9A5D +:100036008D9A8E9AAC9A929A939AC19AB99AC098C6 +:10004600B89897988F9A94988C9AAA98A29A919809 +:10005600899A07E00CD106E00AD105E008D104E050 +:1000660006D101E004D100E002D10FE809B908E1A8 +:100076000AB929D10AEA0CB90CB928D1949A0027F1 +:10008600E0E6FF27019301930193EFEB01930193C0 +:100096000193019301930193019301930093BC0093 +:1000A6000093CB000093BD000093BE0000E40083E4 +:1000B60000E00093C80004E00093C90000E100934B +:1000C600CA0044276627112488249924AA24552483 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CC0000E00093BA0000938F +:10010600BB0007EE202E07EE402E02E003BF02E002 +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1EEE8F7E0A8D0ED +:100146000091CD000A3509F066C041FD6FC043FD40 +:100156007AC040FFF5CF0091CC00033041F0023069 +:1001660091F002E01FE0EAECF7E092D006C002E070 +:100176001FE0EAE0F8E08CD000C003E01EE1ECEA04 +:10018600F7E086D00FC002E01CE0EAEDF7E080D091 +:1001960003E01EE1EEE8F7E07BD003E01CE0EAEDC9 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CD000A35C1F441FD21C043FD2CC0F89471 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1EEE8F7E038D085 +:1002260002E01FE0EAE1F8E033D00AC002E01EE196 +:10023600EEE8F7E02DD002E01FE0E6EEF7E028D08A +:1002460043FD01C0FDCF02E01EE1EEE8F7E020D05D +:1002560002E01FE0E6EFF7E01BD00AEF37D00A9581 +:10026600E9F702E013E0E6E0F8E012D0F6CFAA984C +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A27D000FF919800FD919AAA9A23C0CF +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895ECEDFFE007C0E2E2F1E0C0 +:1002D60004C0EDE101C0E3E0F0E020E02A95F1F78B +:1002E6003197E1F70895FFB666FD22C03CB131258E +:1002F600F2F0312552F0EF93FF93EEEBF091B3005D +:10030600EF0FFF273083FF91EF91131608F0132E9E +:100316006F7E6064312D3F7741F011202AF15798A6 +:100326006F7D3FEF232E606148C033EF42C040C06F +:100336003091B600313019F031E03093BB003CB15A +:10034600EF93FF93E62DE70DE50DEF70ED55FF27D3 +:100356003083E091B500F091B600EF1711F4639485 +:1003660001C07394FF91EF913EEF232E1A941AF574 +:1003760037EE232E606121C0EF93FF93EEEBF091F1 +:10038600B300EF0FFF2730813A953083E82DED5902 +:10039600FF273081FF91EF913CB93695330B3A95A3 +:1003A600232E9A9483943FE383221A9431F403C054 +:1003B60037EE232E6F7E57986F79FFBE1895FFB6DE +:1003C6003091BD007091BE00732B49F031503093CF +:1003D600BD003091BE0030403093BE0091F0442005 +:1003E60051F0439441F430E03DB93EB13FB138EEAF +:1003F6003DB9B89A687F222011F02394B9F0FFBE68 +:10040600189507CE67FD18C0890C3FE3832299240F +:100416009092BA00EF93FF93EEEBF091B300EF0FDB +:10042600FF2730E43083FF91EF9106C065FDEACFE8 +:1004360066FDA2CF64FD7AC033EF232E3091BC0057 +:10044600332359F03A953093BC0031F0AA9891982D +:10045600899A30E03AB9B1CFDCCD57983FE839B93F +:100466003091BA0039293A2939F43091B8003A95D1 +:1004760049F03093B80037C03091B9003A9591F001 +:100486003093B90030E13093B80099203091B30031 +:1004960041F4AA2041F09A2CAA243091B40030935A +:1004A600B300393001F16F779920B9F4AA2059F4D5 +:1004B6003091BA003A9542F43091B3003395393011 +:1004C60048F031E007C031E03093BA009A2CAA24F4 +:1004D6003091B4003093B30025C031E03093BA00B8 +:1004E6003091B3001FC030E13093B900606830919D +:1004F600BB00332331F03A953093BB003091B60000 +:1005060011C03091B600772069F47091B70030932E +:10051600B700372F313021F03395393008F032E00B +:100526003093B6003CB960616F7947CF37EE232E22 +:1005360035E039B9392D67FF04C030E1361937196E +:1005460030683CB9132E579A3CB1606236CFFFB67D +:10055600B8983FB162FD8EC060FD5EC061FD57C0B8 +:100566003A3090F1303899F0313899F03139A1F0BC +:10057600323991F0333981F0353A99F03A3AE1F06F +:10058600353CD9F030E03DB944244260A3C0979889 +:100596009FC04160979A9CC030593093CC0041600F +:1005A60097C03FEF3093BC0030E03DB994983FEFE1 +:1005B60070E07BBD3ABD8CC02CCD38EE3093BD00CB +:1005C60033E03093BE0084C0332379F4686066203C +:1005D60049F47720C1F0672C77243090B60030922A +:1005E600B50012C03090B5000FC0677F332EAA2029 +:1005F60021F03091B400331531F431E03093BA0074 +:100606003092B40001C033243FB8626061C06D7F90 +:10061600332009F061605CC0332E6E7F332063FFA8 +:1006260005C05AF5362D30681FC051C0F2F3EF935E +:10063600FF93EEEBF091B400EF0FFF273081E091CE +:10064600B300F091B400EF1731F0E0E4E9193E177A +:1006560030F03E2F04C0303408F030E439193A192E +:10066600FF91EF910AF43FE7331508F4332E3FB9B3 +:1006760064602EC033208AF43A944AF56160EF93A1 +:10068600FF93E52DED55FF2730813FB9FF91EF919F +:100696006A9453943FE053221BC060FF14C0EF934B +:1006A600FF93E92DEA0DE80DEF73ED59FF2730832F +:1006B600E091B300F091B400EF1711F4939401C0E8 +:1006C600A394FF91EF913A9412F0616001C06B7FA1 +:1006D60037EE432EFFBE1895FFB6A89534B1532FBB +:1006E60035B1379557953795579544FD12C04061FA +:1006F6003091BC003323C9F430E070E05C51C0F1A6 +:1007060030E670E05038A0F55695352F5695350FE2 +:100716002FC04F7E45FD0DC0583F40F03091CA00B6 +:100726003A953093CA0031F5406224C030E13093E7 +:10073600CA005093CB00593330E074E058F0309142 +:10074600C8007091C9003150704021F430E03DB9C5 +:10075600442448603093C8007093C900563450F062 +:100766003FEF3093BC0030E03DB994983FEF70E026 +:100776007BBD3ABD35E445FF34E044FF35E037B98B +:100786003EED36B9FFBE18951B44301B47301B5053 +:10079600311B45301B4B1B301B2F301B5300001BDE +:1007A6004E00801B45311B44301B47301B50311B0C +:1007B60045301B4B1B301B2F301B5300001B4EF0CC +:1007C600401B45311B53100D4859544543482031B1 +:1007D600303030001B53100D57504F3330205635F4 +:1007E6001B53100D42414420434F4D4D414E440092 +:1007F6001B53100D42415454455259204C4F57003B +:100806001B4D30001B53100D4859544543482031A9 +:10081600353030001B53100D535441434B204F5677 +:060826004552464C4F57FD +:042000000041BCAC33 +:00000001FF diff --git a/src/avr/product/WPOV2.HEX b/src/avr/product/WPOV2.HEX new file mode 100644 index 00000000..3a2161e2 --- /dev/null +++ b/src/avr/product/WPOV2.HEX @@ -0,0 +1,131 @@ +:020000020000FC +:020000000BC033 +:06000C00D8C19FC26CC1C7 +:1000160060C30FED0DBF00E808B9A8950FE001BD5C +:100026000AE50093CC0000E00DB90AB9C59ABC9A5E +:100036008D9A8E9A929A939AC19AB99AC098B898BC +:1000460097988F9A94988C9AAA98A29A9198899A36 +:1000560007E00DD106E00BD105E009D104E007D198 +:1000660001E005D100E003D10FE509B908E10AB9BD +:100076002AD10AEA0CB90CB929D1949A27D19498B5 +:1000860025D1949A0027E0E6FF2701930193019377 +:10009600EFEB019301930193019301930193019374 +:1000A60001930093BC000093CA000093BD00009327 +:1000B600BE0000E4008300E00093C80004E0009363 +:1000C600C90044276627112488249924AA24552484 +:1000D6006624772402E00093B70001E00093B300A2 +:1000E6000093B4000093B5000093B6000093B800E7 +:1000F6000093B9000093CB0000E00093BA00009390 +:10010600BB0000EF202E00EF402E02E003BF02E00E +:1001160009BF0EB10FB108EE0DB900E00DBD0CBD63 +:100126000BBD0ABD01EC0FBD01E00EBD05E007B930 +:100136000EED06B9789402E01EE1E4E5F7E0A8D0FA +:100146000091CC000A3509F066C041FD6FC043FD41 +:100156007AC040FFF5CF0091CB00033041F002306A +:1001660091F002E01FE0E0E9F7E092D006C002E07D +:100176001FE0E0EDF7E08CD000C003E01EE1E2E70F +:10018600F7E086D00FC002E01CE0E0EAF7E080D09E +:1001960003E01EE1E4E5F7E07BD003E01CE0E0EAE3 +:1001A600F7E076D01CD00B3109F0FCCF18D0043420 +:1001B60009F0F8CF14D0037039F0013039F002306D +:1001C60039F0033039F0EECF969A05C0969803C001 +:1001D600959A01C0959810E3100FE4CF789400919A +:1001E600CC000A35C1F441FD21C043FD2CC0F89472 +:1001F6009920A1F30091B300093081F7EF93FF93A3 +:10020600E82DED59FF2700819A948394EFE38E221F +:10021600FF91EF91189502E01EE1E4E5F7E038D092 +:1002260002E01FE0E0EEF7E033D00AC002E01EE194 +:10023600E4E5F7E02DD002E01FE0ECEAF7E028D095 +:1002460043FD01C0FDCF02E01EE1E4E5F7E020D06A +:1002560002E01FE0ECEBF7E01BD00AEF37D00A957F +:10026600E9F702E013E0ECECF7E012D0F6CFAA983B +:1002760002FF919802FD919A29D001FF919801FD04 +:10028600919A26D000FF919800FD919AAA9A22C0D1 +:1002960078940000F894AA20D9F70093B400C89582 +:1002A600002D04D031961A95D1F71895EF93FF9348 +:1002B600E92DEA0DE80DEF73ED59FF270083FF9155 +:1002C600EF91A3940895E0EFFAE006C0E8EC03C0CE +:1002D600E4E101C0E2E0F0E020E02A95F1F7319791 +:1002E600E1F70895FFB666FD22C03CB13125F2F074 +:1002F600312552F0EF93FF93EEEBF091B300EF0F41 +:10030600FF273083FF91EF91131608F0132E6F7EAF +:100316006064312D3F7741F011202AF157986F7DA7 +:100326003FEF232E606146C038EF40C03EC030919B +:10033600B600313019F031E03093BB003CB1EF9399 +:10034600FF93E62DE70DE50DEF70ED55FF273083A2 +:10035600E091B500F091B600EF1711F4639401C077 +:100366007394FF91EF913FEF232E1A940AF530EF25 +:10037600232E60611FC0EF93FF93EEEBF091B30065 +:10038600EF0FFF2730813A953083E82DED59FF278F +:100396003081FF91EF913CB93FEF232E9A948394DD +:1003A6003FE383221A9431F403C030EF232E6F7E8D +:1003B60057986F79FFBE1895FFB63091BD007091C2 +:1003C600BE00732B49F031503093BD003091BE0012 +:1003D60030403093BE0091F0442051F0439441F4F4 +:1003E60030E03DB93EB13FB138EE3DB9B89A687FCD +:1003F600222011F02394B9F0FFBE18950ACE67FDAE +:1004060018C0890C3FE3832299249092BA00EF9397 +:10041600FF93EEEBF091B300EF0FFF2730E430834C +:10042600FF91EF9106C065FDEACF66FDA4CF64FD9E +:100436007AC038EF232E3091BC00332359F03A9519 +:100446003093BC0031F0AA989198899A30E03AB975 +:10045600B1CFDFCD57983FE539B93091BA00392988 +:100466003A2939F43091B8003A9549F03093B800FA +:1004760037C03091B9003A9591F03093B90030E128 +:100486003093B80099203091B30041F4AA2041F08E +:100496009A2CAA243091B4003093B300393001F17C +:1004A6006F779920B9F4AA2059F43091BA003A9599 +:1004B60042F43091B3003395393048F031E007C04B +:1004C60031E03093BA009A2CAA243091B4003093CC +:1004D600B30025C031E03093BA003091B3001FC09D +:1004E60030E13093B90060683091BB00332331F0BE +:1004F6003A953093BB003091B60011C03091B600EA +:10050600772069F47091B7003093B700372F3130F8 +:1005160021F03395393008F032E03093B6003CB91B +:1005260060616F7947CF30EF232E33E039B9392D2B +:1005360067FF04C030E13619371930683CB9132E0D +:10054600579A3CB1606236CFFFB6B8983FB162FDAC +:100556008EC060FD5EC061FD57C03A3090F1303804 +:1005660099F0313899F03139A1F0323991F03339B7 +:1005760081F0353A99F03A3AE1F0353CD9F030E07D +:100586003DB944244260A3C097989FC04160979AA2 +:100596009CC030593093CB00416097C03FEF3093F9 +:1005A600BC0030E03DB994983FEF70E07BBD3ABDAA +:1005B6008CC02FCD38EE3093BD0033E03093BE00B3 +:1005C60084C0332379F46860662049F47720C1F04B +:1005D600672C77243090B6003092B50012C0309068 +:1005E600B5000FC0677F332EAA2021F03091B400EA +:1005F600331531F431E03093BA003092B40001C0C3 +:1006060033243FB8626061C06D7F332009F06160BA +:100616005CC0332E6E7F332063FF05C05AF5362D3E +:1006260030681FC051C0F2F3EF93FF93EEEBF091E9 +:10063600B400EF0FFF273081E091B300F091B400D2 +:10064600EF1731F0E0E4E9193E1730F03E2F04C011 +:10065600303408F030E439193A19FF91EF910AF471 +:100666003FE7331508F4332E3FB964602EC03320BC +:100676008AF43A944AF56160EF93FF93E52DED55C0 +:10068600FF2730813FB9FF91EF916A9453943FE081 +:1006960053221BC060FF14C0EF93FF93E92DEA0DB0 +:1006A600E80DEF73ED59FF273083E091B300F09129 +:1006B600B400EF1711F4939401C0A394FF91EF9146 +:1006C6003A9412F0616001C06B7F30EF432EFFBE9B +:1006D6001895FFB6A89534B1532F35B13795579570 +:1006E6003795579544FD12C040613091BC003323C5 +:1006F60031F530E070E05C5100F130E670E05038E2 +:10070600E0F45695352F5695350F17C04F7E50930A +:10071600CA00583A30E074E058F43091C80070913D +:10072600C9003150704021F430E03DB9442448609E +:100736003093C8007093C90002C07BBD3ABD34E057 +:1007460044FF35E037B93EED36B9FFBE18951B4478 +:10075600301B47301B50311B45301B4B1B301B2FAA +:10076600301B5300001B4E00801B45311B44301BC1 +:1007760047301B50311B45301B4B1B301B2F301B8A +:100786005300001B4EF0401B45311B53100D4859BA +:10079600544543482031303030001B53100D57501C +:1007A6004F33302056351B53100D42414420434FE2 +:1007B6004D4D414E44001B53100D42415454455279 +:1007C60059204C4F57001B4D30001B53100D4859F4 +:1007D600544543482031353030001B53100D5354D7 +:0C07E60041434B204F564552464C4F57A4 +:042000000041BCAC33 +:00000001FF diff --git a/src/avr/putpcx.asm b/src/avr/putpcx.asm new file mode 100644 index 00000000..fb026e1e --- /dev/null +++ b/src/avr/putpcx.asm @@ -0,0 +1,79 @@ +; PUTPCX.ASM + +EXTRN GETSTRLOC:FAR + +CODE SEGMENT + + ASSUME CS:CODE,DS:CODE + +B EQU BYTE PTR +W EQU WORD PTR +D EQU DWORD PTR + + LOCALS + +MISC_ADDR EQU 3C2H +SEQU_ADDR EQU 3C4H +CRTC_ADDR EQU 3D4H + +; GET$ #1,32700,F$ +; CALL PUTPCX(F$) + +PUBLIC PUTPCX + +PUTPCX: PUSH BP + MOV BP,SP + PUSH SI + PUSH DI + PUSH DS + PUSH ES + PUSHF + + LDS SI,[BP+6] ; DS:SI -> F$ DESCRIPTOR + LODSW + PUSH AX + CALL GETSTRLOC + XCHG SI,AX + MOV DS,DX ; DS:SI -> F$ DATA + + MOV DX,SEQU_ADDR + MOV AX,0F02H + OUT DX,AX + MOV AX,0A000H + MOV ES,AX + SUB DI,DI + + MOV DX,[SI+10] ; YMAX + SUB DX,[SI+6] ; -YMIN + MOV BP,[SI+66] ; BYTES PER LINE + ADD SI,80H + +@@LINE: MOV BX,BP +@@PCX: LODSB + MOV CX,1 + CMP AL,0C0H + JB @@SNGL + AND AX,3FH + XCHG CX,AX + LODSB +@@SNGL: SUB BX,CX + REP STOSB + JA @@PCX + MOV CX,640/8 + SUB CX,BP + MOV AL,0FFH + REP STOSB + DEC DX + JNZ @@LINE + + POPF + POP ES + POP DS + POP DI + POP SI + POP BP + RETF 4 + +CODE ENDS + END + \ No newline at end of file diff --git a/src/avr/set00.pcx b/src/avr/set00.pcx new file mode 100644 index 00000000..33bf29df Binary files /dev/null and b/src/avr/set00.pcx differ diff --git a/src/avr/ter.inc b/src/avr/ter.inc new file mode 100644 index 00000000..c566b9fd --- /dev/null +++ b/src/avr/ter.inc @@ -0,0 +1,211 @@ +; TER.INC + +; ----------------------------------------------------------------------------- +; TER FOREGROUND TASK + +.MACRO INT_HANDLERS + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + RJMP TX_EMPTY ; UART DATA REGISTER EMPTY HANDLER + ; THIS WILL CRASH IF INVOKED: + RJMP TX_COMPLETE ; UART TX COMPLETE HANDLER +.ENDMACRO + +.MACRO INIT_API_BUS + LDI A,TER_RATE ; 9600 BPS + OUT UBRR,A ; SET UART RATE + + LDI A,$98 ; ENABLE TX, AND RX WITH INTERRUPTS + OUT UCR,A + + CLR TX_PTR + CLR TX_COUNT + + CLR RX_PTR + CLR RX_COUNT + + ;CLR API_STATE + ;CLR API_REMAIN + ;CLR API_WATCHDOG +.ENDMACRO + +; ----------------------------------------------------------------------------- +; TER FOREGROUND ROUTINES + +.MACRO MRX_WAIT + TST RX_COUNT + BREQ RX_WAIT +.ENDMACRO + +.MACRO MRX_CHAR + PUSH YL + PUSH YH + + MOV YL,RX_PTR + SUBI YL,-RX_BUF + CLR YH + LD A,Y + + CLI + DEC RX_COUNT + INC RX_PTR + LDI YL,RX_SIZE-1 + AND RX_PTR,YL + + MOV YL,RX_COUNT + CPI YL,RX_SIZE-42 + BRSH MAY_BE_FULL + SBRC FLAGS,RXFULL ; IF BUFFER WAS FULL, + SBR FLAGS,1<42 BYTES LEFT, BUFFER IS NOT FULL +MAY_BE_FULL: + SEI + + POP YH + POP YL + RET +; FALL INTO MTX_WAIT FOR LOOPBACK TEST +.ENDMACRO + +.MACRO MTX_WAIT + PUSH A +TX_WAIT_LOOP: + MOV A,TX_COUNT + CPI A,TX_SIZE + BRSH TX_WAIT_LOOP + POP A +.ENDMACRO + +.MACRO MTX_CHAR + PUSH YL + PUSH YH + + IN YH,SREG + CLI + MOV YL,TX_COUNT + ADD YL,TX_PTR + OUT SREG,YH ;SEI + ANDI YL,TX_SIZE-1 + SUBI YL,-TX_BUF + CLR YH + ST Y,A + + IN YH,SREG + CLI + INC TX_COUNT + + SBI UCR,UDRIE ; ENABLE UART DATA REGISTER EMPTY INT + OUT SREG,YH ;SEI + + POP YH + POP YL +.ENDMACRO + +; ----------------------------------------------------------------------------- +; TER BACKGROUND ROUTINES + +.MACRO MTX_EMPTY + IN SR,SREG + PUSH F + + SBRS FLAGS,RXSEND + RJMP TX_TEST + + CBR FLAGS,1<42 BYTES LEFT, BUFFER IS NOT FULL +MAY_BE_FULL: + SEI + + POP YH + POP YL + RET +; FALL INTO MTX_WAIT FOR LOOPBACK TEST +.ENDMACRO + +.MACRO MTX_WAIT + PUSH A +TX_WAIT_LOOP: + MOV A,TX_COUNT + CPI A,TX_SIZE + BRSH TX_WAIT_LOOP + POP A +.ENDMACRO + +.MACRO MTX_CHAR + PUSH YL + PUSH YH + + IN YH,SREG + CLI + MOV YL,TX_COUNT + ADD YL,TX_PTR + OUT SREG,YH ;SEI + ANDI YL,TX_SIZE-1 + SUBI YL,-TX_BUF + CLR YH + ST Y,A + + IN YH,SREG + CLI + INC TX_COUNT + + SBI UCR,UDRIE ; ENABLE UART DATA REGISTER EMPTY INT + OUT SREG,YH ;SEI + + POP YH + POP YL +.ENDMACRO + +; ----------------------------------------------------------------------------- +; TER BACKGROUND ROUTINES + +.MACRO MTX_EMPTY + IN SR,SREG + PUSH F + + SBRS FLAGS,RXSEND + RJMP TX_TEST + + LDI F,~(1<>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + LDS R19,LATCH10_SAV ; AND THIS + EOR R19,@0 + ANDI R19,$E0 + EOR R19,@0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + SEI + STS LATCH10_SAV,R19 ; MUST BE ATOMIC DUE TO TOGGLING M +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@1 + ;POP @1 + + LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,1 + BST @1,6 ; A14 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + NOP + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO + OUT PORTA,@0 ; SELECT PHOTODIODE CHANNEL + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LED + OUT PORTA,@0 ; MAIN LED DRIVE PORT + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LEDLO + LDS D,LATCH12_SAV ; DRIVE LED COMMON LO + CBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO LEDHI + LDS D,LATCH12_SAV ; DRIVE LED COMMON HI + SBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKHI + LDS D,LATCH12_SAV ; DRIVE SPEAKER HI + SBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKLO + LDS D,LATCH12_SAV ; DRIVE SPEAKER LO + CBR D,1<<3 + SBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKOFF + LDS D,LATCH12_SAV ; DRIVE SPEAKER OFF + CBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FE00 ; ALL LONG PULSES IS FULLY DARK +;!!.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFC0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCC4 + +; WHEN VCC = $FCC4 FOR 6.0V: +.EQU CONTRAST_MIN =$FCA0 ; MIN IS FULLY DARK +.EQU CONTRAST_MAX =$FD00 ; MAX IS FULLY LIGHT +.EQU CONTRAST_INIT =$FCD0 + +; GENEROUS LIMITS FOR EXPERIMENTATION: +;.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FE10 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =10 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$20 +.EQU RX_SIZE =$80 + +.EQU TK_LED_PULSE =$1E ; 22US ?? CLOCKS OF /8 +.EQU TK_DELAY_0 =$38 ; 54US ?? CLOCKS OF /8 +.EQU TK_DELAY_1 =$28 ; CLOCKS OF /64, CHANNEL SELECT DELAY +.EQU TK_DELAY_2 =$00 ; CLOCKS OF /1024, VDD POWER ON DELAY + ; $D0 IS TOO SHORT, $E0 SEEMS TO WORK + +.EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU TER_RATE =$05 ; DIVISOR FOR 115200 BPS +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 UNUSED +.EQU RXFULL =6 ; PROVIDES HYSTERESIS FOR BUFFER FULL +.EQU RXSEND =7 ; SET WHEN IMMEDIATE XON/XOFF REQUIRED + +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +CHAR_X: .BYTE 1 +CHAR_Y: .BYTE 1 +CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC_64K: .BYTE 1 +TIME_HSEC_256: .BYTE 1 +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_STATE: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RJMP GO_TIM2_OVF ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_T1_OVERFLOW + RJMP GO_T0_OVERFLOW + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + LDI F,0 + STS TIME_HSEC_64K,F + STS TIME_HSEC_256,F + STS TIME_HSEC,F + STS TIME_SECOND,F + STS TIME_MINUTE,F + STS TIME_HOUR,F + LDI F,1 + STS DATE_DAY,F + STS DATE_MONTH,F + LDI F,20 + STS DATE_YEAR,F + +RESTART_ENTRY: +;**: + LDI F,8 ; TIMER 2 CLOCKED BY 32 KHZ +;** LDI F,0 ; TIMER 2 CLOCKED BY 11 MHZ + OUT ASSR,F +;**: + ; MUST MATCH SET_TIME ROUTINE % + LDI F,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;!! LDI F,$11 ; DIVIDE BY 2, TOGGLE OC2 (PIN 21) + ; (RTC DIAGNOSTIC) +;** LDI F,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,F + ; % + LDI F,$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + LDI F,$00 + OUT GIMSK,F + + LDI F,$B8 ; INIT_PORTS + OUT DDRD,F + OUT PORTD,F ; D2 = TRI-STATE, VSWT ON + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + OUT PORTC,F + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + + LDI D,$18 ; A18|A17|A16|A15|A14=11000 + OUT PORTA,D ; CL1=M=FLM=0 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + + CLR SCAN + STS ROW_INDEX,SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + + LDI D,$F4 ; BIT 6 = 1 VDD ON, BIT 7 = 1 LCD ON + STS LATCH5_SAV,D + PHOTO D + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +RTNCDE: LDIZ RTN_CODE ; POINT Z TO FLASH + LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER + LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + CLR R0 ; TEMPORARY CLEAR KB + RAMWRX R0 ; WRITE DATA TO DSPRAM + DEC XL + BREQ RTNCDE_END ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CDE1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CDE0 +RTNCDE_END: + + ; INITIALISE DEFAULT CHARACTER SET + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + ; CLEAR REFRESH BUFFER TO AVOID A BRIEF FLICKER + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL GO_SELECT_PAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +CLEAR_REFRESH: + PUSH B + PUSH YL + PUSH YH + + LDI B,32 + RCALL GO_CLEAR_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + ADIW YL,6 + LDI B,2 + RCALL GO_CLEAR_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP YH + POP YL + POP B + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE CLEAR_REFRESH + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,$40 ;$10 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + LDI A,0 + STS SCAN_STATE,A ; START ON FIRST LED / PHOTODIODE PAIR + + LDI A,0 + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + LDI F,$45 + OUT TIMSK,F ; TURN ON TIMER 0, 1, 2 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL HELLO_DISPLAY ; SHOW EXAMPLE DISPLAY + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + SBI PORTD,4 ; TURN TRANSISTOR OFF + CBI PORTD,5 ; DROP CL2 + + LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + LDI D,$74 ; BIT 6 = 1 VDD ON, BIT 7 = 0 LCD OFF + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;LDI D,$34 ; BIT 6 = 0 VDD OFF, BIT 7 = 0 LCD OFF + STS LATCH5_SAV,D + PHOTO D + + LDI D,$41 + OUT TIMSK,D ; DISABLE TIMER 1 INTERRUPTS + + LDI D,0 + OUT TCCR0,D ; DISABLE TIMER 0 TEMPORARILY ONLY + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + + LDI F,4 + STS TURNON_COUNT,F ; .25 SEC TO BREAK, .75 SEC TO MAKE + + INIT_API_BUS ; RESET UART TO RECEIVE TURNON COMMAND + +SLEEP_LOOP: + CLI + IN F,TCCR0 + TST F + LDI F,$4A ; SE=1 SM1:SM0=00 FOR IDLE MODE + BRNE SLEEP_SETUP ; TIMER 0 RUNNING, STAY IN IDLE MODE + SBIS PIND,0 ; BREAK OFF, UART ACTIVE, STAY IN IDLE + LDI F,$7A ; SE=1 SM1:SM0=11 FOR POWER SAVE MODE +SLEEP_SETUP: + OUT MCUCR,F + SEI + SLEEP + + LDS F,TURNON_COUNT + TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;SBIS PIND,0 ; AND BREAK HAS DISAPPEARED, WAKE UP + BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP + + CLI + RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + +; ----------------------------------------------------------------------------- + +ADRYP: LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL + OUT PORTA,YH + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +;HELLO_DISPLAY: +; LDI A,0 +; STS RECTNC_X,A +; STS RECTNC_Y,A +; STS RECTNC_XX,A +; LDI A,$80 +; STS RECTNC_YY,A +; RCALL DRAW_RECTNC +; +; LDI A,16 +; STS CHAR_X,A +; STS CHAR_Y,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; RCALL STRING_DRAW +; +; LDI A,240 +; STS CHAR_X,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; +;STRING_RIGHT_JUST: +; PUSH B +; PUSH ZL +; PUSH ZH +; RCALL STRING_WIDTH +; POP ZH +; POP ZL +; POP B +; LDS A,CHAR_X +; SUB A,R0 +; STS CHAR_X,A +; +;STRING_DRAW: +; PUSH B +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; PUSH R0 +; RCALL DRAW_CHAR +; POP R0 +; POP ZH +; POP ZL +; LDS A,CHAR_X +; ADD A,R0 +; STS CHAR_X,A +; POP B +; DEC B +; BRNE STRING_DRAW +; RET +; +;STRING_WIDTH: +; CLR R0 +;STRING_WIDTH_LOOP: +; PUSH B +; PUSH R0 +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; POP ZH +; POP ZL +; POP A +; ADD R0,A +; POP B +; DEC B +; BRNE STRING_WIDTH_LOOP +; RET +; +;HELLO_MESSAGE: .DB 'H','E','L','L','O',0 + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + RCALL RX_WAIT + + CPI A,$1B + BREQ ESC_SEQUENCE + + SBRC FLAGS,3 + RJMP REGULAR_CHAR + CPI A,$20 + BRSH REGULAR_CHAR + + CPI A,$08 + RJEQ BACK_SPACE +;L0132: + CPI A,$0D + RJEQ CR +;L0135: + CPI A,$0A + BRNE TEST_BELL + RJMP LF +TEST_BELL: + CPI A,7 + BRNE MAIN_LOOP + +REGULAR_CHAR: + SBRC FLAGS,2 ; CROSSED ZEROS ON? + RJMP L013B ; YES, DON'T BOTHER TESTING FOR ZERO + CPI A,'0' + BRNE L013B + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YL,LOW(-$204) + SBCI YH,HIGH(-$204) + A14_A18 B + RCALL LPMS + MOV A,R0 +L013B: RCALL DRAW_CHAR_TTY + RJMP MAIN_LOOP + +ESC_SEQUENCE: + RCALL RX_WAIT + CPI A,$1B + BREQ REGULAR_CHAR + CPI A,'.' + RJEQ CHARACTER_SET_DOWNLOAD + CPI A,'/' + RJEQ CROSSED_ZEROS + CPI A,'?' + RJEQ CHARACTER_SET_QUERY + CPI A,'B' + RJEQ BUZZER + CPI A,'C' + RJEQ CLEAR_RECTANGLE + CPI A,'D' + RJEQ DRAW_MODE + CPI A,'E' + RJEQ ENABLE_CNTRL + CPI A,'F' + RJEQ GET_FILLED_RECTNC_SIZE + CPI A,'G' + RJEQ INTERPRET_MODE + CPI A,'K' + RJEQ CLR_DISP + CPI A,'L' + RJEQ GO_SCROLL_REGION + CPI A,'M' + RJEQ MOSFET_CONTROL + CPI A,'N' + RJEQ GET_RECTNC_SIZE + CPI A,'P' + RJEQ PROP_FIXED_MODE + CPI A,'R' + RJEQ GET_RECT_SIZE + CPI A,'S' + RJEQ SET_CURSOR + CPI A,'T' + RJEQ SET_TIME + CPI A,'U' + RJEQ NULLSUB + CPI A,'V' + RJEQ CONTRAST_CONTROL + CPI A,'W' + RJEQ NULLSUB + CPI A,'X' + RJEQ SAVE_STATE + CPI A,'Z' + RJEQ TOUCH_ZONE + CPI A,'0' + BRLO ESC_SEQUENCE_ABORT + CPI A,'9'+1 + BRLO SET_CHSET_A +ESC_SEQUENCE_ABORT: + RJMP MAIN_LOOP + +CROSSED_ZEROS: + RCALL RX_WAIT + SBRS A,0 + RJMP CROSSED_ZEROS_OFF + LDI A,1<<2 + OR FLAGS,A + RJMP MAIN_LOOP +CROSSED_ZEROS_OFF: + LDI A,~(1<<2) + AND FLAGS,A + RJMP MAIN_LOOP + +MOSFET_CONTROL: + RCALL RX_WAIT + CPI A,$30 ; DO NOT TURN OFF BY ACCIDENT +; BRNE MOSFET_CONTROL_DONE +; CLI +; LDI F,1<<6 +; OR FLAGS,F ; SAY WE TURNED OFF VIA COMMAND +; SBI DDRD,2 ; D2 = LOW, VSWT OFF +; RJMP SLEEP_ENTRY ; GO AND SHUT DOWN DISPLAY +;MOSFET_CONTROL_DONE: + RJMP MAIN_LOOP + +BUZZER: RCALL RX_WAIT + STS BUZZ_TIME,A ; SAVE REQUESTED DURATION + RJMP MAIN_LOOP + +SET_TIME: + LDI A,0 + OUT TCCR2,A ; STOP COUNTING WHILE SETTING CLOCK + STS TIME_HSEC_64K,A + STS TIME_HSEC_256,A + STS TIME_HSEC,A + RCALL RX_WAIT + STS TIME_HOUR,A + RCALL RX_WAIT + STS TIME_MINUTE,A + RCALL RX_WAIT + STS TIME_SECOND,A + RCALL RX_WAIT + STS DATE_MONTH,A + RCALL RX_WAIT + STS DATE_DAY,A + RCALL RX_WAIT + STS DATE_YEAR,A + LDI A,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;** LDI A,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,A + RJMP MAIN_LOOP + +SET_CHSET: + RCALL RX_WAIT +SET_CHSET_A: + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE +;L01A3: + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: CLR CURSORX + RJMP MAIN_LOOP + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + CLI + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRCC DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRCC DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + RCALL FIND_CHAR ; SET UP CHAR_PTR FROM A = CHAR + RCALL CHAR_WIDTH ; SET UP R0 = PROP WIDTH FROM CHAR PTR + + CLR F + STS TEMP,F ; NUDGE FOR FIXED SPACING MODE + + SBRC FLAGS,4 + RJMP PROP_MODE ; FORCED TO FIXED SPACING MODE? + + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS ; GET R0 = CELL WIDTH FOR CHARACTER SET + PUSH R0 + SUB R0,W + BRCC NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + POP R0 ; RESTORE R0 = FIXED CELL WIDTH + +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE ; FORCED TO GRAPHICS MODE? + + MOV F,CURSORX + ADD F,R0 ; CHECK IF CHAR WILL FIT ON THIS LINE + BRCC OK_LINE + + CLR CURSORX + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 + RCALL SELECT_PAGE ; IN CASE WE SCROLLED THE DISPLAY + +OK_LINE: + LDS F,TEMP + ADD F,CURSORX + STS CHAR_X,F + STS CHAR_Y,CURSORY ; SET UP TOP LEFT COORDINATES + + ADD CURSORX,R0 ; ADVANCE CURSOR + +DRAW_CHAR: + LDS XPIXEL,CHAR_X + LDS LINE_CNT,CHAR_Y + + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE ; Y OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 + +Y_OFFSET_DONE: + SBRS X_SIZE,7 + RJMP X_OFFSET_DONE ; X OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$03 + RCALL LPMS + ADD XPIXEL,R0 + +X_OFFSET_DONE: + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + ADIW YL,$01 + RCALL LPMS ; GET R0 = Y LINES FOR CHARACTER + MOV Y_SIZE,R0 + + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +FIND_CHAR: + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + STS CHAR_PTR,YL + STS CHAR_PTR+1,YH + RET + +CHAR_WIDTH: + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + RCALL LPMS + MOV X_SIZE,R0 + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP LPMS ; PROPORTIONAL WIDTH IS PRESENT + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RJMP LPMS ; NO PROPORTIONAL WIDTH, USE CELL WIDTH + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + ; LET'S BE SAFE + ANDI A,$7F + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +GO_SELECT_PAGE: + RJMP SELECT_PAGE + +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +GO_EXT_INT0: + RJMP EXT_INT0 + +GO_EXT_INT1: + RJMP EXT_INT1 + +GO_TIM2_OVF: + RJMP TIM2_OVF + +GO_T1_OVERFLOW: + RJMP T1_OVERFLOW + +GO_T0_OVERFLOW: + RJMP T0_OVERFLOW + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +; ----------------------------------------------------------------------------- + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +; ----------------------------------------------------------------------------- + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR CURSORX ; HOME CURSOR + CLR CURSORY + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE CLEAR_DISPLAY_LOOP + RET + +; ----------------------------------------------------------------------------- + +EXT_INT0: +;**: +RETI +;** IN SR,SREG ; MEASURE VCC +;** SBI DDRD,2 +;** IN C,TCNT1L +;** IN D,TCNT1H +;** STS VCCH,D +;** STS VCCL,C +;** RJMP EXT_INT_RET + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP EXT_INT_RET + +T1_OVERFLOW: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + ; REDUNDANT, NOW DONE IN TIMER 2 OVERFLOW HANDLER + ;WDR + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDI D,$70 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, TOGGLE OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + LDS C,CLOCKING_PTR + TST C ; START OF 4 LINE BLOCK? (1 BASED) + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL +; LDI D,~(1<<6) +; AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION +GO_SLEEP_ENTRY: + RJMP SLEEP_ENTRY +BREAK_CONT: + +;** SBI DDRD,2 ; PRECHARGE VCC AND +;** SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D ; STOP TIMER1 + OUT TCNT1H,D ; AND CLEAR COUNT + OUT TCNT1L,D +;!! CBI PORTD,5 ; DROP CL2 + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + LDS D,LATCH10_SAV + OUT PORTA,D + SBI PORTB,4 + SBI PORTA,5 ; PULSE CL1 + CBI PORTA,5 + CBI PORTB,4 + RJMP L04F9 + +L04E6: LDS D,LATCH10_SAV + ORI D,$80 ; RAISE FLM + ORI D,$20 ; RAISE CL1 + OUT PORTA,D + + SBI PORTB,4 + LDI C,$60 ; TOGGLE M AND CL1 + EOR D,C + OUT PORTA,D + ANDI D,$7F ; DROP FLM + OUT PORTA,D + CBI PORTB,4 + STS LATCH10_SAV,D + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D +;**: + LDI D,1 ; TO CLOCK AT 5.5/2 MHZ + OUT OCR1AL,D + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + +;**: + LDI D,$7A ; WAIT FOR 32uSEC +;!! LDI D,$80 ; WAIT FOR 32uSEC +;** LDI D,$39 ; WAIT FOR 16uSEC +L050E: DEC D + BRNE L050E + +;!! LDI D,$01 +;!! OUT TCCR1B,D ; KILL CLR ON COMPARE MATCH +;!! SBI PORTD,5 ; SET CL2 HI (FOR REV E DOES NOTHING) + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP +;!!: + LDI D,$01 ; KILL CLR ON COMPARE MATCH + OUT TCCR1B,D ; WITH OC1A LEFT IN HIGH STATE + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + +;** LDS C,VCCL +;** LDS D,VCCH +;** LDI E,LOW(VCC_NOMINAL) +;** SUB C,E +;** LDI E,HIGH(VCC_NOMINAL) +;** SBC D,E + +;** ROR D +;** ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +;** PUSH D +;** PUSH C +;** ASR D +;** ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +;** POP E +;** ADD C,E +;** POP E +;** ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + +;**: + LDS C,VEEL + LDS D,VEEH +;** LDS E,VEEL +;** ADD C,E +;** LDS E,VEEH +;** ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_DELAY_0 ; 54uSEC + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + +;** CBI DDRD,2 ; START VCC AND +;** CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 +;!!: + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + + RJMP T1_OVERFLOW_RET + +T0_OVERFLOW: + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + PUSH ZH + PUSH ZL + PUSH R0 + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_STATE + INC D + STS SCAN_STATE,D + DEC D + BREQ SCAN_START ; IF SCAN_STATE WAS = 0 + DEC D + BREQ SCAN_BEEPER ; IF SCAN_STATE WAS = 1 + ; IMPLEMENT ENTRY POINT FOR SCAN_PULSE_LED HERE + DEC D + RJEQ SCAN_PHOTO ; IF SCAN_STATE WAS = 2 + +T0_OVERFLOW_RET: + POP R0 + POP ZL + POP ZH + +T1_OVERFLOW_RET: + POP D ; RESTORE STATE OF THE WORLD + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +EXT_INT_RET: + OUT SREG,SR + RETI + +SCAN_START: + LDI D,3 ;5 + OUT TCCR0,D ; PRESCALE=CK/1024 + LDI D,-TK_DELAY_1 ;TK_DELAY_2 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + RJMP L0617_RESET + +SCAN_BEEPER: + LDS D,BUZZ_TIME + TST D + BREQ SCAN_PULSE_LED + LDS C,LATCH12_SAV + SBRS C,3 + RJMP BEEPER_SPKHI + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP SCAN_PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP SCAN_PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +SCAN_PULSE_LED: + LDS D,LATCH5_SAV +;**: + SBRS D,7 ; ARE WE INSIDE SLEEP_LOOP? +;** SBRC D,7 + RJMP SCAN_PULSE_LED_OK ; YES, KEEP TIMER 0 TO RETAIN CONTROL + + LDI D,1<<7 + EOR FLAGS,D + BRPL SCAN_PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP T0_OVERFLOW_RET ; AND WASTE EVERY REMAINING CYCLE + +SCAN_PULSE_LED_OK: + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM ; R0 = LED DRIVE VALUE + LDI D,13*4 + CP SCAN,D + BRSH L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + RJMP T0_OVERFLOW_RET + +SCAN_PHOTO: + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + CLC + SBRC D,6 + RJMP L0593 ; ROW/COLUMN IS INACTIVE + + ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF + IN C,SREG + + LDI D,13*4 + CP SCAN,D + BRSH L05A8 + + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS ZL,ROW_BITMAP + LDS ZH,ROW_BITMAP+1 + ROL ZL + ROL ZH + STS ROW_BITMAP,ZL + STS ROW_BITMAP+1,ZH + RJMP L05F9 + +L05A8: ; WE HAVE A COLUMN STATUS +; LDS D,LATCH5_SAV +;;**: +; SBRS D,7 ; TURNED OFF? +;;** SBRC D,7 +; RJMP L05F9 ; YES, NO FURTHER PROCESSING + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRCS L05AB + RJMP L05F9 + +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 + +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS ZH,ROW_BITMAP+1 + LDS ZL,ROW_BITMAP + + LDS D,ROW_INDEX + TST D + BREQ ROW_BITMAP_LOOP + + MOV C,D +ROW_BITMAP_SKIP: + ROR ZH + ROR ZL + SUBI C,4 + BRNE ROW_BITMAP_SKIP + +ROW_BITMAP_LOOP: + SUBI D,-4 + ROR ZH + ROR ZL + BRCS FOUND_INTERSECTION +ROW_BITMAP_LOOPE: + CPI D,13*4 + BRLO ROW_BITMAP_LOOP + + ; NO FURTHER INTERSECTING ROWS FOUND + RJMP L05F9 + +FOUND_INTERSECTION: + ; FOUND AN INTERSECTING ROW FOR COLUMN + STS ROW_INDEX,D + + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + TST R0 + BRNE VALID_INTERSECTION + + ; INTERSECTION IS NULL, GO ON TO NEXT + LDS D,ROW_INDEX + CPI D,13*4 + BRSH L05F9 ; DONE LAST ROW, GO ON TO NEXT COLUMN +GO_L0617: + RJMP L0617 ; GO ON TO NEXT ROW, SAME COLUMN + +VALID_INTERSECTION: + ; INTERSECTION IS VALID, WE HAVE KEY MAKE + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,$40 ;$10 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + + MOV D,TX_COUNT + CPI D,TX_SIZE-1 + BRSH L05F9 + + PUSH A + MOV A,R0 + RCALL TX_CHAR + CPI A,$1B + BRNE TX_CONT + RCALL TX_CHAR +TX_CONT: + POP A + +L05F9: ; SCAN TO NEXT LED / PHOTODIODE PAIR + LDI D,4 + ADD SCAN,D + + LDS D,LATCH5_SAV +;**: + SBRC D,7 +;** SBRS D,7 + RJMP TURNED_ON + + LDI D,3 + OUT TCCR0,D ; PRESCALE=CK/64 + LDI D,-TK_DELAY_1 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI C,13*4 + CP SCAN,C + BRLO GO_L0617 + + ; KEEP VDD ON, TO AVOID THE LONG TK_DELAY_2 + ;LDS D,LATCH5_SAV + ;ANDI D,$BF ; BIT 6 = 0 VDD OFF + ;STS LATCH5_SAV,D + ;PHOTO D ; READY TO SLEEP FOR ANOTHER 0.25 SEC + + LDI D,0 + OUT TCCR0,D ; STOP TIMER SINCE COMPLETE SCAN DONE + ;RJMP T0_OVERFLOW_RET + + ;LDI D,$05 + ;OUT UBRR,D + ;LDI D,$18 + ;OUT UCR,D + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + ;OUT UDR,C + ;OUT UDR,D + OR C,D ; HAVE WE SOME ACTIVITY? + + LDS D,TURNON_COUNT + CPI D,4 + BRSH TURNON_BREAK ; WAITING FOR BREAK + CPI D,1 + BRSH TURNON_MAKE ; WAITING FOR MAKE +GO_T0_OVERFLOW_RET: + RJMP T0_OVERFLOW_RET ; ALREADY HAD MAKE, NOT TURNED ON YET + +TURNON_BREAK: + TST C ; HAD SOME ACTIVITY? + BREQ TURNON_SAVE ; NO, COUNT DOWN TO BREAK + LDI D,4+1 ; YES, RESTART COUNTDOWN TO BREAK + RJMP TURNON_SAVE +TURNON_MAKE: + TST C ; HAD SOME ACTIVITY? + BRNE TURNON_SAVE ; YES, COUNT DOWN TO MAKE + LDI D,3+1 ; NO, RESTART COUNTDOWN TO MAKE +TURNON_SAVE: + DEC D ; COUNT DOWN TO MAKE OR BREAK + STS TURNON_COUNT,D + BRNE GO_T0_OVERFLOW_RET ; NOT READY TO TRY TURNON YET + +; LDI D,~(1<<6) +; AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + CBI DDRD,2 ; D2 = TRI-STATE, VSWT ON + RJMP GO_SLEEP_ENTRY ; WE WILL NOW WAIT FOR TURNON COMMAND + +TURNED_ON: + LDI D,0 ; STOP TIMER, WE WILL REGAIN + OUT TCCR0,D ; CONTROL VIA NEXT CLOCKING INTERRUPT + STS ROW_INDEX,D + + LDI C,50*4 + CP SCAN,C + BRLO L0617 + + ; COMPLETED ENTIRE SCAN, START NEW SCAN + LDS D,DEBOUNCE + TST D + BREQ L0617_RESET + DEC D + STS DEBOUNCE,D + BRNE L0617_RESET + + LDS D,ACTIVE_ZONE + TST D + BREQ L0617_RESET + + MOV D,TX_COUNT + CPI D,TX_SIZE + BRSH L0617_RESET + + PUSH A + LDI A,0 + RCALL TX_CHAR + POP A + +L0617_RESET: + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + LDIZ SCAN_TBL + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$80 ; BIT 7 = PRESERVED, LCD ON/OFF STATUS + ORI D,$40 ; BIT 6 = 1 VDD ON + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + RJMP T0_OVERFLOW_RET + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP CLEAR_DISPLAY_LOOP + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; HOW MANY SECS/6553600 PER 4HZ INTERRUPT ? +; EACH TIME THROUGH ADD 1638400 SECS/6553600 = 1/4 SEC +; OSCILLATOR IS SLOW SO WE WILL ADD 1 PART IN 10000 +; HENCE EACH TIME THROUGH ADD 1638400+164 = 1638564 UNITS TO COUNT + +TIM2_OVF: + IN SR,SREG + + WDR ; BETTER TO HAVE THIS NOT IN AN INTERRUPT?? +;!! LDI A,$10 ; DIAGNOSTIC +;!! STS BUZZ_TIME,A ; SHORT BEEP + + LDS D,TIME_HSEC_64K + SUBI D,LOW(-1638564) + STS TIME_HSEC_64K,D + + LDS D,TIME_HSEC_256 + SBCI D,HIGH(-1638564) + STS TIME_HSEC_256,D + + LDS D,TIME_HSEC + SBCI D,HIGH(-1638564>>8) + CPI D,100 + BRSH TIM2_CARRY + STS TIME_HSEC,D + +TIM2_END: + OUT SREG,SR + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA COMMAND, + ;RETI ; START A NEW SCAN, OTHERWISE DONE + + LDI D,0 + STS SCAN_STATE,D ; WE WILL EXECUTE SCAN_START ROUTINE + RJMP T0_OVERFLOW ; GO AND TURN VDD ON + +GO_TX_CHAR: + RJMP TX_CHAR + +TIM2_CARRY: + LDI D,0 + STS TIME_HSEC,D + + LDS D,TIME_SECOND + INC D + CPI D,60 + BRLO TIM2_SECOND + + LDS D,TIME_MINUTE + INC D + CPI D,60 + BRLO TIM2_MINUTE + + LDS D,TIME_HOUR + INC D + CPI D,24 + BRLO TIM2_HOUR + + PUSH ZL + PUSH ZH + PUSH R0 + LDI ZL,LOW(MONTH_TABLE*2-1) + LDI ZH,HIGH(MONTH_TABLE*2-1) + LDS E,DATE_MONTH + ADD ZL,E + LDI E,0 + ADC ZH,E + LPM + MOV E,R0 + CPI E,28 + BRNE FEBRUARY_OK + LDS E,DATE_YEAR + ANDI E,3 + LDI E,28 + BRNE FEBRUARY_OK + LDI E,29 +FEBRUARY_OK: + POP R0 + POP ZH + POP ZL + + LDS D,DATE_DAY + CP D,E + BRLO TIM2_DAY + + LDS D,DATE_MONTH + CPI D,12 + BRLO TIM2_MONTH + + LDS D,DATE_YEAR + INC D + STS DATE_YEAR,D + CLR D +TIM2_MONTH: + INC D + STS DATE_MONTH,D + CLR D +TIM2_DAY: + INC D + STS DATE_DAY,D + CLR D +TIM2_HOUR: + STS TIME_HOUR,D + CLR D +TIM2_MINUTE: + STS TIME_MINUTE,D + CLR D +TIM2_SECOND: + STS TIME_SECOND,D + +TIM2_SEND: + MOV D,TX_COUNT + CPI D,TX_SIZE-7 + BRSH TIM2_SEND_SKIP + + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'T' + RCALL TX_CHAR +; LDS A,VCCL +; RCALL TX_CHAR +; LDS A,VCCH +; RCALL TX_CHAR +; LDS A,VEEL +; RCALL TX_CHAR +; LDS A,VEEH +; RCALL TX_CHAR +; LDI A,$0D +; RCALL TX_CHAR + LDS A,TIME_HOUR + RCALL GO_TX_CHAR + LDS A,TIME_MINUTE + RCALL GO_TX_CHAR + LDS A,TIME_SECOND + RCALL GO_TX_CHAR + LDS A,DATE_MONTH + RCALL GO_TX_CHAR + LDS A,DATE_DAY + RCALL GO_TX_CHAR + LDS A,DATE_YEAR + RCALL GO_TX_CHAR + POP A + +TIM2_SEND_SKIP: + RJMP TIM2_END + +; ----------------------------------------------------------------------------- + +MONTH_TABLE: + .DB 31,28,31,30,31,30,31,31,30,31,30,31 + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/tsv0.asm b/src/avr/tsv0.asm new file mode 100644 index 00000000..ae4fda1e --- /dev/null +++ b/src/avr/tsv0.asm @@ -0,0 +1,3568 @@ +; TSV0.ASM +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS +; ;!! INDICATES CHANGES + +;** INDICATES CHANGES FOR LOW VCC AVR MOD + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APITS.INC" ; NOT API.INC BECAUSE APITS.INC ALSO HAS TURNON COMMAND +;.INCLUDE "TERTS.INC" ; NOT TER.INC BECAUSE FLAGS IN LOWER HALF OF REGISTER SET + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS PAGE,YH + RCALL ADRYP ; AND SET PAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 + ;POP @1 +.ENDMACRO + +.MACRO A14_A18 + CLI + LDS R19,LATCH10_SAV ; AND THIS + EOR R19,@0 + ANDI R19,$E0 + EOR R19,@0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + SEI + STS LATCH10_SAV,R19 ; MUST BE ATOMIC DUE TO TOGGLING M +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + ;LDS R19,LATCH11_SAV ; ALL THIS IS A TOTAL KLUDGE + ;BST @0,7 ; A7 + ;BLD R19,1 + ;BST @0,6 ; A6 + ;BLD R19,0 + ;OUT PORTA,R19 + ;NOP + ;SBI PORTB,3 + ;NOP + ;CBI PORTB,3 + ;STS LATCH11_SAV,R19 + + MOV R19,@1 ;PUSH @1 + LSL R19 ;@1 + LSL R19 ;@1 + ;LDS R19,LATCH11_SAV + BST @0,7 ;R19,1 ; A7 + BLD R19,1 ;@1,1 + BST @0,6 ;R19,0 ; A6 + BLD R19,0 ;@1,0 + OUT PORTA,R19 ;@1 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@1 + ;POP @1 + + LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,1 + BST @1,6 ; A14 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + NOP + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO + OUT PORTA,@0 ; SELECT PHOTODIODE CHANNEL + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LED + OUT PORTA,@0 ; MAIN LED DRIVE PORT + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LEDLO + LDS D,LATCH12_SAV ; DRIVE LED COMMON LO + CBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO LEDHI + LDS D,LATCH12_SAV ; DRIVE LED COMMON HI + SBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKHI + LDS D,LATCH12_SAV ; DRIVE SPEAKER HI + SBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKLO + LDS D,LATCH12_SAV ; DRIVE SPEAKER LO + CBR D,1<<3 + SBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKOFF + LDS D,LATCH12_SAV ; DRIVE SPEAKER OFF + CBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.EQU T1_INIT =$FB35 +.EQU T1_FULL_SCALE =$FC2F + +.EQU VEE_MIN =$FC40 ; MIN IS FULLY DARK +.EQU VEE_MAX =$FFC0 ; MAX IS FULLY LIGHT +.EQU VEE_INIT =$FE00 + +.EQU CONTRAST_LONG =$FE00 ; ALL LONG PULSES IS FULLY DARK +;!!.EQU CONTRAST_LONG =$FC40 ; ALL LONG PULSES IS FULLY DARK +.EQU CONTRAST_SHORT =$FFC0 ; ALL SHORT PULSES IS FULLY LIGHT +.EQU CONTRAST_MID =$FE00 + +.EQU VCC_NOMINAL =$FCC4 + +; WHEN VCC = $FCC4 FOR 6.0V: +;.EQU CONTRAST_MIN =$FCA0 ; MIN IS FULLY DARK +.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK FOR ALBERT'S LCDS +.EQU CONTRAST_MAX =$FD00 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FCD0 +.EQU CONTRAST_INIT =$FCB0 ; FOR ALBERT'S + +; GENEROUS LIMITS FOR EXPERIMENTATION: +;.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FE10 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =10 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$20 +.EQU RX_SIZE =$80 + +.EQU TK_LED_PULSE =$1E ; 22US ?? CLOCKS OF /8 +.EQU TK_DELAY_0 =$38 ; 54US ?? CLOCKS OF /8 +.EQU TK_DELAY_1 =$28 ; CLOCKS OF /64, CHANNEL SELECT DELAY +.EQU TK_DELAY_2 =$00 ; CLOCKS OF /1024, VDD POWER ON DELAY + ; $D0 IS TOO SHORT, $E0 SEEMS TO WORK + +.EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS +.EQU API_TIMEOUT =50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 USED TO CONTROL LED PULSING FOR TOUCHSCREEN EVERY 2ND CYCLE +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +BUZZ_PERIOD: .BYTE 1 +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +PAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +CHAR_X: .BYTE 1 +CHAR_Y: .BYTE 1 +CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC_64K: .BYTE 1 +TIME_HSEC_256: .BYTE 1 +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_STATE: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RJMP GO_TIM2_OVF ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_T1_OVERFLOW + RJMP GO_T0_OVERFLOW + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + LDI F,0 + STS TIME_HSEC_64K,F + STS TIME_HSEC_256,F + STS TIME_HSEC,F + STS TIME_SECOND,F + STS TIME_MINUTE,F + STS TIME_HOUR,F + LDI F,1 + STS DATE_DAY,F + STS DATE_MONTH,F + LDI F,20 + STS DATE_YEAR,F + +RESTART_ENTRY: +;**: + LDI F,8 ; TIMER 2 CLOCKED BY 32 KHZ +;** LDI F,0 ; TIMER 2 CLOCKED BY 11 MHZ + OUT ASSR,F +;**: + ; MUST MATCH SET_TIME ROUTINE % + LDI F,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;!! LDI F,$11 ; DIVIDE BY 2, TOGGLE OC2 (PIN 21) + ; (RTC DIAGNOSTIC) +;** LDI F,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,F + ; % + LDI F,$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + LDI F,$00 + OUT GIMSK,F + + LDI F,$B8 ; INIT_PORTS + OUT DDRD,F + OUT PORTD,F ; D2 = TRI-STATE, VSWT ON + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + OUT PORTC,F + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + + LDI D,$18 ; A18|A17|A16|A15|A14=11000 + OUT PORTA,D ; CL1=M=FLM=0 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BUZZ_TIME,D ; NOT BUZZING (SHORT BEEP COMES LATER) + + CLR SCAN + STS ROW_INDEX,SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + + LDI D,$F4 ; BIT 6 = 1 VDD ON, BIT 7 = 1 LCD ON + STS LATCH5_SAV,D + PHOTO D + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +RTNCDE: LDIZ RTN_CODE ; POINT Z TO FLASH + LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER + LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + CLR R0 ; TEMPORARY CLEAR KB + RAMWRX R0 ; WRITE DATA TO DSPRAM + DEC XL + BREQ RTNCDE_END ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CDE1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CDE0 +RTNCDE_END: + + ; INITIALISE DEFAULT CHARACTER SET + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + LDIZ CHSET00 ; POINT Z TO FLASH + LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + ; CLEAR REFRESH BUFFER TO AVOID A BRIEF FLICKER + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL GO_SELECT_PAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +CLEAR_REFRESH: + PUSH B + PUSH YL + PUSH YH + + LDI B,32 + RCALL GO_CLEAR_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + ADIW YL,6 + LDI B,2 + RCALL GO_CLEAR_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP YH + POP YL + POP B + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE CLEAR_REFRESH + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,0 + STS BUZZ_PERIOD,A ; HIGHEST FREQUENCY + LDI A,$40 ;$10 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + LDI A,0 + STS SCAN_STATE,A ; START ON FIRST LED / PHOTODIODE PAIR + + LDI A,0 + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + LDI F,$45 + OUT TIMSK,F ; TURN ON TIMER 0, 1, 2 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL HELLO_DISPLAY ; SHOW EXAMPLE DISPLAY + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + SBI PORTD,4 ; TURN TRANSISTOR OFF + CBI PORTD,5 ; DROP CL2 + + LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + LDI D,$74 ; BIT 6 = 1 VDD ON, BIT 7 = 0 LCD OFF + SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + LDI D,$34 ; BIT 6 = 0 VDD OFF, BIT 7 = 0 LCD OFF + STS LATCH5_SAV,D + PHOTO D + + LDI D,$41 + OUT TIMSK,D ; DISABLE TIMER 1 INTERRUPTS + + LDI D,0 + OUT TCCR0,D ; DISABLE TIMER 0 TEMPORARILY ONLY + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + + LDI F,4 + STS TURNON_COUNT,F ; .25 SEC TO BREAK, .75 SEC TO MAKE + + INIT_API_BUS ; RESET UART TO RECEIVE TURNON COMMAND + +SLEEP_LOOP: + CLI + IN F,TCCR0 + TST F + LDI F,$4A ; SE=1 SM1:SM0=00 FOR IDLE MODE + BRNE SLEEP_SETUP ; TIMER 0 RUNNING, STAY IN IDLE MODE + SBIS PIND,0 ; BREAK OFF, UART ACTIVE, STAY IN IDLE + LDI F,$7A ; SE=1 SM1:SM0=11 FOR POWER SAVE MODE +SLEEP_SETUP: + OUT MCUCR,F + SEI + SLEEP + + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDS F,TURNON_COUNT + TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;SBIS PIND,0 ; AND BREAK HAS DISAPPEARED, WAKE UP + BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP + + CLI + RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + +; ----------------------------------------------------------------------------- + +ADRYP: LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL + OUT PORTA,YH + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,PAGE +; INC YH +; ANDI YH,$1F +; STS PAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +;HELLO_DISPLAY: +; LDI A,0 +; STS RECTNC_X,A +; STS RECTNC_Y,A +; STS RECTNC_XX,A +; LDI A,$80 +; STS RECTNC_YY,A +; RCALL DRAW_RECTNC +; +; LDI A,16 +; STS CHAR_X,A +; STS CHAR_Y,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; RCALL STRING_DRAW +; +; LDI A,240 +; STS CHAR_X,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; +;STRING_RIGHT_JUST: +; PUSH B +; PUSH ZL +; PUSH ZH +; RCALL STRING_WIDTH +; POP ZH +; POP ZL +; POP B +; LDS A,CHAR_X +; SUB A,R0 +; STS CHAR_X,A +; +;STRING_DRAW: +; PUSH B +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; PUSH R0 +; RCALL DRAW_CHAR +; POP R0 +; POP ZH +; POP ZL +; LDS A,CHAR_X +; ADD A,R0 +; STS CHAR_X,A +; POP B +; DEC B +; BRNE STRING_DRAW +; RET +; +;STRING_WIDTH: +; CLR R0 +;STRING_WIDTH_LOOP: +; PUSH B +; PUSH R0 +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; POP ZH +; POP ZL +; POP A +; ADD R0,A +; POP B +; DEC B +; BRNE STRING_WIDTH_LOOP +; RET +; +;HELLO_MESSAGE: .DB 'H','E','L','L','O',0 + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +SET_TIME: + LDI A,0 + OUT TCCR2,A ; STOP COUNTING WHILE SETTING CLOCK + STS TIME_HSEC_64K,A + STS TIME_HSEC_256,A + STS TIME_HSEC,A + RCALL RX_WAIT + STS TIME_HOUR,A + RCALL RX_WAIT + STS TIME_MINUTE,A + RCALL RX_WAIT + STS TIME_SECOND,A + RCALL RX_WAIT + STS DATE_MONTH,A + RCALL RX_WAIT + STS DATE_DAY,A + RCALL RX_WAIT + STS DATE_YEAR,A + LDI A,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;** LDI A,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,A + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE +;L01A3: + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: CLR CURSORX + RJMP MAIN_LOOP + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRCC DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRCC DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + RCALL FIND_CHAR ; SET UP CHAR_PTR FROM A = CHAR + RCALL CHAR_WIDTH ; SET UP R0 = PROP WIDTH FROM CHAR PTR + + CLR F + STS TEMP,F ; NUDGE FOR FIXED SPACING MODE + + SBRC FLAGS,4 + RJMP PROP_MODE ; FORCED TO FIXED SPACING MODE? + + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS ; GET R0 = CELL WIDTH FOR CHARACTER SET + PUSH R0 + SUB R0,W + BRCC NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + POP R0 ; RESTORE R0 = FIXED CELL WIDTH + +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE ; FORCED TO GRAPHICS MODE? + + MOV F,CURSORX + ADD F,R0 ; CHECK IF CHAR WILL FIT ON THIS LINE + BRCC OK_LINE + + CLR CURSORX + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 + RCALL SELECT_PAGE ; IN CASE WE SCROLLED THE DISPLAY + +OK_LINE: + LDS F,TEMP + ADD F,CURSORX + STS CHAR_X,F + STS CHAR_Y,CURSORY ; SET UP TOP LEFT COORDINATES + + ADD CURSORX,R0 ; ADVANCE CURSOR + +DRAW_CHAR: + LDS XPIXEL,CHAR_X + LDS LINE_CNT,CHAR_Y + + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE ; Y OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 + +Y_OFFSET_DONE: + SBRS X_SIZE,7 + RJMP X_OFFSET_DONE ; X OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$03 + RCALL LPMS + ADD XPIXEL,R0 + +X_OFFSET_DONE: + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + ADIW YL,$01 + RCALL LPMS ; GET R0 = Y LINES FOR CHARACTER + MOV Y_SIZE,R0 + + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +FIND_CHAR: + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_PAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + STS CHAR_PTR,YL + STS CHAR_PTR+1,YH + RET + +CHAR_WIDTH: + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + RCALL LPMS + MOV X_SIZE,R0 + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP LPMS ; PROPORTIONAL WIDTH IS PRESENT + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RJMP LPMS ; NO PROPORTIONAL WIDTH, USE CELL WIDTH + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + ; LET'S BE SAFE + ANDI A,$7F + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +GO_SELECT_PAGE: + RJMP SELECT_PAGE + +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +GO_EXT_INT0: + RJMP EXT_INT0 + +GO_EXT_INT1: + RJMP EXT_INT1 + +GO_TIM2_OVF: + RJMP TIM2_OVF + +GO_T1_OVERFLOW: + RJMP T1_OVERFLOW + +GO_T0_OVERFLOW: + RJMP T0_OVERFLOW + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +; ----------------------------------------------------------------------------- + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +; ----------------------------------------------------------------------------- + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR CURSORX ; HOME CURSOR + CLR CURSORY + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE +CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE CLEAR_DISPLAY_LOOP + RET + +; ----------------------------------------------------------------------------- + +EXT_INT0: +;**: +RETI +;** IN SR,SREG ; MEASURE VCC +;** SBI DDRD,2 +;** IN C,TCNT1L +;** IN D,TCNT1H +;** STS VCCH,D +;** STS VCCL,C +;** RJMP EXT_INT_RET + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP EXT_INT_RET + +T1_OVERFLOW: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + ; REDUNDANT, NOW DONE IN TIMER 2 OVERFLOW HANDLER + ;WDR + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDI D,$70 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, TOGGLE OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + LDS C,CLOCKING_PTR + TST C ; START OF 4 LINE BLOCK? (1 BASED) + BRNE BREAK_CONT ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK_CONT ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION +GO_SLEEP_ENTRY: + RJMP SLEEP_ENTRY +BREAK_CONT: + +;** SBI DDRD,2 ; PRECHARGE VCC AND +;** SBI PORTD,2 + SBI DDRD,3 ; TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D ; STOP TIMER1 + OUT TCNT1H,D ; AND CLEAR COUNT + OUT TCNT1L,D +;!! CBI PORTD,5 ; DROP CL2 + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + LDS D,LATCH10_SAV + OUT PORTA,D + SBI PORTB,4 + SBI PORTA,5 ; PULSE CL1 + CBI PORTA,5 + CBI PORTB,4 + RJMP L04F9 + +L04E6: LDS D,LATCH10_SAV + ORI D,$80 ; RAISE FLM + ORI D,$20 ; RAISE CL1 + OUT PORTA,D + + SBI PORTB,4 + LDI C,$60 ; TOGGLE M AND CL1 + EOR D,C + OUT PORTA,D + ANDI D,$7F ; DROP FLM + OUT PORTA,D + CBI PORTB,4 + STS LATCH10_SAV,D + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D +;**: + LDI D,1 ; TO CLOCK AT 5.5/2 MHZ + OUT OCR1AL,D + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + +;**: + LDI D,$7A ; WAIT FOR 32uSEC +;!! LDI D,$80 ; WAIT FOR 32uSEC +;** LDI D,$39 ; WAIT FOR 16uSEC +L050E: DEC D + BRNE L050E + +;!! LDI D,$01 +;!! OUT TCCR1B,D ; KILL CLR ON COMPARE MATCH +;!! SBI PORTD,5 ; SET CL2 HI (FOR REV E DOES NOTHING) + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP +;!!: + LDI D,$01 ; KILL CLR ON COMPARE MATCH + OUT TCCR1B,D ; WITH OC1A LEFT IN HIGH STATE + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0535 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + +L0535: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + +;** LDS C,VCCL +;** LDS D,VCCH +;** LDI E,LOW(VCC_NOMINAL) +;** SUB C,E +;** LDI E,HIGH(VCC_NOMINAL) +;** SBC D,E + +;** ROR D +;** ROR C ; ALL CORRECTION VALUES, SLOPE=0.5 +;** PUSH D +;** PUSH C +;** ASR D +;** ROR C ; ALL CORRECTION VALUES, SLOPE=0.25 +;** POP E +;** ADD C,E +;** POP E +;** ADC C,D ; ALL CORRECTION VALUES, SLOPE=0.75 + +;**: + LDS C,VEEL + LDS D,VEEH +;** LDS E,VEEL +;** ADD C,E +;** LDS E,VEEH +;** ADC D,E + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_DELAY_0 ; 54uSEC + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + +;** CBI DDRD,2 ; START VCC AND +;** CBI PORTD,2 + CBI DDRD,3 ; TEMPERATURE MEASUREMENT + CBI PORTD,3 +;!!: + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + + RJMP T1_OVERFLOW_RET + +T0_OVERFLOW: + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + PUSH ZH + PUSH ZL + PUSH R0 + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_STATE + INC D + STS SCAN_STATE,D + DEC D + BREQ SCAN_START ; IF SCAN_STATE WAS = 0 + DEC D + BREQ SCAN_BEEPER ; IF SCAN_STATE WAS = 1 + ; IMPLEMENT ENTRY POINT FOR SCAN_PULSE_LED HERE + DEC D + RJEQ SCAN_PHOTO ; IF SCAN_STATE WAS = 2 + +T0_OVERFLOW_RET: + POP R0 + POP ZL + POP ZH + +T1_OVERFLOW_RET: + POP D ; RESTORE STATE OF THE WORLD + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +EXT_INT_RET: + OUT SREG,SR + RETI + +SCAN_START: + LDI D,3 ;5 + OUT TCCR0,D ; PRESCALE=CK/1024 + LDI D,-TK_DELAY_1 ;TK_DELAY_2 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + RJMP L0617_RESET + +SCAN_BEEPER: + LDS D,BUZZ_TIME + TST D + BREQ SCAN_PULSE_LED + LDS D,BUZZ_PERIOD + SUBI D,$10 + BRLO BUZZ_TOGGLE + STS BUZZ_PERIOD,D + RJMP SCAN_PULSE_LED +BUZZ_TOGGLE: ; ASSUME D = $F0 + PERIOD-1 + MOV C,D ; EG. C = $F3 FOR PERIOD = 4 + SWAP C ; EG. C = $3F FOR PERIOD = 4 + AND D,C ; EG. D = $33 FOR PERIOD = 4 + STS BUZZ_PERIOD,D + LDS C,LATCH12_SAV + SBRS C,3 ; TEST PREVIOUS SPEAKER STATE + RJMP BEEPER_SPKHI + LDS D,BUZZ_TIME + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP SCAN_PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP SCAN_PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +SCAN_PULSE_LED: + LDS D,LATCH5_SAV +;**: + SBRS D,7 ; ARE WE INSIDE SLEEP_LOOP? +;** SBRC D,7 + RJMP SCAN_PULSE_LED_OK ; YES, KEEP TIMER 0 TO RETAIN CONTROL + + LDI D,1<<7 + EOR FLAGS,D + BRPL SCAN_PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP T0_OVERFLOW_RET ; AND WASTE EVERY REMAINING CYCLE + +SCAN_PULSE_LED_OK: + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + + LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM ; R0 = LED DRIVE VALUE + LDI D,13*4 + CP SCAN,D + BRSH L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + RJMP T0_OVERFLOW_RET + +SCAN_PHOTO: + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + CLC + SBRC D,6 + RJMP L0593 ; ROW/COLUMN IS INACTIVE + + ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF + IN C,SREG + + LDI D,13*4 + CP SCAN,D + BRSH L05A8 + + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS ZL,ROW_BITMAP + LDS ZH,ROW_BITMAP+1 + ROL ZL + ROL ZH + STS ROW_BITMAP,ZL + STS ROW_BITMAP+1,ZH + RJMP L05F9 + +L05A8: ; WE HAVE A COLUMN STATUS +; LDS D,LATCH5_SAV +;;**: +; SBRS D,7 ; TURNED OFF? +;;** SBRC D,7 +; RJMP L05F9 ; YES, NO FURTHER PROCESSING + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRCS L05AB + RJMP L05F9 + +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 + +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS ZH,ROW_BITMAP+1 + LDS ZL,ROW_BITMAP + + LDS D,ROW_INDEX + TST D + BREQ ROW_BITMAP_LOOP + + MOV C,D +ROW_BITMAP_SKIP: + ROR ZH + ROR ZL + SUBI C,4 + BRNE ROW_BITMAP_SKIP + +ROW_BITMAP_LOOP: + SUBI D,-4 + ROR ZH + ROR ZL + BRCS FOUND_INTERSECTION +ROW_BITMAP_LOOPE: + CPI D,13*4 + BRLO ROW_BITMAP_LOOP + + ; NO FURTHER INTERSECTING ROWS FOUND + RJMP L05F9 + +FOUND_INTERSECTION: + ; FOUND AN INTERSECTING ROW FOR COLUMN + STS ROW_INDEX,D + + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + TST R0 + BRNE VALID_INTERSECTION + + ; INTERSECTION IS NULL, GO ON TO NEXT + LDS D,ROW_INDEX + CPI D,13*4 + BRSH L05F9 ; DONE LAST ROW, GO ON TO NEXT COLUMN +GO_L0617: + RJMP L0617 ; GO ON TO NEXT ROW, SAME COLUMN + +VALID_INTERSECTION: + ; INTERSECTION IS VALID, WE HAVE KEY MAKE + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,$40 ;$10 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + + MOV D,TX_COUNT + CPI D,TX_SIZE-1 + BRSH L05F9 + + PUSH A + MOV A,R0 + RCALL TX_CHAR + CPI A,$1B + BRNE TX_CONT + RCALL TX_CHAR +TX_CONT: + POP A + +L05F9: ; SCAN TO NEXT LED / PHOTODIODE PAIR + LDI D,4 + ADD SCAN,D + + LDS D,LATCH5_SAV +;**: + SBRC D,7 +;** SBRS D,7 + RJMP TURNED_ON + + LDI D,3 + OUT TCCR0,D ; PRESCALE=CK/64 + LDI D,-TK_DELAY_1 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI C,13*4 + CP SCAN,C + BRLO GO_L0617 + + ; KEEP VDD ON, TO AVOID THE LONG TK_DELAY_2 + ;LDS D,LATCH5_SAV + ;ANDI D,$BF ; BIT 6 = 0 VDD OFF + ;STS LATCH5_SAV,D + ;PHOTO D ; READY TO SLEEP FOR ANOTHER 0.25 SEC + + LDI D,0 + OUT TCCR0,D ; STOP TIMER SINCE COMPLETE SCAN DONE + ;RJMP T0_OVERFLOW_RET + + ;LDI D,$05 + ;OUT UBRR,D + ;LDI D,$18 + ;OUT UCR,D + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + ;OUT UDR,C + ;OUT UDR,D + OR C,D ; HAVE WE SOME ACTIVITY? + + LDS D,TURNON_COUNT + CPI D,4 + BRSH TURNON_BREAK ; WAITING FOR BREAK + CPI D,1 + BRSH TURNON_MAKE ; WAITING FOR MAKE +GO_T0_OVERFLOW_RET: + RJMP T0_OVERFLOW_RET ; ALREADY HAD MAKE, NOT TURNED ON YET + +TURNON_BREAK: + TST C ; HAD SOME ACTIVITY? + BREQ TURNON_SAVE ; NO, COUNT DOWN TO BREAK + LDI D,4+1 ; YES, RESTART COUNTDOWN TO BREAK + RJMP TURNON_SAVE +TURNON_MAKE: + TST C ; HAD SOME ACTIVITY? + BRNE TURNON_SAVE ; YES, COUNT DOWN TO MAKE + LDI D,3+1 ; NO, RESTART COUNTDOWN TO MAKE +TURNON_SAVE: + DEC D ; COUNT DOWN TO MAKE OR BREAK + STS TURNON_COUNT,D + BRNE GO_T0_OVERFLOW_RET ; NOT READY TO TRY TURNON YET + + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + CBI DDRD,2 ; D2 = TRI-STATE, VSWT ON + RJMP GO_SLEEP_ENTRY ; WE WILL NOW WAIT FOR TURNON COMMAND + +TURNED_ON: + LDI D,0 ; STOP TIMER, WE WILL REGAIN + OUT TCCR0,D ; CONTROL VIA NEXT CLOCKING INTERRUPT + STS ROW_INDEX,D + + LDI C,50*4 + CP SCAN,C + BRLO L0617 + + ; COMPLETED ENTIRE SCAN, START NEW SCAN + LDS D,DEBOUNCE + TST D + BREQ L0617_RESET + DEC D + STS DEBOUNCE,D + BRNE L0617_RESET + + LDS D,ACTIVE_ZONE + TST D + BREQ L0617_RESET + + MOV D,TX_COUNT + CPI D,TX_SIZE + BRSH L0617_RESET + + PUSH A + LDI A,0 + RCALL TX_CHAR + POP A + +L0617_RESET: + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + LDIZ SCAN_TBL + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$80 ; BIT 7 = PRESERVED, LCD ON/OFF STATUS + ORI D,$40 ; BIT 6 = 1 VDD ON + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + RJMP T0_OVERFLOW_RET + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP CLEAR_DISPLAY_LOOP + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_PAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_PAGE: + A14_A18 A + RET + +; HOW MANY SECS/6553600 PER 4HZ INTERRUPT ? +; EACH TIME THROUGH ADD 1638400 SECS/6553600 = 1/4 SEC +; OSCILLATOR IS SLOW SO WE WILL ADD 1 PART IN 10000 +; HENCE EACH TIME THROUGH ADD 1638400+164 = 1638564 UNITS TO COUNT + +TIM2_OVF: + IN SR,SREG + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +;!! LDI A,$10 ; DIAGNOSTIC +;!! STS BUZZ_TIME,A ; SHORT BEEP + + LDS D,TIME_HSEC_64K + SUBI D,LOW(-1638564) + STS TIME_HSEC_64K,D + + LDS D,TIME_HSEC_256 + SBCI D,HIGH(-1638564) + STS TIME_HSEC_256,D + + LDS D,TIME_HSEC + SBCI D,HIGH(-1638564>>8) + CPI D,100 + BRSH TIM2_CARRY + STS TIME_HSEC,D + +TIM2_END: + OUT SREG,SR + SBRS FLAGS,6 ; IF WE TURNED OFF VIA COMMAND, + RETI ; START A NEW SCAN, OTHERWISE DONE + + LDI D,0 + STS SCAN_STATE,D ; WE WILL EXECUTE SCAN_START ROUTINE + RJMP T0_OVERFLOW ; GO AND TURN VDD ON + +GO_TX_CHAR: + RJMP TX_CHAR + +TIM2_CARRY: + LDI D,0 + STS TIME_HSEC,D + + LDS D,TIME_SECOND + INC D + CPI D,60 + BRLO TIM2_SECOND + + LDS D,TIME_MINUTE + INC D + CPI D,60 + BRLO TIM2_MINUTE + + LDS D,TIME_HOUR + INC D + CPI D,24 + BRLO TIM2_HOUR + + PUSH ZL + PUSH ZH + PUSH R0 + LDI ZL,LOW(MONTH_TABLE*2-1) + LDI ZH,HIGH(MONTH_TABLE*2-1) + LDS E,DATE_MONTH + ADD ZL,E + LDI E,0 + ADC ZH,E + LPM + MOV E,R0 + CPI E,28 + BRNE FEBRUARY_OK + LDS E,DATE_YEAR + ANDI E,3 + LDI E,28 + BRNE FEBRUARY_OK + LDI E,29 +FEBRUARY_OK: + POP R0 + POP ZH + POP ZL + + LDS D,DATE_DAY + CP D,E + BRLO TIM2_DAY + + LDS D,DATE_MONTH + CPI D,12 + BRLO TIM2_MONTH + + LDS D,DATE_YEAR + INC D + STS DATE_YEAR,D + CLR D +TIM2_MONTH: + INC D + STS DATE_MONTH,D + CLR D +TIM2_DAY: + INC D + STS DATE_DAY,D + CLR D +TIM2_HOUR: + STS TIME_HOUR,D + CLR D +TIM2_MINUTE: + STS TIME_MINUTE,D + CLR D +TIM2_SECOND: + STS TIME_SECOND,D + +TIM2_SEND: + MOV D,TX_COUNT + CPI D,TX_SIZE-7 + BRSH TIM2_SEND_SKIP + + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'T' + RCALL TX_CHAR +; LDS A,VCCL +; RCALL TX_CHAR +; LDS A,VCCH +; RCALL TX_CHAR +; LDS A,VEEL +; RCALL TX_CHAR +; LDS A,VEEH +; RCALL TX_CHAR +; LDI A,$0D +; RCALL TX_CHAR + LDS A,TIME_HOUR + RCALL GO_TX_CHAR + LDS A,TIME_MINUTE + RCALL GO_TX_CHAR + LDS A,TIME_SECOND + RCALL GO_TX_CHAR + LDS A,DATE_MONTH + RCALL GO_TX_CHAR + LDS A,DATE_DAY + RCALL GO_TX_CHAR + LDS A,DATE_YEAR + RCALL GO_TX_CHAR + POP A + +TIM2_SEND_SKIP: + RJMP TIM2_END + +; ----------------------------------------------------------------------------- + +MONTH_TABLE: + .DB 31,28,31,30,31,30,31,31,30,31,30,31 + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 + .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 + .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 + .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 + .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 + .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 + .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 + .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 + .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 + .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 + .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 + .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 + .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 + .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 + .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 + .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 + .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 + .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 + .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 + .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 + .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 + .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 + .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 + .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 + .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 + .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 + .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 + .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 + .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 + .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 + .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 + .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 + .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 + .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 + .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 + .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 + .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 + .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 + .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 + .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 + .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 + .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 + .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 + .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 + .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 + .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 + .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 + .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 + .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 + .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 + .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 + .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 + .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 + .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 + .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 + .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 + .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 + .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 + .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 + .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 + .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 + .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 + .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 + .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 + .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 + .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 + .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 + .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 + .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 + .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 + .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A + .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +CHSET00_END: + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/tsv3-tsv4.diff b/src/avr/tsv3-tsv4.diff new file mode 100644 index 00000000..b0c020ac --- /dev/null +++ b/src/avr/tsv3-tsv4.diff @@ -0,0 +1,666 @@ +--- tsv3.asm 2003-03-18 12:26:48.000000000 +1100 ++++ tsv4.asm 2003-03-20 16:55:02.000000000 +1100 +@@ -1,4 +1,4 @@ +-; TSV3.ASM ++; TSV4.ASM + + ; 19FEB02 REVISE FOR GREATER CONTRAST VOLTAGE FOR ALBERT'S 2ND BATCH -15V + ; 01FEB02 REVISE FOR 7.3728MHz XTAL (SEE !!!) +@@ -17,8 +17,8 @@ + .LISTMAC + .MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) +- STS PAGE,YH +- RCALL ADRYP ; AND SET PAGE ++ STS XPAGE,YH ++ RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) + .ENDMACRO +@@ -289,12 +289,13 @@ + + .EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS + .EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +-.EQU API_RATE_SLOW =$5F ;$8F ; DIVISOR FOR 4800 BPS +-.EQU API_RATE_FAST =$03 ;$05 ; DIVISOR FOR 115200 BPS ++.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS ++.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS + .EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM + .EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD + .EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + ++.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE + .DEF SR =R1 + .DEF RX_PTR =R2 + .DEF RX_COUNT =R3 +@@ -332,6 +333,14 @@ + .DEF CURSORX =R23 + .DEF CURSORY =R24 + ++; for AVRA / TAVRASM: ++;.def XL =R26 ++;.def XH =R27 ++;.def YL =R28 ++;.def YH =R29 ++;.def ZL =R30 ++;.def ZH =R31 ++ + .DSEG + .ORG RAM + +@@ -364,7 +373,7 @@ + LATCH10_SAV: .BYTE 1 + LATCH11_SAV: .BYTE 1 + LATCH12_SAV: .BYTE 1 +-PAGE: .BYTE 1 ++XPAGE: .BYTE 1 + ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + + LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +@@ -535,9 +544,15 @@ + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +-RTNCDE: LDIZ RTN_CODE ; POINT Z TO FLASH +- LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER +- LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET PAGE ++RTNCDE: ;LDIZ RTN_CODE ; POINT Z TO FLASH ++ LDI ZL,LOW((RTN_CODE)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++ ;LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER ++ LDI XL,LOW((RTN_CODE_END-RTN_CODE)*2) ; USE AS BYTE COUNTER ++ LDI XH,HIGH((RTN_CODE_END-RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++ LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE + CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM + CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH +@@ -598,9 +613,15 @@ + BREQ CHARACTER_SET_INIT_DONE + + CHARACTER_SET_INIT: +- LDIZ CHSET00 ; POINT Z TO FLASH +- LDIX CHSET00_END-CHSET00 ; BYTE COUNTER +- LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET PAGE ++ ;LDIZ CHSET00 ; POINT Z TO FLASH ++ LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++ ;LDIX CHSET00_END-CHSET00 ; BYTE COUNTER ++ LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER ++ LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ ++ LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE + CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM + CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH +@@ -628,7 +649,7 @@ + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL GO_SELECT_PAGE ++ RCALL GO_SELECT_XPAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +@@ -672,11 +693,11 @@ + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + +- LDI B,EE_CONTRAST*2 ++ LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A +- LDI B,EE_CONTRAST*2+1 ++ LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + +@@ -802,7 +823,7 @@ + + ; ----------------------------------------------------------------------------- + +-ADRYP: LDS YH,PAGE ; SET PAGE ADDRESS FOR DSPRAM ++ADRYP: LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL +@@ -816,10 +837,10 @@ + ; CLR YL + ; INC YH + ; BRNE INCRET +-; LDS YH,PAGE ++; LDS YH,XPAGE + ; INC YH + ; ANDI YH,$1F +-; STS PAGE,YH ++; STS XPAGE,YH + ; CLR YH + ;INCRET: RET + +@@ -972,14 +993,22 @@ + RJEQ BUZZ_AT_FREQ + CPI A,'C' + RJEQ CLEAR_RECTANGLE ++ CPI A,'c' ++ RJEQ GET_CLEAR_FRAME_RECT_SIZE + CPI A,'D' + RJEQ DRAW_MODE + CPI A,'E' + RJEQ ENABLE_CNTRL + CPI A,'F' + RJEQ GET_FILLED_RECTNC_SIZE ++ CPI A,'f' ++ RJEQ GET_FRAME_RECT_SIZE + CPI A,'G' + RJEQ INTERPRET_MODE ++ CPI A,'H' ++ RJEQ GET_HALFTONE_RECT_SIZE ++ CPI A,'h' ++ RJEQ GET_CLEAR_HALFTONE_RECT_SIZE + CPI A,'K' + RJEQ CLR_DISP + CPI A,'L' +@@ -1292,10 +1321,10 @@ + STS CONTRASTL,A + STS CONTRASTH,B + +- LDI B,EE_CONTRAST*2 ++ LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH +- LDI B,EE_CONTRAST*2+1 ++ LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + + CONTRAST_DONE: +@@ -1706,7 +1735,7 @@ + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 +- RCALL SELECT_PAGE ; IN CASE WE SCROLLED THE DISPLAY ++ RCALL SELECT_XPAGE ; IN CASE WE SCROLLED THE DISPLAY + + OK_LINE: + LDS F,TEMP +@@ -1783,7 +1812,7 @@ + + MORE_X: ADIW YL,$01 + LDS A,PTR+2 +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RCALL LPMS + + CLR A +@@ -1833,7 +1862,7 @@ + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 +@@ -1909,7 +1938,7 @@ + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG +@@ -2043,8 +2072,8 @@ + GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +-GO_SELECT_PAGE: +- RJMP SELECT_PAGE ++GO_SELECT_XPAGE: ++ RJMP SELECT_XPAGE + + GO_SCROLL_REGION: + RJMP SCROLL_REGION +@@ -2083,7 +2112,7 @@ + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + RJMP L03A3 + L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) +@@ -2305,7 +2334,7 @@ + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +@@ -2376,7 +2405,11 @@ + OUT OCR1BL,C + + LDS C,CLOCKING_PTR +- TST C ; START OF 4 LINE BLOCK? (1 BASED) ++; TST C ; START OF 4 LINE BLOCK? (1 BASED) ++ lds d,CLOCKING_PTR+1 ++ andi d,1 ++ or c,d ; checks for start of an 8 line block ++; rjmp BREAK0 ; temporary (prevents switching off via power switch) + BRNE BREAK0 ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT +@@ -2689,7 +2722,10 @@ + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + +- LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL ++ ;LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL ++ LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ + CLR D + ADD ZL,SCAN + ADC ZH,D +@@ -2789,7 +2825,10 @@ + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + +- LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL ++ ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL ++ LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ + CLR D + ADD ZL,C + ADC ZH,D +@@ -2801,7 +2840,11 @@ + ADD C,R0 + LSL R0 + ADD C,R0 +- LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL ++ ++ ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL ++ LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ + CLR D + ADD ZL,SCAN + ADC ZH,D +@@ -2951,7 +2994,10 @@ + STS ROW_BITMAP+1,SCAN + + L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE +- LDIZ SCAN_TBL ++ ;LDIZ SCAN_TBL ++ LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION ++ LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION ++ + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN +@@ -2973,7 +3019,7 @@ + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) +@@ -3025,7 +3071,7 @@ + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) +- RCALL SELECT_PAGE ++ RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 +@@ -3226,7 +3272,7 @@ + RAMWR A + RET + +-SELECT_PAGE: ++SELECT_XPAGE: + A14_A18 A + RET + +@@ -3423,106 +3469,237 @@ + ; ----------------------------------------------------------------------------- + + CHSET00: +- .DB $34,$32,$43,$46,$30,$30,$31,$30,$31,$31,$31,$37,$35,$36,$30,$37 +- .DB $6B,$05,$75,$05,$77,$05,$39,$04,$79,$05,$7B,$05,$7D,$05,$7F,$05 +- .DB $81,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$83,$05,$85,$05,$0A,$02,$15,$02 +- .DB $17,$02,$1F,$02,$29,$02,$2E,$02,$37,$02,$40,$02,$49,$02,$53,$02 +- .DB $59,$02,$63,$02,$6C,$02,$74,$02,$7E,$02,$85,$02,$8A,$02,$8E,$02 +- .DB $96,$02,$9F,$02,$A8,$02,$B1,$02,$BA,$02,$C3,$02,$CC,$02,$D5,$02 +- .DB $DE,$02,$E7,$02,$F1,$02,$FA,$02,$04,$03,$0D,$03,$15,$03,$1E,$03 +- .DB $27,$03,$30,$03,$39,$03,$42,$03,$4B,$03,$54,$03,$5D,$03,$66,$03 +- .DB $6F,$03,$79,$03,$82,$03,$8B,$03,$94,$03,$9D,$03,$A6,$03,$AF,$03 +- .DB $B8,$03,$C1,$03,$CA,$03,$D3,$03,$DC,$03,$E5,$03,$EE,$03,$F7,$03 +- .DB $00,$04,$09,$04,$12,$04,$1C,$04,$25,$04,$2E,$04,$37,$04,$3E,$04 +- .DB $41,$04,$46,$04,$4F,$04,$58,$04,$61,$04,$6A,$04,$73,$04,$7C,$04 +- .DB $86,$04,$90,$04,$9A,$04,$A5,$04,$AF,$04,$B8,$04,$C1,$04,$CA,$04 +- .DB $D3,$04,$DD,$04,$E9,$04,$F0,$04,$F9,$04,$02,$05,$0B,$05,$14,$05 +- .DB $1D,$05,$26,$05,$30,$05,$3A,$05,$44,$05,$4E,$05,$59,$05,$5D,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $66,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05,$6B,$05 +- .DB $06,$08,$01,$01,$4F,$00,$00,$06,$FF,$06,$61,$09,$20,$70,$A8,$A0 +- .DB $70,$28,$A8,$70,$20,$01,$07,$00,$20,$70,$80,$80,$70,$20,$02,$21 +- .DB $07,$80,$80,$80,$80,$00,$00,$80,$04,$21,$03,$A0,$A0,$A0,$01,$07 +- .DB $50,$50,$F8,$50,$F8,$50,$50,$01,$07,$20,$78,$A0,$70,$28,$F0,$20 +- .DB $01,$07,$C0,$C8,$10,$20,$40,$98,$18,$01,$07,$60,$90,$A0,$40,$A8 +- .DB $90,$68,$03,$21,$03,$C0,$40,$80,$04,$21,$07,$20,$40,$80,$80,$80 +- .DB $40,$20,$04,$21,$07,$80,$40,$20,$20,$20,$40,$80,$01,$06,$00,$20 +- .DB $A8,$70,$A8,$20,$01,$06,$00,$20,$20,$F8,$20,$20,$05,$03,$61,$03 +- .DB $C0,$40,$80,$03,$06,$61,$01,$F8,$05,$03,$61,$02,$C0,$C0,$01,$06 +- .DB $00,$08,$10,$20,$40,$80,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01 +- .DB $07,$20,$60,$20,$20,$20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40 +- .DB $F8,$01,$07,$F8,$10,$20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90 +- .DB $F8,$10,$10,$01,$07,$F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40 +- .DB $80,$F0,$88,$88,$70,$01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07 +- .DB $70,$88,$88,$70,$88,$88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60 +- .DB $03,$21,$06,$00,$C0,$C0,$00,$C0,$C0,$03,$21,$07,$00,$C0,$C0,$00 +- .DB $C0,$40,$80,$05,$21,$07,$10,$20,$40,$80,$40,$20,$10,$01,$05,$00 +- .DB $00,$F8,$00,$F8,$05,$21,$07,$80,$40,$20,$10,$20,$40,$80,$01,$07 +- .DB $70,$88,$08,$10,$20,$00,$20,$01,$07,$70,$88,$B8,$A8,$B8,$80,$70 +- .DB $01,$07,$70,$88,$88,$88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88 +- .DB $88,$F0,$01,$07,$70,$88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88 +- .DB $88,$88,$90,$E0,$01,$07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8 +- .DB $80,$80,$F0,$80,$80,$80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01 +- .DB $07,$88,$88,$88,$F8,$88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80 +- .DB $80,$80,$01,$07,$08,$08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0 +- .DB $C0,$A0,$90,$88,$01,$07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88 +- .DB $D8,$A8,$A8,$88,$88,$88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01 +- .DB $07,$70,$88,$88,$88,$88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80 +- .DB $80,$01,$07,$70,$88,$88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0 +- .DB $A0,$90,$88,$01,$07,$70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20 +- .DB $20,$20,$20,$20,$20,$01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07 +- .DB $88,$88,$88,$88,$88,$50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50 +- .DB $01,$07,$88,$88,$50,$20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20 +- .DB $20,$20,$01,$07,$F8,$08,$10,$20,$40,$80,$F8,$04,$21,$07,$E0,$80 +- .DB $80,$80,$80,$80,$E0,$01,$06,$00,$80,$40,$20,$10,$08,$04,$21,$07 +- .DB $E0,$20,$20,$20,$20,$20,$E0,$01,$03,$20,$50,$88,$06,$06,$61,$01 +- .DB $F8,$01,$03,$30,$20,$10,$01,$07,$00,$00,$70,$08,$78,$88,$78,$01 +- .DB $07,$80,$80,$F0,$88,$88,$88,$F0,$01,$07,$00,$00,$78,$80,$80,$80 +- .DB $78,$01,$07,$08,$08,$78,$88,$88,$88,$78,$01,$07,$00,$00,$70,$88 +- .DB $F8,$80,$70,$01,$07,$18,$20,$F8,$20,$20,$20,$20,$01,$08,$00,$00 +- .DB $78,$88,$88,$78,$08,$70,$01,$07,$80,$80,$B0,$C8,$88,$88,$88,$02 +- .DB $21,$07,$80,$00,$80,$80,$80,$80,$80,$05,$21,$08,$10,$00,$10,$10 +- .DB $10,$10,$90,$60,$05,$21,$07,$80,$80,$90,$A0,$C0,$A0,$90,$03,$21 +- .DB $07,$C0,$40,$40,$40,$40,$40,$40,$01,$07,$00,$00,$F0,$A8,$A8,$A8 +- .DB $A8,$01,$07,$00,$00,$B0,$C8,$88,$88,$88,$01,$07,$00,$00,$70,$88 +- .DB $88,$88,$70,$01,$08,$00,$00,$F0,$88,$88,$F0,$80,$80,$01,$08,$00 +- .DB $00,$78,$88,$88,$78,$08,$08,$02,$05,$61,$05,$B0,$C0,$80,$80,$80 +- .DB $01,$07,$00,$00,$78,$80,$70,$08,$F0,$01,$07,$20,$20,$F8,$20,$20 +- .DB $20,$18,$01,$07,$00,$00,$88,$88,$88,$98,$68,$01,$07,$00,$00,$88 +- .DB $88,$88,$50,$20,$01,$07,$00,$00,$88,$88,$A8,$A8,$50,$01,$07,$00 +- .DB $00,$88,$50,$20,$50,$88,$01,$08,$00,$00,$88,$88,$88,$78,$08,$70 +- .DB $01,$07,$00,$00,$F8,$10,$20,$40,$F8,$05,$21,$07,$30,$40,$40,$80 +- .DB $40,$40,$30,$02,$21,$07,$80,$80,$80,$00,$80,$80,$80,$05,$21,$07 +- .DB $C0,$20,$20,$10,$20,$20,$C0,$02,$07,$61,$02,$64,$98,$01,$07,$00 +- .DB $00,$20,$50,$88,$88,$F8,$01,$03,$E0,$A0,$E0,$01,$07,$F8,$F8,$F8 +- .DB $F8,$F8,$F8,$F8,$01,$20,$02,$20,$04,$20,$FC,$20,$FD,$20,$FE,$20 +- .DB $FF,$20,$0C,$20,$F4,$20,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A +- .DB $1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A,$1A ++.INCLUDE "CHSET00.INC" + CHSET00_END: + + ; ----------------------------------------------------------------------------- + ++GET_CLEAR_FRAME_RECT_SIZE: ++ STS RECTNC_X,CURSORX ++ STS RECTNC_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECTNC_XX,A ++ RCALL RX_WAIT ++ STS RECTNC_YY,A ++ RCALL CLEAR_FRAME_RECT ++ RJMP MAIN_LOOP ++ ++GET_FRAME_RECT_SIZE: ++ STS RECTNC_X,CURSORX ++ STS RECTNC_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECTNC_XX,A ++ RCALL RX_WAIT ++ STS RECTNC_YY,A ++ RCALL FRAME_RECT ++ RJMP MAIN_LOOP ++ ++GET_CLEAR_HALFTONE_RECT_SIZE: ++ STS RECT_X,CURSORX ++ STS RECT_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECT_XX,A ++ RCALL RX_WAIT ++ STS RECT_YY,A ++ RCALL CLEAR_HALFTONE_RECT ++ RJMP MAIN_LOOP ++ ++GET_HALFTONE_RECT_SIZE: ++ STS RECT_X,CURSORX ++ STS RECT_Y,CURSORY ++ RCALL RX_WAIT ++ STS RECT_XX,A ++ RCALL RX_WAIT ++ STS RECT_YY,A ++ RCALL HALFTONE_RECT ++ RJMP MAIN_LOOP ++ ++NO_GOX: RET ++ ++CLEAR_FRAME_RECT: ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ STS RECT_Y,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDS F,RECTNC_YY ++ STS RECT_YY,F ++ ++ LDI F,$02 ++ OR FLAGS,F ++ ++ RCALL DRAW_RECT ++ ++ LDI F,$FD ++ AND FLAGS,F ++ ++FRAME_RECT: ++ LDS F,RECTNC_XX ++ DEC F ++ CPI F,2 ++ BRLO NO_GOX ++ LDS F,RECTNC_YY ++ CPI F,3 ++ BRLO NO_GOX ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ STS RECT_Y,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDI F,$01 ++ STS RECT_YY,F ++ RCALL DRAW_RECT ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_Y ++ INC F ++ STS RECT_Y,F ++ LDS F,RECTNC_YY ++ SUBI F,2 ++ STS RECT_YY,F ++ LDI F,$01 ++ STS RECT_XX,F ++ RCALL DRAW_RECT ++ ++ LDS X_SIZE,RECTNC_XX ++ LDS F,RECTNC_X ++ ADD F,X_SIZE ++ DEC F ++ STS RECT_X,F ++ LDI F,$01 ++ STS RECT_XX,F ++ LDS F,RECTNC_Y ++ INC F ++ STS RECT_Y,F ++ LDS F,RECTNC_YY ++ SUBI F,2 ++ STS RECT_YY,F ++ RCALL DRAW_RECT ++ ++ LDS F,RECTNC_X ++ STS RECT_X,F ++ LDS F,RECTNC_XX ++ STS RECT_XX,F ++ LDS Y_SIZE,RECTNC_YY ++ LDS F,RECTNC_Y ++ ADD F,Y_SIZE ++ DEC F ++ STS RECT_Y,F ++ LDI F,$01 ++ STS RECT_YY,F ++ RJMP DRAW_RECT ++ ++CLEAR_HALFTONE_RECT: ++; LDS F,RECTNC_X ++; STS RECT_X,F ++; LDS F,RECTNC_Y ++; STS RECT_Y,F ++; LDS F,RECTNC_XX ++; STS RECT_XX,F ++; LDS F,RECTNC_YY ++; STS RECT_YY,F ++ ++ LDI F,$02 ++ OR FLAGS,F ++ ++ RCALL DRAW_RECT ++ ++ LDI F,$FD ++ AND FLAGS,F ++ ++HALFTONE_RECT: ++ SEI ++ LDS LINE_CNT,RECT_Y ++ LDS XPIXEL,RECT_X ++ RCALL CALCULATE_XBYTE ++ STS XPIXEL_SAV,XPIXEL ++ STS XBYTE_SAV,XBYTE ++ LDS Y_SIZE,RECT_YY ++ CLR YL ++ MOV YH,LINE_CNT ++ LDI A,$55 ++ SBRS YH,0 ++ LDI A,$AA ++ MOV PATTERN,A ++ LSR YH ++ ROR YL ++ LSR YH ++ ROR YL ++ SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER ++ LDI A,HIGH(DRAW_DSPRAM>>6) ++ RCALL SELECT_XPAGE ++ RJMP X03A3 ++X039A: SUBI YL,LOW(-$40) ++ SBCI YH,HIGH(-$40) ++ INC LINE_CNT ++ LDS XPIXEL,XPIXEL_SAV ++ LDS XBYTE,XBYTE_SAV ++X03A3: OR XBYTE,YL ++ LDI A,$FF ++ LDS X_SIZE,RECT_XX ++ LDI F,$00 ++ CP X_SIZE,F ++ BREQ X03B0 ++ LDI F,$08 ++ CP X_SIZE,F ++ BRLO X03C2 ++ TST XPIXEL ++ BREQ X03B0 ++X03AD: LSR A ++ DEC XPIXEL ++ BRNE X03AD ++X03B0: AND A,PATTERN ++ RCALL WR_DISP_MEM ++ LDI F,$08 ++ LDS A,XPIXEL_SAV ++ SUB F,A ++ SUB X_SIZE,F ++ INC XBYTE ++ LDI A,$FF ++X03B8: LDI F,$08 ++ CP X_SIZE,F ++ BRLO X03C2 ++ BREQ X03D2 ++ AND A,PATTERN ++ RCALL WR_DISP_MEM ++ LDI A,$FF ++ LDI F,$08 ++ SUB X_SIZE,F ++ INC XBYTE ++ RJMP X03B8 ++X03C2: TST X_SIZE ++ BREQ X03D3 ++X03C4: LSR A ++ DEC X_SIZE ++ BRNE X03C4 ++ COM A ++ TST XPIXEL ++ BREQ X03D2 ++ CLR B ++X03CB: LSR A ++ ROR B ++ DEC XPIXEL ++ BRNE X03CB ++ AND A,PATTERN ++ RCALL WR_DISP_MEM ++ INC XBYTE ++ MOV A,B ++X03D2: AND A,PATTERN ++ RCALL WR_DISP_MEM ++X03D3: COM PATTERN ++ RCALL NICK_SUB1 ++ DEC Y_SIZE ++ CLR F ++ CPSE Y_SIZE,F ++ RJMP X039A ++ RET ++ ++; ----------------------------------------------------------------------------- ++ + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND diff --git a/src/avr/tsv3.asm b/src/avr/tsv3.asm new file mode 100644 index 00000000..7a71ddb6 --- /dev/null +++ b/src/avr/tsv3.asm @@ -0,0 +1,3708 @@ +; TSV3.ASM + +; 19FEB02 REVISE FOR GREATER CONTRAST VOLTAGE FOR ALBERT'S 2ND BATCH -15V +; 01FEB02 REVISE FOR 7.3728MHz XTAL (SEE !!!) + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS +; ;!! INDICATES CHANGES + +;** INDICATES CHANGES FOR LOW VCC AVR MOD + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APITS.INC" ; NOT API.INC BECAUSE APITS.INC ALSO HAS TURNON COMMAND +;.INCLUDE "TERTS.INC" ; NOT TER.INC BECAUSE FLAGS IN LOWER HALF OF REGISTER SET + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS XPAGE,YH + RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 +.ENDMACRO + +.MACRO A14_A18 + CLI + LDS R19,LATCH10_SAV ; AND THIS + EOR R19,@0 + ANDI R19,$E0 + EOR R19,@0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + SEI + STS LATCH10_SAV,R19 ; MUST BE ATOMIC DUE TO TOGGLING M +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@1 + + LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,1 + BST @1,6 ; A14 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + NOP + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO + OUT PORTA,@0 ; SELECT PHOTODIODE CHANNEL + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LED + OUT PORTA,@0 ; MAIN LED DRIVE PORT + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LEDLO + LDS D,LATCH12_SAV ; DRIVE LED COMMON LO + CBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO LEDHI + LDS D,LATCH12_SAV ; DRIVE LED COMMON HI + SBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKHI + LDS D,LATCH12_SAV ; DRIVE SPEAKER HI + SBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKLO + LDS D,LATCH12_SAV ; DRIVE SPEAKER LO + CBR D,1<<3 + SBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKOFF + LDS D,LATCH12_SAV ; DRIVE SPEAKER OFF + CBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.EQU T1_INIT =-818 ;$FB35 +.EQU T1_FULL_SCALE =-716 ;50.0HZ ; SETS LCD FRAME RATE TEMPORARY TO STOP FLIKER +;.EQU T1_FULL_SCALE =-651 ;53.5HZ ; SETS LCD FRAME RATE +;.EQU T1_FULL_SCALE =-600 ;54.8HZ ; SETS LCD FRAME RATE + +.EQU CONTRAST_LONG =-340 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +;.EQU CONTRAST_LONG =-250 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +.EQU CONTRAST_MID =-200 +.EQU CONTRAST_SHORT = -43 ; ALL SHORT PULSES IS FULLY LIGHT + +.EQU VCC_NOMINAL =-552 ;$FCC4 + +.EQU VEE_MIN =-710 ; MIN IS FULLY DARK +.EQU VEE_INIT =-340 +.EQU VEE_MAX = -43 ; MAX IS FULLY LIGHT + +; WHEN VCC = $FCC4 FOR 6.0V: +.EQU CONTRAST_MIN =-710 ; MIN IS FULLY DARK +.EQU CONTRAST_INIT =-640 +.EQU CONTRAST_MAX =-580 ; MAX IS FULLY LIGHT + +; GENEROUS LIMITS FOR EXPERIMENTATION: +;.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FE10 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =10 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$20 +.EQU RX_SIZE =$80 + +.EQU TK_LED_PULSE =14 ; 18US ?? CLOCKS OF /8 +.EQU TK_DELAY_0 =19 ; ??US DELAY TILL START OF LED PULSE (/8) +;.EQU TK_DELAY_0 =$20 ;$38 ; ??US DELAY TILL START OF LED PULSE +;.EQU TK_DELAY_0 =$25 ;$38 ; 54US ?? CLOCKS OF /8 +.EQU TK_DELAY_1 =$10 ;$28 ; CLOCKS OF /64, CHANNEL SELECT DELAY +.EQU TK_DELAY_2 =$00 ; CLOCKS OF /1024, VDD POWER ON DELAY + ; $D0 IS TOO SHORT, $E0 SEEMS TO WORK + +.EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$5F ;$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ;$05 ; DIVISOR FOR 115200 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 USED TO CONTROL LED PULSING FOR TOUCHSCREEN EVERY 2ND CYCLE +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +; for AVRA / TAVRASM: +;.def XL =R26 +;.def XH =R27 +;.def YL =R28 +;.def YH =R29 +;.def ZL =R30 +;.def ZH =R31 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +BUZZ_PERIOD: .BYTE 1 +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +XPAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +CHAR_X: .BYTE 1 +CHAR_Y: .BYTE 1 +CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC_64K: .BYTE 1 +TIME_HSEC_256: .BYTE 1 +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_STATE: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RJMP GO_TIM2_OVF ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_T1_OVERFLOW + RJMP GO_T0_OVERFLOW + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + LDI F,0 + STS TIME_HSEC_64K,F + STS TIME_HSEC_256,F + STS TIME_HSEC,F + STS TIME_SECOND,F + STS TIME_MINUTE,F + STS TIME_HOUR,F + LDI F,1 + STS DATE_DAY,F + STS DATE_MONTH,F + LDI F,20 + STS DATE_YEAR,F + +RESTART_ENTRY: +;**: + LDI F,8 ; TIMER 2 CLOCKED BY 32 KHZ +;** LDI F,0 ; TIMER 2 CLOCKED BY 11 MHZ + OUT ASSR,F +;**: + ; MUST MATCH SET_TIME ROUTINE % + LDI F,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;!! LDI F,$11 ; DIVIDE BY 2, TOGGLE OC2 (PIN 21) + ; (RTC DIAGNOSTIC) +;** LDI F,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,F + ; % + LDI F,$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + LDI F,$00 + OUT GIMSK,F + + LDI F,$B8 ; INIT_PORTS + OUT DDRD,F + OUT PORTD,F ; D2 = TRI-STATE, VSWT ON + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + OUT PORTC,F + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + + LDI D,$18 ; A18|A17|A16|A15|A14=11000 + OUT PORTA,D ; CL1=M=FLM=0 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BUZZ_TIME,D ; NOT BUZZING (SHORT BEEP COMES LATER) + + CLR SCAN + STS ROW_INDEX,SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + + LDI D,$F4 ; BIT 6 = 1 VDD ON, BIT 7 = 1 LCD ON + STS LATCH5_SAV,D + PHOTO D + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +RTNCDE: ;LDIZ RTN_CODE ; POINT Z TO FLASH + LDI ZL,LOW((RTN_CODE)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER + LDI XL,LOW((RTN_CODE_END-RTN_CODE)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((RTN_CODE_END-RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + CLR R0 ; TEMPORARY CLEAR KB + RAMWRX R0 ; WRITE DATA TO DSPRAM + DEC XL + BREQ RTNCDE_END ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CDE1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CDE0 +RTNCDE_END: + + ; INITIALISE DEFAULT CHARACTER SET + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + ;LDIZ CHSET00 ; POINT Z TO FLASH + LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + ; CLEAR REFRESH BUFFER TO AVOID A BRIEF FLICKER + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL GO_SELECT_XPAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +CLEAR_REFRESH: + PUSH B + PUSH YL + PUSH YH + + LDI B,32 + RCALL GO_CLEAR_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + ADIW YL,6 + LDI B,2 + RCALL GO_CLEAR_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP YH + POP YL + POP B + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE CLEAR_REFRESH + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,0 + STS BUZZ_PERIOD,A ; HIGHEST FREQUENCY + LDI A,54 ;$40 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + LDI A,0 + STS SCAN_STATE,A ; START ON FIRST LED / PHOTODIODE PAIR + + LDI A,0 + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + LDI F,$45 + OUT TIMSK,F ; TURN ON TIMER 0, 1, 2 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL HELLO_DISPLAY ; SHOW EXAMPLE DISPLAY + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + SBI PORTD,4 ; TURN TRANSISTOR OFF + CBI PORTD,5 ; DROP CL2 + + LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + LDI D,$74 ; BIT 6 = 1 VDD ON, BIT 7 = 0 LCD OFF + SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + LDI D,$34 ; BIT 6 = 0 VDD OFF, BIT 7 = 0 LCD OFF + STS LATCH5_SAV,D + PHOTO D + + LDI D,$41 + OUT TIMSK,D ; DISABLE TIMER 1 INTERRUPTS + + LDI D,0 + OUT TCCR0,D ; DISABLE TIMER 0 TEMPORARILY ONLY + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + + LDI F,4 + STS TURNON_COUNT,F ; .25 SEC TO BREAK, .75 SEC TO MAKE + + INIT_API_BUS ; RESET UART TO RECEIVE TURNON COMMAND + +SLEEP_LOOP: + CLI + IN F,TCCR0 + TST F + LDI F,$4A ; SE=1 SM1:SM0=00 FOR IDLE MODE + BRNE SLEEP_SETUP ; TIMER 0 RUNNING, STAY IN IDLE MODE + SBIS PIND,0 ; BREAK OFF, UART ACTIVE, STAY IN IDLE + LDI F,$7A ; SE=1 SM1:SM0=11 FOR POWER SAVE MODE +SLEEP_SETUP: + OUT MCUCR,F + SEI + SLEEP + + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDS F,TURNON_COUNT + TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;SBIS PIND,0 ; AND BREAK HAS DISAPPEARED, WAKE UP + BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP + + CLI + RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + +; ----------------------------------------------------------------------------- + +ADRYP: LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL + OUT PORTA,YH + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,XPAGE +; INC YH +; ANDI YH,$1F +; STS XPAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +;HELLO_DISPLAY: +; LDI A,0 +; STS RECTNC_X,A +; STS RECTNC_Y,A +; STS RECTNC_XX,A +; LDI A,$80 +; STS RECTNC_YY,A +; RCALL DRAW_RECTNC +; +; LDI A,16 +; STS CHAR_X,A +; STS CHAR_Y,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; RCALL STRING_DRAW +; +; LDI A,240 +; STS CHAR_X,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; +;STRING_RIGHT_JUST: +; PUSH B +; PUSH ZL +; PUSH ZH +; RCALL STRING_WIDTH +; POP ZH +; POP ZL +; POP B +; LDS A,CHAR_X +; SUB A,R0 +; STS CHAR_X,A +; +;STRING_DRAW: +; PUSH B +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; PUSH R0 +; RCALL DRAW_CHAR +; POP R0 +; POP ZH +; POP ZL +; LDS A,CHAR_X +; ADD A,R0 +; STS CHAR_X,A +; POP B +; DEC B +; BRNE STRING_DRAW +; RET +; +;STRING_WIDTH: +; CLR R0 +;STRING_WIDTH_LOOP: +; PUSH B +; PUSH R0 +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; POP ZH +; POP ZL +; POP A +; ADD R0,A +; POP B +; DEC B +; BRNE STRING_WIDTH_LOOP +; RET +; +;HELLO_MESSAGE: .DB 'H','E','L','L','O',0 + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +SET_TIME: + LDI A,0 + OUT TCCR2,A ; STOP COUNTING WHILE SETTING CLOCK + STS TIME_HSEC_64K,A + STS TIME_HSEC_256,A + STS TIME_HSEC,A + RCALL RX_WAIT + STS TIME_HOUR,A + RCALL RX_WAIT + STS TIME_MINUTE,A + RCALL RX_WAIT + STS TIME_SECOND,A + RCALL RX_WAIT + STS DATE_MONTH,A + RCALL RX_WAIT + STS DATE_DAY,A + RCALL RX_WAIT + STS DATE_YEAR,A + LDI A,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;** LDI A,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,A + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE +;L01A3: + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: CLR CURSORX + RJMP MAIN_LOOP + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST ; 20mar03 tavrasm *2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST+1 ; 20mar03 tavrasm *2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRCC DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRCC DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + RCALL FIND_CHAR ; SET UP CHAR_PTR FROM A = CHAR + RCALL CHAR_WIDTH ; SET UP R0 = PROP WIDTH FROM CHAR PTR + + CLR F + STS TEMP,F ; NUDGE FOR FIXED SPACING MODE + + SBRC FLAGS,4 + RJMP PROP_MODE ; FORCED TO FIXED SPACING MODE? + + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS ; GET R0 = CELL WIDTH FOR CHARACTER SET + PUSH R0 + SUB R0,W + BRCC NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + POP R0 ; RESTORE R0 = FIXED CELL WIDTH + +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE ; FORCED TO GRAPHICS MODE? + + MOV F,CURSORX + ADD F,R0 ; CHECK IF CHAR WILL FIT ON THIS LINE + BRCC OK_LINE + + CLR CURSORX + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 + RCALL SELECT_XPAGE ; IN CASE WE SCROLLED THE DISPLAY + +OK_LINE: + LDS F,TEMP + ADD F,CURSORX + STS CHAR_X,F + STS CHAR_Y,CURSORY ; SET UP TOP LEFT COORDINATES + + ADD CURSORX,R0 ; ADVANCE CURSOR + +DRAW_CHAR: + LDS XPIXEL,CHAR_X + LDS LINE_CNT,CHAR_Y + + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE ; Y OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 + +Y_OFFSET_DONE: + SBRS X_SIZE,7 + RJMP X_OFFSET_DONE ; X OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$03 + RCALL LPMS + ADD XPIXEL,R0 + +X_OFFSET_DONE: + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + ADIW YL,$01 + RCALL LPMS ; GET R0 = Y LINES FOR CHARACTER + MOV Y_SIZE,R0 + + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +FIND_CHAR: + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + STS CHAR_PTR,YL + STS CHAR_PTR+1,YH + RET + +CHAR_WIDTH: + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + RCALL LPMS + MOV X_SIZE,R0 + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP LPMS ; PROPORTIONAL WIDTH IS PRESENT + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RJMP LPMS ; NO PROPORTIONAL WIDTH, USE CELL WIDTH + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + ; LET'S BE SAFE + ANDI A,$7F + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +GO_SELECT_XPAGE: + RJMP SELECT_XPAGE + +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +GO_EXT_INT0: + RJMP EXT_INT0 + +GO_EXT_INT1: + RJMP EXT_INT1 + +GO_TIM2_OVF: + RJMP TIM2_OVF + +GO_T1_OVERFLOW: + RJMP T1_OVERFLOW + +GO_T0_OVERFLOW: + RJMP T0_OVERFLOW + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +; ----------------------------------------------------------------------------- + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +; ----------------------------------------------------------------------------- + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR CURSORX ; HOME CURSOR + CLR CURSORY + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE +CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE CLEAR_DISPLAY_LOOP + RET + +; ----------------------------------------------------------------------------- + +EXT_INT0: +;**: +RETI +;** IN SR,SREG ; MEASURE VCC +;** SBI DDRD,2 +;** IN C,TCNT1L +;** IN D,TCNT1H +;** STS VCCH,D +;** STS VCCL,C +;** RJMP EXT_INT_RET + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP EXT_INT_RET + +T1_OVERFLOW: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDI D,$70 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, TOGGLE OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + LDS C,CLOCKING_PTR +; TST C ; START OF 4 LINE BLOCK? (1 BASED) + lds d,CLOCKING_PTR+1 + andi d,1 + or c,d ; checks for start of an 8 line block +; rjmp BREAK0 ; temporary (prevents switching off via power switch) + BRNE BREAK0 ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK1 ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION +GO_SLEEP_ENTRY: + RJMP SLEEP_ENTRY + +BREAK0: NOP + NOP + NOP + NOP + NOP + NOP + NOP +BREAK1: SBI DDRD,3 ; PRECHARGE TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D ; STOP TIMER1 + OUT TCNT1H,D ; AND CLEAR COUNT + OUT TCNT1L,D + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + LDS D,LATCH10_SAV + OUT PORTA,D + SBI PORTB,4 + SBI PORTA,5 ; PULSE CL1 + CBI PORTA,5 + CBI PORTB,4 + NOP ; EQUALIZE DELAY + NOP + NOP + NOP + NOP + NOP + RJMP L04F9 + +L04E6: LDS D,LATCH10_SAV + ORI D,$80 ; RAISE FLM + ORI D,$20 ; RAISE CL1 + OUT PORTA,D + + SBI PORTB,4 + LDI C,$60 ; TOGGLE M AND CL1 + EOR D,C + OUT PORTA,D + ANDI D,$7F ; DROP FLM + OUT PORTA,D + CBI PORTB,4 + STS LATCH10_SAV,D + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D + +; LDI D,1 ; TO CLOCK AT 5.5/2 MHZ + OUT OCR1AL,D ; TO CLOCK AT 7.3/2 MHZ + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + +;!!! LDI D,$7A ; WAIT FOR 32uSEC +; LDI D,58 ;$7A ; WAIT FOR 32uSEC GOOD + LDI D,60 ; WAIT FOR 32uSEC +; LDI D,61 ;$7A ; WAIT FOR 32uSEC +; LDI D,62 ;$7A ; WAIT FOR 32uSEC GOOD + +L050E: DEC D + BRNE L050E + + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + LDI D,$01 ; KILL CLR ON COMPARE MATCH + NOP ; !WITH OC1A LEFT IN LOW STATE + OUT TCCR1B,D + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0536 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + RJMP L0536 + +L0535: NOP ; EQUALIZE DELAYS + NOP + NOP + NOP +L0536: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VEEL + LDS D,VEEH + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + NOP + NOP + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,2 ; SET TIME FOR START OF LED PULSE + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_DELAY_0 ; 54uSEC + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,3 ; START TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + + RJMP T1_OVERFLOW_RET + +T0_OVERFLOW: + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + PUSH ZH + PUSH ZL + PUSH R0 + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_STATE + INC D + STS SCAN_STATE,D + DEC D + BREQ SCAN_START ; IF SCAN_STATE WAS = 0 + DEC D + BREQ SCAN_BEEPER ; IF SCAN_STATE WAS = 1 + ; IMPLEMENT ENTRY POINT FOR SCAN_PULSE_LED HERE + DEC D + RJEQ SCAN_PHOTO ; IF SCAN_STATE WAS = 2 + +T0_OVERFLOW_RET: + POP R0 + POP ZL + POP ZH + +T1_OVERFLOW_RET: + POP D ; RESTORE STATE OF THE WORLD + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +EXT_INT_RET: + OUT SREG,SR + RETI + +SCAN_START: + LDI D,3 ;5 + OUT TCCR0,D ; PRESCALE=CK/1024 + LDI D,-TK_DELAY_1 ;TK_DELAY_2 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + RJMP L0617_RESET + +SCAN_BEEPER: + LDS D,BUZZ_TIME + TST D + BREQ SCAN_PULSE_LED + LDS D,BUZZ_PERIOD + SUBI D,$10 + BRLO BUZZ_TOGGLE + STS BUZZ_PERIOD,D + RJMP SCAN_PULSE_LED +BUZZ_TOGGLE: ; ASSUME D = $F0 + PERIOD-1 + MOV C,D ; EG. C = $F3 FOR PERIOD = 4 + SWAP C ; EG. C = $3F FOR PERIOD = 4 + AND D,C ; EG. D = $33 FOR PERIOD = 4 + STS BUZZ_PERIOD,D + LDS C,LATCH12_SAV + SBRS C,3 ; TEST PREVIOUS SPEAKER STATE + RJMP BEEPER_SPKHI + LDS D,BUZZ_TIME + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP SCAN_PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP SCAN_PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +SCAN_PULSE_LED: + LDS D,LATCH5_SAV +;**: + SBRS D,7 ; ARE WE INSIDE SLEEP_LOOP? +;** SBRC D,7 + RJMP SCAN_PULSE_LED_OK ; YES, KEEP TIMER 0 TO RETAIN CONTROL + + LDI D,1<<7 + EOR FLAGS,D + BRPL SCAN_PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP T0_OVERFLOW_RET ; AND WASTE EVERY REMAINING CYCLE + +SCAN_PULSE_LED_OK: + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + + ;LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM ; R0 = LED DRIVE VALUE + LDI D,13*4 + CP SCAN,D + BRSH L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + RJMP T0_OVERFLOW_RET + +SCAN_PHOTO: + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + CLC + SBRC D,6 + RJMP L0593 ; ROW/COLUMN IS INACTIVE + + ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF + IN C,SREG + + LDI D,13*4 + CP SCAN,D + BRSH L05A8 + + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS ZL,ROW_BITMAP + LDS ZH,ROW_BITMAP+1 + ROL ZL + ROL ZH + STS ROW_BITMAP,ZL + STS ROW_BITMAP+1,ZH + RJMP L05F9 + +L05A8: ; WE HAVE A COLUMN STATUS +; LDS D,LATCH5_SAV +;;**: +; SBRS D,7 ; TURNED OFF? +;;** SBRC D,7 +; RJMP L05F9 ; YES, NO FURTHER PROCESSING + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRCS L05AB + RJMP L05F9 + +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 + +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS ZH,ROW_BITMAP+1 + LDS ZL,ROW_BITMAP + + LDS D,ROW_INDEX + TST D + BREQ ROW_BITMAP_LOOP + + MOV C,D +ROW_BITMAP_SKIP: + ROR ZH + ROR ZL + SUBI C,4 + BRNE ROW_BITMAP_SKIP + +ROW_BITMAP_LOOP: + SUBI D,-4 + ROR ZH + ROR ZL + BRCS FOUND_INTERSECTION +ROW_BITMAP_LOOPE: + CPI D,13*4 + BRLO ROW_BITMAP_LOOP + + ; NO FURTHER INTERSECTING ROWS FOUND + RJMP L05F9 + +FOUND_INTERSECTION: + ; FOUND AN INTERSECTING ROW FOR COLUMN + STS ROW_INDEX,D + + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + TST R0 + BRNE VALID_INTERSECTION + + ; INTERSECTION IS NULL, GO ON TO NEXT + LDS D,ROW_INDEX + CPI D,13*4 + BRSH L05F9 ; DONE LAST ROW, GO ON TO NEXT COLUMN +GO_L0617: + RJMP L0617 ; GO ON TO NEXT ROW, SAME COLUMN + +VALID_INTERSECTION: + ; INTERSECTION IS VALID, WE HAVE KEY MAKE + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,54 ;43 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + + MOV D,TX_COUNT + CPI D,TX_SIZE-1 + BRSH L05F9 + + PUSH A + MOV A,R0 + RCALL TX_CHAR + CPI A,$1B + BRNE TX_CONT + RCALL TX_CHAR +TX_CONT: + POP A + +L05F9: + LDI D,4 ; SCAN TO NEXT LED / PHOTODIODE PAIR + ADD SCAN,D + + LDS D,LATCH5_SAV + SBRC D,7 + RJMP TURNED_ON + + LDI D,3 + OUT TCCR0,D ; PRESCALE=CK/64 + LDI D,-TK_DELAY_1 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI C,13*4 + CP SCAN,C + BRLO GO_L0617 + + ; KEEP VDD ON, TO AVOID THE LONG TK_DELAY_2 + ;LDS D,LATCH5_SAV + ;ANDI D,$BF ; BIT 6 = 0 VDD OFF + ;STS LATCH5_SAV,D + ;PHOTO D ; READY TO SLEEP FOR ANOTHER 0.25 SEC + + LDI D,0 + OUT TCCR0,D ; STOP TIMER SINCE COMPLETE SCAN DONE + ;RJMP T0_OVERFLOW_RET + + ;LDI D,$05 + ;OUT UBRR,D + ;LDI D,$18 + ;OUT UCR,D + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + ;OUT UDR,C + ;OUT UDR,D + OR C,D ; HAVE WE SOME ACTIVITY? + + LDS D,TURNON_COUNT + CPI D,4 + BRSH TURNON_BREAK ; WAITING FOR BREAK + CPI D,1 + BRSH TURNON_MAKE ; WAITING FOR MAKE +GO_T0_OVERFLOW_RET: + RJMP T0_OVERFLOW_RET ; ALREADY HAD MAKE, NOT TURNED ON YET + +TURNON_BREAK: + TST C ; HAD SOME ACTIVITY? + BREQ TURNON_SAVE ; NO, COUNT DOWN TO BREAK + LDI D,4+1 ; YES, RESTART COUNTDOWN TO BREAK + RJMP TURNON_SAVE +TURNON_MAKE: + TST C ; HAD SOME ACTIVITY? + BRNE TURNON_SAVE ; YES, COUNT DOWN TO MAKE + LDI D,3+1 ; NO, RESTART COUNTDOWN TO MAKE +TURNON_SAVE: + DEC D ; COUNT DOWN TO MAKE OR BREAK + STS TURNON_COUNT,D + BRNE GO_T0_OVERFLOW_RET ; NOT READY TO TRY TURNON YET + + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + CBI DDRD,2 ; D2 = TRI-STATE, VSWT ON + RJMP GO_SLEEP_ENTRY ; WE WILL NOW WAIT FOR TURNON COMMAND + +TURNED_ON: + LDI D,0 ; STOP TIMER, WE WILL REGAIN + OUT TCCR0,D ; CONTROL VIA NEXT CLOCKING INTERRUPT + STS ROW_INDEX,D + + LDI C,50*4 + CP SCAN,C + BRLO L0617 + + LDS D,DEBOUNCE ; COMPLETED ENTIRE SCAN, START NEW SCAN + TST D + BREQ L0617_RESET + DEC D + STS DEBOUNCE,D + BRNE L0617_RESET + + LDS D,ACTIVE_ZONE + TST D + BREQ L0617_RESET + + MOV D,TX_COUNT + CPI D,TX_SIZE + BRSH L0617_RESET + + PUSH A + LDI A,0 + RCALL TX_CHAR + POP A + +L0617_RESET: + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + ;LDIZ SCAN_TBL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$80 ; BIT 7 = PRESERVED, LCD ON/OFF STATUS + ORI D,$40 ; BIT 6 = 1 VDD ON + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + RJMP T0_OVERFLOW_RET + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP CLEAR_DISPLAY_LOOP + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_XPAGE: + A14_A18 A + RET + +; HOW MANY SECS/6553600 PER 4HZ INTERRUPT ? +; EACH TIME THROUGH ADD 1638400 SECS/6553600 = 1/4 SEC +; OSCILLATOR IS SLOW SO WE WILL ADD 1 PART IN 10000 +; HENCE EACH TIME THROUGH ADD 1638400+164 = 1638564 UNITS TO COUNT + +TIM2_OVF: + IN SR,SREG + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +;!! LDI A,$10 ; DIAGNOSTIC +;!! STS BUZZ_TIME,A ; SHORT BEEP + + LDS D,TIME_HSEC_64K + SUBI D,LOW(-1638564) + STS TIME_HSEC_64K,D + + LDS D,TIME_HSEC_256 + SBCI D,HIGH(-1638564) + STS TIME_HSEC_256,D + + LDS D,TIME_HSEC + SBCI D,HIGH(-1638564>>8) + CPI D,100 + BRSH TIM2_CARRY + STS TIME_HSEC,D + +TIM2_END: + OUT SREG,SR + SBRS FLAGS,6 ; IF WE TURNED OFF VIA COMMAND, + RETI ; START A NEW SCAN, OTHERWISE DONE + + LDI D,0 + STS SCAN_STATE,D ; WE WILL EXECUTE SCAN_START ROUTINE + RJMP T0_OVERFLOW ; GO AND TURN VDD ON + +GO_TX_CHAR: + RJMP TX_CHAR + +TIM2_CARRY: + LDI D,0 + STS TIME_HSEC,D + + LDS D,TIME_SECOND + INC D + CPI D,60 + BRLO TIM2_SECOND + + LDS D,TIME_MINUTE + INC D + CPI D,60 + BRLO TIM2_MINUTE + + LDS D,TIME_HOUR + INC D + CPI D,24 + BRLO TIM2_HOUR + + PUSH ZL + PUSH ZH + PUSH R0 + LDI ZL,LOW(MONTH_TABLE*2-1) + LDI ZH,HIGH(MONTH_TABLE*2-1) + LDS E,DATE_MONTH + ADD ZL,E + LDI E,0 + ADC ZH,E + LPM + MOV E,R0 + CPI E,28 + BRNE FEBRUARY_OK + LDS E,DATE_YEAR + ANDI E,3 + LDI E,28 + BRNE FEBRUARY_OK + LDI E,29 +FEBRUARY_OK: + POP R0 + POP ZH + POP ZL + + LDS D,DATE_DAY + CP D,E + BRLO TIM2_DAY + + LDS D,DATE_MONTH + CPI D,12 + BRLO TIM2_MONTH + + LDS D,DATE_YEAR + INC D + STS DATE_YEAR,D + CLR D +TIM2_MONTH: + INC D + STS DATE_MONTH,D + CLR D +TIM2_DAY: + INC D + STS DATE_DAY,D + CLR D +TIM2_HOUR: + STS TIME_HOUR,D + CLR D +TIM2_MINUTE: + STS TIME_MINUTE,D + CLR D +TIM2_SECOND: + STS TIME_SECOND,D + +TIM2_SEND: + MOV D,TX_COUNT + CPI D,TX_SIZE-7 + BRSH TIM2_SEND_SKIP + + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'T' + RCALL TX_CHAR +; LDS A,VCCL +; RCALL TX_CHAR +; LDS A,VCCH +; RCALL TX_CHAR +; LDS A,VEEL +; RCALL TX_CHAR +; LDS A,VEEH +; RCALL TX_CHAR +; LDI A,$0D +; RCALL TX_CHAR + LDS A,TIME_HOUR + RCALL GO_TX_CHAR + LDS A,TIME_MINUTE + RCALL GO_TX_CHAR + LDS A,TIME_SECOND + RCALL GO_TX_CHAR + LDS A,DATE_MONTH + RCALL GO_TX_CHAR + LDS A,DATE_DAY + RCALL GO_TX_CHAR + LDS A,DATE_YEAR + RCALL GO_TX_CHAR + POP A + +TIM2_SEND_SKIP: + RJMP TIM2_END + +; ----------------------------------------------------------------------------- + +MONTH_TABLE: + .DB 31,28,31,30,31,30,31,31,30,31,30,31 + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: +.INCLUDE "CHSET00.INC" +CHSET00_END: + +; ----------------------------------------------------------------------------- + +GET_CLEAR_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL CLEAR_FRAME_RECT + RJMP MAIN_LOOP + +GET_FRAME_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FRAME_RECT + RJMP MAIN_LOOP + +GET_CLEAR_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL CLEAR_HALFTONE_RECT + RJMP MAIN_LOOP + +GET_HALFTONE_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL HALFTONE_RECT + RJMP MAIN_LOOP + +NO_GOX: RET + +CLEAR_FRAME_RECT: + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS F,RECTNC_YY + STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +FRAME_RECT: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GOX + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GOX + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS F,RECTNC_YY + SUBI F,2 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_XX + STS RECT_XX,F + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +CLEAR_HALFTONE_RECT: +; LDS F,RECTNC_X +; STS RECT_X,F +; LDS F,RECTNC_Y +; STS RECT_Y,F +; LDS F,RECTNC_XX +; STS RECT_XX,F +; LDS F,RECTNC_YY +; STS RECT_YY,F + + LDI F,$02 + OR FLAGS,F + + RCALL DRAW_RECT + + LDI F,$FD + AND FLAGS,F + +HALFTONE_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LDI A,$55 + SBRS YH,0 + LDI A,$AA + MOV PATTERN,A + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP X03A3 +X039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +X03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ X03B0 + LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + TST XPIXEL + BREQ X03B0 +X03AD: LSR A + DEC XPIXEL + BRNE X03AD +X03B0: AND A,PATTERN + RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +X03B8: LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + BREQ X03D2 + AND A,PATTERN + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP X03B8 +X03C2: TST X_SIZE + BREQ X03D3 +X03C4: LSR A + DEC X_SIZE + BRNE X03C4 + COM A + TST XPIXEL + BREQ X03D2 + CLR B +X03CB: LSR A + ROR B + DEC XPIXEL + BRNE X03CB + AND A,PATTERN + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +X03D2: AND A,PATTERN + RCALL WR_DISP_MEM +X03D3: COM PATTERN + RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP X039A + RET + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/wpo15v1.asm b/src/avr/wpo15v1.asm new file mode 100644 index 00000000..c717da5e --- /dev/null +++ b/src/avr/wpo15v1.asm @@ -0,0 +1,2186 @@ +; WPO15V1.ASM + +; LOOK FOR BIGBODGE TO SEE CEC'S CHANGES TO FIX STARTUP PROBLEM +; AND TO SKIP VOLTAGE MEASURING + +; REVISED 17DEC01 TO SUPPORT NEW HARDWARE TYPE 3 FOR HYT1500 + +; REVISED 18DEC01 TO TRY A CONSERVATIVE 4.5 VOLT SHUTDOWN, LOW BATTERY +; THIS DOESN'T PROTECT AGAINST REBOOTING WHILE PRINTING, TOO BAD + +; REVISED 18DEC01 TO TRY AN AGGRESSIVE 5.5 VOLT SHUTDOWN, LOW BATTERY +; ALSO ENABLED THE 4.5 VOLT IMMEDIATE RESET, DUE TO UNRELIABLE OPERATION +; NOW TRYING 5.0 VOLT IMMEDIATE RESET, CEC SAYS IT WAS MARGINAL ANYWAY + +; NOW DISABLED THE IMMEDIATE RESET DUE TO TESTING RESULTS OF 08JAN02 +; NOT SURE IF THAT WAS REALLY THE PROBLEM - BUT WISH TO BE CONSERVATIVE + +; REVISED 01FEB02 FOR NEW 7.3728 MHZ XTAL, PREVIOUSLY 11.0592 MHZ, 2/3 +; LOOK FOR ;! TO SEE CHANGES FOR 7.3728 MHZ XTAL, ADDED COMMENTS ALSO + +; ----------------------------------------------------------------------------- + +.EQU LARGE =1 + +;IF LARGE +.INCLUDE "8535DEF.INC" +;ELSE +;.INCLUDE "4433DEF.INC" +;ENDIF + +; ----------------------------------------------------------------------------- +; API BUS TIMING CALCULATIONS: + +; 115200 BITS/SEC = 11520 BYTES/SEC = 86.8 US/BYTE + +; FOR MASTER API BUS TX, SEND 1 BYTE PER 9+12 BIT-TIMES, 24 TO BE SAFE +; SO THE CORRECT TX RATE = 86.8 * 2.4 = 200.8 US/BYTE = 4980 BYTES/SEC + +; A SUBTLE OPTIMISATION IS POSSIBLE WHEN THE PREVIOUS TRANSMITTED LSB IS 0, +; AS WE CAN THEN GUARANTEE THE 4800 BPS RECEIVERS WILL SEE FALSE START BIT: + +; FOR MASTER API BUS TX EVEN, SEND 1 BYTE PER 2+12 BIT-TIMES, 16 TO BE SAFE +; SO THE CORRECT TX RATE EVEN = 86.8 * 1.6 = 138.9 US/BYTE = 7199 BYTES/SEC + +; OLD: TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ = APPROX 185 US +; NEW: TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ = APPROX 278 US +; THUS ALL THE TIMEOUT VALUES BELOW HAVE BEEN DECREASED TO 2/3 ORIGINAL + +; NEW: THE EVEN/ODD TX RATE OPTIMISATION HAS BEEN DISABLED AS WE DON'T +; HAVE ENOUGH RESOLUTION WITH THE 7.3728 MHZ XTAL / 8 TO GENERATE 138.9 +; US/BYTE DELAY, BECAUSE MINIMUM UNIT IS NOW 278 US INSTEAD OF 185 US, +; THIS COULD BE IMPROVED LATER, BUT FOR NOW, WE GENERATE AN INTERRUPT +; EVERY 278 US, AND THE NEXT AVAILABLE TCK0 DIVIDER IS /1 SO THIS WOULD +; BECOME 34.8 US, THIS WOULD BE UNACCEPTABLE, SO REVISIT THE ISSUE LATER + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_TIMEOUT =16 ;!25 ; 25 * 0.185 MS = 4.6 MS +.EQU API_TIME_IDLE =8 ;!13 ; 13 * 0.185 MS = 2.4 MS +.EQU API_TIME_SLOW =8 ;!13 ; 25 * 0.185 MS = 2.4 MS +.EQU API_TIME_FAST =1 ;!2 ; 2 * 185 US = 370 US, NOW 1 * 278 US +.EQU API_RATE_SLOW =$5F ;!$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ;!$05 ; DIVISOR FOR 115200 BPS + +.EQU SPI_TIMEOUT =16 ;!25 ; 100 * 100 US = APPROX 10.0 MS + +;.def drem16uL =R0 ; remainder low +;.def drem16uH =R1 ; remainder high +;.def dres16uL =R2 ; result low DON'T use as general purpose +;.def dres16uH =R3 ; result high DON'T use as general purpose +;.def dd16uL =R2 ; dividend low +;.def dd16uH =R3 ; dividend high +;.def dv16uL =R4 ; divisor low +;.def dv16uH =R5 ; divisor high +; +;.DEF SPI_REMAIN =R6 +; +;.def mc16uL =R7 ;multiplicand low byte +;.def mc16uH =R8 ;multiplicand high byte +;.def mp16uL =R9 ;multiplier low byte +;.def mp16uH =R10 ;multiplier high byte +;.def m16u0 =R9 ;result byte 0 (LSB) +;.def m16u1 =R10 ;result byte 1 +;.def m16u2 =R11 ;result byte 2 +;.def m16u3 =R12 ;result byte 3 (MSB) +; +;.DEF RX_PTR =R13 +;.DEF RX_COUNT0 =R14 + +.DEF API_REMAIN =R1 +.DEF API_WATCHDOG =R2 +.DEF SPI_REMAIN =R3 +.DEF SPI_WATCHDOG =R4 +.DEF RX_PTR =R5 +.DEF RX_COUNT0 =R6 +.DEF RX_COUNT1 =R7 +.DEF TX_PTR =R8 +.DEF TX_COUNT0 =R9 +.DEF TX_COUNT1 =R10 + +.DEF SR =R15 +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R23 +.DEF G =R24 + +.DEF FLAGS =R20 +;.def counter =R20 ;loop counter + +.DEF ATOD =R21 ; SO YOU CAN USE SBCI, SUBI, CPI ETC + +.DEF API_STATE =R22 + +;.DEF TX_PTR =R25 +;.DEF API_WATCHDOG =R26 +;.DEF API_REMAIN =R27 +;.DEF SPI_WATCHDOG =R28 +;.DEF TX_COUNT0 =R29 + +.EQU TX_SIZE =$40 +.EQU RX_SIZE =$10 + + .DSEG + .ORG $60 + +VSWTS: .BYTE 1 ; RETAIN ORDERING % +VCHGS: .BYTE 1 +NEGVS: .BYTE 1 + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +TX_ADDRESS0: .BYTE 1 ; DEST FOR TX_COUNT0 BYTES AT HEAD +TX_ADDRESS1: .BYTE 1 ; DEST FOR TX_COUNT1 BYTES AT TAIL + +RX_ADDRESS0: .BYTE 1 ; SOURCE FOR RX_COUNT0 BYTES AT HEAD +RX_ADDRESS1: .BYTE 1 ; SOURCE FOR RX_COUNT1 BYTES AT TAIL + +RX_ADDRESS2: .BYTE 1 ; ALTERNATE VALUE FOR RX_ADDRESS1 + ; SCAN IS 1,2,1,3,1,4,1,5,1,6,1,7,1,8 + +TX_OVERRIDE: .BYTE 1 ; COUNTER TO TRANSMIT 1 TIME IN 16 +RX_OVERRIDE: .BYTE 1 ; COUNTER TO RECEIVE 1 TIME IN 16 + +TX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME TX DEVICE +RX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME RX DEVICE + +;ABSENT_COUNT: .BYTE 1 + +TURNOFF_COUNT: .BYTE 1 +WATCHDOG_COUNT: .BYTE 2 + +TX_LIMIT: .BYTE 9 ; MAX Z180 BYTES TO ACCEPT, PER DEVICE + +BATTERY_COUNT: .BYTE 2 ; COUNT 1024 ADC READINGS TO POWER DOWN + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +;LM385_COUNT: .BYTE 1 ; COUNT $10 ADC READINGS TO MISSING REF +VOLTAGE_VSWT: .BYTE 1 ; MOST RECENT ADC READING FROM REF + +HARDWARE_TYPE: .BYTE 1 ; COMES SOMEWHAT BEFORE RSEL HI COMMAND + +STACK_GUARD: .BYTE 1 ; DETECTS IF STACK COMES DOWN TO HERE + +; ----------------------------------------------------------------------------- + +; API_STATE DEFINITIONS +.EQU SPISIZE =0 ; SET IF EXPECTING SPI DATA SIZE CMD +.EQU SPIWAIT =1 ; SET IF SENDING SPI ADDRESS RESPONSE +.EQU SPIDATA =2 ; SET IF TRANSFERRING SPI DATA TX/RX +.EQU SPIDIRN =3 ; SET IF TX, BASED ON ADDRESS COMMAND +.EQU APISIZE =4 ; SET IF NEED TO SEND API DATA SIZE CMD +.EQU APIWAIT =5 ; SET IF WAITING FOR API DATA SIZE RESP +.EQU APIDATA =6 ; SET IF TRANSFERRING API DATA TX/RX +.EQU APIDIRN =7 ; SET IF TX, TOGGLED ON NULL TRANSFER + +; ----------------------------------------------------------------------------- + +;IF LARGE + +.EQU IRQ =6 +.EQU IRQ_PORT =PORTA +.EQU IRQ_DDR =DDRA + +.EQU PRG =3 +.EQU PRG_PORT =PORTB +.EQU PRG_DDR =DDRB + +.EQU OC1 =5 +.EQU OC1_PORT =PORTD +.EQU OC1_DDR =DDRD + +.EQU OCR1H =OCR1AH +.EQU OCR1L =OCR1AL + +.EQU COM10 =COM1A0 +.EQU COM11 =COM1A1 + +;ELSE +; +;.EQU IRQ =0 +;.EQU IRQ_PORT =PORTB +;.EQU IRQ_DDR =DDRB +; +;.EQU PRG =2 +;.EQU PRG_PORT =PORTC +;.EQU PRG_DDR =DDRC +; +;.EQU OC1 =1 +;.EQU OC1_PORT =PORTB +;.EQU OC1_DDR =DDRB +; +;.EQU USR =UCSRA +;.EQU UCR =UCSRB +; +;ENDIF + +; ----------------------------------------------------------------------------- + + .CSEG + + RJMP RESET_ENTRY + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER 0 OVERFLOW HANDLER + + .ORG SPIADDR + RJMP SPI_COMPLETE ; SPI TRANSFER COMPLETE HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + + .ORG ADCCaddr + RJMP ADC_COMPLETE + +; ----------------------------------------------------------------------------- + +RESET_ENTRY: + ; INITIALISE AVR +;IF LARGE + LDI A,HIGH(RAMEND) + OUT SPH,A +;ENDIF + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + ; INITIALISE STACK GUARD + LDI A,$5A + STS STACK_GUARD,A + + ; INITIALISE PORTS + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + LDI A,0 + OUT SPCR,A ; DISABLE SPI WHILE RESETTING Z180 + OUT UCR,A ; DISABLE UART WHILE RESETTING SLAVES + +;IF LARGE + LDI A,$FF + OUT DDRC,A ; PORTC CONFIGURED AS OUTPUT + + SBI PORTB,7 ; PB7/SCK CONFIGURED AS PULLED UP INPUT + SBI DDRB,6 ; PB6/MISO CONFIGURED AS OUTPUT + + SBI DDRA,7 ; A7 CONFIGURED AS OUTPUT FOR DTR1 + SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 + +; 18DEC01 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +; SBI PORTA,4 ; A4 PULLED UP TO DETECT MISSING LM385 +;ELSE +; SBI PORTB,5 ; PB5/SCK CONFIGURED AS PULLED UP INPUT +; SBI DDRB,4 ; PB4/MISO CONFIGURED AS OUTPUT +; +; SBI DDRD,5 ; D5 CONFIGURED AS OUTPUT FOR DTR1 +; SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 +; +; SBI PORTC,4 ; C4 PULLED UP TO DETECT MISSING LM385 +;ENDIF + + SBI PORTD,2 ; D2 CONFIGURED AS PULL UP FOR IBM CLK + SBI PORTD,3 ; D3 CONFIGURED AS PULL UP FOR IBM DATA + + SBI OC1_PORT,OC1 + SBI OC1_DDR,OC1 ; OUTPUT OC1 = 1, PWM TRANSISTOR OFF + + CBI IRQ_PORT,IRQ + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + CBI PORTD,7 + SBI DDRD,7 ; OUTPUT RSEL = 0 + + CBI PORTD,4 + SBI DDRD,4 ; OUTPUT RES = 0 + + ; HARD RESET API BUS DEVICES + CBI PRG_PORT,PRG + SBI PRG_DDR,PRG ; OUTPUT PRG = 0 + + CBI PORTD,1 + SBI DDRD,1 ; OUTPUT TXD = 0 + + LDI A,7 + RCALL PRG_RESET ; SPECIFIC RESET SPARE + + LDI A,6 + RCALL PRG_RESET ; SPECIFIC RESET M192 RECEIPT PRINTER + + LDI A,5 + RCALL PRG_RESET ; SPECIFIC RESET M192 LABEL PRINTER + + LDI A,4 + RCALL PRG_RESET ; SPECIFIC RESET MT102 RECEIPT PRINTER + + ;LDI A,3 + ;RCALL PRG_RESET ; SPECIFIC RESET SPARE + ; THE ABOVE SHOULD BE OK - WHY NOT ?? 16FEB01 + + ;LDI A,2 + ;RCALL PRG_RESET ; SPECIFIC RESET TOUCHSCREEN + + LDI A,1 + RCALL PRG_RESET ; SPECIFIC RESET CUSTOMER DISPLAY + + LDI A,0 + RCALL PRG_RESET ; REMOVE RESET PULSE + + ; LOADCELL HAS BEEN IN RESET UNTIL NOW, AND WILL START IN 10 MS + + ;SBI PORTD,1 ; OUTPUT TXD = 1 + + LDI A,API_RATE_SLOW ; 4800 BAUD + OUT UBRR,A ; SET BAUD RATE + LDI A,$18 + OUT UCR,A ; ENABLE TX AND RX (OUTPUTS TXD = 1) + + RCALL PRG_DELAY_280_MS ; DELAY FOR TOUCHSCREEN TO REENTER IDLE + + LDI A,$AA + OUT UDR,A ; SEND SLOW TURNON COMMAND + OUT UDR,A ; AND AGAIN FOR EXTRA SAFETY + + RCALL PRG_DELAY_20_MS ; DELAY TO ALLOW DEVICES TO INITIALISE + + ; ALLOW Z180 TO START + SBI PORTD,4 ; OUTPUT RES = 1 + ;CBI DDRD,4 ; OUTPUT RES = TRI-STATE + +; BIGBODGE FOR ANOTHER RESET PULSE!!!! +RCALL PRG_DELAY_20_MS +CBI PORTD,4 ; RES=0 +RCALL PRG_DELAY_20_MS +SBI PORTD,4 ; OUTPUT RES = 1 + + ; INITIALISE VARIABLES + CLR A + LDI ZL,VSWTS + CLR ZH + ST Z+,A + ST Z+,A + ST Z+,A + LDI ZL,TX_LIMIT + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A ; CAREFUL - Z WILL BE USED AGAIN BELOW + STS TURNOFF_COUNT,A + STS VOLTAGE_VSWT,A + + ;LDI A,LOW(1000) + STS WATCHDOG_COUNT,A + ;LDI A,HIGH(1000) ; 100 MS + STS WATCHDOG_COUNT+1,A + + LDI A,TX_SIZE + ST Z,A ; RX_LIMIT FOR 9TH (INTERNAL) DEVICE + + LDI A,LOW(1024) + STS BATTERY_COUNT,A + LDI A,HIGH(1024) + STS BATTERY_COUNT+1,A + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI A,$10 ; START COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,A + + CLR FLAGS + + CLR API_STATE + CLR API_REMAIN + + CLR TX_PTR + CLR TX_COUNT0 + CLR TX_COUNT1 + + CLR RX_PTR + CLR RX_COUNT0 + CLR RX_COUNT1 + +; LDI A,4 +; STS ABSENT_COUNT,A ; TOP UP ABSENT COUNTER FOR TX_ADDRESS + + ; START COMMUNICATIONS TASK + LDI A,2 + STS RX_ADDRESS2,A ; ALTERNATE VALUE FOR RX_ADDRESS1 + + LDI A,1 + STS TX_ADDRESS0,A + STS TX_ADDRESS1,A + STS RX_ADDRESS0,A + STS RX_ADDRESS1,A + STS TX_OVERRIDE,A + STS RX_OVERRIDE,A + STS HARDWARE_TYPE,A ; AS FOR OLD ALGORITHM WITH FLAGS,2 = 0 + + LDI A,0 + STS TX_STICKY,A + STS RX_STICKY,A + + LDI A,-API_TIMEOUT + MOV API_WATCHDOG,A ; SET UP TIME TO FIRST API BUS POLL + LDI A,-SPI_TIMEOUT + MOV SPI_WATCHDOG,A ; SET UP TIME TO FIRST SPI BUS POLL + + LDI A,$02 ; TCK0 = CK/8 + OUT TCCR0,A ; TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ + ; = APPROX 278 US + ;!TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ + ;! = APPROX 185 US +;IF LARGE + LDI A,$01 +;ELSE +; LDI A,$02 +;ENDIF + OUT TIMSK,A ; ENABLE TIMER 0 OVERFLOW INTERRUPTS + + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + IN A,SPSR + IN A,SPDR ; CLEAR SPI INTERRUPT PENDING FLAG + LDI A,$E8 + OUT SPCR,A ; SPI SLAVE, SAMPLE ON SCK FALLING EDGE + + ; START -5V GENERATOR TASK + LDI A,0 + OUT TCNT1H,A + OUT TCNT1L,A + OUT OCR1H,A + OUT OCR1L,A ; ASSUME NO LOAD TO BEGIN WITH + + LDI A,1< 0 + OR E,TX_COUNT0 + OR E,TX_COUNT1 + BRNE API_TRY_TX + +;API_TRY_RX: + LDS E,TX_OVERRIDE + DEC E + BREQ API_DIRECTION_TX ; FORCED TRANSMIT EVERY SO OFTEN + STS TX_OVERRIDE,E + RJMP API_DIRECTION_RX + +API_TRY_TX: + LDS E,RX_OVERRIDE + DEC E + BREQ BREQ_API_DIRECTION_RX ; FORCED RECEIVE EVERY SO OFTEN + STS RX_OVERRIDE,E + +API_DIRECTION_TX: + LDI E,$10 + STS TX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + ; SUSPEND TX OPERATIONS WHEN 9TH (INTERNAL) DEVICE ADDRESSED % + TST TX_COUNT0 ; ANY BYTES AT HEAD ? + LDS E,TX_ADDRESS0 + BRNE API_SUSPEND_TX0 ; YES, GO AND CHECK HEAD DEVICE + + TST TX_COUNT1 ; ANY BYTES AT TAIL ? + BREQ API_SUSPEND_TX1 ; NO, GO AND PERFORM TX OPERATION + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE TX_COUNT1 BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 + STS TX_ADDRESS0,E ; ADOPT TAIL DEVICE FOR BYTES AT HEAD + +API_SUSPEND_TX0: + CPI E,9 +BREQ_API_DIRECTION_RX: + BREQ API_DIRECTION_RX + +API_SUSPEND_TX1: + ; % + +; LDS E,ABSENT_COUNT +; TST E +; BRNE API_DEVICE_PRESENT +; +;;API_DEVICE_ABSENT: +; ADD TX_PTR,TX_COUNT0 ; SKIP TX_COUNT0 BYTES AT HEAD +; LDI E,TX_SIZE-1 +; AND TX_PTR,E +; +; CLR TX_COUNT0 ; ABANDON TX_COUNT0 DATA IN TX_BUF +; STS TX_STICKY,TX_COUNT0 ; DO NOT GO STICKY ON ABSENT DEVICE +; +; PUSH ZL +; PUSH ZH +; LDI ZL,TX_LIMIT-1 +; LDS ZH,TX_ADDRESS0 +; ADD ZL,ZH +; CLR ZH +; ;ST Z,TX_COUNT0 ; SAVE MAX BYTES TO ACCEPT, PER DEVICE +; LDI E,TX_SIZE +; ST Z,E ; SO THAT WE WILL GOBBLE UP DATA FOR ABSENT DEVICES +; POP ZH +; POP ZL +; +; LDI E,4 +; STS ABSENT_COUNT,E ; TOP UP ABSENT COUNTER FOR NEXT DEVICE +; +;API_DEVICE_PRESENT: + CBR API_STATE,1< 0 + DEC E + BRPL API_TX_ADDRESS_STICKY ; STAYING STICKY, ADOPT NEW DEVICE + + LDS E,TX_ADDRESS0 + INC E ; BUMP TX_ADDRESS BEFORE USING IT + CPI E,9 + BRLO API_TX_ADDRESS_SAVE + LDI E,1 + RJMP API_TX_ADDRESS_SAVE + +API_TX_ADDRESS_ADOPT: + LDI E,1 +API_TX_ADDRESS_STICKY: + STS TX_STICKY,E ; DECREMENT, OR TOP UP, STICKY COUNT + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 ; DEST FOR TX_COUNT1 BYTES AT HEAD +API_TX_ADDRESS_SAVE: + STS TX_ADDRESS0,E ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_TX_ADDRESS_SAME: + LDI E,1 + STS TX_STICKY,E ; TOP UP STICKY COUNT + + LDS E,TX_ADDRESS0 ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_DIRECTION_RX: + LDI E,$10 + STS RX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + SBR API_STATE,1< $10 + ;MOV E,ATOD + ;LSL ATOD ; $01 HALF SCALE -> $20 + ;ADD E,ATOD ; $01 HALF SCALE -> $30 HALF WIDTH + + LSR ATOD ; $40 HALF SCALE -> $20 + MOV E,ATOD + LSR ATOD ; $40 HALF SCALE -> $10 + ADD E,ATOD ; $40 HALF SCALE -> $30 HALF WIDTH + RJMP ADC_PULSE + +ADC_REFERENCE: + CBR FLAGS,1<<4 ; SAY NEXT RESULT WILL BE -5V GENERATOR + + ;STS VOLTAGE_VSWT,ATOD + ;RJMP ADC_DONE + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; SBRC FLAGS,5 ; CURRENT REFERENCE IS BANDGAP ? +; RJMP ADC_BANDGAP +; +; ; CURRENT REFERENCE IS LM385 (18DEC01 IT'S NOW A 100K/100K DIVIDER) +; CPI ATOD,$F8 ; IF =>$F8 ASSUME WE HAVE PULLUP ONLY +; BRLO ADC_LM385 +; +; LDS E,LM385_COUNT +; DEC E ; COUNT DOWN TO MISSING LM385 +; STS LM385_COUNT,E +; BRNE ADC_DONE ; KEEP TRYING LM385 +; +; SBR FLAGS,1<<5 ; SAY WE HAVE SWITCHED TO BANDGAP +;GO_ADC_DONE: +; RJMP ADC_DONE +; +;ADC_LM385: +; LDI E,$10 ; TOP UP COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,E +; +;; LSR ATOD ; LM385 VOLTAGE = APPROX 2*BANDGAP +; ; USE LM385Z-1.2 +; +;ADC_BANDGAP: + STS VOLTAGE_VSWT,ATOD + + ; 18DEC01 USE 5.5 VOLTS AS FOR THE ORIGINAL HYTECH 1000 SYSTEM + ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC + ;CPI ATOD,137 ; 256*0.5*4.5/4.2 + ;CPI ATOD,152 ; 256*0.5*5.0/4.2 + CPI ATOD,168 ; 256*0.5*5.5/4.2 + +; ;CPI ATOD,70 ; 256*1.22/4.5 +; ;CPI ATOD,63 ; 256*1.22/5.0 +; CPI ATOD,57 ; 256*1.22/5.5 + + LDI E,LOW(1024) + LDI F,HIGH(1024) + ; 18DEC01 FOR HYT1500 REVERSED THE SENSE DUE TO NEW 100K/100K DIVIDER + ;BRLO ADC_BATTERY_SAVE + BRSH ADC_BATTERY_SAVE + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 THIS IS NOW DONE FURTHER DOWN, AFTER LOW BATTERY TEST +;RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + + ; VSWT < 5.5 VOLTS, STABILISE READING FOR BATTERY LOW + LDS E,BATTERY_COUNT + LDS F,BATTERY_COUNT+1 + SUBI E,LOW(1) + SBCI F,HIGH(1) + BRNE ADC_BATTERY_SAVE ; COUNT 1024 LOW BATTERY READINGS + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<3 ; SHOW BATTERY MESSAGE AND POWER DOWN + +ADC_BATTERY_SAVE: + STS BATTERY_COUNT,E + STS BATTERY_COUNT+1,F + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 WE'LL ALSO COMMENT THE WHOLE THING OUT FOR NEATNESS +RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + +; ; 18DEC01 USE 5.0 VOLTS, MORE AGGRESSIVE THAN HYTECH 1000 SYSTEM +; ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC +; ;CPI ATOD,137 ; 256*0.5*4.5/4.2 +; CPI ATOD,152 ; 256*0.5*5.0/4.2 +; ;CPI ATOD,168 ; 256*0.5*5.5/4.2 +; BRSH ADC_DONE +; +;; ;CPI ATOD,90 ; 256*1.22/3.5 +;; ;CPI ATOD,79 ; 256*1.22/4.0 +;; CPI ATOD,70 ; 256*1.22/4.5 +;; BRLO ADC_DONE +; +; ; 18DEC01 VSWT < 5.0 VOLTS, RESET MAIN PROCESSOR IMMEDIATELY +; LDI E,$FF +; STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON +; +; LDI E,0 +; OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 +; +; CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM +; +; LDI E,$FF +; LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT + +ADC_PULSE: + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + +ADC_DONE: +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI E,$45 ; START MEASURING BANDGAP +; SBRS FLAGS,5 + LDI E,$04 ; START MEASURING LM385 + SBRS FLAGS,4 + LDI E,$05 ; START MEASURING -5V GENERATOR + OUT ADMUX,E + LDI E,$DE + OUT ADCSR,E ; ENABLE A/D, START, SINGLE CONVERSION + + OUT SREG,SR + RETI + +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 5 +; RCALL MULTIPLY +;DIAG_VOLTS_AT_A5: +; ;OUT PORTC,M16U1 ; res in byte 2(ignore ls,byte),volts pin 5 +; MOV A,B ; get saved VSWT +; SUB A,M16U1 ; voltage 47K = VSWT-Voltage at pin 35 +; MOV D,A ; which is 1/3 of total supply ie +V+(-V) +; ADD A,D +; ADD A,D ; TOTAL SUPPLY +; SUB A,B ; TOTAL SUPPLY-VSWT=NEG SUPPLY +;DIAG_NEG: +; ;OUT PORTC,A +; +; LDI A,4 +; OUT ADMUX,A ; NEXT TIME READ VCHG +;ADC_DONE: +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI + +;VSWT: ;OUT PORTC,ATOD ; count value for 2.5 V ref +; LDI A,$FF +; MOV DD16UH,A ; divide by full scale ie VSWT +; SUB DD16UL,DD16UL ; clear low reg +; SUB DV16UH,DV16UH ; clear high reg divisor +; MOV DV16UL,ATOD ; use ATOD value as divisor +; ;OUT PORTC,ATOD +; RCALL DIVIDE ; ***** NOTE AN FF RESULT IS NO INPUT ******* +; MOV MC16UH,DRES16UH ; load multiplicand high from result high +; MOV MC16UL,DRES16UL ; load multiplicand low from result low +; SUB MP16UH,MP16UH ; clear high byte in multiplier reg +; LDI A,25 +; MOV MP16UL,A ; mult by zener ref voltage (2.5V) +; RCALL MULTIPLY +;DIAG_VOLT_VSWT: +;xi: +; LDS A,VSWTS ; previous value of VSWT +; MOV B,MP16UL ; new value of VSWT +; ;RCALL SMOOTH +; STS VSWTS,B +; LDS B,VSWTS +; +; ;OUT PORTC,B;M16U1 ; VSWT IN 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; +; ;STS VSWTS,B ; SAVE NEW SMOOTHED VALUE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; MOV B,M16U1 ; save copy of VSWT for neg 5V routine +; MOV DD16UH,M16U1 +; SUB DD16UL,DD16UL +; LDI A,255 ; calculate the atod volts per division +; MOV DV16UL,A +; SUB DV16UH,DV16UH +; RCALL DIVIDE ; result to be found in dres high & low +; +; LDI A,3 +; OUT ADMUX,A ; NEXT TIME READ VCHG +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;VCHG: +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 37 (1/3 VCHG) +; RCALL MULTIPLY +; MOV A,M16U1 +; ADD M16U1,A ; B\C A3 IS 1/3 VCHG +; ADD M16U1,A +;DIAG_VOLT_VHG: +; ;OUT PORTC,M16U1 ; REUSULT 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; LDI A,5 +; OUT ADMUX,A ; NEXT TIME READ VSWT +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;;*************************************************************************** +;;* +;;* "div16u" - 16/16 Bit Unsigned Division +;;* +;;* This subroutine divides the two 16-bit numbers +;;* "dd8uH:dd8uL" (dividend) and "dv16uH:dv16uL" (divisor). +;;* The result is placed in "dres16uH:dres16uL" and the remainder in +;;* "drem16uH:drem16uL". +;;* +;;* Number of words :19 +;;* Number of cycles :235/251 (Min/Max) +;;* Low registers used :2 (drem16uL,drem16uH) +;;* High registers used :5 (dres16uL/dd16uL,dres16uH/dd16uH,dv16uL,dv16uH, +;;* dcnt16u) +;;* +;;*************************************************************************** +;divide: +;div16u: clr drem16uL ;clear remainder Low byte +; sub drem16uH,drem16uH ;clear remainder High byte and carry +; ldi counter,17 ;init loop counter +;d16u_1: rol dd16uL ;shift left dividend +; rol dd16uH +; dec counter ;decrement counter +; brne d16u_2 ;if done +; ret ; return +;d16u_2: rol drem16uL ;shift dividend into remainder +; rol drem16uH +; sub drem16uL,dv16uL ;remainder = remainder - divisor +; sbc drem16uH,dv16uH ; +; brcc d16u_3 ;if result negative +; add drem16uL,dv16uL ; restore remainder +; adc drem16uH,dv16uH +; clc ; clear carry to be shifted into result +; rjmp d16u_1 ;else +;d16u_3: sec ; set carry to be shifted into result +; rjmp d16u_1 +; +;;********* 16 X 16 multiplication routine from app note avr200 ************* +;;* +;;* "mpy16u" - 16x16 Bit Unsigned Multiplication +;;* +;;* This subroutine multiplies the two 16-bit register variables +;;* mp16uH:mp16uL and mc16uH:mc16uL. +;;* The result is placed in m16u3:m16u2:m16u1:m16u0. +;;* +;;* Number of words :14 + return +;;* Number of cycles :153 + return +;;* Low registers used :None +;;* High registers used :7 (mp16uL,mp16uH,mc16uL/m16u0,mc16uH/m16u1,m16u2, +;;* m16u3,mcnt16u) +;;* +;;*************************************************************************** +;multiply: +;mpy16u: clr m16u3 ;clear high byte of result +; sub m16u2,m16u2 ;clear result byte 2 and carry +; clr m16u2 +; ldi counter,16 ;init loop counter +; lsr mp16uH +; ror mp16uL +; +;m16u_1: brcc noad8 ;if bit 0 of multiplier set +; add m16u2,mc16uL ;add multiplicand Low to byte 2 of res +; adc m16u3,mc16uH ;add multiplicand high to byte 3 of res +;noad8: ror m16u3 ;shift right result byte 3 +; ror m16u2 ;rotate right result byte 2 +; ror m16u1 ;rotate result byte 1 and multiplier High +; ror m16u0 ;rotate result byte 0 and multiplier Low +; dec counter ;decrement loop counter +; brne m16u_1 ;if not done, loop more +; ret +;;************************* Exponential smoothing routine ******************** +;;Receives : Previous value in A +;; : New value in B +;;Passes : Smoothed result back in B reg +;;Uses : d reg +; +;Smooth: +; mov d,a ; save a copy of previous value +; lsr a +; lsr a +; lsr b +; lsr b ; prev.ave - prev.ave + new.data +; sub d,a ; -------- -------- +; add b,d ; n n +; ret + +; ----------------------------------------------------------------------------- + +MESSAGE_0: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',0,128,$1B + .DB 'E','1' + +MESSAGE_1: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',240,64,$1B + .DB 'E','1' + +MESSAGE_2: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','0','0','0',0 + +MESSAGE_3: + .DB $1B,'S',16,13 + .DB 'W','P','O','3','0',' ','V','5' + +MESSAGE_4: + .DB $1B,'S',16,13 + .DB 'B','A','D',' ','C','O','M','M','A','N','D',0 + +MESSAGE_5: + .DB $1B,'S',16,13 + .DB 'B','A','T','T','E','R','Y',' ','L','O','W',0 + +MESSAGE_6: + .DB $1B,'M','0',0 + +MESSAGE_7: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','5','0','0',0 + +MESSAGE_8: + .DB $1B,'S',16,13 + .DB 'S','T','A','C','K',' ','O','V','E','R','F','L','O','W' + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4100 ; SELECT ADDRESS COMMAND + ; FSTRT = 0 FOR 1.1 MS R/C STARTUP DELAY + ;.DW $ACBE ; WRITE FUSE BITS COMMAND +; BIGBODGE (NOT REALLY - JUST IN CASE TYPE OF CHANGE) +; FSTRT = 1 FOR 16 MS R/C STARTUP DELAY + .DW $ACBF ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/wpov0.asm b/src/avr/wpov0.asm new file mode 100644 index 00000000..740fde64 --- /dev/null +++ b/src/avr/wpov0.asm @@ -0,0 +1,2116 @@ +; WPOV0.ASM + +; ----------------------------------------------------------------------------- + +.EQU LARGE =0 + +;IF LARGE +;.INCLUDE "8535DEFX.INC" +;ELSE +.INCLUDE "4433DEF.INC" +;ENDIF + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_TIMEOUT =25 ;50 ;100 ; 100 * 100 US = APPROX 10.0 MS +.EQU API_TIME_IDLE =13 ;25 ; 25 * 100 US = APPROX 2.5 MS +.EQU API_TIME_SLOW =13 ;25 ; 25 * 100 US = APPROX 2.5 MS +.EQU API_TIME_FAST =2 ;1 ;2 ; 2 * 100 US = APPROX 200 US +.EQU API_RATE_SLOW =$8F ;$11 ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ;$11 ; DIVISOR FOR 115200 BPS + +.EQU SPI_TIMEOUT =25 ;50 ;100 ; 100 * 100 US = APPROX 10.0 MS + +;.def drem16uL =R0 ; remainder low +;.def drem16uH =R1 ; remainder high +;.def dres16uL =R2 ; result low DON'T use as general purpose +;.def dres16uH =R3 ; result high DON'T use as general purpose +;.def dd16uL =R2 ; dividend low +;.def dd16uH =R3 ; dividend high +;.def dv16uL =R4 ; divisor low +;.def dv16uH =R5 ; divisor high +; +;.DEF SPI_REMAIN =R6 +; +;.def mc16uL =R7 ;multiplicand low byte +;.def mc16uH =R8 ;multiplicand high byte +;.def mp16uL =R9 ;multiplier low byte +;.def mp16uH =R10 ;multiplier high byte +;.def m16u0 =R9 ;result byte 0 (LSB) +;.def m16u1 =R10 ;result byte 1 +;.def m16u2 =R11 ;result byte 2 +;.def m16u3 =R12 ;result byte 3 (MSB) +; +;.DEF RX_PTR =R13 +;.DEF RX_COUNT0 =R14 + +.DEF API_REMAIN =R1 +.DEF API_WATCHDOG =R2 +.DEF SPI_REMAIN =R3 +.DEF SPI_WATCHDOG =R4 +.DEF RX_PTR =R5 +.DEF RX_COUNT0 =R6 +.DEF RX_COUNT1 =R7 +.DEF TX_PTR =R8 +.DEF TX_COUNT0 =R9 +.DEF TX_COUNT1 =R10 + +.DEF SR =R15 +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R23 +.DEF G =R24 + +.DEF FLAGS =R20 +;.def counter =R20 ;loop counter + +.DEF ATOD =R21 ; SO YOU CAN USE SBCI, SUBI, CPI ETC + +.DEF API_STATE =R22 + +;.DEF TX_PTR =R25 +;.DEF API_WATCHDOG =R26 +;.DEF API_REMAIN =R27 +;.DEF SPI_WATCHDOG =R28 +;.DEF TX_COUNT0 =R29 + +.EQU TX_SIZE =$40 +.EQU RX_SIZE =$10 + + .DSEG + .ORG $60 + +VSWTS: .BYTE 1 ; RETAIN ORDERING % +VCHGS: .BYTE 1 +NEGVS: .BYTE 1 + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +TX_ADDRESS0: .BYTE 1 ; DEST FOR TX_COUNT0 BYTES AT HEAD +TX_ADDRESS1: .BYTE 1 ; DEST FOR TX_COUNT1 BYTES AT TAIL + +RX_ADDRESS0: .BYTE 1 ; SOURCE FOR RX_COUNT0 BYTES AT HEAD +RX_ADDRESS1: .BYTE 1 ; SOURCE FOR RX_COUNT1 BYTES AT TAIL + +RX_ADDRESS2: .BYTE 1 ; ALTERNATE VALUE FOR RX_ADDRESS1 + ; SCAN IS 1,2,1,3,1,4,1,5,1,6,1,7,1,8 + +TX_OVERRIDE: .BYTE 1 ; COUNTER TO TRANSMIT 1 TIME IN 16 +RX_OVERRIDE: .BYTE 1 ; COUNTER TO RECEIVE 1 TIME IN 16 + +TX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME TX DEVICE +RX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME RX DEVICE + +;ABSENT_COUNT: .BYTE 1 + +TURNOFF_COUNT: .BYTE 1 +WATCHDOG_COUNT: .BYTE 2 + +TX_LIMIT: .BYTE 9 ; MAX Z180 BYTES TO ACCEPT, PER DEVICE + +BATTERY_COUNT: .BYTE 2 ; COUNT 1024 ADC READINGS TO POWER DOWN + +LM385_COUNT: .BYTE 1 ; COUNT $10 ADC READINGS TO MISSING REF +VOLTAGE_VSWT: .BYTE 1 ; MOST RECENT ADC READING FROM REF + +HARDWARE_TYPE: .BYTE 1 ; COMES SOMEWHAT BEFORE RSEL HI COMMAND + +STACK_GUARD: .BYTE 1 ; DETECTS IF STACK COMES DOWN TO HERE + +; ----------------------------------------------------------------------------- + +; API_STATE DEFINITIONS +.EQU SPISIZE =0 ; SET IF EXPECTING SPI DATA SIZE CMD +.EQU SPIWAIT =1 ; SET IF SENDING SPI ADDRESS RESPONSE +.EQU SPIDATA =2 ; SET IF TRANSFERRING SPI DATA TX/RX +.EQU SPIDIRN =3 ; SET IF TX, BASED ON ADDRESS COMMAND +.EQU APISIZE =4 ; SET IF NEED TO SEND API DATA SIZE CMD +.EQU APIWAIT =5 ; SET IF WAITING FOR API DATA SIZE RESP +.EQU APIDATA =6 ; SET IF TRANSFERRING API DATA TX/RX +.EQU APIDIRN =7 ; SET IF TX, TOGGLED ON NULL TRANSFER + +; ----------------------------------------------------------------------------- + +;IF LARGE +; +;.EQU IRQ =6 +;.EQU IRQ_PORT =PORTA +;.EQU IRQ_DDR =DDRA +; +;.EQU PRG =3 +;.EQU PRG_PORT =PORTB +;.EQU PRG_DDR =DDRB +; +;.EQU OC1 =5 +;.EQU OC1_PORT =PORTD +;.EQU OC1_DDR =DDRD +; +;.EQU OCR1H =OCR1AH +;.EQU OCR1L =OCR1AL +; +;.EQU COM10 =COM1A0 +;.EQU COM11 =COM1A1 +; +;ELSE + +.EQU IRQ =0 +.EQU IRQ_PORT =PORTB +.EQU IRQ_DDR =DDRB +; +.EQU PRG =2 +.EQU PRG_PORT =PORTC +.EQU PRG_DDR =DDRC + +.EQU OC1 =1 +.EQU OC1_PORT =PORTB +.EQU OC1_DDR =DDRB + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +;ENDIF + +; ----------------------------------------------------------------------------- + + .CSEG + + RJMP RESET_ENTRY + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER 0 OVERFLOW HANDLER + + .ORG SPIADDR + RJMP SPI_COMPLETE ; SPI TRANSFER COMPLETE HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + + .ORG ADCCaddr + RJMP ADC_COMPLETE + +; ----------------------------------------------------------------------------- + +RESET_ENTRY: + ; INITIALISE AVR +;IF LARGE +; LDI A,HIGH(RAMEND) +; OUT SPH,A +;ENDIF + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + ; INITIALISE STACK GUARD + LDI A,$5A + STS STACK_GUARD,A + + ; INITIALISE PORTS + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + LDI A,0 + OUT SPCR,A ; DISABLE SPI WHILE RESETTING Z180 + OUT UCR,A ; DISABLE UART WHILE RESETTING SLAVES + +;IF LARGE +; LDI A,$FF +; OUT DDRC,A ; PORTC CONFIGURED AS OUTPUT +; +; SBI PORTB,7 ; PB7/SCK CONFIGURED AS PULLED UP INPUT +; SBI DDRB,6 ; PB6/MISO CONFIGURED AS OUTPUT +; +; SBI DDRA,7 ; A7 CONFIGURED AS OUTPUT FOR DTR1 +; SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 +; +;; 18DEC01 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +;; SBI PORTA,4 ; A4 PULLED UP TO DETECT MISSING LM385 +;ELSE + SBI PORTB,5 ; PB5/SCK CONFIGURED AS PULLED UP INPUT + SBI DDRB,4 ; PB4/MISO CONFIGURED AS OUTPUT + + SBI DDRD,5 ; D5 CONFIGURED AS OUTPUT FOR DTR1 + SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 + + SBI PORTC,4 ; C4 PULLED UP TO DETECT MISSING LM385 +;ENDIF + + SBI PORTD,2 ; D2 CONFIGURED AS PULL UP FOR IBM CLK + SBI PORTD,3 ; D3 CONFIGURED AS PULL UP FOR IBM DATA + + SBI OC1_PORT,OC1 + SBI OC1_DDR,OC1 ; OUTPUT OC1 = 1, PWM TRANSISTOR OFF + + CBI IRQ_PORT,IRQ + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + CBI PORTD,7 + SBI DDRD,7 ; OUTPUT RSEL = 0 + + CBI PORTD,4 + SBI DDRD,4 ; OUTPUT RES = 0 + + ; HARD RESET API BUS DEVICES + CBI PRG_PORT,PRG + SBI PRG_DDR,PRG ; OUTPUT PRG = 0 + + CBI PORTD,1 + SBI DDRD,1 ; OUTPUT TXD = 0 + + LDI A,7 + RCALL PRG_RESET ; SPECIFIC RESET SPARE + + LDI A,6 + RCALL PRG_RESET ; SPECIFIC RESET M192 RECEIPT PRINTER + + LDI A,5 + RCALL PRG_RESET ; SPECIFIC RESET M192 LABEL PRINTER + + LDI A,4 + RCALL PRG_RESET ; SPECIFIC RESET MT102 RECEIPT PRINTER + + ;LDI A,3 + ;RCALL PRG_RESET ; SPECIFIC RESET SPARE + ; THE ABOVE SHOULD BE OK - WHY NOT ?? 16FEB01 + + ;LDI A,2 + ;RCALL PRG_RESET ; SPECIFIC RESET TOUCHSCREEN + + LDI A,1 + RCALL PRG_RESET ; SPECIFIC RESET CUSTOMER DISPLAY + + LDI A,0 + RCALL PRG_RESET ; REMOVE RESET PULSE + + ; LOADCELL HAS BEEN IN RESET UNTIL NOW, AND WILL START IN 10 MS + + ;SBI PORTD,1 ; OUTPUT TXD = 1 + + LDI A,API_RATE_SLOW ; 4800 BAUD + OUT UBRR,A ; SET BAUD RATE + LDI A,$18 + OUT UCR,A ; ENABLE TX AND RX (OUTPUTS TXD = 1) + + RCALL PRG_DELAY_280_MS ; DELAY FOR TOUCHSCREEN TO REENTER IDLE + + LDI A,$AA + OUT UDR,A ; SEND SLOW TURNON COMMAND + OUT UDR,A ; AND AGAIN FOR EXTRA SAFETY + + RCALL PRG_DELAY_20_MS ; DELAY TO ALLOW DEVICES TO INITIALISE + + ; ALLOW Z180 TO START + SBI PORTD,4 ; OUTPUT RES = 1 + ;CBI DDRD,4 ; OUTPUT RES = TRI-STATE + +; BIGBODGE FOR ANOTHER RESET PULSE!!!! (LARGE AVR ONLY, AT THE MOMENT) +;RCALL PRG_DELAY_20_MS +;CBI PORTD,4 ; RES=0 +;RCALL PRG_DELAY_20_MS +;SBI PORTD,4 ; OUTPUT RES = 1 + + ; INITIALISE VARIABLES + CLR A + LDI ZL,VSWTS + CLR ZH + ST Z+,A + ST Z+,A + ST Z+,A + LDI ZL,TX_LIMIT + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A ; CAREFUL - Z WILL BE USED AGAIN BELOW + STS TURNOFF_COUNT,A + STS VOLTAGE_VSWT,A + + ;LDI A,LOW(1000) + STS WATCHDOG_COUNT,A + ;LDI A,HIGH(1000) ; 100 MS + STS WATCHDOG_COUNT+1,A + + LDI A,TX_SIZE + ST Z,A ; RX_LIMIT FOR 9TH (INTERNAL) DEVICE + + LDI A,LOW(1024) + STS BATTERY_COUNT,A + LDI A,HIGH(1024) + STS BATTERY_COUNT+1,A + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION % + LDI A,$10 ; START COUNTDOWN TO MISSING LM385 + STS LM385_COUNT,A +; (BUT REMAINS FOR HYT1000) % + CLR FLAGS + + CLR API_STATE + CLR API_REMAIN + + CLR TX_PTR + CLR TX_COUNT0 + CLR TX_COUNT1 + + CLR RX_PTR + CLR RX_COUNT0 + CLR RX_COUNT1 + +; LDI A,4 +; STS ABSENT_COUNT,A ; TOP UP ABSENT COUNTER FOR TX_ADDRESS + + ; START COMMUNICATIONS TASK + LDI A,2 + STS RX_ADDRESS2,A ; ALTERNATE VALUE FOR RX_ADDRESS1 + + LDI A,1 + STS TX_ADDRESS0,A + STS TX_ADDRESS1,A + STS RX_ADDRESS0,A + STS RX_ADDRESS1,A + STS TX_OVERRIDE,A + STS RX_OVERRIDE,A + STS HARDWARE_TYPE,A ; AS FOR OLD ALGORITHM WITH FLAGS,2 = 0 + + LDI A,0 + STS TX_STICKY,A + STS RX_STICKY,A + + LDI A,-API_TIMEOUT + MOV API_WATCHDOG,A ; SET UP TIME TO FIRST API BUS POLL + LDI A,-SPI_TIMEOUT + MOV SPI_WATCHDOG,A ; SET UP TIME TO FIRST SPI BUS POLL + + LDI A,$02 ; TCK0 = CK/8 + OUT TCCR0,A ; TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ + ; = APPROX 278 US + ;!TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ + ;! = APPROX 185 US +;IF LARGE +; LDI A,$01 +;ELSE + LDI A,$02 +;ENDIF + OUT TIMSK,A ; ENABLE TIMER 0 OVERFLOW INTERRUPTS + + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + IN A,SPSR + IN A,SPDR ; CLEAR SPI INTERRUPT PENDING FLAG + LDI A,$E8 + OUT SPCR,A ; SPI SLAVE, SAMPLE ON SCK FALLING EDGE + + ; START -5V GENERATOR TASK + LDI A,0 + OUT TCNT1H,A + OUT TCNT1L,A + OUT OCR1H,A + OUT OCR1L,A ; ASSUME NO LOAD TO BEGIN WITH + + LDI A,1< 0 + OR E,TX_COUNT0 + OR E,TX_COUNT1 + BRNE API_TRY_TX + +;API_TRY_RX: + LDS E,TX_OVERRIDE + DEC E + BREQ API_DIRECTION_TX ; FORCED TRANSMIT EVERY SO OFTEN + STS TX_OVERRIDE,E + RJMP API_DIRECTION_RX + +API_TRY_TX: + LDS E,RX_OVERRIDE + DEC E + BREQ BREQ_API_DIRECTION_RX ; FORCED RECEIVE EVERY SO OFTEN + STS RX_OVERRIDE,E + +API_DIRECTION_TX: + LDI E,$10 + STS TX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + ; SUSPEND TX OPERATIONS WHEN 9TH (INTERNAL) DEVICE ADDRESSED % + TST TX_COUNT0 ; ANY BYTES AT HEAD ? + LDS E,TX_ADDRESS0 + BRNE API_SUSPEND_TX0 ; YES, GO AND CHECK HEAD DEVICE + + TST TX_COUNT1 ; ANY BYTES AT TAIL ? + BREQ API_SUSPEND_TX1 ; NO, GO AND PERFORM TX OPERATION + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE TX_COUNT1 BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 + STS TX_ADDRESS0,E ; ADOPT TAIL DEVICE FOR BYTES AT HEAD + +API_SUSPEND_TX0: + CPI E,9 +BREQ_API_DIRECTION_RX: + BREQ API_DIRECTION_RX + +API_SUSPEND_TX1: + ; % + +; LDS E,ABSENT_COUNT +; TST E +; BRNE API_DEVICE_PRESENT +; +;;API_DEVICE_ABSENT: +; ADD TX_PTR,TX_COUNT0 ; SKIP TX_COUNT0 BYTES AT HEAD +; LDI E,TX_SIZE-1 +; AND TX_PTR,E +; +; CLR TX_COUNT0 ; ABANDON TX_COUNT0 DATA IN TX_BUF +; STS TX_STICKY,TX_COUNT0 ; DO NOT GO STICKY ON ABSENT DEVICE +; +; PUSH ZL +; PUSH ZH +; LDI ZL,TX_LIMIT-1 +; LDS ZH,TX_ADDRESS0 +; ADD ZL,ZH +; CLR ZH +; ;ST Z,TX_COUNT0 ; SAVE MAX BYTES TO ACCEPT, PER DEVICE +; LDI E,TX_SIZE +; ST Z,E ; SO THAT WE WILL GOBBLE UP DATA FOR ABSENT DEVICES +; POP ZH +; POP ZL +; +; LDI E,4 +; STS ABSENT_COUNT,E ; TOP UP ABSENT COUNTER FOR NEXT DEVICE +; +;API_DEVICE_PRESENT: + CBR API_STATE,1< 0 + DEC E + BRPL API_TX_ADDRESS_STICKY ; STAYING STICKY, ADOPT NEW DEVICE + + LDS E,TX_ADDRESS0 + INC E ; BUMP TX_ADDRESS BEFORE USING IT + CPI E,9 + BRLO API_TX_ADDRESS_SAVE + LDI E,1 + RJMP API_TX_ADDRESS_SAVE + +API_TX_ADDRESS_ADOPT: + LDI E,1 +API_TX_ADDRESS_STICKY: + STS TX_STICKY,E ; DECREMENT, OR TOP UP, STICKY COUNT + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 ; DEST FOR TX_COUNT1 BYTES AT HEAD +API_TX_ADDRESS_SAVE: + STS TX_ADDRESS0,E ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_TX_ADDRESS_SAME: + LDI E,1 + STS TX_STICKY,E ; TOP UP STICKY COUNT + + LDS E,TX_ADDRESS0 ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_DIRECTION_RX: + LDI E,$10 + STS RX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + SBR API_STATE,1< $10 + ;MOV E,ATOD + ;LSL ATOD ; $01 HALF SCALE -> $20 + ;ADD E,ATOD ; $01 HALF SCALE -> $30 HALF WIDTH + + LSR ATOD ; $40 HALF SCALE -> $20 + MOV E,ATOD + LSR ATOD ; $40 HALF SCALE -> $10 + ADD E,ATOD ; $40 HALF SCALE -> $30 HALF WIDTH + RJMP ADC_PULSE + +ADC_REFERENCE: + CBR FLAGS,1<<4 ; SAY NEXT RESULT WILL BE -5V GENERATOR + + ;STS VOLTAGE_VSWT,ATOD + ;RJMP ADC_DONE + + SBRC FLAGS,5 ; CURRENT REFERENCE IS BANDGAP ? + RJMP ADC_BANDGAP + + ; CURRENT REFERENCE IS LM385 + CPI ATOD,$F8 ; IF =>$F8 ASSUME WE HAVE PULLUP ONLY + BRLO ADC_LM385 + + LDS E,LM385_COUNT + DEC E ; COUNT DOWN TO MISSING LM385 + STS LM385_COUNT,E + BRNE ADC_DONE ; KEEP TRYING LM385 + + SBR FLAGS,1<<5 ; SAY WE HAVE SWITCHED TO BANDGAP +GO_ADC_DONE: + RJMP ADC_DONE + +ADC_LM385: + LDI E,$10 ; TOP UP COUNTDOWN TO MISSING LM385 + STS LM385_COUNT,E + +; LSR ATOD ; LM385 VOLTAGE = APPROX 2*BANDGAP + ; USE LM385Z-1.2 + +ADC_BANDGAP: + STS VOLTAGE_VSWT,ATOD + + ;CPI ATOD,70 ; 256*1.22/4.5 + ;CPI ATOD,63 ; 256*1.22/5.0 + CPI ATOD,57 ; 256*1.22/5.5 + LDI E,LOW(1024) + LDI F,HIGH(1024) + BRLO ADC_BATTERY_SAVE + + ; VSWT < 5.5 VOLTS, STABILISE READING FOR BATTERY LOW + LDS E,BATTERY_COUNT + LDS F,BATTERY_COUNT+1 + SUBI E,LOW(1) + SBCI F,HIGH(1) + BRNE ADC_BATTERY_SAVE ; COUNT 1024 LOW BATTERY READINGS + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<3 ; SHOW BATTERY MESSAGE AND POWER DOWN + +ADC_BATTERY_SAVE: + STS BATTERY_COUNT,E + STS BATTERY_COUNT+1,F + + ;CPI ATOD,90 ; 256*1.22/3.5 + ;CPI ATOD,79 ; 256*1.22/4.0 + CPI ATOD,70 ; 256*1.22/4.5 + BRLO ADC_DONE + + ; VSWT < 4.5 VOLTS, RESET MAIN PROCESSOR IMMEDIATELY + LDI E,$FF + STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 + + CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM + + LDI E,$FF + LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT +ADC_PULSE: + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + +ADC_DONE: + LDI E,$45 ; START MEASURING BANDGAP + SBRS FLAGS,5 + LDI E,$04 ; START MEASURING LM385 + SBRS FLAGS,4 + LDI E,$05 ; START MEASURING -5V GENERATOR + OUT ADMUX,E + LDI E,$DE + OUT ADCSR,E ; ENABLE A/D, START, SINGLE CONVERSION + + OUT SREG,SR + RETI + +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 5 +; RCALL MULTIPLY +;DIAG_VOLTS_AT_A5: +; ;OUT PORTC,M16U1 ; res in byte 2(ignore ls,byte),volts pin 5 +; MOV A,B ; get saved VSWT +; SUB A,M16U1 ; voltage 47K = VSWT-Voltage at pin 35 +; MOV D,A ; which is 1/3 of total supply ie +V+(-V) +; ADD A,D +; ADD A,D ; TOTAL SUPPLY +; SUB A,B ; TOTAL SUPPLY-VSWT=NEG SUPPLY +;DIAG_NEG: +; ;OUT PORTC,A +; +; LDI A,4 +; OUT ADMUX,A ; NEXT TIME READ VCHG +;ADC_DONE: +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI + +;VSWT: ;OUT PORTC,ATOD ; count value for 2.5 V ref +; LDI A,$FF +; MOV DD16UH,A ; divide by full scale ie VSWT +; SUB DD16UL,DD16UL ; clear low reg +; SUB DV16UH,DV16UH ; clear high reg divisor +; MOV DV16UL,ATOD ; use ATOD value as divisor +; ;OUT PORTC,ATOD +; RCALL DIVIDE ; ***** NOTE AN FF RESULT IS NO INPUT ******* +; MOV MC16UH,DRES16UH ; load multiplicand high from result high +; MOV MC16UL,DRES16UL ; load multiplicand low from result low +; SUB MP16UH,MP16UH ; clear high byte in multiplier reg +; LDI A,25 +; MOV MP16UL,A ; mult by zener ref voltage (2.5V) +; RCALL MULTIPLY +;DIAG_VOLT_VSWT: +;xi: +; LDS A,VSWTS ; previous value of VSWT +; MOV B,MP16UL ; new value of VSWT +; ;RCALL SMOOTH +; STS VSWTS,B +; LDS B,VSWTS +; +; ;OUT PORTC,B;M16U1 ; VSWT IN 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; +; ;STS VSWTS,B ; SAVE NEW SMOOTHED VALUE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; MOV B,M16U1 ; save copy of VSWT for neg 5V routine +; MOV DD16UH,M16U1 +; SUB DD16UL,DD16UL +; LDI A,255 ; calculate the atod volts per division +; MOV DV16UL,A +; SUB DV16UH,DV16UH +; RCALL DIVIDE ; result to be found in dres high & low +; +; LDI A,3 +; OUT ADMUX,A ; NEXT TIME READ VCHG +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;VCHG: +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 37 (1/3 VCHG) +; RCALL MULTIPLY +; MOV A,M16U1 +; ADD M16U1,A ; B\C A3 IS 1/3 VCHG +; ADD M16U1,A +;DIAG_VOLT_VHG: +; ;OUT PORTC,M16U1 ; REUSULT 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; LDI A,5 +; OUT ADMUX,A ; NEXT TIME READ VSWT +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;;*************************************************************************** +;;* +;;* "div16u" - 16/16 Bit Unsigned Division +;;* +;;* This subroutine divides the two 16-bit numbers +;;* "dd8uH:dd8uL" (dividend) and "dv16uH:dv16uL" (divisor). +;;* The result is placed in "dres16uH:dres16uL" and the remainder in +;;* "drem16uH:drem16uL". +;;* +;;* Number of words :19 +;;* Number of cycles :235/251 (Min/Max) +;;* Low registers used :2 (drem16uL,drem16uH) +;;* High registers used :5 (dres16uL/dd16uL,dres16uH/dd16uH,dv16uL,dv16uH, +;;* dcnt16u) +;;* +;;*************************************************************************** +;divide: +;div16u: clr drem16uL ;clear remainder Low byte +; sub drem16uH,drem16uH ;clear remainder High byte and carry +; ldi counter,17 ;init loop counter +;d16u_1: rol dd16uL ;shift left dividend +; rol dd16uH +; dec counter ;decrement counter +; brne d16u_2 ;if done +; ret ; return +;d16u_2: rol drem16uL ;shift dividend into remainder +; rol drem16uH +; sub drem16uL,dv16uL ;remainder = remainder - divisor +; sbc drem16uH,dv16uH ; +; brcc d16u_3 ;if result negative +; add drem16uL,dv16uL ; restore remainder +; adc drem16uH,dv16uH +; clc ; clear carry to be shifted into result +; rjmp d16u_1 ;else +;d16u_3: sec ; set carry to be shifted into result +; rjmp d16u_1 +; +;;********* 16 X 16 multiplication routine from app note avr200 ************* +;;* +;;* "mpy16u" - 16x16 Bit Unsigned Multiplication +;;* +;;* This subroutine multiplies the two 16-bit register variables +;;* mp16uH:mp16uL and mc16uH:mc16uL. +;;* The result is placed in m16u3:m16u2:m16u1:m16u0. +;;* +;;* Number of words :14 + return +;;* Number of cycles :153 + return +;;* Low registers used :None +;;* High registers used :7 (mp16uL,mp16uH,mc16uL/m16u0,mc16uH/m16u1,m16u2, +;;* m16u3,mcnt16u) +;;* +;;*************************************************************************** +;multiply: +;mpy16u: clr m16u3 ;clear high byte of result +; sub m16u2,m16u2 ;clear result byte 2 and carry +; clr m16u2 +; ldi counter,16 ;init loop counter +; lsr mp16uH +; ror mp16uL +; +;m16u_1: brcc noad8 ;if bit 0 of multiplier set +; add m16u2,mc16uL ;add multiplicand Low to byte 2 of res +; adc m16u3,mc16uH ;add multiplicand high to byte 3 of res +;noad8: ror m16u3 ;shift right result byte 3 +; ror m16u2 ;rotate right result byte 2 +; ror m16u1 ;rotate result byte 1 and multiplier High +; ror m16u0 ;rotate result byte 0 and multiplier Low +; dec counter ;decrement loop counter +; brne m16u_1 ;if not done, loop more +; ret +;;************************* Exponential smoothing routine ******************** +;;Receives : Previous value in A +;; : New value in B +;;Passes : Smoothed result back in B reg +;;Uses : d reg +; +;Smooth: +; mov d,a ; save a copy of previous value +; lsr a +; lsr a +; lsr b +; lsr b ; prev.ave - prev.ave + new.data +; sub d,a ; -------- -------- +; add b,d ; n n +; ret + +; ----------------------------------------------------------------------------- + +MESSAGE_0: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',0,128,$1B + .DB 'E','1' + +MESSAGE_1: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',240,64,$1B + .DB 'E','1' + +MESSAGE_2: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','0','0','0',0 + +MESSAGE_3: + .DB $1B,'S',16,13 + .DB 'W','P','O','3','0',' ','V','5' + +MESSAGE_4: + .DB $1B,'S',16,13 + .DB 'B','A','D',' ','C','O','M','M','A','N','D',0 + +MESSAGE_5: + .DB $1B,'S',16,13 + .DB 'B','A','T','T','E','R','Y',' ','L','O','W',0 + +MESSAGE_6: + .DB $1B,'M','0',0 + +MESSAGE_7: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','5','0','0',0 + +MESSAGE_8: + .DB $1B,'S',16,13 + .DB 'S','T','A','C','K',' ','O','V','E','R','F','L','O','W' + +; ----------------------------------------------------------------------------- + + ; BODEN = 0 ENABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 100 FOR 16K * 11MHZ STARTUP DELAY (NO R/C STARTUP DELAY) + + .ORG $1000 + + .DW $4100 ; SELECT ADDRESS COMMAND + .DW $ACB4 ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/wpov1.asm b/src/avr/wpov1.asm new file mode 100644 index 00000000..cc793ac3 --- /dev/null +++ b/src/avr/wpov1.asm @@ -0,0 +1,2116 @@ +; WPOV1.ASM + +; ----------------------------------------------------------------------------- + +.EQU LARGE =0 + +;IF LARGE +;.INCLUDE "8535DEFX.INC" +;ELSE +.INCLUDE "4433DEF.INC" +;ENDIF + +; ----------------------------------------------------------------------------- + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_TIMEOUT =25 ;50 ;100 ; 100 * 100 US = APPROX 10.0 MS +.EQU API_TIME_IDLE =13 ;25 ; 25 * 100 US = APPROX 2.5 MS +.EQU API_TIME_SLOW =13 ;25 ; 25 * 100 US = APPROX 2.5 MS +.EQU API_TIME_FAST =2 ;1 ;2 ; 2 * 100 US = APPROX 200 US +.EQU API_RATE_SLOW =$8F ;$11 ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$05 ;$11 ; DIVISOR FOR 115200 BPS + +.EQU SPI_TIMEOUT =25 ;50 ;100 ; 100 * 100 US = APPROX 10.0 MS + +;.def drem16uL =R0 ; remainder low +;.def drem16uH =R1 ; remainder high +;.def dres16uL =R2 ; result low DON'T use as general purpose +;.def dres16uH =R3 ; result high DON'T use as general purpose +;.def dd16uL =R2 ; dividend low +;.def dd16uH =R3 ; dividend high +;.def dv16uL =R4 ; divisor low +;.def dv16uH =R5 ; divisor high +; +;.DEF SPI_REMAIN =R6 +; +;.def mc16uL =R7 ;multiplicand low byte +;.def mc16uH =R8 ;multiplicand high byte +;.def mp16uL =R9 ;multiplier low byte +;.def mp16uH =R10 ;multiplier high byte +;.def m16u0 =R9 ;result byte 0 (LSB) +;.def m16u1 =R10 ;result byte 1 +;.def m16u2 =R11 ;result byte 2 +;.def m16u3 =R12 ;result byte 3 (MSB) +; +;.DEF RX_PTR =R13 +;.DEF RX_COUNT0 =R14 + +.DEF API_REMAIN =R1 +.DEF API_WATCHDOG =R2 +.DEF SPI_REMAIN =R3 +.DEF SPI_WATCHDOG =R4 +.DEF RX_PTR =R5 +.DEF RX_COUNT0 =R6 +.DEF RX_COUNT1 =R7 +.DEF TX_PTR =R8 +.DEF TX_COUNT0 =R9 +.DEF TX_COUNT1 =R10 + +.DEF SR =R15 +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R23 +.DEF G =R24 + +.DEF FLAGS =R20 +;.def counter =R20 ;loop counter + +.DEF ATOD =R21 ; SO YOU CAN USE SBCI, SUBI, CPI ETC + +.DEF API_STATE =R22 + +;.DEF TX_PTR =R25 +;.DEF API_WATCHDOG =R26 +;.DEF API_REMAIN =R27 +;.DEF SPI_WATCHDOG =R28 +;.DEF TX_COUNT0 =R29 + +.EQU TX_SIZE =$40 +.EQU RX_SIZE =$10 + + .DSEG + .ORG $60 + +VSWTS: .BYTE 1 ; RETAIN ORDERING % +VCHGS: .BYTE 1 +NEGVS: .BYTE 1 + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +TX_ADDRESS0: .BYTE 1 ; DEST FOR TX_COUNT0 BYTES AT HEAD +TX_ADDRESS1: .BYTE 1 ; DEST FOR TX_COUNT1 BYTES AT TAIL + +RX_ADDRESS0: .BYTE 1 ; SOURCE FOR RX_COUNT0 BYTES AT HEAD +RX_ADDRESS1: .BYTE 1 ; SOURCE FOR RX_COUNT1 BYTES AT TAIL + +RX_ADDRESS2: .BYTE 1 ; ALTERNATE VALUE FOR RX_ADDRESS1 + ; SCAN IS 1,2,1,3,1,4,1,5,1,6,1,7,1,8 + +TX_OVERRIDE: .BYTE 1 ; COUNTER TO TRANSMIT 1 TIME IN 16 +RX_OVERRIDE: .BYTE 1 ; COUNTER TO RECEIVE 1 TIME IN 16 + +TX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME TX DEVICE +RX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME RX DEVICE + +;ABSENT_COUNT: .BYTE 1 + +TURNOFF_COUNT: .BYTE 1 +WATCHDOG_COUNT: .BYTE 2 + +TX_LIMIT: .BYTE 9 ; MAX Z180 BYTES TO ACCEPT, PER DEVICE + +BATTERY_COUNT: .BYTE 2 ; COUNT 1024 ADC READINGS TO POWER DOWN + +LM385_COUNT: .BYTE 1 ; COUNT $10 ADC READINGS TO MISSING REF +VOLTAGE_VSWT: .BYTE 1 ; MOST RECENT ADC READING FROM REF + +HARDWARE_TYPE: .BYTE 1 ; COMES SOMEWHAT BEFORE RSEL HI COMMAND + +STACK_GUARD: .BYTE 1 ; DETECTS IF STACK COMES DOWN TO HERE + +; ----------------------------------------------------------------------------- + +; API_STATE DEFINITIONS +.EQU SPISIZE =0 ; SET IF EXPECTING SPI DATA SIZE CMD +.EQU SPIWAIT =1 ; SET IF SENDING SPI ADDRESS RESPONSE +.EQU SPIDATA =2 ; SET IF TRANSFERRING SPI DATA TX/RX +.EQU SPIDIRN =3 ; SET IF TX, BASED ON ADDRESS COMMAND +.EQU APISIZE =4 ; SET IF NEED TO SEND API DATA SIZE CMD +.EQU APIWAIT =5 ; SET IF WAITING FOR API DATA SIZE RESP +.EQU APIDATA =6 ; SET IF TRANSFERRING API DATA TX/RX +.EQU APIDIRN =7 ; SET IF TX, TOGGLED ON NULL TRANSFER + +; ----------------------------------------------------------------------------- + +;IF LARGE +; +;.EQU IRQ =6 +;.EQU IRQ_PORT =PORTA +;.EQU IRQ_DDR =DDRA +; +;.EQU PRG =3 +;.EQU PRG_PORT =PORTB +;.EQU PRG_DDR =DDRB +; +;.EQU OC1 =5 +;.EQU OC1_PORT =PORTD +;.EQU OC1_DDR =DDRD +; +;.EQU OCR1H =OCR1AH +;.EQU OCR1L =OCR1AL +; +;.EQU COM10 =COM1A0 +;.EQU COM11 =COM1A1 +; +;ELSE + +.EQU IRQ =0 +.EQU IRQ_PORT =PORTB +.EQU IRQ_DDR =DDRB +; +.EQU PRG =2 +.EQU PRG_PORT =PORTC +.EQU PRG_DDR =DDRC + +.EQU OC1 =1 +.EQU OC1_PORT =PORTB +.EQU OC1_DDR =DDRB + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +;ENDIF + +; ----------------------------------------------------------------------------- + + .CSEG + + RJMP RESET_ENTRY + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER 0 OVERFLOW HANDLER + + .ORG SPIADDR + RJMP SPI_COMPLETE ; SPI TRANSFER COMPLETE HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + + .ORG ADCCaddr + RJMP ADC_COMPLETE + +; ----------------------------------------------------------------------------- + +RESET_ENTRY: + ; INITIALISE AVR +;IF LARGE +; LDI A,HIGH(RAMEND) +; OUT SPH,A +;ENDIF + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + ; INITIALISE STACK GUARD + LDI A,$5A + STS STACK_GUARD,A + + ; INITIALISE PORTS + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + LDI A,0 + OUT SPCR,A ; DISABLE SPI WHILE RESETTING Z180 + OUT UCR,A ; DISABLE UART WHILE RESETTING SLAVES + +;IF LARGE +; LDI A,$FF +; OUT DDRC,A ; PORTC CONFIGURED AS OUTPUT +; +; SBI PORTB,7 ; PB7/SCK CONFIGURED AS PULLED UP INPUT +; SBI DDRB,6 ; PB6/MISO CONFIGURED AS OUTPUT +; +; SBI DDRA,7 ; A7 CONFIGURED AS OUTPUT FOR DTR1 +; SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 +; +;; 18DEC01 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +;; SBI PORTA,4 ; A4 PULLED UP TO DETECT MISSING LM385 +;ELSE + SBI PORTB,5 ; PB5/SCK CONFIGURED AS PULLED UP INPUT + SBI DDRB,4 ; PB4/MISO CONFIGURED AS OUTPUT + + SBI DDRD,5 ; D5 CONFIGURED AS OUTPUT FOR DTR1 + SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 + + SBI PORTC,4 ; C4 PULLED UP TO DETECT MISSING LM385 +;ENDIF + + SBI PORTD,2 ; D2 CONFIGURED AS PULL UP FOR IBM CLK + SBI PORTD,3 ; D3 CONFIGURED AS PULL UP FOR IBM DATA + + SBI OC1_PORT,OC1 + SBI OC1_DDR,OC1 ; OUTPUT OC1 = 1, PWM TRANSISTOR OFF + + CBI IRQ_PORT,IRQ + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + CBI PORTD,7 + SBI DDRD,7 ; OUTPUT RSEL = 0 + + CBI PORTD,4 + SBI DDRD,4 ; OUTPUT RES = 0 + + ; HARD RESET API BUS DEVICES + CBI PRG_PORT,PRG + SBI PRG_DDR,PRG ; OUTPUT PRG = 0 + + CBI PORTD,1 + SBI DDRD,1 ; OUTPUT TXD = 0 + + LDI A,7 + RCALL PRG_RESET ; SPECIFIC RESET SPARE + + LDI A,6 + RCALL PRG_RESET ; SPECIFIC RESET M192 RECEIPT PRINTER + + LDI A,5 + RCALL PRG_RESET ; SPECIFIC RESET M192 LABEL PRINTER + + LDI A,4 + RCALL PRG_RESET ; SPECIFIC RESET MT102 RECEIPT PRINTER + + ;LDI A,3 + ;RCALL PRG_RESET ; SPECIFIC RESET SPARE + ; THE ABOVE SHOULD BE OK - WHY NOT ?? 16FEB01 + + ;LDI A,2 + ;RCALL PRG_RESET ; SPECIFIC RESET TOUCHSCREEN + + LDI A,1 + RCALL PRG_RESET ; SPECIFIC RESET CUSTOMER DISPLAY + + LDI A,0 + RCALL PRG_RESET ; REMOVE RESET PULSE + + ; LOADCELL HAS BEEN IN RESET UNTIL NOW, AND WILL START IN 10 MS + + ;SBI PORTD,1 ; OUTPUT TXD = 1 + + LDI A,API_RATE_SLOW ; 4800 BAUD + OUT UBRR,A ; SET BAUD RATE + LDI A,$18 + OUT UCR,A ; ENABLE TX AND RX (OUTPUTS TXD = 1) + + RCALL PRG_DELAY_280_MS ; DELAY FOR TOUCHSCREEN TO REENTER IDLE + + LDI A,$AA + OUT UDR,A ; SEND SLOW TURNON COMMAND + OUT UDR,A ; AND AGAIN FOR EXTRA SAFETY + + RCALL PRG_DELAY_20_MS ; DELAY TO ALLOW DEVICES TO INITIALISE + + ; ALLOW Z180 TO START + SBI PORTD,4 ; OUTPUT RES = 1 + ;CBI DDRD,4 ; OUTPUT RES = TRI-STATE + +; BIGBODGE FOR ANOTHER RESET PULSE!!!! (LARGE AVR ONLY, AT THE MOMENT) +;RCALL PRG_DELAY_20_MS +;CBI PORTD,4 ; RES=0 +;RCALL PRG_DELAY_20_MS +;SBI PORTD,4 ; OUTPUT RES = 1 + + ; INITIALISE VARIABLES + CLR A + LDI ZL,VSWTS + CLR ZH + ST Z+,A + ST Z+,A + ST Z+,A + LDI ZL,TX_LIMIT + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A ; CAREFUL - Z WILL BE USED AGAIN BELOW + STS TURNOFF_COUNT,A + STS VOLTAGE_VSWT,A + + ;LDI A,LOW(1000) + STS WATCHDOG_COUNT,A + ;LDI A,HIGH(1000) ; 100 MS + STS WATCHDOG_COUNT+1,A + + LDI A,TX_SIZE + ST Z,A ; RX_LIMIT FOR 9TH (INTERNAL) DEVICE + + LDI A,LOW(1024) + STS BATTERY_COUNT,A + LDI A,HIGH(1024) + STS BATTERY_COUNT+1,A + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION % + LDI A,$10 ; START COUNTDOWN TO MISSING LM385 + STS LM385_COUNT,A +; (BUT REMAINS FOR HYT1000) % + CLR FLAGS + + CLR API_STATE + CLR API_REMAIN + + CLR TX_PTR + CLR TX_COUNT0 + CLR TX_COUNT1 + + CLR RX_PTR + CLR RX_COUNT0 + CLR RX_COUNT1 + +; LDI A,4 +; STS ABSENT_COUNT,A ; TOP UP ABSENT COUNTER FOR TX_ADDRESS + + ; START COMMUNICATIONS TASK + LDI A,2 + STS RX_ADDRESS2,A ; ALTERNATE VALUE FOR RX_ADDRESS1 + + LDI A,1 + STS TX_ADDRESS0,A + STS TX_ADDRESS1,A + STS RX_ADDRESS0,A + STS RX_ADDRESS1,A + STS TX_OVERRIDE,A + STS RX_OVERRIDE,A + STS HARDWARE_TYPE,A ; AS FOR OLD ALGORITHM WITH FLAGS,2 = 0 + + LDI A,0 + STS TX_STICKY,A + STS RX_STICKY,A + + LDI A,-API_TIMEOUT + MOV API_WATCHDOG,A ; SET UP TIME TO FIRST API BUS POLL + LDI A,-SPI_TIMEOUT + MOV SPI_WATCHDOG,A ; SET UP TIME TO FIRST SPI BUS POLL + + LDI A,$02 ; TCK0 = CK/8 + OUT TCCR0,A ; TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ + ; = APPROX 278 US + ;!TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ + ;! = APPROX 185 US +;IF LARGE +; LDI A,$01 +;ELSE + LDI A,$02 +;ENDIF + OUT TIMSK,A ; ENABLE TIMER 0 OVERFLOW INTERRUPTS + + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + IN A,SPSR + IN A,SPDR ; CLEAR SPI INTERRUPT PENDING FLAG + LDI A,$E8 + OUT SPCR,A ; SPI SLAVE, SAMPLE ON SCK FALLING EDGE + + ; START -5V GENERATOR TASK + LDI A,0 + OUT TCNT1H,A + OUT TCNT1L,A + OUT OCR1H,A + OUT OCR1L,A ; ASSUME NO LOAD TO BEGIN WITH + + LDI A,1< 0 + OR E,TX_COUNT0 + OR E,TX_COUNT1 + BRNE API_TRY_TX + +;API_TRY_RX: + LDS E,TX_OVERRIDE + DEC E + BREQ API_DIRECTION_TX ; FORCED TRANSMIT EVERY SO OFTEN + STS TX_OVERRIDE,E + RJMP API_DIRECTION_RX + +API_TRY_TX: + LDS E,RX_OVERRIDE + DEC E + BREQ BREQ_API_DIRECTION_RX ; FORCED RECEIVE EVERY SO OFTEN + STS RX_OVERRIDE,E + +API_DIRECTION_TX: + LDI E,$10 + STS TX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + ; SUSPEND TX OPERATIONS WHEN 9TH (INTERNAL) DEVICE ADDRESSED % + TST TX_COUNT0 ; ANY BYTES AT HEAD ? + LDS E,TX_ADDRESS0 + BRNE API_SUSPEND_TX0 ; YES, GO AND CHECK HEAD DEVICE + + TST TX_COUNT1 ; ANY BYTES AT TAIL ? + BREQ API_SUSPEND_TX1 ; NO, GO AND PERFORM TX OPERATION + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE TX_COUNT1 BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 + STS TX_ADDRESS0,E ; ADOPT TAIL DEVICE FOR BYTES AT HEAD + +API_SUSPEND_TX0: + CPI E,9 +BREQ_API_DIRECTION_RX: + BREQ API_DIRECTION_RX + +API_SUSPEND_TX1: + ; % + +; LDS E,ABSENT_COUNT +; TST E +; BRNE API_DEVICE_PRESENT +; +;;API_DEVICE_ABSENT: +; ADD TX_PTR,TX_COUNT0 ; SKIP TX_COUNT0 BYTES AT HEAD +; LDI E,TX_SIZE-1 +; AND TX_PTR,E +; +; CLR TX_COUNT0 ; ABANDON TX_COUNT0 DATA IN TX_BUF +; STS TX_STICKY,TX_COUNT0 ; DO NOT GO STICKY ON ABSENT DEVICE +; +; PUSH ZL +; PUSH ZH +; LDI ZL,TX_LIMIT-1 +; LDS ZH,TX_ADDRESS0 +; ADD ZL,ZH +; CLR ZH +; ;ST Z,TX_COUNT0 ; SAVE MAX BYTES TO ACCEPT, PER DEVICE +; LDI E,TX_SIZE +; ST Z,E ; SO THAT WE WILL GOBBLE UP DATA FOR ABSENT DEVICES +; POP ZH +; POP ZL +; +; LDI E,4 +; STS ABSENT_COUNT,E ; TOP UP ABSENT COUNTER FOR NEXT DEVICE +; +;API_DEVICE_PRESENT: + CBR API_STATE,1< 0 + DEC E + BRPL API_TX_ADDRESS_STICKY ; STAYING STICKY, ADOPT NEW DEVICE + + LDS E,TX_ADDRESS0 + INC E ; BUMP TX_ADDRESS BEFORE USING IT + CPI E,9 + BRLO API_TX_ADDRESS_SAVE + LDI E,1 + RJMP API_TX_ADDRESS_SAVE + +API_TX_ADDRESS_ADOPT: + LDI E,1 +API_TX_ADDRESS_STICKY: + STS TX_STICKY,E ; DECREMENT, OR TOP UP, STICKY COUNT + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 ; DEST FOR TX_COUNT1 BYTES AT HEAD +API_TX_ADDRESS_SAVE: + STS TX_ADDRESS0,E ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_TX_ADDRESS_SAME: + LDI E,1 + STS TX_STICKY,E ; TOP UP STICKY COUNT + + LDS E,TX_ADDRESS0 ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_DIRECTION_RX: + LDI E,$10 + STS RX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + SBR API_STATE,1< $10 + ;MOV E,ATOD + ;LSL ATOD ; $01 HALF SCALE -> $20 + ;ADD E,ATOD ; $01 HALF SCALE -> $30 HALF WIDTH + + LSR ATOD ; $40 HALF SCALE -> $20 + MOV E,ATOD + LSR ATOD ; $40 HALF SCALE -> $10 + ADD E,ATOD ; $40 HALF SCALE -> $30 HALF WIDTH + RJMP ADC_PULSE + +ADC_REFERENCE: + CBR FLAGS,1<<4 ; SAY NEXT RESULT WILL BE -5V GENERATOR + + ;STS VOLTAGE_VSWT,ATOD + ;RJMP ADC_DONE + + SBRC FLAGS,5 ; CURRENT REFERENCE IS BANDGAP ? + RJMP ADC_BANDGAP + + ; CURRENT REFERENCE IS LM385 + CPI ATOD,$F8 ; IF =>$F8 ASSUME WE HAVE PULLUP ONLY + BRLO ADC_LM385 + + LDS E,LM385_COUNT + DEC E ; COUNT DOWN TO MISSING LM385 + STS LM385_COUNT,E + BRNE ADC_DONE ; KEEP TRYING LM385 + + SBR FLAGS,1<<5 ; SAY WE HAVE SWITCHED TO BANDGAP +GO_ADC_DONE: + RJMP ADC_DONE + +ADC_LM385: + LDI E,$10 ; TOP UP COUNTDOWN TO MISSING LM385 + STS LM385_COUNT,E + +; LSR ATOD ; LM385 VOLTAGE = APPROX 2*BANDGAP + ; USE LM385Z-1.2 + +ADC_BANDGAP: + STS VOLTAGE_VSWT,ATOD + + ;CPI ATOD,70 ; 256*1.22/4.5 + ;CPI ATOD,63 ; 256*1.22/5.0 + CPI ATOD,57 ; 256*1.22/5.5 + LDI E,LOW(1024) + LDI F,HIGH(1024) + BRLO ADC_BATTERY_SAVE + + ; VSWT < 5.5 VOLTS, STABILISE READING FOR BATTERY LOW + LDS E,BATTERY_COUNT + LDS F,BATTERY_COUNT+1 + SUBI E,LOW(1) + SBCI F,HIGH(1) + BRNE ADC_BATTERY_SAVE ; COUNT 1024 LOW BATTERY READINGS + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<3 ; SHOW BATTERY MESSAGE AND POWER DOWN + +ADC_BATTERY_SAVE: + STS BATTERY_COUNT,E + STS BATTERY_COUNT+1,F + + ;CPI ATOD,90 ; 256*1.22/3.5 + ;CPI ATOD,79 ; 256*1.22/4.0 + CPI ATOD,70 ; 256*1.22/4.5 + BRLO ADC_DONE + + ; VSWT < 4.5 VOLTS, RESET MAIN PROCESSOR IMMEDIATELY + LDI E,$FF + STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 + + CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM + + LDI E,$FF + LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT +ADC_PULSE: + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + +ADC_DONE: + LDI E,$45 ; START MEASURING BANDGAP + SBRS FLAGS,5 + LDI E,$04 ; START MEASURING LM385 + SBRS FLAGS,4 + LDI E,$05 ; START MEASURING -5V GENERATOR + OUT ADMUX,E + LDI E,$DE + OUT ADCSR,E ; ENABLE A/D, START, SINGLE CONVERSION + + OUT SREG,SR + RETI + +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 5 +; RCALL MULTIPLY +;DIAG_VOLTS_AT_A5: +; ;OUT PORTC,M16U1 ; res in byte 2(ignore ls,byte),volts pin 5 +; MOV A,B ; get saved VSWT +; SUB A,M16U1 ; voltage 47K = VSWT-Voltage at pin 35 +; MOV D,A ; which is 1/3 of total supply ie +V+(-V) +; ADD A,D +; ADD A,D ; TOTAL SUPPLY +; SUB A,B ; TOTAL SUPPLY-VSWT=NEG SUPPLY +;DIAG_NEG: +; ;OUT PORTC,A +; +; LDI A,4 +; OUT ADMUX,A ; NEXT TIME READ VCHG +;ADC_DONE: +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI + +;VSWT: ;OUT PORTC,ATOD ; count value for 2.5 V ref +; LDI A,$FF +; MOV DD16UH,A ; divide by full scale ie VSWT +; SUB DD16UL,DD16UL ; clear low reg +; SUB DV16UH,DV16UH ; clear high reg divisor +; MOV DV16UL,ATOD ; use ATOD value as divisor +; ;OUT PORTC,ATOD +; RCALL DIVIDE ; ***** NOTE AN FF RESULT IS NO INPUT ******* +; MOV MC16UH,DRES16UH ; load multiplicand high from result high +; MOV MC16UL,DRES16UL ; load multiplicand low from result low +; SUB MP16UH,MP16UH ; clear high byte in multiplier reg +; LDI A,25 +; MOV MP16UL,A ; mult by zener ref voltage (2.5V) +; RCALL MULTIPLY +;DIAG_VOLT_VSWT: +;xi: +; LDS A,VSWTS ; previous value of VSWT +; MOV B,MP16UL ; new value of VSWT +; ;RCALL SMOOTH +; STS VSWTS,B +; LDS B,VSWTS +; +; ;OUT PORTC,B;M16U1 ; VSWT IN 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; +; ;STS VSWTS,B ; SAVE NEW SMOOTHED VALUE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; MOV B,M16U1 ; save copy of VSWT for neg 5V routine +; MOV DD16UH,M16U1 +; SUB DD16UL,DD16UL +; LDI A,255 ; calculate the atod volts per division +; MOV DV16UL,A +; SUB DV16UH,DV16UH +; RCALL DIVIDE ; result to be found in dres high & low +; +; LDI A,3 +; OUT ADMUX,A ; NEXT TIME READ VCHG +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;VCHG: +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 37 (1/3 VCHG) +; RCALL MULTIPLY +; MOV A,M16U1 +; ADD M16U1,A ; B\C A3 IS 1/3 VCHG +; ADD M16U1,A +;DIAG_VOLT_VHG: +; ;OUT PORTC,M16U1 ; REUSULT 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; LDI A,5 +; OUT ADMUX,A ; NEXT TIME READ VSWT +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;;*************************************************************************** +;;* +;;* "div16u" - 16/16 Bit Unsigned Division +;;* +;;* This subroutine divides the two 16-bit numbers +;;* "dd8uH:dd8uL" (dividend) and "dv16uH:dv16uL" (divisor). +;;* The result is placed in "dres16uH:dres16uL" and the remainder in +;;* "drem16uH:drem16uL". +;;* +;;* Number of words :19 +;;* Number of cycles :235/251 (Min/Max) +;;* Low registers used :2 (drem16uL,drem16uH) +;;* High registers used :5 (dres16uL/dd16uL,dres16uH/dd16uH,dv16uL,dv16uH, +;;* dcnt16u) +;;* +;;*************************************************************************** +;divide: +;div16u: clr drem16uL ;clear remainder Low byte +; sub drem16uH,drem16uH ;clear remainder High byte and carry +; ldi counter,17 ;init loop counter +;d16u_1: rol dd16uL ;shift left dividend +; rol dd16uH +; dec counter ;decrement counter +; brne d16u_2 ;if done +; ret ; return +;d16u_2: rol drem16uL ;shift dividend into remainder +; rol drem16uH +; sub drem16uL,dv16uL ;remainder = remainder - divisor +; sbc drem16uH,dv16uH ; +; brcc d16u_3 ;if result negative +; add drem16uL,dv16uL ; restore remainder +; adc drem16uH,dv16uH +; clc ; clear carry to be shifted into result +; rjmp d16u_1 ;else +;d16u_3: sec ; set carry to be shifted into result +; rjmp d16u_1 +; +;;********* 16 X 16 multiplication routine from app note avr200 ************* +;;* +;;* "mpy16u" - 16x16 Bit Unsigned Multiplication +;;* +;;* This subroutine multiplies the two 16-bit register variables +;;* mp16uH:mp16uL and mc16uH:mc16uL. +;;* The result is placed in m16u3:m16u2:m16u1:m16u0. +;;* +;;* Number of words :14 + return +;;* Number of cycles :153 + return +;;* Low registers used :None +;;* High registers used :7 (mp16uL,mp16uH,mc16uL/m16u0,mc16uH/m16u1,m16u2, +;;* m16u3,mcnt16u) +;;* +;;*************************************************************************** +;multiply: +;mpy16u: clr m16u3 ;clear high byte of result +; sub m16u2,m16u2 ;clear result byte 2 and carry +; clr m16u2 +; ldi counter,16 ;init loop counter +; lsr mp16uH +; ror mp16uL +; +;m16u_1: brcc noad8 ;if bit 0 of multiplier set +; add m16u2,mc16uL ;add multiplicand Low to byte 2 of res +; adc m16u3,mc16uH ;add multiplicand high to byte 3 of res +;noad8: ror m16u3 ;shift right result byte 3 +; ror m16u2 ;rotate right result byte 2 +; ror m16u1 ;rotate result byte 1 and multiplier High +; ror m16u0 ;rotate result byte 0 and multiplier Low +; dec counter ;decrement loop counter +; brne m16u_1 ;if not done, loop more +; ret +;;************************* Exponential smoothing routine ******************** +;;Receives : Previous value in A +;; : New value in B +;;Passes : Smoothed result back in B reg +;;Uses : d reg +; +;Smooth: +; mov d,a ; save a copy of previous value +; lsr a +; lsr a +; lsr b +; lsr b ; prev.ave - prev.ave + new.data +; sub d,a ; -------- -------- +; add b,d ; n n +; ret + +; ----------------------------------------------------------------------------- + +MESSAGE_0: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',0,128,$1B + .DB 'E','1' + +MESSAGE_1: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',240,64,$1B + .DB 'E','1' + +MESSAGE_2: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','0','0','0',0 + +MESSAGE_3: + .DB $1B,'S',16,13 + .DB 'W','P','O','3','0',' ','V','5' + +MESSAGE_4: + .DB $1B,'S',16,13 + .DB 'B','A','D',' ','C','O','M','M','A','N','D',0 + +MESSAGE_5: + .DB $1B,'S',16,13 + .DB 'B','A','T','T','E','R','Y',' ','L','O','W',0 + +MESSAGE_6: + .DB $1B,'M','0',0 + +MESSAGE_7: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','5','0','0',0 + +MESSAGE_8: + .DB $1B,'S',16,13 + .DB 'S','T','A','C','K',' ','O','V','E','R','F','L','O','W' + +; ----------------------------------------------------------------------------- + + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 100 FOR 16K * 11MHZ STARTUP DELAY (NO R/C STARTUP DELAY) + + .ORG $1000 + + .DW $4100 ; SELECT ADDRESS COMMAND + .DW $ACBC ; WRITE FUSE BITS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/avr/wpov2.asm b/src/avr/wpov2.asm new file mode 100644 index 00000000..665c1456 --- /dev/null +++ b/src/avr/wpov2.asm @@ -0,0 +1,2198 @@ +; WPOV2.ASM +; COPIED FROM WPO15V1.ASM ON 20JUN02 + +; LOOK FOR BIGBODGE TO SEE CEC'S CHANGES TO FIX STARTUP PROBLEM +; AND TO SKIP VOLTAGE MEASURING + +; REVISED 17DEC01 TO SUPPORT NEW HARDWARE TYPE 3 FOR HYT1500 + +; REVISED 18DEC01 TO TRY A CONSERVATIVE 4.5 VOLT SHUTDOWN, LOW BATTERY +; THIS DOESN'T PROTECT AGAINST REBOOTING WHILE PRINTING, TOO BAD + +; REVISED 18DEC01 TO TRY AN AGGRESSIVE 5.5 VOLT SHUTDOWN, LOW BATTERY +; ALSO ENABLED THE 4.5 VOLT IMMEDIATE RESET, DUE TO UNRELIABLE OPERATION +; NOW TRYING 5.0 VOLT IMMEDIATE RESET, CEC SAYS IT WAS MARGINAL ANYWAY + +; NOW DISABLED THE IMMEDIATE RESET DUE TO TESTING RESULTS OF 08JAN02 +; NOT SURE IF THAT WAS REALLY THE PROBLEM - BUT WISH TO BE CONSERVATIVE + +; REVISED 01FEB02 FOR NEW 7.3728 MHZ XTAL, PREVIOUSLY 11.0592 MHZ, 2/3 +; LOOK FOR ;! TO SEE CHANGES FOR 7.3728 MHZ XTAL, ADDED COMMENTS ALSO + +; ----------------------------------------------------------------------------- + +.EQU LARGE =0 + +;IF LARGE +;.INCLUDE "8535DEF.INC" +;ELSE +.INCLUDE "4433DEF.INC" +;ENDIF + +; ----------------------------------------------------------------------------- +; API BUS TIMING CALCULATIONS: + +; 115200 BITS/SEC = 11520 BYTES/SEC = 86.8 US/BYTE + +; FOR MASTER API BUS TX, SEND 1 BYTE PER 9+12 BIT-TIMES, 24 TO BE SAFE +; SO THE CORRECT TX RATE = 86.8 * 2.4 = 200.8 US/BYTE = 4980 BYTES/SEC + +; A SUBTLE OPTIMISATION IS POSSIBLE WHEN THE PREVIOUS TRANSMITTED LSB IS 0, +; AS WE CAN THEN GUARANTEE THE 4800 BPS RECEIVERS WILL SEE FALSE START BIT: + +; FOR MASTER API BUS TX EVEN, SEND 1 BYTE PER 2+12 BIT-TIMES, 16 TO BE SAFE +; SO THE CORRECT TX RATE EVEN = 86.8 * 1.6 = 138.9 US/BYTE = 7199 BYTES/SEC + +; OLD: TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ = APPROX 185 US +; NEW: TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ = APPROX 278 US +; THUS ALL THE TIMEOUT VALUES BELOW HAVE BEEN DECREASED TO 2/3 ORIGINAL + +; NEW: THE EVEN/ODD TX RATE OPTIMISATION HAS BEEN DISABLED AS WE DON'T +; HAVE ENOUGH RESOLUTION WITH THE 7.3728 MHZ XTAL / 8 TO GENERATE 138.9 +; US/BYTE DELAY, BECAUSE MINIMUM UNIT IS NOW 278 US INSTEAD OF 185 US, +; THIS COULD BE IMPROVED LATER, BUT FOR NOW, WE GENERATE AN INTERRUPT +; EVERY 278 US, AND THE NEXT AVAILABLE TCK0 DIVIDER IS /1 SO THIS WOULD +; BECOME 34.8 US, THIS WOULD BE UNACCEPTABLE, SO REVISIT THE ISSUE LATER + +.EQU RAM =$60 ; START OF SRAM + +.EQU API_TIMEOUT =16 ;!25 ; 25 * 0.185 MS = 4.6 MS +.EQU API_TIME_IDLE =8 ;!13 ; 13 * 0.185 MS = 2.4 MS +.EQU API_TIME_SLOW =8 ;!13 ; 25 * 0.185 MS = 2.4 MS +.EQU API_TIME_FAST =1 ;!2 ; 2 * 185 US = 370 US, NOW 1 * 278 US +.EQU API_RATE_SLOW =$5F ;!$8F ; DIVISOR FOR 4800 BPS +.EQU API_RATE_FAST =$03 ;!$05 ; DIVISOR FOR 115200 BPS + +.EQU SPI_TIMEOUT =16 ;!25 ; 100 * 100 US = APPROX 10.0 MS + +;.def drem16uL =R0 ; remainder low +;.def drem16uH =R1 ; remainder high +;.def dres16uL =R2 ; result low DON'T use as general purpose +;.def dres16uH =R3 ; result high DON'T use as general purpose +;.def dd16uL =R2 ; dividend low +;.def dd16uH =R3 ; dividend high +;.def dv16uL =R4 ; divisor low +;.def dv16uH =R5 ; divisor high +; +;.DEF SPI_REMAIN =R6 +; +;.def mc16uL =R7 ;multiplicand low byte +;.def mc16uH =R8 ;multiplicand high byte +;.def mp16uL =R9 ;multiplier low byte +;.def mp16uH =R10 ;multiplier high byte +;.def m16u0 =R9 ;result byte 0 (LSB) +;.def m16u1 =R10 ;result byte 1 +;.def m16u2 =R11 ;result byte 2 +;.def m16u3 =R12 ;result byte 3 (MSB) +; +;.DEF RX_PTR =R13 +;.DEF RX_COUNT0 =R14 + +.DEF API_REMAIN =R1 +.DEF API_WATCHDOG =R2 +.DEF SPI_REMAIN =R3 +.DEF SPI_WATCHDOG =R4 +.DEF RX_PTR =R5 +.DEF RX_COUNT0 =R6 +.DEF RX_COUNT1 =R7 +.DEF TX_PTR =R8 +.DEF TX_COUNT0 =R9 +.DEF TX_COUNT1 =R10 + +.DEF SR =R15 +.DEF A =R16 ; GLOBAL REGISTERS +.DEF B =R17 +.DEF D =R18 +.DEF E =R19 +.DEF F =R23 +.DEF G =R24 + +.DEF FLAGS =R20 +;.def counter =R20 ;loop counter + +.DEF ATOD =R21 ; SO YOU CAN USE SBCI, SUBI, CPI ETC + +.DEF API_STATE =R22 + +;.DEF TX_PTR =R25 +;.DEF API_WATCHDOG =R26 +;.DEF API_REMAIN =R27 +;.DEF SPI_WATCHDOG =R28 +;.DEF TX_COUNT0 =R29 + +.EQU TX_SIZE =$40 +.EQU RX_SIZE =$10 + + .DSEG + .ORG $60 + +VSWTS: .BYTE 1 ; RETAIN ORDERING % +VCHGS: .BYTE 1 +NEGVS: .BYTE 1 + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +TX_ADDRESS0: .BYTE 1 ; DEST FOR TX_COUNT0 BYTES AT HEAD +TX_ADDRESS1: .BYTE 1 ; DEST FOR TX_COUNT1 BYTES AT TAIL + +RX_ADDRESS0: .BYTE 1 ; SOURCE FOR RX_COUNT0 BYTES AT HEAD +RX_ADDRESS1: .BYTE 1 ; SOURCE FOR RX_COUNT1 BYTES AT TAIL + +RX_ADDRESS2: .BYTE 1 ; ALTERNATE VALUE FOR RX_ADDRESS1 + ; SCAN IS 1,2,1,3,1,4,1,5,1,6,1,7,1,8 + +TX_OVERRIDE: .BYTE 1 ; COUNTER TO TRANSMIT 1 TIME IN 16 +RX_OVERRIDE: .BYTE 1 ; COUNTER TO RECEIVE 1 TIME IN 16 + +TX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME TX DEVICE +RX_STICKY: .BYTE 1 ; COUNTER TO STAY ON SAME RX DEVICE + +;ABSENT_COUNT: .BYTE 1 + +TURNOFF_COUNT: .BYTE 1 +WATCHDOG_COUNT: .BYTE 2 + +TX_LIMIT: .BYTE 9 ; MAX Z180 BYTES TO ACCEPT, PER DEVICE + +BATTERY_COUNT: .BYTE 2 ; COUNT 1024 ADC READINGS TO POWER DOWN + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +;LM385_COUNT: .BYTE 1 ; COUNT $10 ADC READINGS TO MISSING REF +VOLTAGE_VSWT: .BYTE 1 ; MOST RECENT ADC READING FROM REF + +HARDWARE_TYPE: .BYTE 1 ; COMES SOMEWHAT BEFORE RSEL HI COMMAND + +STACK_GUARD: .BYTE 1 ; DETECTS IF STACK COMES DOWN TO HERE + +; ----------------------------------------------------------------------------- + +; API_STATE DEFINITIONS +.EQU SPISIZE =0 ; SET IF EXPECTING SPI DATA SIZE CMD +.EQU SPIWAIT =1 ; SET IF SENDING SPI ADDRESS RESPONSE +.EQU SPIDATA =2 ; SET IF TRANSFERRING SPI DATA TX/RX +.EQU SPIDIRN =3 ; SET IF TX, BASED ON ADDRESS COMMAND +.EQU APISIZE =4 ; SET IF NEED TO SEND API DATA SIZE CMD +.EQU APIWAIT =5 ; SET IF WAITING FOR API DATA SIZE RESP +.EQU APIDATA =6 ; SET IF TRANSFERRING API DATA TX/RX +.EQU APIDIRN =7 ; SET IF TX, TOGGLED ON NULL TRANSFER + +; ----------------------------------------------------------------------------- + +;IF LARGE +; +;.EQU IRQ =6 +;.EQU IRQ_PORT =PORTA +;.EQU IRQ_DDR =DDRA +; +;.EQU PRG =3 +;.EQU PRG_PORT =PORTB +;.EQU PRG_DDR =DDRB +; +;.EQU OC1 =5 +;.EQU OC1_PORT =PORTD +;.EQU OC1_DDR =DDRD +; +;.EQU OCR1H =OCR1AH +;.EQU OCR1L =OCR1AL +; +;.EQU COM10 =COM1A0 +;.EQU COM11 =COM1A1 +; +;ELSE + +.EQU IRQ =0 +.EQU IRQ_PORT =PORTB +.EQU IRQ_DDR =DDRB + +.EQU PRG =2 +.EQU PRG_PORT =PORTC +.EQU PRG_DDR =DDRC + +.EQU OC1 =1 +.EQU OC1_PORT =PORTB +.EQU OC1_DDR =DDRB + +.EQU USR =UCSRA +.EQU UCR =UCSRB + +;ENDIF + +; ----------------------------------------------------------------------------- + + .CSEG + + RJMP RESET_ENTRY + + .ORG OVF0ADDR + RJMP T0_OVERFLOW ; TIMER 0 OVERFLOW HANDLER + + .ORG SPIADDR + RJMP SPI_COMPLETE ; SPI TRANSFER COMPLETE HANDLER + + .ORG URXCADDR + RJMP RX_COMPLETE ; UART RX COMPLETE HANDLER + + .ORG ADCCaddr + RJMP ADC_COMPLETE + +; ----------------------------------------------------------------------------- + +RESET_ENTRY: + ; INITIALISE AVR +;IF LARGE +; LDI A,HIGH(RAMEND) +; OUT SPH,A +;ENDIF + LDI A,LOW(RAMEND) + OUT SPL,A ; INIT STACK POINTER + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + ; INITIALISE STACK GUARD + LDI A,$5A + STS STACK_GUARD,A + + ; INITIALISE PORTS + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + LDI A,0 + OUT SPCR,A ; DISABLE SPI WHILE RESETTING Z180 + OUT UCR,A ; DISABLE UART WHILE RESETTING SLAVES + +;IF LARGE +; LDI A,$FF +; OUT DDRC,A ; PORTC CONFIGURED AS OUTPUT +; +; SBI PORTB,7 ; PB7/SCK CONFIGURED AS PULLED UP INPUT +; SBI DDRB,6 ; PB6/MISO CONFIGURED AS OUTPUT +; +; SBI DDRA,7 ; A7 CONFIGURED AS OUTPUT FOR DTR1 +; SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 +; +;; 18DEC01 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +;; SBI PORTA,4 ; A4 PULLED UP TO DETECT MISSING LM385 +;ELSE + SBI PORTB,5 ; PB5/SCK CONFIGURED AS PULLED UP INPUT + SBI DDRB,4 ; PB4/MISO CONFIGURED AS OUTPUT + + SBI DDRD,5 ; D5 CONFIGURED AS OUTPUT FOR DTR1 + SBI DDRD,6 ; D6 CONFIGURED AS OUTPUT FOR DTR0 + +; 20JUN02 NOT PULLED UP, DON'T WANT TO CORRUPT 100K/100K DIVIDER +; SBI PORTC,4 ; C4 PULLED UP TO DETECT MISSING LM385 +;ENDIF + + SBI PORTD,2 ; D2 CONFIGURED AS PULL UP FOR IBM CLK + SBI PORTD,3 ; D3 CONFIGURED AS PULL UP FOR IBM DATA + + SBI OC1_PORT,OC1 + SBI OC1_DDR,OC1 ; OUTPUT OC1 = 1, PWM TRANSISTOR OFF + + CBI IRQ_PORT,IRQ + CBI IRQ_DDR,IRQ ; OUTPUT IRQ = TRI-STATE + + CBI PORTD,7 + SBI DDRD,7 ; OUTPUT RSEL = 0 + + CBI PORTD,4 + SBI DDRD,4 ; OUTPUT RES = 0 + + ; HARD RESET API BUS DEVICES + CBI PRG_PORT,PRG + SBI PRG_DDR,PRG ; OUTPUT PRG = 0 + + CBI PORTD,1 + SBI DDRD,1 ; OUTPUT TXD = 0 + + LDI A,7 + RCALL PRG_RESET ; SPECIFIC RESET SPARE + + LDI A,6 + RCALL PRG_RESET ; SPECIFIC RESET M192 RECEIPT PRINTER + + LDI A,5 + RCALL PRG_RESET ; SPECIFIC RESET M192 LABEL PRINTER + + LDI A,4 + RCALL PRG_RESET ; SPECIFIC RESET MT102 RECEIPT PRINTER + + ;LDI A,3 + ;RCALL PRG_RESET ; SPECIFIC RESET SPARE + ; THE ABOVE SHOULD BE OK - WHY NOT ?? 16FEB01 + + ;LDI A,2 + ;RCALL PRG_RESET ; SPECIFIC RESET TOUCHSCREEN + + LDI A,1 + RCALL PRG_RESET ; SPECIFIC RESET CUSTOMER DISPLAY + + LDI A,0 + RCALL PRG_RESET ; REMOVE RESET PULSE + + ; LOADCELL HAS BEEN IN RESET UNTIL NOW, AND WILL START IN 10 MS + + ;SBI PORTD,1 ; OUTPUT TXD = 1 + + LDI A,API_RATE_SLOW ; 4800 BAUD + OUT UBRR,A ; SET BAUD RATE + LDI A,$18 + OUT UCR,A ; ENABLE TX AND RX (OUTPUTS TXD = 1) + + RCALL PRG_DELAY_280_MS ; DELAY FOR TOUCHSCREEN TO REENTER IDLE + + LDI A,$AA + OUT UDR,A ; SEND SLOW TURNON COMMAND + OUT UDR,A ; AND AGAIN FOR EXTRA SAFETY + + RCALL PRG_DELAY_20_MS ; DELAY TO ALLOW DEVICES TO INITIALISE + + ; ALLOW Z180 TO START + SBI PORTD,4 ; OUTPUT RES = 1 + ;CBI DDRD,4 ; OUTPUT RES = TRI-STATE + +; BIGBODGE FOR ANOTHER RESET PULSE!!!! +RCALL PRG_DELAY_20_MS +CBI PORTD,4 ; RES=0 +RCALL PRG_DELAY_20_MS +SBI PORTD,4 ; OUTPUT RES = 1 + + ; INITIALISE VARIABLES + CLR A + LDI ZL,VSWTS + CLR ZH + ST Z+,A + ST Z+,A + ST Z+,A + LDI ZL,TX_LIMIT + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A + ST Z+,A ; CAREFUL - Z WILL BE USED AGAIN BELOW + STS TURNOFF_COUNT,A + STS VOLTAGE_VSWT,A + + ;LDI A,LOW(1000) + STS WATCHDOG_COUNT,A + ;LDI A,HIGH(1000) ; 100 MS + STS WATCHDOG_COUNT+1,A + + LDI A,TX_SIZE + ST Z,A ; RX_LIMIT FOR 9TH (INTERNAL) DEVICE + + LDI A,LOW(1024) + STS BATTERY_COUNT,A + LDI A,HIGH(1024) + STS BATTERY_COUNT+1,A + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI A,$10 ; START COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,A + + CLR FLAGS + + CLR API_STATE + CLR API_REMAIN + + CLR TX_PTR + CLR TX_COUNT0 + CLR TX_COUNT1 + + CLR RX_PTR + CLR RX_COUNT0 + CLR RX_COUNT1 + +; LDI A,4 +; STS ABSENT_COUNT,A ; TOP UP ABSENT COUNTER FOR TX_ADDRESS + + ; START COMMUNICATIONS TASK + LDI A,2 + STS RX_ADDRESS2,A ; ALTERNATE VALUE FOR RX_ADDRESS1 + + LDI A,1 + STS TX_ADDRESS0,A + STS TX_ADDRESS1,A + STS RX_ADDRESS0,A + STS RX_ADDRESS1,A + STS TX_OVERRIDE,A + STS RX_OVERRIDE,A + STS HARDWARE_TYPE,A ; AS FOR OLD ALGORITHM WITH FLAGS,2 = 0 + + LDI A,0 + STS TX_STICKY,A + STS RX_STICKY,A + + LDI A,-API_TIMEOUT + MOV API_WATCHDOG,A ; SET UP TIME TO FIRST API BUS POLL + LDI A,-SPI_TIMEOUT + MOV SPI_WATCHDOG,A ; SET UP TIME TO FIRST SPI BUS POLL + + LDI A,$02 ; TCK0 = CK/8 + OUT TCCR0,A ; TCK0 ROLLOVER = 256 * 8 / 7.3728 MHZ + ; = APPROX 278 US + ;!TCK0 ROLLOVER = 256 * 8 / 11.0592 MHZ + ;! = APPROX 185 US +;IF LARGE +; LDI A,$01 +;ELSE + LDI A,$02 +;ENDIF + OUT TIMSK,A ; ENABLE TIMER 0 OVERFLOW INTERRUPTS + + ;LDI A,API_RATE_SLOW ; 4800 BAUD + ;OUT UBRR,A ; SET BAUD RATE + ;LDI A,$18 + ;OUT UCR,A ; ENABLE TX AND RX + + IN A,SPSR + IN A,SPDR ; CLEAR SPI INTERRUPT PENDING FLAG + LDI A,$E8 + OUT SPCR,A ; SPI SLAVE, SAMPLE ON SCK FALLING EDGE + + ; START -5V GENERATOR TASK + LDI A,0 + OUT TCNT1H,A + OUT TCNT1L,A + OUT OCR1H,A + OUT OCR1L,A ; ASSUME NO LOAD TO BEGIN WITH + + LDI A,1< 0 + OR E,TX_COUNT0 + OR E,TX_COUNT1 + BRNE API_TRY_TX + +;API_TRY_RX: + LDS E,TX_OVERRIDE + DEC E + BREQ API_DIRECTION_TX ; FORCED TRANSMIT EVERY SO OFTEN + STS TX_OVERRIDE,E + RJMP API_DIRECTION_RX + +API_TRY_TX: + LDS E,RX_OVERRIDE + DEC E + BREQ BREQ_API_DIRECTION_RX ; FORCED RECEIVE EVERY SO OFTEN + STS RX_OVERRIDE,E + +API_DIRECTION_TX: + LDI E,$10 + STS TX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + ; SUSPEND TX OPERATIONS WHEN 9TH (INTERNAL) DEVICE ADDRESSED % + TST TX_COUNT0 ; ANY BYTES AT HEAD ? + LDS E,TX_ADDRESS0 + BRNE API_SUSPEND_TX0 ; YES, GO AND CHECK HEAD DEVICE + + TST TX_COUNT1 ; ANY BYTES AT TAIL ? + BREQ API_SUSPEND_TX1 ; NO, GO AND PERFORM TX OPERATION + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE TX_COUNT1 BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 + STS TX_ADDRESS0,E ; ADOPT TAIL DEVICE FOR BYTES AT HEAD + +API_SUSPEND_TX0: + CPI E,9 +BREQ_API_DIRECTION_RX: + BREQ API_DIRECTION_RX + +API_SUSPEND_TX1: + ; % + +; LDS E,ABSENT_COUNT +; TST E +; BRNE API_DEVICE_PRESENT +; +;;API_DEVICE_ABSENT: +; ADD TX_PTR,TX_COUNT0 ; SKIP TX_COUNT0 BYTES AT HEAD +; LDI E,TX_SIZE-1 +; AND TX_PTR,E +; +; CLR TX_COUNT0 ; ABANDON TX_COUNT0 DATA IN TX_BUF +; STS TX_STICKY,TX_COUNT0 ; DO NOT GO STICKY ON ABSENT DEVICE +; +; PUSH ZL +; PUSH ZH +; LDI ZL,TX_LIMIT-1 +; LDS ZH,TX_ADDRESS0 +; ADD ZL,ZH +; CLR ZH +; ;ST Z,TX_COUNT0 ; SAVE MAX BYTES TO ACCEPT, PER DEVICE +; LDI E,TX_SIZE +; ST Z,E ; SO THAT WE WILL GOBBLE UP DATA FOR ABSENT DEVICES +; POP ZH +; POP ZL +; +; LDI E,4 +; STS ABSENT_COUNT,E ; TOP UP ABSENT COUNTER FOR NEXT DEVICE +; +;API_DEVICE_PRESENT: + CBR API_STATE,1< 0 + DEC E + BRPL API_TX_ADDRESS_STICKY ; STAYING STICKY, ADOPT NEW DEVICE + + LDS E,TX_ADDRESS0 + INC E ; BUMP TX_ADDRESS BEFORE USING IT + CPI E,9 + BRLO API_TX_ADDRESS_SAVE + LDI E,1 + RJMP API_TX_ADDRESS_SAVE + +API_TX_ADDRESS_ADOPT: + LDI E,1 +API_TX_ADDRESS_STICKY: + STS TX_STICKY,E ; DECREMENT, OR TOP UP, STICKY COUNT + + MOV TX_COUNT0,TX_COUNT1 + CLR TX_COUNT1 ; MOVE BYTES AT TAIL TO HEAD + + LDS E,TX_ADDRESS1 ; DEST FOR TX_COUNT1 BYTES AT HEAD +API_TX_ADDRESS_SAVE: + STS TX_ADDRESS0,E ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_TX_ADDRESS_SAME: + LDI E,1 + STS TX_STICKY,E ; TOP UP STICKY COUNT + + LDS E,TX_ADDRESS0 ; DEST FOR TX_COUNT0 BYTES AT HEAD + RJMP API_ADDRESS_SEND + +API_DIRECTION_RX: + LDI E,$10 + STS RX_OVERRIDE,E ; COUNTDOWN TO NEXT OVERRIDE + + SBR API_STATE,1< $10 + ;MOV E,ATOD + ;LSL ATOD ; $01 HALF SCALE -> $20 + ;ADD E,ATOD ; $01 HALF SCALE -> $30 HALF WIDTH + + LSR ATOD ; $40 HALF SCALE -> $20 + MOV E,ATOD + LSR ATOD ; $40 HALF SCALE -> $10 + ADD E,ATOD ; $40 HALF SCALE -> $30 HALF WIDTH + RJMP ADC_PULSE + +ADC_REFERENCE: + CBR FLAGS,1<<4 ; SAY NEXT RESULT WILL BE -5V GENERATOR + + ;STS VOLTAGE_VSWT,ATOD + ;RJMP ADC_DONE + +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; SBRC FLAGS,5 ; CURRENT REFERENCE IS BANDGAP ? +; RJMP ADC_BANDGAP +; +; ; CURRENT REFERENCE IS LM385 (18DEC01 IT'S NOW A 100K/100K DIVIDER) +; CPI ATOD,$F8 ; IF =>$F8 ASSUME WE HAVE PULLUP ONLY +; BRLO ADC_LM385 +; +; LDS E,LM385_COUNT +; DEC E ; COUNT DOWN TO MISSING LM385 +; STS LM385_COUNT,E +; BRNE ADC_DONE ; KEEP TRYING LM385 +; +; SBR FLAGS,1<<5 ; SAY WE HAVE SWITCHED TO BANDGAP +;GO_ADC_DONE: +; RJMP ADC_DONE +; +;ADC_LM385: +; LDI E,$10 ; TOP UP COUNTDOWN TO MISSING LM385 +; STS LM385_COUNT,E +; +;; LSR ATOD ; LM385 VOLTAGE = APPROX 2*BANDGAP +; ; USE LM385Z-1.2 +; +;ADC_BANDGAP: + STS VOLTAGE_VSWT,ATOD + + ; 18DEC01 USE 5.5 VOLTS AS FOR THE ORIGINAL HYTECH 1000 SYSTEM + ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC + ;CPI ATOD,137 ; 256*0.5*4.5/4.2 + ;CPI ATOD,152 ; 256*0.5*5.0/4.2 + CPI ATOD,168 ; 256*0.5*5.5/4.2 + +; ;CPI ATOD,70 ; 256*1.22/4.5 +; ;CPI ATOD,63 ; 256*1.22/5.0 +; CPI ATOD,57 ; 256*1.22/5.5 + + LDI E,LOW(1024) + LDI F,HIGH(1024) + ; 18DEC01 FOR HYT1500 REVERSED THE SENSE DUE TO NEW 100K/100K DIVIDER + ;BRLO ADC_BATTERY_SAVE + BRSH ADC_BATTERY_SAVE + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 THIS IS NOW DONE FURTHER DOWN, AFTER LOW BATTERY TEST +;RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + + ; VSWT < 5.5 VOLTS, STABILISE READING FOR BATTERY LOW + LDS E,BATTERY_COUNT + LDS F,BATTERY_COUNT+1 + SUBI E,LOW(1) + SBCI F,HIGH(1) + BRNE ADC_BATTERY_SAVE ; COUNT 1024 LOW BATTERY READINGS + + LDI E,0 + OUT SPCR,E ; DISABLE SPI WHILE SHOWING MESSAGE + CLR SPI_WATCHDOG ; ENSURE SPI REMAINS DISABLED + + SBR FLAGS,1<<3 ; SHOW BATTERY MESSAGE AND POWER DOWN + +ADC_BATTERY_SAVE: + STS BATTERY_COUNT,E + STS BATTERY_COUNT+1,F + +; BIGBODGE TO SKIP SHUT DOWN DUE TO VOLTAGE MEASURING +; 17DEC01 WE'LL ALSO COMMENT THE WHOLE THING OUT FOR NEATNESS +RJMP ADC_DONE ; SKIP VOLTAGE TEST FOR NOW + +; ; 18DEC01 USE 5.0 VOLTS, MORE AGGRESSIVE THAN HYTECH 1000 SYSTEM +; ; IT MUST BE A BIT > 4.2 VOLTS BECAUSE OTHERWISE AVR VCC = Z180 VCC +; ;CPI ATOD,137 ; 256*0.5*4.5/4.2 +; CPI ATOD,152 ; 256*0.5*5.0/4.2 +; ;CPI ATOD,168 ; 256*0.5*5.5/4.2 +; BRSH ADC_DONE +; +;; ;CPI ATOD,90 ; 256*1.22/3.5 +;; ;CPI ATOD,79 ; 256*1.22/4.0 +;; CPI ATOD,70 ; 256*1.22/4.5 +;; BRLO ADC_DONE +; +; ; 18DEC01 VSWT < 5.0 VOLTS, RESET MAIN PROCESSOR IMMEDIATELY +; LDI E,$FF +; STS TURNOFF_COUNT,E ; TIMEOUT TO RESET IF POWER STUCK ON +; +; LDI E,0 +; OUT SPCR,E ; DISABLE SPI WHILE RESETTING Z180 +; +; CBI PORTD,4 ; OUTPUT RES = 0 TO PROTECT RAM +; +; LDI E,$FF +; LDI F,$00 ; PWM TRANSISTOR ON, TO PULL DOWN VSWT + +ADC_PULSE: + OUT OCR1H,F + OUT OCR1L,E ; SET PULSE WIDTH FOR PWM TRANSISTOR + +ADC_DONE: +; 18DEC01 REMOVED FOR HYT1500 AS ONLY ONE POSSIBLE CONFIGURATION +; LDI E,$45 ; START MEASURING BANDGAP +; SBRS FLAGS,5 + LDI E,$04 ; START MEASURING LM385 + SBRS FLAGS,4 + LDI E,$05 ; START MEASURING -5V GENERATOR + OUT ADMUX,E + LDI E,$DE + OUT ADCSR,E ; ENABLE A/D, START, SINGLE CONVERSION + + OUT SREG,SR + RETI + +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 5 +; RCALL MULTIPLY +;DIAG_VOLTS_AT_A5: +; ;OUT PORTC,M16U1 ; res in byte 2(ignore ls,byte),volts pin 5 +; MOV A,B ; get saved VSWT +; SUB A,M16U1 ; voltage 47K = VSWT-Voltage at pin 35 +; MOV D,A ; which is 1/3 of total supply ie +V+(-V) +; ADD A,D +; ADD A,D ; TOTAL SUPPLY +; SUB A,B ; TOTAL SUPPLY-VSWT=NEG SUPPLY +;DIAG_NEG: +; ;OUT PORTC,A +; +; LDI A,4 +; OUT ADMUX,A ; NEXT TIME READ VCHG +;ADC_DONE: +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI + +;VSWT: ;OUT PORTC,ATOD ; count value for 2.5 V ref +; LDI A,$FF +; MOV DD16UH,A ; divide by full scale ie VSWT +; SUB DD16UL,DD16UL ; clear low reg +; SUB DV16UH,DV16UH ; clear high reg divisor +; MOV DV16UL,ATOD ; use ATOD value as divisor +; ;OUT PORTC,ATOD +; RCALL DIVIDE ; ***** NOTE AN FF RESULT IS NO INPUT ******* +; MOV MC16UH,DRES16UH ; load multiplicand high from result high +; MOV MC16UL,DRES16UL ; load multiplicand low from result low +; SUB MP16UH,MP16UH ; clear high byte in multiplier reg +; LDI A,25 +; MOV MP16UL,A ; mult by zener ref voltage (2.5V) +; RCALL MULTIPLY +;DIAG_VOLT_VSWT: +;xi: +; LDS A,VSWTS ; previous value of VSWT +; MOV B,MP16UL ; new value of VSWT +; ;RCALL SMOOTH +; STS VSWTS,B +; LDS B,VSWTS +; +; ;OUT PORTC,B;M16U1 ; VSWT IN 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; +; ;STS VSWTS,B ; SAVE NEW SMOOTHED VALUE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; MOV B,M16U1 ; save copy of VSWT for neg 5V routine +; MOV DD16UH,M16U1 +; SUB DD16UL,DD16UL +; LDI A,255 ; calculate the atod volts per division +; MOV DV16UL,A +; SUB DV16UH,DV16UH +; RCALL DIVIDE ; result to be found in dres high & low +; +; LDI A,3 +; OUT ADMUX,A ; NEXT TIME READ VCHG +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;VCHG: +; MOV MC16UH,DRES16UH ; X high from result of previous division in VSWT +; MOV MC16UL,DRES16UL ; X low from result of previous division in VSWT +; SUB MP16UH,MP16UH ; clear high +; MOV MP16UL,ATOD ; from ATOD count on pin 37 (1/3 VCHG) +; RCALL MULTIPLY +; MOV A,M16U1 +; ADD M16U1,A ; B\C A3 IS 1/3 VCHG +; ADD M16U1,A +;DIAG_VOLT_VHG: +; ;OUT PORTC,M16U1 ; REUSULT 2nd BYTE B/C YOU WANT IT FIXED SO THE REMAINDER IN THE +; ; LAST DIVISION IS WEIGHED CORRECTLY .... SEE CEC IF YOU CAN'T REMEMBER +; LDI A,5 +; OUT ADMUX,A ; NEXT TIME READ VSWT +; SBI ADCSR,ADSC ; START ANOTHER CONVERSION +; RETI +; +;;*************************************************************************** +;;* +;;* "div16u" - 16/16 Bit Unsigned Division +;;* +;;* This subroutine divides the two 16-bit numbers +;;* "dd8uH:dd8uL" (dividend) and "dv16uH:dv16uL" (divisor). +;;* The result is placed in "dres16uH:dres16uL" and the remainder in +;;* "drem16uH:drem16uL". +;;* +;;* Number of words :19 +;;* Number of cycles :235/251 (Min/Max) +;;* Low registers used :2 (drem16uL,drem16uH) +;;* High registers used :5 (dres16uL/dd16uL,dres16uH/dd16uH,dv16uL,dv16uH, +;;* dcnt16u) +;;* +;;*************************************************************************** +;divide: +;div16u: clr drem16uL ;clear remainder Low byte +; sub drem16uH,drem16uH ;clear remainder High byte and carry +; ldi counter,17 ;init loop counter +;d16u_1: rol dd16uL ;shift left dividend +; rol dd16uH +; dec counter ;decrement counter +; brne d16u_2 ;if done +; ret ; return +;d16u_2: rol drem16uL ;shift dividend into remainder +; rol drem16uH +; sub drem16uL,dv16uL ;remainder = remainder - divisor +; sbc drem16uH,dv16uH ; +; brcc d16u_3 ;if result negative +; add drem16uL,dv16uL ; restore remainder +; adc drem16uH,dv16uH +; clc ; clear carry to be shifted into result +; rjmp d16u_1 ;else +;d16u_3: sec ; set carry to be shifted into result +; rjmp d16u_1 +; +;;********* 16 X 16 multiplication routine from app note avr200 ************* +;;* +;;* "mpy16u" - 16x16 Bit Unsigned Multiplication +;;* +;;* This subroutine multiplies the two 16-bit register variables +;;* mp16uH:mp16uL and mc16uH:mc16uL. +;;* The result is placed in m16u3:m16u2:m16u1:m16u0. +;;* +;;* Number of words :14 + return +;;* Number of cycles :153 + return +;;* Low registers used :None +;;* High registers used :7 (mp16uL,mp16uH,mc16uL/m16u0,mc16uH/m16u1,m16u2, +;;* m16u3,mcnt16u) +;;* +;;*************************************************************************** +;multiply: +;mpy16u: clr m16u3 ;clear high byte of result +; sub m16u2,m16u2 ;clear result byte 2 and carry +; clr m16u2 +; ldi counter,16 ;init loop counter +; lsr mp16uH +; ror mp16uL +; +;m16u_1: brcc noad8 ;if bit 0 of multiplier set +; add m16u2,mc16uL ;add multiplicand Low to byte 2 of res +; adc m16u3,mc16uH ;add multiplicand high to byte 3 of res +;noad8: ror m16u3 ;shift right result byte 3 +; ror m16u2 ;rotate right result byte 2 +; ror m16u1 ;rotate result byte 1 and multiplier High +; ror m16u0 ;rotate result byte 0 and multiplier Low +; dec counter ;decrement loop counter +; brne m16u_1 ;if not done, loop more +; ret +;;************************* Exponential smoothing routine ******************** +;;Receives : Previous value in A +;; : New value in B +;;Passes : Smoothed result back in B reg +;;Uses : d reg +; +;Smooth: +; mov d,a ; save a copy of previous value +; lsr a +; lsr a +; lsr b +; lsr b ; prev.ave - prev.ave + new.data +; sub d,a ; -------- -------- +; add b,d ; n n +; ret + +; ----------------------------------------------------------------------------- + +MESSAGE_0: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',0,128,$1B + .DB 'E','1' + +MESSAGE_1: + .DB $1B,'D','0',$1B,'G','0' + .DB $1B,'P','1',$1B,'E','0' + .DB $1B,'K' + .DB $1B,'0' + .DB $1B,'/','0',$1B + .DB 'S',0,0,$1B + .DB 'N',240,64,$1B + .DB 'E','1' + +MESSAGE_2: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','0','0','0',0 + +MESSAGE_3: + .DB $1B,'S',16,13 + .DB 'W','P','O','3','0',' ','V','5' + +MESSAGE_4: + .DB $1B,'S',16,13 + .DB 'B','A','D',' ','C','O','M','M','A','N','D',0 + +MESSAGE_5: + .DB $1B,'S',16,13 + .DB 'B','A','T','T','E','R','Y',' ','L','O','W',0 + +MESSAGE_6: + .DB $1B,'M','0',0 + +MESSAGE_7: + .DB $1B,'S',16,13 + .DB 'H','Y','T','E','C','H',' ','1','5','0','0',0 + +MESSAGE_8: + .DB $1B,'S',16,13 + .DB 'S','T','A','C','K',' ','O','V','E','R','F','L','O','W' + +; ----------------------------------------------------------------------------- + + .ORG $1000 + +;IF LARGE (THE ORIGINAL WPO15V1.HEX SETTINGS) +; .DW $4100 ; SELECT ADDRESS COMMAND +; ; FSTRT = 0 FOR 1.1 MS R/C STARTUP DELAY +; ;.DW $ACBE ; WRITE FUSE BITS COMMAND +;; BIGBODGE (NOT REALLY - JUST IN CASE TYPE OF CHANGE) +;; FSTRT = 1 FOR 16 MS R/C STARTUP DELAY +; .DW $ACBF ; WRITE FUSE BITS COMMAND +;ELSE + ; BODEN = 1 DISABLED + ; BODLEVEL = 1 FOR 2.7V + + ; CKSEL = 100 FOR 16K * 11MHZ STARTUP DELAY (NO R/C STARTUP DELAY) + + .DW $4100 ; SELECT ADDRESS COMMAND + .DW $ACBC ; WRITE FUSE BITS COMMAND +;ENDIF + +; ----------------------------------------------------------------------------- + diff --git a/src/bin/as-z80.exe b/src/bin/as-z80.exe index 632a28d5..912b5f73 100644 Binary files a/src/bin/as-z80.exe and b/src/bin/as-z80.exe differ diff --git a/src/bin/bd.exe b/src/bin/bd.exe index af80d7fe..d284f670 100644 Binary files a/src/bin/bd.exe and b/src/bin/bd.exe differ diff --git a/src/bin/bin2avr.exe b/src/bin/bin2avr.exe new file mode 100644 index 00000000..3ea5d513 Binary files /dev/null and b/src/bin/bin2avr.exe differ diff --git a/src/bin/bin2c.exe b/src/bin/bin2c.exe index e9139f48..ec59276a 100644 Binary files a/src/bin/bin2c.exe and b/src/bin/bin2c.exe differ diff --git a/src/bin/bmp2txt.exe b/src/bin/bmp2txt.exe new file mode 100644 index 00000000..fdf4e300 Binary files /dev/null and b/src/bin/bmp2txt.exe differ diff --git a/src/bin/chs2cmd.exe b/src/bin/chs2cmd.exe new file mode 100644 index 00000000..f355dbb7 Binary files /dev/null and b/src/bin/chs2cmd.exe differ diff --git a/src/bin/cr.exe b/src/bin/cr.exe index 062bc409..dccde719 100644 Binary files a/src/bin/cr.exe and b/src/bin/cr.exe differ diff --git a/src/bin/diff.exe b/src/bin/diff.exe deleted file mode 100644 index 8c84ded6..00000000 Binary files a/src/bin/diff.exe and /dev/null differ diff --git a/src/bin/fsck.exe b/src/bin/fsck.exe index 0354bae4..30225ccb 100644 Binary files a/src/bin/fsck.exe and b/src/bin/fsck.exe differ diff --git a/src/bin/ihex2bin.exe b/src/bin/ihex2bin.exe index 0f3885e0..c29e1e58 100644 Binary files a/src/bin/ihex2bin.exe and b/src/bin/ihex2bin.exe differ diff --git a/src/bin/link-z80.exe b/src/bin/link-z80.exe index f6760bf1..1462ae12 100644 Binary files a/src/bin/link-z80.exe and b/src/bin/link-z80.exe differ diff --git a/src/bin/mkfs.exe b/src/bin/mkfs.exe index 60123069..34770dde 100644 Binary files a/src/bin/mkfs.exe and b/src/bin/mkfs.exe differ diff --git a/src/bin/nroff.exe b/src/bin/nroff.exe index 60199e76..250afd09 100644 Binary files a/src/bin/nroff.exe and b/src/bin/nroff.exe differ diff --git a/src/bin/p.exe b/src/bin/p.exe new file mode 100644 index 00000000..e3721c39 Binary files /dev/null and b/src/bin/p.exe differ diff --git a/src/bin/patch.exe b/src/bin/patch.exe deleted file mode 100644 index b7dd0e5f..00000000 Binary files a/src/bin/patch.exe and /dev/null differ diff --git a/src/bin/pkzipc.exe b/src/bin/pkzipc.exe new file mode 100644 index 00000000..09883b9e Binary files /dev/null and b/src/bin/pkzipc.exe differ diff --git a/src/bin/tavrasm.exe b/src/bin/tavrasm.exe new file mode 100644 index 00000000..fa3f52cd Binary files /dev/null and b/src/bin/tavrasm.exe differ diff --git a/src/bin/touch.exe b/src/bin/touch.exe index a607f979..84db3811 100644 Binary files a/src/bin/touch.exe and b/src/bin/touch.exe differ diff --git a/src/bin/txt2chs.exe b/src/bin/txt2chs.exe new file mode 100644 index 00000000..e5eb754e Binary files /dev/null and b/src/bin/txt2chs.exe differ diff --git a/src/bin/ucp.exe b/src/bin/ucp.exe index 1b4d72e7..29b22fa1 100644 Binary files a/src/bin/ucp.exe and b/src/bin/ucp.exe differ diff --git a/src/font/large.psd b/src/font/large.psd new file mode 100644 index 00000000..d2f7656a Binary files /dev/null and b/src/font/large.psd differ diff --git a/src/font/lcd0.cmd b/src/font/lcd0.cmd new file mode 100644 index 00000000..b01407f1 Binary files /dev/null and b/src/font/lcd0.cmd differ diff --git a/src/font/lcd1.cmd b/src/font/lcd1.cmd new file mode 100644 index 00000000..5e9496d8 Binary files /dev/null and b/src/font/lcd1.cmd differ diff --git a/src/font/n.bat b/src/font/n.bat new file mode 100644 index 00000000..754176fc --- /dev/null +++ b/src/font/n.bat @@ -0,0 +1,27 @@ +bmp2txt set01.bmp +bmp2txt set02.bmp +bmp2txt set03.bmp +bmp2txt set04.bmp +bmp2txt set05.bmp +bmp2txt set06.bmp + +txt2chs set01.txt 1 3 +txt2chs set02.txt 1 3 +txt2chs set03.txt 1 4 +txt2chs set04.txt 2 5 +txt2chs set05.txt 2 7 +txt2chs set06.txt 1 3 + +chs2cmd set01.chs 1 +chs2cmd set02.chs 2 +chs2cmd set03.chs 3 +chs2cmd set04.chs 4 +chs2cmd set05.chs 5 +chs2cmd set06.chs 6 + +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd+set06.cmd lcd0.cmd +copy/b set01.cmd+set02.cmd+set03.cmd+set04.cmd+set05.cmd lcd1.cmd + +copy lcd0.cmd ..\..\bin\font +copy lcd1.cmd ..\..\bin\font + diff --git a/src/font/set01.bmp b/src/font/set01.bmp new file mode 100644 index 00000000..c49ae7a6 Binary files /dev/null and b/src/font/set01.bmp differ diff --git a/src/font/set01.chs b/src/font/set01.chs new file mode 100644 index 00000000..311c8d53 Binary files /dev/null and b/src/font/set01.chs differ diff --git a/src/font/set01.cmd b/src/font/set01.cmd new file mode 100644 index 00000000..bd79d3ba Binary files /dev/null and b/src/font/set01.cmd differ diff --git a/src/font/set01.txt b/src/font/set01.txt new file mode 100644 index 00000000..2b3e6462 --- /dev/null +++ b/src/font/set01.txt @@ -0,0 +1,1056 @@ +at 15,17 size 2,10 + +## +## +## +## +## + +##__ + + +at 21,17 size 4,10 +## ## +## ## +## ## + + + + +________ + + +at 30,17 size 7,10 + + ## ## + ## ## + ########## + ## ## +########## + ## ## +__##__##______ + + +at 41,17 size 6,10 + ## + ## + ######## +## ## + #### + #### + ## ## +########____ + ## + ## +at 51,17 size 10,10 + + #### ## +## ## ## +## ## ## + #### ## #### + ## ## ## + ## ## ## +____##______####____ + + +at 65,17 size 7,10 + + #### +## ## +## ## + #### ## +## ## ## +## ## +__######__##__ + + +at 76,17 size 2,10 +## +## +## + + + + +____ + + +at 82,17 size 4,10 + ## + ## +## +## +## +## +## +##______ + ## + ## +at 90,17 size 4,10 +## + ## + ## + ## + ## + ## + ## +____##__ + ## +## +at 99,17 size 6,10 + ## +## ## ## + ###### +## ## ## + ## + + +____________ + + +at 108,17 size 8,10 + + ## + ## + ## +############## + ## + ## +______##________ + + +at 120,17 size 3,10 + + + + + + + ## +__##__ +## + +at 127,17 size 4,10 + + + + +###### + + +________ + + +at 135,17 size 2,10 + + + + + + +## +##__ + + +at 141,17 size 5,10 + ## + ## + ## + ## + ## + ## + ## +##________ +## + +at 151,17 size 6,10 + + ###### +## ## +## ## +## ## +## ## +## ## +__######____ + + +at 160,17 size 6,10 + + ## +###### + ## + ## + ## + ## +##########__ + + +at 170,17 size 6,10 + + ###### +## ## + ## + ## + ## + ## +##########__ + + +at 180,17 size 6,10 + + ###### +## ## + ## + #### + ## +## ## +__######____ + + +at 190,17 size 6,10 + + ## + #### + ## ## +## ## +########## + ## +______##____ + + +at 200,17 size 6,10 + +########## +## +######## + ## + ## +## ## +__######____ + + +at 210,17 size 6,10 + + #### + ## +## +######## +## ## +## ## +__######____ + + +at 220,17 size 6,10 + +########## + ## + ## + ## + ## + ## +__##________ + + +at 230,17 size 6,10 + + ###### +## ## +## ## + ###### +## ## +## ## +__######____ + + +at 239,17 size 6,10 + + ###### +## ## +## ## + ######## + ## + ## +__####______ + + +at 250,17 size 2,10 + + + +## +## + +## +##__ + + +at 257,17 size 3,10 + + + + ## + ## + + ## +__##__ +## + +at 265,17 size 7,10 + + + #### + #### +#### + #### + #### +______________ + + +at 277,17 size 7,10 + + + +############ + +############ + +______________ + + +at 289,17 size 7,10 + + +#### + #### + #### + #### +#### +______________ + + +at 300,17 size 5,10 + +###### + ## + ## + ## + ## + +__##______ + + +at 7,41 size 9,10 + + ########## + ## ## +## ###### ## +## ## ## ## +## ## ## ## +## ## ## ## +##____####__##____ + ## + ######## +at 20,41 size 8,10 + + ## + ## ## + ## ## + ## ## + ########## + ## ## +##__________##__ + + +at 31,41 size 6,10 + +###### +## ## +## ## +######## +## ## +## ## +########____ + + +at 41,41 size 7,10 + + ###### + ## ## +## +## +## + ## ## +____######____ + + +at 52,41 size 7,10 + +######## +## ## +## ## +## ## +## ## +## ## +########______ + + +at 63,41 size 5,10 + +######## +## +## +######## +## +## +########__ + + +at 73,41 size 6,10 + +########## +## +## +######## +## +## +##__________ + + +at 82,41 size 7,10 + + ###### + ## ## +## +## ###### +## ## + ## ## +____########__ + + +at 93,41 size 7,10 + +## ## +## ## +## ## +############ +## ## +## ## +##________##__ + + +at 104,41 size 4,10 + +###### + ## + ## + ## + ## + ## +######__ + + +at 111,41 size 5,10 + + #### + ## + ## + ## + ## + ## +######____ + + +at 120,41 size 7,10 + +## ## +## ## +## ## +###### +## ## +## ## +##________##__ + + +at 131,41 size 6,10 + +## +## +## +## +## +## +##########__ + + +at 140,41 size 8,10 + +#### #### +#### #### +## ## ## ## +## ## ## ## +## ## ## +## ## ## +##__________##__ + + +at 152,41 size 6,10 + +## ## +#### ## +## ## ## +## ## ## +## #### +## ## +##______##__ + + +at 163,41 size 8,10 + + ###### + ## ## +## ## +## ## +## ## + ## ## +____######______ + + +at 174,41 size 6,10 + +######## +## ## +## ## +## ## +######## +## +##__________ + + +at 184,41 size 8,10 + + ###### + ## ## +## ## +## ## +## ## + ## ## +____######______ + ## + #### +at 195,41 size 7,10 + +######## +## ## +## ## +######## +## ## +## ## +##________##__ + + +at 205,41 size 6,10 + + ###### +## ## +## + ###### + ## +## ## +__######____ + + +at 215,41 size 8,10 + +############## + ## + ## + ## + ## + ## +______##________ + + +at 225,41 size 7,10 + +## ## +## ## +## ## +## ## +## ## +## ## +__########____ + + +at 235,41 size 8,10 + +## ## + ## ## + ## ## + ## ## + ## ## + ## ## +______##________ + + +at 247,41 size 10,10 + +## ## ## +## ## ## + ## ## ## ## + ## ## ## ## + ## ## ## ## + ## ## +____##______##______ + + +at 260,41 size 6,10 + +## ## +## ## + ## ## + ## + ## ## +## ## +##______##__ + + +at 269,41 size 8,10 + +## ## + ## ## + ## ## + ## + ## + ## +______##________ + + +at 280,41 size 6,10 + +########## + ## + ## + ## + ## +## +##########__ + + +at 290,41 size 4,10 +###### +## +## +## +## +## +## +##______ +## +###### +at 297,41 size 5,10 +## +## + ## + ## + ## + ## + ## +______##__ + ## + +at 307,41 size 4,10 +###### + ## + ## + ## + ## + ## + ## +____##__ + ## +###### +at 315,41 size 7,10 + + #### + ## ## +## ## + + + +______________ + + +at 325,41 size 7,10 + + + + + + + +______________ + +############ +at 8,65 size 3,10 +## + ## + + + + + +______ + + +at 17,65 size 6,10 + + + + ###### + ## + ######## +## ## +__########__ + + +at 26,65 size 6,10 +## +## +## +######## +## ## +## ## +## ## +########____ + + +at 36,65 size 5,10 + + + + ###### +## +## +## +__######__ + + +at 45,65 size 6,10 + ## + ## + ## + ######## +## ## +## ## +## ## +__########__ + + +at 55,65 size 6,10 + + + + ###### +## ## +########## +## +__########__ + + +at 63,65 size 5,10 + #### + ## + ## +######## + ## + ## + ## +__##______ + + +at 71,65 size 6,10 + + + + ######## +## ## +## ## +## ## +__########__ + ## + ###### +at 81,65 size 6,10 +## +## +## +######## +## ## +## ## +## ## +##______##__ + + +at 91,65 size 2,10 + +## + +## +## +## +## +##__ + + +at 96,65 size 3,10 + + ## + +#### + ## + ## + ## +__##__ + ## +## +at 104,65 size 6,10 +## +## +## +## ## +## ## +###### +## ## +##______##__ + + +at 113,65 size 2,10 +## +## +## +## +## +## +## +##__ + + +at 120,65 size 10,10 + + + +######## ###### +## ## ## +## ## ## +## ## ## +##______##______##__ + + +at 133,65 size 6,10 + + + +######## +## ## +## ## +## ## +##______##__ + + +at 143,65 size 6,10 + + + + ###### +## ## +## ## +## ## +__######____ + + +at 152,65 size 6,10 + + + +######## +## ## +## ## +## ## +########____ +## +## +at 162,65 size 6,10 + + + + ######## +## ## +## ## +## ## +__########__ + ## + ## +at 172,65 size 4,10 + + + +## ## +#### +## +## +##______ + + +at 180,65 size 5,10 + + + + ###### +## + #### + ## +######____ + + +at 187,65 size 5,10 + + ## + ## +######## + ## + ## + ## +____####__ + + +at 196,65 size 6,10 + + + +## ## +## ## +## ## +## ## +__########__ + + +at 206,65 size 5,10 + + + +## ## +## ## +## ## + #### +__####____ + + +at 215,65 size 6,10 + + + +## ## +## ## ## +## ## ## + ## ## +__##__##____ + + +at 227,65 size 6,10 + + + +## ## + ## ## + ## + ## ## +##______##__ + + +at 236,65 size 5,10 + + + +## ## +## ## +## ## + #### +____##____ + ## + ## +at 246,65 size 5,10 + + + +######## + ## + ## +## +########__ + + +at 254,65 size 6,10 + #### + ## + ## + ## + ## +#### + ## +____##______ + ## + #### +at 265,65 size 2,10 +## +## +## +## +## +## +## +##__ +## +## +at 271,65 size 6,10 +#### + ## + ## + ## + ## + #### + ## +____##______ + ## +#### +at 282,65 size 7,10 + + + + ## ## +## #### ## +## ## + +______________ + + +at 293,65 size 7,10 + + ###### + ## ## +######## + ## +######## + ## ## +____######____ + + +at 303,65 size 6,10 + + + ## + ######## +## +## +## +__########__ + ## + diff --git a/src/font/set02.bmp b/src/font/set02.bmp new file mode 100644 index 00000000..0c7e2e80 Binary files /dev/null and b/src/font/set02.bmp differ diff --git a/src/font/set02.chs b/src/font/set02.chs new file mode 100644 index 00000000..8896bcb6 Binary files /dev/null and b/src/font/set02.chs differ diff --git a/src/font/set02.cmd b/src/font/set02.cmd new file mode 100644 index 00000000..160af2d0 Binary files /dev/null and b/src/font/set02.cmd differ diff --git a/src/font/set02.txt b/src/font/set02.txt new file mode 100644 index 00000000..5c04da59 --- /dev/null +++ b/src/font/set02.txt @@ -0,0 +1,1087 @@ +at 15,19 size 3,11 + + +#### +#### +#### +#### +#### + +####__ + + +at 21,19 size 6,11 + +#### #### +#### #### +#### #### + + + + +____________ + + +at 32,19 size 8,11 + + + ## ## + ## ## + ############ + ## ## +############ + ## ## +__##__##________ + + +at 44,19 size 6,11 + ## + ## + ###### +###### ## +###### + ###### + ###### +## ###### +__######____ + ## + ## +at 54,19 size 12,11 + + + #### ## +## ## ## +## ## ## #### +## ## ## ## ## + #### ## ## ## + ## ## ## +______##________####____ + + +at 70,19 size 8,11 + + + ###### +#### #### +#### #### + ###### #### +#### ###### +#### #### +__######__####__ + + +at 81,19 size 3,11 + +#### +#### +#### + + + + +______ + + +at 89,19 size 5,11 + + #### + #### +#### +#### +#### +#### +#### +####______ + #### + #### +at 97,19 size 5,11 + +#### + #### + #### + #### + #### + #### + #### +____####__ + #### +#### +at 107,19 size 6,11 + + ## +## ## ## + ###### +## ## ## + ## + + +____________ + + +at 117,19 size 8,11 + + + ## + ## + ## +############## + ## + ## +______##________ + + +at 129,19 size 3,11 + + + + + + + +#### +####__ +#### +## +at 136,19 size 4,11 + + + + + +###### + + +________ + + +at 145,19 size 3,11 + + + + + + + +#### +####__ + + +at 152,19 size 6,11 + + ## + ## + ## + ## + ## + ## + ## +__##________ +## +## +at 162,19 size 6,11 + + + ###### +#### #### +#### #### +#### #### +#### #### +#### #### +__######____ + + +at 174,19 size 5,11 + + + #### +###### + #### + #### + #### + #### +########__ + + +at 183,19 size 6,11 + + + ###### +## #### + #### + #### + #### +#### +##########__ + + +at 194,19 size 6,11 + + + ###### +## #### + #### + ###### + #### +## #### +__######____ + + +at 204,19 size 7,11 + + + #### + ###### + ## #### +## #### +############ + #### +______####____ + + +at 215,19 size 6,11 + + +########## +#### +######## + #### + #### +## #### +__######____ + + +at 225,19 size 6,11 + + + ###### +#### +######## +#### #### +#### #### +#### #### +__######____ + + +at 236,19 size 6,11 + + +########## + #### + #### + #### + #### + #### +####________ + + +at 246,19 size 6,11 + + + ###### +#### #### +#### #### + ###### +#### #### +#### #### +__######____ + + +at 257,19 size 6,11 + + + ###### +#### #### +#### #### +#### #### + ######## + #### +__######____ + + +at 267,19 size 3,11 + + + + +#### +#### + +#### +####__ + + +at 275,19 size 3,11 + + + + +#### +#### + +#### +####__ +#### +## +at 282,19 size 8,11 + + + #### + #### + #### +## + #### + #### +__________####__ + + +at 294,19 size 8,11 + + + + +############## + + +############## +________________ + + +at 306,19 size 8,11 + + +#### + #### + #### + ## + #### + #### +####____________ + + +at 317,19 size 6,11 + + + ###### +## #### + #### + #### + #### + +__####______ + + +at 8,43 size 9,10 + + ######## + ## ## +## ###### ## +## ## ## ## +## ## ## ## +## ######## +__##______________ + ######## + +at 21,43 size 8,10 + + ###### + ###### + #### #### + #### #### + ########## +#### #### +####______####__ + + +at 32,43 size 7,10 + +########## +#### #### +#### #### +########## +#### #### +#### #### +##########____ + + +at 43,43 size 6,10 + + ###### +#### ## +#### +#### +#### +#### ## +__######____ + + +at 54,43 size 8,10 + +########## +#### #### +#### #### +#### #### +#### #### +#### #### +##########______ + + +at 66,43 size 6,10 + +########## +#### +#### +########## +#### +#### +##########__ + + +at 76,43 size 6,10 + +########## +#### +#### +########## +#### +#### +####________ + + +at 86,43 size 7,10 + + ######## +#### ## +#### +#### +#### ###### +#### #### +__##########__ + + +at 97,43 size 7,10 + +#### #### +#### #### +#### #### +############ +#### #### +#### #### +####____####__ + + +at 109,43 size 5,10 + +######## + #### + #### + #### + #### + #### +########__ + + +at 117,43 size 6,10 + + ######## + #### + #### + #### + #### + #### +########____ + + +at 127,43 size 7,10 + +#### #### +#### #### +######## +###### +######## +#### #### +####____####__ + + +at 138,43 size 6,10 + +#### +#### +#### +#### +#### +#### +##########__ + + +at 148,43 size 8,10 + +## ## +#### #### +###### ###### +## #### #### +## #### #### +## #### +##________####__ + + +at 161,43 size 7,10 + +## ## +#### ## +###### ## +## #### ## +## ###### +## #### +##________##__ + + +at 173,43 size 8,10 + + ########## +#### #### +#### #### +#### #### +#### #### +#### #### +__##########____ + + +at 185,43 size 7,10 + +########## +#### #### +#### #### +#### #### +########## +#### +####__________ + + +at 195,43 size 8,10 + + ########## +#### #### +#### #### +#### #### +#### #### +#### #### +__##########____ + #### + ###### +at 207,43 size 8,10 + +########## +#### #### +#### #### +########## +#### #### +#### #### +####______####__ + + +at 219,43 size 6,10 + + ###### +#### ## +#### + ###### + #### +## #### +__######____ + + +at 228,43 size 7,10 + +############ + #### + #### + #### + #### + #### +____####______ + + +at 239,43 size 7,10 + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +__########____ + + +at 251,43 size 7,10 + +#### #### +#### #### +#### #### + ######## + ######## + ######## +____####______ + + +at 262,43 size 11,10 + +#### #### #### +#### #### #### + #### #### #### + #### #### #### + ###### ###### + #### #### +____####____####______ + + +at 277,43 size 7,10 + +#### #### +#### #### + ######## + #### + ######## +#### #### +####____####__ + + +at 288,43 size 7,10 + +#### #### +#### #### + ######## + #### + #### + #### +____####______ + + +at 298,43 size 6,10 + +########## + #### + #### + #### +#### +#### +##########__ + + +at 309,43 size 4,10 +###### +#### +#### +#### +#### +#### +#### +####____ +#### +###### +at 318,43 size 6,10 +## +## + ## + ## + ## + ## + ## +______##____ + ## + ## +at 328,43 size 4,10 +###### + #### + #### + #### + #### + #### + #### +__####__ + #### +###### +at 337,43 size 8,10 + + ## + ###### + #### #### +#### #### + + +________________ + + +at 348,43 size 8,10 + + + + + + + +________________ + +############## +at 9,67 size 4,10 +#### + #### + + + + + +________ + + +at 18,67 size 7,10 + + + + ######## + #### + ########## +#### #### +__##########__ + + +at 28,67 size 7,10 +#### +#### +#### +########## +#### #### +#### #### +#### #### +##########____ + + +at 38,67 size 6,10 + + + + ######## +#### +#### +#### +__########__ + + +at 47,67 size 7,10 + #### + #### + #### + ########## +#### #### +#### #### +#### #### +__##########__ + + +at 58,67 size 7,10 + + + + ######## +#### #### +############ +#### +__##########__ + + +at 68,67 size 6,10 + ###### + #### + #### +########## + #### + #### + #### +__####______ + + +at 75,67 size 7,10 + + + + ########## +#### #### +#### #### +#### #### +__##########__ + #### + ######## +at 86,67 size 7,10 +#### +#### +#### +########## +#### #### +#### #### +#### #### +####____####__ + + +at 96,67 size 3,10 + +#### + +#### +#### +#### +#### +####__ + + +at 103,67 size 4,10 + + #### + +###### + #### + #### + #### +__####__ + #### +#### +at 111,67 size 7,10 +#### +#### +#### +#### #### +#### #### +######## +#### #### +####____####__ + + +at 121,67 size 3,10 +#### +#### +#### +#### +#### +#### +#### +####__ + + +at 128,67 size 11,10 + + + +########## ###### +#### #### #### +#### #### #### +#### #### #### +####____####____####__ + + +at 142,67 size 7,10 + + + +########## +#### #### +#### #### +#### #### +####____####__ + + +at 152,67 size 7,10 + + + + ######## +#### #### +#### #### +#### #### +__########____ + + +at 162,67 size 7,10 + + + +########## +#### #### +#### #### +#### #### +##########____ +#### +#### +at 173,67 size 7,10 + + + + ########## +#### #### +#### #### +#### #### +__##########__ + #### + #### +at 183,67 size 6,10 + + + +#### #### +########## +#### +#### +####________ + + +at 192,67 size 6,10 + + + + ######## +#### +########## + #### +########____ + + +at 201,67 size 6,10 + + #### + #### +########## + #### + #### + #### +____######__ + + +at 209,67 size 7,10 + + + +#### #### +#### #### +#### #### +#### #### +__##########__ + + +at 220,67 size 7,10 + + + +#### #### +#### #### + ######## + ######## +____####______ + + +at 229,67 size 9,10 + + + +#### #### #### +#### #### #### +#### #### #### + #### #### +__####____####____ + + +at 243,67 size 7,10 + + + +#### #### + ######## + #### + ######## +####____####__ + + +at 253,67 size 7,10 + + + +#### #### +#### #### + ######## + ######## +____####______ + #### + #### +at 263,67 size 6,10 + + + +########## + #### + #### +#### +##########__ + + +at 273,67 size 6,10 + #### + #### + #### + #### +###### + #### + #### +____####____ + #### + #### +at 285,67 size 2,10 +## +## +## +## +## +## +## +##__ +## +## +at 292,67 size 6,10 +#### + #### + #### + #### + ###### + #### + #### +__####______ + #### +#### +at 303,67 size 8,10 + + + + #### ## +## ## ## +## #### + +________________ + + +at 317,67 size 8,10 + + + ######## + #### ## +########## + #### +########## +__####______##__ + ######## + +at 330,67 size 7,10 + + + + #### + ########## +#### +#### +####__________ + ########## + #### diff --git a/src/font/set03.bmp b/src/font/set03.bmp new file mode 100644 index 00000000..6b6ad7fb Binary files /dev/null and b/src/font/set03.bmp differ diff --git a/src/font/set03.chs b/src/font/set03.chs new file mode 100644 index 00000000..05c355be Binary files /dev/null and b/src/font/set03.chs differ diff --git a/src/font/set03.cmd b/src/font/set03.cmd new file mode 100644 index 00000000..de811f16 Binary files /dev/null and b/src/font/set03.cmd differ diff --git a/src/font/set03.txt b/src/font/set03.txt new file mode 100644 index 00000000..49b686eb --- /dev/null +++ b/src/font/set03.txt @@ -0,0 +1,1312 @@ +at 19,20 size 2,13 + +## +## +## +## +## +## + +## +##__ + + + +at 28,20 size 4,13 +## ## +## ## +## ## +## ## + + + + + +________ + + + +at 38,20 size 9,13 + + ## ## + ## ## + ############## + ## ## + ## ## +############## + ## ## + ## ## +__________________ + + + +at 54,20 size 7,13 + ## + ## + ########## +## ## +## ## + #### + ###### + ## ## + ## ## +##########____ + ## + ## + +at 66,20 size 12,13 + + ###### ## +## ## ## +## ## ## +## ## ## + ###### ## ###### + ## ## ## + ## ## ## + ## ## ## +____##________######____ + + + +at 85,20 size 9,13 + + ###### +## ## +## ## +## ## + ###### ## +## ## ## +## ## +## #### +__######____####__ + + + +at 99,20 size 2,13 +## +## +## +## + + + + + +____ + + + +at 107,20 size 5,13 + ## + ## + ## + ## +## +## +## +## +## +__##______ + ## + ## + ## +at 118,20 size 5,13 +## + ## + ## + ## + ## + ## + ## + ## + ## +____##____ + ## + ## +## +at 129,20 size 6,13 + ## +## ## ## + ###### +## ## ## + ## + + + + +____________ + + + +at 141,20 size 8,13 + + + ## + ## + ## +############## + ## + ## + ## +________________ + + + +at 156,20 size 3,13 + + + + + + + + + ## +__##__ + ## +## + +at 165,20 size 6,13 + + + + + +########## + + + +____________ + + + +at 177,20 size 2,13 + + + + + + + + +## +##__ + + + +at 184,20 size 7,13 + ## + ## + ## + ## + ## + ## + ## + ## + ## +__##__________ +## +## + +at 196,20 size 7,13 + + ######## +## ## +## ## +## ## +## ## +## ## +## ## +## ## +__########____ + + + +at 209,20 size 6,13 + + ## +###### + ## + ## + ## + ## + ## + ## +##########__ + + + +at 221,20 size 7,13 + + ######## +## ## +## ## + ## + ## + #### + ## +## +############__ + + + +at 234,20 size 7,13 + + ######## +## ## + ## + ## + ###### + ## + ## +## ## +__########____ + + + +at 247,20 size 8,13 + + ## + #### + ## ## + ## ## +## ## +############## + ## + ## +________##______ + + + +at 260,20 size 7,13 + + ########## + ## + ## + ## + ######## + ## + ## +## ## +__########____ + + + +at 273,20 size 7,13 + + ###### + ## +## +########## +## ## +## ## +## ## +## ## +__########____ + + + +at 285,20 size 7,13 + +############ + ## + ## + ## + ## + ## + ## + ## +____##________ + + + +at 298,20 size 7,13 + + ######## +## ## +## ## +## ## + ######## +## ## +## ## +## ## +__########____ + + + +at 311,20 size 7,13 + + ######## +## ## +## ## +## ## +## ## + ########## + ## + ## +__######______ + + + +at 325,20 size 2,13 + + + +## +## + + + +## +##__ + + + +at 334,20 size 3,13 + + + + ## + ## + + + + ## +__##__ + ## +## + +at 345,20 size 8,13 + + + + #### + #### + #### +## + #### + #### +__________####__ + + + +at 360,20 size 8,13 + + + + +############## + + +############## + +________________ + + + +at 375,20 size 8,13 + + + +#### + #### + #### + ## + #### + #### +####____________ + + + +at 391,20 size 6,13 + + ###### +## ## + ## + ## + ## + ## + + ## +____##______ + + + +at 9,51 size 12,12 + + ########## + ## ## + ## ######## ## +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +__##____############____ + ## + ########## +at 27,51 size 8,12 + + ## + ## + ## ## + ## ## + ## ## + ## ## + ########## +## ## +##__________##__ + + +at 40,51 size 7,12 + +######## +## ## +## ## +## ## +########## +## ## +## ## +## ## +##########____ + + +at 54,51 size 8,12 + + ######## + ## ## +## +## +## +## +## + ## ## +____########____ + + +at 67,51 size 8,12 + +########## +## ## +## ## +## ## +## ## +## ## +## ## +## ## +##########______ + + +at 82,51 size 7,12 + +############ +## +## +## +############ +## +## +## +############__ + + +at 95,51 size 7,12 + +############ +## +## +## +########## +## +## +## +##____________ + + +at 107,51 size 8,12 + + ######## + ## ## +## +## +## +## ###### +## ## + ## ## +____##########__ + + +at 121,51 size 8,12 + +## ## +## ## +## ## +## ## +############## +## ## +## ## +## ## +##__________##__ + + +at 136,51 size 4,12 + +###### + ## + ## + ## + ## + ## + ## + ## +######__ + + +at 145,51 size 6,12 + + ###### + ## + ## + ## + ## + ## + ## + ## +########____ + + +at 156,51 size 7,12 + +## ## +## ## +## ## +## ## +#### +## ## +## ## +## ## +##________##__ + + +at 170,51 size 7,12 + +## +## +## +## +## +## +## +## +############__ + + +at 181,51 size 10,12 + +#### #### +#### #### +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## +## ## ## +##______________##__ + + +at 197,51 size 8,12 + +#### ## +#### ## +## ## ## +## ## ## +## ## ## +## ## ## +## ## ## +## #### +##________####__ + + +at 211,51 size 9,12 + + ######## + ## ## +## ## +## ## +## ## +## ## +## ## + ## ## +____########______ + + +at 226,51 size 7,12 + +########## +## ## +## ## +## ## +## ## +########## +## +## +##____________ + + +at 239,51 size 9,12 + + ######## + ## ## +## ## +## ## +## ## +## ## +## ## + ## ## +____########______ + ## + #### +at 253,51 size 8,12 + +########## +## ## +## ## +## ## +## ## +######## +## ## +## ## +##__________##__ + + +at 267,51 size 8,12 + + ########## +## ## +## +## + ########## + ## + ## +## ## +__##########____ + + +at 280,51 size 8,12 + +############## + ## + ## + ## + ## + ## + ## + ## +______##________ + + +at 293,51 size 8,12 + +## ## +## ## +## ## +## ## +## ## +## ## +## ## + ## ## +____######______ + + +at 307,51 size 8,12 + +## ## +## ## +## ## + ## ## + ## ## + ## ## + ## ## + ## +______##________ + + +at 320,51 size 12,12 + +## ## ## +## ## ## +## ## ## ## +## ## ## ## + ## ## ## ## + ## ## ## ## + ## ## ## ## + ## ## +____##__________##______ + + +at 338,51 size 8,12 + +## ## +## ## + ## ## + ## ## + ## + ## ## + ## ## +## ## +##__________##__ + + +at 351,51 size 8,12 + +## ## + ## ## + ## ## + ## ## + ## ## + ## + ## + ## +______##________ + + +at 364,51 size 8,12 + +############## + ## + ## + ## + ## + ## + ## +## +##############__ + + +at 378,51 size 4,12 +###### +## +## +## +## +## +## +## +## +##______ +## +###### +at 387,51 size 7,12 +## +## + ## + ## + ## + ## + ## + ## + ## +________##____ + ## + ## +at 398,51 size 4,12 +###### + ## + ## + ## + ## + ## + ## + ## + ## +____##__ + ## +###### +at 409,51 size 10,12 + + ## + ## ## + ## ## + ## ## +## ## + + + +____________________ + + +at 423,51 size 9,12 + + + + + + + + + +__________________ + +################ +at 11,84 size 3,13 +## + ## + + + + + + + +______ + + + +at 22,84 size 7,13 + + + + ######## + ## + ## + ########## +## ## +## ## +__##########__ + + + +at 34,84 size 7,13 +## +## +## +## ###### +#### ## +## ## +## ## +## ## +## ## +##########____ + + + +at 47,84 size 7,13 + + + + ######## +## ## +## +## +## +## ## +__########____ + + + +at 58,84 size 7,13 + ## + ## + ## + ########## +## ## +## ## +## ## +## ## +## #### +__######__##__ + + + +at 71,84 size 7,13 + + + + ######## +## ## +## ## +############ +## +## ## +__########____ + + + +at 83,84 size 6,13 + ###### + ## + ## +######## + ## + ## + ## + ## + ## +__##________ + + + +at 92,84 size 7,13 + + + + ########## +## ## +## ## +## ## +## ## +## #### +__######__##__ + ## + ## + ######## +at 105,84 size 7,13 +## +## +## +## ###### +#### ## +## ## +## ## +## ## +## ## +##________##__ + + + +at 118,84 size 2,13 +## + + +## +## +## +## +## +## +##__ + + + +at 125,84 size 4,13 + ## + + + #### + ## + ## + ## + ## + ## +____##__ + ## + ## +#### +at 135,84 size 6,13 +## +## +## +## ## +## ## +## ## +#### +## ## +## ## +##______##__ + + + +at 147,84 size 2,13 +## +## +## +## +## +## +## +## +## +##__ + + + +at 155,84 size 10,13 + + + +## #### #### +#### #### ## +## ## ## +## ## ## +## ## ## +## ## ## +##______##______##__ + + + +at 173,84 size 7,13 + + + +## ###### +#### ## +## ## +## ## +## ## +## ## +##________##__ + + + +at 185,84 size 7,13 + + + + ######## +## ## +## ## +## ## +## ## +## ## +__########____ + + + +at 198,84 size 7,13 + + + +## ###### +#### ## +## ## +## ## +## ## +## ## +##########____ +## +## +## +at 211,84 size 7,13 + + + + ########## +## ## +## ## +## ## +## ## +## #### +__######__##__ + ## + ## + ## +at 223,84 size 5,13 + + + +## #### +#### +## +## +## +## +##________ + + + +at 233,84 size 6,13 + + + + ######## +## +## + ###### + ## + ## +########____ + + + +at 245,84 size 5,13 + + ## + ## +######## + ## + ## + ## + ## + ## +____####__ + + + +at 254,84 size 7,13 + + + +## ## +## ## +## ## +## ## +## ## +## #### +__######__##__ + + + +at 267,84 size 7,13 + + + +## ## +## ## + ## ## + ## ## + ## ## + #### +____####______ + + + +at 279,84 size 10,13 + + + +## ## ## +## ## ## + ## ## ## ## + ## ## ## ## + ## ## ## ## + ## ## +____##______##______ + + + +at 295,84 size 6,13 + + + +## ## +## ## + ## ## + ## + ## ## +## ## +##______##__ + + + +at 307,84 size 7,13 + + + +## ## +## ## + ## ## + ## ## + ## ## + #### +____####______ + ## + ## + ## +at 319,84 size 6,13 + + + +########## + ## + ## + ## + ## +## +##########__ + + + +at 331,84 size 6,13 + #### + ## + ## + ## + ## +#### + ## + ## + ## +____##______ + ## + #### + +at 345,84 size 2,13 +## +## +## +## +## +## +## +## +## +##__ +## +## + +at 355,84 size 6,13 +#### + ## + ## + ## + ## + #### + ## + ## + ## +____##______ + ## +#### + +at 367,84 size 9,13 + + + + + #### ## +## #### ## +## #### + + +__________________ + + + +at 383,84 size 10,13 + + ######## + ## ## + ## +############## + ## +############## + ## + ## ## +________########____ + + + +at 400,84 size 7,13 + + ## + ## + ######## +## ## +## +## +## +## ## +__########____ + ## + ## + diff --git a/src/font/set04.bmp b/src/font/set04.bmp new file mode 100644 index 00000000..2d5f953a Binary files /dev/null and b/src/font/set04.bmp differ diff --git a/src/font/set04.chs b/src/font/set04.chs new file mode 100644 index 00000000..09561644 Binary files /dev/null and b/src/font/set04.chs differ diff --git a/src/font/set04.cmd b/src/font/set04.cmd new file mode 100644 index 00000000..0f1d2693 Binary files /dev/null and b/src/font/set04.cmd differ diff --git a/src/font/set04.txt b/src/font/set04.txt new file mode 100644 index 00000000..f7e1cb60 --- /dev/null +++ b/src/font/set04.txt @@ -0,0 +1,1665 @@ +at 25,25 size 3,16 + +#### +#### +#### +#### +#### +#### +#### +#### +#### + +#### +####__ + + + +at 36,25 size 6,16 +#### #### +#### #### +#### #### +#### #### +#### #### + + + + + + + +____________ + + + +at 50,25 size 12,16 + + ## ## + ## ## + ## ## + #################### + ## ## + ## ## + ## ## + ## ## +#################### + ## ## + ## ## +____##____##____________ + + + +at 69,25 size 10,16 + ## + ## + ############## + #### ## ## +#### ## +#### ## +###### ## + ############ + ## ###### + ## #### + ## #### +## ## #### +##############______ + ## + ## + ## +at 86,25 size 17,16 + + ######## #### +#### #### ## +#### #### #### +#### #### ## +#### #### #### +#### #### ## ######## + ######## ## #### #### + #### #### #### + ## #### #### + #### #### #### + ## #### #### +________####__________########____ + + + +at 110,25 size 13,16 + + ######## + #### #### + #### #### + #### #### + ######## + ###### #### + #### #### #### +#### #### #### +#### ###### +#### ###### + #### #### #### +____########________####__ + + + +at 129,25 size 3,16 +#### +#### +#### +#### +#### + + + + + + + +______ + + + +at 139,25 size 6,16 + #### + #### + #### + #### +###### +#### +#### +#### +#### +#### +#### +###### +__####______ + #### + #### + #### +at 153,25 size 6,16 +#### + #### + #### + #### + ###### + #### + #### + #### + #### + #### + #### + ###### +____####____ + #### + #### +#### +at 168,25 size 8,16 + ## +## ## ## + ## ## ## + ###### + ###### + ## ## ## +## ## ## + ## + + + + +________________ + + + +at 183,25 size 12,16 + + + ## + ## + ## + ## + ## +###################### + ## + ## + ## + ## +__________##____________ + + + +at 203,25 size 5,16 + + + + + + + + + + + + ###### +__####____ + #### +#### +#### +at 215,25 size 6,16 + + + + + + + +########## + + + + +____________ + + + +at 230,25 size 3,16 + + + + + + + + + + + +#### +####__ + + + +at 240,25 size 8,16 + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +__####__________ + #### +#### +#### +at 255,25 size 10,16 + + ########## + #### #### + ## ## +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + ## ## + #### #### +____##########______ + + + +at 273,25 size 9,16 + + #### + #### +########## + #### + #### + #### + #### + #### + #### + #### + #### +################__ + + + +at 289,25 size 10,16 + + ########## +#### #### +## #### + #### + #### + #### + ###### + ###### + ###### + ###### +#### +##################__ + + + +at 305,25 size 10,16 + + ############ +#### ###### +## #### + #### + #### + ###### + #### + #### + #### +## #### +#### #### +__############______ + + + +at 322,25 size 11,16 + + #### + ###### + ## #### + ## #### + #### #### + #### #### +#### #### +## #### +#################### + #### + #### +____________####______ + + + +at 340,25 size 9,16 + + ############## + #### + #### + #### + ########## + #### + #### + #### + #### + #### +## #### +############______ + + + +at 356,25 size 10,16 + + ######## + #### + #### + ## +#### ######## +###### #### +#### #### +#### #### +#### #### + ## #### + #### #### +____##########______ + + + +at 372,25 size 9,16 + +################ + #### + #### + #### + #### + #### + ###### + #### + #### + #### + #### +__####____________ + + + +at 389,25 size 10,16 + + ########## + #### #### +#### #### +#### #### + #### #### + ########## + #### ###### +#### #### +#### #### +#### #### + #### #### +____##########______ + + + +at 406,25 size 10,16 + + ########## + #### #### +#### #### +#### #### +#### #### +#### #### + #### ###### + ######## #### + ## + #### + #### +__########__________ + + + +at 425,25 size 3,16 + + + + +#### +#### + + + + + +#### +####__ + + + +at 438,25 size 5,16 + + + + + #### + #### + + + + + + ###### +__####____ + #### +#### +#### +at 451,25 size 11,16 + + + #### + #### + #### + #### +#### +#### + #### + #### + #### + #### +______________________ + + + +at 471,25 size 11,16 + + + + + +#################### + + +#################### + + + +______________________ + + + +at 491,25 size 11,16 + + +#### + #### + #### + #### + #### + #### + #### + #### + #### +#### +______________________ + + + +at 510,25 size 8,16 + +########## +## ###### + #### + #### + ###### + ###### + ###### + #### + #### + + #### +____####________ + + + +at 11,65 size 15,16 + + ############ + #### ###### + #### #### + #### ########## #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### ###### ## + #### ###### ########## +__######______________________ + ###### + ############ + +at 33,65 size 13,16 + + #### + ######## + ######## + #### #### + #### #### + #### #### + #### #### + ################ + #### #### + #### #### + #### #### +####________________####__ + + + +at 53,65 size 10,16 + +############## +#### #### +#### #### +#### #### +#### #### +############## +#### #### +#### #### +#### #### +#### #### +#### #### +##############______ + + + +at 69,65 size 11,16 + + ############ + #### #### + #### ## +#### +#### +#### +#### +#### +#### + #### ## + #### #### +______############____ + + + +at 88,65 size 11,16 + +############## +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +##############________ + + + +at 107,65 size 9,16 + +################ +#### +#### +#### +#### +################ +#### +#### +#### +#### +#### +################__ + + + +at 124,65 size 9,16 + +################ +#### +#### +#### +#### +############## +#### +#### +#### +#### +#### +####______________ + + + +at 139,65 size 12,16 + + ############ + #### #### + #### ## +#### +#### +#### +#### ########## +#### #### +#### #### + #### #### + #### #### +______############______ + + + +at 159,65 size 10,16 + +#### #### +#### #### +#### #### +#### #### +#### #### +################## +#### #### +#### #### +#### #### +#### #### +#### #### +####__________####__ + + + +at 177,65 size 7,16 + +############ + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +############__ + + + +at 189,65 size 7,16 + + ######## + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +########______ + + + +at 204,65 size 11,16 + +#### #### +#### #### +#### #### +#### #### +#### #### +######## +########## +#### #### +#### ###### +#### ###### +#### ###### +####__________######__ + + + +at 222,65 size 8,16 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +##############__ + + + +at 238,65 size 11,16 + +###### ###### +###### ###### +###### ###### +#### ## ## #### +#### ## ## #### +#### #### ## #### +#### #### #### +#### #### #### +#### #### #### +#### #### +#### #### +####____________####__ + + + +at 258,65 size 10,16 + +###### #### +###### #### +#### ## #### +#### ## #### +#### #### #### +#### ## #### +#### #### #### +#### ## #### +#### ## #### +#### ###### +#### ###### +####________######__ + + + +at 276,65 size 12,16 + + ########## + #### #### + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### + #### #### +______##########________ + + + +at 296,65 size 8,16 + +########## +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +########## +#### +#### +#### +####____________ + + + +at 311,65 size 12,16 + + ########## + #### #### + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### + #### #### +______##########________ + #### + #### + ######## +at 331,65 size 11,16 + +############ +#### ###### +#### #### +#### #### +#### #### +#### #### +############ +#### #### +#### #### +#### #### +#### #### +####__________######__ + + + +at 348,65 size 11,16 + + ############ + #### #### +#### ## +#### +###### + ############ + ############ + ###### + #### +## #### +#### #### +__##############______ + + + +at 365,65 size 11,16 + +#################### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +________####__________ + + + +at 382,65 size 11,16 + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### +____############______ + + + +at 400,65 size 13,16 + +#### #### + ## ## + #### #### + #### #### + #### #### + #### #### + ## ## + #### #### + #### #### + ######## + ######## +__________####____________ + + + +at 418,65 size 16,16 + +#### ## #### +#### ###### #### + #### ## ## #### + #### ## ## #### + #### ## ## #### + #### #### #### #### + ## ## ## ## + #### ## ## #### + #### ## ## #### + ###### ######## + #### #### +______####__________####________ + + + +at 441,65 size 11,16 + +###### ###### + #### #### + #### #### + #### #### + ######## + #### + #### + ######## + #### #### + #### #### + #### #### +######________######__ + + + +at 458,65 size 11,16 + +###### ###### + #### #### + ###### ###### + #### #### + ######## + ######## + #### + #### + #### + #### + #### +________####__________ + + + +at 475,65 size 11,16 + +#################### + ###### + #### + #### + #### + #### + #### + #### + #### + #### +###### +####################__ + + + +at 494,65 size 5,16 +######## +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####______ +#### +#### +######## +at 507,65 size 8,16 +#### +#### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +________####____ + #### + #### + #### +at 520,65 size 5,16 +######## + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +____####__ + #### + #### +######## +at 535,65 size 12,16 + + ## + ###### + #### #### + #### #### + ## ## + #### #### +#### #### + + + + +________________________ + + + +at 553,65 size 12,16 + + + + + + + + + + + + +________________________ + + +###################### +at 13,105 size 5,17 +###### + #### + #### + + + + + + + + + + +__________ + + + +at 27,105 size 9,17 + + + + + + ############ + ## #### + #### + ############ + #### #### +#### #### +#### #### +#### ###### +__########__####__ + + + +at 44,105 size 10,17 + +#### +#### +#### +#### +#### ######## +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +##############______ + + + +at 60,105 size 9,17 + + + + + + ############ + #### ## +#### +#### +#### +#### +#### + #### #### +____##########____ + + + +at 74,105 size 10,17 + + #### + #### + #### + #### + ############## + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### +____########__####__ + + + +at 91,105 size 10,17 + + + + + + ########## + #### #### +#### #### +#### #### +################## +#### +#### + #### ## +______############__ + + + +at 107,105 size 7,17 + + ######## + #### + #### + #### +########## + #### + #### + #### + #### + #### + #### + #### +__####________ + + + +at 119,105 size 10,17 + + + + + + ############## + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### +____########__####__ + #### + ## #### + ############ +at 137,105 size 9,17 + +#### +#### +#### +#### +#### ######## +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +####________####__ + + + +at 153,105 size 3,17 + + +#### +#### + +#### +#### +#### +#### +#### +#### +#### +#### +####__ + + + +at 163,105 size 5,17 + + + #### + #### + + ###### + #### + #### + #### + #### + #### + #### + #### +____####__ + #### + #### +###### +at 176,105 size 10,17 + +#### +#### +#### +#### +#### #### +#### #### +#### #### +#### #### +########## +############ +#### ###### +#### ###### +####________######__ + + + +at 192,105 size 3,17 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__ + + + +at 202,105 size 15,17 + + + + + +#### ######## ######## +###### ###### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +####________####________####__ + + + +at 225,105 size 9,17 + + + + + +#### ######## +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +####________####__ + + + +at 241,105 size 10,17 + + + + + + ########## + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### +____##########______ + + + +at 258,105 size 10,17 + + + + + +#### ######## +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +##############______ +#### +#### +#### +at 274,105 size 10,17 + + + + + + ############## + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### +____########__####__ + #### + #### + #### +at 291,105 size 7,17 + + + + + +#### ###### +###### +#### +#### +#### +#### +#### +#### +####__________ + + + +at 303,105 size 9,17 + + + + + + ########## + #### #### +#### ## +###### + ############ + ###### +## #### +#### #### +__##########______ + + + +at 318,105 size 8,17 + + + #### + #### + #### +############## + #### + #### + #### + #### + #### + #### + #### +____##########__ + + + +at 332,105 size 9,17 + + + + + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### ###### +__########__####__ + + + +at 349,105 size 9,17 + + + + + +#### #### + #### #### + #### #### + #### #### + ## ## + ######## + ######## + #### +______####________ + + + +at 365,105 size 13,17 + + + + + +#### #### #### +#### #### #### + ## #### ## + #### ######## #### + #### ## ## #### + #### ## ## #### + ###### ###### + #### #### +____####________####______ + + + +at 385,105 size 9,17 + + + + + +###### ###### + #### #### + ######## + ###### + #### + ######## + ######## + #### #### +######____######__ + + + +at 401,105 size 9,17 + + + + + +#### #### + #### #### + #### #### + #### #### + ## ## + ######## + #### + #### +______####________ + ## + #### + #### +at 417,105 size 8,17 + + + + + +############## + #### + #### + #### + ## + #### + #### +#### +##############__ + + + +at 433,105 size 9,17 + + ######## + #### + #### + #### + #### + #### + #### +###### + #### + #### + #### + #### +______####________ + #### + #### + ######## +at 450,105 size 3,17 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__ +#### +#### +#### +at 462,105 size 9,17 + +######## + #### + #### + #### + #### + #### + #### + ###### + #### + #### + #### + #### +______####________ + #### + #### +######## +at 480,105 size 12,17 + + + + + + + ###### #### + #### ## #### +#### ## #### +#### ###### + + + +________________________ + + + +at 501,105 size 11,17 + + + ########## + #### #### + #### + #### +############## + #### + #### +############## + #### + #### + #### #### +________##########____ + + + +at 516,105 size 9,17 + + + + #### + #### + ############ + #### ## +#### +#### +#### +#### +#### + #### #### +____##########____ + #### + #### + diff --git a/src/font/set05.bmp b/src/font/set05.bmp new file mode 100644 index 00000000..ef53425f Binary files /dev/null and b/src/font/set05.bmp differ diff --git a/src/font/set05.chs b/src/font/set05.chs new file mode 100644 index 00000000..06ca0fbb Binary files /dev/null and b/src/font/set05.chs differ diff --git a/src/font/set05.cmd b/src/font/set05.cmd new file mode 100644 index 00000000..c365d83a Binary files /dev/null and b/src/font/set05.cmd differ diff --git a/src/font/set05.txt b/src/font/set05.txt new file mode 100644 index 00000000..1739a518 --- /dev/null +++ b/src/font/set05.txt @@ -0,0 +1,2145 @@ +at 32,42 size 3,21 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### + + +#### +####__ + + + + +at 48,42 size 7,21 +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + + + + + + + + + + +______________ + + + + +at 66,42 size 15,21 + + ## ## + ## ## + ## ## + ## ## + ## ## + ########################## + ## ## + ## ## + ## ## + ## ## +########################## + ## ## + ## ## + ## ## + ## ## +____##________##______________ + + + + +at 90,42 size 12,21 + ## + ## + ## + ############ + ################## +###### ## ## +#### ## +#### ## +###### ## + ############## + ############ + ## ###### + ## #### + ## #### +#### ## ###### +#################### +__##############________ + ## + ## + ## + ## +at 113,42 size 21,21 + + ######## #### + ############ #### +###### ###### #### +#### #### #### +#### #### #### +#### #### #### +###### ###### #### + ############ #### ######## + ######## #### ############ + #### ###### ###### + #### #### #### + #### #### #### + #### #### #### + #### ###### ###### + #### ############ +__________####______________########______ + + + + +at 144,42 size 17,21 + + ########## + ############## + ###### ###### + #### #### + #### #### + #### #### + ########## #### + ########## #### + #### #### #### +#### ###### #### +#### ######## +#### ###### +#### ######## +######## ############ + ################ ###### +______##########__________######__ + + + + +at 168,42 size 3,21 +#### +#### +#### +#### +#### +#### + + + + + + + + + + +______ + + + + +at 182,42 size 7,21 + ###### + #### + #### + #### + #### + #### +###### +#### +#### +#### +#### +#### +#### +#### +###### + #### +__####________ + #### + #### + #### + ###### +at 200,42 size 7,21 +###### + #### + #### + ###### + #### + #### + ###### + #### + #### + #### + #### + #### + #### + #### + ###### + #### +______####____ + ###### + #### + #### +###### +at 216,42 size 12,21 + ## + ## +#### ## #### + ###### ## ###### + ########## + ########## + ###### ## ###### +#### ## #### + ## + ## + + + + + + +________________________ + + + + +at 239,42 size 15,21 + + + + #### + #### + #### + #### + #### + #### +############################ +############################ + #### + #### + #### + #### + #### +____________####______________ + + + + +at 265,42 size 6,21 + + + + + + + + + + + + + + + ###### + #### +__######____ + #### + #### +#### +#### +at 281,42 size 8,21 + + + + + + + + + +############## +############## + + + + + +________________ + + + + +at 299,42 size 4,21 + + + + + + + + + + + + + + +###### +###### +######__ + + + + +at 312,42 size 11,21 + #### + #### + #### + ###### + #### + #### + #### + #### + ###### + #### + #### + #### + #### + #### + #### + #### +__######______________ + #### + #### +#### + +at 331,42 size 12,21 + + ########## + ############## + ###### ###### + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### + ###### ###### + ############## +______##########________ + + + + +at 354,42 size 9,21 + + #### + #### +########## +########## + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +################ +################__ + + + + +at 375,42 size 11,21 + + ############ +################ +## ###### + #### + #### + #### + #### + #### + #### + ###### + ###### + ###### + ###### +###### +#################### +####################__ + + + + +at 397,42 size 11,21 + + ############## +################## +## ###### + #### + #### + #### + ######## + ######## + #### + #### + #### + #### + #### +## #### +################## +__############________ + + + + +at 418,42 size 13,21 + + #### + ###### + ######## + ########## + ###### #### + ###### #### + ###### #### + ###### #### +###### #### +######################## +######################## + #### + #### + #### + #### +________________####______ + + + + +at 440,42 size 11,21 + + ################## + ################## + #### + #### + #### + #### + ############## + ################ + ###### + #### + #### + #### + #### +## #### +################## +__############________ + + + + +at 461,42 size 12,21 + + ########## + ############ + ###### + #### + #### +#### +#### ########## +#################### +###### ###### +#### #### +#### #### +#### #### + #### #### + ###### #### + ############## +______##########________ + + + + +at 484,42 size 12,21 + +###################### +###################### + #### + #### + #### + ###### + #### + #### + #### + #### + ###### + #### + #### + #### + #### +__######________________ + + + + +at 504,42 size 12,21 + + ########## + ################## +###### ###### +#### #### +#### #### +###### #### + ######## ###### + ########## + #### ######## +#### ###### +#### #### +#### #### +#### #### +###### #### + ################## +______##########________ + + + + +at 526,42 size 12,21 + + ########## + ############## + #### ###### +#### #### +#### #### +#### #### +#### #### +###### ###### + #################### + ########## #### + #### + #### + #### + ###### + ############ +____##########__________ + + + + +at 551,42 size 4,21 + + + + + +###### +###### +###### + + + + + + +###### +###### +######__ + + + + +at 568,42 size 6,21 + + + + + + ###### + ###### + ###### + + + + + + + ###### + #### +__######____ + #### + #### +#### +#### +at 585,42 size 13,21 + + + + + #### + ######## + ######## + ######## + ######## +######## +######## + ######## + ######## + ######## + ######## + #### +__________________________ + + + + +at 611,42 size 14,21 + + + + + + + +########################## +########################## + + + +########################## +########################## + + +____________________________ + + + + +at 637,42 size 13,21 + + + + +#### +######## + ######## + ######## + ######## + ######## + ######## + ######## + ######## + ######## +######## +#### +__________________________ + + + + +at 662,42 size 10,21 + + ############ +################ +## ###### + #### + #### + #### + #### + ###### + ###### + #### + #### + #### + + + #### +______####__________ + + + + +at 16,94 size 19,21 + + ############ + #################### + ###### ######## + ###### #### + ###### ############## #### + #### ################ #### +###### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +###### ###### ###### ###### + #### ######################## + ###### ######## ############ +____######____________________________ + ######## + ################## + ############## + +at 44,94 size 16,21 + + ###### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + ###### ###### + ###################### + ###################### + #### #### + #### #### + #### #### +####______________________####__ + + + + +at 68,94 size 13,21 + +################## +#################### +#### ###### +#### #### +#### #### +#### #### +################## +###################### +#### #### +#### #### +#### #### +#### #### +#### #### +#### ###### +###################### +##################________ + + + + +at 90,94 size 14,21 + + ############ + #################### + ###### ###### + ###### ## + #### +#### +#### +#### +#### +#### +#### + #### + ###### ## + ###### ###### + #################### +________##############______ + + + + +at 114,94 size 15,21 + +################## +###################### +#### ######## +#### ###### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### ###### +#### ######## +###################### +##################____________ + + + + +at 139,94 size 12,21 + +###################### +###################### +#### +#### +#### +#### +###################### +###################### +#### +#### +#### +#### +#### +#### +###################### +######################__ + + + + +at 161,94 size 12,21 + +###################### +###################### +#### +#### +#### +#### +#################### +#################### +#### +#### +#### +#### +#### +#### +#### +####____________________ + + + + +at 180,94 size 15,21 + + ############## + ###################### + ###### ###### + ###### ## + #### +#### +#### +#### +#### ############ +#### ############ +#### #### + #### #### + ###### #### + ###### #### + ###################### +__________############________ + + + + +at 206,94 size 14,21 + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +########################## +########################## +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +####__________________####__ + + + + +at 230,94 size 7,21 + +############ +############ + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +############ +############__ + + + + +at 245,94 size 9,21 + + ############ + ############ + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + ###### +############## +############______ + + + + +at 265,94 size 14,21 + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +############ +###### #### +#### ###### +#### ###### +#### ###### +#### ###### +#### ###### +####________________######__ + + + + +at 288,94 size 11,21 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#################### +####################__ + + + + +at 308,94 size 16,21 + +###### ###### +######## ######## +######## ######## +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### #### #### #### +#### ###### #### +#### ###### #### +#### ## #### +#### #### +#### #### +#### #### +####______________________####__ + + + + +at 334,94 size 13,21 + +######## #### +######## #### +########## #### +#### #### #### +#### ###### #### +#### #### #### +#### ###### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### ######## +#### ######## +#### ###### +####______________######__ + + + + +at 357,94 size 16,21 + + ############ + ################## + ###### ###### + ###### ###### + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### + ###### ###### + ###### ###### + ################## +__________############__________ + + + + +at 383,94 size 11,21 + +############## +################## +#### ###### +#### #### +#### #### +#### #### +#### #### +#### #### +################ +############## +#### +#### +#### +#### +#### +####__________________ + + + + +at 403,94 size 16,21 + + ############ + ################## + ###### ###### + ###### ###### + #### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### #### + ###### ###### + ###### ###### + ################## +__________##########____________ + #### + ###### + ############ + ########## +at 429,94 size 14,21 + +################ +################## +#### ###### +#### #### +#### #### +#### #### +#### #### +#### #### +################ +############## +#### #### +#### ###### +#### ###### +#### ###### +#### ###### +####________________######__ + + + + +at 451,94 size 14,21 + + ############## + ###################### + #### ###### +#### ## +#### +#### + ###### + ################ + ################ + ######## + #### + #### +## #### +###### ###### +###################### +____################________ + + + + +at 473,94 size 15,21 + +############################ +############################ + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +____________####______________ + + + + +at 497,94 size 13,21 + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +###### ###### + ###### ###### + ################ +______############________ + + + + +at 518,94 size 16,21 + +#### #### + #### #### + #### #### + #### #### + #### #### + #### #### + ###### ###### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + ########## +____________######______________ + + + + +at 542,94 size 21,21 + +#### #### #### +#### ###### #### + #### ######## #### + #### ######## #### + #### ######## #### + ###### ## #### #### + #### #### #### #### + #### #### #### #### + #### #### #### #### + #### ## #### #### + #### #### #### #### + #### #### #### #### + #### #### #### #### + ###### ###### + ###### ###### +________######____________######__________ + + + + +at 572,94 size 14,21 + +###### ###### + #### #### + #### #### + ###### ###### + #### #### + #### #### + ########## + ###### + ###### + #### #### + #### #### + #### #### + ###### ###### + #### #### + #### #### +######______________######__ + + + + +at 593,94 size 15,21 + +###### ###### + #### #### + #### #### + ###### ###### + #### #### + #### #### + ############ + ######## + #### + #### + #### + #### + #### + #### + #### +____________####______________ + + + + +at 616,94 size 14,21 + +########################## +########################## + ###### + ###### + ###### + ###### + #### + #### + #### + #### + ###### + ###### + ###### +###### +########################## +##########################__ + + + + +at 640,94 size 7,21 +############ +############ +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__________ +#### +#### +############ +############ +at 656,94 size 11,21 +#### + #### + #### + ###### + #### + #### + #### + #### + ###### + #### + #### + #### + #### + #### + #### + #### +____________######____ + #### + #### + #### + +at 675,94 size 7,21 +############ +############ + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### + #### +________####__ + #### + #### +############ +############ +at 693,94 size 15,21 + + #### + ######## + ######## + #### #### + #### #### + ###### ###### + #### #### + #### #### +#### #### + + + + + + +______________________________ + + + + +at 716,94 size 12,21 + + + + + + + + + + + + + + + + +________________________ + + +###################### + +at 18,146 size 6,22 +###### + ###### + #### + #### + + + + + + + + + + + + + +____________ + + + + +at 37,146 size 11,22 + + + + + + + ############## + ################ + ## ###### + #### + ############## + ################## +######## #### +#### #### +#### #### +###### ###### + ################## +____########____####__ + + + + +at 59,146 size 12,22 + +#### +#### +#### +#### +#### +#### ######## +#################### +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### ###### +#### ###### +################## +####__##########________ + + + + +at 79,146 size 10,22 + + + + + + + ########## + ############## + ###### ## +###### +#### +#### +#### +#### +###### + #### ## + ################ +______##########____ + + + + +at 98,146 size 12,22 + + #### + #### + #### + #### + #### + ########## #### + ################## + ###### #### +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### + #################### +______########____####__ + + + + +at 120,146 size 12,22 + + + + + + + ########## + ################ + ###### #### +###### #### +#### #### +###################### +###################### +#### +#### + ###### ## + ################## +______##############____ + + + + +at 141,146 size 8,22 + + ######## + ########## + ###### + #### + #### +############ +############ + #### + #### + #### + #### + #### + #### + #### + #### + #### +__####__________ + + + + +at 156,146 size 12,22 + + + + + + + ########## #### + ################## + ###### #### +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### + #################### +______########____####__ + #### + ## #### + ################## + ############## +at 178,146 size 11,22 + +#### +#### +#### +#### +#### +#### ######## +################## +###### ###### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +####____________####__ + + + + +at 200,146 size 3,22 + + +#### +#### + + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__ + + + + +at 212,146 size 7,22 + + + #### + #### + + + ########## + ########## + #### + #### + #### + #### + #### + #### + #### + #### + #### +________####__ + #### + ###### +########## +######## +at 229,146 size 12,22 + +#### +#### +#### +#### +#### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +############ +###### ###### +#### ###### +#### ###### +#### ###### +####____________######__ + + + + +at 250,146 size 3,22 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__ + + + + +at 264,146 size 19,22 + + + + + + +#### ######## ########## +################## ############## +###### ########## ###### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +#### #### #### +####____________####____________####__ + + + + +at 293,146 size 11,22 + + + + + + +#### ######## +################## +###### ###### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +####____________####__ + + + + +at 314,146 size 12,22 + + + + + + + ########## + ############## + ###### ###### +###### ###### +#### #### +#### #### +#### #### +#### #### +###### ###### + ###### ###### + ############## +______##########________ + + + + +at 336,146 size 12,22 + + + + + + +#### ######## +#################### +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### ###### +#### ###### +################## +####__##########________ +#### +#### +#### +#### +at 356,146 size 12,22 + + + + + + + ########## #### + ################## + ###### #### +###### #### +#### #### +#### #### +#### #### +#### #### +#### #### + #### ###### + #################### +______##########__####__ + #### + #### + #### + #### +at 378,146 size 8,22 + + + + + + +#### ###### +############## +###### +#### +#### +#### +#### +#### +#### +#### +#### +####____________ + + + + +at 395,146 size 10,22 + + + + + + + ############ + ################ +#### ## +#### +###### + ############ + ########## + ###### + #### +## #### +################ +__############______ + + + + +at 414,146 size 9,22 + + + + #### + #### + #### +################ +################ + #### + #### + #### + #### + #### + #### + #### + ###### + ############ +______##########__ + + + + +at 431,146 size 11,22 + + + + + + +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +#### #### +###### ###### + ################## +____########____####__ + + + + +at 452,146 size 12,22 + + + + + + +#### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + ###### + ###### +________######__________ + + + + +at 473,146 size 17,22 + + + + + + +#### #### #### +#### #### #### + #### ######## #### + #### ######## #### + #### ## ## #### + #### #### #### #### + #### #### #### ## + #### ## ## #### + #### ## ######## + ######## ######## + #### #### +______####____________####________ + + + + +at 498,146 size 12,22 + + + + + + +###### ###### + ###### #### + #### #### + #### #### + ########## + ###### + ###### + ########## + #### #### + #### #### + #### #### +######__________######__ + + + + +at 519,146 size 12,22 + + + + + + +#### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + #### #### + ###### + ###### +________####____________ + #### + #### + #### + ###### +at 540,146 size 11,22 + + + + + + +#################### +#################### + ###### + ###### + ###### + ###### + ###### + ###### + ###### +###### +#################### +####################__ + + + + +at 560,146 size 11,22 + + ######## + ########## + ###### + #### + #### + #### + #### + #### + #### + #### +######## +######## + #### + #### + #### + #### +________####__________ + #### + ###### + ########## + ######## +at 584,146 size 3,22 + +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +#### +####__ +#### +#### +#### +#### +at 600,146 size 11,22 + +######## +########## + ###### + #### + #### + #### + #### + #### + #### + #### + ######## + ######## + #### + #### + #### + #### +________####__________ + #### + ###### +########## +######## +at 621,146 size 15,22 + + + + + + + + + ######## #### + ############ #### + #### ###### #### +#### ###### #### +#### ############ +#### ######## + + + +______________________________ + + + + +at 647,146 size 14,22 + + + ############ + ################## + ######## #### + ###### + #### +###################### +###################### + #### +#################### +#################### + #### + ###### + ######## #### + ################## + ############ +____________________________ + + + + +at 676,146 size 10,22 + + + + #### + #### + #### + ########## + ############## + ###### ## +###### +#### +#### +#### +#### +###### + #### ## + ################ +______##########____ + #### + #### + #### + diff --git a/src/font/set06.bmp b/src/font/set06.bmp new file mode 100644 index 00000000..e995ee45 Binary files /dev/null and b/src/font/set06.bmp differ diff --git a/src/font/set06.chs b/src/font/set06.chs new file mode 100644 index 00000000..24b25335 Binary files /dev/null and b/src/font/set06.chs differ diff --git a/src/font/set06.cmd b/src/font/set06.cmd new file mode 100644 index 00000000..3523644c Binary files /dev/null and b/src/font/set06.cmd differ diff --git a/src/font/set06.txt b/src/font/set06.txt new file mode 100644 index 00000000..087aaa8b --- /dev/null +++ b/src/font/set06.txt @@ -0,0 +1,1024 @@ +at 13,18 size 2,10 + +## +## +## +## +## + +##__ + + +at 17,18 size 4,10 + +## ## +## ## +## ## + + + +________ + + +at 22,18 size 6,10 + + ## ## + ## ## +########## + ## ## +########## +## ## +##__##______ + + +at 29,18 size 6,10 + ## + ###### +## ## ## +## ## + ###### + ## ## +## ## ## +__######____ + ## + +at 36,18 size 8,10 + + ## ## +## ## ## +## ## ## + ## ## ## + #### ## + ## ## ## +____##____##____ + + +at 46,18 size 6,10 + + ## + ## ## + ## ## + #### +## #### +## ## +__####__##__ + + +at 53,18 size 2,10 + +## +## +## + + + +____ + + +at 57,18 size 3,10 + + ## +## +## +## +## +## +##____ +## + ## +at 62,18 size 3,10 + +## + ## + ## + ## + ## + ## +__##__ + ## +## +at 67,18 size 4,10 + + ## +###### + ## +## ## + + +________ + + +at 73,18 size 5,10 + + + ## + ## +######## + ## + ## +__________ + + +at 80,18 size 2,10 + + + + + + + +##__ +## + +at 84,18 size 3,10 + + + + + +#### + +______ + + +at 89,18 size 2,10 + + + + + + + +##__ + + +at 94,18 size 3,10 + + ## + ## + ## + ## +## +## +##____ + + +at 98,18 size 5,10 + + #### +## ## +## ## +## ## +## ## +## ## +__####____ + + +at 106,18 size 3,10 + + ## +#### + ## + ## + ## + ## +__##__ + + +at 112,18 size 5,10 + + #### +## ## + ## + ## + ## +## +########__ + + +at 119,18 size 5,10 + + #### +## ## + ## + #### + ## +## ## +__####____ + + +at 126,18 size 6,10 + + ## + #### + ## ## +## ## +########## + ## +______##____ + + +at 133,18 size 5,10 + +######## +## +###### + ## + ## +## ## +__####____ + + +at 139,18 size 5,10 + + #### +## +## ## +#### ## +## ## +## ## +__####____ + + +at 146,18 size 5,10 + +######## + ## + ## + ## + ## + ## +__##______ + + +at 153,18 size 5,10 + + #### +## ## +## ## + #### +## ## +## ## +__####____ + + +at 160,18 size 5,10 + + #### +## ## +## ## +## #### + ## ## + ## +__####____ + + +at 167,18 size 2,10 + + + +## + + + +##__ + + +at 171,18 size 2,10 + + + +## + + + +##__ +## + +at 176,18 size 5,10 + + + ## + #### +## + #### + ## +__________ + + +at 183,18 size 5,10 + + + +######## + +######## + +__________ + + +at 190,18 size 5,10 + + +## + #### + ## + #### +## +__________ + + +at 197,18 size 5,10 + + #### +## ## + ## + ## + ## + +__##______ + + +at 8,42 size 8,9 + ###### + ## ## +## #### ## +## ## ## ## +## ## ## ## +## ## ## ## +##____######____ + ## ## + ######## +at 18,42 size 6,9 + ## + ## + ## ## + ## ## + ###### +## ## +##______##__ + + +at 26,42 size 5,9 +###### +## ## +## ## +###### +## ## +## ## +######____ + + +at 34,42 size 6,9 + #### + ## ## +## +## +## + ## ## +____####____ + + +at 42,42 size 6,9 +###### +## ## +## ## +## ## +## ## +## ## +######______ + + +at 50,42 size 5,9 +######## +## +## +######## +## +## +########__ + + +at 58,42 size 5,9 +######## +## +## +######## +## +## +##________ + + +at 65,42 size 6,9 + #### + ## ## +## +## #### +## ## + ## ## +____####____ + + +at 74,42 size 6,9 +## ## +## ## +## ## +########## +## ## +## ## +##______##__ + + +at 82,42 size 2,9 +## +## +## +## +## +## +##__ + + +at 87,42 size 4,9 + ## + ## + ## + ## + ## +## ## +__##____ + + +at 93,42 size 5,9 +## ## +## ## +#### +#### +## ## +## ## +##____##__ + + +at 101,42 size 5,9 +## +## +## +## +## +## +########__ + + +at 107,42 size 6,9 +## ## +## ## +#### #### +#### #### +#### #### +## ## ## +##__##__##__ + + +at 117,42 size 6,9 +## ## +#### ## +#### ## +## ## ## +## #### +## #### +##______##__ + + +at 125,42 size 6,9 + ## + ## ## +## ## +## ## +## ## + ## ## +____##______ + + +at 133,42 size 5,9 +###### +## ## +## ## +###### +## +## +##________ + + +at 141,42 size 6,9 + ## + ## ## +## ## +## ## +## ## + ## ## +____######__ + ## + +at 150,42 size 6,9 +######## +## ## +## ## +######## +## ## +## ## +##______##__ + + +at 158,42 size 5,9 + #### +## ## +## + #### + ## +## ## +__####____ + + +at 166,42 size 5,9 +######## + ## + ## + ## + ## + ## +__##______ + + +at 173,42 size 6,9 +## ## +## ## +## ## +## ## +## ## +## ## +__######____ + + +at 181,42 size 6,9 +## ## +## ## + ## ## + ## ## + ## ## + ## ## +____##______ + + +at 189,42 size 8,9 +## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +## ## ## ## +__##______##____ + + +at 199,42 size 6,9 +## ## + ## ## + ## ## + ## + ## ## + ## ## +##______##__ + + +at 207,42 size 6,9 +## ## + ## ## + ## ## + ## + ## + ## +____##______ + + +at 214,42 size 5,9 +######## + ## + ## + ## + ## +## +########__ + + +at 222,42 size 3,9 +#### +## +## +## +## +## +##____ +## +#### +at 226,42 size 3,9 +## +## +## + ## + ## + ## +__##__ + + +at 230,42 size 3,9 +#### + ## + ## + ## + ## + ## +__##__ + ## +#### +at 235,42 size 4,9 + ## +## ## +## ## +## ## + + +________ + + +at 241,42 size 6,9 + + + + + + +____________ +########## + +at 8,66 size 2,10 +## +## + + + + + +____ + + +at 13,66 size 5,10 + + + + #### + ## + ###### +## ## +__######__ + + +at 20,66 size 5,10 + +## +## +## ## +#### ## +## ## +#### ## +##__##____ + + +at 27,66 size 4,10 + + + + ## +## ## +## +## ## +__##____ + + +at 33,66 size 5,10 + + ## + ## + ## ## +## #### +## ## +## #### +__##__##__ + + +at 40,66 size 5,10 + + + + #### +## ## +######## +## +__######__ + + +at 47,66 size 3,10 + + ## +## +#### +## +## +## +##____ + + +at 51,66 size 5,10 + + + + ## ## +## #### +## ## +## #### +__##__##__ + ## +###### +at 58,66 size 5,10 + +## +## +## ## +#### ## +## ## +## ## +##____##__ + + +at 65,66 size 2,10 + +## + +## +## +## +## +##__ + + +at 69,66 size 2,10 + +## + +## +## +## +## +##__ +## +## +at 73,66 size 4,10 + +## +## +## ## +#### +#### +## ## +##__##__ + + +at 80,66 size 2,10 + +## +## +## +## +## +## +##__ + + +at 84,66 size 6,10 + + + +######## +## ## ## +## ## ## +## ## ## +##__##__##__ + + +at 93,66 size 5,10 + + + +## ## +#### ## +## ## +## ## +##____##__ + + +at 100,66 size 5,10 + + + + #### +## ## +## ## +## ## +__####____ + + +at 106,66 size 5,10 + + + +## ## +#### ## +## ## +#### ## +##__##____ +## +## +at 113,66 size 5,10 + + + + ## ## +## #### +## ## +## #### +__##__##__ + ## + ## +at 120,66 size 4,10 + + + +## ## +#### +## +## +##______ + + +at 125,66 size 4,10 + + + + #### +## + ## + ## +####____ + + +at 132,66 size 3,10 + +## +## +#### +## +## +## +__##__ + + +at 136,66 size 5,10 + + + +## ## +## ## +## ## +## #### +__##__##__ + + +at 143,66 size 4,10 + + + +## ## +## ## +## ## +## ## +__##____ + + +at 149,66 size 6,10 + + + +## ## ## +## ## ## +## ## ## +## ## ## +__##__##____ + + +at 158,66 size 4,10 + + + +## ## + ## + ## + ## +##__##__ + + +at 164,66 size 4,10 + + + +## ## +## ## +## ## + ## +__##____ + ## +## +at 170,66 size 4,10 + + + +###### + ## + ## +## +######__ + + +at 177,66 size 4,10 + + ## + ## + ## + ## +## + ## +__##____ + ## + ## +at 182,66 size 2,10 + +## +## +## +## +## +## +##__ +## +## +at 186,66 size 4,10 + +## + ## + ## + ## + ## + ## +__##____ + ## +## +at 191,66 size 5,10 + + + + ## ## +## ## + + +__________ + + +at 197,66 size 6,10 + + #### + ## ## +###### + ## +###### + ## ## +____####____ + + +at 204,66 size 5,10 + + + ## + ###### +## +## +## +__######__ + ## + diff --git a/src/font/small.psd b/src/font/small.psd new file mode 100644 index 00000000..0fbc524e Binary files /dev/null and b/src/font/small.psd differ diff --git a/src/fsutil/bd.exe b/src/fsutil/bd.exe index af80d7fe..d284f670 100644 Binary files a/src/fsutil/bd.exe and b/src/fsutil/bd.exe differ diff --git a/src/fsutil/boot.c b/src/fsutil/boot.c index 446b7e41..352a23ad 100644 --- a/src/fsutil/boot.c +++ b/src/fsutil/boot.c @@ -1,7 +1,7 @@ -/* ..\fsutil\boot.c generated from ..\..\bin\boot.bin, do not edit! */ +/* ..\..\fsutil\boot.c generated from ..\..\..\bin\boot.bin, do not edit! */ -0x43,0x38,0x33,0x30,0x30,0x33,0x30,0x33, -0x31,0x31,0x30,0x34,0x35,0x32,0x34,0x34, +0x43,0x36,0x45,0x46,0x30,0x33,0x30,0x35, +0x30,0x39,0x32,0x30,0x33,0x39,0x31,0x30, 0x31,0x00,0x80,0xcd,0xa3,0x06,0xcd,0xab, 0x05,0xcd,0xfd,0x04,0x18,0x22,0x00,0x00, 0x00,0x42,0x4f,0x4f,0x54,0x20,0x20,0x20, diff --git a/src/fsutil/f.bat b/src/fsutil/f.bat deleted file mode 100644 index eb08e560..00000000 --- a/src/fsutil/f.bat +++ /dev/null @@ -1,13 +0,0 @@ -cl -Zi -I. -I..\kernel -DVAX -DUTIL -DDEBUG=1 -c utils.c -@if errorlevel 1 goto failure -cl -Zi -I. -I..\kernel -DVAX -DUTIL -DNATIVE -DDEBUG=1 -c fsck.c -@if errorlevel 1 goto failure -link @fsck.lnk -@if errorlevel 1 goto failure - -@echo SUCCESS -@goto done -:failure -@echo FAILURE -:done - diff --git a/src/fsutil/fsck.exe b/src/fsutil/fsck.exe index 0354bae4..30225ccb 100644 Binary files a/src/fsutil/fsck.exe and b/src/fsutil/fsck.exe differ diff --git a/src/fsutil/fsck.lnk b/src/fsutil/fsck.lnk index aeeac6d4..6415e4ee 100644 --- a/src/fsutil/fsck.lnk +++ b/src/fsutil/fsck.lnk @@ -1,12 +1,14 @@ -k ..\..\lib --l libcl.lib --l libsysl.lib +-l libcb.lib +-l libsysb.lib -l libiar.lib -m -u -i -o fsck -bl RCODE=0x8100 -..\..\lib\c0l.rel +-bl CODE=0x4000,0x10000 +-bc CODE=0x4000 +..\..\lib\c0b.rel fsck -utils +utils diff --git a/src/fsutil/fsck.map b/src/fsutil/fsck.map index 8e4abd56..851ad610 100644 --- a/src/fsutil/fsck.map +++ b/src/fsutil/fsck.map @@ -9,15 +9,15 @@ Area Addr Size Decimal Bytes (Attributes) 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR 00000000 l_CONST | 00000000 .__.ABS. | 00000000 ?CL64180L 00000000 ?CL64180B | 00000014 e__DEFAUL | 00000014 l__DEFAUL - 0000016C l_CDATA0 | 0000016C l_IDATA0 | 00000352 l_RCODE - 000007A9 l_CSTR | 000008C2 l_UDATA0 | 00001000 l_CSTACK - 000038A8 l_CODE | 00008100 s_RCODE | 00008452 e_RCODE - 00008452 s_CODE | 0000BCFA s_CSTR | 0000BCFA e_CODE - 0000BCFA e_CONST | 0000BCFA s_CONST | 0000C4A3 e_CSTR - 0000C4A3 s_IDATA0 | 0000C4A3 s_CDATA0 | 0000C60F s_UDATA0 - 0000C60F e_CCSTR | 0000C60F e_ECSTR | 0000C60F s_CCSTR - 0000C60F e_CDATA0 | 0000C60F s_ECSTR | 0000C60F e_IDATA0 - 0000CED1 e_UDATA0 | 0000CED1 s_CSTACK | 0000DED1 e_CSTACK + 0000016C l_CDATA0 | 0000016C l_IDATA0 | 00000377 l_RCODE + 000007A9 l_CSTR | 000008CD l_UDATA0 | 00001000 l_CSTACK + 00004000 s_CODE | 00008100 s_RCODE | 00008477 s_CSTR + 00008477 e_RCODE | 00008477 e_CONST | 00008477 s_CONST + 00008C20 e_CSTR | 00008C20 s_IDATA0 | 00008C20 s_CDATA0 + 00008D8C s_UDATA0 | 00008D8C e_CCSTR | 00008D8C e_ECSTR + 00008D8C s_CCSTR | 00008D8C e_CDATA0 | 00008D8C s_ECSTR + 00008D8C e_IDATA0 | 00009659 e_UDATA0 | 00009659 s_CSTACK + 0000A659 e_CSTACK | 0000C015 l_CODE | 00010015 e_CODE Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) @@ -30,61 +30,35 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -RCODE 00008100 00000352 = 850. bytes (REL,CON) +RCODE 00008100 00000377 = 887. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00008100 __init | 00008115 ?US_RSH_L | 0000811F ?S_LSH_L0 - 00008128 ?LEAVE_DI | 0000812F ?ENT_PARM | 0000813B ?L_ANDASG - 00008154 ?SL_CMP_L | 00008185 ?ENT_AUTO | 00008199 ?SL_DIV_L - 000081C9 ?SS_CMP_L | 000081DB ?L_INC_L0 | 000081E3 ?US_MOD_L - 000081EC ?C_LSH_L0 | 000081F3 ?US_DIV_L | 00008201 ?SL_RSH_L - 0000820F ?L_DIVMOD | 00008267 ?L_LSH_L0 | 0000827F ?S_DIVMOD - 00008295 ?LEAVE_32 | 0000829D ?S_MULASG | 000082A7 ?L_NOT_L0 - 000082B6 ?S_MUL_L0 | 000082CC ?C_V_SWIT | 000082DE ?CALL_IND - 000082DF ?L_FIND_S | 00008323 ?UL_DIVAS | 00008333 ?V_SWITCH - 0000833D ?UL_MOD_L | 00008362 ?UL_DIV_L | 0000838A ?L_NEG_L0 - 0000839C ?L_END_MU | 000083A5 ?L_MULASG | 000083B5 ?L_MUL_L0 - 00008439 ?L_ADDASG + 00008100 __init | 0000811F ?US_RSH_L | 00008129 ?S_LSH_L0 + 00008132 ?BANK_LEA | 00008138 ?BANK_FAS | 0000813D ?ENT_PARM + 00008149 ?BANK_CAL | 00008156 ?L_ANDASG | 0000816F ?SL_CMP_L + 000081A0 ?ENT_AUTO | 000081B4 ?SL_DIV_L | 000081E4 ?SS_CMP_L + 000081F6 ?L_INC_L0 | 000081FE ?US_MOD_L | 00008207 ?C_LSH_L0 + 0000820E ?US_DIV_L | 0000821C ?SL_RSH_L | 0000822A ?L_DIVMOD + 00008282 ?BANK_LEA | 0000828E ?L_LSH_L0 | 000082A6 ?S_DIVMOD + 000082BC ?S_MULASG | 000082C6 ?L_NOT_L0 | 000082D5 ?S_MUL_L0 + 000082EB ?C_V_SWIT | 000082FD ?LEAVE_DI | 00008304 ?L_FIND_S + 00008348 ?UL_DIVAS | 00008358 ?V_SWITCH | 00008362 ?UL_MOD_L + 00008387 ?UL_DIV_L | 000083AF ?L_NEG_L0 | 000083C1 ?L_END_MU + 000083CA ?L_MULASG | 000083DA ?L_MUL_L0 | 0000845E ?L_ADDASG Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CODE 00008452 000038A8 = 14504. bytes (REL,CON) +CONST 00008477 00000000 = 0. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00008452 da_read | 000084C5 da_write | 00008538 pass1 - 000089A8 pass2 | 00008C22 pass3 | 00008EF0 ckdir - 000092FF pass4 | 0000932B mkentry | 000093EE pass5 - 000095DA getblkno | 000096C7 setblkno | 000097F5 _blk_allo - 000098AD daread | 000098DD dwrite | 00009907 iread - 0000994B iwrite | 000099A9 dirread | 00009A09 dirwrite - 00009A7A yes | 00009AC4 main | 00009D79 bitmap_du - 00009E5B bitmap_fi | 00009F9E mypanic | 00009FBA bzero - 00009FE4 bfill | 0000A010 bcopy | 0000A048 int_min - 0000A069 int_max | 0000A07F sprintf | 0000A0BE fflush - 0000A2B3 _write | 0000A2CD strcat | 0000A2E3 printf - 0000A30D lseek | 0000A335 __stdio_c | 0000A38C __stdio_i - 0000A3BA close | 0000A3CA strlen | 0000A401 abort - 0000A445 _exit | 0000A455 fgets | 0000A4F5 strcmp - 0000A591 perror | 0000A5C9 pause | 0000A5D2 isatty - 0000A608 fstat | 0000A61A strcpy | 0000A637 kill - 0000A7BA vfprintf | 0000ACED ltoa | 0000AD4B __longtoa - 0000AEDF itoa | 0000AF43 open | 0000AF69 malloc - 0000B18B fprintf | 0000B1B8 exit | 0000B1DD _read - 0000B1F7 getpid | 0000B205 signal | 0000B225 strerror - 0000B3B4 unix | 0000B3CC fgetc | 0000B4D2 memcpy - 0000B58B on_exit | 0000B5ED atexit | 0000B5F9 unix_long - 0000B611 strchr | 0000B64C free | 0000B72C fputc - 0000B82A ultoa | 0000B87A atoi | 0000B88B sbrk - 0000B89B fread | 0000BA30 strtol | 0000BB59 strtoul - 0000BCB0 toupper | 0000BCD5 tolower Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CONST 0000BCFA 00000000 = 0. bytes (REL,CON) +CSTR 00008477 000007A9 = 1961. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -92,26 +66,26 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTR 0000BCFA 000007A9 = 1961. bytes (REL,CON) +IDATA0 00008C20 0000016C = 364. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ + 00008C20 _yes | 00008C3A __IO_list | 00008C3C stdin + 00008C54 stdout | 00008C6C stderr | 00008C86 __sys_err + 00008C88 __sys_ner | 00008C8A __on_exit | 00008C8C __ctype Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -IDATA0 0000C4A3 0000016C = 364. bytes (NUL,CON) +CDATA0 00008C20 0000016C = 364. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 0000C4A3 _yes | 0000C4BD __IO_list | 0000C4BF stdin - 0000C4D7 stdout | 0000C4EF stderr | 0000C509 __sys_err - 0000C50B __sys_ner | 0000C50D __on_exit | 0000C50F __ctype Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CDATA0 0000C4A3 0000016C = 364. bytes (REL,CON) +ECSTR 00008D8C 00000000 = 0. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -119,7 +93,7 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -ECSTR 0000C60F 00000000 = 0. bytes (NUL,CON) +CCSTR 00008D8C 00000000 = 0. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -127,120 +101,147 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CCSTR 0000C60F 00000000 = 0. bytes (REL,CON) +CODE 00004000 0000C015 = 49173. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ + 00004CA0 da_read | 00004D45 da_write | 00004DEA pass1 + 000052C9 pass2 | 00005570 pass3 | 0000589D ckdir + 00005D38 pass4 | 00005D70 mkentry | 00005E52 pass5 + 0000608F getblkno | 0000618B setblkno | 000062E1 _blk_allo + 000063B3 daread | 000063F2 dwrite | 0000642B iread + 00006479 iwrite | 000064E6 dirread | 0000655A dirwrite + 000065E4 yes | 0000663D main | 000069D9 bitmap_du + 00006ACF bitmap_fi | 00006C21 mypanic | 00006C4C bzero + 00006C76 bfill | 00006CA2 bcopy | 00006CDA int_min + 00006CFB int_max | 00006D11 sprintf | 00006D55 fflush + 00006F68 _write | 00006F87 strcat | 00006FA7 printf + 00006FD6 lseek | 00007003 __stdio_c | 0000706E __stdio_i + 000070AC close | 000070C1 strlen | 000070F8 abort + 00007166 _exit | 0000717B fgets | 00007220 strcmp + 000072C1 perror | 000072FE pause | 0000730E isatty + 00007349 fstat | 00007360 strcpy | 00007387 kill + 0000751E vfprintf | 00007A79 ltoa | 00007ADC __longtoa + 00007C70 itoa | 00007CD9 open | 00007D04 malloc + 00007F30 fprintf | 00007F62 exit | 00007F92 _read + 00007FB1 getpid | 00007FC6 signal | 00014000 strerror + 000141BD unix | 000141D7 fgetc | 000142E7 memcpy + 000143B5 on_exit | 0001442E atexit | 00014441 unix_long + 0001445B strchr | 00014496 free | 00014576 fputc + 00014688 ultoa | 000146DD atoi | 000146F3 sbrk + 00014708 fread | 000148B6 strtol | 000149E4 strtoul + 00014B3B toupper | 00014B60 tolower Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -UDATA0 0000C60F 000008C2 = 2242. bytes (REL,CON) +UDATA0 00008D8C 000008CD = 2253. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 0000C60F _argc | 0000C611 _argv | 0000C613 environ - 0000C615 errno | 0000C617 __cleanup | 0000C619 device_ha - 0000C61B device_na | 0000C81B zeroed | 0000CA1B depth - 0000CA1D dev | 0000CA1F filsys | 0000CA3D ninodes - 0000CA3F finode | 0000CA41 bitmap_in | 0000CA45 bitmap_bl - 0000CA49 bitmap_im | 0000CA4D inode_bit | 0000CA4F block_bit - 0000CA51 link_coun | 0000CE53 __malloc_ | 0000CE57 __malloc_ - 0000CEA9 __on_exit + 00008D8C _argc | 00008D8E _argv | 00008D90 environ + 00008D92 errno | 00008D94 __cleanup | 00008D97 device_ha + 00008D99 device_na | 00008F99 zeroed | 00009199 depth + 0000919B dev | 0000919D filsys | 000091BB ninodes + 000091BD finode | 000091BF bitmap_in | 000091C3 bitmap_bl + 000091C7 bitmap_im | 000091CB inode_bit | 000091CD block_bit + 000091CF link_coun | 000095D1 __malloc_ | 000095D5 __malloc_ + 00009627 __on_exit Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTACK 0000CED1 00001000 = 4096. bytes (REL,CON) +CSTACK 00009659 00001000 = 4096. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ Files Linked [ module(s) ] -..\..\lib\c0l.rel [ _c0l ] +..\..\lib\c0b.rel [ _c0b ] fsck [ fsck ] utils [ utils ] Libraries Linked [ object file ] -..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] ..\..\lib\libiar.lib [ reliar\USRSH.rel ] ..\..\lib\libiar.lib [ reliar\SLSH.rel ] -..\..\lib\libcl.lib [ relcl\sprintf.rel ] -..\..\lib\libcl.lib [ relcl\fflush.rel ] -..\..\lib\libsysl.lib [ relsysl\write.rel ] -..\..\lib\libcl.lib [ relcl\strcat.rel ] -..\..\lib\libcl.lib [ relcl\printf.rel ] -..\..\lib\libsysl.lib [ relsysl\lseek.rel ] -..\..\lib\libcl.lib [ relcl\stdio0.rel ] -..\..\lib\libsysl.lib [ relsysl\close.rel ] -..\..\lib\libcl.lib [ relcl\strlen.rel ] -..\..\lib\libcl.lib [ relcl\abort.rel ] -..\..\lib\libsysl.lib [ relsysl\_exit.rel ] -..\..\lib\libcl.lib [ relcl\fgets.rel ] -..\..\lib\libcl.lib [ relcl\strcmp.rel ] -..\..\lib\libcl.lib [ relcl\perror.rel ] -..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] -..\..\lib\libsysl.lib [ relsysl\pause.rel ] -..\..\lib\libcl.lib [ relcl\isatty.rel ] -..\..\lib\libsysl.lib [ relsysl\fstat.rel ] +..\..\lib\libcb.lib [ relcb\sprintf.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libcb.lib [ relcb\printf.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libcb.lib [ relcb\abort.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libcb.lib [ relcb\fgets.rel ] +..\..\lib\libcb.lib [ relcb\strcmp.rel ] +..\..\lib\libcb.lib [ relcb\perror.rel ] +..\..\lib\libsysb.lib [ relsysb\pause.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] ..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] -..\..\lib\libcl.lib [ relcl\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] ..\..\lib\libiar.lib [ reliar\LANDASG.rel ] ..\..\lib\libiar.lib [ reliar\SLCMP.rel ] -..\..\lib\libsysl.lib [ relsysl\kill.rel ] +..\..\lib\libsysb.lib [ relsysb\kill.rel ] ..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] ..\..\lib\libiar.lib [ reliar\SLDIV.rel ] -..\..\lib\libcl.lib [ relcl\vfprintf.rel ] -..\..\lib\libcl.lib [ relcl\ltoa.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] ..\..\lib\libiar.lib [ reliar\SSCMP.rel ] -..\..\lib\libcl.lib [ relcl\itoa.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] ..\..\lib\libiar.lib [ reliar\LINC.rel ] -..\..\lib\libsysl.lib [ relsysl\open.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] ..\..\lib\libiar.lib [ reliar\USMOD.rel ] ..\..\lib\libiar.lib [ reliar\CLSH.rel ] ..\..\lib\libiar.lib [ reliar\USDIV.rel ] -..\..\lib\libcl.lib [ relcl\malloc.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] ..\..\lib\libiar.lib [ reliar\SLRSH.rel ] -..\..\lib\libcl.lib [ relcl\fprintf.rel ] -..\..\lib\libcl.lib [ relcl\exit.rel ] +..\..\lib\libcb.lib [ relcb\fprintf.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] ..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] -..\..\lib\libsysl.lib [ relsysl\read.rel ] -..\..\lib\libsysl.lib [ relsysl\getpid.rel ] -..\..\lib\libsysl.lib [ relsysl\signal.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libsysb.lib [ relsysb\getpid.rel ] +..\..\lib\libsysb.lib [ relsysb\signal.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] ..\..\lib\libiar.lib [ reliar\LLSH.rel ] ..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] -..\..\lib\libcl.lib [ relcl\error.rel ] -..\..\lib\libiar.lib [ reliar\LEAVE32.rel ] -..\..\lib\libsysl.lib [ relsysl\sys0l.rel ] +..\..\lib\libcb.lib [ relcb\error.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] ..\..\lib\libiar.lib [ reliar\SMULASG.rel ] ..\..\lib\libiar.lib [ reliar\LNOT.rel ] -..\..\lib\libcl.lib [ relcl\fgetc.rel ] -..\..\lib\libcl.lib [ relcl\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\fgetc.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] ..\..\lib\libiar.lib [ reliar\SMUL.rel ] -..\..\lib\libcl.lib [ relcl\atexit.rel ] -..\..\lib\libsysl.lib [ relsysl\sys1l.rel ] -..\..\lib\libcl.lib [ relcl\strchr.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libcb.lib [ relcb\strchr.rel ] ..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] -..\..\lib\libcl.lib [ relcl\free.rel ] -..\..\lib\libcl.lib [ relcl\fputc.rel ] -..\..\lib\libcl.lib [ relcl\ultoa.rel ] -..\..\lib\libiar.lib [ reliar\CALLIND.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] ..\..\lib\libiar.lib [ reliar\LFINDSIGN.rel ] ..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] ..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] -..\..\lib\libcl.lib [ relcl\atoi.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] ..\..\lib\libiar.lib [ reliar\ULMOD.rel ] ..\..\lib\libiar.lib [ reliar\ULDIV.rel ] -..\..\lib\libsysl.lib [ relsysl\sbrk.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] ..\..\lib\libiar.lib [ reliar\LNEG.rel ] -..\..\lib\libcl.lib [ relcl\fread.rel ] +..\..\lib\libcb.lib [ relcb\fread.rel ] ..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] -..\..\lib\libcl.lib [ relcl\strtol.rel ] -..\..\lib\libcl.lib [ relcl\strtoul.rel ] -..\..\lib\libcl.lib [ relcl\ctype.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] ..\..\lib\libiar.lib [ reliar\LMULASG.rel ] ..\..\lib\libiar.lib [ reliar\LMUL.rel ] ..\..\lib\libiar.lib [ reliar\LADDASG.rel ] @@ -249,3 +250,5 @@ Libraries Linked [ object file ] User Base Address Definitions l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/fsutil/fsck.rel b/src/fsutil/fsck.rel index 5f9624b5..d2974fdf 100644 --- a/src/fsutil/fsck.rel +++ b/src/fsutil/fsck.rel @@ -1,26 +1,27 @@ XL4 -H 6 areas 4B global symbols +H 6 areas 4D global symbols M fsck S ?US_RSH_L02 Ref00000000 -S ?CL64180L_4_06_L00 Ref00000000 S ?S_LSH_L02 Ref00000000 S sprintf Ref00000000 +S ?BANK_FAST_LEAVE_L08 Ref00000000 S fflush Ref00000000 S bfill Ref00000000 S _write Ref00000000 S strcat Ref00000000 S printf Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 S stderr Ref00000000 S lseek Ref00000000 S close Ref00000000 S abort Ref00000000 S strcmp Ref00000000 S fgets Ref00000000 -S ?LEAVE_DIRECT_L09 Ref00000000 S perror Ref00000000 S bcopy Ref00000000 S stdin Ref00000000 S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 S stdout Ref00000000 S strcpy Ref00000000 S ?L_ANDASG_L03 Ref00000000 @@ -31,6 +32,7 @@ S int_min Ref00000000 S ?SS_CMP_L02 Ref00000000 S open Ref00000000 S ?C_LSH_L01 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 S ?SL_RSH_L03 Ref00000000 S malloc Ref00000000 S fprintf Ref00000000 @@ -39,30 +41,30 @@ S _read Ref00000000 S .__.ABS. Def00000000 S ?L_LSH_L03 Ref00000000 A _DEFAULT size 0 flags 0 -A CODE size 1B68 flags 0 +A CODE size 1FAC flags 0 S da_read Def00000000 -S _blk_alloc Def000013A3 -S iread Def000014B5 -S mkentry Def00000ED9 -S ckdir Def00000A9E -S dwrite Def0000148B -S da_write Def00000073 -S yes Def00001628 -S bitmap_dump Def00001927 -S iwrite Def000014F9 -S getblkno Def00001188 -S dirread Def00001557 -S daread Def0000145B -S setblkno Def00001275 -S main Def00001672 -S pass1 Def000000E6 -S pass2 Def00000556 -S pass3 Def000007D0 -S dirwrite Def000015B7 -S pass4 Def00000EAD -S pass5 Def00000F9C -S mypanic Def00001B4C -S bitmap_find Def00001A09 +S _blk_alloc Def00001641 +S iread Def0000178B +S mkentry Def000010D0 +S ckdir Def00000BFD +S dwrite Def00001752 +S da_write Def000000A5 +S yes Def00001944 +S bitmap_dump Def00001D39 +S iwrite Def000017D9 +S getblkno Def000013EF +S dirread Def00001846 +S daread Def00001713 +S setblkno Def000014EB +S main Def0000199D +S pass1 Def0000014A +S pass2 Def00000629 +S pass3 Def000008D0 +S dirwrite Def000018BA +S pass4 Def00001098 +S pass5 Def000011B2 +S mypanic Def00001F81 +S bitmap_find Def00001E2F A CSTR size 771 flags 0 A UDATA0 size 63A flags 0 S bitmap_immov Def00000430 @@ -87,2519 +89,2941 @@ R 00 00 01 00 T 00 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 R 00 00 01 00 02 05 13 00 T 09 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 -R 00 00 01 00 02 0A 24 00 -T 12 00 00 00 E5 ED 5B 00 00 00 00 CD +R 00 00 01 00 02 0A 26 00 +T 12 00 00 00 E5 ED 5B 00 00 00 00 3E R 00 00 01 00 00 07 03 00 -T 18 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 1A -R 00 00 01 00 02 04 0A 00 -T 21 00 00 00 -R 00 00 01 00 -T 21 00 00 00 21 00 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 28 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 2F 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 10 00 -T 36 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 21 00 -T 3B 00 00 00 -R 00 00 01 00 -T 3B 00 00 00 21 00 02 E5 DD 4E 08 DD 46 09 ED -R 00 00 01 00 -T 46 00 00 00 5B 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 00 05 03 00 02 0A 22 00 -T 4D 00 00 00 3E 02 AC B5 28 1A -R 00 00 01 00 -T 53 00 00 00 -R 00 00 01 00 -T 53 00 00 00 21 0D 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 5A 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 61 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 10 00 -T 68 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 21 00 -T 6D 00 00 00 -R 00 00 01 00 -T 6D 00 00 00 21 00 02 C3 00 00 00 00 -R 00 00 01 00 02 08 0F 00 -T 73 00 00 00 -R 00 00 01 00 -T 73 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 +T 18 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +T 1D 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 2E +R 00 00 01 00 02 04 14 00 +T 26 00 00 00 +R 00 00 01 00 +T 26 00 00 00 21 00 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 2C 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 33 00 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T 39 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 3F 00 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 10 00 +T 44 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 10 00 02 09 14 00 +T 4A 00 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T 4F 00 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T 54 00 00 00 +R 00 00 01 00 +T 54 00 00 00 21 00 02 E5 DD 4E 0A DD 46 0B ED +R 00 00 01 00 +T 5F 00 00 00 5B 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 03 00 2B 0A 24 00 +T 65 00 00 00 00 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 02 04 24 00 02 09 14 00 +T 6C 00 00 00 02 AC B5 28 2E +R 00 00 01 00 +T 71 00 00 00 +R 00 00 01 00 +T 71 00 00 00 21 0D 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 77 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 7E 00 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T 84 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 8A 00 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 10 00 +T 8F 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 10 00 02 09 14 00 +T 95 00 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T 9A 00 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T 9F 00 00 00 +R 00 00 01 00 +T 9F 00 00 00 21 00 02 C3 00 00 00 00 +R 00 00 01 00 02 08 09 00 +T A5 00 00 00 +R 00 00 01 00 +T A5 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 R 00 00 01 00 02 05 13 00 -T 7C 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 -R 00 00 01 00 02 0A 24 00 -T 85 00 00 00 E5 ED 5B 00 00 00 00 CD +T AE 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 +R 00 00 01 00 02 0A 26 00 +T B7 00 00 00 E5 ED 5B 00 00 00 00 3E R 00 00 01 00 00 07 03 00 -T 8B 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 1A -R 00 00 01 00 02 04 0A 00 -T 94 00 00 00 -R 00 00 01 00 -T 94 00 00 00 21 00 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 9B 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T A2 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 10 00 -T A9 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 21 00 -T AE 00 00 00 -R 00 00 01 00 -T AE 00 00 00 21 00 02 E5 DD 4E 08 DD 46 09 ED -R 00 00 01 00 -T B9 00 00 00 5B 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 00 05 03 00 02 0A 06 00 -T C0 00 00 00 3E 02 AC B5 28 1A -R 00 00 01 00 -T C6 00 00 00 -R 00 00 01 00 -T C6 00 00 00 21 1A 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T CD 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T D4 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 10 00 -T DB 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 21 00 -T E0 00 00 00 -R 00 00 01 00 -T E0 00 00 00 21 00 02 C3 00 00 00 00 -R 00 00 01 00 02 08 0F 00 -T E6 00 00 00 -R 00 00 01 00 -T E6 00 00 00 CD 00 00 00 00 B2 FF AF DD 77 B6 -R 00 00 01 00 02 05 18 00 -T EF 00 00 00 DD 77 B7 DD 36 B2 01 DD 36 B3 00 -R 00 00 01 00 -T FA 00 00 00 -R 00 00 01 00 -T FA 00 00 00 ED 4B 24 04 00 00 DD 6E B2 DD 66 +T BD 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +T C2 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 2E +R 00 00 01 00 02 04 14 00 +T CB 00 00 00 +R 00 00 01 00 +T CB 00 00 00 21 00 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T D1 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T D8 00 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T DE 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T E4 00 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 10 00 +T E9 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 10 00 02 09 14 00 +T EF 00 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T F4 00 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T F9 00 00 00 +R 00 00 01 00 +T F9 00 00 00 21 00 02 E5 DD 4E 0A DD 46 0B ED +R 00 00 01 00 +T 04 01 00 00 5B 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 03 00 2B 0A 06 00 +T 0A 01 00 00 00 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 02 04 06 00 02 09 14 00 +T 11 01 00 00 02 AC B5 28 2E +R 00 00 01 00 +T 16 01 00 00 +R 00 00 01 00 +T 16 01 00 00 21 1A 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 1C 01 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 23 01 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T 29 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 2F 01 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 10 00 +T 34 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 10 00 02 09 14 00 +T 3A 01 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T 3F 01 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T 44 01 00 00 +R 00 00 01 00 +T 44 01 00 00 21 00 02 C3 00 00 00 00 +R 00 00 01 00 02 08 09 00 +T 4A 01 00 00 +R 00 00 01 00 +T 4A 01 00 00 CD 00 00 00 00 B2 FF AF DD 77 B6 +R 00 00 01 00 02 05 19 00 +T 53 01 00 00 DD 77 B7 DD 36 B2 01 DD 36 B3 00 +R 00 00 01 00 +T 5E 01 00 00 +R 00 00 01 00 +T 5E 01 00 00 ED 4B 24 04 00 00 DD 6E B2 DD 66 R 00 00 01 00 00 06 03 00 -T 03 01 00 00 B3 A7 ED 42 D2 03 05 00 00 +T 67 01 00 00 B3 A7 ED 42 D2 C7 05 00 00 R 00 00 01 00 00 09 01 00 -T 0A 01 00 00 +T 6E 01 00 00 R 00 00 01 00 -T 0A 01 00 00 21 0E 00 39 4D 44 DD 5E B2 DD 56 +T 6E 01 00 00 21 0E 00 39 4D 44 DD 5E B2 DD 56 R 00 00 01 00 -T 15 01 00 00 B3 CD B5 14 00 00 DD 6E B2 DD 66 -R 00 00 01 00 00 06 01 00 -T 1E 01 00 00 B3 ED 4B 38 04 00 00 09 36 FF DD -R 00 00 01 00 00 07 03 00 -T 27 01 00 00 6E C0 DD 66 C1 7D B4 20 03 +T 79 01 00 00 B3 3E 8B 17 00 00 21 8B 17 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 7F 01 00 00 CD 00 00 00 00 DD 6E B2 DD 66 B3 +R 00 00 01 00 02 05 14 00 +T 88 01 00 00 ED 4B 38 04 00 00 09 36 FF DD 6E +R 00 00 01 00 00 06 03 00 +T 91 01 00 00 C0 DD 66 C1 7D B4 20 03 R 00 00 01 00 -T 30 01 00 00 +T 99 01 00 00 R 00 00 01 00 -T 30 01 00 00 C3 F8 04 00 00 +T 99 01 00 00 C3 BC 05 00 00 R 00 00 01 00 00 05 01 00 -T 33 01 00 00 -R 00 00 01 00 -T 33 01 00 00 DD 7E C0 E6 00 6F DD 7E C1 E6 F0 +T 9C 01 00 00 R 00 00 01 00 -T 3E 01 00 00 67 DD 75 B4 DD 74 B5 3E A0 AC B5 +T 9C 01 00 00 DD 7E C0 E6 00 6F DD 7E C1 E6 F0 R 00 00 01 00 -T 49 01 00 00 28 71 3E 80 DD AE B5 DD B6 B4 28 +T A7 01 00 00 67 DD 75 B4 DD 74 B5 3E A0 AC B5 R 00 00 01 00 -T 54 01 00 00 67 3E 40 DD AE B5 DD B6 B4 28 5D +T B2 01 00 00 CA 35 02 00 00 3E 80 DD AE B5 DD +R 00 00 01 00 00 05 01 00 +T BB 01 00 00 B6 B4 28 76 3E 40 DD AE B5 DD B6 R 00 00 01 00 -T 5F 01 00 00 3E 90 DD AE B5 DD B6 B4 28 53 3E +T C6 01 00 00 B4 28 6C 3E 90 DD AE B5 DD B6 B4 R 00 00 01 00 -T 6A 01 00 00 60 DD AE B5 DD B6 B4 28 49 3E 20 +T D1 01 00 00 28 62 3E 60 DD AE B5 DD B6 B4 28 R 00 00 01 00 -T 75 01 00 00 DD AE B5 DD B6 B4 28 3F +T DC 01 00 00 58 3E 20 DD AE B5 DD B6 B4 28 4E R 00 00 01 00 -T 7D 01 00 00 +T E7 01 00 00 R 00 00 01 00 -T 7D 01 00 00 +T E7 01 00 00 R 00 00 01 00 -T 7D 01 00 00 +T E7 01 00 00 R 00 00 01 00 -T 7D 01 00 00 DD 6E C0 DD 66 C1 E5 DD 6E B2 DD +T E7 01 00 00 DD 6E C0 DD 66 C1 E5 DD 6E B2 DD R 00 00 01 00 -T 88 01 00 00 66 B3 E5 21 28 00 00 00 E5 CD +T F2 01 00 00 66 B3 E5 21 28 00 00 00 E5 3E R 00 00 01 00 00 08 02 00 -T 90 01 00 00 00 00 00 00 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T 96 01 00 00 28 16 00 00 7D B4 28 20 +T FA 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T FF 01 00 00 00 00 00 00 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 05 02 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 0A 02 00 00 00 00 00 00 7D B4 28 25 +R 00 00 01 00 02 04 14 00 +T 10 02 00 00 +R 00 00 01 00 +T 10 02 00 00 AF DD 77 C0 DD 77 C1 AF DD 77 C2 +R 00 00 01 00 +T 1B 02 00 00 DD 77 C3 21 0E 00 39 4D 44 DD 5E +R 00 00 01 00 +T 26 02 00 00 B2 DD 56 B3 3E D9 17 00 00 21 +R 00 00 01 00 29 09 01 00 +T 2D 02 00 00 D9 17 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 33 02 00 00 BC 05 00 00 R 00 00 01 00 00 04 01 00 -T 9C 01 00 00 +T 35 02 00 00 R 00 00 01 00 -T 9C 01 00 00 AF DD 77 C0 DD 77 C1 AF DD 77 C2 +T 35 02 00 00 R 00 00 01 00 -T A7 01 00 00 DD 77 C3 21 0E 00 39 4D 44 DD 5E +T 35 02 00 00 DD 6E B2 DD 66 B3 ED 4B R 00 00 01 00 -T B2 01 00 00 B2 DD 56 B3 CD F9 14 00 00 C3 -R 00 00 01 00 00 09 01 00 -T BA 01 00 00 F8 04 00 00 -R 00 00 01 00 00 04 01 00 -T BC 01 00 00 -R 00 00 01 00 -T BC 01 00 00 -R 00 00 01 00 -T BC 01 00 00 DD 6E B2 DD 66 B3 ED 4B -R 00 00 01 00 -T C4 01 00 00 38 04 00 00 09 36 00 DD 34 B6 20 +T 3D 02 00 00 38 04 00 00 09 36 00 DD 34 B6 20 R 00 00 01 00 00 04 03 00 -T CD 01 00 00 03 DD 34 B7 +T 46 02 00 00 03 DD 34 B7 R 00 00 01 00 -T D1 01 00 00 +T 4A 02 00 00 R 00 00 01 00 -T D1 01 00 00 3E A0 DD AE B5 DD B6 B4 28 1F 3E +T 4A 02 00 00 3E A0 DD AE B5 DD B6 B4 28 1F 3E R 00 00 01 00 -T DC 01 00 00 80 DD AE B5 DD B6 B4 28 15 3E 40 +T 55 02 00 00 80 DD AE B5 DD B6 B4 28 15 3E 40 R 00 00 01 00 -T E7 01 00 00 DD AE B5 DD B6 B4 28 0B 3E 90 DD +T 60 02 00 00 DD AE B5 DD B6 B4 28 0B 3E 90 DD R 00 00 01 00 -T F2 01 00 00 AE B5 DD B6 B4 C2 F8 04 00 00 +T 6B 02 00 00 AE B5 DD B6 B4 C2 BC 05 00 00 R 00 00 01 00 00 0A 01 00 -T FA 01 00 00 +T 73 02 00 00 R 00 00 01 00 -T FA 01 00 00 +T 73 02 00 00 R 00 00 01 00 -T FA 01 00 00 +T 73 02 00 00 R 00 00 01 00 -T FA 01 00 00 DD 36 B8 12 DD 36 B9 00 +T 73 02 00 00 DD 36 B8 12 DD 36 B9 00 R 00 00 01 00 -T 02 02 00 00 +T 7B 02 00 00 R 00 00 01 00 -T 02 02 00 00 DD 4E B8 DD 46 B9 21 13 00 A7 ED +T 7B 02 00 00 DD 4E B8 DD 46 B9 21 13 00 A7 ED R 00 00 01 00 -T 0D 02 00 00 42 DA 3D 03 00 00 +T 86 02 00 00 42 DA D4 03 00 00 R 00 00 01 00 00 06 01 00 -T 11 02 00 00 +T 8A 02 00 00 R 00 00 01 00 -T 11 02 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 +T 8A 02 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 R 00 00 01 00 -T 1C 02 00 00 39 01 18 00 09 4D 44 E1 09 46 23 +T 95 02 00 00 39 01 18 00 09 4D 44 E1 09 46 23 R 00 00 01 00 -T 27 02 00 00 66 68 DD 75 BC DD 74 BD 7D B4 28 +T A0 02 00 00 66 68 DD 75 BC DD 74 BD 7D B4 28 R 00 00 01 00 -T 32 02 00 00 6C ED 4B 26 04 00 00 DD 6E BC DD +T AB 02 00 00 7B ED 4B 26 04 00 00 DD 6E BC DD R 00 00 01 00 00 07 03 00 -T 3B 02 00 00 66 BD A7 ED 42 38 0F ED 4B +T B4 02 00 00 66 BD A7 ED 42 38 0F ED 4B R 00 00 01 00 -T 44 02 00 00 0C 04 00 00 DD 6E BC DD 66 BD A7 +T BD 02 00 00 0C 04 00 00 DD 6E BC DD 66 BD A7 R 00 00 01 00 00 04 03 00 -T 4D 02 00 00 ED 42 38 4E +T C6 02 00 00 ED 42 38 5D R 00 00 01 00 -T 51 02 00 00 +T CA 02 00 00 R 00 00 01 00 -T 51 02 00 00 +T CA 02 00 00 R 00 00 01 00 -T 51 02 00 00 +T CA 02 00 00 R 00 00 01 00 -T 51 02 00 00 +T CA 02 00 00 R 00 00 01 00 -T 51 02 00 00 +T CA 02 00 00 R 00 00 01 00 -T 51 02 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD +T CA 02 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD R 00 00 01 00 -T 5C 02 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 +T D5 02 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 R 00 00 01 00 -T 67 02 00 00 5D 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 6E 02 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T 77 02 00 00 27 +T E0 02 00 00 5D 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T E6 02 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T ED 02 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T F2 02 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T F9 02 00 00 28 2C R 00 00 01 00 -T 78 02 00 00 +T FB 02 00 00 R 00 00 01 00 -T 78 02 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 +T FB 02 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 R 00 00 01 00 -T 83 02 00 00 39 01 18 00 09 4D 44 E1 09 AF 77 +T 06 03 00 00 39 01 18 00 09 4D 44 E1 09 AF 77 R 00 00 01 00 -T 8E 02 00 00 23 77 21 0E 00 39 4D 44 DD 5E B2 +T 11 03 00 00 23 77 21 0E 00 39 4D 44 DD 5E B2 R 00 00 01 00 -T 99 02 00 00 DD 56 B3 CD F9 14 00 00 -R 00 00 01 00 00 08 01 00 -T 9F 02 00 00 +T 1C 03 00 00 DD 56 B3 3E D9 17 00 00 21 +R 00 00 01 00 29 08 01 00 +T 22 03 00 00 D9 17 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 27 03 00 00 R 00 00 01 00 -T 9F 02 00 00 +T 27 03 00 00 R 00 00 01 00 -T 9F 02 00 00 DD 7E BC DD B6 BD 28 67 21 16 00 +T 27 03 00 00 DD 7E BC DD B6 BD 28 76 21 16 00 R 00 00 01 00 -T AA 02 00 00 39 5E 23 56 23 4E 23 46 EB 3E 09 +T 32 03 00 00 39 5E 23 56 23 4E 23 46 EB 3E 09 R 00 00 01 00 -T B5 02 00 00 CD 00 00 00 00 01 12 00 A7 ED 42 -R 00 00 01 00 02 05 1E 00 -T BE 02 00 00 30 4E +T 3D 03 00 00 CD 00 00 00 00 01 12 00 A7 ED 42 +R 00 00 01 00 02 05 20 00 +T 46 03 00 00 30 5D R 00 00 01 00 -T C0 02 00 00 +T 48 03 00 00 R 00 00 01 00 -T C0 02 00 00 +T 48 03 00 00 R 00 00 01 00 -T C0 02 00 00 +T 48 03 00 00 R 00 00 01 00 -T C0 02 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD +T 48 03 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD R 00 00 01 00 -T CB 02 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 +T 53 03 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 R 00 00 01 00 -T D6 02 00 00 A7 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T DD 02 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T E6 02 00 00 27 +T 5E 03 00 00 A7 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 64 03 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 6B 03 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 70 03 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 77 03 00 00 28 2C R 00 00 01 00 -T E7 02 00 00 +T 79 03 00 00 R 00 00 01 00 -T E7 02 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 +T 79 03 00 00 DD 6E B8 DD 66 B9 29 E5 21 10 00 R 00 00 01 00 -T F2 02 00 00 39 01 18 00 09 4D 44 E1 09 AF 77 +T 84 03 00 00 39 01 18 00 09 4D 44 E1 09 AF 77 R 00 00 01 00 -T FD 02 00 00 23 77 21 0E 00 39 4D 44 DD 5E B2 +T 8F 03 00 00 23 77 21 0E 00 39 4D 44 DD 5E B2 R 00 00 01 00 -T 08 03 00 00 DD 56 B3 CD F9 14 00 00 -R 00 00 01 00 00 08 01 00 -T 0E 03 00 00 +T 9A 03 00 00 DD 56 B3 3E D9 17 00 00 21 +R 00 00 01 00 29 08 01 00 +T A0 03 00 00 D9 17 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T A5 03 00 00 R 00 00 01 00 -T 0E 03 00 00 +T A5 03 00 00 R 00 00 01 00 -T 0E 03 00 00 DD 7E BC DD B6 BD 28 1C +T A5 03 00 00 DD 7E BC DD B6 BD 28 1C R 00 00 01 00 -T 16 03 00 00 +T AD 03 00 00 R 00 00 01 00 -T 16 03 00 00 06 03 DD 5E BC DD 56 BD CD +T AD 03 00 00 06 03 DD 5E BC DD 56 BD CD R 00 00 01 00 -T 1F 03 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T B6 03 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 26 03 00 00 7E BC E6 07 47 3E 01 CD +T BD 03 00 00 7E BC E6 07 47 3E 01 CD R 00 00 01 00 -T 2E 03 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T 32 03 00 00 +T C5 03 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T C9 03 00 00 R 00 00 01 00 -T 32 03 00 00 DD 34 B8 20 03 DD 34 B9 +T C9 03 00 00 DD 34 B8 20 03 DD 34 B9 R 00 00 01 00 -T 3A 03 00 00 +T D1 03 00 00 R 00 00 01 00 -T 3A 03 00 00 C3 02 02 00 00 +T D1 03 00 00 C3 7B 02 00 00 R 00 00 01 00 00 05 01 00 -T 3D 03 00 00 +T D4 03 00 00 R 00 00 01 00 -T 3D 03 00 00 DD 6E FE DD 66 FF 7D B4 CA +T D4 03 00 00 DD 6E FE DD 66 FF 7D B4 CA R 00 00 01 00 -T 46 03 00 00 18 04 00 00 +T DD 03 00 00 C3 04 00 00 R 00 00 01 00 00 04 01 00 -T 48 03 00 00 +T DF 03 00 00 R 00 00 01 00 -T 48 03 00 00 DD 5E FE DD 56 FF CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 51 03 00 00 DD 75 BE DD 74 BF AF DD 77 B8 DD +T DF 03 00 00 DD 5E FE DD 56 FF 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T E7 03 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T EE 03 00 00 75 BE DD 74 BF AF DD 77 B8 DD 77 R 00 00 01 00 -T 5C 03 00 00 77 B9 +T F9 03 00 00 B9 R 00 00 01 00 -T 5E 03 00 00 +T FA 03 00 00 R 00 00 01 00 -T 5E 03 00 00 01 00 01 DD 6E B8 DD 66 B9 A7 ED +T FA 03 00 00 01 00 01 DD 6E B8 DD 66 B9 A7 ED R 00 00 01 00 -T 69 03 00 00 42 D2 18 04 00 00 +T 05 04 00 00 42 D2 C3 04 00 00 R 00 00 01 00 00 06 01 00 -T 6D 03 00 00 +T 09 04 00 00 R 00 00 01 00 -T 6D 03 00 00 DD 6E B2 DD 66 B3 29 DD 4E BE DD +T 09 04 00 00 DD 6E B2 DD 66 B3 29 DD 4E BE DD R 00 00 01 00 -T 78 03 00 00 46 BF 09 46 23 66 68 DD 75 BC DD +T 14 04 00 00 46 BF 09 46 23 66 68 DD 75 BC DD R 00 00 01 00 -T 83 03 00 00 74 BD 7D B4 28 60 ED 4B +T 1F 04 00 00 74 BD 7D B4 28 6F ED 4B R 00 00 01 00 -T 8B 03 00 00 26 04 00 00 DD 6E BC DD 66 BD A7 +T 27 04 00 00 26 04 00 00 DD 6E BC DD 66 BD A7 R 00 00 01 00 00 04 03 00 -T 94 03 00 00 ED 42 38 0F ED 4B 0C 04 00 00 DD +T 30 04 00 00 ED 42 38 0F ED 4B 0C 04 00 00 DD R 00 00 01 00 00 0A 03 00 -T 9D 03 00 00 6E BC DD 66 BD A7 ED 42 38 42 +T 39 04 00 00 6E BC DD 66 BD A7 ED 42 38 51 R 00 00 01 00 -T A7 03 00 00 +T 43 04 00 00 R 00 00 01 00 -T A7 03 00 00 +T 43 04 00 00 R 00 00 01 00 -T A7 03 00 00 +T 43 04 00 00 R 00 00 01 00 -T A7 03 00 00 +T 43 04 00 00 R 00 00 01 00 -T A7 03 00 00 +T 43 04 00 00 R 00 00 01 00 -T A7 03 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD +T 43 04 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD R 00 00 01 00 -T B2 03 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 +T 4E 04 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 R 00 00 01 00 -T BD 03 00 00 F5 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T C4 03 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T CD 03 00 00 1B +T 59 04 00 00 F5 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 5F 04 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 66 04 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 6B 04 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 72 04 00 00 28 20 R 00 00 01 00 -T CE 03 00 00 +T 74 04 00 00 R 00 00 01 00 -T CE 03 00 00 DD 6E B8 DD 66 B9 29 DD 4E BE DD +T 74 04 00 00 DD 6E B8 DD 66 B9 29 DD 4E BE DD R 00 00 01 00 -T D9 03 00 00 46 BF 09 AF 77 23 77 DD 5E B8 DD +T 7F 04 00 00 46 BF 09 AF 77 23 77 DD 5E B8 DD R 00 00 01 00 -T E4 03 00 00 56 B9 CD 8B 14 00 00 -R 00 00 01 00 00 07 01 00 -T E9 03 00 00 +T 8A 04 00 00 56 B9 3E 52 17 00 00 21 +R 00 00 01 00 29 07 01 00 +T 8F 04 00 00 52 17 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 94 04 00 00 R 00 00 01 00 -T E9 03 00 00 +T 94 04 00 00 R 00 00 01 00 -T E9 03 00 00 DD 7E BC DD B6 BD 28 1C +T 94 04 00 00 DD 7E BC DD B6 BD 28 1C R 00 00 01 00 -T F1 03 00 00 +T 9C 04 00 00 R 00 00 01 00 -T F1 03 00 00 06 03 DD 5E BC DD 56 BD CD +T 9C 04 00 00 06 03 DD 5E BC DD 56 BD CD R 00 00 01 00 -T FA 03 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T A5 04 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 01 04 00 00 7E BC E6 07 47 3E 01 CD +T AC 04 00 00 7E BC E6 07 47 3E 01 CD R 00 00 01 00 -T 09 04 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T 0D 04 00 00 +T B4 04 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T B8 04 00 00 R 00 00 01 00 -T 0D 04 00 00 DD 34 B8 20 03 DD 34 B9 +T B8 04 00 00 DD 34 B8 20 03 DD 34 B9 R 00 00 01 00 -T 15 04 00 00 +T C0 04 00 00 R 00 00 01 00 -T 15 04 00 00 C3 5E 03 00 00 +T C0 04 00 00 C3 FA 03 00 00 R 00 00 01 00 00 05 01 00 -T 18 04 00 00 +T C3 04 00 00 R 00 00 01 00 -T 18 04 00 00 +T C3 04 00 00 R 00 00 01 00 -T 18 04 00 00 AF DD 77 B8 DD 77 B9 21 16 00 39 +T C3 04 00 00 AF DD 77 B8 DD 77 B9 21 16 00 39 R 00 00 01 00 -T 23 04 00 00 5E 23 56 23 4E 23 46 EB 3E 09 CD +T CE 04 00 00 5E 23 56 23 4E 23 46 EB 3E 09 CD R 00 00 01 00 -T 2E 04 00 00 00 00 00 00 DD 75 BA DD 74 BB -R 00 00 01 00 02 04 1E 00 -T 36 04 00 00 +T D9 04 00 00 00 00 00 00 DD 75 BA DD 74 BB +R 00 00 01 00 02 04 20 00 +T E1 04 00 00 R 00 00 01 00 -T 36 04 00 00 DD 4E B8 DD 46 B9 DD 6E BA DD 66 +T E1 04 00 00 DD 4E B8 DD 46 B9 DD 6E BA DD 66 R 00 00 01 00 -T 41 04 00 00 BB A7 ED 42 DA F8 04 00 00 +T EC 04 00 00 BB A7 ED 42 DA BC 05 00 00 R 00 00 01 00 00 09 01 00 -T 48 04 00 00 +T F3 04 00 00 R 00 00 01 00 -T 48 04 00 00 DD 4E B8 DD 46 B9 21 0E 00 39 5D +T F3 04 00 00 DD 4E B8 DD 46 B9 21 0E 00 39 5D R 00 00 01 00 -T 53 04 00 00 54 CD 88 11 00 00 DD 75 BC DD 74 -R 00 00 01 00 00 06 01 00 -T 5C 04 00 00 BD 7D B4 28 68 ED 4B 26 04 00 00 -R 00 00 01 00 00 0B 03 00 -T 65 04 00 00 DD 6E BC DD 66 BD A7 ED 42 38 0F +T FE 04 00 00 54 3E EF 13 00 00 21 EF 13 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 04 05 00 00 CD 00 00 00 00 DD 75 BC DD 74 BD +R 00 00 01 00 02 05 14 00 +T 0D 05 00 00 7D B4 28 7C ED 4B 26 04 00 00 DD +R 00 00 01 00 00 0A 03 00 +T 16 05 00 00 6E BC DD 66 BD A7 ED 42 38 0F ED R 00 00 01 00 -T 70 04 00 00 ED 4B 0C 04 00 00 DD 6E BC DD 66 -R 00 00 01 00 00 06 03 00 -T 79 04 00 00 BD A7 ED 42 38 4A +T 21 05 00 00 4B 0C 04 00 00 DD 6E BC DD 66 BD +R 00 00 01 00 00 05 03 00 +T 2A 05 00 00 A7 ED 42 38 5E R 00 00 01 00 -T 7F 04 00 00 +T 2F 05 00 00 R 00 00 01 00 -T 7F 04 00 00 +T 2F 05 00 00 R 00 00 01 00 -T 7F 04 00 00 +T 2F 05 00 00 R 00 00 01 00 -T 7F 04 00 00 +T 2F 05 00 00 R 00 00 01 00 -T 7F 04 00 00 +T 2F 05 00 00 R 00 00 01 00 -T 7F 04 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD +T 2F 05 00 00 DD 6E BC DD 66 BD E5 DD 6E B8 DD R 00 00 01 00 -T 8A 04 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 +T 3A 05 00 00 66 B9 E5 DD 6E B2 DD 66 B3 E5 21 R 00 00 01 00 -T 95 04 00 00 3F 01 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 9C 04 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T A5 04 00 00 23 +T 45 05 00 00 3F 01 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 4B 05 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 52 05 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 57 05 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 5E 05 00 00 28 2D R 00 00 01 00 -T A6 04 00 00 +T 60 05 00 00 R 00 00 01 00 -T A6 04 00 00 21 00 00 E5 DD 4E B8 DD 46 B9 21 +T 60 05 00 00 21 00 00 E5 DD 4E B8 DD 46 B9 21 R 00 00 01 00 -T B1 04 00 00 10 00 39 5D 54 CD 75 12 00 00 E1 -R 00 00 01 00 00 0A 01 00 -T BA 04 00 00 21 0E 00 39 4D 44 DD 5E B2 DD 56 +T 6B 05 00 00 10 00 39 5D 54 3E EB 14 00 00 21 +R 00 00 01 00 29 0A 01 00 +T 73 05 00 00 EB 14 00 00 CD 00 00 00 00 E1 21 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 7A 05 00 00 0E 00 39 4D 44 DD 5E B2 DD 56 B3 R 00 00 01 00 -T C5 04 00 00 B3 CD F9 14 00 00 -R 00 00 01 00 00 06 01 00 -T C9 04 00 00 +T 85 05 00 00 3E D9 17 00 00 21 D9 17 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 8B 05 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 8D 05 00 00 R 00 00 01 00 -T C9 04 00 00 +T 8D 05 00 00 R 00 00 01 00 -T C9 04 00 00 DD 7E BC DD B6 BD 28 1C +T 8D 05 00 00 DD 7E BC DD B6 BD 28 1C R 00 00 01 00 -T D1 04 00 00 +T 95 05 00 00 R 00 00 01 00 -T D1 04 00 00 06 03 DD 5E BC DD 56 BD CD +T 95 05 00 00 06 03 DD 5E BC DD 56 BD CD R 00 00 01 00 -T DA 04 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 9E 05 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T E1 04 00 00 7E BC E6 07 47 3E 01 CD +T A5 05 00 00 7E BC E6 07 47 3E 01 CD R 00 00 01 00 -T E9 04 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T ED 04 00 00 +T AD 05 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T B1 05 00 00 R 00 00 01 00 -T ED 04 00 00 DD 34 B8 20 03 DD 34 B9 +T B1 05 00 00 DD 34 B8 20 03 DD 34 B9 R 00 00 01 00 -T F5 04 00 00 +T B9 05 00 00 R 00 00 01 00 -T F5 04 00 00 C3 36 04 00 00 +T B9 05 00 00 C3 E1 04 00 00 R 00 00 01 00 00 05 01 00 -T F8 04 00 00 +T BC 05 00 00 R 00 00 01 00 -T F8 04 00 00 +T BC 05 00 00 R 00 00 01 00 -T F8 04 00 00 +T BC 05 00 00 R 00 00 01 00 -T F8 04 00 00 DD 34 B2 20 03 DD 34 B3 +T BC 05 00 00 DD 34 B2 20 03 DD 34 B3 R 00 00 01 00 -T 00 05 00 00 +T C4 05 00 00 R 00 00 01 00 -T 00 05 00 00 C3 FA 00 00 00 +T C4 05 00 00 C3 5E 01 00 00 R 00 00 01 00 00 05 01 00 -T 03 05 00 00 +T C7 05 00 00 R 00 00 01 00 -T 03 05 00 00 DD 4E B6 DD 46 B7 2A 24 04 00 00 +T C7 05 00 00 DD 4E B6 DD 46 B7 2A 24 04 00 00 R 00 00 01 00 00 0B 03 00 -T 0C 05 00 00 A7 ED 42 01 FF FF 09 DD 75 B8 DD +T D0 05 00 00 A7 ED 42 01 FF FF 09 DD 75 B8 DD R 00 00 01 00 -T 17 05 00 00 74 B9 ED 4B 10 04 00 00 A7 ED 42 +T DB 05 00 00 74 B9 ED 4B 10 04 00 00 A7 ED 42 R 00 00 01 00 00 08 03 00 -T 20 05 00 00 28 31 +T E4 05 00 00 28 40 R 00 00 01 00 -T 22 05 00 00 +T E6 05 00 00 R 00 00 01 00 -T 22 05 00 00 DD 6E B8 DD 66 B9 E5 21 +T E6 05 00 00 DD 6E B8 DD 66 B9 E5 21 R 00 00 01 00 -T 2A 05 00 00 10 04 00 00 4E 23 46 C5 21 +T EE 05 00 00 10 04 00 00 4E 23 46 C5 21 R 00 00 01 00 00 04 03 00 -T 31 05 00 00 79 01 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 38 05 00 00 F1 F1 CD 28 16 00 00 7D B4 28 12 -R 00 00 01 00 00 07 01 00 -T 41 05 00 00 -R 00 00 01 00 -T 41 05 00 00 DD 6E B8 DD 66 B9 22 10 04 00 00 +T F5 05 00 00 79 01 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T FB 05 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 02 06 00 00 F1 3E 44 19 00 00 21 44 19 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 08 06 00 00 CD 00 00 00 00 7D B4 28 17 +R 00 00 01 00 02 05 14 00 +T 0F 06 00 00 +R 00 00 01 00 +T 0F 06 00 00 DD 6E B8 DD 66 B9 22 10 04 00 00 R 00 00 01 00 00 0B 03 00 -T 4A 05 00 00 01 06 04 00 00 11 01 00 CD +T 18 06 00 00 01 06 04 00 00 11 01 00 3E R 00 00 01 00 00 05 03 00 -T 51 05 00 00 8B 14 00 00 -R 00 00 01 00 00 04 01 00 -T 53 05 00 00 +T 1F 06 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 24 06 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 26 06 00 00 R 00 00 01 00 -T 53 05 00 00 +T 26 06 00 00 R 00 00 01 00 -T 53 05 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 56 05 00 00 +T 26 06 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 29 06 00 00 R 00 00 01 00 -T 56 05 00 00 CD 00 00 00 00 F0 FF 2A -R 00 00 01 00 02 05 18 00 -T 5C 05 00 00 0E 04 00 00 DD 75 F6 DD 74 F7 2A +T 29 06 00 00 CD 00 00 00 00 F0 FF 2A +R 00 00 01 00 02 05 19 00 +T 2F 06 00 00 0E 04 00 00 DD 75 F6 DD 74 F7 2A R 00 00 01 00 00 04 03 00 -T 65 05 00 00 10 04 00 00 DD 75 F8 DD 74 F9 21 +T 38 06 00 00 10 04 00 00 DD 75 F8 DD 74 F9 21 R 00 00 01 00 00 04 03 00 -T 6E 05 00 00 B3 01 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 75 05 00 00 CD 28 16 00 00 7D B4 20 03 -R 00 00 01 00 00 05 01 00 -T 7C 05 00 00 -R 00 00 01 00 -T 7C 05 00 00 C3 CD 07 00 00 +T 41 06 00 00 B3 01 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 47 06 00 00 00 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 4E 06 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 53 06 00 00 00 00 00 00 7D B4 20 03 +R 00 00 01 00 02 04 14 00 +T 59 06 00 00 +R 00 00 01 00 +T 59 06 00 00 C3 CD 08 00 00 R 00 00 01 00 00 05 01 00 -T 7F 05 00 00 +T 5C 06 00 00 R 00 00 01 00 -T 7F 05 00 00 2A 16 04 00 00 DD 75 FA DD 74 FB +T 5C 06 00 00 2A 16 04 00 00 DD 75 FA DD 74 FB R 00 00 01 00 00 05 03 00 -T 88 05 00 00 2A 18 04 00 00 DD 75 FC DD 74 FD +T 65 06 00 00 2A 18 04 00 00 DD 75 FC DD 74 FD R 00 00 01 00 00 05 03 00 -T 91 05 00 00 2A 1A 04 00 00 DD 75 FE DD 74 FF +T 6E 06 00 00 2A 1A 04 00 00 DD 75 FE DD 74 FF R 00 00 01 00 00 05 03 00 -T 9A 05 00 00 AF DD 77 F2 DD 77 F3 +T 77 06 00 00 AF DD 77 F2 DD 77 F3 R 00 00 01 00 -T A1 05 00 00 +T 7E 06 00 00 R 00 00 01 00 -T A1 05 00 00 2A 0A 04 00 00 ED 4B 26 04 00 00 +T 7E 06 00 00 2A 0A 04 00 00 ED 4B 26 04 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T A8 05 00 00 09 4D 44 DD 6E F2 DD 66 F3 A7 ED +T 85 06 00 00 09 4D 44 DD 6E F2 DD 66 F3 A7 ED R 00 00 01 00 -T B3 05 00 00 42 30 26 +T 90 06 00 00 42 30 26 R 00 00 01 00 -T B6 05 00 00 +T 93 06 00 00 R 00 00 01 00 -T B6 05 00 00 06 03 DD 5E F2 DD 56 F3 CD +T 93 06 00 00 06 03 DD 5E F2 DD 56 F3 CD R 00 00 01 00 -T BF 05 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 9C 06 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T C6 05 00 00 7E F2 E6 07 47 3E 01 CD +T A3 06 00 00 7E F2 E6 07 47 3E 01 CD R 00 00 01 00 -T CE 05 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 -R 00 00 01 00 02 04 1D 00 -T D7 05 00 00 DD 34 F3 +T AB 06 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 +R 00 00 01 00 02 04 1E 00 +T B4 06 00 00 DD 34 F3 R 00 00 01 00 -T DA 05 00 00 +T B7 06 00 00 R 00 00 01 00 -T DA 05 00 00 18 C5 +T B7 06 00 00 18 C5 R 00 00 01 00 -T DC 05 00 00 +T B9 06 00 00 R 00 00 01 00 -T DC 05 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 +T B9 06 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 R 00 00 01 00 -T E7 05 00 00 FF A7 ED 42 29 29 29 DD 75 F4 DD +T C4 06 00 00 FF A7 ED 42 29 29 29 DD 75 F4 DD R 00 00 01 00 -T F2 05 00 00 74 F5 2A 0C 04 00 00 DD 75 F2 DD +T CF 06 00 00 74 F5 2A 0C 04 00 00 DD 75 F2 DD R 00 00 01 00 00 07 03 00 -T FB 05 00 00 74 F3 +T D8 06 00 00 74 F3 R 00 00 01 00 -T FD 05 00 00 +T DA 06 00 00 R 00 00 01 00 -T FD 05 00 00 DD 6E F4 DD 66 F5 DD 4E F2 DD 46 +T DA 06 00 00 DD 6E F4 DD 66 F5 DD 4E F2 DD 46 R 00 00 01 00 -T 08 06 00 00 F3 A7 ED 42 28 26 +T E5 06 00 00 F3 A7 ED 42 28 26 R 00 00 01 00 -T 0E 06 00 00 +T EB 06 00 00 R 00 00 01 00 -T 0E 06 00 00 06 03 DD 5E F2 DD 56 F3 CD +T EB 06 00 00 06 03 DD 5E F2 DD 56 F3 CD R 00 00 01 00 -T 17 06 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T F4 06 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 1E 06 00 00 7E F2 E6 07 47 3E 01 CD +T FB 06 00 00 7E F2 E6 07 47 3E 01 CD R 00 00 01 00 -T 26 06 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 -R 00 00 01 00 02 04 1D 00 -T 2F 06 00 00 DD 34 F3 +T 03 07 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 +R 00 00 01 00 02 04 1E 00 +T 0C 07 00 00 DD 34 F3 R 00 00 01 00 -T 32 06 00 00 +T 0F 07 00 00 R 00 00 01 00 -T 32 06 00 00 18 C9 +T 0F 07 00 00 18 C9 R 00 00 01 00 -T 34 06 00 00 +T 11 07 00 00 R 00 00 01 00 -T 34 06 00 00 21 00 00 22 0E 04 00 00 2A +T 11 07 00 00 21 00 00 22 0E 04 00 00 2A R 00 00 01 00 00 08 03 00 -T 3B 06 00 00 0A 04 00 00 ED 4B 26 04 00 00 09 +T 18 07 00 00 0A 04 00 00 ED 4B 26 04 00 00 09 R 00 00 01 00 00 04 03 00 00 0A 03 00 -T 42 06 00 00 DD 75 F2 DD 74 F3 +T 1F 07 00 00 DD 75 F2 DD 74 F3 R 00 00 01 00 -T 48 06 00 00 +T 25 07 00 00 R 00 00 01 00 -T 48 06 00 00 ED 4B 0C 04 00 00 DD 6E F2 DD 66 +T 25 07 00 00 ED 4B 0C 04 00 00 DD 6E F2 DD 66 R 00 00 01 00 00 06 03 00 -T 51 06 00 00 F3 A7 ED 42 30 2E +T 2E 07 00 00 F3 A7 ED 42 30 2E R 00 00 01 00 -T 57 06 00 00 +T 34 07 00 00 R 00 00 01 00 -T 57 06 00 00 06 03 DD 5E F2 DD 56 F3 CD +T 34 07 00 00 06 03 DD 5E F2 DD 56 F3 CD R 00 00 01 00 -T 60 06 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 3D 07 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 67 06 00 00 7E F2 E6 07 47 3E 01 CD +T 44 07 00 00 7E F2 E6 07 47 3E 01 CD R 00 00 01 00 -T 6F 06 00 00 00 00 00 00 A6 20 07 -R 00 00 01 00 02 04 1D 00 -T 74 06 00 00 +T 4C 07 00 00 00 00 00 00 A6 20 07 +R 00 00 01 00 02 04 1E 00 +T 51 07 00 00 R 00 00 01 00 -T 74 06 00 00 2A 0E 04 00 00 23 22 0E 04 00 00 +T 51 07 00 00 2A 0E 04 00 00 23 22 0E 04 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T 7B 06 00 00 +T 58 07 00 00 R 00 00 01 00 -T 7B 06 00 00 DD 34 F2 20 03 DD 34 F3 +T 58 07 00 00 DD 34 F2 20 03 DD 34 F3 R 00 00 01 00 -T 83 06 00 00 +T 60 07 00 00 R 00 00 01 00 -T 83 06 00 00 18 C3 +T 60 07 00 00 18 C3 R 00 00 01 00 -T 85 06 00 00 +T 62 07 00 00 R 00 00 01 00 -T 85 06 00 00 DD 6E FE DD 66 FF 01 00 00 C5 E5 +T 62 07 00 00 DD 6E FE DD 66 FF 01 00 00 C5 E5 R 00 00 01 00 -T 90 06 00 00 DD 6E FC DD 66 FD 01 00 00 C5 E5 +T 6D 07 00 00 DD 6E FC DD 66 FD 01 00 00 C5 E5 R 00 00 01 00 -T 9B 06 00 00 ED 5B 36 04 00 00 CD 27 19 00 00 -R 00 00 01 00 00 06 03 00 00 0B 01 00 -T A2 06 00 00 E1 E1 E1 E1 2A 34 04 00 00 7E F6 -R 00 00 01 00 00 09 03 00 -T AB 06 00 00 01 77 2A 34 04 00 00 7E F6 02 77 -R 00 00 01 00 00 07 03 00 -T B4 06 00 00 DD 36 F2 02 DD 36 F3 00 +T 78 07 00 00 ED 5B 36 04 00 00 3E 39 1D 00 00 +R 00 00 01 00 00 06 03 00 29 0B 01 00 +T 7E 07 00 00 21 39 1D 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 85 07 00 00 E1 E1 E1 2A 34 04 00 00 7E F6 01 +R 00 00 01 00 00 08 03 00 +T 8E 07 00 00 77 2A 34 04 00 00 7E F6 02 77 DD +R 00 00 01 00 00 06 03 00 +T 97 07 00 00 36 F2 02 DD 36 F3 00 R 00 00 01 00 -T BC 06 00 00 +T 9E 07 00 00 R 00 00 01 00 -T BC 06 00 00 ED 4B 24 04 00 00 DD 6E F2 DD 66 +T 9E 07 00 00 ED 4B 24 04 00 00 DD 6E F2 DD 66 R 00 00 01 00 00 06 03 00 -T C5 06 00 00 F3 A7 ED 42 30 35 +T A7 07 00 00 F3 A7 ED 42 30 35 R 00 00 01 00 -T CB 06 00 00 +T AD 07 00 00 R 00 00 01 00 -T CB 06 00 00 DD 6E F2 DD 66 F3 ED 4B +T AD 07 00 00 DD 6E F2 DD 66 F3 ED 4B R 00 00 01 00 -T D3 06 00 00 38 04 00 00 09 46 04 28 1C +T B5 07 00 00 38 04 00 00 09 46 04 28 1C R 00 00 01 00 00 04 03 00 -T DA 06 00 00 +T BC 07 00 00 R 00 00 01 00 -T DA 06 00 00 06 03 DD 5E F2 DD 56 F3 CD +T BC 07 00 00 06 03 DD 5E F2 DD 56 F3 CD R 00 00 01 00 -T E3 06 00 00 00 00 00 00 2A 34 04 00 00 19 DD +T C5 07 00 00 00 00 00 00 2A 34 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T EA 06 00 00 7E F2 E6 07 47 3E 01 CD +T CC 07 00 00 7E F2 E6 07 47 3E 01 CD R 00 00 01 00 -T F2 06 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T F6 06 00 00 +T D4 07 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T D8 07 00 00 R 00 00 01 00 -T F6 06 00 00 DD 34 F2 20 03 DD 34 F3 +T D8 07 00 00 DD 34 F2 20 03 DD 34 F3 R 00 00 01 00 -T FE 06 00 00 +T E0 07 00 00 R 00 00 01 00 -T FE 06 00 00 18 BC +T E0 07 00 00 18 BC R 00 00 01 00 -T 00 07 00 00 +T E2 07 00 00 R 00 00 01 00 -T 00 07 00 00 DD 4E FA DD 46 FB DD 6E FC DD 66 +T E2 07 00 00 DD 4E FA DD 46 FB DD 6E FC DD 66 R 00 00 01 00 -T 0B 07 00 00 FD A7 ED 42 29 29 29 DD 75 F4 DD +T ED 07 00 00 FD A7 ED 42 29 29 29 DD 75 F4 DD R 00 00 01 00 -T 16 07 00 00 74 F5 2A 0A 04 00 00 29 29 29 DD +T F8 07 00 00 74 F5 2A 0A 04 00 00 29 29 29 DD R 00 00 01 00 00 07 03 00 -T 1F 07 00 00 75 F2 DD 74 F3 +T 01 08 00 00 75 F2 DD 74 F3 R 00 00 01 00 -T 24 07 00 00 +T 06 08 00 00 R 00 00 01 00 -T 24 07 00 00 DD 6E F4 DD 66 F5 DD 4E F2 DD 46 +T 06 08 00 00 DD 6E F4 DD 66 F5 DD 4E F2 DD 46 R 00 00 01 00 -T 2F 07 00 00 F3 A7 ED 42 28 26 +T 11 08 00 00 F3 A7 ED 42 28 26 R 00 00 01 00 -T 35 07 00 00 +T 17 08 00 00 R 00 00 01 00 -T 35 07 00 00 06 03 DD 5E F2 DD 56 F3 CD +T 17 08 00 00 06 03 DD 5E F2 DD 56 F3 CD R 00 00 01 00 -T 3E 07 00 00 00 00 00 00 2A 34 04 00 00 19 DD +T 20 08 00 00 00 00 00 00 2A 34 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 45 07 00 00 7E F2 E6 07 47 3E 01 CD +T 27 08 00 00 7E F2 E6 07 47 3E 01 CD R 00 00 01 00 -T 4D 07 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 -R 00 00 01 00 02 04 1D 00 -T 56 07 00 00 DD 34 F3 +T 2F 08 00 00 00 00 00 00 B6 77 DD 34 F2 20 03 +R 00 00 01 00 02 04 1E 00 +T 38 08 00 00 DD 34 F3 R 00 00 01 00 -T 59 07 00 00 +T 3B 08 00 00 R 00 00 01 00 -T 59 07 00 00 18 C9 +T 3B 08 00 00 18 C9 R 00 00 01 00 -T 5B 07 00 00 +T 3D 08 00 00 R 00 00 01 00 -T 5B 07 00 00 DD 6E FC DD 66 FD 01 00 00 C5 E5 +T 3D 08 00 00 DD 6E FC DD 66 FD 01 00 00 C5 E5 R 00 00 01 00 -T 66 07 00 00 DD 6E FA DD 66 FB 01 00 00 C5 E5 +T 48 08 00 00 DD 6E FA DD 66 FB 01 00 00 C5 E5 R 00 00 01 00 -T 71 07 00 00 ED 5B 34 04 00 00 CD 27 19 00 00 -R 00 00 01 00 00 06 03 00 00 0B 01 00 -T 78 07 00 00 E1 E1 E1 E1 11 04 00 CD +T 53 08 00 00 ED 5B 34 04 00 00 3E 39 1D 00 00 +R 00 00 01 00 00 06 03 00 29 0B 01 00 +T 59 08 00 00 21 39 1D 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 60 08 00 00 E1 E1 E1 11 04 00 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 68 08 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 6F 08 00 00 75 F0 DD 74 F1 01 1E 00 C5 4D 44 R 00 00 01 00 -T 80 07 00 00 5B 14 00 00 DD 75 F0 DD 74 F1 01 -R 00 00 01 00 00 04 01 00 -T 89 07 00 00 1E 00 C5 4D 44 11 06 04 00 00 CD -R 00 00 01 00 00 0A 03 00 -T 92 07 00 00 00 00 00 00 E1 DD 4E F0 DD 46 F1 -R 00 00 01 00 02 04 11 00 -T 9B 07 00 00 11 04 00 CD 8B 14 00 00 2A -R 00 00 01 00 00 08 01 00 -T A2 07 00 00 0E 04 00 00 DD 4E F6 DD 46 F7 A7 -R 00 00 01 00 00 04 03 00 -T AB 07 00 00 ED 42 28 1E +T 7A 08 00 00 11 06 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 03 00 2B 0A 11 00 +T 80 08 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T 87 08 00 00 4E F0 DD 46 F1 11 04 00 3E R 00 00 01 00 -T AF 07 00 00 +T 90 08 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 95 08 00 00 00 00 00 00 2A 0E 04 00 00 DD 4E +R 00 00 01 00 02 04 14 00 00 09 03 00 +T 9C 08 00 00 F6 DD 46 F7 A7 ED 42 28 28 R 00 00 01 00 -T AF 07 00 00 DD 6E F6 DD 66 F7 E5 21 +T A5 08 00 00 R 00 00 01 00 -T B7 07 00 00 0E 04 00 00 4E 23 46 C5 21 +T A5 08 00 00 DD 6E F6 DD 66 F7 E5 21 +R 00 00 01 00 +T AD 08 00 00 0E 04 00 00 4E 23 46 C5 21 R 00 00 01 00 00 04 03 00 -T BE 07 00 00 D2 01 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T C5 07 00 00 F1 F1 11 00 00 00 00 CD -R 00 00 01 00 02 07 14 00 -T CB 07 00 00 00 00 00 00 -R 00 00 01 00 02 04 04 00 -T CD 07 00 00 -R 00 00 01 00 -T CD 07 00 00 -R 00 00 01 00 -T CD 07 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T D0 07 00 00 -R 00 00 01 00 -T D0 07 00 00 CD 00 00 00 00 B4 FF 2A -R 00 00 01 00 02 05 18 00 -T D6 07 00 00 26 04 00 00 DD 75 F8 DD 74 F9 +T B4 08 00 00 D2 01 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T BA 08 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T C1 08 00 00 F1 11 00 00 00 00 3E 00 00 00 00 +R 00 00 01 00 02 06 15 00 2B 0B 04 00 +T C7 08 00 00 21 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 04 00 02 0A 14 00 +T CD 08 00 00 +R 00 00 01 00 +T CD 08 00 00 +R 00 00 01 00 +T CD 08 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T D0 08 00 00 +R 00 00 01 00 +T D0 08 00 00 CD 00 00 00 00 B4 FF 2A +R 00 00 01 00 02 05 19 00 +T D6 08 00 00 26 04 00 00 DD 75 F8 DD 74 F9 R 00 00 01 00 00 04 03 00 -T DE 07 00 00 +T DE 08 00 00 R 00 00 01 00 -T DE 07 00 00 ED 4B 0C 04 00 00 DD 6E F8 DD 66 +T DE 08 00 00 ED 4B 0C 04 00 00 DD 6E F8 DD 66 R 00 00 01 00 00 06 03 00 -T E7 07 00 00 F9 A7 ED 42 30 27 +T E7 08 00 00 F9 A7 ED 42 30 27 R 00 00 01 00 -T ED 07 00 00 +T ED 08 00 00 R 00 00 01 00 -T ED 07 00 00 06 03 DD 5E F8 DD 56 F9 CD +T ED 08 00 00 06 03 DD 5E F8 DD 56 F9 CD R 00 00 01 00 -T F6 07 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T F6 08 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T FD 07 00 00 7E F8 E6 07 47 3E 01 CD +T FD 08 00 00 7E F8 E6 07 47 3E 01 CD R 00 00 01 00 -T 05 08 00 00 00 00 00 00 2F A6 77 DD 34 F8 20 -R 00 00 01 00 02 04 1D 00 -T 0E 08 00 00 03 DD 34 F9 +T 05 09 00 00 00 00 00 00 2F A6 77 DD 34 F8 20 +R 00 00 01 00 02 04 1E 00 +T 0E 09 00 00 03 DD 34 F9 R 00 00 01 00 -T 12 08 00 00 +T 12 09 00 00 R 00 00 01 00 -T 12 08 00 00 18 CA +T 12 09 00 00 18 CA R 00 00 01 00 -T 14 08 00 00 +T 14 09 00 00 R 00 00 01 00 -T 14 08 00 00 DD 36 B4 01 DD 36 B5 00 +T 14 09 00 00 DD 36 B4 01 DD 36 B5 00 R 00 00 01 00 -T 1C 08 00 00 +T 1C 09 00 00 R 00 00 01 00 -T 1C 08 00 00 ED 4B 24 04 00 00 DD 6E B4 DD 66 +T 1C 09 00 00 ED 4B 24 04 00 00 DD 6E B4 DD 66 R 00 00 01 00 00 06 03 00 -T 25 08 00 00 B5 A7 ED 42 D2 9B 0A 00 00 +T 25 09 00 00 B5 A7 ED 42 D2 FA 0B 00 00 R 00 00 01 00 00 09 01 00 -T 2C 08 00 00 +T 2C 09 00 00 R 00 00 01 00 -T 2C 08 00 00 21 04 00 39 4D 44 DD 5E B4 DD 56 +T 2C 09 00 00 21 04 00 39 4D 44 DD 5E B4 DD 56 R 00 00 01 00 -T 37 08 00 00 B5 CD B5 14 00 00 DD 7E B8 E6 00 -R 00 00 01 00 00 06 01 00 -T 40 08 00 00 6F DD 7E B9 E6 F0 67 DD 75 B6 DD +T 37 09 00 00 B5 3E 8B 17 00 00 21 8B 17 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 3D 09 00 00 CD 00 00 00 00 DD 7E B8 E6 00 6F +R 00 00 01 00 02 05 14 00 +T 46 09 00 00 DD 7E B9 E6 F0 67 DD 75 B6 DD 74 R 00 00 01 00 -T 4B 08 00 00 74 B7 3E A0 AC B5 28 21 3E 80 DD +T 51 09 00 00 B7 3E A0 AC B5 28 21 3E 80 DD AE R 00 00 01 00 -T 56 08 00 00 AE B7 DD B6 B6 28 17 3E 40 DD AE +T 5C 09 00 00 B7 DD B6 B6 28 17 3E 40 DD AE B7 R 00 00 01 00 -T 61 08 00 00 B7 DD B6 B6 28 0D 3E 90 DD AE B7 +T 67 09 00 00 DD B6 B6 28 0D 3E 90 DD AE B7 DD R 00 00 01 00 -T 6C 08 00 00 DD B6 B6 28 03 +T 72 09 00 00 B6 B6 28 03 R 00 00 01 00 -T 71 08 00 00 +T 76 09 00 00 R 00 00 01 00 -T 71 08 00 00 +T 76 09 00 00 R 00 00 01 00 -T 71 08 00 00 +T 76 09 00 00 R 00 00 01 00 -T 71 08 00 00 C3 90 0A 00 00 +T 76 09 00 00 C3 EF 0B 00 00 R 00 00 01 00 00 05 01 00 -T 74 08 00 00 +T 79 09 00 00 R 00 00 01 00 -T 74 08 00 00 DD 36 F8 12 DD 36 F9 00 +T 79 09 00 00 DD 36 F8 12 DD 36 F9 00 R 00 00 01 00 -T 7C 08 00 00 +T 81 09 00 00 R 00 00 01 00 -T 7C 08 00 00 DD 4E F8 DD 46 F9 21 13 00 A7 ED +T 81 09 00 00 DD 4E F8 DD 46 F9 21 13 00 A7 ED R 00 00 01 00 -T 87 08 00 00 42 DA 7C 09 00 00 +T 8C 09 00 00 42 DA A9 0A 00 00 R 00 00 01 00 00 06 01 00 -T 8B 08 00 00 +T 90 09 00 00 R 00 00 01 00 -T 8B 08 00 00 DD 6E F8 DD 66 F9 29 E5 21 06 00 +T 90 09 00 00 DD 6E F8 DD 66 F9 29 E5 21 06 00 R 00 00 01 00 -T 96 08 00 00 39 01 18 00 09 4D 44 E1 09 46 23 +T 9B 09 00 00 39 01 18 00 09 4D 44 E1 09 46 23 R 00 00 01 00 -T A1 08 00 00 66 68 DD 75 FC DD 74 FD 7D B4 CA +T A6 09 00 00 66 68 DD 75 FC DD 74 FD 7D B4 CA R 00 00 01 00 -T AC 08 00 00 71 09 00 00 +T B1 09 00 00 9E 0A 00 00 R 00 00 01 00 00 04 01 00 -T AE 08 00 00 +T B3 09 00 00 R 00 00 01 00 -T AE 08 00 00 06 03 DD 5E FC DD 56 FD CD +T B3 09 00 00 06 03 DD 5E FC DD 56 FD CD R 00 00 01 00 -T B7 08 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T BC 09 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T BE 08 00 00 7E FC E6 07 47 3E 01 CD +T C3 09 00 00 7E FC E6 07 47 3E 01 CD R 00 00 01 00 -T C6 08 00 00 00 00 00 00 A6 CA 55 09 00 00 -R 00 00 01 00 02 04 1D 00 00 0A 01 00 -T CC 08 00 00 +T CB 09 00 00 00 00 00 00 A6 CA 82 0A 00 00 +R 00 00 01 00 02 04 1E 00 00 0A 01 00 +T D1 09 00 00 R 00 00 01 00 -T CC 08 00 00 DD 6E FC DD 66 FD E5 DD 6E B4 DD +T D1 09 00 00 DD 6E FC DD 66 FD E5 DD 6E B4 DD R 00 00 01 00 -T D7 08 00 00 66 B5 E5 DD 6E F8 DD 66 F9 E5 21 +T DC 09 00 00 66 B5 E5 DD 6E F8 DD 66 F9 E5 21 R 00 00 01 00 -T E2 08 00 00 14 02 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T E9 08 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T F2 08 00 00 60 +T E7 09 00 00 14 02 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T ED 09 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T F4 09 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T F9 09 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 00 0A 00 00 28 7E R 00 00 01 00 -T F3 08 00 00 +T 02 0A 00 00 R 00 00 01 00 -T F3 08 00 00 11 06 04 00 00 CD A3 13 00 00 DD -R 00 00 01 00 00 05 03 00 00 0A 01 00 -T FA 08 00 00 75 FE DD 74 FF 7D B4 20 10 +T 02 0A 00 00 11 06 04 00 00 3E 41 16 00 00 21 +R 00 00 01 00 00 05 03 00 29 0A 01 00 +T 08 0A 00 00 41 16 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 0F 0A 00 00 FE DD 74 FF 7D B4 20 1A R 00 00 01 00 -T 03 09 00 00 +T 17 0A 00 00 R 00 00 01 00 -T 03 09 00 00 21 55 02 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 0A 09 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 11 09 00 00 18 40 +T 17 0A 00 00 21 55 02 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 1D 0A 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 24 0A 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T 2A 0A 00 00 00 00 00 00 CD 00 00 00 00 18 4F +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 31 0A 00 00 R 00 00 01 00 -T 13 09 00 00 +T 31 0A 00 00 DD 5E FC DD 56 FD 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 39 0A 00 00 21 13 17 00 00 CD 00 00 00 00 4D +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 40 0A 00 00 44 DD 5E FE DD 56 FF 3E R 00 00 01 00 -T 13 09 00 00 DD 5E FC DD 56 FD CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 1C 09 00 00 4D 44 DD 5E FE DD 56 FF CD +T 48 0A 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 4D 0A 00 00 00 00 00 00 DD 6E F8 DD 66 F9 29 +R 00 00 01 00 02 04 14 00 +T 56 0A 00 00 E5 21 06 00 39 01 18 00 09 4D 44 R 00 00 01 00 -T 25 09 00 00 8B 14 00 00 DD 6E F8 DD 66 F9 29 -R 00 00 01 00 00 04 01 00 -T 2E 09 00 00 E5 21 06 00 39 01 18 00 09 4D 44 +T 61 0A 00 00 E1 09 DD 4E FE DD 46 FF 71 23 70 R 00 00 01 00 -T 39 09 00 00 E1 09 DD 4E FE DD 46 FF 71 23 70 +T 6C 0A 00 00 21 04 00 39 4D 44 DD 5E B4 DD 56 R 00 00 01 00 -T 44 09 00 00 21 04 00 39 4D 44 DD 5E B4 DD 56 +T 77 0A 00 00 B5 3E D9 17 00 00 21 D9 17 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 7D 0A 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 14 00 +T 80 0A 00 00 R 00 00 01 00 -T 4F 09 00 00 B5 CD F9 14 00 00 -R 00 00 01 00 00 06 01 00 -T 53 09 00 00 -R 00 00 01 00 -T 53 09 00 00 +T 80 0A 00 00 R 00 00 01 00 -T 53 09 00 00 18 1C +T 80 0A 00 00 18 1C R 00 00 01 00 -T 55 09 00 00 +T 82 0A 00 00 R 00 00 01 00 -T 55 09 00 00 06 03 DD 5E FC DD 56 FD CD +T 82 0A 00 00 06 03 DD 5E FC DD 56 FD CD R 00 00 01 00 -T 5E 09 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 8B 0A 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 65 09 00 00 7E FC E6 07 47 3E 01 CD +T 92 0A 00 00 7E FC E6 07 47 3E 01 CD R 00 00 01 00 -T 6D 09 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T 71 09 00 00 +T 9A 0A 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T 9E 0A 00 00 R 00 00 01 00 -T 71 09 00 00 +T 9E 0A 00 00 R 00 00 01 00 -T 71 09 00 00 DD 34 F8 20 03 DD 34 F9 +T 9E 0A 00 00 DD 34 F8 20 03 DD 34 F9 R 00 00 01 00 -T 79 09 00 00 +T A6 0A 00 00 R 00 00 01 00 -T 79 09 00 00 C3 7C 08 00 00 +T A6 0A 00 00 C3 81 09 00 00 R 00 00 01 00 00 05 01 00 -T 7C 09 00 00 +T A9 0A 00 00 R 00 00 01 00 -T 7C 09 00 00 AF DD 77 F8 DD 77 F9 21 0C 00 39 +T A9 0A 00 00 AF DD 77 F8 DD 77 F9 21 0C 00 39 R 00 00 01 00 -T 87 09 00 00 5E 23 56 23 4E 23 46 EB 3E 09 CD +T B4 0A 00 00 5E 23 56 23 4E 23 46 EB 3E 09 CD R 00 00 01 00 -T 92 09 00 00 00 00 00 00 DD 75 FA DD 74 FB -R 00 00 01 00 02 04 1E 00 -T 9A 09 00 00 +T BF 0A 00 00 00 00 00 00 DD 75 FA DD 74 FB +R 00 00 01 00 02 04 20 00 +T C7 0A 00 00 R 00 00 01 00 -T 9A 09 00 00 DD 4E F8 DD 46 F9 DD 6E FA DD 66 +T C7 0A 00 00 DD 4E F8 DD 46 F9 DD 6E FA DD 66 R 00 00 01 00 -T A5 09 00 00 FB A7 ED 42 DA 90 0A 00 00 +T D2 0A 00 00 FB A7 ED 42 DA EF 0B 00 00 R 00 00 01 00 00 09 01 00 -T AC 09 00 00 +T D9 0A 00 00 R 00 00 01 00 -T AC 09 00 00 DD 4E F8 DD 46 F9 21 04 00 39 5D +T D9 0A 00 00 DD 4E F8 DD 46 F9 21 04 00 39 5D R 00 00 01 00 -T B7 09 00 00 54 CD 88 11 00 00 DD 75 FC DD 74 -R 00 00 01 00 00 06 01 00 -T C0 09 00 00 FD 7D B4 20 03 +T E4 0A 00 00 54 3E EF 13 00 00 21 EF 13 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T EA 0A 00 00 CD 00 00 00 00 DD 75 FC DD 74 FD +R 00 00 01 00 02 05 14 00 +T F3 0A 00 00 7D B4 20 03 R 00 00 01 00 -T C5 09 00 00 +T F7 0A 00 00 R 00 00 01 00 -T C5 09 00 00 C3 85 0A 00 00 +T F7 0A 00 00 C3 E4 0B 00 00 R 00 00 01 00 00 05 01 00 -T C8 09 00 00 +T FA 0A 00 00 R 00 00 01 00 -T C8 09 00 00 06 03 DD 5E FC DD 56 FD CD +T FA 0A 00 00 06 03 DD 5E FC DD 56 FD CD R 00 00 01 00 -T D1 09 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 03 0B 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T D8 09 00 00 7E FC E6 07 47 3E 01 CD -R 00 00 01 00 -T E0 09 00 00 00 00 00 00 A6 CA 69 0A 00 00 -R 00 00 01 00 02 04 1D 00 00 0A 01 00 -T E6 09 00 00 -R 00 00 01 00 -T E6 09 00 00 DD 6E FC DD 66 FD E5 DD 6E B4 DD -R 00 00 01 00 -T F1 09 00 00 66 B5 E5 DD 6E F8 DD 66 F9 E5 21 -R 00 00 01 00 -T FC 09 00 00 74 02 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 03 0A 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T 0C 0A 00 00 5A -R 00 00 01 00 -T 0D 0A 00 00 -R 00 00 01 00 -T 0D 0A 00 00 11 06 04 00 00 CD A3 13 00 00 DD -R 00 00 01 00 00 05 03 00 00 0A 01 00 -T 14 0A 00 00 75 FE DD 74 FF 7D B4 20 10 -R 00 00 01 00 -T 1D 0A 00 00 -R 00 00 01 00 -T 1D 0A 00 00 21 55 02 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 24 0A 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 2B 0A 00 00 18 3A -R 00 00 01 00 -T 2D 0A 00 00 -R 00 00 01 00 -T 2D 0A 00 00 DD 5E FC DD 56 FD CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 36 0A 00 00 4D 44 DD 5E FE DD 56 FF CD -R 00 00 01 00 -T 3F 0A 00 00 8B 14 00 00 DD 6E FE DD 66 FF E5 -R 00 00 01 00 00 04 01 00 -T 48 0A 00 00 DD 4E F8 DD 46 F9 21 06 00 39 5D -R 00 00 01 00 -T 53 0A 00 00 54 CD 75 12 00 00 E1 21 04 00 39 -R 00 00 01 00 00 06 01 00 -T 5C 0A 00 00 4D 44 DD 5E B4 DD 56 B5 CD -R 00 00 01 00 -T 65 0A 00 00 F9 14 00 00 -R 00 00 01 00 00 04 01 00 -T 67 0A 00 00 -R 00 00 01 00 -T 67 0A 00 00 -R 00 00 01 00 -T 67 0A 00 00 18 1C -R 00 00 01 00 -T 69 0A 00 00 -R 00 00 01 00 -T 69 0A 00 00 06 03 DD 5E FC DD 56 FD CD -R 00 00 01 00 -T 72 0A 00 00 00 00 00 00 2A 36 04 00 00 19 DD +T 0A 0B 00 00 7E FC E6 07 47 3E 01 CD +R 00 00 01 00 +T 12 0B 00 00 00 00 00 00 A6 CA C8 0B 00 00 +R 00 00 01 00 02 04 1E 00 00 0A 01 00 +T 18 0B 00 00 +R 00 00 01 00 +T 18 0B 00 00 DD 6E FC DD 66 FD E5 DD 6E B4 DD +R 00 00 01 00 +T 23 0B 00 00 66 B5 E5 DD 6E F8 DD 66 F9 E5 21 +R 00 00 01 00 +T 2E 0B 00 00 74 02 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 34 0B 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 3B 0B 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 40 0B 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 47 0B 00 00 28 7D +R 00 00 01 00 +T 49 0B 00 00 +R 00 00 01 00 +T 49 0B 00 00 11 06 04 00 00 3E 41 16 00 00 21 +R 00 00 01 00 00 05 03 00 29 0A 01 00 +T 4F 0B 00 00 41 16 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 56 0B 00 00 FE DD 74 FF 7D B4 20 1A +R 00 00 01 00 +T 5E 0B 00 00 +R 00 00 01 00 +T 5E 0B 00 00 21 55 02 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 64 0B 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 6B 0B 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T 71 0B 00 00 00 00 00 00 CD 00 00 00 00 18 4E +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 78 0B 00 00 +R 00 00 01 00 +T 78 0B 00 00 DD 5E FC DD 56 FD 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 80 0B 00 00 21 13 17 00 00 CD 00 00 00 00 4D +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 87 0B 00 00 44 DD 5E FE DD 56 FF 3E +R 00 00 01 00 +T 8F 0B 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 94 0B 00 00 00 00 00 00 DD 6E FE DD 66 FF E5 +R 00 00 01 00 02 04 14 00 +T 9D 0B 00 00 DD 4E F8 DD 46 F9 21 06 00 39 5D +R 00 00 01 00 +T A8 0B 00 00 54 3E EB 14 00 00 21 EB 14 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T AE 0B 00 00 CD 00 00 00 00 E1 21 04 00 39 4D +R 00 00 01 00 02 05 14 00 +T B7 0B 00 00 44 DD 5E B4 DD 56 B5 3E +R 00 00 01 00 +T BF 0B 00 00 D9 17 00 00 21 D9 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T C4 0B 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T C6 0B 00 00 +R 00 00 01 00 +T C6 0B 00 00 +R 00 00 01 00 +T C6 0B 00 00 18 1C +R 00 00 01 00 +T C8 0B 00 00 +R 00 00 01 00 +T C8 0B 00 00 06 03 DD 5E FC DD 56 FD CD +R 00 00 01 00 +T D1 0B 00 00 00 00 00 00 2A 36 04 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 79 0A 00 00 7E FC E6 07 47 3E 01 CD +T D8 0B 00 00 7E FC E6 07 47 3E 01 CD R 00 00 01 00 -T 81 0A 00 00 00 00 00 00 B6 77 -R 00 00 01 00 02 04 1D 00 -T 85 0A 00 00 +T E0 0B 00 00 00 00 00 00 B6 77 +R 00 00 01 00 02 04 1E 00 +T E4 0B 00 00 R 00 00 01 00 -T 85 0A 00 00 +T E4 0B 00 00 R 00 00 01 00 -T 85 0A 00 00 DD 34 F8 20 03 DD 34 F9 +T E4 0B 00 00 DD 34 F8 20 03 DD 34 F9 R 00 00 01 00 -T 8D 0A 00 00 +T EC 0B 00 00 R 00 00 01 00 -T 8D 0A 00 00 C3 9A 09 00 00 +T EC 0B 00 00 C3 C7 0A 00 00 R 00 00 01 00 00 05 01 00 -T 90 0A 00 00 +T EF 0B 00 00 R 00 00 01 00 -T 90 0A 00 00 +T EF 0B 00 00 R 00 00 01 00 -T 90 0A 00 00 DD 34 B4 20 03 DD 34 B5 +T EF 0B 00 00 DD 34 B4 20 03 DD 34 B5 R 00 00 01 00 -T 98 0A 00 00 +T F7 0B 00 00 R 00 00 01 00 -T 98 0A 00 00 C3 1C 08 00 00 +T F7 0B 00 00 C3 1C 09 00 00 R 00 00 01 00 00 05 01 00 -T 9B 0A 00 00 +T FA 0B 00 00 R 00 00 01 00 -T 9B 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 9E 0A 00 00 +T FA 0B 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T FD 0B 00 00 R 00 00 01 00 -T 9E 0A 00 00 CD 00 00 00 00 14 FF 21 00 00 39 -R 00 00 01 00 02 05 18 00 -T A7 0A 00 00 4D 44 DD 5E 02 DD 56 03 CD +T FD 0B 00 00 CD 00 00 00 00 14 FF 21 00 00 39 +R 00 00 01 00 02 05 19 00 +T 06 0C 00 00 4D 44 DD 5E 02 DD 56 03 3E R 00 00 01 00 -T B0 0A 00 00 B5 14 00 00 21 00 00 39 7E E6 00 -R 00 00 01 00 00 04 01 00 -T B9 0A 00 00 4F 23 7E E6 F0 47 3E 40 A8 B1 28 +T 0F 0C 00 00 8B 17 00 00 21 8B 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 14 0C 00 00 00 00 00 00 21 00 00 39 7E E6 00 +R 00 00 01 00 02 04 14 00 +T 1D 0C 00 00 4F 23 7E E6 F0 47 3E 40 A8 B1 28 R 00 00 01 00 -T C4 0A 00 00 03 +T 28 0C 00 00 03 R 00 00 01 00 -T C5 0A 00 00 +T 29 0C 00 00 R 00 00 01 00 -T C5 0A 00 00 C3 AA 0E 00 00 +T 29 0C 00 00 C3 95 10 00 00 R 00 00 01 00 00 05 01 00 -T C8 0A 00 00 +T 2C 0C 00 00 R 00 00 01 00 -T C8 0A 00 00 2A 02 04 00 00 23 22 02 04 00 00 +T 2C 0C 00 00 2A 02 04 00 00 23 22 02 04 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T CF 0A 00 00 21 52 00 39 E5 21 0A 00 39 5E 23 +T 33 0C 00 00 21 52 00 39 E5 21 0A 00 39 5E 23 R 00 00 01 00 -T DA 0A 00 00 56 23 4E 23 46 EB 7D E6 0F 4F 7C +T 3E 0C 00 00 56 23 4E 23 46 EB 7D E6 0F 4F 7C R 00 00 01 00 -T E5 0A 00 00 E6 00 47 E1 71 23 70 21 52 00 39 +T 49 0C 00 00 E6 00 47 E1 71 23 70 21 52 00 39 R 00 00 01 00 -T F0 0A 00 00 7E 23 B6 28 3C +T 54 0C 00 00 7E 23 B6 28 4B R 00 00 01 00 -T F5 0A 00 00 +T 59 0C 00 00 R 00 00 01 00 -T F5 0A 00 00 21 52 00 39 4E 23 46 C5 DD 6E 02 +T 59 0C 00 00 21 52 00 39 4E 23 46 C5 DD 6E 02 R 00 00 01 00 -T 00 0B 00 00 DD 66 03 E5 21 AC 02 00 00 E5 CD +T 64 0C 00 00 DD 66 03 E5 21 AC 02 00 00 E5 3E R 00 00 01 00 00 09 02 00 -T 09 0B 00 00 00 00 00 00 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T 0F 0B 00 00 28 16 00 00 7D B4 28 1C -R 00 00 01 00 00 04 01 00 -T 15 0B 00 00 +T 6D 0C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 72 0C 00 00 00 00 00 00 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 78 0C 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 7D 0C 00 00 00 00 00 00 7D B4 28 21 +R 00 00 01 00 02 04 14 00 +T 83 0C 00 00 R 00 00 01 00 -T 15 0B 00 00 21 08 00 39 01 00 00 11 F0 FF CD +T 83 0C 00 00 21 08 00 39 01 00 00 11 F0 FF CD R 00 00 01 00 -T 20 0B 00 00 00 00 00 00 21 00 00 39 4D 44 DD -R 00 00 01 00 02 04 16 00 -T 29 0B 00 00 5E 02 DD 56 03 CD F9 14 00 00 -R 00 00 01 00 00 0A 01 00 -T 31 0B 00 00 +T 8E 0C 00 00 00 00 00 00 21 00 00 39 4D 44 DD +R 00 00 01 00 02 04 17 00 +T 97 0C 00 00 5E 02 DD 56 03 3E D9 17 00 00 21 +R 00 00 01 00 29 0A 01 00 +T 9F 0C 00 00 D9 17 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T A4 0C 00 00 R 00 00 01 00 -T 31 0B 00 00 +T A4 0C 00 00 R 00 00 01 00 -T 31 0B 00 00 21 54 00 39 E5 01 00 00 C5 01 +T A4 0C 00 00 21 54 00 39 E5 01 00 00 C5 01 R 00 00 01 00 -T 3B 0B 00 00 10 00 C5 21 0E 00 39 5E 23 56 23 +T AE 0C 00 00 10 00 C5 21 0E 00 39 5E 23 56 23 R 00 00 01 00 -T 46 0B 00 00 4E 23 46 EB CD 00 00 00 00 EB E1 -R 00 00 01 00 02 09 19 00 -T 4F 0B 00 00 73 23 72 21 50 00 39 AF 77 23 77 +T B9 0C 00 00 4E 23 46 EB CD 00 00 00 00 EB E1 +R 00 00 01 00 02 09 1A 00 +T C2 0C 00 00 73 23 72 21 50 00 39 AF 77 23 77 R 00 00 01 00 -T 5A 0B 00 00 +T CD 0C 00 00 R 00 00 01 00 -T 5A 0B 00 00 21 54 00 39 4E 23 46 21 50 00 39 +T CD 0C 00 00 21 54 00 39 4E 23 46 21 50 00 39 R 00 00 01 00 -T 65 0B 00 00 56 23 66 6A A7 ED 42 D2 +T D8 0C 00 00 56 23 66 6A A7 ED 42 D2 R 00 00 01 00 -T 6D 0B 00 00 A3 0E 00 00 +T E0 0C 00 00 8E 10 00 00 R 00 00 01 00 00 04 01 00 -T 6F 0B 00 00 +T E2 0C 00 00 R 00 00 01 00 -T 6F 0B 00 00 21 40 00 39 E5 21 52 00 39 4E 23 +T E2 0C 00 00 21 40 00 39 E5 21 52 00 39 4E 23 R 00 00 01 00 -T 7A 0B 00 00 46 21 02 00 39 5D 54 CD +T ED 0C 00 00 46 21 02 00 39 5D 54 3E R 00 00 01 00 -T 82 0B 00 00 57 15 00 00 E1 21 40 00 39 46 23 -R 00 00 01 00 00 04 01 00 -T 8B 0B 00 00 66 68 7D B4 20 03 +T F5 0C 00 00 46 18 00 00 21 46 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T FA 0C 00 00 00 00 00 00 E1 21 40 00 39 46 23 +R 00 00 01 00 02 04 14 00 +T 03 0D 00 00 66 68 7D B4 20 03 R 00 00 01 00 -T 91 0B 00 00 +T 09 0D 00 00 R 00 00 01 00 -T 91 0B 00 00 C3 97 0E 00 00 +T 09 0D 00 00 C3 82 10 00 00 R 00 00 01 00 00 05 01 00 -T 94 0B 00 00 +T 0C 0D 00 00 R 00 00 01 00 -T 94 0B 00 00 21 40 00 39 46 23 66 68 01 01 00 +T 0C 0D 00 00 21 40 00 39 46 23 66 68 01 01 00 R 00 00 01 00 -T 9F 0B 00 00 A7 ED 42 38 15 2A 0A 04 00 00 29 +T 17 0D 00 00 A7 ED 42 38 15 2A 0A 04 00 00 29 R 00 00 01 00 00 0A 03 00 -T A8 0B 00 00 29 29 4D 44 21 40 00 39 56 23 66 +T 20 0D 00 00 29 29 4D 44 21 40 00 39 56 23 66 R 00 00 01 00 -T B3 0B 00 00 6A A7 ED 42 38 51 +T 2B 0D 00 00 6A A7 ED 42 38 60 R 00 00 01 00 -T B9 0B 00 00 +T 31 0D 00 00 R 00 00 01 00 -T B9 0B 00 00 +T 31 0D 00 00 R 00 00 01 00 -T B9 0B 00 00 +T 31 0D 00 00 R 00 00 01 00 -T B9 0B 00 00 21 40 00 39 4E 23 46 C5 21 42 00 +T 31 0D 00 00 21 40 00 39 4E 23 46 C5 21 42 00 R 00 00 01 00 -T C4 0B 00 00 39 01 02 00 09 E5 DD 6E 08 DD 66 +T 3C 0D 00 00 39 01 02 00 09 E5 DD 6E 0A DD 66 R 00 00 01 00 -T CF 0B 00 00 09 E5 21 E5 02 00 00 E5 CD +T 47 0D 00 00 0B E5 21 E5 02 00 00 E5 3E R 00 00 01 00 00 07 02 00 -T D6 0B 00 00 00 00 00 00 F1 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T DD 0B 00 00 28 16 00 00 7D B4 28 27 -R 00 00 01 00 00 04 01 00 -T E3 0B 00 00 +T 4E 0D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 53 0D 00 00 00 00 00 00 F1 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 5A 0D 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 5F 0D 00 00 00 00 00 00 7D B4 28 2C +R 00 00 01 00 02 04 14 00 +T 65 0D 00 00 R 00 00 01 00 -T E3 0B 00 00 21 40 00 39 AF 77 23 77 21 42 00 +T 65 0D 00 00 21 40 00 39 AF 77 23 77 21 42 00 R 00 00 01 00 -T EE 0B 00 00 39 36 00 21 40 00 39 E5 21 52 00 +T 70 0D 00 00 39 36 00 21 40 00 39 E5 21 52 00 R 00 00 01 00 -T F9 0B 00 00 39 4E 23 46 21 02 00 39 5D 54 CD +T 7B 0D 00 00 39 4E 23 46 21 02 00 39 5D 54 3E R 00 00 01 00 -T 04 0C 00 00 B7 15 00 00 E1 C3 97 0E 00 00 -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 0A 0C 00 00 +T 86 0D 00 00 BA 18 00 00 21 BA 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 8B 0D 00 00 00 00 00 00 E1 C3 82 10 00 00 +R 00 00 01 00 02 04 14 00 00 0A 01 00 +T 91 0D 00 00 R 00 00 01 00 -T 0A 0C 00 00 +T 91 0D 00 00 R 00 00 01 00 -T 0A 0C 00 00 21 40 00 39 46 23 66 68 7D B4 28 +T 91 0D 00 00 21 40 00 39 46 23 66 68 7D B4 28 R 00 00 01 00 -T 15 0C 00 00 62 21 40 00 39 46 23 66 68 ED 4B +T 9C 0D 00 00 71 21 40 00 39 46 23 66 68 ED 4B R 00 00 01 00 -T 20 0C 00 00 38 04 00 00 09 46 04 20 51 +T A7 0D 00 00 38 04 00 00 09 46 04 20 60 R 00 00 01 00 00 04 03 00 -T 27 0C 00 00 +T AE 0D 00 00 R 00 00 01 00 -T 27 0C 00 00 +T AE 0D 00 00 R 00 00 01 00 -T 27 0C 00 00 +T AE 0D 00 00 R 00 00 01 00 -T 27 0C 00 00 21 40 00 39 4E 23 46 C5 21 42 00 +T AE 0D 00 00 21 40 00 39 4E 23 46 C5 21 42 00 R 00 00 01 00 -T 32 0C 00 00 39 01 02 00 09 E5 DD 6E 08 DD 66 +T B9 0D 00 00 39 01 02 00 09 E5 DD 6E 0A DD 66 R 00 00 01 00 -T 3D 0C 00 00 09 E5 21 20 03 00 00 E5 CD +T C4 0D 00 00 0B E5 21 20 03 00 00 E5 3E R 00 00 01 00 00 07 02 00 -T 44 0C 00 00 00 00 00 00 F1 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T 4B 0C 00 00 28 16 00 00 7D B4 28 27 -R 00 00 01 00 00 04 01 00 -T 51 0C 00 00 +T CB 0D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T D0 0D 00 00 00 00 00 00 F1 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T D7 0D 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T DC 0D 00 00 00 00 00 00 7D B4 28 2C +R 00 00 01 00 02 04 14 00 +T E2 0D 00 00 R 00 00 01 00 -T 51 0C 00 00 21 40 00 39 AF 77 23 77 21 42 00 +T E2 0D 00 00 21 40 00 39 AF 77 23 77 21 42 00 R 00 00 01 00 -T 5C 0C 00 00 39 36 00 21 40 00 39 E5 21 52 00 +T ED 0D 00 00 39 36 00 21 40 00 39 E5 21 52 00 R 00 00 01 00 -T 67 0C 00 00 39 4E 23 46 21 02 00 39 5D 54 CD +T F8 0D 00 00 39 4E 23 46 21 02 00 39 5D 54 3E R 00 00 01 00 -T 72 0C 00 00 B7 15 00 00 E1 C3 97 0E 00 00 -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 78 0C 00 00 +T 03 0E 00 00 BA 18 00 00 21 BA 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 08 0E 00 00 00 00 00 00 E1 C3 82 10 00 00 +R 00 00 01 00 02 04 14 00 00 0A 01 00 +T 0E 0E 00 00 R 00 00 01 00 -T 78 0C 00 00 +T 0E 0E 00 00 R 00 00 01 00 -T 78 0C 00 00 21 40 00 39 46 23 66 68 ED 4B +T 0E 0E 00 00 21 40 00 39 46 23 66 68 ED 4B R 00 00 01 00 -T 82 0C 00 00 38 04 00 00 09 46 34 04 04 20 1C +T 18 0E 00 00 38 04 00 00 09 46 34 04 04 20 26 R 00 00 01 00 00 04 03 00 -T 8B 0C 00 00 +T 21 0E 00 00 R 00 00 01 00 -T 8B 0C 00 00 21 40 00 39 4E 23 46 C5 21 +T 21 0E 00 00 21 40 00 39 4E 23 46 C5 21 R 00 00 01 00 -T 94 0C 00 00 5A 03 00 00 E5 21 00 00 00 00 E5 -R 00 00 01 00 00 04 02 00 02 0A 09 00 -T 9B 0C 00 00 CD 00 00 00 00 F1 F1 F1 11 01 00 -R 00 00 01 00 02 05 20 00 -T A4 0C 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 21 00 -T A7 0C 00 00 +T 2A 0E 00 00 5A 03 00 00 E5 21 00 00 00 00 E5 +R 00 00 01 00 00 04 02 00 02 0A 0A 00 +T 31 0E 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 22 00 02 0A 22 00 +T 37 0E 00 00 00 00 00 00 F1 F1 F1 11 01 00 3E +R 00 00 01 00 02 04 14 00 +T 40 0E 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T 45 0E 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 47 0E 00 00 R 00 00 01 00 -T A7 0C 00 00 21 52 00 39 AF 77 23 77 +T 47 0E 00 00 21 52 00 39 AF 77 23 77 R 00 00 01 00 -T AF 0C 00 00 +T 4F 0E 00 00 R 00 00 01 00 -T AF 0C 00 00 01 0E 00 21 52 00 39 56 23 66 6A +T 4F 0E 00 00 01 0E 00 21 52 00 39 56 23 66 6A R 00 00 01 00 -T BA 0C 00 00 A7 ED 42 D2 44 0D 00 00 21 40 00 +T 5A 0E 00 00 A7 ED 42 D2 F3 0E 00 00 21 40 00 R 00 00 01 00 00 08 01 00 -T C3 0C 00 00 39 01 02 00 09 E5 21 54 00 39 4E +T 63 0E 00 00 39 01 02 00 09 E5 21 54 00 39 4E R 00 00 01 00 -T CE 0C 00 00 23 46 E1 09 7E B7 28 6E +T 6E 0E 00 00 23 46 E1 09 7E B7 28 7D R 00 00 01 00 -T D6 0C 00 00 +T 76 0E 00 00 R 00 00 01 00 -T D6 0C 00 00 +T 76 0E 00 00 R 00 00 01 00 -T D6 0C 00 00 +T 76 0E 00 00 R 00 00 01 00 -T D6 0C 00 00 21 40 00 39 01 02 00 09 E5 21 +T 76 0E 00 00 21 40 00 39 01 02 00 09 E5 21 R 00 00 01 00 -T E0 0C 00 00 54 00 39 4E 23 46 E1 09 7E FE 2F +T 80 0E 00 00 54 00 39 4E 23 46 E1 09 7E FE 2F R 00 00 01 00 -T EB 0C 00 00 20 4B +T 8B 0E 00 00 20 5A R 00 00 01 00 -T ED 0C 00 00 +T 8D 0E 00 00 R 00 00 01 00 -T ED 0C 00 00 21 40 00 39 01 02 00 09 E5 DD 6E +T 8D 0E 00 00 21 40 00 39 01 02 00 09 E5 DD 6E R 00 00 01 00 -T F8 0C 00 00 08 DD 66 09 E5 21 9D 03 00 00 E5 +T 98 0E 00 00 0A DD 66 0B E5 21 9D 03 00 00 E5 R 00 00 01 00 00 0A 02 00 -T 01 0D 00 00 CD 00 00 00 00 F1 F1 F1 CD -R 00 00 01 00 02 05 08 00 -T 08 0D 00 00 28 16 00 00 7D B4 28 2A -R 00 00 01 00 00 04 01 00 -T 0E 0D 00 00 +T A1 0E 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 08 00 02 0A 08 00 +T A7 0E 00 00 00 00 00 00 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T AD 0E 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T B2 0E 00 00 00 00 00 00 7D B4 28 2F +R 00 00 01 00 02 04 14 00 +T B8 0E 00 00 R 00 00 01 00 -T 0E 0D 00 00 21 40 00 39 01 02 00 09 E5 21 +T B8 0E 00 00 21 40 00 39 01 02 00 09 E5 21 R 00 00 01 00 -T 18 0D 00 00 54 00 39 4E 23 46 E1 09 36 7E 21 +T C2 0E 00 00 54 00 39 4E 23 46 E1 09 36 7E 21 R 00 00 01 00 -T 23 0D 00 00 40 00 39 E5 21 52 00 39 4E 23 46 +T CD 0E 00 00 40 00 39 E5 21 52 00 39 4E 23 46 R 00 00 01 00 -T 2E 0D 00 00 21 02 00 39 5D 54 CD B7 15 00 00 -R 00 00 01 00 00 0B 01 00 -T 37 0D 00 00 E1 +T D8 0E 00 00 21 02 00 39 5D 54 3E BA 18 00 00 +R 00 00 01 00 29 0B 01 00 +T E0 0E 00 00 21 BA 18 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T E7 0E 00 00 R 00 00 01 00 -T 38 0D 00 00 +T E7 0E 00 00 R 00 00 01 00 -T 38 0D 00 00 +T E7 0E 00 00 21 52 00 39 34 23 20 01 34 R 00 00 01 00 -T 38 0D 00 00 21 52 00 39 34 23 20 01 34 +T F0 0E 00 00 R 00 00 01 00 -T 41 0D 00 00 -R 00 00 01 00 -T 41 0D 00 00 C3 AF 0C 00 00 +T F0 0E 00 00 C3 4F 0E 00 00 R 00 00 01 00 00 05 01 00 -T 44 0D 00 00 +T F3 0E 00 00 R 00 00 01 00 -T 44 0D 00 00 01 CD 03 00 00 21 40 00 39 11 +T F3 0E 00 00 01 CD 03 00 00 21 40 00 39 11 R 00 00 01 00 00 05 02 00 -T 4C 0D 00 00 02 00 19 EB CD 00 00 00 00 7D B4 -R 00 00 01 00 02 09 0D 00 -T 55 0D 00 00 20 5C 21 40 00 39 46 23 66 68 DD +T FB 0E 00 00 02 00 19 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 0E 00 +T 02 0F 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 02 04 0E 00 02 09 14 00 +T 09 0F 00 00 20 6B 21 40 00 39 46 23 66 68 DD R 00 00 01 00 -T 60 0D 00 00 4E 02 DD 46 03 A7 ED 42 28 49 +T 14 0F 00 00 4E 02 DD 46 03 A7 ED 42 28 58 R 00 00 01 00 -T 6A 0D 00 00 +T 1E 0F 00 00 R 00 00 01 00 -T 6A 0D 00 00 +T 1E 0F 00 00 R 00 00 01 00 -T 6A 0D 00 00 +T 1E 0F 00 00 R 00 00 01 00 -T 6A 0D 00 00 21 40 00 39 01 02 00 09 E5 21 +T 1E 0F 00 00 21 40 00 39 01 02 00 09 E5 21 R 00 00 01 00 -T 74 0D 00 00 0E 00 E5 DD 6E 08 DD 66 09 E5 21 +T 28 0F 00 00 0E 00 E5 DD 6E 0A DD 66 0B E5 21 R 00 00 01 00 -T 7F 0D 00 00 CF 03 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 86 0D 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T 8F 0D 00 00 23 +T 33 0F 00 00 CF 03 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 39 0F 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 40 0F 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 45 0F 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 4C 0F 00 00 28 28 R 00 00 01 00 -T 90 0D 00 00 +T 4E 0F 00 00 R 00 00 01 00 -T 90 0D 00 00 21 40 00 39 DD 4E 02 DD 46 03 71 +T 4E 0F 00 00 21 40 00 39 DD 4E 02 DD 46 03 71 R 00 00 01 00 -T 9B 0D 00 00 23 70 21 40 00 39 E5 21 52 00 39 +T 59 0F 00 00 23 70 21 40 00 39 E5 21 52 00 39 R 00 00 01 00 -T A6 0D 00 00 4E 23 46 21 02 00 39 5D 54 CD +T 64 0F 00 00 4E 23 46 21 02 00 39 5D 54 3E R 00 00 01 00 -T B0 0D 00 00 B7 15 00 00 E1 -R 00 00 01 00 00 04 01 00 -T B3 0D 00 00 +T 6E 0F 00 00 BA 18 00 00 21 BA 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 73 0F 00 00 00 00 00 00 E1 +R 00 00 01 00 02 04 14 00 +T 76 0F 00 00 R 00 00 01 00 -T B3 0D 00 00 +T 76 0F 00 00 R 00 00 01 00 -T B3 0D 00 00 01 FF 03 00 00 21 40 00 39 11 +T 76 0F 00 00 01 FF 03 00 00 21 40 00 39 11 R 00 00 01 00 00 05 02 00 -T BB 0D 00 00 02 00 19 EB CD 00 00 00 00 7D B4 -R 00 00 01 00 02 09 0D 00 -T C4 0D 00 00 20 5C 21 40 00 39 46 23 66 68 DD +T 7E 0F 00 00 02 00 19 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 0E 00 +T 85 0F 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 02 04 0E 00 02 09 14 00 +T 8C 0F 00 00 20 6B 21 40 00 39 46 23 66 68 DD R 00 00 01 00 -T CF 0D 00 00 4E 04 DD 46 05 A7 ED 42 28 49 +T 97 0F 00 00 4E 04 DD 46 05 A7 ED 42 28 58 R 00 00 01 00 -T D9 0D 00 00 +T A1 0F 00 00 R 00 00 01 00 -T D9 0D 00 00 +T A1 0F 00 00 R 00 00 01 00 -T D9 0D 00 00 +T A1 0F 00 00 R 00 00 01 00 -T D9 0D 00 00 21 40 00 39 01 02 00 09 E5 21 +T A1 0F 00 00 21 40 00 39 01 02 00 09 E5 21 R 00 00 01 00 -T E3 0D 00 00 0E 00 E5 DD 6E 08 DD 66 09 E5 21 +T AB 0F 00 00 0E 00 E5 DD 6E 0A DD 66 0B E5 21 R 00 00 01 00 -T EE 0D 00 00 02 04 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T F5 0D 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T FE 0D 00 00 23 +T B6 0F 00 00 02 04 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T BC 0F 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T C3 0F 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T C8 0F 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T CF 0F 00 00 28 28 R 00 00 01 00 -T FF 0D 00 00 +T D1 0F 00 00 R 00 00 01 00 -T FF 0D 00 00 21 40 00 39 DD 4E 04 DD 46 05 71 +T D1 0F 00 00 21 40 00 39 DD 4E 04 DD 46 05 71 R 00 00 01 00 -T 0A 0E 00 00 23 70 21 40 00 39 E5 21 52 00 39 +T DC 0F 00 00 23 70 21 40 00 39 E5 21 52 00 39 R 00 00 01 00 -T 15 0E 00 00 4E 23 46 21 02 00 39 5D 54 CD +T E7 0F 00 00 4E 23 46 21 02 00 39 5D 54 3E R 00 00 01 00 -T 1F 0E 00 00 B7 15 00 00 E1 -R 00 00 01 00 00 04 01 00 -T 22 0E 00 00 +T F1 0F 00 00 BA 18 00 00 21 BA 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T F6 0F 00 00 00 00 00 00 E1 +R 00 00 01 00 02 04 14 00 +T F9 0F 00 00 R 00 00 01 00 -T 22 0E 00 00 +T F9 0F 00 00 R 00 00 01 00 -T 22 0E 00 00 21 40 00 39 46 23 66 68 DD 4E 04 +T F9 0F 00 00 21 40 00 39 46 23 66 68 DD 4E 04 R 00 00 01 00 -T 2D 0E 00 00 DD 46 05 A7 ED 42 28 62 21 40 00 +T 04 10 00 00 DD 46 05 A7 ED 42 28 76 21 40 00 R 00 00 01 00 -T 38 0E 00 00 39 46 23 66 68 DD 4E 02 DD 46 03 +T 0F 10 00 00 39 46 23 66 68 DD 4E 02 DD 46 03 R 00 00 01 00 -T 43 0E 00 00 A7 ED 42 28 4F 01 21 00 2A +T 1A 10 00 00 A7 ED 42 28 63 01 21 00 2A R 00 00 01 00 -T 4C 0E 00 00 02 04 00 00 A7 ED 42 30 44 +T 23 10 00 00 02 04 00 00 A7 ED 42 30 58 R 00 00 01 00 00 04 03 00 -T 53 0E 00 00 -R 00 00 01 00 -T 53 0E 00 00 +T 2A 10 00 00 R 00 00 01 00 -T 53 0E 00 00 +T 2A 10 00 00 R 00 00 01 00 -T 53 0E 00 00 DD 4E 08 DD 46 09 21 56 00 39 5D +T 2A 10 00 00 R 00 00 01 00 -T 5E 0E 00 00 54 CD 00 00 00 00 21 40 00 39 01 -R 00 00 01 00 02 06 15 00 -T 67 0E 00 00 02 00 09 4D 44 21 56 00 39 5D 54 +T 2A 10 00 00 DD 4E 0A DD 46 0B 21 56 00 39 5D R 00 00 01 00 -T 72 0E 00 00 CD 00 00 00 00 01 33 04 00 00 21 -R 00 00 01 00 02 05 07 00 00 0A 02 00 -T 79 0E 00 00 56 00 39 5D 54 CD 00 00 00 00 21 -R 00 00 01 00 02 0A 07 00 -T 82 0E 00 00 56 00 39 E5 DD 4E 02 DD 46 03 21 +T 35 10 00 00 54 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 16 00 02 0B 16 00 +T 3B 10 00 00 CD 00 00 00 00 21 40 00 39 01 +R 00 00 01 00 02 05 14 00 +T 43 10 00 00 02 00 09 4D 44 21 56 00 39 5D 54 R 00 00 01 00 -T 8D 0E 00 00 42 00 39 5E 23 56 CD 9E 0A 00 00 -R 00 00 01 00 00 0B 01 00 -T 96 0E 00 00 E1 +T 4E 10 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 07 00 02 0A 07 00 +T 54 10 00 00 00 00 00 00 01 33 04 00 00 21 +R 00 00 01 00 02 04 14 00 00 09 02 00 +T 5A 10 00 00 56 00 39 5D 54 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 07 00 +T 62 10 00 00 00 00 00 00 CD 00 00 00 00 21 +R 00 00 01 00 02 04 07 00 02 09 14 00 +T 68 10 00 00 56 00 39 E5 DD 4E 02 DD 46 03 21 R 00 00 01 00 -T 97 0E 00 00 +T 73 10 00 00 42 00 39 5E 23 56 3E FD 0B 00 00 +R 00 00 01 00 29 0B 01 00 +T 7B 10 00 00 21 FD 0B 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 82 10 00 00 R 00 00 01 00 -T 97 0E 00 00 +T 82 10 00 00 R 00 00 01 00 -T 97 0E 00 00 21 50 00 39 34 23 20 01 34 +T 82 10 00 00 21 50 00 39 34 23 20 01 34 R 00 00 01 00 -T A0 0E 00 00 +T 8B 10 00 00 R 00 00 01 00 -T A0 0E 00 00 C3 5A 0B 00 00 +T 8B 10 00 00 C3 CD 0C 00 00 R 00 00 01 00 00 05 01 00 -T A3 0E 00 00 +T 8E 10 00 00 R 00 00 01 00 -T A3 0E 00 00 2A 02 04 00 00 2B 22 02 04 00 00 +T 8E 10 00 00 2A 02 04 00 00 2B 22 02 04 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T AA 0E 00 00 +T 95 10 00 00 R 00 00 01 00 -T AA 0E 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T AD 0E 00 00 +T 95 10 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 98 10 00 00 R 00 00 01 00 -T AD 0E 00 00 C5 D5 21 00 00 22 02 04 00 00 2A +T 98 10 00 00 C5 D5 21 00 00 22 02 04 00 00 2A R 00 00 01 00 00 0A 03 00 -T B6 0E 00 00 38 04 00 00 23 36 01 21 +T A1 10 00 00 38 04 00 00 23 36 01 21 R 00 00 01 00 00 04 03 00 -T BC 0E 00 00 33 04 00 00 E5 01 01 00 11 01 00 +T A7 10 00 00 33 04 00 00 E5 01 01 00 11 01 00 R 00 00 01 00 00 04 02 00 -T C5 0E 00 00 CD 9E 0A 00 00 E1 2A 02 04 00 00 -R 00 00 01 00 00 05 01 00 00 0B 03 00 -T CC 0E 00 00 7D B4 28 06 +T B0 10 00 00 3E FD 0B 00 00 21 FD 0B 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T B6 10 00 00 00 00 00 00 E1 2A 02 04 00 00 7D +R 00 00 01 00 02 04 14 00 00 0A 03 00 +T BD 10 00 00 B4 28 0B R 00 00 01 00 -T D0 0E 00 00 +T C0 10 00 00 R 00 00 01 00 -T D0 0E 00 00 11 35 04 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T D6 0E 00 00 +T C0 10 00 00 11 35 04 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T C6 10 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T CB 10 00 00 R 00 00 01 00 -T D6 0E 00 00 D1 C1 C9 +T CB 10 00 00 D1 C1 C3 00 00 00 00 +R 00 00 01 00 02 07 03 00 +T D0 10 00 00 R 00 00 01 00 -T D9 0E 00 00 +T D0 10 00 00 CD 00 00 00 00 AC FF 21 00 00 39 +R 00 00 01 00 02 05 19 00 +T D9 10 00 00 4D 44 11 01 00 3E 8B 17 00 00 21 +R 00 00 01 00 29 0A 01 00 +T E1 10 00 00 8B 17 00 00 CD 00 00 00 00 AF DD +R 00 00 01 00 00 04 01 00 02 09 14 00 +T E8 10 00 00 77 FC DD 77 FD 21 00 00 E5 21 R 00 00 01 00 -T D9 0E 00 00 CD 00 00 00 00 AC FF 21 00 00 39 -R 00 00 01 00 02 05 18 00 -T E2 0E 00 00 4D 44 11 01 00 CD B5 14 00 00 AF -R 00 00 01 00 00 0A 01 00 -T EB 0E 00 00 DD 77 FC DD 77 FD 21 00 00 E5 21 -R 00 00 01 00 -T F6 0E 00 00 10 00 E5 21 0C 00 39 5E 23 56 23 +T F2 10 00 00 10 00 E5 21 0C 00 39 5E 23 56 23 R 00 00 01 00 -T 01 0F 00 00 4E 23 46 EB CD 00 00 00 00 DD 75 -R 00 00 01 00 02 09 19 00 -T 0A 0F 00 00 FE DD 74 FF +T FD 10 00 00 4E 23 46 EB CD 00 00 00 00 DD 75 +R 00 00 01 00 02 09 1A 00 +T 06 11 00 00 FE DD 74 FF R 00 00 01 00 -T 0E 0F 00 00 +T 0A 11 00 00 R 00 00 01 00 -T 0E 0F 00 00 DD 4E FE DD 46 FF DD 6E FC DD 66 +T 0A 11 00 00 DD 4E FE DD 46 FF DD 6E FC DD 66 R 00 00 01 00 -T 19 0F 00 00 FD A7 ED 42 30 6C +T 15 11 00 00 FD A7 ED 42 30 7C R 00 00 01 00 -T 1F 0F 00 00 +T 1B 11 00 00 R 00 00 01 00 -T 1F 0F 00 00 21 40 00 39 E5 DD 4E FC DD 46 FD +T 1B 11 00 00 21 40 00 39 E5 DD 4E FC DD 46 FD R 00 00 01 00 -T 2A 0F 00 00 21 02 00 39 5D 54 CD 57 15 00 00 -R 00 00 01 00 00 0B 01 00 -T 33 0F 00 00 E1 DD 6E EC DD 66 ED 7D B4 20 43 +T 26 11 00 00 21 02 00 39 5D 54 3E 46 18 00 00 +R 00 00 01 00 29 0B 01 00 +T 2E 11 00 00 21 46 18 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 35 11 00 00 DD 6E EC DD 66 ED 7D B4 20 4D DD R 00 00 01 00 -T 3E 0F 00 00 DD 7E EE B7 20 3D +T 40 11 00 00 7E EE B7 20 47 R 00 00 01 00 -T 44 0F 00 00 +T 45 11 00 00 R 00 00 01 00 -T 44 0F 00 00 +T 45 11 00 00 R 00 00 01 00 -T 44 0F 00 00 +T 45 11 00 00 R 00 00 01 00 -T 44 0F 00 00 DD 6E 02 DD 66 03 DD 75 EC DD 74 +T 45 11 00 00 DD 6E 02 DD 66 03 DD 75 EC DD 74 R 00 00 01 00 -T 4F 0F 00 00 ED DD 6E 02 DD 66 03 E5 21 +T 50 11 00 00 ED DD 6E 02 DD 66 03 E5 21 R 00 00 01 00 -T 58 0F 00 00 48 04 00 00 E5 21 44 00 39 01 +T 59 11 00 00 48 04 00 00 E5 21 44 00 39 01 R 00 00 01 00 00 04 02 00 -T 60 0F 00 00 02 00 09 E5 CD 00 00 00 00 F1 F1 -R 00 00 01 00 02 09 03 00 -T 69 0F 00 00 F1 21 40 00 39 E5 DD 4E FC DD 46 +T 61 11 00 00 02 00 09 E5 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 02 00 +T 68 11 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 02 00 02 09 14 00 +T 6F 11 00 00 F1 21 40 00 39 E5 DD 4E FC DD 46 R 00 00 01 00 -T 74 0F 00 00 FD 21 02 00 39 5D 54 CD +T 7A 11 00 00 FD 21 02 00 39 5D 54 3E R 00 00 01 00 -T 7C 0F 00 00 B7 15 00 00 E1 18 18 -R 00 00 01 00 00 04 01 00 -T 81 0F 00 00 +T 82 11 00 00 BA 18 00 00 21 BA 18 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 87 11 00 00 00 00 00 00 E1 18 23 +R 00 00 01 00 02 04 14 00 +T 8C 11 00 00 R 00 00 01 00 -T 81 0F 00 00 DD 34 FC 20 03 DD 34 FD +T 8C 11 00 00 DD 34 FC 20 03 DD 34 FD R 00 00 01 00 -T 89 0F 00 00 +T 94 11 00 00 R 00 00 01 00 -T 89 0F 00 00 18 83 -R 00 00 01 00 -T 8B 0F 00 00 +T 94 11 00 00 C3 0A 11 00 00 +R 00 00 01 00 00 05 01 00 +T 97 11 00 00 R 00 00 01 00 -T 8B 0F 00 00 21 4E 04 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 92 0F 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 99 0F 00 00 +T 97 11 00 00 21 4E 04 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 9D 11 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T A4 11 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T AA 11 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T AF 11 00 00 R 00 00 01 00 -T 99 0F 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 9C 0F 00 00 +T AF 11 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T B2 11 00 00 R 00 00 01 00 -T 9C 0F 00 00 CD 00 00 00 00 BC FF DD 36 BE 01 -R 00 00 01 00 02 05 18 00 -T A5 0F 00 00 DD 36 BF 00 +T B2 11 00 00 CD 00 00 00 00 BC FF DD 36 BE 01 +R 00 00 01 00 02 05 19 00 +T BB 11 00 00 DD 36 BF 00 R 00 00 01 00 -T A9 0F 00 00 +T BF 11 00 00 R 00 00 01 00 -T A9 0F 00 00 ED 4B 24 04 00 00 DD 6E BE DD 66 +T BF 11 00 00 ED 4B 24 04 00 00 DD 6E BE DD 66 R 00 00 01 00 00 06 03 00 -T B2 0F 00 00 BF A7 ED 42 D2 85 11 00 00 +T C8 11 00 00 BF A7 ED 42 D2 EC 13 00 00 R 00 00 01 00 00 09 01 00 -T B9 0F 00 00 +T CF 11 00 00 R 00 00 01 00 -T B9 0F 00 00 21 04 00 39 4D 44 DD 5E BE DD 56 +T CF 11 00 00 21 04 00 39 4D 44 DD 5E BE DD 56 R 00 00 01 00 -T C4 0F 00 00 BF CD B5 14 00 00 DD 6E C0 DD 66 -R 00 00 01 00 00 06 01 00 -T CD 0F 00 00 C1 7D B4 20 18 +T DA 11 00 00 BF 3E 8B 17 00 00 21 8B 17 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T E0 11 00 00 CD 00 00 00 00 DD 6E C0 DD 66 C1 +R 00 00 01 00 02 05 14 00 +T E9 11 00 00 7D B4 20 1D R 00 00 01 00 -T D2 0F 00 00 +T ED 11 00 00 R 00 00 01 00 -T D2 0F 00 00 DD 6E BE DD 66 BF ED 4B +T ED 11 00 00 DD 6E BE DD 66 BF ED 4B R 00 00 01 00 -T DA 0F 00 00 38 04 00 00 09 46 04 28 06 +T F5 11 00 00 38 04 00 00 09 46 04 28 0B R 00 00 01 00 00 04 03 00 -T E1 0F 00 00 +T FC 11 00 00 R 00 00 01 00 -T E1 0F 00 00 11 7A 04 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T E7 0F 00 00 +T FC 11 00 00 11 7A 04 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 02 12 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 07 12 00 00 R 00 00 01 00 -T E7 0F 00 00 C3 7A 11 00 00 +T 07 12 00 00 C3 E1 13 00 00 R 00 00 01 00 00 05 01 00 -T EA 0F 00 00 +T 0A 12 00 00 R 00 00 01 00 -T EA 0F 00 00 DD 6E BE DD 66 BF ED 4B +T 0A 12 00 00 DD 6E BE DD 66 BF ED 4B R 00 00 01 00 -T F2 0F 00 00 38 04 00 00 09 46 04 20 10 DD 6E +T 12 12 00 00 38 04 00 00 09 46 04 20 15 DD 6E R 00 00 01 00 00 04 03 00 -T FB 0F 00 00 C0 DD 66 C1 7D B4 28 06 +T 1B 12 00 00 C0 DD 66 C1 7D B4 28 0B R 00 00 01 00 -T 03 10 00 00 +T 23 12 00 00 R 00 00 01 00 -T 03 10 00 00 +T 23 12 00 00 R 00 00 01 00 -T 03 10 00 00 +T 23 12 00 00 R 00 00 01 00 -T 03 10 00 00 11 7A 04 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T 09 10 00 00 +T 23 12 00 00 11 7A 04 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 29 12 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 2E 12 00 00 R 00 00 01 00 -T 09 10 00 00 DD 6E BE DD 66 BF ED 4B +T 2E 12 00 00 DD 6E BE DD 66 BF ED 4B R 00 00 01 00 -T 11 10 00 00 38 04 00 00 09 46 04 28 6B DD 6E +T 36 12 00 00 38 04 00 00 09 46 04 28 7A DD 6E R 00 00 01 00 00 04 03 00 -T 1A 10 00 00 BE DD 66 BF ED 4B 38 04 00 00 09 +T 3F 12 00 00 BE DD 66 BF ED 4B 38 04 00 00 09 R 00 00 01 00 00 0A 03 00 -T 23 10 00 00 4E 06 00 DD 6E C2 DD 66 C3 A7 ED +T 48 12 00 00 4E 06 00 DD 6E C2 DD 66 C3 A7 ED R 00 00 01 00 -T 2E 10 00 00 42 28 52 +T 53 12 00 00 42 28 61 R 00 00 01 00 -T 31 10 00 00 +T 56 12 00 00 R 00 00 01 00 -T 31 10 00 00 +T 56 12 00 00 R 00 00 01 00 -T 31 10 00 00 +T 56 12 00 00 R 00 00 01 00 -T 31 10 00 00 DD 6E BE DD 66 BF ED 4B +T 56 12 00 00 DD 6E BE DD 66 BF ED 4B R 00 00 01 00 -T 39 10 00 00 38 04 00 00 09 4E 06 00 C5 DD 6E +T 5E 12 00 00 38 04 00 00 09 4E 06 00 C5 DD 6E R 00 00 01 00 00 04 03 00 -T 42 10 00 00 C2 DD 66 C3 E5 DD 6E BE DD 66 BF +T 67 12 00 00 C2 DD 66 C3 E5 DD 6E BE DD 66 BF R 00 00 01 00 -T 4D 10 00 00 E5 21 92 04 00 00 E5 CD +T 72 12 00 00 E5 21 92 04 00 00 E5 3E R 00 00 01 00 00 06 02 00 -T 53 10 00 00 00 00 00 00 F1 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T 5A 10 00 00 28 16 00 00 7D B4 28 23 -R 00 00 01 00 00 04 01 00 -T 60 10 00 00 -R 00 00 01 00 -T 60 10 00 00 DD 6E BE DD 66 BF ED 4B -R 00 00 01 00 -T 68 10 00 00 38 04 00 00 09 4E 06 00 DD 71 C2 +T 78 12 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 7D 12 00 00 00 00 00 00 F1 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 84 12 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 89 12 00 00 00 00 00 00 7D B4 28 28 +R 00 00 01 00 02 04 14 00 +T 8F 12 00 00 +R 00 00 01 00 +T 8F 12 00 00 DD 6E BE DD 66 BF ED 4B +R 00 00 01 00 +T 97 12 00 00 38 04 00 00 09 4E 06 00 DD 71 C2 R 00 00 01 00 00 04 03 00 -T 71 10 00 00 DD 70 C3 21 04 00 39 4D 44 DD 5E +T A0 12 00 00 DD 70 C3 21 04 00 39 4D 44 DD 5E R 00 00 01 00 -T 7C 10 00 00 BE DD 56 BF CD F9 14 00 00 -R 00 00 01 00 00 09 01 00 -T 83 10 00 00 +T AB 12 00 00 BE DD 56 BF 3E D9 17 00 00 21 +R 00 00 01 00 29 09 01 00 +T B2 12 00 00 D9 17 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T B7 12 00 00 R 00 00 01 00 -T 83 10 00 00 +T B7 12 00 00 R 00 00 01 00 -T 83 10 00 00 DD 6E BE DD 66 BF ED 4B +T B7 12 00 00 DD 6E BE DD 66 BF ED 4B R 00 00 01 00 -T 8B 10 00 00 38 04 00 00 09 7E B7 C2 +T BF 12 00 00 38 04 00 00 09 7E B7 C2 R 00 00 01 00 00 04 03 00 -T 91 10 00 00 7A 11 00 00 +T C5 12 00 00 E1 13 00 00 R 00 00 01 00 00 04 01 00 -T 93 10 00 00 +T C7 12 00 00 R 00 00 01 00 -T 93 10 00 00 DD 7E C0 E6 00 6F DD 7E C1 E6 F0 +T C7 12 00 00 DD 7E C0 E6 00 6F DD 7E C1 E6 F0 R 00 00 01 00 -T 9E 10 00 00 67 3E 60 AC B5 28 24 DD 7E C0 E6 +T D2 12 00 00 67 3E 60 AC B5 28 25 DD 7E C0 E6 R 00 00 01 00 -T A9 10 00 00 00 6F DD 7E C1 E6 F0 67 3E 20 AC +T DD 12 00 00 00 6F DD 7E C1 E6 F0 67 3E 20 AC R 00 00 01 00 -T B4 10 00 00 B5 28 12 21 0C 00 39 5E 23 56 23 +T E8 12 00 00 B5 28 13 21 0C 00 39 5E 23 56 23 R 00 00 01 00 -T BF 10 00 00 4E 23 46 EB 7D B4 B1 B0 20 72 +T F3 12 00 00 4E 23 46 EB 7D B4 B1 B0 C2 R 00 00 01 00 -T C9 10 00 00 +T FC 12 00 00 8E 13 00 00 +R 00 00 01 00 00 04 01 00 +T FE 12 00 00 R 00 00 01 00 -T C9 10 00 00 +T FE 12 00 00 R 00 00 01 00 -T C9 10 00 00 +T FE 12 00 00 R 00 00 01 00 -T C9 10 00 00 DD 6E C2 DD 66 C3 E5 DD 6E C0 DD +T FE 12 00 00 DD 6E C2 DD 66 C3 E5 DD 6E C0 DD R 00 00 01 00 -T D4 10 00 00 66 C1 E5 DD 6E BE DD 66 BF E5 21 +T 09 13 00 00 66 C1 E5 DD 6E BE DD 66 BF E5 21 R 00 00 01 00 -T DF 10 00 00 C1 04 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T E6 10 00 00 F1 F1 F1 CD 28 16 00 00 7D B4 28 -R 00 00 01 00 00 08 01 00 -T EF 10 00 00 49 +T 14 13 00 00 C1 04 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 1A 13 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 21 13 00 00 F1 F1 3E 44 19 00 00 21 +R 00 00 01 00 29 07 01 00 +T 26 13 00 00 44 19 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 2D 13 00 00 28 5D R 00 00 01 00 -T F0 10 00 00 +T 2F 13 00 00 R 00 00 01 00 -T F0 10 00 00 AF DD 77 C2 DD 77 C3 AF DD 77 C0 +T 2F 13 00 00 AF DD 77 C2 DD 77 C3 AF DD 77 C0 R 00 00 01 00 -T FB 10 00 00 DD 77 C1 21 04 00 39 4D 44 DD 5E +T 3A 13 00 00 DD 77 C1 21 04 00 39 4D 44 DD 5E R 00 00 01 00 -T 06 11 00 00 BE DD 56 BF CD F9 14 00 00 2A -R 00 00 01 00 00 09 01 00 -T 0E 11 00 00 10 04 00 00 23 22 10 04 00 00 11 +T 45 13 00 00 BE DD 56 BF 3E D9 17 00 00 21 +R 00 00 01 00 29 09 01 00 +T 4C 13 00 00 D9 17 00 00 CD 00 00 00 00 2A +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 52 13 00 00 10 04 00 00 23 22 10 04 00 00 11 R 00 00 01 00 00 04 03 00 00 0A 03 00 -T 15 11 00 00 04 00 CD 5B 14 00 00 DD 75 BC DD -R 00 00 01 00 00 07 01 00 -T 1E 11 00 00 74 BD 01 1E 00 C5 4D 44 11 +T 59 13 00 00 04 00 3E 13 17 00 00 21 +R 00 00 01 00 29 07 01 00 +T 5E 13 00 00 13 17 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 65 13 00 00 BC DD 74 BD 01 1E 00 C5 4D 44 11 R 00 00 01 00 -T 27 11 00 00 06 04 00 00 CD 00 00 00 00 E1 DD -R 00 00 01 00 00 04 03 00 02 09 11 00 -T 2E 11 00 00 4E BC DD 46 BD 11 04 00 CD +T 70 13 00 00 06 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 11 00 +T 75 13 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T 7C 13 00 00 4E BC DD 46 BD 11 04 00 3E R 00 00 01 00 -T 37 11 00 00 8B 14 00 00 -R 00 00 01 00 00 04 01 00 -T 39 11 00 00 +T 85 13 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 8A 13 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 8C 13 00 00 R 00 00 01 00 -T 39 11 00 00 18 3F +T 8C 13 00 00 18 53 R 00 00 01 00 -T 3B 11 00 00 +T 8E 13 00 00 R 00 00 01 00 -T 3B 11 00 00 DD 6E C2 DD 66 C3 E5 DD 6E BE DD +T 8E 13 00 00 DD 6E C2 DD 66 C3 E5 DD 6E BE DD R 00 00 01 00 -T 46 11 00 00 66 BF E5 21 0D 05 00 00 E5 CD +T 99 13 00 00 66 BF E5 21 0D 05 00 00 E5 3E R 00 00 01 00 00 08 02 00 -T 4E 11 00 00 00 00 00 00 F1 F1 F1 CD -R 00 00 01 00 02 04 08 00 -T 54 11 00 00 28 16 00 00 7D B4 28 20 -R 00 00 01 00 00 04 01 00 -T 5A 11 00 00 +T A1 13 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T A6 13 00 00 00 00 00 00 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T AC 13 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T B1 13 00 00 00 00 00 00 7D B4 28 2A +R 00 00 01 00 02 04 14 00 +T B7 13 00 00 R 00 00 01 00 -T 5A 11 00 00 DD 36 C2 01 DD 36 C3 00 21 04 00 +T B7 13 00 00 DD 36 C2 01 DD 36 C3 00 21 04 00 R 00 00 01 00 -T 65 11 00 00 39 4D 44 DD 5E BE DD 56 BF CD +T C2 13 00 00 39 4D 44 DD 5E BE DD 56 BF 3E R 00 00 01 00 -T 6F 11 00 00 F9 14 00 00 DD 5E BE DD 56 BF CD -R 00 00 01 00 00 04 01 00 -T 78 11 00 00 D9 0E 00 00 -R 00 00 01 00 00 04 01 00 -T 7A 11 00 00 +T CC 13 00 00 D9 17 00 00 21 D9 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T D1 13 00 00 00 00 00 00 DD 5E BE DD 56 BF 3E +R 00 00 01 00 02 04 14 00 +T DA 13 00 00 D0 10 00 00 21 D0 10 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T DF 13 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T E1 13 00 00 R 00 00 01 00 -T 7A 11 00 00 +T E1 13 00 00 R 00 00 01 00 -T 7A 11 00 00 +T E1 13 00 00 R 00 00 01 00 -T 7A 11 00 00 +T E1 13 00 00 R 00 00 01 00 -T 7A 11 00 00 DD 34 BE 20 03 DD 34 BF +T E1 13 00 00 DD 34 BE 20 03 DD 34 BF R 00 00 01 00 -T 82 11 00 00 +T E9 13 00 00 R 00 00 01 00 -T 82 11 00 00 C3 A9 0F 00 00 +T E9 13 00 00 C3 BF 11 00 00 R 00 00 01 00 00 05 01 00 -T 85 11 00 00 +T EC 13 00 00 R 00 00 01 00 -T 85 11 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 88 11 00 00 +T EC 13 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T EF 13 00 00 R 00 00 01 00 -T 88 11 00 00 CD 00 00 00 00 FA FF 11 12 00 69 -R 00 00 01 00 02 05 18 00 -T 91 11 00 00 60 A7 ED 52 30 19 +T EF 13 00 00 CD 00 00 00 00 FA FF 11 12 00 69 +R 00 00 01 00 02 05 19 00 +T F8 13 00 00 60 A7 ED 52 30 19 R 00 00 01 00 -T 97 11 00 00 +T FE 13 00 00 R 00 00 01 00 -T 97 11 00 00 DD 6E 04 DD 66 05 29 DD 4E 02 DD +T FE 13 00 00 DD 6E 04 DD 66 05 29 DD 4E 02 DD R 00 00 01 00 -T A2 11 00 00 46 03 09 01 18 00 09 46 23 66 68 +T 09 14 00 00 46 03 09 01 18 00 09 46 23 66 68 R 00 00 01 00 -T AD 11 00 00 C3 72 12 00 00 +T 14 14 00 00 C3 E8 14 00 00 R 00 00 01 00 00 05 01 00 -T B0 11 00 00 +T 17 14 00 00 R 00 00 01 00 -T B0 11 00 00 01 12 01 DD 6E 04 DD 66 05 A7 ED +T 17 14 00 00 01 12 01 DD 6E 04 DD 66 05 A7 ED R 00 00 01 00 -T BB 11 00 00 42 30 43 +T 22 14 00 00 42 30 48 R 00 00 01 00 -T BE 11 00 00 +T 25 14 00 00 R 00 00 01 00 -T BE 11 00 00 21 3C 00 DD 4E 02 DD 46 03 09 46 +T 25 14 00 00 21 3C 00 DD 4E 02 DD 46 03 09 46 R 00 00 01 00 -T C9 11 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 +T 30 14 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 R 00 00 01 00 -T D4 11 00 00 20 06 +T 3B 14 00 00 20 06 R 00 00 01 00 -T D6 11 00 00 +T 3D 14 00 00 R 00 00 01 00 -T D6 11 00 00 21 00 00 C3 72 12 00 00 +T 3D 14 00 00 21 00 00 C3 E8 14 00 00 R 00 00 01 00 00 08 01 00 -T DC 11 00 00 +T 43 14 00 00 R 00 00 01 00 -T DC 11 00 00 DD 5E FA DD 56 FB CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T E5 11 00 00 DD 75 FE DD 74 FF E5 DD 6E 04 DD +T 43 14 00 00 DD 5E FA DD 56 FB 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 4B 14 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 52 14 00 00 75 FE DD 74 FF E5 DD 6E 04 DD 66 R 00 00 01 00 -T F0 11 00 00 66 05 29 4D 44 E1 09 01 DC FF 09 +T 5D 14 00 00 05 29 4D 44 E1 09 01 DC FF 09 46 R 00 00 01 00 -T FB 11 00 00 46 23 66 68 18 71 +T 68 14 00 00 23 66 68 18 7B R 00 00 01 00 -T 01 12 00 00 +T 6D 14 00 00 R 00 00 01 00 -T 01 12 00 00 21 3E 00 DD 4E 02 DD 46 03 09 46 +T 6D 14 00 00 21 3E 00 DD 4E 02 DD 46 03 09 46 R 00 00 01 00 -T 0C 12 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 +T 78 14 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 R 00 00 01 00 -T 17 12 00 00 20 05 +T 83 14 00 00 20 05 R 00 00 01 00 -T 19 12 00 00 +T 85 14 00 00 R 00 00 01 00 -T 19 12 00 00 21 00 00 18 54 +T 85 14 00 00 21 00 00 18 5E R 00 00 01 00 -T 1E 12 00 00 +T 8A 14 00 00 R 00 00 01 00 -T 1E 12 00 00 DD 5E FA DD 56 FB CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 27 12 00 00 DD 75 FE DD 74 FF 21 E0 00 DD 4E +T 8A 14 00 00 DD 5E FA DD 56 FB 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 92 14 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 99 14 00 00 75 FE DD 74 FF 21 E0 00 DD 4E 04 R 00 00 01 00 -T 32 12 00 00 04 DD 46 05 09 DD 75 FA DD 74 FB +T A4 14 00 00 DD 46 05 09 DD 75 FA DD 74 FB 6C R 00 00 01 00 -T 3D 12 00 00 6C 26 00 29 DD 4E FE DD 46 FF 09 +T AF 14 00 00 26 00 29 DD 4E FE DD 46 FF 09 56 R 00 00 01 00 -T 48 12 00 00 56 23 66 6A DD 75 FC DD 74 FD EB +T BA 14 00 00 23 66 6A DD 75 FC DD 74 FD EB 3E R 00 00 01 00 -T 53 12 00 00 CD 5B 14 00 00 DD 75 FE DD 74 FF -R 00 00 01 00 00 05 01 00 -T 5C 12 00 00 E5 DD 7E FA E6 FF 6F DD 7E FB E6 +T C5 14 00 00 13 17 00 00 21 13 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T CA 14 00 00 00 00 00 00 DD 75 FE DD 74 FF E5 +R 00 00 01 00 02 04 14 00 +T D3 14 00 00 DD 7E FA E6 FF 6F DD 7E FB E6 00 R 00 00 01 00 -T 67 12 00 00 00 67 29 4D 44 E1 09 46 23 66 68 +T DE 14 00 00 67 29 4D 44 E1 09 46 23 66 68 R 00 00 01 00 -T 72 12 00 00 +T E8 14 00 00 R 00 00 01 00 -T 72 12 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 75 12 00 00 +T E8 14 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T EB 14 00 00 R 00 00 01 00 -T 75 12 00 00 CD 00 00 00 00 FA FF 11 12 00 69 -R 00 00 01 00 02 05 18 00 -T 7E 12 00 00 60 A7 ED 52 30 1E +T EB 14 00 00 CD 00 00 00 00 FA FF 11 12 00 69 +R 00 00 01 00 02 05 19 00 +T F4 14 00 00 60 A7 ED 52 30 1E R 00 00 01 00 -T 84 12 00 00 +T FA 14 00 00 R 00 00 01 00 -T 84 12 00 00 DD 6E 04 DD 66 05 29 DD 4E 02 DD +T FA 14 00 00 DD 6E 04 DD 66 05 29 DD 4E 02 DD R 00 00 01 00 -T 8F 12 00 00 46 03 09 01 18 00 09 DD 4E 08 DD +T 05 15 00 00 46 03 09 01 18 00 09 DD 4E 0A DD R 00 00 01 00 -T 9A 12 00 00 46 09 71 23 70 C3 A0 13 00 00 +T 10 15 00 00 46 0B 71 23 70 C3 3E 16 00 00 R 00 00 01 00 00 0A 01 00 -T A2 12 00 00 +T 18 15 00 00 R 00 00 01 00 -T A2 12 00 00 01 12 01 DD 6E 04 DD 66 05 A7 ED +T 18 15 00 00 01 12 01 DD 6E 04 DD 66 05 A7 ED R 00 00 01 00 -T AD 12 00 00 42 30 58 +T 23 15 00 00 42 30 67 R 00 00 01 00 -T B0 12 00 00 +T 26 15 00 00 R 00 00 01 00 -T B0 12 00 00 21 3C 00 DD 4E 02 DD 46 03 09 46 +T 26 15 00 00 21 3C 00 DD 4E 02 DD 46 03 09 46 R 00 00 01 00 -T BB 12 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 +T 31 15 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 R 00 00 01 00 -T C6 12 00 00 20 06 +T 3C 15 00 00 20 0B R 00 00 01 00 -T C8 12 00 00 +T 3E 15 00 00 R 00 00 01 00 -T C8 12 00 00 11 43 05 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T CE 12 00 00 +T 3E 15 00 00 11 43 05 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 44 15 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 49 15 00 00 R 00 00 01 00 -T CE 12 00 00 DD 5E FA DD 56 FB CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T D7 12 00 00 DD 75 FE DD 74 FF E5 DD 6E 04 DD +T 49 15 00 00 DD 5E FA DD 56 FB 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 51 15 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 58 15 00 00 75 FE DD 74 FF E5 DD 6E 04 DD 66 R 00 00 01 00 -T E2 12 00 00 66 05 29 4D 44 E1 09 01 DC FF 09 +T 63 15 00 00 05 29 4D 44 E1 09 01 DC FF 09 DD R 00 00 01 00 -T ED 12 00 00 DD 4E 08 DD 46 09 71 23 70 DD 4E +T 6E 15 00 00 4E 0A DD 46 0B 71 23 70 DD 4E FE R 00 00 01 00 -T F8 12 00 00 FE DD 46 FF DD 5E FA DD 56 FB CD +T 79 15 00 00 DD 46 FF DD 5E FA DD 56 FB 3E R 00 00 01 00 -T 03 13 00 00 8B 14 00 00 C3 A0 13 00 00 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 08 13 00 00 +T 83 15 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 88 15 00 00 00 00 00 00 C3 3E 16 00 00 +R 00 00 01 00 02 04 14 00 00 09 01 00 +T 8D 15 00 00 R 00 00 01 00 -T 08 13 00 00 21 3E 00 DD 4E 02 DD 46 03 09 46 +T 8D 15 00 00 21 3E 00 DD 4E 02 DD 46 03 09 46 R 00 00 01 00 -T 13 13 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 +T 98 15 00 00 23 66 68 DD 75 FA DD 74 FB 7D B4 R 00 00 01 00 -T 1E 13 00 00 20 06 +T A3 15 00 00 20 0B R 00 00 01 00 -T 20 13 00 00 +T A5 15 00 00 R 00 00 01 00 -T 20 13 00 00 11 43 05 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T 26 13 00 00 +T A5 15 00 00 11 43 05 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T AB 15 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T B0 15 00 00 R 00 00 01 00 -T 26 13 00 00 DD 5E FA DD 56 FB CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 2F 13 00 00 DD 75 FE DD 74 FF 21 0A 00 39 7E +T B0 15 00 00 DD 5E FA DD 56 FB 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T B8 15 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T BF 15 00 00 75 FE DD 74 FF 21 0A 00 39 7E D6 R 00 00 01 00 -T 3A 13 00 00 D6 12 77 23 7E DE 01 77 DD 6E 04 +T CA 15 00 00 12 77 23 7E DE 01 77 DD 6E 04 DD R 00 00 01 00 -T 45 13 00 00 DD 66 05 6C 26 00 29 DD 4E FE DD +T D5 15 00 00 66 05 6C 26 00 29 DD 4E FE DD 46 R 00 00 01 00 -T 50 13 00 00 46 FF 09 46 23 66 68 DD 75 FC DD +T E0 15 00 00 FF 09 46 23 66 68 DD 75 FC DD 74 R 00 00 01 00 -T 5B 13 00 00 74 FD 7D B4 20 06 +T EB 15 00 00 FD 7D B4 20 0B R 00 00 01 00 -T 61 13 00 00 +T F0 15 00 00 R 00 00 01 00 -T 61 13 00 00 11 43 05 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T 67 13 00 00 +T F0 15 00 00 11 43 05 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T F6 15 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T FB 15 00 00 R 00 00 01 00 -T 67 13 00 00 DD 5E FC DD 56 FD CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 70 13 00 00 DD 75 FE DD 74 FF E5 DD 7E 04 E6 +T FB 15 00 00 DD 5E FC DD 56 FD 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 03 16 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 0A 16 00 00 75 FE DD 74 FF E5 DD 7E 04 E6 FF R 00 00 01 00 -T 7B 13 00 00 FF 6F DD 7E 05 E6 00 67 29 4D 44 +T 15 16 00 00 6F DD 7E 05 E6 00 67 29 4D 44 E1 R 00 00 01 00 -T 86 13 00 00 E1 09 DD 4E 04 DD 46 05 71 23 70 +T 20 16 00 00 09 DD 4E 04 DD 46 05 71 23 70 DD R 00 00 01 00 -T 91 13 00 00 DD 4E FE DD 46 FF DD 5E FA DD 56 +T 2B 16 00 00 4E FE DD 46 FF DD 5E FA DD 56 FB R 00 00 01 00 -T 9C 13 00 00 FB CD 8B 14 00 00 -R 00 00 01 00 00 06 01 00 -T A0 13 00 00 -R 00 00 01 00 -T A0 13 00 00 +T 36 16 00 00 3E 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 3C 16 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 3E 16 00 00 R 00 00 01 00 -T A0 13 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T A3 13 00 00 +T 3E 16 00 00 R 00 00 01 00 -T A3 13 00 00 CD 00 00 00 00 F6 FF 21 12 00 DD -R 00 00 01 00 02 05 18 00 -T AC 13 00 00 4E 02 DD 46 03 09 56 23 66 6A DD +T 3E 16 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 41 16 00 00 R 00 00 01 00 -T B7 13 00 00 75 FC DD 74 FD 21 14 00 09 46 23 +T 41 16 00 00 CD 00 00 00 00 F6 FF 21 12 00 DD +R 00 00 01 00 02 05 19 00 +T 4A 16 00 00 4E 02 DD 46 03 09 56 23 66 6A DD R 00 00 01 00 -T C2 13 00 00 66 68 DD 75 FE DD 74 FF 4D 44 DD +T 55 16 00 00 75 FC DD 74 FD 21 14 00 09 46 23 R 00 00 01 00 -T CD 13 00 00 5E FC DD 56 FD CD 09 1A 00 00 DD -R 00 00 01 00 00 0A 01 00 -T D6 13 00 00 75 FA DD 74 FB 7D A4 3C 20 05 +T 60 16 00 00 66 68 DD 75 FE DD 74 FF 4D 44 DD R 00 00 01 00 -T E0 13 00 00 +T 6B 16 00 00 5E FC DD 56 FD 3E 2F 1E 00 00 21 +R 00 00 01 00 29 0A 01 00 +T 73 16 00 00 2F 1E 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 7A 16 00 00 FA DD 74 FB 7D A4 3C 20 06 R 00 00 01 00 -T E0 13 00 00 21 00 00 18 73 +T 83 16 00 00 R 00 00 01 00 -T E5 13 00 00 +T 83 16 00 00 21 00 00 C3 10 17 00 00 +R 00 00 01 00 00 08 01 00 +T 89 16 00 00 R 00 00 01 00 -T E5 13 00 00 21 08 00 DD 4E 02 DD 46 03 09 4E +T 89 16 00 00 21 08 00 DD 4E 02 DD 46 03 09 4E R 00 00 01 00 -T F0 13 00 00 23 46 0B 70 2B 71 ED 4B +T 94 16 00 00 23 46 0B 70 2B 71 ED 4B R 00 00 01 00 -T F8 13 00 00 26 04 00 00 DD 6E FA DD 66 FB A7 +T 9C 16 00 00 26 04 00 00 DD 6E FA DD 66 FB A7 R 00 00 01 00 00 04 03 00 -T 01 14 00 00 ED 42 38 18 21 06 00 DD 4E 02 DD +T A5 16 00 00 ED 42 38 18 21 06 00 DD 4E 02 DD R 00 00 01 00 -T 0C 14 00 00 46 03 09 4E 23 46 DD 6E FA DD 66 +T B0 16 00 00 46 03 09 4E 23 46 DD 6E FA DD 66 R 00 00 01 00 -T 17 14 00 00 FB A7 ED 42 38 0D +T BB 16 00 00 FB A7 ED 42 38 12 R 00 00 01 00 -T 1D 14 00 00 +T C1 16 00 00 R 00 00 01 00 -T 1D 14 00 00 +T C1 16 00 00 R 00 00 01 00 -T 1D 14 00 00 +T C1 16 00 00 R 00 00 01 00 -T 1D 14 00 00 21 5A 05 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 24 14 00 00 F1 21 00 00 18 2E +T C1 16 00 00 21 5A 05 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T C7 16 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T CE 16 00 00 21 00 00 18 3D R 00 00 01 00 -T 2A 14 00 00 +T D3 16 00 00 R 00 00 01 00 -T 2A 14 00 00 11 04 00 CD 5B 14 00 00 DD 75 F8 -R 00 00 01 00 00 08 01 00 -T 33 14 00 00 DD 74 F9 01 02 00 C5 4D 44 21 +T D3 16 00 00 11 04 00 3E 13 17 00 00 21 +R 00 00 01 00 29 08 01 00 +T D9 16 00 00 13 17 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T E0 16 00 00 F8 DD 74 F9 01 02 00 C5 4D 44 21 R 00 00 01 00 -T 3D 14 00 00 0E 00 39 5D 54 CD 00 00 00 00 E1 -R 00 00 01 00 02 0A 11 00 -T 46 14 00 00 DD 4E F8 DD 46 F9 11 04 00 CD +T EB 16 00 00 0E 00 39 5D 54 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 11 00 +T F3 16 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T FA 16 00 00 4E F8 DD 46 F9 11 04 00 3E R 00 00 01 00 -T 50 14 00 00 8B 14 00 00 DD 6E FA DD 66 FB -R 00 00 01 00 00 04 01 00 -T 58 14 00 00 +T 03 17 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 08 17 00 00 00 00 00 00 DD 6E FA DD 66 FB +R 00 00 01 00 02 04 14 00 +T 10 17 00 00 R 00 00 01 00 -T 58 14 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 5B 14 00 00 +T 10 17 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 13 17 00 00 R 00 00 01 00 -T 5B 14 00 00 CD 00 00 00 00 21 3A 04 00 00 E5 +T 13 17 00 00 CD 00 00 00 00 21 3A 04 00 00 E5 R 00 00 01 00 02 05 13 00 00 0A 03 00 -T 62 14 00 00 4B 42 ED 5B 04 04 00 00 CD +T 1A 17 00 00 4B 42 ED 5B 04 04 00 00 3E R 00 00 01 00 00 08 03 00 -T 69 14 00 00 00 00 00 00 F1 3E 02 AC B5 28 13 -R 00 00 01 00 00 04 01 00 -T 72 14 00 00 -R 00 00 01 00 -T 72 14 00 00 DD 6E 02 DD 66 03 E5 21 -R 00 00 01 00 -T 7A 14 00 00 86 05 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 81 14 00 00 F1 CD 00 00 00 00 -R 00 00 01 00 02 06 0C 00 -T 85 14 00 00 -R 00 00 01 00 -T 85 14 00 00 21 3A 04 00 00 C3 00 00 00 00 -R 00 00 01 00 00 05 03 00 02 0A 0F 00 -T 8B 14 00 00 -R 00 00 01 00 -T 8B 14 00 00 CD 00 00 00 00 C5 4B 42 ED 5B +T 21 17 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 26 17 00 00 00 00 00 00 F1 3E 02 AC B5 28 1D +R 00 00 01 00 02 04 14 00 +T 2F 17 00 00 +R 00 00 01 00 +T 2F 17 00 00 DD 6E 02 DD 66 03 E5 21 +R 00 00 01 00 +T 37 17 00 00 86 05 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 3D 17 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 44 17 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 0D 00 02 0A 0D 00 +T 4A 17 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 4C 17 00 00 +R 00 00 01 00 +T 4C 17 00 00 21 3A 04 00 00 C3 00 00 00 00 +R 00 00 01 00 00 05 03 00 02 0A 09 00 +T 52 17 00 00 +R 00 00 01 00 +T 52 17 00 00 CD 00 00 00 00 C5 4B 42 ED 5B R 00 00 01 00 02 05 13 00 -T 93 14 00 00 04 04 00 00 CD 73 00 00 00 F1 3E -R 00 00 01 00 00 04 03 00 00 09 01 00 -T 9A 14 00 00 02 AC B5 28 13 -R 00 00 01 00 -T 9F 14 00 00 -R 00 00 01 00 -T 9F 14 00 00 DD 6E 02 DD 66 03 E5 21 -R 00 00 01 00 -T A7 14 00 00 A0 05 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T AE 14 00 00 F1 CD 00 00 00 00 -R 00 00 01 00 02 06 0C 00 -T B2 14 00 00 -R 00 00 01 00 -T B2 14 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T B5 14 00 00 -R 00 00 01 00 -T B5 14 00 00 CD 00 00 00 00 FE FF 06 03 DD 5E -R 00 00 01 00 02 05 18 00 -T BE 14 00 00 02 DD 56 03 CD 00 00 00 00 2A -R 00 00 01 00 02 09 00 00 -T C6 14 00 00 26 04 00 00 19 EB CD 5B 14 00 00 -R 00 00 01 00 00 04 03 00 00 0B 01 00 -T CD 14 00 00 DD 75 FE DD 74 FF 01 40 00 C5 DD -R 00 00 01 00 -T D8 14 00 00 4E 04 DD 46 05 C5 DD 7E 02 E6 07 -R 00 00 01 00 -T E3 14 00 00 5F DD 7E 03 E6 00 57 06 06 CD -R 00 00 01 00 -T ED 14 00 00 00 00 00 00 19 EB C1 CD -R 00 00 01 00 02 04 02 00 -T F3 14 00 00 00 00 00 00 E1 C3 00 00 00 00 -R 00 00 01 00 02 04 11 00 02 0A 0F 00 -T F9 14 00 00 -R 00 00 01 00 -T F9 14 00 00 CD 00 00 00 00 FE FF 06 03 DD 5E -R 00 00 01 00 02 05 18 00 -T 02 15 00 00 02 DD 56 03 CD 00 00 00 00 2A +T 5A 17 00 00 04 04 00 00 3E A5 00 00 00 21 +R 00 00 01 00 00 04 03 00 29 09 01 00 +T 5F 17 00 00 A5 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 66 17 00 00 02 AC B5 28 1D +R 00 00 01 00 +T 6B 17 00 00 +R 00 00 01 00 +T 6B 17 00 00 DD 6E 02 DD 66 03 E5 21 +R 00 00 01 00 +T 73 17 00 00 A0 05 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 79 17 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 80 17 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 0D 00 02 0A 0D 00 +T 86 17 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 88 17 00 00 +R 00 00 01 00 +T 88 17 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 8B 17 00 00 +R 00 00 01 00 +T 8B 17 00 00 CD 00 00 00 00 FE FF 06 03 DD 5E +R 00 00 01 00 02 05 19 00 +T 94 17 00 00 02 DD 56 03 CD 00 00 00 00 2A R 00 00 01 00 02 09 00 00 -T 0A 15 00 00 26 04 00 00 19 EB CD 5B 14 00 00 -R 00 00 01 00 00 04 03 00 00 0B 01 00 -T 11 15 00 00 DD 75 FE DD 74 FF 01 40 00 C5 DD -R 00 00 01 00 -T 1C 15 00 00 7E 02 E6 07 5F DD 7E 03 E6 00 57 -R 00 00 01 00 -T 27 15 00 00 06 06 CD 00 00 00 00 19 4D 44 DD -R 00 00 01 00 02 07 02 00 -T 30 15 00 00 5E 04 DD 56 05 CD 00 00 00 00 E1 -R 00 00 01 00 02 0A 11 00 -T 39 15 00 00 DD 4E FE DD 46 FF C5 06 03 DD 5E -R 00 00 01 00 -T 44 15 00 00 02 DD 56 03 CD 00 00 00 00 2A +T 9C 17 00 00 26 04 00 00 19 EB 3E 13 17 00 00 +R 00 00 01 00 00 04 03 00 29 0B 01 00 +T A2 17 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T A9 17 00 00 75 FE DD 74 FF 01 40 00 C5 DD 4E +R 00 00 01 00 +T B4 17 00 00 04 DD 46 05 C5 DD 7E 02 E6 07 5F +R 00 00 01 00 +T BF 17 00 00 DD 7E 03 E6 00 57 06 06 CD +R 00 00 01 00 +T C8 17 00 00 00 00 00 00 19 EB 3E 00 00 00 00 +R 00 00 01 00 02 04 01 00 2B 0B 11 00 +T CE 17 00 00 21 00 00 00 00 C1 CD 00 00 00 00 +R 00 00 01 00 02 05 11 00 02 0B 14 00 +T D5 17 00 00 E1 C3 00 00 00 00 +R 00 00 01 00 02 06 09 00 +T D9 17 00 00 +R 00 00 01 00 +T D9 17 00 00 CD 00 00 00 00 FE FF 06 03 DD 5E +R 00 00 01 00 02 05 19 00 +T E2 17 00 00 02 DD 56 03 CD 00 00 00 00 2A R 00 00 01 00 02 09 00 00 -T 4C 15 00 00 26 04 00 00 19 EB C1 CD -R 00 00 01 00 00 04 03 00 -T 52 15 00 00 8B 14 00 00 C3 00 00 00 00 -R 00 00 01 00 00 04 01 00 02 09 0F 00 -T 57 15 00 00 -R 00 00 01 00 -T 57 15 00 00 CD 00 00 00 00 FC FF 06 05 DD 5E -R 00 00 01 00 02 05 18 00 -T 60 15 00 00 04 DD 56 05 CD 00 00 00 00 4B 42 +T EA 17 00 00 26 04 00 00 19 EB 3E 13 17 00 00 +R 00 00 01 00 00 04 03 00 29 0B 01 00 +T F0 17 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T F7 17 00 00 75 FE DD 74 FF 01 40 00 C5 DD 7E +R 00 00 01 00 +T 02 18 00 00 02 E6 07 5F DD 7E 03 E6 00 57 06 +R 00 00 01 00 +T 0D 18 00 00 06 CD 00 00 00 00 19 4D 44 DD 5E +R 00 00 01 00 02 06 01 00 +T 16 18 00 00 04 DD 56 05 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 11 00 +T 1D 18 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T 24 18 00 00 4E FE DD 46 FF C5 06 03 DD 5E 02 +R 00 00 01 00 +T 2F 18 00 00 DD 56 03 CD 00 00 00 00 2A +R 00 00 01 00 02 08 00 00 +T 36 18 00 00 26 04 00 00 19 EB 3E 52 17 00 00 +R 00 00 01 00 00 04 03 00 29 0B 01 00 +T 3C 18 00 00 21 52 17 00 00 C1 CD 00 00 00 00 +R 00 00 01 00 00 05 01 00 02 0B 14 00 +T 43 18 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 46 18 00 00 +R 00 00 01 00 +T 46 18 00 00 CD 00 00 00 00 FC FF 06 05 DD 5E +R 00 00 01 00 02 05 19 00 +T 4F 18 00 00 04 DD 56 05 CD 00 00 00 00 4B 42 R 00 00 01 00 02 09 00 00 -T 69 15 00 00 DD 5E 02 DD 56 03 CD 88 11 00 00 -R 00 00 01 00 00 0B 01 00 -T 72 15 00 00 DD 75 FE DD 74 FF 7D B4 20 06 -R 00 00 01 00 -T 7C 15 00 00 -R 00 00 01 00 -T 7C 15 00 00 11 BB 05 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T 82 15 00 00 -R 00 00 01 00 -T 82 15 00 00 DD 5E FE DD 56 FF CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T 8B 15 00 00 DD 75 FC DD 74 FD 01 10 00 C5 DD -R 00 00 01 00 -T 96 15 00 00 4E 08 DD 46 09 E5 DD 7E 04 E6 1F -R 00 00 01 00 -T A1 15 00 00 6F DD 7E 05 E6 00 67 29 29 29 29 -R 00 00 01 00 -T AC 15 00 00 EB E1 19 EB CD 00 00 00 00 E1 C3 -R 00 00 01 00 02 09 11 00 -T B5 15 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 -T B7 15 00 00 -R 00 00 01 00 -T B7 15 00 00 CD 00 00 00 00 FC FF 06 05 DD 5E -R 00 00 01 00 02 05 18 00 -T C0 15 00 00 04 DD 56 05 CD 00 00 00 00 4B 42 +T 58 18 00 00 DD 5E 02 DD 56 03 3E EF 13 00 00 +R 00 00 01 00 29 0B 01 00 +T 60 18 00 00 21 EF 13 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 67 18 00 00 75 FE DD 74 FF 7D B4 20 0B +R 00 00 01 00 +T 70 18 00 00 +R 00 00 01 00 +T 70 18 00 00 11 BB 05 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 76 18 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T 7B 18 00 00 +R 00 00 01 00 +T 7B 18 00 00 DD 5E FE DD 56 FF 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T 83 18 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 8A 18 00 00 75 FC DD 74 FD 01 10 00 C5 DD 4E +R 00 00 01 00 +T 95 18 00 00 0A DD 46 0B E5 DD 7E 04 E6 1F 6F +R 00 00 01 00 +T A0 18 00 00 DD 7E 05 E6 00 67 29 29 29 29 EB +R 00 00 01 00 +T AB 18 00 00 E1 19 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 11 00 +T B1 18 00 00 00 00 00 00 CD 00 00 00 00 E1 C3 +R 00 00 01 00 02 04 11 00 02 09 14 00 +T B8 18 00 00 00 00 00 00 +R 00 00 01 00 02 04 09 00 +T BA 18 00 00 +R 00 00 01 00 +T BA 18 00 00 CD 00 00 00 00 FC FF 06 05 DD 5E +R 00 00 01 00 02 05 19 00 +T C3 18 00 00 04 DD 56 05 CD 00 00 00 00 4B 42 R 00 00 01 00 02 09 00 00 -T C9 15 00 00 DD 5E 02 DD 56 03 CD 88 11 00 00 -R 00 00 01 00 00 0B 01 00 -T D2 15 00 00 DD 75 FE DD 74 FF 7D B4 20 06 -R 00 00 01 00 -T DC 15 00 00 -R 00 00 01 00 -T DC 15 00 00 11 BB 05 00 00 CD 4C 1B 00 00 -R 00 00 01 00 00 05 02 00 00 0A 01 00 -T E2 15 00 00 -R 00 00 01 00 -T E2 15 00 00 DD 5E FE DD 56 FF CD 5B 14 00 00 -R 00 00 01 00 00 0B 01 00 -T EB 15 00 00 DD 75 FC DD 74 FD 01 10 00 C5 E5 -R 00 00 01 00 -T F6 15 00 00 DD 7E 04 E6 1F 6F DD 7E 05 E6 00 -R 00 00 01 00 -T 01 16 00 00 67 29 29 29 29 4D 44 E1 09 4D 44 -R 00 00 01 00 -T 0C 16 00 00 DD 5E 08 DD 56 09 CD 00 00 00 00 -R 00 00 01 00 02 0B 11 00 -T 15 16 00 00 E1 DD 4E FC DD 46 FD DD 5E FE DD -R 00 00 01 00 -T 20 16 00 00 56 FF CD 8B 14 00 00 C3 -R 00 00 01 00 00 07 01 00 -T 26 16 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 -T 28 16 00 00 -R 00 00 01 00 -T 28 16 00 00 CD 00 00 00 00 EC FF 11 -R 00 00 01 00 02 05 18 00 -T 2E 16 00 00 00 00 00 00 CD 00 00 00 00 2A -R 00 00 01 00 02 04 14 00 02 09 04 00 -T 34 16 00 00 00 00 00 00 7D B4 28 0A +T CC 18 00 00 DD 5E 02 DD 56 03 3E EF 13 00 00 +R 00 00 01 00 29 0B 01 00 +T D4 18 00 00 21 EF 13 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T DB 18 00 00 75 FE DD 74 FF 7D B4 20 0B +R 00 00 01 00 +T E4 18 00 00 +R 00 00 01 00 +T E4 18 00 00 11 BB 05 00 00 3E 81 1F 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T EA 18 00 00 81 1F 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T EF 18 00 00 +R 00 00 01 00 +T EF 18 00 00 DD 5E FE DD 56 FF 3E 13 17 00 00 +R 00 00 01 00 29 0B 01 00 +T F7 18 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T FE 18 00 00 75 FC DD 74 FD 01 10 00 C5 E5 DD +R 00 00 01 00 +T 09 19 00 00 7E 04 E6 1F 6F DD 7E 05 E6 00 67 +R 00 00 01 00 +T 14 19 00 00 29 29 29 29 4D 44 E1 09 4D 44 DD +R 00 00 01 00 +T 1F 19 00 00 5E 0A DD 56 0B 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 11 00 +T 27 19 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T 2E 19 00 00 4E FC DD 46 FD DD 5E FE DD 56 FF +R 00 00 01 00 +T 39 19 00 00 3E 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 3F 19 00 00 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 04 14 00 02 09 09 00 +T 44 19 00 00 +R 00 00 01 00 +T 44 19 00 00 CD 00 00 00 00 EC FF 11 +R 00 00 01 00 02 05 19 00 +T 4A 19 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 15 00 2B 09 04 00 +T 4F 19 00 00 00 00 00 00 CD 00 00 00 00 2A +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 55 19 00 00 00 00 00 00 7D B4 28 0F R 00 00 01 00 00 04 04 00 -T 3A 16 00 00 +T 5B 19 00 00 R 00 00 01 00 -T 3A 16 00 00 21 D6 05 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 41 16 00 00 F1 18 28 +T 5B 19 00 00 21 D6 05 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 61 19 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T 68 19 00 00 18 2D R 00 00 01 00 -T 44 16 00 00 +T 6A 19 00 00 R 00 00 01 00 -T 44 16 00 00 21 00 00 00 00 E5 01 14 00 21 +T 6A 19 00 00 21 00 00 00 00 E5 01 14 00 21 R 00 00 01 00 02 05 12 00 -T 4C 16 00 00 02 00 39 5D 54 CD 00 00 00 00 F1 -R 00 00 01 00 02 0A 0E 00 -T 55 16 00 00 7D B4 28 0E DD 7E EC FE 79 28 0C +T 72 19 00 00 02 00 39 5D 54 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 0F 00 +T 7A 19 00 00 00 00 00 00 CD 00 00 00 00 F1 7D +R 00 00 01 00 02 04 0F 00 02 09 14 00 +T 81 19 00 00 B4 28 0E DD 7E EC FE 79 28 0C DD R 00 00 01 00 -T 60 16 00 00 DD 7E EC FE 59 28 05 +T 8C 19 00 00 7E EC FE 59 28 05 R 00 00 01 00 -T 67 16 00 00 +T 92 19 00 00 R 00 00 01 00 -T 67 16 00 00 +T 92 19 00 00 R 00 00 01 00 -T 67 16 00 00 +T 92 19 00 00 R 00 00 01 00 -T 67 16 00 00 +T 92 19 00 00 R 00 00 01 00 -T 67 16 00 00 +T 92 19 00 00 R 00 00 01 00 -T 67 16 00 00 21 00 00 18 03 +T 92 19 00 00 21 00 00 18 03 R 00 00 01 00 -T 6C 16 00 00 +T 97 19 00 00 R 00 00 01 00 -T 6C 16 00 00 +T 97 19 00 00 R 00 00 01 00 -T 6C 16 00 00 21 01 00 +T 97 19 00 00 21 01 00 R 00 00 01 00 -T 6F 16 00 00 +T 9A 19 00 00 R 00 00 01 00 -T 6F 16 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 72 16 00 00 +T 9A 19 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 9D 19 00 00 R 00 00 01 00 -T 72 16 00 00 CD 00 00 00 00 F8 FF DD 36 FC 01 -R 00 00 01 00 02 05 18 00 -T 7B 16 00 00 DD 36 FD 00 DD 6E 02 DD 66 03 DD +T 9D 19 00 00 CD 00 00 00 00 F8 FF DD 36 FC 01 +R 00 00 01 00 02 05 19 00 +T A6 19 00 00 DD 36 FD 00 DD 6E 02 DD 66 03 DD R 00 00 01 00 -T 86 16 00 00 75 FE DD 74 FF 2B DD 75 FE DD 74 +T B1 19 00 00 75 FE DD 74 FF 2B DD 75 FE DD 74 R 00 00 01 00 -T 91 16 00 00 FF 4D 44 21 00 00 CD 00 00 00 00 -R 00 00 01 00 02 0B 1B 00 -T 9A 16 00 00 30 6C DD 6E FC DD 66 FD 29 DD 4E +T BC 19 00 00 FF 4D 44 21 00 00 CD 00 00 00 00 +R 00 00 01 00 02 0B 1C 00 +T C5 19 00 00 30 76 DD 6E FC DD 66 FD 29 DD 4E R 00 00 01 00 -T A5 16 00 00 04 DD 46 05 09 46 23 66 68 DD 75 +T D0 19 00 00 04 DD 46 05 09 46 23 66 68 DD 75 R 00 00 01 00 -T B0 16 00 00 FA DD 74 FB 7E FE 2D 20 4F +T DB 19 00 00 FA DD 74 FB 7E FE 2D 20 59 R 00 00 01 00 -T B9 16 00 00 +T E4 19 00 00 R 00 00 01 00 -T B9 16 00 00 +T E4 19 00 00 R 00 00 01 00 -T B9 16 00 00 +T E4 19 00 00 R 00 00 01 00 -T B9 16 00 00 DD 6E FA DD 66 FB 23 7E FE 79 28 +T E4 19 00 00 DD 6E FA DD 66 FB 23 7E FE 79 28 R 00 00 01 00 -T C4 16 00 00 27 DD 6E FA DD 66 FB 23 7E FE 59 +T EF 19 00 00 31 DD 6E FA DD 66 FB 23 7E FE 59 R 00 00 01 00 -T CF 16 00 00 28 1B +T FA 19 00 00 28 25 R 00 00 01 00 -T D1 16 00 00 +T FC 19 00 00 R 00 00 01 00 -T D1 16 00 00 +T FC 19 00 00 R 00 00 01 00 -T D1 16 00 00 +T FC 19 00 00 R 00 00 01 00 -T D1 16 00 00 DD 6E FA DD 66 FB E5 21 +T FC 19 00 00 DD 6E FA DD 66 FB E5 21 R 00 00 01 00 -T D9 16 00 00 D9 05 00 00 E5 21 00 00 00 00 E5 -R 00 00 01 00 00 04 02 00 02 0A 09 00 -T E0 16 00 00 CD 00 00 00 00 F1 F1 F1 11 01 00 -R 00 00 01 00 02 05 20 00 -T E9 16 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 21 00 -T EC 16 00 00 +T 04 1A 00 00 D9 05 00 00 E5 21 00 00 00 00 E5 +R 00 00 01 00 00 04 02 00 02 0A 0A 00 +T 0B 1A 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 22 00 02 0A 22 00 +T 11 1A 00 00 00 00 00 00 F1 F1 F1 11 01 00 3E +R 00 00 01 00 02 04 14 00 +T 1A 1A 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T 1F 1A 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 21 1A 00 00 R 00 00 01 00 -T EC 16 00 00 2A 00 00 00 00 23 22 00 00 00 00 +T 21 1A 00 00 2A 00 00 00 00 23 22 00 00 00 00 R 00 00 01 00 00 05 04 00 00 0B 04 00 -T F3 16 00 00 DD 34 FC 20 03 DD 34 FD +T 28 1A 00 00 DD 34 FC 20 03 DD 34 FD R 00 00 01 00 -T FB 16 00 00 +T 30 1A 00 00 R 00 00 01 00 -T FB 16 00 00 DD 6E FE DD 66 FF 2B DD 75 FE DD +T 30 1A 00 00 DD 6E FE DD 66 FF 2B DD 75 FE DD R 00 00 01 00 -T 06 17 00 00 74 FF +T 3B 1A 00 00 74 FF R 00 00 01 00 -T 08 17 00 00 +T 3D 1A 00 00 R 00 00 01 00 -T 08 17 00 00 3E 01 DD AE FE DD B6 FF 28 13 +T 3D 1A 00 00 3E 01 DD AE FE DD B6 FF 28 1D R 00 00 01 00 -T 12 17 00 00 +T 47 1A 00 00 R 00 00 01 00 -T 12 17 00 00 21 EC 05 00 00 E5 21 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 09 00 -T 19 17 00 00 E5 CD 00 00 00 00 F1 F1 11 01 00 -R 00 00 01 00 02 06 20 00 -T 22 17 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 21 00 -T 25 17 00 00 +T 47 1A 00 00 21 EC 05 00 00 E5 21 00 00 00 00 +R 00 00 01 00 00 05 02 00 02 0B 0A 00 +T 4E 1A 00 00 E5 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 22 00 02 0B 22 00 +T 54 1A 00 00 CD 00 00 00 00 F1 F1 11 01 00 3E +R 00 00 01 00 02 05 14 00 +T 5D 1A 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T 62 1A 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 64 1A 00 00 R 00 00 01 00 -T 25 17 00 00 DD 6E FC DD 66 FD 29 DD 4E 04 DD +T 64 1A 00 00 DD 6E FC DD 66 FD 29 DD 4E 04 DD R 00 00 01 00 -T 30 17 00 00 46 05 09 4E 23 46 11 02 00 00 00 +T 6F 1A 00 00 46 05 09 4E 23 46 11 02 00 00 00 R 00 00 01 00 00 0B 03 00 -T 39 17 00 00 CD 00 00 00 00 21 02 80 E5 21 -R 00 00 01 00 02 05 15 00 -T 41 17 00 00 02 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 03 00 02 0A 1C 00 -T 48 17 00 00 F1 22 00 00 00 00 CB 7C 28 1A -R 00 00 01 00 00 06 03 00 -T 50 17 00 00 -R 00 00 01 00 -T 50 17 00 00 21 05 06 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 08 00 -T 57 17 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 14 00 02 0B 04 00 -T 5E 17 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 10 00 -T 65 17 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 21 00 -T 6A 17 00 00 -R 00 00 01 00 -T 6A 17 00 00 11 04 00 CD 5B 14 00 00 DD 75 F8 -R 00 00 01 00 00 08 01 00 -T 73 17 00 00 DD 74 F9 01 1E 00 C5 01 -R 00 00 01 00 -T 7B 17 00 00 06 04 00 00 EB CD 00 00 00 00 E1 -R 00 00 01 00 00 04 03 00 02 0A 11 00 -T 82 17 00 00 2A 06 04 00 00 01 C6 31 A7 ED 42 +T 78 1A 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 16 00 02 0A 16 00 +T 7E 1A 00 00 00 00 00 00 21 02 80 E5 21 +R 00 00 01 00 02 04 14 00 +T 85 1A 00 00 02 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 0A 1D 00 +T 8B 1A 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 1D 00 02 09 14 00 +T 92 1A 00 00 22 00 00 00 00 CB 7C 28 2E R 00 00 01 00 00 05 03 00 -T 8B 17 00 00 28 45 +T 99 1A 00 00 +R 00 00 01 00 +T 99 1A 00 00 21 05 06 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 08 00 +T 9F 1A 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 14 00 +T A6 1A 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 15 00 2B 0A 04 00 +T AC 1A 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T B2 1A 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 10 00 +T B7 1A 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 10 00 02 09 14 00 +T BD 1A 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T C2 1A 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T C7 1A 00 00 +R 00 00 01 00 +T C7 1A 00 00 11 04 00 3E 13 17 00 00 21 +R 00 00 01 00 29 08 01 00 +T CD 1A 00 00 13 17 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T D4 1A 00 00 F8 DD 74 F9 01 1E 00 C5 01 +R 00 00 01 00 +T DD 1A 00 00 06 04 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 0A 11 00 +T E3 1A 00 00 00 00 00 00 CD 00 00 00 00 E1 2A +R 00 00 01 00 02 04 11 00 02 09 14 00 +T EA 1A 00 00 06 04 00 00 01 C6 31 A7 ED 42 28 +R 00 00 01 00 00 04 03 00 +T F3 1A 00 00 5E R 00 00 01 00 -T 8D 17 00 00 +T F4 1A 00 00 R 00 00 01 00 -T 8D 17 00 00 21 06 04 00 00 4E 23 46 C5 2A +T F4 1A 00 00 21 06 04 00 00 4E 23 46 C5 2A R 00 00 01 00 00 05 03 00 -T 95 17 00 00 04 04 00 00 E5 21 12 06 00 00 E5 +T FC 1A 00 00 04 04 00 00 E5 21 12 06 00 00 E5 R 00 00 01 00 00 04 03 00 00 0A 02 00 -T 9C 17 00 00 CD 00 00 00 00 F1 F1 F1 CD -R 00 00 01 00 02 05 08 00 -T A3 17 00 00 28 16 00 00 7D B4 20 06 -R 00 00 01 00 00 04 01 00 -T A9 17 00 00 -R 00 00 01 00 -T A9 17 00 00 11 01 00 CD 00 00 00 00 -R 00 00 01 00 02 08 21 00 -T AF 17 00 00 -R 00 00 01 00 -T AF 17 00 00 21 C6 31 22 06 04 00 00 21 1E 00 +T 03 1B 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 08 00 02 0A 08 00 +T 09 1B 00 00 00 00 00 00 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 0F 1B 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 14 1B 00 00 00 00 00 00 7D B4 20 0B +R 00 00 01 00 02 04 14 00 +T 1A 1B 00 00 +R 00 00 01 00 +T 1A 1B 00 00 11 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 23 00 +T 20 1B 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T 25 1B 00 00 +R 00 00 01 00 +T 25 1B 00 00 21 C6 31 22 06 04 00 00 21 1E 00 R 00 00 01 00 00 08 03 00 -T B8 17 00 00 E5 DD 4E F8 DD 46 F9 11 +T 2E 1B 00 00 E5 DD 4E F8 DD 46 F9 11 R 00 00 01 00 -T C0 17 00 00 06 04 00 00 CD 00 00 00 00 E1 DD -R 00 00 01 00 00 04 03 00 02 09 11 00 -T C7 17 00 00 4E F8 DD 46 F9 11 04 00 CD +T 36 1B 00 00 06 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 11 00 +T 3B 1B 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 11 00 02 09 14 00 +T 42 1B 00 00 4E F8 DD 46 F9 11 04 00 3E R 00 00 01 00 -T D0 17 00 00 8B 14 00 00 -R 00 00 01 00 00 04 01 00 -T D2 17 00 00 +T 4B 1B 00 00 52 17 00 00 21 52 17 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 50 1B 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 52 1B 00 00 R 00 00 01 00 -T D2 17 00 00 2A 08 04 00 00 01 FB FF 09 E5 21 +T 52 1B 00 00 2A 08 04 00 00 01 FB FF 09 E5 21 R 00 00 01 00 00 05 03 00 -T DB 17 00 00 0A 04 00 00 4E 23 46 C5 21 +T 5B 1B 00 00 0A 04 00 00 4E 23 46 C5 21 R 00 00 01 00 00 04 03 00 -T E2 17 00 00 0C 04 00 00 4E 23 46 C5 21 +T 62 1B 00 00 0C 04 00 00 4E 23 46 C5 21 R 00 00 01 00 00 04 03 00 -T E9 17 00 00 02 00 00 00 E5 21 3F 06 00 00 E5 +T 69 1B 00 00 02 00 00 00 E5 21 3F 06 00 00 E5 R 00 00 01 00 00 04 03 00 00 0A 02 00 -T F0 17 00 00 CD 00 00 00 00 F1 F1 F1 F1 F1 CD -R 00 00 01 00 02 05 08 00 -T F9 17 00 00 28 16 00 00 7D B4 20 06 -R 00 00 01 00 00 04 01 00 -T FF 17 00 00 -R 00 00 01 00 -T FF 17 00 00 11 01 00 CD 00 00 00 00 -R 00 00 01 00 02 08 21 00 -T 05 18 00 00 -R 00 00 01 00 -T 05 18 00 00 ED 4B 16 04 00 00 2A 18 04 00 00 +T 70 1B 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 08 00 02 0A 08 00 +T 76 1B 00 00 00 00 00 00 F1 F1 F1 F1 F1 3E +R 00 00 01 00 02 04 14 00 +T 7E 1B 00 00 44 19 00 00 21 44 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 83 1B 00 00 00 00 00 00 7D B4 20 0B +R 00 00 01 00 02 04 14 00 +T 89 1B 00 00 +R 00 00 01 00 +T 89 1B 00 00 11 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 23 00 +T 8F 1B 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T 94 1B 00 00 +R 00 00 01 00 +T 94 1B 00 00 ED 4B 16 04 00 00 2A 18 04 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 0C 18 00 00 A7 ED 42 EB CD 00 00 00 00 22 -R 00 00 01 00 02 09 1F 00 -T 14 18 00 00 34 04 00 00 7D B4 20 0A +T 9B 1B 00 00 A7 ED 42 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 21 00 +T A2 1B 00 00 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 04 21 00 02 09 14 00 +T A8 1B 00 00 34 04 00 00 7D B4 20 0B R 00 00 01 00 00 04 03 00 -T 1A 18 00 00 +T AE 1B 00 00 R 00 00 01 00 -T 1A 18 00 00 DD 36 FA 79 06 00 00 DD 36 FB +T AE 1B 00 00 DD 36 FA 79 06 00 00 DD 36 FB R 00 00 01 00 09 07 02 00 -T 21 18 00 00 79 06 00 00 18 6D -R 00 00 01 00 89 04 02 00 -T 24 18 00 00 +T B5 1B 00 00 79 06 00 00 C3 3A 1C 00 00 +R 00 00 01 00 89 04 02 00 00 09 01 00 +T B9 1B 00 00 R 00 00 01 00 -T 24 18 00 00 ED 4B 16 04 00 00 2A 18 04 00 00 +T B9 1B 00 00 ED 4B 16 04 00 00 2A 18 04 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 2B 18 00 00 A7 ED 42 E5 0E 00 ED 5B +T C0 1B 00 00 A7 ED 42 E5 0E 00 ED 5B R 00 00 01 00 -T 33 18 00 00 34 04 00 00 CD 00 00 00 00 E1 ED -R 00 00 01 00 00 04 03 00 02 09 05 00 -T 3A 18 00 00 4B 18 04 00 00 2A 1A 04 00 00 A7 +T C8 1B 00 00 34 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 05 00 +T CD 1B 00 00 00 00 00 00 CD 00 00 00 00 E1 ED +R 00 00 01 00 02 04 05 00 02 09 14 00 +T D4 1B 00 00 4B 18 04 00 00 2A 1A 04 00 00 A7 R 00 00 01 00 00 05 03 00 00 0A 03 00 -T 41 18 00 00 ED 42 EB CD 00 00 00 00 22 -R 00 00 01 00 02 08 1F 00 -T 48 18 00 00 36 04 00 00 7D B4 20 0A +T DB 1B 00 00 ED 42 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 21 00 +T E1 1B 00 00 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 04 21 00 02 09 14 00 +T E7 1B 00 00 36 04 00 00 7D B4 20 0A R 00 00 01 00 00 04 03 00 -T 4E 18 00 00 +T ED 1B 00 00 R 00 00 01 00 -T 4E 18 00 00 DD 36 FA 86 06 00 00 DD 36 FB +T ED 1B 00 00 DD 36 FA 86 06 00 00 DD 36 FB R 00 00 01 00 09 07 02 00 -T 55 18 00 00 86 06 00 00 18 39 +T F4 1B 00 00 86 06 00 00 18 43 R 00 00 01 00 89 04 02 00 -T 58 18 00 00 +T F7 1B 00 00 R 00 00 01 00 -T 58 18 00 00 ED 4B 18 04 00 00 2A 1A 04 00 00 +T F7 1B 00 00 ED 4B 18 04 00 00 2A 1A 04 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 5F 18 00 00 A7 ED 42 E5 0E 00 ED 5B +T FE 1B 00 00 A7 ED 42 E5 0E 00 ED 5B R 00 00 01 00 -T 67 18 00 00 36 04 00 00 CD 00 00 00 00 E1 2A -R 00 00 01 00 00 04 03 00 02 09 05 00 -T 6E 18 00 00 0A 04 00 00 29 29 29 22 +T 06 1C 00 00 36 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 05 00 +T 0B 1C 00 00 00 00 00 00 CD 00 00 00 00 E1 2A +R 00 00 01 00 02 04 05 00 02 09 14 00 +T 12 1C 00 00 0A 04 00 00 29 29 29 22 R 00 00 01 00 00 04 03 00 -T 74 18 00 00 24 04 00 00 ED 4B 08 04 00 00 ED +T 18 1C 00 00 24 04 00 00 ED 4B 08 04 00 00 ED R 00 00 01 00 00 04 03 00 00 0A 03 00 -T 7B 18 00 00 43 26 04 00 00 EB CD 00 00 00 00 -R 00 00 01 00 00 05 03 00 02 0B 1F 00 -T 82 18 00 00 22 38 04 00 00 7D B4 20 23 -R 00 00 01 00 00 05 03 00 -T 89 18 00 00 +T 1F 1C 00 00 43 26 04 00 00 EB 3E 00 00 00 00 +R 00 00 01 00 00 05 03 00 2B 0B 21 00 +T 25 1C 00 00 21 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 05 21 00 02 0A 14 00 +T 2C 1C 00 00 38 04 00 00 7D B4 20 2D +R 00 00 01 00 00 04 03 00 +T 32 1C 00 00 R 00 00 01 00 -T 89 18 00 00 DD 36 FA 93 06 00 00 DD 36 FB +T 32 1C 00 00 DD 36 FA 93 06 00 00 DD 36 FB R 00 00 01 00 09 07 02 00 -T 90 18 00 00 93 06 00 00 +T 39 1C 00 00 93 06 00 00 R 00 00 01 00 89 04 02 00 -T 91 18 00 00 -R 00 00 01 00 -T 91 18 00 00 DD 6E FA DD 66 FB E5 21 -R 00 00 01 00 -T 99 18 00 00 9F 06 00 00 E5 21 00 00 00 00 E5 -R 00 00 01 00 00 04 02 00 02 0A 09 00 -T A0 18 00 00 CD 00 00 00 00 F1 F1 F1 11 01 00 -R 00 00 01 00 02 05 20 00 -T A9 18 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 21 00 -T AC 18 00 00 -R 00 00 01 00 -T AC 18 00 00 2A 24 04 00 00 E5 0E 00 ED 5B +T 3A 1C 00 00 +R 00 00 01 00 +T 3A 1C 00 00 DD 6E FA DD 66 FB E5 21 +R 00 00 01 00 +T 42 1C 00 00 9F 06 00 00 E5 21 00 00 00 00 E5 +R 00 00 01 00 00 04 02 00 02 0A 0A 00 +T 49 1C 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 22 00 02 0A 22 00 +T 4F 1C 00 00 00 00 00 00 F1 F1 F1 11 01 00 3E +R 00 00 01 00 02 04 14 00 +T 58 1C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T 5D 1C 00 00 00 00 00 00 +R 00 00 01 00 02 04 14 00 +T 5F 1C 00 00 +R 00 00 01 00 +T 5F 1C 00 00 2A 24 04 00 00 E5 0E 00 ED 5B R 00 00 01 00 00 05 03 00 -T B4 18 00 00 38 04 00 00 CD 00 00 00 00 E1 21 -R 00 00 01 00 00 04 03 00 02 09 05 00 -T BB 18 00 00 BA 06 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T C2 18 00 00 11 00 00 00 00 CD 00 00 00 00 CD -R 00 00 01 00 02 05 14 00 02 0A 04 00 -T C9 18 00 00 E6 00 00 00 21 D5 06 00 00 E5 CD -R 00 00 01 00 00 04 01 00 00 09 02 00 -T D0 18 00 00 00 00 00 00 F1 11 00 00 00 00 CD -R 00 00 01 00 02 04 08 00 02 0A 14 00 -T D7 18 00 00 00 00 00 00 CD 56 05 00 00 21 -R 00 00 01 00 02 04 04 00 00 09 01 00 -T DD 18 00 00 F7 06 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T E4 18 00 00 11 00 00 00 00 CD 00 00 00 00 CD -R 00 00 01 00 02 05 14 00 02 0A 04 00 -T EB 18 00 00 D0 07 00 00 21 1B 07 00 00 E5 CD -R 00 00 01 00 00 04 01 00 00 09 02 00 -T F2 18 00 00 00 00 00 00 F1 11 00 00 00 00 CD -R 00 00 01 00 02 04 08 00 02 0A 14 00 -T F9 18 00 00 00 00 00 00 CD AD 0E 00 00 21 -R 00 00 01 00 02 04 04 00 00 09 01 00 -T FF 18 00 00 40 07 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 08 00 -T 06 19 00 00 11 00 00 00 00 CD 00 00 00 00 CD -R 00 00 01 00 02 05 14 00 02 0A 04 00 -T 0D 19 00 00 9C 0F 00 00 ED 5B 00 00 00 00 CD -R 00 00 01 00 00 04 01 00 00 0A 03 00 -T 14 19 00 00 00 00 00 00 21 5F 07 00 00 E5 CD -R 00 00 01 00 02 04 0B 00 00 09 02 00 -T 1B 19 00 00 00 00 00 00 F1 11 00 00 CD -R 00 00 01 00 02 04 08 00 -T 22 19 00 00 00 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 04 21 00 02 09 0F 00 -T 27 19 00 00 -R 00 00 01 00 -T 27 19 00 00 CD 00 00 00 00 FA FF DD 6E 08 DD -R 00 00 01 00 02 05 18 00 -T 30 19 00 00 66 09 DD 75 FC DD 74 FD -R 00 00 01 00 -T 38 19 00 00 -R 00 00 01 00 -T 38 19 00 00 DD 6E 0E DD 66 0F E5 DD 6E 0C DD -R 00 00 01 00 -T 43 19 00 00 66 0D E5 DD 6E FC DD 66 FD 01 -R 00 00 01 00 -T 4D 19 00 00 00 00 CD 00 00 00 00 D2 -R 00 00 01 00 02 07 17 00 -T 53 19 00 00 06 1A 00 00 +T 67 1C 00 00 38 04 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 05 00 +T 6C 1C 00 00 00 00 00 00 CD 00 00 00 00 E1 21 +R 00 00 01 00 02 04 05 00 02 09 14 00 +T 73 1C 00 00 BA 06 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T 79 1C 00 00 00 00 00 00 CD 00 00 00 00 F1 11 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 80 1C 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 15 00 2B 09 04 00 +T 85 1C 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 8B 1C 00 00 4A 01 00 00 21 4A 01 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 90 1C 00 00 00 00 00 00 21 D5 06 00 00 E5 3E +R 00 00 01 00 02 04 14 00 00 09 02 00 +T 97 1C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 9C 1C 00 00 00 00 00 00 F1 11 00 00 00 00 3E +R 00 00 01 00 02 04 14 00 02 0A 15 00 +T A3 1C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 04 00 02 09 04 00 +T A8 1C 00 00 00 00 00 00 3E 29 06 00 00 21 +R 00 00 01 00 02 04 14 00 29 09 01 00 +T AD 1C 00 00 29 06 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T B3 1C 00 00 F7 06 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T B9 1C 00 00 00 00 00 00 CD 00 00 00 00 F1 11 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T C0 1C 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 15 00 2B 09 04 00 +T C5 1C 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 04 00 02 09 14 00 +T CB 1C 00 00 D0 08 00 00 21 D0 08 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T D0 1C 00 00 00 00 00 00 21 1B 07 00 00 E5 3E +R 00 00 01 00 02 04 14 00 00 09 02 00 +T D7 1C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T DC 1C 00 00 00 00 00 00 F1 11 00 00 00 00 3E +R 00 00 01 00 02 04 14 00 02 0A 15 00 +T E3 1C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 04 00 02 09 04 00 +T E8 1C 00 00 00 00 00 00 3E 98 10 00 00 21 +R 00 00 01 00 02 04 14 00 29 09 01 00 +T ED 1C 00 00 98 10 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T F3 1C 00 00 40 07 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 08 00 +T F9 1C 00 00 00 00 00 00 CD 00 00 00 00 F1 11 +R 00 00 01 00 02 04 08 00 02 09 14 00 +T 00 1D 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 15 00 2B 09 04 00 +T 05 1D 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 0B 1D 00 00 B2 11 00 00 21 B2 11 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 10 1D 00 00 00 00 00 00 ED 5B 00 00 00 00 3E +R 00 00 01 00 02 04 14 00 00 0A 03 00 +T 17 1D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0C 00 02 09 0C 00 +T 1C 1D 00 00 00 00 00 00 21 5F 07 00 00 E5 3E +R 00 00 01 00 02 04 14 00 00 09 02 00 +T 23 1D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 28 1D 00 00 00 00 00 00 F1 11 00 00 3E +R 00 00 01 00 02 04 14 00 +T 2F 1D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T 34 1D 00 00 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 04 14 00 02 09 09 00 +T 39 1D 00 00 +R 00 00 01 00 +T 39 1D 00 00 CD 00 00 00 00 FA FF DD 6E 0A DD +R 00 00 01 00 02 05 19 00 +T 42 1D 00 00 66 0B DD 75 FC DD 74 FD +R 00 00 01 00 +T 4A 1D 00 00 +R 00 00 01 00 +T 4A 1D 00 00 DD 6E 10 DD 66 11 E5 DD 6E 0E DD +R 00 00 01 00 +T 55 1D 00 00 66 0F E5 DD 6E FC DD 66 FD 01 +R 00 00 01 00 +T 5F 1D 00 00 00 00 CD 00 00 00 00 D2 +R 00 00 01 00 02 07 18 00 +T 65 1D 00 00 2C 1E 00 00 R 00 00 01 00 00 04 01 00 -T 55 19 00 00 +T 67 1D 00 00 R 00 00 01 00 -T 55 19 00 00 DD 4E 0C DD 46 0D DD 6E FC DD 66 +T 67 1D 00 00 DD 4E 0E DD 46 0F DD 6E FC DD 66 R 00 00 01 00 -T 60 19 00 00 FD 3E 02 84 67 7D E6 00 5F 7C E6 +T 72 1D 00 00 FD 3E 02 84 67 7D E6 00 5F 7C E6 R 00 00 01 00 -T 6B 19 00 00 FE 57 CD 00 00 00 00 DD 75 FE DD -R 00 00 01 00 02 07 1A 00 -T 74 19 00 00 74 FF DD 4E FC DD 46 FD A7 ED 42 +T 7D 1D 00 00 FE 57 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 1B 00 +T 82 1D 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 1B 00 02 09 14 00 +T 89 1D 00 00 FE DD 74 FF DD 4E FC DD 46 FD A7 R 00 00 01 00 -T 7F 19 00 00 01 00 02 A7 ED 42 30 16 +T 94 1D 00 00 ED 42 01 00 02 A7 ED 42 30 1B R 00 00 01 00 -T 87 19 00 00 +T 9E 1D 00 00 R 00 00 01 00 -T 87 19 00 00 06 09 DD 5E FC DD 56 FD CD +T 9E 1D 00 00 06 09 DD 5E FC DD 56 FD CD R 00 00 01 00 -T 90 19 00 00 00 00 00 00 CD 5B 14 00 00 DD 75 -R 00 00 01 00 02 04 00 00 00 09 01 00 -T 97 19 00 00 FA DD 74 FB 18 08 +T A7 1D 00 00 00 00 00 00 3E 13 17 00 00 21 +R 00 00 01 00 02 04 00 00 29 09 01 00 +T AC 1D 00 00 13 17 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 14 00 +T B3 1D 00 00 FA DD 74 FB 18 08 R 00 00 01 00 -T 9D 19 00 00 +T B9 1D 00 00 R 00 00 01 00 -T 9D 19 00 00 DD 36 FA 02 02 00 00 DD 36 FB +T B9 1D 00 00 DD 36 FA 02 02 00 00 DD 36 FB R 00 00 01 00 09 07 03 00 -T A4 19 00 00 02 02 00 00 +T C0 1D 00 00 02 02 00 00 R 00 00 01 00 89 04 03 00 -T A5 19 00 00 +T C1 1D 00 00 R 00 00 01 00 -T A5 19 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 +T C1 1D 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 R 00 00 01 00 -T B0 19 00 00 FF A7 ED 42 E5 79 E6 FF 6F 78 E6 +T CC 1D 00 00 FF A7 ED 42 E5 79 E6 FF 6F 78 E6 R 00 00 01 00 -T BB 19 00 00 01 67 DD 5E FA DD 56 FB 19 4D 44 +T D7 1D 00 00 01 67 DD 5E FA DD 56 FB 19 4D 44 R 00 00 01 00 -T C6 19 00 00 DD 5E 08 DD 56 09 DD 6E FC DD 66 +T E2 1D 00 00 DD 5E 0A DD 56 0B DD 6E FC DD 66 R 00 00 01 00 -T D1 19 00 00 FD A7 ED 52 DD 5E 02 DD 56 03 19 +T ED 1D 00 00 FD A7 ED 52 DD 5E 02 DD 56 03 19 R 00 00 01 00 -T DC 19 00 00 EB CD 00 00 00 00 E1 DD 4E FA DD -R 00 00 01 00 02 06 11 00 -T E5 19 00 00 46 FB C5 06 09 DD 5E FC DD 56 FD +T F8 1D 00 00 EB 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 11 00 02 0B 11 00 +T FE 1D 00 00 CD 00 00 00 00 E1 DD 4E FA DD 46 +R 00 00 01 00 02 05 14 00 +T 07 1E 00 00 FB C5 06 09 DD 5E FC DD 56 FD CD R 00 00 01 00 -T F0 19 00 00 CD 00 00 00 00 C1 CD 8B 14 00 00 -R 00 00 01 00 02 05 00 00 00 0B 01 00 -T F7 19 00 00 DD 6E FE DD 66 FF DD 75 FC DD 74 +T 12 1E 00 00 00 00 00 00 3E 52 17 00 00 21 +R 00 00 01 00 02 04 00 00 29 09 01 00 +T 17 1E 00 00 52 17 00 00 C1 CD 00 00 00 00 DD +R 00 00 01 00 00 04 01 00 02 0A 14 00 +T 1E 1E 00 00 6E FE DD 66 FF DD 75 FC DD 74 FD R 00 00 01 00 -T 02 1A 00 00 FD C3 38 19 00 00 -R 00 00 01 00 00 06 01 00 -T 06 1A 00 00 +T 29 1E 00 00 C3 4A 1D 00 00 +R 00 00 01 00 00 05 01 00 +T 2C 1E 00 00 R 00 00 01 00 -T 06 1A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 09 1A 00 00 +T 2C 1E 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 2F 1E 00 00 R 00 00 01 00 -T 09 1A 00 00 CD 00 00 00 00 F4 FF DD 6E 02 DD -R 00 00 01 00 02 05 18 00 -T 12 1A 00 00 66 03 DD 75 FA DD 74 FB +T 2F 1E 00 00 CD 00 00 00 00 F4 FF DD 6E 02 DD +R 00 00 01 00 02 05 19 00 +T 38 1E 00 00 66 03 DD 75 FA DD 74 FB R 00 00 01 00 -T 1A 1A 00 00 +T 40 1E 00 00 R 00 00 01 00 -T 1A 1A 00 00 DD 4E 04 DD 46 05 DD 6E FA DD 66 +T 40 1E 00 00 DD 4E 04 DD 46 05 DD 6E FA DD 66 R 00 00 01 00 -T 25 1A 00 00 FB A7 ED 42 D2 46 1B 00 00 +T 4B 1E 00 00 FB A7 ED 42 D2 7B 1F 00 00 R 00 00 01 00 00 09 01 00 -T 2C 1A 00 00 +T 52 1E 00 00 R 00 00 01 00 -T 2C 1A 00 00 DD 4E 04 DD 46 05 DD 6E FA DD 66 +T 52 1E 00 00 DD 4E 04 DD 46 05 DD 6E FA DD 66 R 00 00 01 00 -T 37 1A 00 00 FB 3E 02 84 67 7D E6 00 5F 7C E6 +T 5D 1E 00 00 FB 3E 02 84 67 7D E6 00 5F 7C E6 R 00 00 01 00 -T 42 1A 00 00 FE 57 CD 00 00 00 00 DD 75 FC DD -R 00 00 01 00 02 07 1A 00 -T 4B 1A 00 00 74 FD 06 09 DD 5E FA DD 56 FB CD +T 68 1E 00 00 FE 57 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 1B 00 +T 6D 1E 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 1B 00 02 09 14 00 +T 74 1E 00 00 FC DD 74 FD 06 09 DD 5E FA DD 56 R 00 00 01 00 -T 56 1A 00 00 00 00 00 00 CD 5B 14 00 00 DD 75 -R 00 00 01 00 02 04 00 00 00 09 01 00 -T 5D 1A 00 00 F4 DD 74 F5 DD 7E FA E6 FF 4F DD +T 7F 1E 00 00 FB CD 00 00 00 00 3E 13 17 00 00 +R 00 00 01 00 02 06 00 00 29 0B 01 00 +T 85 1E 00 00 21 13 17 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 14 00 +T 8C 1E 00 00 75 F4 DD 74 F5 DD 7E FA E6 FF 4F R 00 00 01 00 -T 68 1A 00 00 7E FB E6 01 47 09 DD 75 F6 DD 74 +T 97 1E 00 00 DD 7E FB E6 01 47 09 DD 75 F6 DD R 00 00 01 00 -T 73 1A 00 00 F7 DD 6E FA DD 66 FB DD 75 F8 DD +T A2 1E 00 00 74 F7 DD 6E FA DD 66 FB DD 75 F8 R 00 00 01 00 -T 7E 1A 00 00 74 F9 +T AD 1E 00 00 DD 74 F9 R 00 00 01 00 -T 80 1A 00 00 +T B0 1E 00 00 R 00 00 01 00 -T 80 1A 00 00 DD 4E FC DD 46 FD DD 6E F8 DD 66 +T B0 1E 00 00 DD 4E FC DD 46 FD DD 6E F8 DD 66 R 00 00 01 00 -T 8B 1A 00 00 F9 A7 ED 42 D2 37 1B 00 00 +T BB 1E 00 00 F9 A7 ED 42 D2 6C 1F 00 00 R 00 00 01 00 00 09 01 00 -T 92 1A 00 00 +T C2 1E 00 00 R 00 00 01 00 -T 92 1A 00 00 DD 6E F6 DD 66 F7 46 04 CA +T C2 1E 00 00 DD 6E F6 DD 66 F7 46 04 CA R 00 00 01 00 -T 9B 1A 00 00 24 1B 00 00 +T CB 1E 00 00 59 1F 00 00 R 00 00 01 00 00 04 01 00 -T 9D 1A 00 00 +T CD 1E 00 00 R 00 00 01 00 -T 9D 1A 00 00 DD 4E 02 DD 46 03 DD 6E F8 DD 66 +T CD 1E 00 00 DD 4E 02 DD 46 03 DD 6E F8 DD 66 R 00 00 01 00 -T A8 1A 00 00 F9 A7 ED 42 29 29 29 DD 75 FE DD +T D8 1E 00 00 F9 A7 ED 42 29 29 29 DD 75 FE DD R 00 00 01 00 -T B3 1A 00 00 74 FF AF DD 77 F8 DD 77 F9 +T E3 1E 00 00 74 FF AF DD 77 F8 DD 77 F9 R 00 00 01 00 -T BC 1A 00 00 +T EC 1E 00 00 R 00 00 01 00 -T BC 1A 00 00 01 07 00 DD 6E F8 DD 66 F9 A7 ED +T EC 1E 00 00 01 07 00 DD 6E F8 DD 66 F9 A7 ED R 00 00 01 00 -T C7 1A 00 00 42 30 1D +T F7 1E 00 00 42 30 1D R 00 00 01 00 -T CA 1A 00 00 +T FA 1E 00 00 R 00 00 01 00 -T CA 1A 00 00 DD 6E F6 DD 66 F7 DD 46 F8 3E 01 +T FA 1E 00 00 DD 6E F6 DD 66 F7 DD 46 F8 3E 01 R 00 00 01 00 -T D5 1A 00 00 CD 00 00 00 00 A6 20 02 -R 00 00 01 00 02 05 1D 00 -T DB 1A 00 00 +T 05 1F 00 00 CD 00 00 00 00 A6 20 02 +R 00 00 01 00 02 05 1E 00 +T 0B 1F 00 00 R 00 00 01 00 -T DB 1A 00 00 18 0A +T 0B 1F 00 00 18 0A R 00 00 01 00 -T DD 1A 00 00 +T 0D 1F 00 00 R 00 00 01 00 -T DD 1A 00 00 DD 34 F8 20 03 DD 34 F9 +T 0D 1F 00 00 DD 34 F8 20 03 DD 34 F9 R 00 00 01 00 -T E5 1A 00 00 +T 15 1F 00 00 R 00 00 01 00 -T E5 1A 00 00 18 D5 +T 15 1F 00 00 18 D5 R 00 00 01 00 -T E7 1A 00 00 +T 17 1F 00 00 R 00 00 01 00 -T E7 1A 00 00 21 0A 00 39 7E DD 86 F8 77 23 7E +T 17 1F 00 00 21 0A 00 39 7E DD 86 F8 77 23 7E R 00 00 01 00 -T F2 1A 00 00 DD 8E F9 77 DD 6E F6 DD 66 F7 DD +T 22 1F 00 00 DD 8E F9 77 DD 6E F6 DD 66 F7 DD R 00 00 01 00 -T FD 1A 00 00 46 F8 3E 01 CD 00 00 00 00 B6 77 -R 00 00 01 00 02 09 1D 00 -T 06 1B 00 00 DD 4E F4 DD 46 F5 C5 06 09 DD 5E +T 2D 1F 00 00 46 F8 3E 01 CD 00 00 00 00 B6 77 +R 00 00 01 00 02 09 1E 00 +T 36 1F 00 00 DD 4E F4 DD 46 F5 C5 06 09 DD 5E R 00 00 01 00 -T 11 1B 00 00 FA DD 56 FB CD 00 00 00 00 C1 CD +T 41 1F 00 00 FA DD 56 FB CD 00 00 00 00 3E R 00 00 01 00 02 09 00 00 -T 1A 1B 00 00 8B 14 00 00 DD 6E FE DD 66 FF 18 -R 00 00 01 00 00 04 01 00 -T 23 1B 00 00 25 +T 49 1F 00 00 52 17 00 00 21 52 17 00 00 C1 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 4F 1F 00 00 00 00 00 00 DD 6E FE DD 66 FF 18 +R 00 00 01 00 02 04 14 00 +T 58 1F 00 00 25 R 00 00 01 00 -T 24 1B 00 00 +T 59 1F 00 00 R 00 00 01 00 -T 24 1B 00 00 DD 34 F6 20 03 DD 34 F7 +T 59 1F 00 00 DD 34 F6 20 03 DD 34 F7 R 00 00 01 00 -T 2C 1B 00 00 +T 61 1F 00 00 R 00 00 01 00 -T 2C 1B 00 00 DD 34 F8 20 03 DD 34 F9 +T 61 1F 00 00 DD 34 F8 20 03 DD 34 F9 R 00 00 01 00 -T 34 1B 00 00 +T 69 1F 00 00 R 00 00 01 00 -T 34 1B 00 00 C3 80 1A 00 00 +T 69 1F 00 00 C3 B0 1E 00 00 R 00 00 01 00 00 05 01 00 -T 37 1B 00 00 +T 6C 1F 00 00 R 00 00 01 00 -T 37 1B 00 00 DD 6E FC DD 66 FD DD 75 FA DD 74 +T 6C 1F 00 00 DD 6E FC DD 66 FD DD 75 FA DD 74 R 00 00 01 00 -T 42 1B 00 00 FB C3 1A 1A 00 00 +T 77 1F 00 00 FB C3 40 1E 00 00 R 00 00 01 00 00 06 01 00 -T 46 1B 00 00 +T 7B 1F 00 00 R 00 00 01 00 -T 46 1B 00 00 21 FF FF +T 7B 1F 00 00 21 FF FF R 00 00 01 00 -T 49 1B 00 00 +T 7E 1F 00 00 R 00 00 01 00 -T 49 1B 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 4C 1B 00 00 +T 7E 1F 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 09 00 +T 81 1F 00 00 R 00 00 01 00 -T 4C 1B 00 00 CD 00 00 00 00 D5 21 67 07 00 00 +T 81 1F 00 00 CD 00 00 00 00 D5 21 67 07 00 00 R 00 00 01 00 02 05 13 00 00 0B 02 00 -T 53 1B 00 00 E5 CD 00 00 00 00 F1 F1 11 -R 00 00 01 00 02 06 08 00 -T 5A 1B 00 00 00 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 02 04 14 00 02 09 04 00 -T 60 1B 00 00 01 00 CD 00 00 00 00 C3 -R 00 00 01 00 02 07 21 00 -T 66 1B 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 +T 88 1F 00 00 E5 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 08 00 02 0B 08 00 +T 8E 1F 00 00 CD 00 00 00 00 F1 F1 11 +R 00 00 01 00 02 05 14 00 +T 94 1F 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 15 00 2B 09 04 00 +T 99 1F 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 04 00 02 09 14 00 +T 9F 1F 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 23 00 +T A4 1F 00 00 00 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 02 04 23 00 02 09 14 00 +T AA 1F 00 00 00 00 00 00 +R 00 00 01 00 02 04 09 00 T 00 00 00 00 R 00 00 02 00 T 00 00 00 00 63 61 6E 27 74 20 73 65 65 6B 3A diff --git a/src/fsutil/m.bat b/src/fsutil/m.bat deleted file mode 100644 index e476e5ba..00000000 --- a/src/fsutil/m.bat +++ /dev/null @@ -1,13 +0,0 @@ -cl -Zi -I. -I..\kernel -DVAX -DUTIL -DDEBUG=1 -c utils.c -@if errorlevel 1 goto failure -cl -Zi -I. -I..\kernel -DVAX -DUTIL -DNATIVE -DDEBUG=1 -c mkfs.c -@if errorlevel 1 goto failure -link @mkfs.lnk -@if errorlevel 1 goto failure - -@echo SUCCESS -@goto done -:failure -@echo FAILURE -:done - diff --git a/src/fsutil/mkfs.c b/src/fsutil/mkfs.c index 9c0b56bc..22073d50 100644 --- a/src/fsutil/mkfs.c +++ b/src/fsutil/mkfs.c @@ -197,10 +197,17 @@ int da_read(dev, blk, addr) if (read(device_handle, addr, BUFSIZE) != BUFSIZE) { + if (errno == 0) + { + bfill(addr, 0xaa, BUFSIZE); /* for creation of unpadded initrd images */ + } + else + { printf("can't read: "); fflush(stdout); perror(device_name); exit(1); + } } #else bufptr buf = bread(dev, blk, 0); diff --git a/src/fsutil/mkfs.exe b/src/fsutil/mkfs.exe index 60123069..34770dde 100644 Binary files a/src/fsutil/mkfs.exe and b/src/fsutil/mkfs.exe differ diff --git a/src/fsutil/mkfs.lnk b/src/fsutil/mkfs.lnk index a7a9d4cb..e48eab74 100644 --- a/src/fsutil/mkfs.lnk +++ b/src/fsutil/mkfs.lnk @@ -1,12 +1,14 @@ -k ..\..\lib --l libcl.lib --l libsysl.lib +-l libcb.lib +-l libsysb.lib -l libiar.lib -m -u -i -o mkfs -bl RCODE=0x8100 -..\..\lib\c0l.rel +-bl CODE=0x4000,0x10000 +-bc CODE=0x4000 +..\..\lib\c0b.rel mkfs -utils +utils diff --git a/src/fsutil/mkfs.map b/src/fsutil/mkfs.map index 0ce2377c..6b653807 100644 --- a/src/fsutil/mkfs.map +++ b/src/fsutil/mkfs.map @@ -6,18 +6,18 @@ Area Addr Size Decimal Bytes (Attributes) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR - 00000000 l_CONST | 00000000 .__.ABS. | 00000000 ?CL64180L - 00000000 ?CL64180B | 00000014 e__DEFAUL | 00000014 l__DEFAUL - 00000232 l_CSTR | 000002D2 l_RCODE | 00000AA2 l_UDATA0 - 00000AD7 l_CDATA0 | 00000AD7 l_IDATA0 | 00001000 l_CSTACK - 00002955 l_CODE | 00008100 s_RCODE | 000083D2 e_RCODE - 000083D2 s_CODE | 0000AD27 s_CSTR | 0000AD27 e_CODE - 0000AD27 e_CONST | 0000AD27 s_CONST | 0000AF59 e_CSTR - 0000AF59 s_IDATA0 | 0000AF59 s_CDATA0 | 0000BA30 s_UDATA0 - 0000BA30 e_CCSTR | 0000BA30 e_ECSTR | 0000BA30 s_CCSTR - 0000BA30 e_CDATA0 | 0000BA30 s_ECSTR | 0000BA30 e_IDATA0 - 0000C4D2 e_UDATA0 | 0000C4D2 s_CSTACK | 0000D4D2 e_CSTACK + 00000000 s__DEFAUL | 00000000 l_CODE | 00000000 l_CCSTR + 00000000 l_ECSTR | 00000000 l_CONST | 00000000 .__.ABS. + 00000000 ?CL64180L | 00000000 ?CL64180B | 00000014 e__DEFAUL + 00000014 l__DEFAUL | 00000232 l_CSTR | 000002F7 l_RCODE + 00000AAD l_UDATA0 | 00000AD7 l_CDATA0 | 00000AD7 l_IDATA0 + 00001000 l_CSTACK | 00004000 e_CODE | 00004000 s_CODE + 00008100 s_RCODE | 000083F7 s_CSTR | 000083F7 e_RCODE + 000083F7 e_CONST | 000083F7 s_CONST | 00008629 e_CSTR + 00008629 s_IDATA0 | 00008629 s_CDATA0 | 00009100 s_UDATA0 + 00009100 e_CCSTR | 00009100 e_ECSTR | 00009100 s_CCSTR + 00009100 e_CDATA0 | 00009100 s_ECSTR | 00009100 e_IDATA0 + 00009BAD e_UDATA0 | 00009BAD s_CSTACK | 0000ABAD e_CSTACK Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) @@ -30,54 +30,34 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -RCODE 00008100 000002D2 = 722. bytes (REL,CON) +RCODE 00008100 000002F7 = 759. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00008100 __init | 00008115 ?US_RSH_L | 0000811F ?C_V_SWIT - 00008131 ?LEAVE_DI | 00008138 ?ENT_PARM | 00008144 ?L_AND_L0 - 00008162 ?SL_CMP_L | 00008193 ?ENT_AUTO | 000081A7 ?V_SWITCH - 000081B1 ?SS_CMP_L | 000081C3 ?US_MOD_L | 000081CC ?C_LSH_L0 - 000081D3 ?US_DIV_L | 000081E1 ?SL_RSH_L | 000081EF ?L_LSH_L0 - 00008207 ?S_DIVMOD | 0000821D ?LEAVE_32 | 00008225 ?S_MULASG - 0000822F ?S_MUL_L0 | 00008245 ?CALL_IND | 00008246 ?UL_DIVAS - 00008256 ?UL_MOD_L | 0000827B ?UL_DIV_L | 000082A3 ?L_NEG_L0 - 000082B5 ?L_DIVMOD | 0000830D ?L_NOT_L0 | 0000831C ?L_END_MU - 00008325 ?L_MULASG | 00008335 ?L_MUL_L0 | 000083B9 ?L_ADDASG + 00008100 __init | 0000811F ?US_RSH_L | 00008129 ?BANK_LEA + 0000812F ?BANK_FAS | 00008134 ?C_V_SWIT | 00008146 ?ENT_PARM + 00008152 ?BANK_CAL | 0000815F ?L_AND_L0 | 0000817D ?SL_CMP_L + 000081AE ?ENT_AUTO | 000081C2 ?V_SWITCH | 000081CC ?SS_CMP_L + 000081DE ?US_MOD_L | 000081E7 ?C_LSH_L0 | 000081EE ?US_DIV_L + 000081FC ?SL_RSH_L | 0000820A ?BANK_LEA | 00008216 ?L_LSH_L0 + 0000822E ?S_DIVMOD | 00008244 ?S_MULASG | 0000824E ?S_MUL_L0 + 00008264 ?LEAVE_DI | 0000826B ?UL_DIVAS | 0000827B ?UL_MOD_L + 000082A0 ?UL_DIV_L | 000082C8 ?L_NEG_L0 | 000082DA ?L_DIVMOD + 00008332 ?L_NOT_L0 | 00008341 ?L_END_MU | 0000834A ?L_MULASG + 0000835A ?L_MUL_L0 | 000083DE ?L_ADDASG Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CODE 000083D2 00002955 = 10581. bytes (REL,CON) +CONST 000083F7 00000000 = 0. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 000083D2 daread | 00008402 dwrite | 0000842C da_read - 0000849F da_write | 00008512 yes | 00008568 mkfs - 00008A11 doformatt | 00008A73 main | 00008F42 bitmap_du - 00009024 bzero | 0000904E bfill | 0000907A bcopy - 000090B2 int_min | 000090D3 int_max | 000090E9 fflush - 000092DE _write | 000092F8 printf | 00009322 lseek - 0000934A __stdio_c | 000093A1 __stdio_i | 000093CF close - 000093DF abort | 00009423 _exit | 00009433 fgets - 00009518 perror | 00009550 pause | 00009559 isatty - 0000958F fstat | 000095A1 strcpy | 000095BE kill - 000095D0 atoi | 00009752 vfprintf | 00009C85 ltoa - 00009CE3 __longtoa | 00009E77 itoa | 00009EDB fputs - 00009F34 open | 00009F5A malloc | 0000A17C fprintf - 0000A1A9 exit | 0000A1CE _read | 0000A1E8 getpid - 0000A1F6 signal | 0000A216 strerror | 0000A3A5 unix - 0000A3BD fgetc | 0000A4C3 memcpy | 0000A57C on_exit - 0000A5DE atexit | 0000A5EA strcat | 0000A600 unix_long - 0000A618 strchr | 0000A653 strlen | 0000A68A free - 0000A76A fputc | 0000A868 ultoa | 0000A8B8 strtol - 0000A95B sbrk | 0000A96B fread | 0000AB86 strtoul - 0000ACDD toupper | 0000AD02 tolower Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CONST 0000AD27 00000000 = 0. bytes (REL,CON) +CSTR 000083F7 00000232 = 562. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -85,28 +65,28 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTR 0000AD27 00000232 = 562. bytes (REL,CON) +IDATA0 00008629 00000AD7 = 2775. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ + 00008629 bootblock | 00008DA9 dirbuf | 00008FA9 _fmt + 00008FAA _yes | 00008FAB _quick | 00008FAC _verb + 00008FAD _immov | 00008FAE __IO_list | 00008FB0 stdin + 00008FC8 stdout | 00008FE0 stderr | 00008FFA __sys_err + 00008FFC __sys_ner | 00008FFE __on_exit | 00009000 __ctype Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -IDATA0 0000AF59 00000AD7 = 2775. bytes (NUL,CON) +CDATA0 00008629 00000AD7 = 2775. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 0000AF59 bootblock | 0000B6D9 dirbuf | 0000B8D9 _fmt - 0000B8DA _yes | 0000B8DB _quick | 0000B8DC _verb - 0000B8DD _immov | 0000B8DE __IO_list | 0000B8E0 stdin - 0000B8F8 stdout | 0000B910 stderr | 0000B92A __sys_err - 0000B92C __sys_ner | 0000B92E __on_exit | 0000B930 __ctype Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CDATA0 0000AF59 00000AD7 = 2775. bytes (REL,CON) +ECSTR 00009100 00000000 = 0. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -114,7 +94,7 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -ECSTR 0000BA30 00000000 = 0. bytes (NUL,CON) +CCSTR 00009100 00000000 = 0. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -122,114 +102,136 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CCSTR 0000BA30 00000000 = 0. bytes (REL,CON) +CODE 00004000 00000000 = 0. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ + 00005014 daread | 00005053 dwrite | 0000508C da_read + 0000514F da_write | 000051F4 yes | 0000525E mkfs + 00005785 doformatt | 000057FB main | 00005D71 bitmap_du + 00005E67 bzero | 00005E91 bfill | 00005EBD bcopy + 00005EF5 int_min | 00005F16 int_max | 00005F2C fflush + 0000613F _write | 0000615E printf | 0000618D lseek + 000061BA __stdio_c | 00006225 __stdio_i | 00006263 close + 00006278 abort | 000062E6 _exit | 000062FB fgets + 000063EA perror | 00006427 pause | 00006437 isatty + 00006472 fstat | 00006489 strcpy | 000064B0 kill + 000064C7 atoi | 0000665D vfprintf | 00006BB8 ltoa + 00006C1B __longtoa | 00006DAF itoa | 00006E18 fputs + 00006E76 open | 00006EA1 malloc | 000070CD fprintf + 000070FF exit | 0000712F _read | 0000714E getpid + 00007163 signal | 00007188 strerror | 00007345 unix + 0000735F fgetc | 0000746F memcpy | 0000753D on_exit + 000075B6 atexit | 000075C9 strcat | 000075E9 unix_long + 00007603 strchr | 0000763E strlen | 00007675 free + 00007755 fputc | 00007867 ultoa | 000078BC strtol + 00007964 sbrk | 00007979 fread | 00007BAD strtoul + 00007D04 toupper | 00007D29 tolower Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -UDATA0 0000BA30 00000AA2 = 2722. bytes (REL,CON) +UDATA0 00009100 00000AAD = 2733. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 0000BA30 _argc | 0000BA32 _argv | 0000BA34 environ - 0000BA36 errno | 0000BA38 __cleanup | 0000BA3A device_ha - 0000BA3C device_na | 0000BC3C zeroed | 0000BE3C dev - 0000BE3E inode | 0000C03E bitmap_in | 0000C042 bitmap_bl - 0000C046 bitmap_im | 0000C04A bitmap_fi | 0000C04E inode_bit - 0000C050 block_bit | 0000C052 immov_bit | 0000C454 __malloc_ - 0000C458 __malloc_ | 0000C4AA __on_exit + 00009100 _argc | 00009102 _argv | 00009104 environ + 00009106 errno | 00009108 __cleanup | 0000910B device_ha + 0000910D device_na | 0000930D zeroed | 0000950D dev + 0000950F inode | 0000970F bitmap_in | 00009713 bitmap_bl + 00009717 bitmap_im | 0000971B bitmap_fi | 0000971F inode_bit + 00009721 block_bit | 00009723 immov_bit | 00009B25 __malloc_ + 00009B29 __malloc_ | 00009B7B __on_exit Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTACK 0000C4D2 00001000 = 4096. bytes (REL,CON) +CSTACK 00009BAD 00001000 = 4096. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ Files Linked [ module(s) ] -..\..\lib\c0l.rel [ _c0l ] +..\..\lib\c0b.rel [ _c0b ] mkfs [ mkfs ] utils [ utils ] Libraries Linked [ object file ] -..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] ..\..\lib\libiar.lib [ reliar\USRSH.rel ] -..\..\lib\libcl.lib [ relcl\fflush.rel ] -..\..\lib\libsysl.lib [ relsysl\write.rel ] -..\..\lib\libcl.lib [ relcl\printf.rel ] -..\..\lib\libsysl.lib [ relsysl\lseek.rel ] -..\..\lib\libcl.lib [ relcl\stdio0.rel ] -..\..\lib\libsysl.lib [ relsysl\close.rel ] -..\..\lib\libcl.lib [ relcl\abort.rel ] -..\..\lib\libsysl.lib [ relsysl\_exit.rel ] -..\..\lib\libcl.lib [ relcl\fgets.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libcb.lib [ relcb\printf.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\abort.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libcb.lib [ relcb\fgets.rel ] ..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] -..\..\lib\libcl.lib [ relcl\perror.rel ] -..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] -..\..\lib\libsysl.lib [ relsysl\pause.rel ] -..\..\lib\libcl.lib [ relcl\isatty.rel ] -..\..\lib\libsysl.lib [ relsysl\fstat.rel ] +..\..\lib\libcb.lib [ relcb\perror.rel ] +..\..\lib\libsysb.lib [ relsysb\pause.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] ..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] -..\..\lib\libcl.lib [ relcl\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] ..\..\lib\libiar.lib [ reliar\LAND.rel ] ..\..\lib\libiar.lib [ reliar\SLCMP.rel ] -..\..\lib\libsysl.lib [ relsysl\kill.rel ] +..\..\lib\libsysb.lib [ relsysb\kill.rel ] ..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] ..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] -..\..\lib\libcl.lib [ relcl\atoi.rel ] -..\..\lib\libcl.lib [ relcl\vfprintf.rel ] -..\..\lib\libcl.lib [ relcl\ltoa.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] ..\..\lib\libiar.lib [ reliar\SSCMP.rel ] -..\..\lib\libcl.lib [ relcl\itoa.rel ] -..\..\lib\libcl.lib [ relcl\fputs.rel ] -..\..\lib\libsysl.lib [ relsysl\open.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] +..\..\lib\libcb.lib [ relcb\fputs.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] ..\..\lib\libiar.lib [ reliar\USMOD.rel ] ..\..\lib\libiar.lib [ reliar\CLSH.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] ..\..\lib\libiar.lib [ reliar\USDIV.rel ] -..\..\lib\libcl.lib [ relcl\malloc.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] ..\..\lib\libiar.lib [ reliar\SLRSH.rel ] -..\..\lib\libcl.lib [ relcl\fprintf.rel ] -..\..\lib\libcl.lib [ relcl\exit.rel ] -..\..\lib\libsysl.lib [ relsysl\read.rel ] -..\..\lib\libsysl.lib [ relsysl\getpid.rel ] -..\..\lib\libsysl.lib [ relsysl\signal.rel ] +..\..\lib\libcb.lib [ relcb\fprintf.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libsysb.lib [ relsysb\getpid.rel ] +..\..\lib\libsysb.lib [ relsysb\signal.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] ..\..\lib\libiar.lib [ reliar\LLSH.rel ] ..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] -..\..\lib\libcl.lib [ relcl\error.rel ] -..\..\lib\libiar.lib [ reliar\LEAVE32.rel ] -..\..\lib\libsysl.lib [ relsysl\sys0l.rel ] +..\..\lib\libcb.lib [ relcb\error.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] ..\..\lib\libiar.lib [ reliar\SMULASG.rel ] -..\..\lib\libcl.lib [ relcl\fgetc.rel ] -..\..\lib\libcl.lib [ relcl\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\fgetc.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] ..\..\lib\libiar.lib [ reliar\SMUL.rel ] -..\..\lib\libcl.lib [ relcl\atexit.rel ] -..\..\lib\libcl.lib [ relcl\strcat.rel ] -..\..\lib\libsysl.lib [ relsysl\sys1l.rel ] -..\..\lib\libcl.lib [ relcl\strchr.rel ] -..\..\lib\libcl.lib [ relcl\strlen.rel ] -..\..\lib\libcl.lib [ relcl\free.rel ] -..\..\lib\libcl.lib [ relcl\fputc.rel ] -..\..\lib\libcl.lib [ relcl\ultoa.rel ] -..\..\lib\libcl.lib [ relcl\strtol.rel ] -..\..\lib\libiar.lib [ reliar\CALLIND.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libcb.lib [ relcb\strchr.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] ..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] ..\..\lib\libiar.lib [ reliar\ULMOD.rel ] ..\..\lib\libiar.lib [ reliar\ULDIV.rel ] -..\..\lib\libsysl.lib [ relsysl\sbrk.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] ..\..\lib\libiar.lib [ reliar\LNEG.rel ] ..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] -..\..\lib\libcl.lib [ relcl\fread.rel ] +..\..\lib\libcb.lib [ relcb\fread.rel ] ..\..\lib\libiar.lib [ reliar\LNOT.rel ] ..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] -..\..\lib\libcl.lib [ relcl\strtoul.rel ] -..\..\lib\libcl.lib [ relcl\ctype.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] ..\..\lib\libiar.lib [ reliar\LMULASG.rel ] ..\..\lib\libiar.lib [ reliar\LMUL.rel ] ..\..\lib\libiar.lib [ reliar\LADDASG.rel ] @@ -238,3 +240,5 @@ Libraries Linked [ object file ] User Base Address Definitions l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/fsutil/mkfs.rel b/src/fsutil/mkfs.rel index a997a24a..e12e8062 100644 --- a/src/fsutil/mkfs.rel +++ b/src/fsutil/mkfs.rel @@ -1,26 +1,27 @@ XL4 -H 6 areas 42 global symbols +H 6 areas 44 global symbols M mkfs S ?US_RSH_L02 Ref00000000 -S ?CL64180L_4_06_L00 Ref00000000 S fflush Ref00000000 S bfill Ref00000000 S _write Ref00000000 S printf Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 S stderr Ref00000000 S lseek Ref00000000 S close Ref00000000 S abort Ref00000000 S ?C_V_SWITCH_L06 Ref00000000 S fgets Ref00000000 -S ?LEAVE_DIRECT_L09 Ref00000000 S perror Ref00000000 S bcopy Ref00000000 S stdin Ref00000000 S bzero Ref00000000 S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 S stdout Ref00000000 S strcpy Ref00000000 +S errno Ref00000000 S ?SL_CMP_L03 Ref00000000 S ?L_AND_L03 Ref00000000 S ?ENT_AUTO_DIRECT_L09 Ref00000000 @@ -32,6 +33,7 @@ S fputs Ref00000000 S ?US_MOD_L02 Ref00000000 S ?C_LSH_L01 Ref00000000 S ?US_DIV_L02 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 S ?SL_RSH_L03 Ref00000000 S malloc Ref00000000 S fprintf Ref00000000 @@ -40,16 +42,16 @@ S _read Ref00000000 S .__.ABS. Def00000000 S ?L_LSH_L03 Ref00000000 A _DEFAULT size 0 flags 0 -A CODE size C52 flags 0 -S da_read Def0000005A -S doformatting Def0000063F -S dwrite Def00000030 -S da_write Def000000CD -S yes Def00000140 -S bitmap_dump Def00000B70 +A CODE size E53 flags 0 +S da_read Def00000078 +S doformatting Def00000771 +S dwrite Def0000003F +S da_write Def0000013B +S yes Def000001E0 +S bitmap_dump Def00000D5D S daread Def00000000 -S main Def000006A1 -S mkfs Def00000196 +S main Def000007E7 +S mkfs Def0000024A A CSTR size 1FA flags 0 A UDATA0 size 81A flags 0 S immov_bitmap Def00000618 @@ -76,1101 +78,1307 @@ A CDATA0 size 985 flags 0 T 00 00 00 00 R 00 00 01 00 T 00 00 00 00 CD 00 00 00 00 21 1A 06 00 00 E5 -R 00 00 01 00 02 05 11 00 00 0A 03 00 -T 07 00 00 00 4B 42 ED 5B 02 04 00 00 CD +R 00 00 01 00 02 05 10 00 00 0A 03 00 +T 07 00 00 00 4B 42 ED 5B 02 04 00 00 3E R 00 00 01 00 00 08 03 00 -T 0E 00 00 00 5A 00 00 00 F1 3E 02 AC B5 28 13 -R 00 00 01 00 00 04 01 00 -T 17 00 00 00 -R 00 00 01 00 -T 17 00 00 00 DD 6E 02 DD 66 03 E5 21 -R 00 00 01 00 -T 1F 00 00 00 00 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 05 00 -T 26 00 00 00 F1 CD 00 00 00 00 -R 00 00 01 00 02 06 09 00 -T 2A 00 00 00 -R 00 00 01 00 -T 2A 00 00 00 21 1A 06 00 00 C3 00 00 00 00 -R 00 00 01 00 00 05 03 00 02 0A 0C 00 -T 30 00 00 00 -R 00 00 01 00 -T 30 00 00 00 CD 00 00 00 00 C5 4B 42 ED 5B -R 00 00 01 00 02 05 11 00 -T 38 00 00 00 02 04 00 00 CD CD 00 00 00 F1 3E -R 00 00 01 00 00 04 03 00 00 09 01 00 -T 3F 00 00 00 02 AC B5 28 13 -R 00 00 01 00 -T 44 00 00 00 -R 00 00 01 00 -T 44 00 00 00 DD 6E 02 DD 66 03 E5 21 -R 00 00 01 00 -T 4C 00 00 00 1A 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 05 00 -T 53 00 00 00 F1 CD 00 00 00 00 -R 00 00 01 00 02 06 09 00 -T 57 00 00 00 -R 00 00 01 00 -T 57 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0C 00 -T 5A 00 00 00 +T 0E 00 00 00 78 00 00 00 21 78 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 13 00 00 00 00 00 00 00 F1 3E 02 AC B5 28 1D +R 00 00 01 00 02 04 11 00 +T 1C 00 00 00 +R 00 00 01 00 +T 1C 00 00 00 DD 6E 02 DD 66 03 E5 21 +R 00 00 01 00 +T 24 00 00 00 00 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 04 00 +T 2A 00 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 04 00 02 09 11 00 +T 31 00 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 09 00 02 0A 09 00 +T 37 00 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T 39 00 00 00 +R 00 00 01 00 +T 39 00 00 00 21 1A 06 00 00 C3 00 00 00 00 +R 00 00 01 00 00 05 03 00 02 0A 05 00 +T 3F 00 00 00 +R 00 00 01 00 +T 3F 00 00 00 CD 00 00 00 00 C5 4B 42 ED 5B +R 00 00 01 00 02 05 10 00 +T 47 00 00 00 02 04 00 00 3E 3B 01 00 00 21 +R 00 00 01 00 00 04 03 00 29 09 01 00 +T 4C 00 00 00 3B 01 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 00 04 01 00 02 09 11 00 +T 53 00 00 00 02 AC B5 28 1D +R 00 00 01 00 +T 58 00 00 00 +R 00 00 01 00 +T 58 00 00 00 DD 6E 02 DD 66 03 E5 21 +R 00 00 01 00 +T 60 00 00 00 1A 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 04 00 +T 66 00 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 04 00 02 09 11 00 +T 6D 00 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 09 00 02 0A 09 00 +T 73 00 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T 75 00 00 00 +R 00 00 01 00 +T 75 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 05 00 +T 78 00 00 00 R 00 00 01 00 -T 5A 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 -R 00 00 01 00 02 05 11 00 -T 63 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 -R 00 00 01 00 02 0A 25 00 -T 6C 00 00 00 E5 ED 5B 00 00 00 00 CD +T 78 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 +R 00 00 01 00 02 05 10 00 +T 81 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 +R 00 00 01 00 02 0A 27 00 +T 8A 00 00 00 E5 ED 5B 00 00 00 00 3E R 00 00 01 00 00 07 03 00 -T 72 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 1A -R 00 00 01 00 02 04 07 00 -T 7B 00 00 00 -R 00 00 01 00 -T 7B 00 00 00 21 35 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 82 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T 89 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 0D 00 -T 90 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 22 00 -T 95 00 00 00 -R 00 00 01 00 -T 95 00 00 00 21 00 02 E5 DD 4E 08 DD 46 09 ED -R 00 00 01 00 -T A0 00 00 00 5B 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 00 05 03 00 02 0A 23 00 -T A7 00 00 00 3E 02 AC B5 28 1A -R 00 00 01 00 -T AD 00 00 00 -R 00 00 01 00 -T AD 00 00 00 21 42 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T B4 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T BB 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 0D 00 -T C2 00 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 22 00 -T C7 00 00 00 -R 00 00 01 00 -T C7 00 00 00 21 00 02 C3 00 00 00 00 -R 00 00 01 00 02 08 0C 00 -T CD 00 00 00 -R 00 00 01 00 -T CD 00 00 00 CD 00 00 00 00 21 00 00 E5 69 60 +T 90 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 95 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 2E +R 00 00 01 00 02 04 11 00 +T 9E 00 00 00 +R 00 00 01 00 +T 9E 00 00 00 21 35 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T A4 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T AB 00 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T B1 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T B7 00 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0C 00 +T BC 00 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0C 00 02 09 11 00 +T C2 00 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 24 00 +T C7 00 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T CC 00 00 00 +R 00 00 01 00 +T CC 00 00 00 21 00 02 E5 DD 4E 0A DD 46 0B ED +R 00 00 01 00 +T D7 00 00 00 5B 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 03 00 2B 0A 25 00 +T DD 00 00 00 00 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 02 04 25 00 02 09 11 00 +T E4 00 00 00 02 AC B5 28 4C +R 00 00 01 00 +T E9 00 00 00 +R 00 00 01 00 +T E9 00 00 00 2A 00 00 00 00 7D B4 20 17 +R 00 00 01 00 02 05 14 00 +T F0 00 00 00 +R 00 00 01 00 +T F0 00 00 00 21 00 02 E5 0E AA DD 5E 0A DD 56 +R 00 00 01 00 +T FB 00 00 00 0B 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 02 00 02 0B 02 00 +T 01 01 00 00 CD 00 00 00 00 E1 18 2E R 00 00 01 00 02 05 11 00 -T D6 00 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 -R 00 00 01 00 02 0A 25 00 -T DF 00 00 00 E5 ED 5B 00 00 00 00 CD +T 07 01 00 00 +R 00 00 01 00 +T 07 01 00 00 21 42 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 0D 01 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 14 01 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 1A 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 20 01 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0C 00 +T 25 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0C 00 02 09 11 00 +T 2B 01 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 24 00 +T 30 01 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T 35 01 00 00 +R 00 00 01 00 +T 35 01 00 00 +R 00 00 01 00 +T 35 01 00 00 21 00 02 C3 00 00 00 00 +R 00 00 01 00 02 08 05 00 +T 3B 01 00 00 +R 00 00 01 00 +T 3B 01 00 00 CD 00 00 00 00 21 00 00 E5 69 60 +R 00 00 01 00 02 05 10 00 +T 44 01 00 00 01 00 00 3E 09 CD 00 00 00 00 C5 +R 00 00 01 00 02 0A 27 00 +T 4D 01 00 00 E5 ED 5B 00 00 00 00 3E R 00 00 01 00 00 07 03 00 -T E5 00 00 00 00 00 00 00 F1 F1 F1 CB 78 28 1A -R 00 00 01 00 02 04 07 00 -T EE 00 00 00 -R 00 00 01 00 -T EE 00 00 00 21 35 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T F5 00 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T FC 00 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 0D 00 -T 03 01 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 22 00 -T 08 01 00 00 -R 00 00 01 00 -T 08 01 00 00 21 00 02 E5 DD 4E 08 DD 46 09 ED -R 00 00 01 00 -T 13 01 00 00 5B 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 00 05 03 00 02 0A 04 00 -T 1A 01 00 00 3E 02 AC B5 28 1A -R 00 00 01 00 -T 20 01 00 00 -R 00 00 01 00 -T 20 01 00 00 21 4F 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 27 01 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T 2E 01 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 0D 00 -T 35 01 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 22 00 -T 3A 01 00 00 -R 00 00 01 00 -T 3A 01 00 00 21 00 02 C3 00 00 00 00 -R 00 00 01 00 02 08 0C 00 -T 40 01 00 00 -R 00 00 01 00 -T 40 01 00 00 CD 00 00 00 00 EC FF 01 -R 00 00 01 00 02 05 16 00 -T 46 01 00 00 00 00 00 00 DD 5E 02 DD 56 03 CD +T 53 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 58 01 00 00 00 00 00 00 F1 F1 F1 CB 78 28 2E +R 00 00 01 00 02 04 11 00 +T 61 01 00 00 +R 00 00 01 00 +T 61 01 00 00 21 35 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 67 01 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 6E 01 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 74 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 7A 01 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0C 00 +T 7F 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0C 00 02 09 11 00 +T 85 01 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 24 00 +T 8A 01 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T 8F 01 00 00 +R 00 00 01 00 +T 8F 01 00 00 21 00 02 E5 DD 4E 0A DD 46 0B ED +R 00 00 01 00 +T 9A 01 00 00 5B 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 03 00 2B 0A 03 00 +T A0 01 00 00 00 00 00 00 CD 00 00 00 00 F1 3E +R 00 00 01 00 02 04 03 00 02 09 11 00 +T A7 01 00 00 02 AC B5 28 2E +R 00 00 01 00 +T AC 01 00 00 +R 00 00 01 00 +T AC 01 00 00 21 4F 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T B2 01 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T B9 01 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T BF 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T C5 01 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0C 00 +T CA 01 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0C 00 02 09 11 00 +T D0 01 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 24 00 +T D5 01 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T DA 01 00 00 +R 00 00 01 00 +T DA 01 00 00 21 00 02 C3 00 00 00 00 +R 00 00 01 00 02 08 05 00 +T E0 01 00 00 +R 00 00 01 00 +T E0 01 00 00 CD 00 00 00 00 EC FF 01 +R 00 00 01 00 02 05 17 00 +T E6 01 00 00 00 00 00 00 DD 5E 02 DD 56 03 3E R 00 00 01 00 02 04 12 00 -T 4F 01 00 00 00 00 00 00 11 00 00 00 00 CD -R 00 00 01 00 02 04 1B 00 02 09 12 00 -T 55 01 00 00 00 00 00 00 3A 81 09 00 00 B7 28 -R 00 00 01 00 02 04 02 00 00 09 04 00 -T 5C 01 00 00 0B -R 00 00 01 00 -T 5D 01 00 00 -R 00 00 01 00 -T 5D 01 00 00 01 00 00 00 00 11 5D 00 00 00 CD +T EF 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 1C 00 02 09 1C 00 +T F4 01 00 00 00 00 00 00 11 00 00 00 00 3E +R 00 00 01 00 02 04 11 00 02 09 12 00 +T FA 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 01 00 02 09 01 00 +T FF 01 00 00 00 00 00 00 3A 81 09 00 00 B7 28 +R 00 00 01 00 02 04 11 00 00 09 04 00 +T 06 02 00 00 10 +R 00 00 01 00 +T 07 02 00 00 +R 00 00 01 00 +T 07 02 00 00 01 00 00 00 00 11 5D 00 00 00 3E R 00 00 01 00 02 05 12 00 00 0A 02 00 -T 64 01 00 00 00 00 00 00 18 28 -R 00 00 01 00 02 04 1B 00 -T 68 01 00 00 +T 0E 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 1C 00 02 09 1C 00 +T 13 02 00 00 00 00 00 00 18 2D +R 00 00 01 00 02 04 11 00 +T 17 02 00 00 R 00 00 01 00 -T 68 01 00 00 21 00 00 00 00 E5 01 14 00 21 -R 00 00 01 00 02 05 0F 00 -T 70 01 00 00 02 00 39 5D 54 CD 00 00 00 00 F1 -R 00 00 01 00 02 0A 0B 00 -T 79 01 00 00 7D B4 28 0E DD 7E EC FE 79 28 0C +T 17 02 00 00 21 00 00 00 00 E5 01 14 00 21 +R 00 00 01 00 02 05 0E 00 +T 1F 02 00 00 02 00 39 5D 54 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 0B 00 +T 27 02 00 00 00 00 00 00 CD 00 00 00 00 F1 7D +R 00 00 01 00 02 04 0B 00 02 09 11 00 +T 2E 02 00 00 B4 28 0E DD 7E EC FE 79 28 0C DD R 00 00 01 00 -T 84 01 00 00 DD 7E EC FE 59 28 05 +T 39 02 00 00 7E EC FE 59 28 05 R 00 00 01 00 -T 8B 01 00 00 +T 3F 02 00 00 R 00 00 01 00 -T 8B 01 00 00 +T 3F 02 00 00 R 00 00 01 00 -T 8B 01 00 00 +T 3F 02 00 00 R 00 00 01 00 -T 8B 01 00 00 +T 3F 02 00 00 R 00 00 01 00 -T 8B 01 00 00 +T 3F 02 00 00 R 00 00 01 00 -T 8B 01 00 00 21 00 00 18 03 +T 3F 02 00 00 21 00 00 18 03 R 00 00 01 00 -T 90 01 00 00 +T 44 02 00 00 R 00 00 01 00 -T 90 01 00 00 +T 44 02 00 00 R 00 00 01 00 -T 90 01 00 00 21 01 00 +T 44 02 00 00 21 01 00 R 00 00 01 00 -T 93 01 00 00 +T 47 02 00 00 R 00 00 01 00 -T 93 01 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0C 00 -T 96 01 00 00 +T 47 02 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 05 00 +T 4A 02 00 00 R 00 00 01 00 -T 96 01 00 00 CD 00 00 00 00 DC FF 3A -R 00 00 01 00 02 05 16 00 -T 9C 01 00 00 83 09 00 00 B7 28 0E +T 4A 02 00 00 CD 00 00 00 00 DC FF 3A +R 00 00 01 00 02 05 17 00 +T 50 02 00 00 83 09 00 00 B7 28 18 R 00 00 01 00 00 04 04 00 -T A1 01 00 00 -R 00 00 01 00 -T A1 01 00 00 21 60 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T A8 01 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T AF 01 00 00 +T 55 02 00 00 R 00 00 01 00 -T AF 01 00 00 AF DD 77 DC DD 77 DD +T 55 02 00 00 21 60 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 5B 02 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 62 02 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 68 02 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 6D 02 00 00 R 00 00 01 00 -T B6 01 00 00 +T 6D 02 00 00 AF DD 77 DC DD 77 DD R 00 00 01 00 -T B6 01 00 00 01 80 07 DD 6E DC DD 66 DD A7 ED +T 74 02 00 00 R 00 00 01 00 -T C1 01 00 00 42 30 7C +T 74 02 00 00 01 80 07 DD 6E DC DD 66 DD A7 ED R 00 00 01 00 -T C4 01 00 00 +T 7F 02 00 00 42 D2 13 03 00 00 +R 00 00 01 00 00 06 01 00 +T 83 02 00 00 R 00 00 01 00 -T C4 01 00 00 01 00 02 DD 5E DC DD 56 DD 21 +T 83 02 00 00 01 00 02 DD 5E DC DD 56 DD 21 R 00 00 01 00 -T CE 01 00 00 80 07 A7 ED 52 EB CD 00 00 00 00 -R 00 00 01 00 02 0B 18 00 -T D7 01 00 00 DD 75 DE DD 74 DF 01 00 02 A7 ED +T 8D 02 00 00 80 07 A7 ED 52 EB 3E 00 00 00 00 +R 00 00 01 00 2B 0B 19 00 +T 95 02 00 00 21 00 00 00 00 CD 00 00 00 00 DD +R 00 00 01 00 02 05 19 00 02 0A 11 00 +T 9C 02 00 00 75 DE DD 74 DF 01 00 02 A7 ED 42 R 00 00 01 00 -T E2 01 00 00 42 30 16 +T A7 02 00 00 30 1B R 00 00 01 00 -T E5 01 00 00 +T A9 02 00 00 R 00 00 01 00 -T E5 01 00 00 06 09 DD 5E DC DD 56 DD CD +T A9 02 00 00 06 09 DD 5E DC DD 56 DD CD R 00 00 01 00 -T EE 01 00 00 00 00 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 02 04 00 00 00 09 01 00 -T F5 01 00 00 FE DD 74 FF 18 08 +T B2 02 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 00 00 29 09 01 00 +T B7 02 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T BE 02 00 00 FE DD 74 FF 18 08 R 00 00 01 00 -T FB 01 00 00 +T C4 02 00 00 R 00 00 01 00 -T FB 01 00 00 DD 36 FE 02 02 00 00 DD 36 FF +T C4 02 00 00 DD 36 FE 02 02 00 00 DD 36 FF R 00 00 01 00 09 07 03 00 -T 02 02 00 00 02 02 00 00 +T CB 02 00 00 02 02 00 00 R 00 00 01 00 89 04 03 00 -T 03 02 00 00 +T CC 02 00 00 R 00 00 01 00 -T 03 02 00 00 DD 6E DE DD 66 DF E5 DD 4E FE DD +T CC 02 00 00 DD 6E DE DD 66 DF E5 DD 4E FE DD R 00 00 01 00 -T 0E 02 00 00 46 FF 21 00 00 00 00 DD 5E DC DD +T D7 02 00 00 46 FF 21 00 00 00 00 DD 5E DC DD R 00 00 01 00 00 07 04 00 -T 17 02 00 00 56 DD 19 EB CD 00 00 00 00 E1 DD -R 00 00 01 00 02 09 0E 00 -T 20 02 00 00 4E FE DD 46 FF C5 06 09 DD 5E DC +T E0 02 00 00 56 DD 19 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 0D 00 +T E7 02 00 00 00 00 00 00 CD 00 00 00 00 E1 DD +R 00 00 01 00 02 04 0D 00 02 09 11 00 +T EE 02 00 00 4E FE DD 46 FF C5 06 09 DD 5E DC R 00 00 01 00 -T 2B 02 00 00 DD 56 DD CD 00 00 00 00 C1 CD +T F9 02 00 00 DD 56 DD CD 00 00 00 00 3E R 00 00 01 00 02 08 00 00 -T 33 02 00 00 30 00 00 00 3E 02 DD 86 DD DD 77 -R 00 00 01 00 00 04 01 00 -T 3C 02 00 00 DD C3 B6 01 00 00 +T 00 03 00 00 3F 00 00 00 21 3F 00 00 00 C1 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 06 03 00 00 00 00 00 00 3E 02 DD 86 DD DD 77 +R 00 00 01 00 02 04 11 00 +T 0F 03 00 00 DD C3 74 02 00 00 R 00 00 01 00 00 06 01 00 -T 40 02 00 00 +T 13 03 00 00 R 00 00 01 00 -T 40 02 00 00 01 00 02 11 02 02 00 00 CD +T 13 03 00 00 01 00 02 11 02 02 00 00 3E R 00 00 01 00 00 08 03 00 -T 47 02 00 00 00 00 00 00 3A 83 09 00 00 B7 28 -R 00 00 01 00 02 04 10 00 00 09 04 00 -T 4E 02 00 00 0E -R 00 00 01 00 -T 4F 02 00 00 -R 00 00 01 00 -T 4F 02 00 00 21 78 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 56 02 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T 5D 02 00 00 -R 00 00 01 00 -T 5D 02 00 00 3A 82 09 00 00 B7 28 19 +T 1A 03 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0F 00 02 09 0F 00 +T 1F 03 00 00 00 00 00 00 3A 83 09 00 00 B7 28 +R 00 00 01 00 02 04 11 00 00 09 04 00 +T 26 03 00 00 18 +R 00 00 01 00 +T 27 03 00 00 +R 00 00 01 00 +T 27 03 00 00 21 78 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 2D 03 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 34 03 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 3A 03 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 3F 03 00 00 +R 00 00 01 00 +T 3F 03 00 00 3A 82 09 00 00 B7 28 19 R 00 00 01 00 00 05 04 00 -T 63 02 00 00 +T 45 03 00 00 R 00 00 01 00 -T 63 02 00 00 DD 6E 04 DD 66 05 DD 4E 08 DD 46 +T 45 03 00 00 DD 6E 04 DD 66 05 DD 4E 0A DD 46 R 00 00 01 00 -T 6E 02 00 00 09 09 01 05 00 09 DD 75 DE DD 74 +T 50 03 00 00 0B 09 01 05 00 09 DD 75 DE DD 74 R 00 00 01 00 -T 79 02 00 00 DF 18 0C +T 5B 03 00 00 DF 18 0C R 00 00 01 00 -T 7C 02 00 00 +T 5E 03 00 00 R 00 00 01 00 -T 7C 02 00 00 DD 6E 02 DD 66 03 DD 75 DE DD 74 +T 5E 03 00 00 DD 6E 02 DD 66 03 DD 75 DE DD 74 R 00 00 01 00 -T 87 02 00 00 DF +T 69 03 00 00 DF R 00 00 01 00 -T 88 02 00 00 +T 6A 03 00 00 R 00 00 01 00 -T 88 02 00 00 21 05 00 DD 4E 08 DD 46 09 09 DD +T 6A 03 00 00 21 05 00 DD 4E 0A DD 46 0B 09 DD R 00 00 01 00 -T 93 02 00 00 75 DC DD 74 DD +T 75 03 00 00 75 DC DD 74 DD R 00 00 01 00 -T 98 02 00 00 +T 7A 03 00 00 R 00 00 01 00 -T 98 02 00 00 DD 4E DE DD 46 DF DD 6E DC DD 66 +T 7A 03 00 00 DD 4E DE DD 46 DF DD 6E DC DD 66 R 00 00 01 00 -T A3 02 00 00 DD A7 ED 42 30 42 +T 85 03 00 00 DD A7 ED 42 30 51 R 00 00 01 00 -T A9 02 00 00 +T 8B 03 00 00 R 00 00 01 00 -T A9 02 00 00 3A 83 09 00 00 B7 28 26 01 09 00 +T 8B 03 00 00 3A 83 09 00 00 B7 28 30 01 09 00 R 00 00 01 00 00 05 04 00 -T B2 02 00 00 DD 5E DC DD 56 DD CD 00 00 00 00 -R 00 00 01 00 02 0B 1C 00 -T BB 02 00 00 7B B2 20 16 +T 94 03 00 00 DD 5E DC DD 56 DD CD 00 00 00 00 +R 00 00 01 00 02 0B 1D 00 +T 9D 03 00 00 7B B2 20 20 R 00 00 01 00 -T BF 02 00 00 +T A1 03 00 00 R 00 00 01 00 -T BF 02 00 00 +T A1 03 00 00 R 00 00 01 00 -T BF 02 00 00 +T A1 03 00 00 R 00 00 01 00 -T BF 02 00 00 DD 6E DC DD 66 DD E5 21 +T A1 03 00 00 DD 6E DC DD 66 DD E5 21 R 00 00 01 00 -T C7 02 00 00 9C 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 02 00 02 0A 05 00 -T CE 02 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T D5 02 00 00 +T A9 03 00 00 9C 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 0A 04 00 +T AF 03 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 04 00 02 09 11 00 +T B6 03 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T BC 03 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T C1 03 00 00 R 00 00 01 00 -T D5 02 00 00 01 02 02 00 00 DD 5E DC DD 56 DD +T C1 03 00 00 01 02 02 00 00 DD 5E DC DD 56 DD R 00 00 01 00 00 05 03 00 -T DE 02 00 00 13 DD 73 DC DD 72 DD 1B CD +T CA 03 00 00 13 DD 73 DC DD 72 DD 1B 3E R 00 00 01 00 -T E7 02 00 00 30 00 00 00 18 AD -R 00 00 01 00 00 04 01 00 -T EB 02 00 00 +T D3 03 00 00 3F 00 00 00 21 3F 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T D8 03 00 00 00 00 00 00 18 9E +R 00 00 01 00 02 04 11 00 +T DC 03 00 00 R 00 00 01 00 -T EB 02 00 00 3A 83 09 00 00 B7 28 1D +T DC 03 00 00 3A 83 09 00 00 B7 28 27 R 00 00 01 00 00 05 04 00 -T F1 02 00 00 +T E2 03 00 00 R 00 00 01 00 -T F1 02 00 00 DD 6E DC DD 66 DD 2B DD 75 DC DD +T E2 03 00 00 DD 6E DC DD 66 DD 2B DD 75 DC DD R 00 00 01 00 -T FC 02 00 00 74 DD E5 21 A5 00 00 00 E5 CD +T ED 03 00 00 74 DD E5 21 A5 00 00 00 E5 3E R 00 00 01 00 00 08 02 00 -T 04 03 00 00 00 00 00 00 F1 F1 11 00 00 00 00 -R 00 00 01 00 02 04 05 00 02 0B 12 00 -T 0B 03 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 02 00 -T 0E 03 00 00 -R 00 00 01 00 -T 0E 03 00 00 3A 83 09 00 00 B7 28 0E +T F5 03 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 04 00 02 09 04 00 +T FA 03 00 00 00 00 00 00 F1 F1 11 00 00 00 00 +R 00 00 01 00 02 04 11 00 02 0B 12 00 +T 01 04 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 01 00 02 0A 01 00 +T 07 04 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T 09 04 00 00 +R 00 00 01 00 +T 09 04 00 00 3A 83 09 00 00 B7 28 18 R 00 00 01 00 00 05 04 00 -T 14 03 00 00 +T 0F 04 00 00 R 00 00 01 00 -T 14 03 00 00 21 AE 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 1B 03 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T 22 03 00 00 +T 0F 04 00 00 21 AE 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 15 04 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 1C 04 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 22 04 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 27 04 00 00 R 00 00 01 00 -T 22 03 00 00 01 1E 00 21 04 00 39 5D 54 CD +T 27 04 00 00 01 1E 00 21 04 00 39 5D 54 3E R 00 00 01 00 -T 2C 03 00 00 00 00 00 00 DD 36 E0 C6 DD 36 E1 -R 00 00 01 00 02 04 10 00 -T 35 03 00 00 31 21 05 00 DD 4E 08 DD 46 09 09 +T 31 04 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0F 00 02 09 0F 00 +T 36 04 00 00 00 00 00 00 DD 36 E0 C6 DD 36 E1 +R 00 00 01 00 02 04 11 00 +T 3F 04 00 00 31 21 05 00 DD 4E 0A DD 46 0B 09 R 00 00 01 00 -T 40 03 00 00 DD 75 E2 DD 74 E3 DD 6E 04 DD 66 +T 4A 04 00 00 DD 75 E2 DD 74 E3 DD 6E 04 DD 66 R 00 00 01 00 -T 4B 03 00 00 05 DD 75 E4 DD 74 E5 DD 6E 02 DD +T 55 04 00 00 05 DD 75 E4 DD 74 E5 DD 6E 02 DD R 00 00 01 00 -T 56 03 00 00 66 03 DD 75 E6 DD 74 E7 DD 6E 04 +T 60 04 00 00 66 03 DD 75 E6 DD 74 E7 DD 6E 04 R 00 00 01 00 -T 61 03 00 00 DD 66 05 29 29 29 11 FE FF 19 DD +T 6B 04 00 00 DD 66 05 29 29 29 11 FE FF 19 DD R 00 00 01 00 -T 6C 03 00 00 75 EA DD 74 EB DD 6E 04 DD 66 05 +T 76 04 00 00 75 EA DD 74 EB DD 6E 04 DD 66 05 R 00 00 01 00 -T 77 03 00 00 09 01 06 00 09 4D 44 DD 6E 02 DD +T 81 04 00 00 09 01 06 00 09 4D 44 DD 6E 02 DD R 00 00 01 00 -T 82 03 00 00 66 03 A7 ED 42 DD 75 E8 DD 74 E9 +T 8C 04 00 00 66 03 A7 ED 42 DD 75 E8 DD 74 E9 R 00 00 01 00 -T 8D 03 00 00 2A 04 06 00 00 DD 75 F0 DD 74 F1 +T 97 04 00 00 2A 04 06 00 00 DD 75 F0 DD 74 F1 R 00 00 01 00 00 05 03 00 -T 96 03 00 00 2A 08 06 00 00 DD 75 F2 DD 74 F3 +T A0 04 00 00 2A 08 06 00 00 DD 75 F2 DD 74 F3 R 00 00 01 00 00 05 03 00 -T 9F 03 00 00 2A 0C 06 00 00 DD 75 F4 DD 74 F5 +T A9 04 00 00 2A 0C 06 00 00 DD 75 F4 DD 74 F5 R 00 00 01 00 00 05 03 00 -T A8 03 00 00 2A 10 06 00 00 DD 75 F6 DD 74 F7 +T B2 04 00 00 2A 10 06 00 00 DD 75 F6 DD 74 F7 R 00 00 01 00 00 05 03 00 -T B1 03 00 00 AF DD 77 DC DD 77 DD +T BB 04 00 00 AF DD 77 DC DD 77 DD R 00 00 01 00 -T B8 03 00 00 +T C2 04 00 00 R 00 00 01 00 -T B8 03 00 00 DD 6E 04 DD 66 05 DD 4E 08 DD 46 +T C2 04 00 00 DD 6E 04 DD 66 05 DD 4E 0A DD 46 R 00 00 01 00 -T C3 03 00 00 09 09 01 06 00 09 4D 44 DD 6E DC +T CD 04 00 00 0B 09 01 06 00 09 4D 44 DD 6E DC R 00 00 01 00 -T CE 03 00 00 DD 66 DD A7 ED 42 30 26 +T D8 04 00 00 DD 66 DD A7 ED 42 30 26 R 00 00 01 00 -T D6 03 00 00 +T E0 04 00 00 R 00 00 01 00 -T D6 03 00 00 06 03 DD 5E DC DD 56 DD CD +T E0 04 00 00 06 03 DD 5E DC DD 56 DD CD R 00 00 01 00 -T DF 03 00 00 00 00 00 00 2A 16 06 00 00 19 DD +T E9 04 00 00 00 00 00 00 2A 16 06 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T E6 03 00 00 7E DC E6 07 47 3E 01 CD +T F0 04 00 00 7E DC E6 07 47 3E 01 CD R 00 00 01 00 -T EE 03 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 -R 00 00 01 00 02 04 1D 00 -T F7 03 00 00 DD 34 DD +T F8 04 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 +R 00 00 01 00 02 04 1E 00 +T 01 05 00 00 DD 34 DD R 00 00 01 00 -T FA 03 00 00 +T 04 05 00 00 R 00 00 01 00 -T FA 03 00 00 18 BC +T 04 05 00 00 18 BC R 00 00 01 00 -T FC 03 00 00 +T 06 05 00 00 R 00 00 01 00 -T FC 03 00 00 ED 4B 08 06 00 00 2A 0C 06 00 00 +T 06 05 00 00 ED 4B 08 06 00 00 2A 0C 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 03 04 00 00 A7 ED 42 29 29 29 DD 75 DE DD 74 +T 0D 05 00 00 A7 ED 42 29 29 29 DD 75 DE DD 74 R 00 00 01 00 -T 0E 04 00 00 DF DD 6E 02 DD 66 03 DD 75 DC DD +T 18 05 00 00 DF DD 6E 02 DD 66 03 DD 75 DC DD R 00 00 01 00 -T 19 04 00 00 74 DD +T 23 05 00 00 74 DD R 00 00 01 00 -T 1B 04 00 00 +T 25 05 00 00 R 00 00 01 00 -T 1B 04 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 +T 25 05 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 R 00 00 01 00 -T 26 04 00 00 DD A7 ED 42 28 26 +T 30 05 00 00 DD A7 ED 42 28 26 R 00 00 01 00 -T 2C 04 00 00 +T 36 05 00 00 R 00 00 01 00 -T 2C 04 00 00 06 03 DD 5E DC DD 56 DD CD +T 36 05 00 00 06 03 DD 5E DC DD 56 DD CD R 00 00 01 00 -T 35 04 00 00 00 00 00 00 2A 16 06 00 00 19 DD +T 3F 05 00 00 00 00 00 00 2A 16 06 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T 3C 04 00 00 7E DC E6 07 47 3E 01 CD +T 46 05 00 00 7E DC E6 07 47 3E 01 CD R 00 00 01 00 -T 44 04 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 -R 00 00 01 00 02 04 1D 00 -T 4D 04 00 00 DD 34 DD +T 4E 05 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 +R 00 00 01 00 02 04 1E 00 +T 57 05 00 00 DD 34 DD R 00 00 01 00 -T 50 04 00 00 +T 5A 05 00 00 R 00 00 01 00 -T 50 04 00 00 18 C9 +T 5A 05 00 00 18 C9 R 00 00 01 00 -T 52 04 00 00 +T 5C 05 00 00 R 00 00 01 00 -T 52 04 00 00 2A 0E 06 00 00 E5 2A 0C 06 00 00 +T 5C 05 00 00 2A 0E 06 00 00 E5 2A 0C 06 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T 59 04 00 00 E5 2A 0A 06 00 00 E5 2A +T 63 05 00 00 E5 2A 0A 06 00 00 E5 2A R 00 00 01 00 00 06 03 00 -T 5F 04 00 00 08 06 00 00 E5 ED 5B 16 06 00 00 +T 69 05 00 00 08 06 00 00 E5 ED 5B 16 06 00 00 R 00 00 01 00 00 04 03 00 00 0B 03 00 -T 66 04 00 00 CD 70 0B 00 00 E1 E1 E1 E1 3A -R 00 00 01 00 00 05 01 00 -T 6E 04 00 00 84 09 00 00 B7 CA 30 05 00 00 +T 70 05 00 00 3E 5D 0D 00 00 21 5D 0D 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 76 05 00 00 00 00 00 00 E1 E1 E1 E1 3A +R 00 00 01 00 02 04 11 00 +T 7D 05 00 00 84 09 00 00 B7 CA 44 06 00 00 R 00 00 01 00 00 04 04 00 00 0A 01 00 -T 74 04 00 00 +T 83 05 00 00 R 00 00 01 00 -T 74 04 00 00 AF DD 77 DC DD 77 DD +T 83 05 00 00 AF DD 77 DC DD 77 DD R 00 00 01 00 -T 7B 04 00 00 +T 8A 05 00 00 R 00 00 01 00 -T 7B 04 00 00 DD 6E 04 DD 66 05 DD 4E 08 DD 46 +T 8A 05 00 00 DD 6E 04 DD 66 05 DD 4E 0A DD 46 R 00 00 01 00 -T 86 04 00 00 09 09 01 06 00 09 4D 44 DD 6E DC +T 95 05 00 00 0B 09 01 06 00 09 4D 44 DD 6E DC R 00 00 01 00 -T 91 04 00 00 DD 66 DD A7 ED 42 30 26 +T A0 05 00 00 DD 66 DD A7 ED 42 30 26 R 00 00 01 00 -T 99 04 00 00 +T A8 05 00 00 R 00 00 01 00 -T 99 04 00 00 06 03 DD 5E DC DD 56 DD CD +T A8 05 00 00 06 03 DD 5E DC DD 56 DD CD R 00 00 01 00 -T A2 04 00 00 00 00 00 00 2A 18 06 00 00 19 DD +T B1 05 00 00 00 00 00 00 2A 18 06 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T A9 04 00 00 7E DC E6 07 47 3E 01 CD +T B8 05 00 00 7E DC E6 07 47 3E 01 CD R 00 00 01 00 -T B1 04 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 -R 00 00 01 00 02 04 1D 00 -T BA 04 00 00 DD 34 DD +T C0 05 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 +R 00 00 01 00 02 04 1E 00 +T C9 05 00 00 DD 34 DD R 00 00 01 00 -T BD 04 00 00 +T CC 05 00 00 R 00 00 01 00 -T BD 04 00 00 18 BC +T CC 05 00 00 18 BC R 00 00 01 00 -T BF 04 00 00 +T CE 05 00 00 R 00 00 01 00 -T BF 04 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 +T CE 05 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T C6 04 00 00 A7 ED 42 29 29 29 DD 75 DE DD 74 +T D5 05 00 00 A7 ED 42 29 29 29 DD 75 DE DD 74 R 00 00 01 00 -T D1 04 00 00 DF DD 6E 02 DD 66 03 DD 75 DC DD +T E0 05 00 00 DF DD 6E 02 DD 66 03 DD 75 DC DD R 00 00 01 00 -T DC 04 00 00 74 DD +T EB 05 00 00 74 DD R 00 00 01 00 -T DE 04 00 00 +T ED 05 00 00 R 00 00 01 00 -T DE 04 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 +T ED 05 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 R 00 00 01 00 -T E9 04 00 00 DD A7 ED 42 28 26 +T F8 05 00 00 DD A7 ED 42 28 26 R 00 00 01 00 -T EF 04 00 00 +T FE 05 00 00 R 00 00 01 00 -T EF 04 00 00 06 03 DD 5E DC DD 56 DD CD +T FE 05 00 00 06 03 DD 5E DC DD 56 DD CD R 00 00 01 00 -T F8 04 00 00 00 00 00 00 2A 18 06 00 00 19 DD +T 07 06 00 00 00 00 00 00 2A 18 06 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T FF 04 00 00 7E DC E6 07 47 3E 01 CD +T 0E 06 00 00 7E DC E6 07 47 3E 01 CD R 00 00 01 00 -T 07 05 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 -R 00 00 01 00 02 04 1D 00 -T 10 05 00 00 DD 34 DD +T 16 06 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 +R 00 00 01 00 02 04 1E 00 +T 1F 06 00 00 DD 34 DD R 00 00 01 00 -T 13 05 00 00 +T 22 06 00 00 R 00 00 01 00 -T 13 05 00 00 18 C9 +T 22 06 00 00 18 C9 R 00 00 01 00 -T 15 05 00 00 +T 24 06 00 00 R 00 00 01 00 -T 15 05 00 00 2A 12 06 00 00 E5 2A 10 06 00 00 +T 24 06 00 00 2A 12 06 00 00 E5 2A 10 06 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T 1C 05 00 00 E5 2A 0E 06 00 00 E5 2A +T 2B 06 00 00 E5 2A 0E 06 00 00 E5 2A R 00 00 01 00 00 06 03 00 -T 22 05 00 00 0C 06 00 00 E5 ED 5B 18 06 00 00 +T 31 06 00 00 0C 06 00 00 E5 ED 5B 18 06 00 00 R 00 00 01 00 00 04 03 00 00 0B 03 00 -T 29 05 00 00 CD 70 0B 00 00 E1 E1 E1 E1 -R 00 00 01 00 00 05 01 00 -T 30 05 00 00 +T 38 06 00 00 3E 5D 0D 00 00 21 5D 0D 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 3E 06 00 00 00 00 00 00 E1 E1 E1 E1 +R 00 00 01 00 02 04 11 00 +T 44 06 00 00 R 00 00 01 00 -T 30 05 00 00 21 ED 41 22 44 04 00 00 21 03 00 +T 44 06 00 00 21 ED 41 22 44 04 00 00 21 03 00 R 00 00 01 00 00 08 03 00 -T 39 05 00 00 22 46 04 00 00 01 00 00 21 20 00 +T 4D 06 00 00 22 46 04 00 00 01 00 00 21 20 00 R 00 00 01 00 00 05 03 00 -T 42 05 00 00 22 4C 04 00 00 ED 43 4E 04 00 00 +T 56 06 00 00 22 4C 04 00 00 ED 43 4E 04 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T 49 05 00 00 DD 6E 04 DD 66 05 DD 4E 08 DD 46 +T 5D 06 00 00 DD 6E 04 DD 66 05 DD 4E 0A DD 46 R 00 00 01 00 -T 54 05 00 00 09 09 01 05 00 09 22 5C 04 00 00 +T 68 06 00 00 0B 09 01 05 00 09 22 5C 04 00 00 R 00 00 01 00 00 0B 03 00 -T 5D 05 00 00 21 01 00 22 06 04 00 00 21 FF FF +T 71 06 00 00 21 01 00 22 06 04 00 00 21 FF FF R 00 00 01 00 00 08 03 00 -T 66 05 00 00 22 04 04 00 00 2A 14 06 00 00 7E +T 7A 06 00 00 22 04 04 00 00 2A 14 06 00 00 7E R 00 00 01 00 00 05 03 00 00 0A 03 00 -T 6D 05 00 00 F6 01 77 2A 14 06 00 00 7E F6 02 +T 81 06 00 00 F6 01 77 2A 14 06 00 00 7E F6 02 R 00 00 01 00 00 08 03 00 -T 76 05 00 00 77 ED 4B 04 06 00 00 2A +T 8A 06 00 00 77 ED 4B 04 06 00 00 2A R 00 00 01 00 00 07 03 00 -T 7C 05 00 00 08 06 00 00 A7 ED 42 29 29 29 DD +T 90 06 00 00 08 06 00 00 A7 ED 42 29 29 29 DD R 00 00 01 00 00 04 03 00 -T 85 05 00 00 75 DE DD 74 DF DD 6E 04 DD 66 05 +T 99 06 00 00 75 DE DD 74 DF DD 6E 04 DD 66 05 R 00 00 01 00 -T 90 05 00 00 29 29 29 DD 75 DC DD 74 DD +T A4 06 00 00 29 29 29 DD 75 DC DD 74 DD R 00 00 01 00 -T 99 05 00 00 +T AD 06 00 00 R 00 00 01 00 -T 99 05 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 +T AD 06 00 00 DD 6E DE DD 66 DF DD 4E DC DD 46 R 00 00 01 00 -T A4 05 00 00 DD A7 ED 42 28 26 +T B8 06 00 00 DD A7 ED 42 28 26 R 00 00 01 00 -T AA 05 00 00 +T BE 06 00 00 R 00 00 01 00 -T AA 05 00 00 06 03 DD 5E DC DD 56 DD CD +T BE 06 00 00 06 03 DD 5E DC DD 56 DD CD R 00 00 01 00 -T B3 05 00 00 00 00 00 00 2A 14 06 00 00 19 DD +T C7 06 00 00 00 00 00 00 2A 14 06 00 00 19 DD R 00 00 01 00 02 04 00 00 00 09 03 00 -T BA 05 00 00 7E DC E6 07 47 3E 01 CD +T CE 06 00 00 7E DC E6 07 47 3E 01 CD R 00 00 01 00 -T C2 05 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 -R 00 00 01 00 02 04 1D 00 -T CB 05 00 00 DD 34 DD +T D6 06 00 00 00 00 00 00 B6 77 DD 34 DC 20 03 +R 00 00 01 00 02 04 1E 00 +T DF 06 00 00 DD 34 DD R 00 00 01 00 -T CE 05 00 00 +T E2 06 00 00 R 00 00 01 00 -T CE 05 00 00 18 C9 +T E2 06 00 00 18 C9 R 00 00 01 00 -T D0 05 00 00 +T E4 06 00 00 R 00 00 01 00 -T D0 05 00 00 2A 0A 06 00 00 E5 2A 08 06 00 00 +T E4 06 00 00 2A 0A 06 00 00 E5 2A 08 06 00 00 R 00 00 01 00 00 05 03 00 00 0B 03 00 -T D7 05 00 00 E5 2A 06 06 00 00 E5 2A +T EB 06 00 00 E5 2A 06 06 00 00 E5 2A R 00 00 01 00 00 06 03 00 -T DD 05 00 00 04 06 00 00 E5 ED 5B 14 06 00 00 +T F1 06 00 00 04 06 00 00 E5 ED 5B 14 06 00 00 R 00 00 01 00 00 04 03 00 00 0B 03 00 -T E4 05 00 00 CD 70 0B 00 00 E1 E1 E1 E1 01 -R 00 00 01 00 00 05 01 00 -T EC 05 00 00 04 04 00 00 21 05 00 DD 5E 08 DD +T F8 06 00 00 3E 5D 0D 00 00 21 5D 0D 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T FE 06 00 00 00 00 00 00 E1 E1 E1 E1 01 +R 00 00 01 00 02 04 11 00 +T 05 07 00 00 04 04 00 00 21 05 00 DD 5E 0A DD R 00 00 01 00 00 04 03 00 -T F5 05 00 00 56 09 19 EB CD 30 00 00 00 01 -R 00 00 01 00 00 09 01 00 -T FD 05 00 00 80 07 00 00 DD 6E 04 DD 66 05 DD +T 0E 07 00 00 56 0B 19 EB 3E 3F 00 00 00 21 +R 00 00 01 00 29 09 01 00 +T 15 07 00 00 3F 00 00 00 CD 00 00 00 00 01 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T 1B 07 00 00 80 07 00 00 DD 6E 04 DD 66 05 DD R 00 00 01 00 00 04 04 00 -T 06 06 00 00 5E 08 DD 56 09 19 11 05 00 19 EB -R 00 00 01 00 -T 11 06 00 00 CD 30 00 00 00 11 04 00 CD -R 00 00 01 00 00 05 01 00 -T 18 06 00 00 00 00 00 00 DD 75 FE DD 74 FF 01 -R 00 00 01 00 00 04 01 00 -T 21 06 00 00 1E 00 C5 4D 44 21 06 00 39 5D 54 -R 00 00 01 00 -T 2C 06 00 00 CD 00 00 00 00 E1 DD 4E FE DD 46 -R 00 00 01 00 02 05 0E 00 -T 35 06 00 00 FF 11 04 00 CD 30 00 00 00 C3 -R 00 00 01 00 00 09 01 00 -T 3D 06 00 00 00 00 00 00 -R 00 00 01 00 02 04 0C 00 -T 3F 06 00 00 -R 00 00 01 00 -T 3F 06 00 00 CD 00 00 00 00 FE FD 3A -R 00 00 01 00 02 05 16 00 -T 45 06 00 00 83 09 00 00 B7 28 0E +T 24 07 00 00 5E 0A DD 56 0B 19 11 05 00 19 EB +R 00 00 01 00 +T 2F 07 00 00 3E 3F 00 00 00 21 3F 00 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 35 07 00 00 00 00 00 00 11 04 00 3E +R 00 00 01 00 02 04 11 00 +T 3B 07 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 40 07 00 00 00 00 00 00 DD 75 FE DD 74 FF 01 +R 00 00 01 00 02 04 11 00 +T 49 07 00 00 1E 00 C5 4D 44 21 06 00 39 5D 54 +R 00 00 01 00 +T 54 07 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 0D 00 02 0A 0D 00 +T 5A 07 00 00 00 00 00 00 E1 DD 4E FE DD 46 FF +R 00 00 01 00 02 04 11 00 +T 63 07 00 00 11 04 00 3E 3F 00 00 00 21 +R 00 00 01 00 29 08 01 00 +T 69 07 00 00 3F 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T 6F 07 00 00 00 00 00 00 +R 00 00 01 00 02 04 05 00 +T 71 07 00 00 +R 00 00 01 00 +T 71 07 00 00 CD 00 00 00 00 FE FD 3A +R 00 00 01 00 02 05 17 00 +T 77 07 00 00 83 09 00 00 B7 28 18 R 00 00 01 00 00 04 04 00 -T 4A 06 00 00 -R 00 00 01 00 -T 4A 06 00 00 21 C7 00 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 51 06 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T 58 06 00 00 -R 00 00 01 00 -T 58 06 00 00 21 00 02 E5 0E AA 21 04 00 39 5D -R 00 00 01 00 -T 63 06 00 00 54 CD 00 00 00 00 E1 21 00 00 39 -R 00 00 01 00 02 06 03 00 -T 6C 06 00 00 AF 77 23 77 +T 7C 07 00 00 +R 00 00 01 00 +T 7C 07 00 00 21 C7 00 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 82 07 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 89 07 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 8F 07 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 94 07 00 00 +R 00 00 01 00 +T 94 07 00 00 21 00 02 E5 0E AA 21 04 00 39 5D +R 00 00 01 00 +T 9F 07 00 00 54 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 02 00 02 0B 02 00 +T A5 07 00 00 CD 00 00 00 00 E1 21 00 00 39 AF +R 00 00 01 00 02 05 11 00 +T AE 07 00 00 77 23 77 R 00 00 01 00 -T 70 06 00 00 +T B1 07 00 00 R 00 00 01 00 -T 70 06 00 00 DD 4E 02 DD 46 03 21 00 00 39 56 +T B1 07 00 00 DD 4E 02 DD 46 03 21 00 00 39 56 R 00 00 01 00 -T 7B 06 00 00 23 66 6A A7 ED 42 30 1B +T BC 07 00 00 23 66 6A A7 ED 42 30 20 R 00 00 01 00 -T 83 06 00 00 +T C4 07 00 00 R 00 00 01 00 -T 83 06 00 00 21 02 00 39 4D 44 21 00 00 39 5E +T C4 07 00 00 21 02 00 39 4D 44 21 00 00 39 5E R 00 00 01 00 -T 8E 06 00 00 23 56 CD 30 00 00 00 21 00 00 39 -R 00 00 01 00 00 07 01 00 -T 97 06 00 00 34 23 20 01 34 +T CF 07 00 00 23 56 3E 3F 00 00 00 21 +R 00 00 01 00 29 07 01 00 +T D4 07 00 00 3F 00 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T DA 07 00 00 00 00 39 34 23 20 01 34 R 00 00 01 00 -T 9C 06 00 00 +T E2 07 00 00 R 00 00 01 00 -T 9C 06 00 00 18 D2 +T E2 07 00 00 18 CD R 00 00 01 00 -T 9E 06 00 00 +T E4 07 00 00 R 00 00 01 00 -T 9E 06 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0C 00 -T A1 06 00 00 +T E4 07 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 05 00 +T E7 07 00 00 R 00 00 01 00 -T A1 06 00 00 CD 00 00 00 00 F4 FF AF DD 77 F8 -R 00 00 01 00 02 05 16 00 -T AA 06 00 00 DD 77 F9 DD 36 FA 01 DD 36 FB 00 +T E7 07 00 00 CD 00 00 00 00 F4 FF AF DD 77 F8 +R 00 00 01 00 02 05 17 00 +T F0 07 00 00 DD 77 F9 DD 36 FA 01 DD 36 FB 00 R 00 00 01 00 -T B5 06 00 00 DD 6E 02 DD 66 03 DD 75 FC DD 74 +T FB 07 00 00 DD 6E 02 DD 66 03 DD 75 FC DD 74 R 00 00 01 00 -T C0 06 00 00 FD +T 06 08 00 00 FD R 00 00 01 00 -T C1 06 00 00 +T 07 08 00 00 R 00 00 01 00 -T C1 06 00 00 DD 4E 02 DD 46 03 DD 6E FA DD 66 +T 07 08 00 00 DD 4E 02 DD 46 03 DD 6E FA DD 66 R 00 00 01 00 -T CC 06 00 00 FB CD 00 00 00 00 D2 8F 07 00 00 -R 00 00 01 00 02 06 19 00 00 0B 01 00 -T D3 06 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD +T 12 08 00 00 FB CD 00 00 00 00 D2 E0 08 00 00 +R 00 00 01 00 02 06 1A 00 00 0B 01 00 +T 19 08 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD R 00 00 01 00 -T DE 06 00 00 46 05 09 46 23 66 68 DD 75 FE DD +T 24 08 00 00 46 05 09 46 23 66 68 DD 75 FE DD R 00 00 01 00 -T E9 06 00 00 74 FF 7E FE 2D C2 8F 07 00 00 +T 2F 08 00 00 74 FF 7E FE 2D C2 E0 08 00 00 R 00 00 01 00 00 0A 01 00 -T F1 06 00 00 +T 37 08 00 00 R 00 00 01 00 -T F1 06 00 00 +T 37 08 00 00 R 00 00 01 00 -T F1 06 00 00 +T 37 08 00 00 R 00 00 01 00 -T F1 06 00 00 DD 34 FE 20 03 DD 34 FF +T 37 08 00 00 DD 34 FE 20 03 DD 34 FF R 00 00 01 00 -T F9 06 00 00 +T 3F 08 00 00 R 00 00 01 00 -T F9 06 00 00 DD 34 FA 20 03 DD 34 FB +T 3F 08 00 00 DD 34 FA 20 03 DD 34 FB R 00 00 01 00 -T 01 07 00 00 +T 47 08 00 00 R 00 00 01 00 -T 01 07 00 00 DD 6E FC DD 66 FD 2B DD 75 FC DD +T 47 08 00 00 DD 6E FC DD 66 FD 2B DD 75 FC DD R 00 00 01 00 -T 0C 07 00 00 74 FD +T 52 08 00 00 74 FD R 00 00 01 00 -T 0E 07 00 00 +T 54 08 00 00 R 00 00 01 00 -T 0E 07 00 00 DD 6E FE DD 66 FF AF B6 28 74 +T 54 08 00 00 DD 6E FE DD 66 FF AF B6 28 7F R 00 00 01 00 -T 18 07 00 00 +T 5E 08 00 00 R 00 00 01 00 -T 18 07 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T 5E 08 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T 23 07 00 00 74 FF 2B 5E CD 00 00 00 00 0A 00 +T 69 08 00 00 74 FF 2B 5E CD 00 00 00 00 0A 00 R 00 00 01 00 02 09 0A 00 -T 2C 07 00 00 46 4C 51 56 59 66 6C 71 76 79 +T 72 08 00 00 46 4C 51 56 59 66 6C 71 76 79 R 00 00 01 00 -T 36 07 00 00 6F 07 00 00 4C 07 00 00 +T 7C 08 00 00 B5 08 00 00 92 08 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 -T 3A 07 00 00 61 07 00 00 5A 07 00 00 +T 80 08 00 00 A7 08 00 00 A0 08 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 -T 3E 07 00 00 68 07 00 00 53 07 00 00 +T 84 08 00 00 AE 08 00 00 99 08 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 -T 42 07 00 00 4C 07 00 00 61 07 00 00 +T 88 08 00 00 92 08 00 00 A7 08 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 -T 46 07 00 00 5A 07 00 00 68 07 00 00 +T 8C 08 00 00 A0 08 00 00 AE 08 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 -T 4A 07 00 00 53 07 00 00 +T 90 08 00 00 99 08 00 00 R 00 00 01 00 00 04 01 00 -T 4C 07 00 00 +T 92 08 00 00 R 00 00 01 00 -T 4C 07 00 00 3E 01 32 81 09 00 00 18 37 +T 92 08 00 00 3E 01 32 81 09 00 00 18 41 R 00 00 01 00 00 07 04 00 -T 53 07 00 00 +T 99 08 00 00 R 00 00 01 00 -T 53 07 00 00 3E 01 32 80 09 00 00 18 30 +T 99 08 00 00 3E 01 32 80 09 00 00 18 3A R 00 00 01 00 00 07 04 00 -T 5A 07 00 00 +T A0 08 00 00 R 00 00 01 00 -T 5A 07 00 00 3E 01 32 82 09 00 00 18 29 +T A0 08 00 00 3E 01 32 82 09 00 00 18 33 R 00 00 01 00 00 07 04 00 -T 61 07 00 00 +T A7 08 00 00 R 00 00 01 00 -T 61 07 00 00 3E 01 32 83 09 00 00 18 22 +T A7 08 00 00 3E 01 32 83 09 00 00 18 2C R 00 00 01 00 00 07 04 00 -T 68 07 00 00 +T AE 08 00 00 R 00 00 01 00 -T 68 07 00 00 3E 01 32 84 09 00 00 18 1B +T AE 08 00 00 3E 01 32 84 09 00 00 18 25 R 00 00 01 00 00 07 04 00 -T 6F 07 00 00 +T B5 08 00 00 R 00 00 01 00 -T 6F 07 00 00 DD 6E FE DD 66 FF E5 21 +T B5 08 00 00 DD 6E FE DD 66 FF E5 21 R 00 00 01 00 -T 77 07 00 00 E0 00 00 00 E5 21 00 00 00 00 E5 +T BD 08 00 00 E0 00 00 00 E5 21 00 00 00 00 E5 R 00 00 01 00 00 04 02 00 02 0A 06 00 -T 7E 07 00 00 CD 00 00 00 00 F1 F1 F1 11 01 00 -R 00 00 01 00 02 05 21 00 -T 87 07 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 22 00 -T 8A 07 00 00 -R 00 00 01 00 -T 8A 07 00 00 18 82 -R 00 00 01 00 -T 8C 07 00 00 +T C4 08 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 23 00 02 0A 23 00 +T CA 08 00 00 00 00 00 00 F1 F1 F1 11 01 00 3E +R 00 00 01 00 02 04 11 00 +T D3 08 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 24 00 02 09 24 00 +T D8 08 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T DA 08 00 00 +R 00 00 01 00 +T DA 08 00 00 C3 54 08 00 00 +R 00 00 01 00 00 05 01 00 +T DD 08 00 00 R 00 00 01 00 -T 8C 07 00 00 C3 C1 06 00 00 +T DD 08 00 00 C3 07 08 00 00 R 00 00 01 00 00 05 01 00 -T 8F 07 00 00 +T E0 08 00 00 R 00 00 01 00 -T 8F 07 00 00 01 04 80 DD 6E FC DD 66 FD 3E 80 +T E0 08 00 00 01 04 80 DD 6E FC DD 66 FD 3E 80 R 00 00 01 00 -T 9A 07 00 00 AC 67 ED 42 30 13 +T EB 08 00 00 AC 67 ED 42 30 1D R 00 00 01 00 -T A0 07 00 00 +T F1 08 00 00 R 00 00 01 00 -T A0 07 00 00 21 F3 00 00 00 E5 21 00 00 00 00 +T F1 08 00 00 21 F3 00 00 00 E5 21 00 00 00 00 R 00 00 01 00 00 05 02 00 02 0B 06 00 -T A7 07 00 00 E5 CD 00 00 00 00 F1 F1 11 01 00 -R 00 00 01 00 02 06 21 00 -T B0 07 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 22 00 -T B3 07 00 00 +T F8 08 00 00 E5 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 23 00 02 0B 23 00 +T FE 08 00 00 CD 00 00 00 00 F1 F1 11 01 00 3E +R 00 00 01 00 02 05 11 00 +T 07 09 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 24 00 02 09 24 00 +T 0C 09 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T 0E 09 00 00 R 00 00 01 00 -T B3 07 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD +T 0E 09 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD R 00 00 01 00 -T BE 07 00 00 46 05 09 4E 23 46 11 02 00 00 00 +T 19 09 00 00 46 05 09 4E 23 46 11 02 00 00 00 R 00 00 01 00 00 0B 03 00 -T C7 07 00 00 CD 00 00 00 00 21 02 80 E5 21 -R 00 00 01 00 02 05 13 00 -T CF 07 00 00 02 00 00 00 E5 CD 00 00 00 00 F1 -R 00 00 01 00 00 04 03 00 02 0A 1A 00 -T D6 07 00 00 F1 22 00 00 00 00 CB 7C 28 1A -R 00 00 01 00 00 06 03 00 -T DE 07 00 00 -R 00 00 01 00 -T DE 07 00 00 21 24 01 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T E5 07 00 00 F1 11 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 06 12 00 02 0B 02 00 -T EC 07 00 00 11 02 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 05 03 00 02 0A 0D 00 -T F3 07 00 00 01 00 CD 00 00 00 00 -R 00 00 01 00 02 07 22 00 -T F8 07 00 00 -R 00 00 01 00 -T F8 07 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD -R 00 00 01 00 -T 03 08 00 00 46 05 09 23 23 5E 23 56 CD -R 00 00 01 00 -T 0C 08 00 00 00 00 00 00 DD 75 F4 DD 74 F5 DD -R 00 00 01 00 02 04 17 00 -T 15 08 00 00 6E FA DD 66 FB 29 09 01 04 00 09 -R 00 00 01 00 -T 20 08 00 00 5E 23 56 CD 00 00 00 00 DD 75 F6 -R 00 00 01 00 02 08 17 00 -T 29 08 00 00 DD 74 F7 DD 4E FC DD 46 FD 21 -R 00 00 01 00 -T 33 08 00 00 04 00 CD 00 00 00 00 30 1E -R 00 00 01 00 02 07 19 00 -T 3A 08 00 00 -R 00 00 01 00 -T 3A 08 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD -R 00 00 01 00 -T 45 08 00 00 46 05 09 01 06 00 09 5E 23 56 CD -R 00 00 01 00 -T 50 08 00 00 00 00 00 00 DD 75 F8 DD 74 F9 -R 00 00 01 00 02 04 17 00 -T 58 08 00 00 -R 00 00 01 00 -T 58 08 00 00 01 64 00 DD 6E F4 DD 66 F5 A7 ED -R 00 00 01 00 -T 63 08 00 00 42 38 25 01 1E 00 DD 5E F4 DD 56 -R 00 00 01 00 -T 6E 08 00 00 F5 CD 00 00 00 00 DD 6E F6 DD 66 -R 00 00 01 00 02 06 1E 00 -T 77 08 00 00 F7 A7 ED 52 30 0E DD 4E F8 DD 46 +T 22 09 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 13 00 02 0A 13 00 +T 28 09 00 00 00 00 00 00 21 02 80 E5 21 +R 00 00 01 00 02 04 11 00 +T 2F 09 00 00 02 00 00 00 E5 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 0A 1B 00 +T 35 09 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 1B 00 02 09 11 00 +T 3C 09 00 00 22 00 00 00 00 CB 7C 28 2E +R 00 00 01 00 00 05 03 00 +T 43 09 00 00 +R 00 00 01 00 +T 43 09 00 00 21 24 01 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 49 09 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 50 09 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 12 00 2B 0A 01 00 +T 56 09 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T 5C 09 00 00 02 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0C 00 +T 61 09 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0C 00 02 09 11 00 +T 67 09 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 24 00 +T 6C 09 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T 71 09 00 00 +R 00 00 01 00 +T 71 09 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD +R 00 00 01 00 +T 7C 09 00 00 46 05 09 23 23 5E 23 56 3E +R 00 00 01 00 +T 85 09 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 18 00 02 09 18 00 +T 8A 09 00 00 00 00 00 00 DD 75 F4 DD 74 F5 DD +R 00 00 01 00 02 04 11 00 +T 93 09 00 00 6E FA DD 66 FB 29 09 01 04 00 09 +R 00 00 01 00 +T 9E 09 00 00 5E 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 18 00 +T A4 09 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 18 00 02 09 11 00 +T AB 09 00 00 F6 DD 74 F7 DD 4E FC DD 46 FD 21 +R 00 00 01 00 +T B6 09 00 00 04 00 CD 00 00 00 00 30 23 +R 00 00 01 00 02 07 1A 00 +T BD 09 00 00 +R 00 00 01 00 +T BD 09 00 00 DD 6E FA DD 66 FB 29 DD 4E 04 DD +R 00 00 01 00 +T C8 09 00 00 46 05 09 01 06 00 09 5E 23 56 3E +R 00 00 01 00 +T D3 09 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 18 00 02 09 18 00 +T D8 09 00 00 00 00 00 00 DD 75 F8 DD 74 F9 +R 00 00 01 00 02 04 11 00 +T E0 09 00 00 +R 00 00 01 00 +T E0 09 00 00 01 64 00 DD 6E F4 DD 66 F5 A7 ED +R 00 00 01 00 +T EB 09 00 00 42 38 25 01 1E 00 DD 5E F4 DD 56 +R 00 00 01 00 +T F6 09 00 00 F5 CD 00 00 00 00 DD 6E F6 DD 66 +R 00 00 01 00 02 06 1F 00 +T FF 09 00 00 F7 A7 ED 52 30 0E DD 4E F8 DD 46 R 00 00 01 00 -T 82 08 00 00 F9 21 64 00 A7 ED 42 30 13 +T 0A 0A 00 00 F9 21 64 00 A7 ED 42 30 1D R 00 00 01 00 -T 8B 08 00 00 +T 13 0A 00 00 R 00 00 01 00 -T 8B 08 00 00 +T 13 0A 00 00 R 00 00 01 00 -T 8B 08 00 00 +T 13 0A 00 00 R 00 00 01 00 -T 8B 08 00 00 21 31 01 00 00 E5 21 00 00 00 00 +T 13 0A 00 00 21 31 01 00 00 E5 21 00 00 00 00 R 00 00 01 00 00 05 02 00 02 0B 06 00 -T 92 08 00 00 E5 CD 00 00 00 00 F1 F1 11 01 00 -R 00 00 01 00 02 06 21 00 -T 9B 08 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 22 00 -T 9E 08 00 00 +T 1A 0A 00 00 E5 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 23 00 02 0B 23 00 +T 20 0A 00 00 CD 00 00 00 00 F1 F1 11 01 00 3E +R 00 00 01 00 02 05 11 00 +T 29 0A 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 24 00 02 09 24 00 +T 2E 0A 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T 30 0A 00 00 R 00 00 01 00 -T 9E 08 00 00 01 00 00 21 1E 08 22 04 06 00 00 +T 30 0A 00 00 01 00 00 21 1E 08 22 04 06 00 00 R 00 00 01 00 00 0B 03 00 -T A7 08 00 00 ED 43 06 06 00 00 11 FF FF D5 11 +T 39 0A 00 00 ED 43 06 06 00 00 11 FF FF D5 11 R 00 00 01 00 00 06 03 00 -T B0 08 00 00 FC FF D5 C5 E5 21 03 00 C1 09 EB +T 42 0A 00 00 FC FF D5 C5 E5 21 03 00 C1 09 EB R 00 00 01 00 -T BB 08 00 00 21 00 00 C1 ED 4A 4D 44 EB CD +T 4D 0A 00 00 21 00 00 C1 ED 4A 4D 44 EB CD R 00 00 01 00 -T C5 08 00 00 00 00 00 00 22 04 06 00 00 ED 43 -R 00 00 01 00 02 04 15 00 00 09 03 00 -T CC 08 00 00 06 06 00 00 C5 E5 DD 6E F6 DD 66 +T 57 0A 00 00 00 00 00 00 22 04 06 00 00 ED 43 +R 00 00 01 00 02 04 16 00 00 09 03 00 +T 5E 0A 00 00 06 06 00 00 C5 E5 DD 6E F6 DD 66 R 00 00 01 00 00 04 03 00 -T D5 08 00 00 F7 29 29 29 01 FF FF 09 EB 06 03 +T 67 0A 00 00 F7 29 29 29 01 FF FF 09 EB 06 03 R 00 00 01 00 -T E0 08 00 00 CD 00 00 00 00 EB 11 00 00 C1 09 +T 72 0A 00 00 CD 00 00 00 00 EB 11 00 00 C1 09 R 00 00 01 00 02 05 00 00 -T E9 08 00 00 EB C1 ED 4A E5 D5 21 01 00 C1 09 +T 7B 0A 00 00 EB C1 ED 4A E5 D5 21 01 00 C1 09 R 00 00 01 00 -T F4 08 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 22 +T 86 0A 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 22 R 00 00 01 00 -T FF 08 00 00 08 06 00 00 ED 43 0A 06 00 00 11 +T 91 0A 00 00 08 06 00 00 ED 43 0A 06 00 00 11 R 00 00 01 00 00 04 03 00 00 0A 03 00 -T 06 09 00 00 FF FF D5 11 FC FF D5 C5 E5 21 +T 98 0A 00 00 FF FF D5 11 FC FF D5 C5 E5 21 R 00 00 01 00 -T 10 09 00 00 03 00 C1 09 EB 21 00 00 C1 ED 4A +T A2 0A 00 00 03 00 C1 09 EB 21 00 00 C1 ED 4A R 00 00 01 00 -T 1B 09 00 00 4D 44 EB CD 00 00 00 00 22 -R 00 00 01 00 02 08 15 00 -T 22 09 00 00 08 06 00 00 ED 43 0A 06 00 00 C5 +T AD 0A 00 00 4D 44 EB CD 00 00 00 00 22 +R 00 00 01 00 02 08 16 00 +T B4 0A 00 00 08 06 00 00 ED 43 0A 06 00 00 C5 R 00 00 01 00 00 04 03 00 00 0A 03 00 -T 29 09 00 00 E5 21 FF FF DD 4E F4 DD 46 F5 09 +T BB 0A 00 00 E5 21 FF FF DD 4E F4 DD 46 F5 09 R 00 00 01 00 -T 34 09 00 00 EB 06 03 CD 00 00 00 00 EB 11 +T C6 0A 00 00 EB 06 03 CD 00 00 00 00 EB 11 R 00 00 01 00 02 08 00 00 -T 3C 09 00 00 00 00 C1 09 EB C1 ED 4A E5 D5 21 +T CE 0A 00 00 00 00 C1 09 EB C1 ED 4A E5 D5 21 R 00 00 01 00 -T 47 09 00 00 01 00 C1 09 EB 21 00 00 C1 ED 4A +T D9 0A 00 00 01 00 C1 09 EB 21 00 00 C1 ED 4A R 00 00 01 00 -T 52 09 00 00 4D 44 EB 22 0C 06 00 00 ED 43 +T E4 0A 00 00 4D 44 EB 22 0C 06 00 00 ED 43 R 00 00 01 00 00 08 03 00 -T 5A 09 00 00 0E 06 00 00 11 FF FF D5 11 FC FF +T EC 0A 00 00 0E 06 00 00 11 FF FF D5 11 FC FF R 00 00 01 00 00 04 03 00 -T 63 09 00 00 D5 C5 E5 21 03 00 C1 09 EB 21 +T F5 0A 00 00 D5 C5 E5 21 03 00 C1 09 EB 21 R 00 00 01 00 -T 6D 09 00 00 00 00 C1 ED 4A 4D 44 EB CD +T FF 0A 00 00 00 00 C1 ED 4A 4D 44 EB CD R 00 00 01 00 -T 76 09 00 00 00 00 00 00 22 0C 06 00 00 ED 43 -R 00 00 01 00 02 04 15 00 00 09 03 00 -T 7D 09 00 00 0E 06 00 00 22 10 06 00 00 ED 43 +T 08 0B 00 00 00 00 00 00 22 0C 06 00 00 ED 43 +R 00 00 01 00 02 04 16 00 00 09 03 00 +T 0F 0B 00 00 0E 06 00 00 22 10 06 00 00 ED 43 R 00 00 01 00 00 04 03 00 00 09 03 00 -T 84 09 00 00 12 06 00 00 C5 E5 21 FF 01 C1 09 +T 16 0B 00 00 12 06 00 00 C5 E5 21 FF 01 C1 09 R 00 00 01 00 00 04 03 00 -T 8D 09 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 3E +T 1F 0B 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 3E R 00 00 01 00 -T 98 09 00 00 09 CD 00 00 00 00 01 FB FF 09 DD -R 00 00 01 00 02 06 1F 00 -T A1 09 00 00 75 F8 DD 74 F9 3A 84 09 00 00 B7 +T 2A 0B 00 00 09 CD 00 00 00 00 01 FB FF 09 DD +R 00 00 01 00 02 06 21 00 +T 33 0B 00 00 75 F8 DD 74 F9 3A 84 09 00 00 B7 R 00 00 01 00 00 0A 04 00 -T AA 09 00 00 28 7D +T 3C 0B 00 00 28 7D R 00 00 01 00 -T AC 09 00 00 +T 3E 0B 00 00 R 00 00 01 00 -T AC 09 00 00 21 FF FF DD 4E F4 DD 46 F5 09 EB +T 3E 0B 00 00 21 FF FF DD 4E F4 DD 46 F5 09 EB R 00 00 01 00 -T B7 09 00 00 06 03 CD 00 00 00 00 EB 01 00 00 +T 49 0B 00 00 06 03 CD 00 00 00 00 EB 01 00 00 R 00 00 01 00 02 07 00 00 -T C0 09 00 00 C5 E5 2A 0C 06 00 00 C1 09 EB 2A +T 52 0B 00 00 C5 E5 2A 0C 06 00 00 C1 09 EB 2A R 00 00 01 00 00 07 03 00 -T C9 09 00 00 0E 06 00 00 C1 ED 4A E5 D5 21 +T 5B 0B 00 00 0E 06 00 00 C1 ED 4A E5 D5 21 R 00 00 01 00 00 04 03 00 -T D1 09 00 00 01 00 C1 09 EB 21 00 00 C1 ED 4A +T 63 0B 00 00 01 00 C1 09 EB 21 00 00 C1 ED 4A R 00 00 01 00 -T DC 09 00 00 4D 44 EB 22 10 06 00 00 ED 43 +T 6E 0B 00 00 4D 44 EB 22 10 06 00 00 ED 43 R 00 00 01 00 00 08 03 00 -T E4 09 00 00 12 06 00 00 11 FF FF D5 11 FC FF +T 76 0B 00 00 12 06 00 00 11 FF FF D5 11 FC FF R 00 00 01 00 00 04 03 00 -T ED 09 00 00 D5 C5 E5 21 03 00 C1 09 EB 21 +T 7F 0B 00 00 D5 C5 E5 21 03 00 C1 09 EB 21 R 00 00 01 00 -T F7 09 00 00 00 00 C1 ED 4A 4D 44 EB CD +T 89 0B 00 00 00 00 C1 ED 4A 4D 44 EB CD R 00 00 01 00 -T 00 0A 00 00 00 00 00 00 22 10 06 00 00 ED 43 -R 00 00 01 00 02 04 15 00 00 09 03 00 -T 07 0A 00 00 12 06 00 00 C5 E5 21 FF 01 C1 09 +T 92 0B 00 00 00 00 00 00 22 10 06 00 00 ED 43 +R 00 00 01 00 02 04 16 00 00 09 03 00 +T 99 0B 00 00 12 06 00 00 C5 E5 21 FF 01 C1 09 R 00 00 01 00 00 04 03 00 -T 10 0A 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 3E +T A2 0B 00 00 EB 21 00 00 C1 ED 4A 4D 44 EB 3E R 00 00 01 00 -T 1B 0A 00 00 09 CD 00 00 00 00 01 FB FF 09 DD -R 00 00 01 00 02 06 1F 00 -T 24 0A 00 00 75 F8 DD 74 F9 +T AD 0B 00 00 09 CD 00 00 00 00 01 FB FF 09 DD +R 00 00 01 00 02 06 21 00 +T B6 0B 00 00 75 F8 DD 74 F9 R 00 00 01 00 -T 29 0A 00 00 +T BB 0B 00 00 R 00 00 01 00 -T 29 0A 00 00 DD 6E F8 DD 66 F9 E5 DD 6E F6 DD +T BB 0B 00 00 DD 6E F8 DD 66 F9 E5 DD 6E F6 DD R 00 00 01 00 -T 34 0A 00 00 66 F7 E5 DD 6E F4 DD 66 F5 E5 21 +T C6 0B 00 00 66 F7 E5 DD 6E F4 DD 66 F5 E5 21 R 00 00 01 00 -T 3F 0A 00 00 02 00 00 00 E5 21 47 01 00 00 E5 +T D1 0B 00 00 02 00 00 00 E5 21 47 01 00 00 E5 R 00 00 01 00 00 04 03 00 00 0A 02 00 -T 46 0A 00 00 CD 00 00 00 00 F1 F1 F1 F1 F1 11 -R 00 00 01 00 02 05 05 00 -T 4F 0A 00 00 00 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 02 04 12 00 02 09 02 00 -T 55 0A 00 00 80 01 00 00 CD 40 01 00 00 7D B4 -R 00 00 01 00 00 04 02 00 00 09 01 00 -T 5C 0A 00 00 20 06 -R 00 00 01 00 -T 5E 0A 00 00 -R 00 00 01 00 -T 5E 0A 00 00 11 01 00 CD 00 00 00 00 -R 00 00 01 00 02 08 22 00 -T 64 0A 00 00 -R 00 00 01 00 -T 64 0A 00 00 21 8A 01 00 00 E5 CD 00 00 00 00 -R 00 00 01 00 00 05 02 00 02 0B 05 00 -T 6B 0A 00 00 F1 3A 80 09 00 00 B7 28 09 -R 00 00 01 00 00 06 04 00 -T 72 0A 00 00 +T D8 0B 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 04 00 02 0A 04 00 +T DE 0B 00 00 00 00 00 00 F1 F1 F1 F1 F1 11 +R 00 00 01 00 02 04 11 00 +T E6 0B 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 12 00 2B 09 01 00 +T EB 0B 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 01 00 02 09 11 00 +T F1 0B 00 00 80 01 00 00 3E E0 01 00 00 21 +R 00 00 01 00 00 04 02 00 29 09 01 00 +T F6 0B 00 00 E0 01 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T FD 0B 00 00 20 0B +R 00 00 01 00 +T FF 0B 00 00 +R 00 00 01 00 +T FF 0B 00 00 11 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 24 00 +T 05 0C 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T 0A 0C 00 00 +R 00 00 01 00 +T 0A 0C 00 00 21 8A 01 00 00 E5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 04 00 +T 10 0C 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 04 00 02 0A 11 00 +T 17 0C 00 00 3A 80 09 00 00 B7 28 0E +R 00 00 01 00 00 05 04 00 +T 1D 0C 00 00 R 00 00 01 00 -T 72 0A 00 00 DD 5E F4 DD 56 F5 CD 3F 06 00 00 -R 00 00 01 00 00 0B 01 00 -T 7B 0A 00 00 +T 1D 0C 00 00 DD 5E F4 DD 56 F5 3E 71 07 00 00 +R 00 00 01 00 29 0B 01 00 +T 25 0C 00 00 21 71 07 00 00 CD 00 00 00 00 +R 00 00 01 00 00 05 01 00 02 0A 11 00 +T 2B 0C 00 00 R 00 00 01 00 -T 7B 0A 00 00 ED 4B 04 06 00 00 2A 08 06 00 00 +T 2B 0C 00 00 ED 4B 04 06 00 00 2A 08 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 82 0A 00 00 A7 ED 42 EB CD 00 00 00 00 22 -R 00 00 01 00 02 09 20 00 -T 8A 0A 00 00 14 06 00 00 7D B4 20 0A +T 32 0C 00 00 A7 ED 42 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 22 00 +T 39 0C 00 00 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 04 22 00 02 09 11 00 +T 3F 0C 00 00 14 06 00 00 7D B4 20 0B R 00 00 01 00 00 04 03 00 -T 90 0A 00 00 +T 45 0C 00 00 R 00 00 01 00 -T 90 0A 00 00 DD 36 FE 8C 01 00 00 DD 36 FF +T 45 0C 00 00 DD 36 FE 8C 01 00 00 DD 36 FF R 00 00 01 00 09 07 02 00 -T 97 0A 00 00 8C 01 00 00 18 6C -R 00 00 01 00 89 04 02 00 -T 9A 0A 00 00 +T 4C 0C 00 00 8C 01 00 00 C3 D0 0C 00 00 +R 00 00 01 00 89 04 02 00 00 09 01 00 +T 50 0C 00 00 R 00 00 01 00 -T 9A 0A 00 00 ED 4B 04 06 00 00 2A 08 06 00 00 +T 50 0C 00 00 ED 4B 04 06 00 00 2A 08 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T A1 0A 00 00 A7 ED 42 E5 0E 00 ED 5B +T 57 0C 00 00 A7 ED 42 E5 0E 00 ED 5B R 00 00 01 00 -T A9 0A 00 00 14 06 00 00 CD 00 00 00 00 E1 ED -R 00 00 01 00 00 04 03 00 02 09 03 00 -T B0 0A 00 00 4B 08 06 00 00 2A 10 06 00 00 A7 +T 5F 0C 00 00 14 06 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 02 00 +T 64 0C 00 00 00 00 00 00 CD 00 00 00 00 E1 ED +R 00 00 01 00 02 04 02 00 02 09 11 00 +T 6B 0C 00 00 4B 08 06 00 00 2A 10 06 00 00 A7 R 00 00 01 00 00 05 03 00 00 0A 03 00 -T B7 0A 00 00 ED 42 EB CD 00 00 00 00 22 -R 00 00 01 00 02 08 20 00 -T BE 0A 00 00 16 06 00 00 7D B4 20 0A +T 72 0C 00 00 ED 42 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 22 00 +T 78 0C 00 00 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 04 22 00 02 09 11 00 +T 7E 0C 00 00 16 06 00 00 7D B4 20 0A R 00 00 01 00 00 04 03 00 -T C4 0A 00 00 +T 84 0C 00 00 R 00 00 01 00 -T C4 0A 00 00 DD 36 FE 99 01 00 00 DD 36 FF +T 84 0C 00 00 DD 36 FE 99 01 00 00 DD 36 FF R 00 00 01 00 09 07 02 00 -T CB 0A 00 00 99 01 00 00 18 38 +T 8B 0C 00 00 99 01 00 00 18 42 R 00 00 01 00 89 04 02 00 -T CE 0A 00 00 +T 8E 0C 00 00 R 00 00 01 00 -T CE 0A 00 00 ED 4B 08 06 00 00 2A 10 06 00 00 +T 8E 0C 00 00 ED 4B 08 06 00 00 2A 10 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T D5 0A 00 00 A7 ED 42 E5 0E 00 ED 5B +T 95 0C 00 00 A7 ED 42 E5 0E 00 ED 5B R 00 00 01 00 -T DD 0A 00 00 16 06 00 00 CD 00 00 00 00 E1 3A -R 00 00 01 00 00 04 03 00 02 09 03 00 -T E4 0A 00 00 84 09 00 00 B7 28 4D +T 9D 0C 00 00 16 06 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 02 00 +T A2 0C 00 00 00 00 00 00 CD 00 00 00 00 E1 3A +R 00 00 01 00 02 04 02 00 02 09 11 00 +T A9 0C 00 00 84 09 00 00 B7 28 61 R 00 00 01 00 00 04 04 00 -T E9 0A 00 00 +T AE 0C 00 00 R 00 00 01 00 -T E9 0A 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 +T AE 0C 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T F0 0A 00 00 A7 ED 42 EB CD 00 00 00 00 22 -R 00 00 01 00 02 09 20 00 -T F8 0A 00 00 18 06 00 00 7D B4 20 23 +T B5 0C 00 00 A7 ED 42 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 22 00 +T BC 0C 00 00 00 00 00 00 CD 00 00 00 00 22 +R 00 00 01 00 02 04 22 00 02 09 11 00 +T C2 0C 00 00 18 06 00 00 7D B4 20 2D R 00 00 01 00 00 04 03 00 -T FE 0A 00 00 +T C8 0C 00 00 R 00 00 01 00 -T FE 0A 00 00 DD 36 FE A6 01 00 00 DD 36 FF +T C8 0C 00 00 DD 36 FE A6 01 00 00 DD 36 FF R 00 00 01 00 09 07 02 00 -T 05 0B 00 00 A6 01 00 00 +T CF 0C 00 00 A6 01 00 00 R 00 00 01 00 89 04 02 00 -T 06 0B 00 00 +T D0 0C 00 00 R 00 00 01 00 -T 06 0B 00 00 DD 6E FE DD 66 FF E5 21 +T D0 0C 00 00 DD 6E FE DD 66 FF E5 21 R 00 00 01 00 -T 0E 0B 00 00 B2 01 00 00 E5 21 00 00 00 00 E5 +T D8 0C 00 00 B2 01 00 00 E5 21 00 00 00 00 E5 R 00 00 01 00 00 04 02 00 02 0A 06 00 -T 15 0B 00 00 CD 00 00 00 00 F1 F1 F1 11 01 00 -R 00 00 01 00 02 05 21 00 -T 1E 0B 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 22 00 -T 21 0B 00 00 -R 00 00 01 00 -T 21 0B 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 +T DF 0C 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 23 00 02 0A 23 00 +T E5 0C 00 00 00 00 00 00 F1 F1 F1 11 01 00 3E +R 00 00 01 00 02 04 11 00 +T EE 0C 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 24 00 02 09 24 00 +T F3 0C 00 00 00 00 00 00 +R 00 00 01 00 02 04 11 00 +T F5 0C 00 00 +R 00 00 01 00 +T F5 0C 00 00 ED 4B 0C 06 00 00 2A 10 06 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 28 0B 00 00 A7 ED 42 E5 0E 00 ED 5B +T FC 0C 00 00 A7 ED 42 E5 0E 00 ED 5B R 00 00 01 00 -T 30 0B 00 00 18 06 00 00 CD 00 00 00 00 E1 -R 00 00 01 00 00 04 03 00 02 09 03 00 -T 36 0B 00 00 +T 04 0D 00 00 18 06 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 02 00 +T 09 0D 00 00 00 00 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 02 04 02 00 02 09 11 00 +T 0F 0D 00 00 R 00 00 01 00 -T 36 0B 00 00 DD 6E F8 DD 66 F9 E5 DD 4E F6 DD +T 0F 0D 00 00 DD 6E F8 DD 66 F9 E5 DD 4E F6 DD R 00 00 01 00 -T 41 0B 00 00 46 F7 DD 5E F4 DD 56 F5 CD +T 1A 0D 00 00 46 F7 DD 5E F4 DD 56 F5 3E R 00 00 01 00 -T 4A 0B 00 00 96 01 00 00 E1 ED 5B 00 00 00 00 -R 00 00 01 00 00 04 01 00 00 0B 03 00 -T 51 0B 00 00 CD 00 00 00 00 3A 83 09 00 00 B7 -R 00 00 01 00 02 05 08 00 00 0A 04 00 -T 58 0B 00 00 28 0D +T 23 0D 00 00 4A 02 00 00 21 4A 02 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 28 0D 00 00 00 00 00 00 E1 ED 5B 00 00 00 00 +R 00 00 01 00 02 04 11 00 00 0B 03 00 +T 2F 0D 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 08 00 02 0A 08 00 +T 35 0D 00 00 00 00 00 00 3A 83 09 00 00 B7 28 +R 00 00 01 00 02 04 11 00 00 09 04 00 +T 3C 0D 00 00 12 R 00 00 01 00 -T 5A 0B 00 00 +T 3D 0D 00 00 R 00 00 01 00 -T 5A 0B 00 00 21 02 00 00 00 E5 21 CD 01 00 00 +T 3D 0D 00 00 21 02 00 00 00 E5 21 CD 01 00 00 R 00 00 01 00 00 05 03 00 00 0B 02 00 -T 61 0B 00 00 E5 CD 00 00 00 00 F1 F1 -R 00 00 01 00 02 06 05 00 -T 67 0B 00 00 +T 44 0D 00 00 E5 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 04 00 02 0B 04 00 +T 4A 0D 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 05 11 00 +T 4F 0D 00 00 R 00 00 01 00 -T 67 0B 00 00 11 00 00 CD 00 00 00 00 C3 -R 00 00 01 00 02 08 22 00 -T 6E 0B 00 00 00 00 00 00 -R 00 00 01 00 02 04 0C 00 -T 70 0B 00 00 +T 4F 0D 00 00 11 00 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 24 00 +T 55 0D 00 00 00 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 02 04 24 00 02 09 11 00 +T 5B 0D 00 00 00 00 00 00 +R 00 00 01 00 02 04 05 00 +T 5D 0D 00 00 R 00 00 01 00 -T 70 0B 00 00 CD 00 00 00 00 FA FF DD 6E 08 DD -R 00 00 01 00 02 05 16 00 -T 79 0B 00 00 66 09 DD 75 FC DD 74 FD +T 5D 0D 00 00 CD 00 00 00 00 FA FF DD 6E 0A DD +R 00 00 01 00 02 05 17 00 +T 66 0D 00 00 66 0B DD 75 FC DD 74 FD R 00 00 01 00 -T 81 0B 00 00 +T 6E 0D 00 00 R 00 00 01 00 -T 81 0B 00 00 DD 6E 0E DD 66 0F E5 DD 6E 0C DD +T 6E 0D 00 00 DD 6E 10 DD 66 11 E5 DD 6E 0E DD R 00 00 01 00 -T 8C 0B 00 00 66 0D E5 DD 6E FC DD 66 FD 01 +T 79 0D 00 00 66 0F E5 DD 6E FC DD 66 FD 01 R 00 00 01 00 -T 96 0B 00 00 00 00 CD 00 00 00 00 D2 -R 00 00 01 00 02 07 14 00 -T 9C 0B 00 00 4F 0C 00 00 +T 83 0D 00 00 00 00 CD 00 00 00 00 D2 +R 00 00 01 00 02 07 15 00 +T 89 0D 00 00 50 0E 00 00 R 00 00 01 00 00 04 01 00 -T 9E 0B 00 00 +T 8B 0D 00 00 R 00 00 01 00 -T 9E 0B 00 00 DD 4E 0C DD 46 0D DD 6E FC DD 66 +T 8B 0D 00 00 DD 4E 0E DD 46 0F DD 6E FC DD 66 R 00 00 01 00 -T A9 0B 00 00 FD 3E 02 84 67 7D E6 00 5F 7C E6 +T 96 0D 00 00 FD 3E 02 84 67 7D E6 00 5F 7C E6 R 00 00 01 00 -T B4 0B 00 00 FE 57 CD 00 00 00 00 DD 75 FE DD -R 00 00 01 00 02 07 18 00 -T BD 0B 00 00 74 FF DD 4E FC DD 46 FD A7 ED 42 +T A1 0D 00 00 FE 57 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 19 00 +T A6 0D 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 19 00 02 09 11 00 +T AD 0D 00 00 FE DD 74 FF DD 4E FC DD 46 FD A7 R 00 00 01 00 -T C8 0B 00 00 01 00 02 A7 ED 42 30 16 +T B8 0D 00 00 ED 42 01 00 02 A7 ED 42 30 1B R 00 00 01 00 -T D0 0B 00 00 +T C2 0D 00 00 R 00 00 01 00 -T D0 0B 00 00 06 09 DD 5E FC DD 56 FD CD +T C2 0D 00 00 06 09 DD 5E FC DD 56 FD CD R 00 00 01 00 -T D9 0B 00 00 00 00 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 02 04 00 00 00 09 01 00 -T E0 0B 00 00 FA DD 74 FB 18 08 +T CB 0D 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 00 00 29 09 01 00 +T D0 0D 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T D7 0D 00 00 FA DD 74 FB 18 08 R 00 00 01 00 -T E6 0B 00 00 +T DD 0D 00 00 R 00 00 01 00 -T E6 0B 00 00 DD 36 FA 02 02 00 00 DD 36 FB +T DD 0D 00 00 DD 36 FA 02 02 00 00 DD 36 FB R 00 00 01 00 09 07 03 00 -T ED 0B 00 00 02 02 00 00 +T E4 0D 00 00 02 02 00 00 R 00 00 01 00 89 04 03 00 -T EE 0B 00 00 +T E5 0D 00 00 R 00 00 01 00 -T EE 0B 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 +T E5 0D 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 R 00 00 01 00 -T F9 0B 00 00 FF A7 ED 42 E5 79 E6 FF 6F 78 E6 +T F0 0D 00 00 FF A7 ED 42 E5 79 E6 FF 6F 78 E6 R 00 00 01 00 -T 04 0C 00 00 01 67 DD 5E FA DD 56 FB 19 4D 44 +T FB 0D 00 00 01 67 DD 5E FA DD 56 FB 19 4D 44 R 00 00 01 00 -T 0F 0C 00 00 DD 5E 08 DD 56 09 DD 6E FC DD 66 +T 06 0E 00 00 DD 5E 0A DD 56 0B DD 6E FC DD 66 R 00 00 01 00 -T 1A 0C 00 00 FD A7 ED 52 DD 5E 02 DD 56 03 19 +T 11 0E 00 00 FD A7 ED 52 DD 5E 02 DD 56 03 19 R 00 00 01 00 -T 25 0C 00 00 EB CD 00 00 00 00 E1 DD 4E FA DD -R 00 00 01 00 02 06 0E 00 -T 2E 0C 00 00 46 FB C5 06 09 DD 5E FC DD 56 FD +T 1C 0E 00 00 EB 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 0D 00 02 0B 0D 00 +T 22 0E 00 00 CD 00 00 00 00 E1 DD 4E FA DD 46 +R 00 00 01 00 02 05 11 00 +T 2B 0E 00 00 FB C5 06 09 DD 5E FC DD 56 FD CD R 00 00 01 00 -T 39 0C 00 00 CD 00 00 00 00 C1 CD 30 00 00 00 -R 00 00 01 00 02 05 00 00 00 0B 01 00 -T 40 0C 00 00 DD 6E FE DD 66 FF DD 75 FC DD 74 +T 36 0E 00 00 00 00 00 00 3E 3F 00 00 00 21 +R 00 00 01 00 02 04 00 00 29 09 01 00 +T 3B 0E 00 00 3F 00 00 00 C1 CD 00 00 00 00 DD +R 00 00 01 00 00 04 01 00 02 0A 11 00 +T 42 0E 00 00 6E FE DD 66 FF DD 75 FC DD 74 FD R 00 00 01 00 -T 4B 0C 00 00 FD C3 81 0B 00 00 -R 00 00 01 00 00 06 01 00 -T 4F 0C 00 00 +T 4D 0E 00 00 C3 6E 0D 00 00 +R 00 00 01 00 00 05 01 00 +T 50 0E 00 00 R 00 00 01 00 -T 4F 0C 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0C 00 +T 50 0E 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 05 00 T 00 00 00 00 R 00 00 02 00 T 00 00 00 00 52 65 61 64 20 6F 66 20 62 6C 6F @@ -1421,9 +1629,9 @@ T 84 09 00 00 R 00 00 04 00 T 84 09 00 00 R 00 00 04 00 -T 00 00 00 00 43 38 33 30 30 33 30 33 31 31 30 +T 00 00 00 00 43 36 45 46 30 33 30 35 30 39 32 R 00 00 05 00 -T 0B 00 00 00 34 35 32 34 34 31 00 80 CD A3 06 +T 0B 00 00 00 30 33 39 31 30 31 00 80 CD A3 06 R 00 00 05 00 T 16 00 00 00 CD AB 05 CD FD 04 18 22 00 00 00 R 00 00 05 00 diff --git a/src/fsutil/n.bat b/src/fsutil/n.bat index 14d4e49e..1cb4914d 100644 --- a/src/fsutil/n.bat +++ b/src/fsutil/n.bat @@ -60,12 +60,17 @@ link @bd.w32 @if errorlevel 1 goto failure copy bd.exe ..\bin +rem compile utils in large mode, once, for large-mode mkfs and fsck + iccz80 -S -w -ml -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 utils @if errorlevel 1 goto failure del utils.r01 as-z80 -l -o utils.s01 @if errorlevel 1 goto failure +call mklink-l mkfs +echo utils >> mkfs.lnk + iccz80 -S -w -ml -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 mkfs @if errorlevel 1 goto failure del mkfs.r01 @@ -77,6 +82,9 @@ link-z80 -f mkfs ihex2bin -l mkfs.i86 ..\..\bin\large\mkfs @if errorlevel 1 goto failure +call mklink-l fsck +echo utils >> fsck.lnk + iccz80 -S -w -ml -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 fsck @if errorlevel 1 goto failure del fsck.r01 @@ -88,6 +96,42 @@ link-z80 -f fsck ihex2bin -l fsck.i86 ..\..\bin\large\fsck @if errorlevel 1 goto failure +rem compile utils in banked mode, once, for banked-mode mkfs and fsck + +iccz80 -S -w -mb -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 utils +@if errorlevel 1 goto failure +del utils.r01 +as-z80 -l -o utils.s01 +@if errorlevel 1 goto failure + +call mklink-b mkfs +echo utils >> mkfs.lnk + +iccz80 -S -w -mb -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 mkfs +@if errorlevel 1 goto failure +del mkfs.r01 +as-z80 -l -o mkfs.s01 +@if errorlevel 1 goto failure + +link-z80 -f mkfs +@if errorlevel 1 goto failure +ihex2bin -l mkfs.i86 ..\..\bin\banked\mkfs +@if errorlevel 1 goto failure + +call mklink-b fsck +echo utils >> fsck.lnk + +iccz80 -S -w -mb -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 fsck +@if errorlevel 1 goto failure +del fsck.r01 +as-z80 -l -o fsck.s01 +@if errorlevel 1 goto failure + +link-z80 -f fsck +@if errorlevel 1 goto failure +ihex2bin -l fsck.i86 ..\..\bin\banked\fsck +@if errorlevel 1 goto failure + iccz80 -S -w -ml -v1 -z -A -I..\..\include\ -I..\kernel\uzi\ -DUTIL -DNATIVE -DDEBUG=1 bd -l bd @if errorlevel 1 goto failure del bd.r01 diff --git a/src/fsutil/ucp.c b/src/fsutil/ucp.c index 04d3813b..86aded38 100644 --- a/src/fsutil/ucp.c +++ b/src/fsutil/ucp.c @@ -71,7 +71,11 @@ uchar line[128+1]; uchar f_pause = 0; int xls(char *option, char *path); -int xchmod(char *path, char *modes); +int xchmod(char *modes, char *path); /* Nick reversed argument order */ +#if 1 /* Nick */ +int xchown(char *uidno, char *path); +int xchgrp(char *gidno, char *path); +#endif int xumask(char *masks); int xmknod(char *path, char *modes, char *devs, char *devs1); int xmkdir(char *path); @@ -113,6 +117,10 @@ char *help[] = { "mkdir name", "mknod name mode major minor", "chmod mode name", +#if 1 /* Nick */ + "chown decimaluid name", + "chgrp decimalgid name", +#endif "[b]get dosfilename [uzixfilename]", "[b]put uzixfilename [dosfilename]", "type|cat filename", @@ -187,6 +195,16 @@ int execute(cmd, a1, a2, a3, a4) if (*a1 && *a2) xchmod(a1, a2); } +#if 1 /* Nick */ + else if (eq(cmd, "chown")) { + if (*a1 && *a2) + xchown(a1, a2); + } + else if (eq(cmd, "chgrp")) { + if (*a1 && *a2) + xchgrp(a1, a2); + } +#endif else if (eq(cmd, "ln")) { if (*a1 && *a2) UZIXlink(a1, a2); diff --git a/src/fsutil/ucp.exe b/src/fsutil/ucp.exe index 1b4d72e7..29b22fa1 100644 Binary files a/src/fsutil/ucp.exe and b/src/fsutil/ucp.exe differ diff --git a/src/fsutil/ucp.map b/src/fsutil/ucp.map index 43e53cfb..44d8238b 100644 --- a/src/fsutil/ucp.map +++ b/src/fsutil/ucp.map @@ -1,13 +1,13 @@ ucp - Timestamp is 3e6cd0f0 (Tue Mar 11 04:52:48 2003) + Timestamp is 3ebb8562 (Fri May 09 20:39:30 2003) Preferred load address is 00400000 Start Length Name Class - 0001:00000000 000197f7H .text CODE - 0002:00000000 00000696H .rdata DATA - 0002:00000696 00000000H .edata DATA + 0001:00000000 0001aa8fH .text CODE + 0002:00000000 000006d0H .rdata DATA + 0002:000006d0 00000000H .edata DATA 0003:00000000 00000104H .CRT$XCA DATA 0003:00000104 00000104H .CRT$XCZ DATA 0003:00000208 00000104H .CRT$XIA DATA @@ -18,725 +18,758 @@ 0003:00000724 00000104H .CRT$XPZ DATA 0003:00000828 00000104H .CRT$XTA DATA 0003:0000092c 00000104H .CRT$XTZ DATA - 0003:00000a30 000026eeH .data DATA - 0003:00003120 000076a4H .bss DATA + 0003:00000a30 00004f6fH .data DATA + 0003:000059a0 00006c04H .bss DATA 0004:00000000 00000014H .idata$2 DATA 0004:00000014 00000014H .idata$3 DATA - 0004:00000028 00000138H .idata$4 DATA - 0004:00000160 00000138H .idata$5 DATA - 0004:00000298 00000559H .idata$6 DATA + 0004:00000028 00000144H .idata$4 DATA + 0004:0000016c 00000144H .idata$5 DATA + 0004:000002b0 0000059dH .idata$6 DATA Address Publics by Value Rva+Base Lib:Object - 0001:000008a0 _pse 004018a0 f ucp.obj - 0001:000008e6 _dohelp 004018e6 f ucp.obj - 0001:0000092d _eq 0040192d f ucp.obj - 0001:00000947 _execute 00401947 f ucp.obj - 0001:00000ea9 _usage 00401ea9 f ucp.obj - 0001:00000ec7 _main 00401ec7 f ucp.obj - 0001:000019e0 _ldir 004029e0 f ucpsub.obj - 0001:00001a21 _devdir 00402a21 f ucpsub.obj - 0001:00001a9c _prot 00402a9c f ucpsub.obj - 0001:00001aae _dols 00402aae f ucpsub.obj - 0001:0000206e _xls 0040306e f ucpsub.obj - 0001:00002164 _xchmod 00403164 f ucpsub.obj - 0001:000021e4 _xumask 004031e4 f ucpsub.obj - 0001:00002265 _xmknod 00403265 f ucpsub.obj - 0001:00002399 _xmkdir 00403399 f ucpsub.obj - 0001:000023e0 _xget 004033e0 f ucpsub.obj - 0001:0000258b _xput 0040358b f ucpsub.obj - 0001:00002722 _xtype 00403722 f ucpsub.obj - 0001:000027c0 _xdump 004037c0 f ucpsub.obj - 0001:00002a7e _xunlink 00403a7e f ucpsub.obj - 0001:00002b64 _xrmdir 00403b64 f ucpsub.obj - 0001:00002d68 _xdf 00403d68 f ucpsub.obj - 0001:00002e27 _xalign 00403e27 f ucpsub.obj - 0001:00002f1c _xualign 00403f1c f ucpsub.obj - 0001:00003560 _wd_read 00404560 f devhd.obj - 0001:00003597 _wd_write 00404597 f devhd.obj - 0001:000035ce _setup 004045ce f devhd.obj - 0001:0000372b _chkstat 0040472b f devhd.obj - 0001:00003771 _wd_open 00404771 f devhd.obj - 0001:00003810 _bread 00404810 f devio.obj - 0001:00003947 _bfree 00404947 f devio.obj - 0001:000039fe _zerobuf 004049fe f devio.obj - 0001:00003a85 _bufsync 00404a85 f devio.obj - 0001:00003af9 _bfind 00404af9 f devio.obj - 0001:00003b51 _freebuf 00404b51 f devio.obj - 0001:00003c93 _bufdump 00404c93 f devio.obj - 0001:00003d7a _validdev 00404d7a f devio.obj - 0001:00003e05 _bdreadwrite 00404e05 f devio.obj - 0001:00003e83 _cdreadwrite 00404e83 f devio.obj - 0001:00003ee9 _d_openclose 00404ee9 f devio.obj - 0001:00003f49 _d_ioctl 00404f49 f devio.obj - 0001:00003f9f _d_init 00404f9f f devio.obj - 0001:00003ffe _ok 00404ffe f devio.obj - 0001:00004005 _ok_rdwr 00405005 f devio.obj - 0001:0000400c _nogood 0040500c f devio.obj - 0001:00004014 _nogood_ioctl 00405014 f devio.obj - 0001:0000401c _insq 0040501c f devio.obj - 0001:0000408e _remq 0040508e f devio.obj - 0001:000040fc _uninsq 004050fc f devio.obj - 0001:0000416f _clrq 0040516f f devio.obj - 0001:000043f0 _mem_read 004053f0 f devmisc.obj - 0001:00004451 _mem_write 00405451 f devmisc.obj - 0001:000044b4 _null_write 004054b4 f devmisc.obj - 0001:000044be _lpr_open 004054be f devmisc.obj - 0001:000044cc _lpr_close 004054cc f devmisc.obj - 0001:000044e5 _lpr_write 004054e5 f devmisc.obj - 0001:0000454b _mt_read 0040554b f devmisc.obj - 0001:00004553 _mt_write 00405553 f devmisc.obj - 0001:0000455b _mt_open 0040555b f devmisc.obj - 0001:00004563 _mt_close 00405563 f devmisc.obj - 0001:000045d0 _tty_read 004055d0 f devtty.obj - 0001:00004783 _tty_write 00405783 f devtty.obj - 0001:00004900 _tty_open 00405900 f devtty.obj - 0001:00004997 _tty_close 00405997 f devtty.obj - 0001:000049fb _tty_ioctl 004059fb f devtty.obj - 0001:00004b99 _tty_inproc 00405b99 f devtty.obj - 0001:00004f41 _tty_inproc_dummy 00405f41 f devtty.obj - 0001:00004f46 _echo 00405f46 f devtty.obj - 0001:000051e0 _findfs 004061e0 f filesys.obj - 0001:0000522c _getfs 0040622c f filesys.obj - 0001:00005281 _wr_inode 00406281 f filesys.obj - 0001:00005354 _i_ref 00406354 f filesys.obj - 0001:000053b2 _i_deref 004063b2 f filesys.obj - 0001:00005489 _i_free 00406489 f filesys.obj - 0001:00005522 __namei 00406522 f filesys.obj - 0001:000056f9 _namei 004066f9 f filesys.obj - 0001:00005a57 _srch_dir 00406a57 f filesys.obj - 0001:00005b87 _srch_mt 00406b87 f filesys.obj - 0001:00005be7 _i_open 00406be7 f filesys.obj - 0001:00005e80 _ch_link 00406e80 f filesys.obj - 0001:00006029 _filename 00407029 f filesys.obj - 0001:000060d0 _namecomp 004070d0 f filesys.obj - 0001:00006156 _newfile 00407156 f filesys.obj - 0001:00006232 _doclose 00407232 f filesys.obj - 0001:000062d3 _i_alloc 004072d3 f filesys.obj - 0001:000063d8 _blk_alloc 004073d8 f filesys.obj - 0001:00006512 _blk_free 00407512 f filesys.obj - 0001:000065c0 _oft_alloc 004075c0 f filesys.obj - 0001:00006630 _oft_deref 00407630 f filesys.obj - 0001:00006688 _uf_alloc 00407688 f filesys.obj - 0001:000066e0 _isdevice 004076e0 f filesys.obj - 0001:00006727 _freeblk 00407727 f filesys.obj - 0001:000067c8 _f_trunc 004077c8 f filesys.obj - 0001:00006881 _bmap 00407881 f filesys.obj - 0001:00006ae1 _validblk 00407ae1 f filesys.obj - 0001:00006b60 _getinode 00407b60 f filesys.obj - 0001:00006c3c _getperm 00407c3c f filesys.obj - 0001:00006cdc _setftim 00407cdc f filesys.obj - 0001:00006d46 _fmount 00407d46 f filesys.obj - 0001:00006efe _magic 00407efe f filesys.obj - 0001:00006f28 _i_sync 00407f28 f filesys.obj - 0001:00006f9d _fs_sync 00407f9d f filesys.obj - 0001:00007d40 _scsiop 00408d40 f hdasm.obj - 0001:00007e60 _fs_init 00408e60 f machdep.obj - 0001:00007e81 _valadr 00408e81 f machdep.obj - 0001:00007e8b _addtick 00408e8b f machdep.obj - 0001:00007ee9 _incrtick 00408ee9 f machdep.obj - 0001:00007f28 _calltrap 00408f28 f machdep.obj - 0001:00007fae _sttime 00408fae f machdep.obj - 0001:00007fc6 _panic 00408fc6 f machdep.obj - 0001:00008014 _warning 00409014 f machdep.obj - 0001:00008048 _idump 00409048 f machdep.obj - 0001:000082b0 _abort 004092b0 f main.obj - 0001:000082ce _rdtime 004092ce f main.obj - 0001:00008370 _init2 00409370 f process.obj - 0001:00008591 _psleep 00409591 f process.obj - 0001:0000860d _wakeup 0040960d f process.obj - 0001:00008658 _getproc 00409658 f process.obj - 0001:000086b1 _newproc 004096b1 f process.obj - 0001:000087f1 _ptab_alloc 004097f1 f process.obj - 0001:000088a6 _clkint2 004098a6 f process.obj - 0001:000089ea _unix2 004099ea f process.obj - 0001:00008a72 _chksigs 00409a72 f process.obj - 0001:00008b30 _sgrpsig 00409b30 f process.obj - 0001:00008b7c _ssig 00409b7c f process.obj - 0001:00008bf3 _sendsig 00409bf3 f process.obj - 0001:00008c47 _dowait 00409c47 f process.obj - 0001:00008fa0 _sys_NONE 00409fa0 f scall1.obj - 0001:00008fb2 _sys_sync 00409fb2 f scall1.obj - 0001:00008fc3 _sys_utime 00409fc3 f scall1.obj - 0001:000090e4 _sys_close 0040a0e4 f scall1.obj - 0001:000090f7 _truncateto0 0040a0f7 f scall1.obj - 0001:00009170 _sys_open 0040a170 f scall1.obj - 0001:000094a9 _sys_link 0040a4a9 f scall1.obj - 0001:000095f4 _sys_symlink 0040a5f4 f scall1.obj - 0001:000096e2 _sys_unlink 0040a6e2 f scall1.obj - 0001:000097fc _sys_readwrite 0040a7fc f scall1.obj - 0001:00009892 _sys_lseek 0040a892 f scall1.obj - 0001:00009970 _sys_chdir 0040a970 f scall1.obj - 0001:000099ff _sys_chroot 0040a9ff f scall1.obj - 0001:00009a3d _sys_mknod 0040aa3d f scall1.obj - 0001:00009b18 _sys_access 0040ab18 f scall1.obj - 0001:00009bff _sys_chmod 0040abff f scall1.obj - 0001:00009ce3 _sys_chown 0040ace3 f scall1.obj - 0001:00009d0a _stcpy 0040ad0a f scall1.obj - 0001:00009da7 _sys_statfstat 0040ada7 f scall1.obj - 0001:00009e3a _sys_falign 0040ae3a f scall1.obj - 0001:00009ea4 _sys_dup 0040aea4 f scall1.obj - 0001:00009f2f _sys_dup2 0040af2f f scall1.obj - 0001:00009fdb _sys_getfsys 0040afdb f scall1.obj - 0001:0000a036 _sys_ioctl 0040b036 f scall1.obj - 0001:0000a0c9 _sys_mountumount 0040b0c9 f scall1.obj - 0001:0000a32c _sys_time 0040b32c f scall1.obj - 0001:0000a364 _exit0 0040b364 f scall1.obj - 0001:0000a375 _n_creat 0040b375 f scall1.obj - 0001:0000a531 _readwritei 0040b531 f scall1.obj - 0001:0000aa5b _rwsetup 0040ba5b f scall1.obj - 0001:0000ab08 _getfsys 0040bb08 f scall1.obj - 0001:0000b410 _findprocess 0040c410 f scall2.obj - 0001:0000b475 _filldesc 0040c475 f scall2.obj - 0001:0000b4ab _sys_pipe 0040c4ab f scall2.obj - 0001:0000b642 _sys_stime 0040c642 f scall2.obj - 0001:0000b691 _sys_times 0040c691 f scall2.obj - 0001:0000b6e0 _sys_brk 0040c6e0 f scall2.obj - 0001:0000b71c _sys_sbrk 0040c71c f scall2.obj - 0001:0000b762 _sys_waitpid 0040c762 f scall2.obj - 0001:0000b7dd _sys__exit 0040c7dd f scall2.obj - 0001:0000b7f5 _doexit 0040c7f5 f scall2.obj - 0001:0000b929 _sys_fork 0040c929 f scall2.obj - 0001:0000b92e _sys_pause 0040c92e f scall2.obj - 0001:0000b94a _sys_signal 0040c94a f scall2.obj - 0001:0000ba03 _sys_kill 0040ca03 f scall2.obj - 0001:0000ba67 _sys_alarm 0040ca67 f scall2.obj - 0001:0000ba8b _sys_reboot 0040ca8b f scall2.obj - 0001:0000bade _sys_getset 0040cade f scall2.obj - 0001:0000bf10 _bitmap_align 0040cf10 f xip.obj - 0001:0000c62a _bitmap_ualign 0040d62a f xip.obj - 0001:0000c752 _bitmap_examine 0040d752 f xip.obj - 0001:0000c977 _bitmap_align_chase 0040d977 f xip.obj - 0001:0000cae2 _bitmap_align_bmap 0040dae2 f xip.obj - 0001:0000cd68 _bitmap_align_reverse 0040dd68 f xip.obj - 0001:0000ce53 _bitmap_align_recurse 0040de53 f xip.obj - 0001:0000d2d7 _bitmap_search 0040e2d7 f xip.obj - 0001:0000d469 _bitmap_reserve 0040e469 f xip.obj - 0001:0000d656 _bitmap_find 0040e656 f xip.obj - 0001:0000d895 _bitmap_get 0040e895 f xip.obj - 0001:0000d966 _bitmap_set 0040e966 f xip.obj - 0001:0000e010 _bzero 0040f010 f utils.obj - 0001:0000e036 _bfill 0040f036 f utils.obj - 0001:0000e05e _bcopy 0040f05e f utils.obj - 0001:0000e091 _int_min 0040f091 f utils.obj - 0001:0000e0b2 _int_max 0040f0b2 f utils.obj - 0001:0000e110 _xfs_init 0040f110 f xfs.obj - 0001:0000e27e _xfs_end 0040f27e f xfs.obj - 0001:0000e2c5 _UZIXopen 0040f2c5 f xfs.obj - 0001:0000e2ea _UZIXclose 0040f2ea f xfs.obj - 0001:0000e2fc _UZIXcreat 0040f2fc f xfs.obj - 0001:0000e321 _UZIXlink 0040f321 f xfs.obj - 0001:0000e33c _UZIXsymlink 0040f33c f xfs.obj - 0001:0000e357 _UZIXunlink 0040f357 f xfs.obj - 0001:0000e369 _UZIXread 0040f369 f xfs.obj - 0001:0000e394 _UZIXwrite 0040f394 f xfs.obj - 0001:0000e3bf _UZIXlseek 0040f3bf f xfs.obj - 0001:0000e3ee _UZIXchdir 0040f3ee f xfs.obj - 0001:0000e400 _UZIXmknod 0040f400 f xfs.obj - 0001:0000e424 _UZIXsync 0040f424 f xfs.obj - 0001:0000e42e _UZIXaccess 0040f42e f xfs.obj - 0001:0000e449 _UZIXchmod 0040f449 f xfs.obj - 0001:0000e464 _UZIXchown 0040f464 f xfs.obj - 0001:0000e488 _UZIXstat 0040f488 f xfs.obj - 0001:0000e4aa _UZIXfstat 0040f4aa f xfs.obj - 0001:0000e4cc _UZIXfalign 0040f4cc f xfs.obj - 0001:0000e4e7 _UZIXdup 0040f4e7 f xfs.obj - 0001:0000e4f9 _UZIXdup2 0040f4f9 f xfs.obj - 0001:0000e514 _UZIXumask 0040f514 f xfs.obj - 0001:0000e530 _UZIXgetfsys 0040f530 f xfs.obj - 0001:0000e550 _UZIXioctl 0040f550 f xfs.obj - 0001:0000e574 _UZIXmount 0040f574 f xfs.obj - 0001:0000e59f _UZIXumount 0040f59f f xfs.obj - 0001:0000e5b8 _UZIXtime 0040f5b8 f xfs.obj - 0001:0000e6f8 ___initstdio 0040f6f8 f LIBC:_file.obj - 0001:0000e79d ___endstdio 0040f79d f LIBC:_file.obj - 0001:0000e7b1 _fgets 0040f7b1 f LIBC:fgets.obj - 0001:0000e808 _fflush 0040f808 f LIBC:fflush.obj - 0001:0000e843 __flush 0040f843 f LIBC:fflush.obj - 0001:0000e89f __flushall 0040f89f f LIBC:fflush.obj - 0001:0000e915 _fprintf 0040f915 f LIBC:fprintf.obj - 0001:0000e947 _printf 0040f947 f LIBC:printf.obj - 0001:0000e980 _strcpy 0040f980 f LIBC:strcat.obj - 0001:0000e990 _strcat 0040f990 f LIBC:strcat.obj - 0001:0000ea70 __cinit 0040fa70 f LIBC:crt0dat.obj - 0001:0000ea9d _exit 0040fa9d f LIBC:crt0dat.obj - 0001:0000eaae __exit 0040faae f LIBC:crt0dat.obj - 0001:0000eabf __cexit 0040fabf f LIBC:crt0dat.obj - 0001:0000eace __c_exit 0040face f LIBC:crt0dat.obj - 0001:0000eb90 _system 0040fb90 f LIBC:system.obj - 0001:0000ec40 _strchr 0040fc40 f LIBC:strchr.obj - 0001:0000ec46 ___from_strstr_to_strchr 0040fc46 f LIBC:strchr.obj - 0001:0000ecfc _sscanf 0040fcfc f LIBC:sscanf.obj - 0001:0000ed30 _fputs 0040fd30 f LIBC:fputs.obj - 0001:0000ed73 __flsbuf 0040fd73 f LIBC:_flsbuf.obj - 0001:0000ee90 _strlen 0040fe90 f LIBC:strlen.obj - 0001:0000ef0b __isctype 0040ff0b f LIBC:isctype.obj - 0001:0000ef80 __fsopen 0040ff80 f LIBC:fopen.obj - 0001:0000efa0 _fopen 0040ffa0 f LIBC:fopen.obj - 0001:0000efb3 _sprintf 0040ffb3 f LIBC:sprintf.obj - 0001:0000f010 _strncat 00410010 f LIBC:strncat.obj - 0001:0000f133 _fclose 00410133 f LIBC:fclose.obj - 0001:0000f189 _fread 00410189 f LIBC:fread.obj - 0001:0000f271 _fwrite 00410271 f LIBC:fwrite.obj - 0001:0000f37b _atol 0041037b f LIBC:atox.obj - 0001:0000f406 _atoi 00410406 f LIBC:atox.obj - 0001:0000f411 __atoi64 00410411 f LIBC:atox.obj - 0001:0000f4cb __fputchar 004104cb f LIBC:fputchar.obj - 0001:0000f4fa _putchar 004104fa f LIBC:fputchar.obj - 0001:0000f505 _localtime 00410505 f LIBC:localtim.obj - 0001:0000f665 _time 00410665 f LIBC:time.obj - 0001:0000f741 _mainCRTStartup 00410741 f LIBC:crt0.obj - 0001:0000f820 __amsg_exit 00410820 f LIBC:crt0.obj - 0001:0000f869 __ioinit 00410869 f LIBC:ioinit.obj - 0001:0000fa14 __ioterm 00410a14 f LIBC:ioinit.obj - 0001:0000fa37 _calloc 00410a37 f LIBC:calloc.obj - 0001:0000fab4 __fcloseall 00410ab4 f LIBC:closeall.obj - 0001:0000fb0c __filbuf 00410b0c f LIBC:_filbuf.obj - 0001:0000fbe5 __commit 00410be5 f LIBC:commit.obj - 0001:0000fc3c __write 00410c3c f LIBC:write.obj - 0001:0000fc3c _write 00410c3c f LIBC:write.obj - 0001:0000fde9 __stbuf 00410de9 f LIBC:_sftbuf.obj - 0001:0000fe76 __ftbuf 00410e76 f LIBC:_sftbuf.obj - 0001:0000feb3 __output 00410eb3 f LIBC:output.obj - 0001:000106bd __spawnvpe 004116bd f LIBC:spawnvpe.obj - 0001:00010820 __spawnve 00411820 f LIBC:spawnve.obj - 0001:000109ba __access 004119ba f LIBC:access.obj - 0001:000109fe _getenv 004119fe f LIBC:getenv.obj - 0001:00010a7b __input 00411a7b f LIBC:input.obj - 0001:0001152c _lseek 0041252c f LIBC:lseek.obj - 0001:0001152c __lseek 0041252c f LIBC:lseek.obj - 0001:000115c6 __getbuf 004125c6 f LIBC:_getbuf.obj - 0001:0001160a __isatty 0041260a f LIBC:isatty.obj - 0001:0001160a _isatty 0041260a f LIBC:isatty.obj - 0001:00011630 ___crtGetStringTypeA 00412630 f LIBC:a_str.obj - 0001:00011779 __openfile 00412779 f LIBC:_open.obj - 0001:000118e9 __getstream 004128e9 f LIBC:stream.obj - 0001:00011961 _free 00412961 f LIBC:free.obj - 0001:00011990 __close 00412990 f LIBC:close.obj - 0001:00011a43 __freebuf 00412a43 f LIBC:_freebuf.obj - 0001:00011a6e __read 00412a6e f LIBC:read.obj - 0001:00011a6e _read 00412a6e f LIBC:read.obj - 0001:00011c70 _memcpy 00412c70 f LIBC:memcpy.obj - 0001:00011fb0 __allmul 00412fb0 f LIBC:llmul.obj - 0001:00011fe4 ___tzset 00412fe4 f LIBC:tzset.obj - 0001:00011ff9 __tzset 00412ff9 f LIBC:tzset.obj - 0001:00012257 __isindst 00413257 f LIBC:tzset.obj - 0001:00012543 _gmtime 00413543 f LIBC:gmtime.obj - 0001:0001263c ___loctotime_t 0041363c f LIBC:dtoxtime.obj - 0001:000126fe __XcptFilter 004136fe f LIBC:winxfltr.obj - 0001:00012882 __setenvp 00413882 f LIBC:stdenvp.obj - 0001:0001293b __setargv 0041393b f LIBC:stdargv.obj - 0001:00012b88 ___crtGetEnvironmentStringsA 00413b88 f LIBC:a_env.obj - 0001:00012cba __heap_init 00413cba f LIBC:heapinit.obj - 0001:00012cf6 __heap_term 00413cf6 f LIBC:heapinit.obj - 0001:00012d6c __global_unwind2 00413d6c f LIBC:exsup.obj - 0001:00012dae __local_unwind2 00413dae f LIBC:exsup.obj - 0001:00012e06 __NLG_Return2 00413e06 f LIBC:exsup.obj - 0001:00012e16 __abnormal_termination 00413e16 f LIBC:exsup.obj - 0001:00012e39 __NLG_Notify1 00413e39 f LIBC:exsup.obj - 0001:00012e42 __NLG_Notify 00413e42 f LIBC:exsup.obj - 0001:00012e55 __NLG_Dispatch 00413e55 f LIBC:exsup.obj - 0001:00012e64 __except_handler3 00413e64 f LIBC:exsup3.obj - 0001:00012f21 __seh_longjmp_unwind@4 00413f21 f LIBC:exsup3.obj - 0001:00012f3c __FF_MSGBANNER 00413f3c f LIBC:crt0msg.obj - 0001:00012f75 __NMSG_WRITE 00413f75 f LIBC:crt0msg.obj - 0001:000130c8 __GET_RTERRMSG 004140c8 f LIBC:crt0msg.obj - 0001:000130f9 _malloc 004140f9 f LIBC:malloc.obj - 0001:0001310b __nh_malloc 0041410b f LIBC:malloc.obj - 0001:00013137 __heap_alloc 00414137 f LIBC:malloc.obj - 0001:00013170 _memset 00414170 f LIBC:memset.obj - 0001:000131c8 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 004141c8 f LIBC:handler.obj - 0001:000131d8 ?_query_new_handler@@YAP6AHI@ZXZ 004141d8 f LIBC:handler.obj - 0001:000131de __callnewh 004141de f LIBC:handler.obj - 0001:000131f9 __get_sbh_threshold 004141f9 f LIBC:sbheap.obj - 0001:000131ff __set_sbh_threshold 004141ff f LIBC:sbheap.obj - 0001:00013216 ___sbh_heap_init 00414216 f LIBC:sbheap.obj - 0001:00013254 ___sbh_find_block 00414254 f LIBC:sbheap.obj - 0001:0001327f ___sbh_free_block 0041427f f LIBC:sbheap.obj - 0001:000135aa ___sbh_alloc_block 004145aa f LIBC:sbheap.obj - 0001:000138b3 ___sbh_alloc_new_region 004148b3 f LIBC:sbheap.obj - 0001:00013964 ___sbh_alloc_new_group 00414964 f LIBC:sbheap.obj - 0001:00013a5f ___sbh_resize_block 00414a5f f LIBC:sbheap.obj - 0001:00013d55 ___sbh_heapmin 00414d55 f LIBC:sbheap.obj - 0001:00013e26 ___sbh_heap_check 00414e26 f LIBC:sbheap.obj - 0001:00014155 __alloc_osfhnd 00415155 f LIBC:osfinfo.obj - 0001:000141ea __set_osfhnd 004151ea f LIBC:osfinfo.obj - 0001:00014261 __free_osfhnd 00415261 f LIBC:osfinfo.obj - 0001:000142db __get_osfhandle 004152db f LIBC:osfinfo.obj - 0001:00014318 __open_osfhandle 00415318 f LIBC:osfinfo.obj - 0001:000143b5 __dosmaperr 004153b5 f LIBC:dosmap.obj - 0001:0001441c _wctomb 0041541c f LIBC:wctomb.obj - 0001:00014490 __aulldiv 00415490 f LIBC:ulldiv.obj - 0001:00014500 __aullrem 00415500 f LIBC:ullrem.obj - 0001:00014575 __mbsrchr 00415575 f LIBC:mbsrchr.obj - 0001:000145d5 __getpath 004155d5 f LIBC:getpath.obj - 0001:00014649 __mbschr 00415649 f LIBC:mbschr.obj - 0001:000146bc __dospawn 004156bc f LIBC:dospawn.obj - 0001:0001489b __cenvarg 0041589b f LIBC:cenvarg.obj - 0001:00014a9f __mbsnbicoll 00415a9f f LIBC:mbsnbico.obj - 0001:00014ade ___wtomb_environ 00415ade f LIBC:wtombenv.obj - 0001:00014b4c _mbtowc 00415b4c f LIBC:mbtowc.obj - 0001:00014c14 _isalpha 00415c14 f LIBC:_ctype.obj - 0001:00014c42 _isupper 00415c42 f LIBC:_ctype.obj - 0001:00014c6a _islower 00415c6a f LIBC:_ctype.obj - 0001:00014c92 _isdigit 00415c92 f LIBC:_ctype.obj - 0001:00014cba _isxdigit 00415cba f LIBC:_ctype.obj - 0001:00014ce7 _isspace 00415ce7 f LIBC:_ctype.obj - 0001:00014d0f _ispunct 00415d0f f LIBC:_ctype.obj - 0001:00014d37 _isalnum 00415d37 f LIBC:_ctype.obj - 0001:00014d65 _isprint 00415d65 f LIBC:_ctype.obj - 0001:00014d93 _isgraph 00415d93 f LIBC:_ctype.obj - 0001:00014dc1 _iscntrl 00415dc1 f LIBC:_ctype.obj - 0001:00014de9 ___isascii 00415de9 f LIBC:_ctype.obj - 0001:00014df6 ___toascii 00415df6 f LIBC:_ctype.obj - 0001:00014dfe ___iscsymf 00415dfe f LIBC:_ctype.obj - 0001:00014e3b ___iscsym 00415e3b f LIBC:_ctype.obj - 0001:00014e80 __allshl 00415e80 f LIBC:llshl.obj - 0001:00014e9f _ungetc 00415e9f f LIBC:ungetc.obj - 0001:00014f10 __chkstk 00415f10 f LIBC:chkstk.obj - 0001:00014f10 __alloca_probe 00415f10 f LIBC:chkstk.obj - 0001:00014f3f __open 00415f3f f LIBC:open.obj - 0001:00014f3f _open 00415f3f f LIBC:open.obj - 0001:00014f56 __sopen 00415f56 f LIBC:open.obj - 0001:00015210 _strncpy 00416210 f LIBC:strncpy.obj - 0001:00015310 _strcmp 00416310 f LIBC:strcmp.obj - 0001:00015394 __setmbcp 00416394 f LIBC:mbctype.obj - 0001:00015758 __getmbcp 00416758 f LIBC:mbctype.obj - 0001:00015768 ___initmbctable 00416768 f LIBC:mbctype.obj - 0001:00015784 ___crtMessageBoxA 00416784 f LIBC:crtmbox.obj - 0001:00015810 _memmove 00416810 f LIBC:memmove.obj - 0001:00015b45 __fptrap 00416b45 f LIBC:crt0fp.obj - 0001:00015b50 _strrchr 00416b50 f LIBC:strrchr.obj - 0001:00015b77 ___crtCompareStringA 00416b77 f LIBC:a_cmp.obj - 0001:00015e1f ___crtsetenv 00416e1f f LIBC:setenv.obj - 0001:00016065 __chsize 00417065 f LIBC:chsize.obj - 0001:000161ab ___crtLCMapStringA 004171ab f LIBC:a_map.obj - 0001:000163fa _realloc 004173fa f LIBC:realloc.obj - 0001:0001651a __strdup 0041751a f LIBC:strdup.obj - 0001:00016545 __setmode 00417545 f LIBC:setmode.obj - 0001:000165c0 _ExitProcess@4 004175c0 f kernel32:KERNEL32.dll - 0001:000165c6 _TerminateProcess@8 004175c6 f kernel32:KERNEL32.dll - 0001:000165cc _GetCurrentProcess@0 004175cc f kernel32:KERNEL32.dll - 0001:000165d2 _GetTimeZoneInformation@4 004175d2 f kernel32:KERNEL32.dll - 0001:000165d8 _GetSystemTime@4 004175d8 f kernel32:KERNEL32.dll - 0001:000165de _GetLocalTime@4 004175de f kernel32:KERNEL32.dll - 0001:000165e4 _GetCommandLineA@0 004175e4 f kernel32:KERNEL32.dll - 0001:000165ea _GetVersion@0 004175ea f kernel32:KERNEL32.dll - 0001:000165f0 _SetHandleCount@4 004175f0 f kernel32:KERNEL32.dll - 0001:000165f6 _GetStdHandle@4 004175f6 f kernel32:KERNEL32.dll - 0001:000165fc _GetFileType@4 004175fc f kernel32:KERNEL32.dll - 0001:00016602 _GetStartupInfoA@4 00417602 f kernel32:KERNEL32.dll - 0001:00016608 _HeapAlloc@12 00417608 f kernel32:KERNEL32.dll - 0001:0001660e _GetLastError@0 0041760e f kernel32:KERNEL32.dll - 0001:00016614 _FlushFileBuffers@4 00417614 f kernel32:KERNEL32.dll - 0001:0001661a _WriteFile@20 0041761a f kernel32:KERNEL32.dll - 0001:00016620 _GetFileAttributesA@4 00417620 f kernel32:KERNEL32.dll - 0001:00016626 _SetFilePointer@16 00417626 f kernel32:KERNEL32.dll - 0001:0001662c _MultiByteToWideChar@24 0041762c f kernel32:KERNEL32.dll - 0001:00016632 _GetStringTypeA@20 00417632 f kernel32:KERNEL32.dll - 0001:00016638 _GetStringTypeW@16 00417638 f kernel32:KERNEL32.dll - 0001:0001663e _HeapFree@12 0041763e f kernel32:KERNEL32.dll - 0001:00016644 _CloseHandle@4 00417644 f kernel32:KERNEL32.dll - 0001:0001664a _ReadFile@20 0041764a f kernel32:KERNEL32.dll - 0001:00016650 _WideCharToMultiByte@32 00417650 f kernel32:KERNEL32.dll - 0001:00016656 _UnhandledExceptionFilter@4 00417656 f kernel32:KERNEL32.dll - 0001:0001665c _GetModuleFileNameA@12 0041765c f kernel32:KERNEL32.dll - 0001:00016662 _FreeEnvironmentStringsA@4 00417662 f kernel32:KERNEL32.dll - 0001:00016668 _FreeEnvironmentStringsW@4 00417668 f kernel32:KERNEL32.dll - 0001:0001666e _GetEnvironmentStrings@0 0041766e f kernel32:KERNEL32.dll - 0001:00016674 _GetEnvironmentStringsW@0 00417674 f kernel32:KERNEL32.dll - 0001:0001667a _HeapDestroy@4 0041767a f kernel32:KERNEL32.dll - 0001:00016680 _HeapCreate@12 00417680 f kernel32:KERNEL32.dll - 0001:00016686 _VirtualFree@12 00417686 f kernel32:KERNEL32.dll - 0001:0001668c _RtlUnwind@16 0041768c f kernel32:KERNEL32.dll - 0001:00016692 _VirtualAlloc@16 00417692 f kernel32:KERNEL32.dll - 0001:00016698 _HeapReAlloc@16 00417698 f kernel32:KERNEL32.dll - 0001:0001669e _IsBadWritePtr@8 0041769e f kernel32:KERNEL32.dll - 0001:000166a4 _SetStdHandle@8 004176a4 f kernel32:KERNEL32.dll - 0001:000166aa _GetExitCodeProcess@8 004176aa f kernel32:KERNEL32.dll - 0001:000166b0 _WaitForSingleObject@8 004176b0 f kernel32:KERNEL32.dll - 0001:000166b6 _CreateProcessA@40 004176b6 f kernel32:KERNEL32.dll - 0001:000166bc _CreateFileA@28 004176bc f kernel32:KERNEL32.dll - 0001:000166c2 _GetCPInfo@8 004176c2 f kernel32:KERNEL32.dll - 0001:000166c8 _GetACP@0 004176c8 f kernel32:KERNEL32.dll - 0001:000166ce _GetOEMCP@0 004176ce f kernel32:KERNEL32.dll - 0001:000166d4 _GetProcAddress@8 004176d4 f kernel32:KERNEL32.dll - 0001:000166da _LoadLibraryA@4 004176da f kernel32:KERNEL32.dll - 0001:000166e0 _CompareStringA@24 004176e0 f kernel32:KERNEL32.dll - 0001:000166e6 _CompareStringW@24 004176e6 f kernel32:KERNEL32.dll - 0001:000166ec _SetEnvironmentVariableA@8 004176ec f kernel32:KERNEL32.dll - 0001:000166f2 _SetEndOfFile@4 004176f2 f kernel32:KERNEL32.dll - 0001:000166f8 _LCMapStringA@24 004176f8 f kernel32:KERNEL32.dll - 0001:000166fe _LCMapStringW@24 004176fe f kernel32:KERNEL32.dll - 0001:00016710 __stricmp 00417710 f LIBC:stricmp.obj - 0001:00016710 _stricmp 00417710 f LIBC:stricmp.obj - 0001:00016710 __strcmpi 00417710 f LIBC:stricmp.obj - 0001:0001679c _chdir 0041779c f LIBC:chdir.obj - 0001:0001679c __chdir 0041779c f LIBC:chdir.obj - 0001:00016830 _memicmp 00417830 f LIBC:memicmp.obj - 0001:00016830 __memicmp 00417830 f LIBC:memicmp.obj - 0001:000168cd __fileno 004178cd f LIBC:fileno.obj - 0001:000168cd _fileno 004178cd f LIBC:fileno.obj - 0001:000168d5 __tolower 004178d5 f LIBC:tolower.obj - 0001:000168dd _tolower 004178dd f LIBC:tolower.obj - 0001:000169a8 __mbctoupper 004179a8 f LIBC:mbtoupr.obj - 0001:00016a24 _GetCurrentDirectoryA@8 00417a24 f kernel32:KERNEL32.dll - 0001:00016a2a _SetCurrentDirectoryA@4 00417a2a f kernel32:KERNEL32.dll - 0002:0000001c ??_C@_07OOMJ@cmd?4exe?$AA@ 0041b01c LIBC:system.obj - 0002:00000024 ??_C@_0M@IPJP@command?4com?$AA@ 0041b024 LIBC:system.obj - 0002:00000030 ??_C@_02JMK@?1c?$AA@ 0041b030 LIBC:system.obj - 0002:00000034 ??_C@_07KFDO@COMSPEC?$AA@ 0041b034 LIBC:system.obj - 0002:0000004c ___lookuptable 0041b04c LIBC:output.obj - 0002:000000a8 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 0041b0a8 LIBC:output.obj - 0002:000000b8 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 0041b0b8 LIBC:output.obj - 0002:000000c0 ??_C@_01PCFE@?2?$AA@ 0041b0c0 LIBC:spawnvpe.obj - 0002:000000c4 ??_C@_04LNMG@PATH?$AA@ 0041b0c4 LIBC:spawnvpe.obj - 0002:000000cc ??_C@_04GGNP@?4com?$AA@ 0041b0cc LIBC:spawnve.obj - 0002:000000d4 ??_C@_04NFOM@?4exe?$AA@ 0041b0d4 LIBC:spawnve.obj - 0002:000000dc ??_C@_04KBDN@?4bat?$AA@ 0041b0dc LIBC:spawnve.obj - 0002:000000e4 ??_C@_04LFKF@?4cmd?$AA@ 0041b0e4 LIBC:spawnve.obj - 0002:000000ec ??_C@_02OFKN@?4?2?$AA@ 0041b0ec LIBC:spawnve.obj - 0002:000000f0 ??_C@_01A@?$AA?$AA@ 0041b0f0 LIBC:a_str.obj - 0002:000000f4 ??_C@_13A@?$AA?$AA?$AA?$AA@ 0041b0f4 LIBC:a_str.obj - 0002:00000104 ___dnames 0041b104 LIBC:timeset.obj - 0002:0000011c ___mnames 0041b11c LIBC:timeset.obj - 0002:00000144 ??_C@_02JHIA@TZ?$AA@ 0041b144 LIBC:tzset.obj - 0002:00000148 ??_C@_0P@GGKG@runtime?5error?5?$AA@ 0041b148 LIBC:crt0msg.obj - 0002:00000158 ??_C@_02PIMC@?$AN?6?$AA@ 0041b158 LIBC:crt0msg.obj - 0002:0000015c ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 0041b15c LIBC:crt0msg.obj - 0002:0000016c ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 0041b16c LIBC:crt0msg.obj - 0002:0000017c ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 0041b17c LIBC:crt0msg.obj - 0002:0000018c ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 0041b18c LIBC:crt0msg.obj - 0002:000001b4 ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 0041b1b4 LIBC:crt0msg.obj - 0002:000001ec ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 0041b1ec LIBC:crt0msg.obj - 0002:00000224 ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 0041b224 LIBC:crt0msg.obj - 0002:0000024c ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 0041b24c LIBC:crt0msg.obj - 0002:00000284 ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 0041b284 LIBC:crt0msg.obj - 0002:000002b0 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 0041b2b0 LIBC:crt0msg.obj - 0002:000002d4 ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 0041b2d4 LIBC:crt0msg.obj - 0002:00000304 ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 0041b304 LIBC:crt0msg.obj - 0002:00000330 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 0041b330 LIBC:crt0msg.obj - 0002:00000354 ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 0041b354 LIBC:crt0msg.obj - 0002:00000380 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 0041b380 LIBC:crt0msg.obj - 0002:000003ac ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 0041b3ac LIBC:crt0msg.obj - 0002:000003d4 ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 0041b3d4 LIBC:crt0msg.obj - 0002:000003fc ??_C@_02JJJH@?6?6?$AA@ 0041b3fc LIBC:crt0msg.obj - 0002:00000400 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 0041b400 LIBC:crt0msg.obj - 0002:0000041c ??_C@_03NAME@?4?4?4?$AA@ 0041b41c LIBC:crt0msg.obj - 0002:00000420 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 0041b420 LIBC:crt0msg.obj - 0002:00000438 ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 0041b438 LIBC:crtmbox.obj - 0002:0000044c ??_C@_0BA@GILI@GetActiveWindow?$AA@ 0041b44c LIBC:crtmbox.obj - 0002:0000045c ??_C@_0M@PKCK@MessageBoxA?$AA@ 0041b45c LIBC:crtmbox.obj - 0002:00000468 ??_C@_0L@HKL@user32?4dll?$AA@ 0041b468 LIBC:crtmbox.obj - 0003:00000000 ___xc_a 0041c000 LIBC:crt0init.obj - 0003:00000104 ___xc_z 0041c104 LIBC:crt0init.obj - 0003:00000208 ___xi_a 0041c208 LIBC:crt0init.obj - 0003:00000418 ___xi_z 0041c418 LIBC:crt0init.obj - 0003:0000051c ___xp_a 0041c51c LIBC:crt0init.obj - 0003:00000724 ___xp_z 0041c724 LIBC:crt0init.obj - 0003:00000828 ___xt_a 0041c828 LIBC:crt0init.obj - 0003:0000092c ___xt_z 0041c92c LIBC:crt0init.obj - 0003:00000a30 _in 0041ca30 ucp.obj - 0003:00000a34 _rdev 0041ca34 ucp.obj - 0003:00000a38 _syserror 0041ca38 ucp.obj - 0003:00000a3c _help 0041ca3c ucp.obj - 0003:000016c4 _cmdblk 0041d6c4 devhd.obj - 0003:000016cc _busid 0041d6cc devhd.obj - 0003:00001708 _dev_tab 0041d708 devio.obj - 0003:00001898 _tty_default 0041d898 devtty.obj - 0003:000018a8 _tty_vector 0041d8a8 devtty.obj - 0003:000018d0 _ttyinq 0041d8d0 devtty.obj - 0003:00001a00 _baddevmsg 0041da00 filesys.obj - 0003:00001d4c _UZIX 0041dd4c main.obj - 0003:00001d5c _HOST 0041dd5c main.obj - 0003:00001ec8 _stringerr 0041dec8 xfs.obj - 0003:00002450 __iob 0041e450 LIBC:_file.obj - 0003:000026d0 __pctype 0041e6d0 LIBC:ctype.obj - 0003:000026d4 __pwctype 0041e6d4 LIBC:ctype.obj - 0003:000026d8 __ctype 0041e6d8 LIBC:ctype.obj - 0003:000028dc ___mb_cur_max 0041e8dc LIBC:nlsdata1.obj - 0003:000028e0 ___decimal_point 0041e8e0 LIBC:nlsdata1.obj - 0003:000028e4 ___decimal_point_length 0041e8e4 LIBC:nlsdata1.obj - 0003:000028f0 __aexit_rtn 0041e8f0 LIBC:crt0.obj - 0003:000028f4 ___app_type 0041e8f4 LIBC:crt0.obj - 0003:000028f8 ___badioinfo 0041e8f8 LIBC:ioinit.obj - 0003:00002900 ___nullstring 0041e900 LIBC:output.obj - 0003:00002904 ___wnullstring 0041e904 LIBC:output.obj - 0003:00002930 __timezone 0041e930 LIBC:timeset.obj - 0003:00002934 __daylight 0041e934 LIBC:timeset.obj - 0003:00002938 __dstbias 0041e938 LIBC:timeset.obj - 0003:000029bc __tzname 0041e9bc LIBC:timeset.obj - 0003:000029e8 __XcptActTab 0041e9e8 LIBC:winxfltr.obj - 0003:00002a60 __First_FPE_Indx 0041ea60 LIBC:winxfltr.obj - 0003:00002a64 __Num_FPE 0041ea64 LIBC:winxfltr.obj - 0003:00002a68 __XcptActTabCount 0041ea68 LIBC:winxfltr.obj - 0003:00002a6c __fpecode 0041ea6c LIBC:winxfltr.obj - 0003:00002a70 __amblksiz 0041ea70 LIBC:heapinit.obj - 0003:00002a74 __NLG_Destination 0041ea74 LIBC:exsup.obj - 0003:00002b20 ___sbh_threshold 0041eb20 LIBC:sbheap.obj - 0003:00002c90 __cfltcvt_tab 0041ec90 LIBC:cmiscdat.obj - 0003:00002cb0 __p_overlay 0041ecb0 LIBC:dospawn.obj - 0003:00002cc0 __lpdays 0041ecc0 LIBC:days.obj - 0003:00002cf4 __days 0041ecf4 LIBC:days.obj - 0003:00003120 _f_pause 0041f120 ucp.obj - 0003:00003121 _unix_locked_out 0041f121 - 0003:00003122 _swapblk 0041f122 - 0003:00003124 _hd_offset 0041f124 devhd.obj - 0003:00003128 _hd_sector 0041f128 devhd.obj - 0003:0000312c _dptr 0041f12c devhd.obj - 0003:00003130 _dlen 0041f130 devhd.obj - 0003:00003134 _cptr 0041f134 devhd.obj - 0003:00003139 _dirty_mask 0041f139 - 0003:0000313a _inint 0041f13a - 0003:0000313c _initproc 0041f13c - 0003:00003140 _bufclock 0041f140 devio.obj - 0003:00003148 _swapcnt 0041f148 - 0003:0000314d _traceon 0041f14d - 0003:0000314e _sec 0041f14e - 0003:00003159 _total 0041f159 - 0003:0000315a _waitno 0041f15a - 0003:00003164 _tod 0041f164 - 0003:00003174 _runticks 0041f174 - 0003:00003176 _root_dev 0041f176 - 0003:00003188 __cflush 0041f188 LIBC:_file.obj - 0003:0000318c _errno 0041f18c LIBC:crt0dat.obj - 0003:00003190 __doserrno 0041f190 LIBC:crt0dat.obj - 0003:00003194 __umaskval 0041f194 LIBC:crt0dat.obj - 0003:00003198 __osver 0041f198 LIBC:crt0dat.obj - 0003:0000319c __winver 0041f19c LIBC:crt0dat.obj - 0003:000031a0 __winmajor 0041f1a0 LIBC:crt0dat.obj - 0003:000031a4 __winminor 0041f1a4 LIBC:crt0dat.obj - 0003:000031a8 ___argc 0041f1a8 LIBC:crt0dat.obj - 0003:000031ac ___argv 0041f1ac LIBC:crt0dat.obj - 0003:000031b0 ___wargv 0041f1b0 LIBC:crt0dat.obj - 0003:000031b4 __environ 0041f1b4 LIBC:crt0dat.obj - 0003:000031b8 ___initenv 0041f1b8 LIBC:crt0dat.obj - 0003:000031bc __wenviron 0041f1bc LIBC:crt0dat.obj - 0003:000031c0 ___winitenv 0041f1c0 LIBC:crt0dat.obj - 0003:000031c4 __pgmptr 0041f1c4 LIBC:crt0dat.obj - 0003:000031c8 __wpgmptr 0041f1c8 LIBC:crt0dat.obj - 0003:000031cc __exitflag 0041f1cc LIBC:crt0dat.obj - 0003:000031d0 __C_Termination_Done 0041f1d0 LIBC:crt0dat.obj - 0003:000031d4 __C_Exit_Done 0041f1d4 LIBC:crt0dat.obj - 0003:000031f0 __aenvptr 0041f1f0 LIBC:crt0.obj - 0003:000031f4 __wenvptr 0041f1f4 LIBC:crt0.obj - 0003:000031f8 ___error_mode 0041f1f8 LIBC:crt0.obj - 0003:000031fc __stdbuf 0041f1fc LIBC:_sftbuf.obj - 0003:000032c4 _swapbase 0041f2c4 - 0003:000032ec __pxcptinfoptrs 0041f2ec LIBC:winxfltr.obj - 0003:000033f8 __adbgmsg 0041f3f8 LIBC:crt0msg.obj - 0003:000033fc ?_pnhHeap@@3P6AHI@ZA 0041f3fc LIBC:handler.obj - 0003:00003400 __newmode 0041f400 LIBC:_newmode.obj - 0003:00003404 ___lc_handle 0041f404 LIBC:nlsdata2.obj - 0003:0000341c ___lc_codepage 0041f41c LIBC:nlsdata2.obj - 0003:00003420 ___lc_collate_cp 0041f420 LIBC:nlsdata2.obj - 0003:00003424 __commode 0041f424 LIBC:ncommode.obj - 0003:0000343c __fmode 0041f43c LIBC:txtmode.obj - 0003:00003444 _ticks 0041f444 - 0003:00003448 _root_ino 0041f448 - 0003:0000344c _ncalls 0041f44c - 0003:00003450 _ibuf 0041f450 - 0003:0000345c _osBank 0041f45c - 0003:00003460 _bufpool 0041f460 - 0003:00005d50 _disp_tab 00421d50 - 0003:00005d54 _buf_flsh 00421d54 - 0003:00005d58 _buf_hits 00421d58 - 0003:00005d5c _buf_miss 00421d5c - 0003:00005d60 _fs_tab 00421d60 - 0003:00005de0 _of_tab 00421de0 - 0003:00005f60 _i_tab 00421f60 - 0003:00006b40 _ub 00422b40 - 0003:00007b40 _ptab 00423b40 - 0003:00007c80 _kbuf 00423c80 - 0003:00007cc0 _recv_bufs 00423cc0 - 0003:000089c0 _stopflag 004249c0 - 0003:00008a00 _flshflag 00424a00 - 0003:00008a40 _tty_data 00424a40 - 0003:00008ae0 _cwd 00424ae0 - 0003:00008b80 _line 00424b80 - 0003:00009024 ___mbcodepage 00425024 - 0003:000090a0 ___mbulinfo 004250a0 - 0003:000090ac ___ismbcodepage 004250ac - 0003:000090c0 __mbcasemap 004250c0 - 0003:000091c0 __mbctype 004251c0 - 0003:000092c4 ___mblcid 004252c4 - 0003:000092c8 ___sbh_sizeHeaderList 004252c8 - 0003:000092d8 ___sbh_indGroupDefer 004252d8 - 0003:000092dc ___sbh_pHeaderScan 004252dc - 0003:000092e0 ___sbh_pHeaderDefer 004252e0 - 0003:000092e4 ___sbh_cntHeaderList 004252e4 - 0003:000092e8 ___sbh_pHeaderList 004252e8 - 0003:000092ec __crtheap 004252ec - 0003:00009300 ___pioinfo 00425300 - 0003:0000943c __nhandle 0042543c - 0003:00009440 __acmdln 00425440 - 0003:0000944c ___env_initialized 0042544c - 0003:0000945c ___mbctype_initialized 0042545c - 0003:00009460 ___onexitend 00425460 - 0003:00009464 ___onexitbegin 00425464 - 0003:00009468 __FPinit 00425468 - 0003:0000946c ___piob 0042546c - 0003:000097c0 __bufin 004257c0 - 0003:0000a7c0 __nstream 004267c0 - 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 00427000 kernel32:KERNEL32.dll - 0004:00000014 __NULL_IMPORT_DESCRIPTOR 00427014 kernel32:KERNEL32.dll - 0004:00000160 __imp__FreeEnvironmentStringsW@4 00427160 kernel32:KERNEL32.dll - 0004:00000164 __imp__TerminateProcess@8 00427164 kernel32:KERNEL32.dll - 0004:00000168 __imp__GetCurrentProcess@0 00427168 kernel32:KERNEL32.dll - 0004:0000016c __imp__GetTimeZoneInformation@4 0042716c kernel32:KERNEL32.dll - 0004:00000170 __imp__GetSystemTime@4 00427170 kernel32:KERNEL32.dll - 0004:00000174 __imp__GetLocalTime@4 00427174 kernel32:KERNEL32.dll - 0004:00000178 __imp__GetCommandLineA@0 00427178 kernel32:KERNEL32.dll - 0004:0000017c __imp__GetVersion@0 0042717c kernel32:KERNEL32.dll - 0004:00000180 __imp__SetHandleCount@4 00427180 kernel32:KERNEL32.dll - 0004:00000184 __imp__GetStdHandle@4 00427184 kernel32:KERNEL32.dll - 0004:00000188 __imp__GetFileType@4 00427188 kernel32:KERNEL32.dll - 0004:0000018c __imp__GetStartupInfoA@4 0042718c kernel32:KERNEL32.dll - 0004:00000190 __imp__HeapAlloc@12 00427190 kernel32:KERNEL32.dll - 0004:00000194 __imp__GetLastError@0 00427194 kernel32:KERNEL32.dll - 0004:00000198 __imp__FlushFileBuffers@4 00427198 kernel32:KERNEL32.dll - 0004:0000019c __imp__WriteFile@20 0042719c kernel32:KERNEL32.dll - 0004:000001a0 __imp__GetFileAttributesA@4 004271a0 kernel32:KERNEL32.dll - 0004:000001a4 __imp__SetFilePointer@16 004271a4 kernel32:KERNEL32.dll - 0004:000001a8 __imp__MultiByteToWideChar@24 004271a8 kernel32:KERNEL32.dll - 0004:000001ac __imp__GetStringTypeA@20 004271ac kernel32:KERNEL32.dll - 0004:000001b0 __imp__GetStringTypeW@16 004271b0 kernel32:KERNEL32.dll - 0004:000001b4 __imp__HeapFree@12 004271b4 kernel32:KERNEL32.dll - 0004:000001b8 __imp__CloseHandle@4 004271b8 kernel32:KERNEL32.dll - 0004:000001bc __imp__ReadFile@20 004271bc kernel32:KERNEL32.dll - 0004:000001c0 __imp__WideCharToMultiByte@32 004271c0 kernel32:KERNEL32.dll - 0004:000001c4 __imp__UnhandledExceptionFilter@4 004271c4 kernel32:KERNEL32.dll - 0004:000001c8 __imp__GetModuleFileNameA@12 004271c8 kernel32:KERNEL32.dll - 0004:000001cc __imp__FreeEnvironmentStringsA@4 004271cc kernel32:KERNEL32.dll - 0004:000001d0 __imp__ExitProcess@4 004271d0 kernel32:KERNEL32.dll - 0004:000001d4 __imp__GetEnvironmentStrings@0 004271d4 kernel32:KERNEL32.dll - 0004:000001d8 __imp__GetEnvironmentStringsW@0 004271d8 kernel32:KERNEL32.dll - 0004:000001dc __imp__HeapDestroy@4 004271dc kernel32:KERNEL32.dll - 0004:000001e0 __imp__HeapCreate@12 004271e0 kernel32:KERNEL32.dll - 0004:000001e4 __imp__VirtualFree@12 004271e4 kernel32:KERNEL32.dll - 0004:000001e8 __imp__RtlUnwind@16 004271e8 kernel32:KERNEL32.dll - 0004:000001ec __imp__VirtualAlloc@16 004271ec kernel32:KERNEL32.dll - 0004:000001f0 __imp__HeapReAlloc@16 004271f0 kernel32:KERNEL32.dll - 0004:000001f4 __imp__IsBadWritePtr@8 004271f4 kernel32:KERNEL32.dll - 0004:000001f8 __imp__SetStdHandle@8 004271f8 kernel32:KERNEL32.dll - 0004:000001fc __imp__GetExitCodeProcess@8 004271fc kernel32:KERNEL32.dll - 0004:00000200 __imp__WaitForSingleObject@8 00427200 kernel32:KERNEL32.dll - 0004:00000204 __imp__CreateProcessA@40 00427204 kernel32:KERNEL32.dll - 0004:00000208 __imp__CreateFileA@28 00427208 kernel32:KERNEL32.dll - 0004:0000020c __imp__GetCPInfo@8 0042720c kernel32:KERNEL32.dll - 0004:00000210 __imp__GetACP@0 00427210 kernel32:KERNEL32.dll - 0004:00000214 __imp__GetOEMCP@0 00427214 kernel32:KERNEL32.dll - 0004:00000218 __imp__GetProcAddress@8 00427218 kernel32:KERNEL32.dll - 0004:0000021c __imp__LoadLibraryA@4 0042721c kernel32:KERNEL32.dll - 0004:00000220 __imp__CompareStringA@24 00427220 kernel32:KERNEL32.dll - 0004:00000224 __imp__CompareStringW@24 00427224 kernel32:KERNEL32.dll - 0004:00000228 __imp__SetEnvironmentVariableA@8 00427228 kernel32:KERNEL32.dll - 0004:0000022c __imp__SetEndOfFile@4 0042722c kernel32:KERNEL32.dll - 0004:00000230 __imp__LCMapStringA@24 00427230 kernel32:KERNEL32.dll - 0004:00000234 __imp__LCMapStringW@24 00427234 kernel32:KERNEL32.dll - 0004:00000238 __imp__GetCurrentDirectoryA@8 00427238 kernel32:KERNEL32.dll - 0004:0000023c __imp__SetCurrentDirectoryA@4 0042723c kernel32:KERNEL32.dll - 0004:00000240 \177KERNEL32_NULL_THUNK_DATA 00427240 kernel32:KERNEL32.dll + 0001:000008c0 _pse 004018c0 f ucp.obj + 0001:00000906 _dohelp 00401906 f ucp.obj + 0001:0000094d _eq 0040194d f ucp.obj + 0001:00000967 _execute 00401967 f ucp.obj + 0001:00000f45 _usage 00401f45 f ucp.obj + 0001:00000f63 _main 00401f63 f ucp.obj + 0001:00001aa0 _ldir 00402aa0 f ucpsub.obj + 0001:00001ae1 _devdir 00402ae1 f ucpsub.obj + 0001:00001b5c _prot 00402b5c f ucpsub.obj + 0001:00001b6e _dols 00402b6e f ucpsub.obj + 0001:0000212e _xls 0040312e f ucpsub.obj + 0001:00002224 _xchmod 00403224 f ucpsub.obj + 0001:000022a4 _xchown 004032a4 f ucpsub.obj + 0001:00002344 _xchgrp 00403344 f ucpsub.obj + 0001:000023e4 _xumask 004033e4 f ucpsub.obj + 0001:00002465 _xmknod 00403465 f ucpsub.obj + 0001:00002599 _xmkdir 00403599 f ucpsub.obj + 0001:000025e0 _xget 004035e0 f ucpsub.obj + 0001:0000278b _xput 0040378b f ucpsub.obj + 0001:00002922 _xtype 00403922 f ucpsub.obj + 0001:000029c0 _xdump 004039c0 f ucpsub.obj + 0001:00002c7e _xunlink 00403c7e f ucpsub.obj + 0001:00002d64 _xrmdir 00403d64 f ucpsub.obj + 0001:00002f68 _xdf 00403f68 f ucpsub.obj + 0001:00003027 _xalign 00404027 f ucpsub.obj + 0001:0000311c _xualign 0040411c f ucpsub.obj + 0001:000037b0 _wd_read 004047b0 f devhd.obj + 0001:000037e7 _wd_write 004047e7 f devhd.obj + 0001:0000381e _setup 0040481e f devhd.obj + 0001:0000397b _chkstat 0040497b f devhd.obj + 0001:000039c1 _wd_open 004049c1 f devhd.obj + 0001:00003a50 _bread 00404a50 f devio.obj + 0001:00003b87 _bfree 00404b87 f devio.obj + 0001:00003c3e _zerobuf 00404c3e f devio.obj + 0001:00003cc5 _bufsync 00404cc5 f devio.obj + 0001:00003d39 _bfind 00404d39 f devio.obj + 0001:00003d91 _freebuf 00404d91 f devio.obj + 0001:00003ed3 _bufdump 00404ed3 f devio.obj + 0001:00003fba _validdev 00404fba f devio.obj + 0001:00004045 _bdreadwrite 00405045 f devio.obj + 0001:000040c3 _cdreadwrite 004050c3 f devio.obj + 0001:00004129 _d_openclose 00405129 f devio.obj + 0001:00004189 _d_ioctl 00405189 f devio.obj + 0001:000041df _d_init 004051df f devio.obj + 0001:0000423e _ok 0040523e f devio.obj + 0001:00004245 _ok_rdwr 00405245 f devio.obj + 0001:0000424c _nogood 0040524c f devio.obj + 0001:00004254 _nogood_ioctl 00405254 f devio.obj + 0001:0000425c _insq 0040525c f devio.obj + 0001:000042ce _remq 004052ce f devio.obj + 0001:0000433c _uninsq 0040533c f devio.obj + 0001:000043af _clrq 004053af f devio.obj + 0001:00004640 _mem_read 00405640 f devmisc.obj + 0001:000046a1 _mem_write 004056a1 f devmisc.obj + 0001:00004704 _null_write 00405704 f devmisc.obj + 0001:0000470e _lpr_open 0040570e f devmisc.obj + 0001:0000471c _lpr_close 0040571c f devmisc.obj + 0001:00004735 _lpr_write 00405735 f devmisc.obj + 0001:0000479b _mt_read 0040579b f devmisc.obj + 0001:000047a3 _mt_write 004057a3 f devmisc.obj + 0001:000047ab _mt_open 004057ab f devmisc.obj + 0001:000047b3 _mt_close 004057b3 f devmisc.obj + 0001:00004820 _tty_read 00405820 f devtty.obj + 0001:000049d3 _tty_write 004059d3 f devtty.obj + 0001:00004b50 _tty_open 00405b50 f devtty.obj + 0001:00004be7 _tty_close 00405be7 f devtty.obj + 0001:00004c4b _tty_ioctl 00405c4b f devtty.obj + 0001:00004de9 _tty_inproc 00405de9 f devtty.obj + 0001:00005191 _tty_inproc_dummy 00406191 f devtty.obj + 0001:00005196 _echo 00406196 f devtty.obj + 0001:00005430 _findfs 00406430 f filesys.obj + 0001:0000547c _getfs 0040647c f filesys.obj + 0001:000054d1 _wr_inode 004064d1 f filesys.obj + 0001:000055a4 _i_ref 004065a4 f filesys.obj + 0001:00005602 _i_deref 00406602 f filesys.obj + 0001:000056d9 _i_free 004066d9 f filesys.obj + 0001:00005772 __namei 00406772 f filesys.obj + 0001:00005949 _namei 00406949 f filesys.obj + 0001:00005ca7 _srch_dir 00406ca7 f filesys.obj + 0001:00005dd7 _srch_mt 00406dd7 f filesys.obj + 0001:00005e37 _i_open 00406e37 f filesys.obj + 0001:000060fe _ch_link 004070fe f filesys.obj + 0001:000062a7 _filename 004072a7 f filesys.obj + 0001:0000634e _namecomp 0040734e f filesys.obj + 0001:000063d4 _newfile 004073d4 f filesys.obj + 0001:000064b0 _doclose 004074b0 f filesys.obj + 0001:00006551 _i_alloc 00407551 f filesys.obj + 0001:00006656 _blk_alloc 00407656 f filesys.obj + 0001:00006790 _blk_free 00407790 f filesys.obj + 0001:0000683e _oft_alloc 0040783e f filesys.obj + 0001:000068ae _oft_deref 004078ae f filesys.obj + 0001:00006906 _uf_alloc 00407906 f filesys.obj + 0001:0000695e _isdevice 0040795e f filesys.obj + 0001:000069a5 _freeblk 004079a5 f filesys.obj + 0001:00006a46 _f_trunc 00407a46 f filesys.obj + 0001:00006aff _bmap 00407aff f filesys.obj + 0001:00006d5f _validblk 00407d5f f filesys.obj + 0001:00006dde _getinode 00407dde f filesys.obj + 0001:00006eba _getperm 00407eba f filesys.obj + 0001:00006f5a _setftim 00407f5a f filesys.obj + 0001:00006fc4 _fmount 00407fc4 f filesys.obj + 0001:0000717c _magic 0040817c f filesys.obj + 0001:000071a6 _i_sync 004081a6 f filesys.obj + 0001:0000721b _fs_sync 0040821b f filesys.obj + 0001:00007a50 _scsiop 00408a50 f hdasm.obj + 0001:00007b70 _fs_init 00408b70 f machdep.obj + 0001:00007b91 _valadr 00408b91 f machdep.obj + 0001:00007b9b _addtick 00408b9b f machdep.obj + 0001:00007bf9 _incrtick 00408bf9 f machdep.obj + 0001:00007c38 _calltrap 00408c38 f machdep.obj + 0001:00007cbe _sttime 00408cbe f machdep.obj + 0001:00007cd6 _panic 00408cd6 f machdep.obj + 0001:00007d24 _warning 00408d24 f machdep.obj + 0001:00007d58 _idump 00408d58 f machdep.obj + 0001:00007ff0 _abort 00408ff0 f main.obj + 0001:0000800e _rdtime 0040900e f main.obj + 0001:000080b0 _init2 004090b0 f process.obj + 0001:000082d1 _psleep 004092d1 f process.obj + 0001:0000834d _wakeup 0040934d f process.obj + 0001:00008398 _getproc 00409398 f process.obj + 0001:000083f1 _newproc 004093f1 f process.obj + 0001:00008537 _ptab_alloc 00409537 f process.obj + 0001:000085ec _clkint2 004095ec f process.obj + 0001:00008730 _unix2 00409730 f process.obj + 0001:000087b8 _chksigs 004097b8 f process.obj + 0001:00008862 _sgrpsig 00409862 f process.obj + 0001:000088ae _ssig 004098ae f process.obj + 0001:00008925 _sendsig 00409925 f process.obj + 0001:00008979 _dowait 00409979 f process.obj + 0001:00008cf0 _sys_NONE 00409cf0 f scall1.obj + 0001:00008d02 _sys_sync 00409d02 f scall1.obj + 0001:00008d13 _sys_utime 00409d13 f scall1.obj + 0001:00008e34 _sys_close 00409e34 f scall1.obj + 0001:00008e47 _truncateto0 00409e47 f scall1.obj + 0001:00008ec0 _sys_open 00409ec0 f scall1.obj + 0001:000091f9 _sys_link 0040a1f9 f scall1.obj + 0001:00009344 _sys_symlink 0040a344 f scall1.obj + 0001:00009432 _sys_unlink 0040a432 f scall1.obj + 0001:0000954c _sys_readwrite 0040a54c f scall1.obj + 0001:000095e2 _sys_lseek 0040a5e2 f scall1.obj + 0001:000096c0 _sys_chdir 0040a6c0 f scall1.obj + 0001:0000974f _sys_chroot 0040a74f f scall1.obj + 0001:0000978d _sys_mknod 0040a78d f scall1.obj + 0001:00009868 _sys_access 0040a868 f scall1.obj + 0001:0000994f _sys_chmod 0040a94f f scall1.obj + 0001:00009a33 _sys_chown 0040aa33 f scall1.obj + 0001:00009a5a _stcpy 0040aa5a f scall1.obj + 0001:00009af7 _sys_statfstat 0040aaf7 f scall1.obj + 0001:00009b8a _sys_falign 0040ab8a f scall1.obj + 0001:00009bf4 _sys_dup 0040abf4 f scall1.obj + 0001:00009c7f _sys_dup2 0040ac7f f scall1.obj + 0001:00009d2b _sys_getfsys 0040ad2b f scall1.obj + 0001:00009d86 _sys_ioctl 0040ad86 f scall1.obj + 0001:00009e19 _sys_mountumount 0040ae19 f scall1.obj + 0001:0000a07c _sys_time 0040b07c f scall1.obj + 0001:0000a0b4 _exit0 0040b0b4 f scall1.obj + 0001:0000a0c5 _n_creat 0040b0c5 f scall1.obj + 0001:0000a281 _readwritei 0040b281 f scall1.obj + 0001:0000a7ab _rwsetup 0040b7ab f scall1.obj + 0001:0000a858 _getfsys 0040b858 f scall1.obj + 0001:0000b160 _findprocess 0040c160 f scall2.obj + 0001:0000b1c5 _filldesc 0040c1c5 f scall2.obj + 0001:0000b1fb _sys_pipe 0040c1fb f scall2.obj + 0001:0000b392 _sys_stime 0040c392 f scall2.obj + 0001:0000b3e1 _sys_times 0040c3e1 f scall2.obj + 0001:0000b430 _sys_brk 0040c430 f scall2.obj + 0001:0000b46c _sys_sbrk 0040c46c f scall2.obj + 0001:0000b4b2 _sys_waitpid 0040c4b2 f scall2.obj + 0001:0000b52d _sys__exit 0040c52d f scall2.obj + 0001:0000b545 _doexit 0040c545 f scall2.obj + 0001:0000b67e _sys_fork 0040c67e f scall2.obj + 0001:0000b683 _sys_pause 0040c683 f scall2.obj + 0001:0000b69f _sys_signal 0040c69f f scall2.obj + 0001:0000b758 _sys_kill 0040c758 f scall2.obj + 0001:0000b7bc _sys_alarm 0040c7bc f scall2.obj + 0001:0000b7e0 _sys_reboot 0040c7e0 f scall2.obj + 0001:0000b833 _sys_getset 0040c833 f scall2.obj + 0001:0000bcb0 _bitmap_align 0040ccb0 f xip.obj + 0001:0000c368 _bitmap_ualign 0040d368 f xip.obj + 0001:0000c490 _bitmap_examine 0040d490 f xip.obj + 0001:0000c6b5 _bitmap_align_chase 0040d6b5 f xip.obj + 0001:0000c7ca _bitmap_align_bmap 0040d7ca f xip.obj + 0001:0000ca50 _bitmap_align_reverse 0040da50 f xip.obj + 0001:0000cb3b _bitmap_align_recurse 0040db3b f xip.obj + 0001:0000cf5e _bitmap_search 0040df5e f xip.obj + 0001:0000d0f0 _bitmap_reserve 0040e0f0 f xip.obj + 0001:0000d2dd _bitmap_find 0040e2dd f xip.obj + 0001:0000d51c _bitmap_get 0040e51c f xip.obj + 0001:0000d5ed _bitmap_set 0040e5ed f xip.obj + 0001:0000dda0 _bzero 0040eda0 f utils.obj + 0001:0000ddc6 _bfill 0040edc6 f utils.obj + 0001:0000ddee _bcopy 0040edee f utils.obj + 0001:0000de21 _int_min 0040ee21 f utils.obj + 0001:0000de42 _int_max 0040ee42 f utils.obj + 0001:0000dea0 _xfs_init 0040eea0 f xfs.obj + 0001:0000e00e _xfs_end 0040f00e f xfs.obj + 0001:0000e055 _UZIXopen 0040f055 f xfs.obj + 0001:0000e07a _UZIXclose 0040f07a f xfs.obj + 0001:0000e08c _UZIXcreat 0040f08c f xfs.obj + 0001:0000e0b1 _UZIXlink 0040f0b1 f xfs.obj + 0001:0000e0cc _UZIXsymlink 0040f0cc f xfs.obj + 0001:0000e0e7 _UZIXunlink 0040f0e7 f xfs.obj + 0001:0000e0f9 _UZIXread 0040f0f9 f xfs.obj + 0001:0000e124 _UZIXwrite 0040f124 f xfs.obj + 0001:0000e14f _UZIXlseek 0040f14f f xfs.obj + 0001:0000e17e _UZIXchdir 0040f17e f xfs.obj + 0001:0000e190 _UZIXmknod 0040f190 f xfs.obj + 0001:0000e1b4 _UZIXsync 0040f1b4 f xfs.obj + 0001:0000e1be _UZIXaccess 0040f1be f xfs.obj + 0001:0000e1d9 _UZIXchmod 0040f1d9 f xfs.obj + 0001:0000e1f4 _UZIXchown 0040f1f4 f xfs.obj + 0001:0000e218 _UZIXstat 0040f218 f xfs.obj + 0001:0000e23a _UZIXfstat 0040f23a f xfs.obj + 0001:0000e25c _UZIXfalign 0040f25c f xfs.obj + 0001:0000e277 _UZIXdup 0040f277 f xfs.obj + 0001:0000e289 _UZIXdup2 0040f289 f xfs.obj + 0001:0000e2a4 _UZIXumask 0040f2a4 f xfs.obj + 0001:0000e2c0 _UZIXgetfsys 0040f2c0 f xfs.obj + 0001:0000e2e0 _UZIXioctl 0040f2e0 f xfs.obj + 0001:0000e304 _UZIXmount 0040f304 f xfs.obj + 0001:0000e32f _UZIXumount 0040f32f f xfs.obj + 0001:0000e348 _UZIXtime 0040f348 f xfs.obj + 0001:0000e488 ___initstdio 0040f488 f LIBC:_file.obj + 0001:0000e52d ___endstdio 0040f52d f LIBC:_file.obj + 0001:0000e541 _fgets 0040f541 f LIBC:fgets.obj + 0001:0000e598 _fflush 0040f598 f LIBC:fflush.obj + 0001:0000e5d3 __flush 0040f5d3 f LIBC:fflush.obj + 0001:0000e62f __flushall 0040f62f f LIBC:fflush.obj + 0001:0000e6a5 _fprintf 0040f6a5 f LIBC:fprintf.obj + 0001:0000e6d7 _printf 0040f6d7 f LIBC:printf.obj + 0001:0000e710 _strcpy 0040f710 f LIBC:strcat.obj + 0001:0000e720 _strcat 0040f720 f LIBC:strcat.obj + 0001:0000e800 __cinit 0040f800 f LIBC:crt0dat.obj + 0001:0000e82d _exit 0040f82d f LIBC:crt0dat.obj + 0001:0000e83e __exit 0040f83e f LIBC:crt0dat.obj + 0001:0000e84f __cexit 0040f84f f LIBC:crt0dat.obj + 0001:0000e85e __c_exit 0040f85e f LIBC:crt0dat.obj + 0001:0000e920 _system 0040f920 f LIBC:system.obj + 0001:0000e9d0 _strchr 0040f9d0 f LIBC:strchr.obj + 0001:0000e9d6 ___from_strstr_to_strchr 0040f9d6 f LIBC:strchr.obj + 0001:0000ea8c _sscanf 0040fa8c f LIBC:sscanf.obj + 0001:0000eac0 _fputs 0040fac0 f LIBC:fputs.obj + 0001:0000eb03 __flsbuf 0040fb03 f LIBC:_flsbuf.obj + 0001:0000ec20 _strlen 0040fc20 f LIBC:strlen.obj + 0001:0000ec9b __isctype 0040fc9b f LIBC:isctype.obj + 0001:0000ed10 __fsopen 0040fd10 f LIBC:fopen.obj + 0001:0000ed30 _fopen 0040fd30 f LIBC:fopen.obj + 0001:0000ed43 _sprintf 0040fd43 f LIBC:sprintf.obj + 0001:0000eda0 _strncat 0040fda0 f LIBC:strncat.obj + 0001:0000eec3 _fclose 0040fec3 f LIBC:fclose.obj + 0001:0000ef19 _fread 0040ff19 f LIBC:fread.obj + 0001:0000f001 _fwrite 00410001 f LIBC:fwrite.obj + 0001:0000f10b _atol 0041010b f LIBC:atox.obj + 0001:0000f196 _atoi 00410196 f LIBC:atox.obj + 0001:0000f1a1 __atoi64 004101a1 f LIBC:atox.obj + 0001:0000f25b __fputchar 0041025b f LIBC:fputchar.obj + 0001:0000f28a _putchar 0041028a f LIBC:fputchar.obj + 0001:0000f295 _localtime 00410295 f LIBC:localtim.obj + 0001:0000f3f5 _time 004103f5 f LIBC:time.obj + 0001:0000f4d1 _mainCRTStartup 004104d1 f LIBC:crt0.obj + 0001:0000f5b0 __amsg_exit 004105b0 f LIBC:crt0.obj + 0001:0000f5f9 __ioinit 004105f9 f LIBC:ioinit.obj + 0001:0000f7a4 __ioterm 004107a4 f LIBC:ioinit.obj + 0001:0000f7c7 _calloc 004107c7 f LIBC:calloc.obj + 0001:0000f878 __fcloseall 00410878 f LIBC:closeall.obj + 0001:0000f8d0 __filbuf 004108d0 f LIBC:_filbuf.obj + 0001:0000f9a9 __commit 004109a9 f LIBC:commit.obj + 0001:0000fa00 _write 00410a00 f LIBC:write.obj + 0001:0000fa00 __write 00410a00 f LIBC:write.obj + 0001:0000fbad __stbuf 00410bad f LIBC:_sftbuf.obj + 0001:0000fc3a __ftbuf 00410c3a f LIBC:_sftbuf.obj + 0001:0000fc77 __output 00410c77 f LIBC:output.obj + 0001:00010481 __spawnvpe 00411481 f LIBC:spawnvpe.obj + 0001:000105e4 __spawnve 004115e4 f LIBC:spawnve.obj + 0001:0001077e __access 0041177e f LIBC:access.obj + 0001:000107c2 _getenv 004117c2 f LIBC:getenv.obj + 0001:0001083f __input 0041183f f LIBC:input.obj + 0001:000112f0 _lseek 004122f0 f LIBC:lseek.obj + 0001:000112f0 __lseek 004122f0 f LIBC:lseek.obj + 0001:0001138a __getbuf 0041238a f LIBC:_getbuf.obj + 0001:000113ce _isatty 004123ce f LIBC:isatty.obj + 0001:000113ce __isatty 004123ce f LIBC:isatty.obj + 0001:000113f4 ___crtGetStringTypeA 004123f4 f LIBC:a_str.obj + 0001:0001153d __openfile 0041253d f LIBC:_open.obj + 0001:000116ad __getstream 004126ad f LIBC:stream.obj + 0001:00011725 _free 00412725 f LIBC:free.obj + 0001:0001178e __close 0041278e f LIBC:close.obj + 0001:00011841 __freebuf 00412841 f LIBC:_freebuf.obj + 0001:0001186c __read 0041286c f LIBC:read.obj + 0001:0001186c _read 0041286c f LIBC:read.obj + 0001:00011a70 _memcpy 00412a70 f LIBC:memcpy.obj + 0001:00011db0 __allmul 00412db0 f LIBC:llmul.obj + 0001:00011de4 ___tzset 00412de4 f LIBC:tzset.obj + 0001:00011df9 __tzset 00412df9 f LIBC:tzset.obj + 0001:00012057 __isindst 00413057 f LIBC:tzset.obj + 0001:00012343 _gmtime 00413343 f LIBC:gmtime.obj + 0001:0001243c ___loctotime_t 0041343c f LIBC:dtoxtime.obj + 0001:000124fe __XcptFilter 004134fe f LIBC:winxfltr.obj + 0001:00012682 __setenvp 00413682 f LIBC:stdenvp.obj + 0001:0001273b __setargv 0041373b f LIBC:stdargv.obj + 0001:00012988 ___crtGetEnvironmentStringsA 00413988 f LIBC:a_env.obj + 0001:00012aba __GetLinkerVersion 00413aba f LIBC:heapinit.obj + 0001:00012ae7 ___heap_select 00413ae7 f LIBC:heapinit.obj + 0001:00012c2f __heap_init 00413c2f f LIBC:heapinit.obj + 0001:00012c8c __heap_term 00413c8c f LIBC:heapinit.obj + 0001:00012d34 __global_unwind2 00413d34 f LIBC:exsup.obj + 0001:00012d76 __local_unwind2 00413d76 f LIBC:exsup.obj + 0001:00012dce __NLG_Return2 00413dce f LIBC:exsup.obj + 0001:00012dde __abnormal_termination 00413dde f LIBC:exsup.obj + 0001:00012e01 __NLG_Notify1 00413e01 f LIBC:exsup.obj + 0001:00012e0a __NLG_Notify 00413e0a f LIBC:exsup.obj + 0001:00012e1d __NLG_Dispatch 00413e1d f LIBC:exsup.obj + 0001:00012e2c __except_handler3 00413e2c f LIBC:exsup3.obj + 0001:00012ee9 __seh_longjmp_unwind@4 00413ee9 f LIBC:exsup3.obj + 0001:00012f04 __FF_MSGBANNER 00413f04 f LIBC:crt0msg.obj + 0001:00012f3d __NMSG_WRITE 00413f3d f LIBC:crt0msg.obj + 0001:00013090 __GET_RTERRMSG 00414090 f LIBC:crt0msg.obj + 0001:000130c1 _malloc 004140c1 f LIBC:malloc.obj + 0001:000130d3 __nh_malloc 004140d3 f LIBC:malloc.obj + 0001:000130ff __heap_alloc 004140ff f LIBC:malloc.obj + 0001:00013180 _memset 00414180 f LIBC:memset.obj + 0001:000131d8 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 004141d8 f LIBC:handler.obj + 0001:000131e8 ?_query_new_handler@@YAP6AHI@ZXZ 004141e8 f LIBC:handler.obj + 0001:000131ee __callnewh 004141ee f LIBC:handler.obj + 0001:00013209 __get_sbh_threshold 00414209 f LIBC:sbheap.obj + 0001:00013228 __set_sbh_threshold 00414228 f LIBC:sbheap.obj + 0001:000132db ___sbh_heap_init 004142db f LIBC:sbheap.obj + 0001:00013323 ___sbh_find_block 00414323 f LIBC:sbheap.obj + 0001:0001334e ___sbh_free_block 0041434e f LIBC:sbheap.obj + 0001:00013677 ___sbh_alloc_block 00414677 f LIBC:sbheap.obj + 0001:00013980 ___sbh_alloc_new_region 00414980 f LIBC:sbheap.obj + 0001:00013a31 ___sbh_alloc_new_group 00414a31 f LIBC:sbheap.obj + 0001:00013b2c ___sbh_resize_block 00414b2c f LIBC:sbheap.obj + 0001:00013e22 ___sbh_heapmin 00414e22 f LIBC:sbheap.obj + 0001:00013ef3 ___sbh_heap_check 00414ef3 f LIBC:sbheap.obj + 0001:00014222 __get_old_sbh_threshold 00415222 f LIBC:sbheap.obj + 0001:00014228 __set_old_sbh_threshold 00415228 f LIBC:sbheap.obj + 0001:00014244 ___old_sbh_new_region 00415244 f LIBC:sbheap.obj + 0001:00014388 ___old_sbh_release_region 00415388 f LIBC:sbheap.obj + 0001:000143de ___old_sbh_decommit_pages 004153de f LIBC:sbheap.obj + 0001:000144a0 ___old_sbh_find_block 004154a0 f LIBC:sbheap.obj + 0001:000144f7 ___old_sbh_free_block 004154f7 f LIBC:sbheap.obj + 0001:0001453c ___old_sbh_alloc_block 0041553c f LIBC:sbheap.obj + 0001:00014744 ___old_sbh_alloc_block_from_page 00415744 f LIBC:sbheap.obj + 0001:00014868 ___old_sbh_resize_block 00415868 f LIBC:sbheap.obj + 0001:00014911 ___old_sbh_heap_check 00415911 f LIBC:sbheap.obj + 0001:00014a6f __alloc_osfhnd 00415a6f f LIBC:osfinfo.obj + 0001:00014b04 __set_osfhnd 00415b04 f LIBC:osfinfo.obj + 0001:00014b7b __free_osfhnd 00415b7b f LIBC:osfinfo.obj + 0001:00014bf5 __get_osfhandle 00415bf5 f LIBC:osfinfo.obj + 0001:00014c32 __open_osfhandle 00415c32 f LIBC:osfinfo.obj + 0001:00014ccf __dosmaperr 00415ccf f LIBC:dosmap.obj + 0001:00014d36 _wctomb 00415d36 f LIBC:wctomb.obj + 0001:00014da0 __aulldiv 00415da0 f LIBC:ulldiv.obj + 0001:00014e10 __aullrem 00415e10 f LIBC:ullrem.obj + 0001:00014e85 __mbsrchr 00415e85 f LIBC:mbsrchr.obj + 0001:00014ee5 __getpath 00415ee5 f LIBC:getpath.obj + 0001:00014f59 __mbschr 00415f59 f LIBC:mbschr.obj + 0001:00014fcc __dospawn 00415fcc f LIBC:dospawn.obj + 0001:000151ab __cenvarg 004161ab f LIBC:cenvarg.obj + 0001:000153af __mbsnbicoll 004163af f LIBC:mbsnbico.obj + 0001:000153ee ___wtomb_environ 004163ee f LIBC:wtombenv.obj + 0001:0001545c _mbtowc 0041645c f LIBC:mbtowc.obj + 0001:00015524 _isalpha 00416524 f LIBC:_ctype.obj + 0001:00015552 _isupper 00416552 f LIBC:_ctype.obj + 0001:0001557a _islower 0041657a f LIBC:_ctype.obj + 0001:000155a2 _isdigit 004165a2 f LIBC:_ctype.obj + 0001:000155ca _isxdigit 004165ca f LIBC:_ctype.obj + 0001:000155f7 _isspace 004165f7 f LIBC:_ctype.obj + 0001:0001561f _ispunct 0041661f f LIBC:_ctype.obj + 0001:00015647 _isalnum 00416647 f LIBC:_ctype.obj + 0001:00015675 _isprint 00416675 f LIBC:_ctype.obj + 0001:000156a3 _isgraph 004166a3 f LIBC:_ctype.obj + 0001:000156d1 _iscntrl 004166d1 f LIBC:_ctype.obj + 0001:000156f9 ___isascii 004166f9 f LIBC:_ctype.obj + 0001:00015706 ___toascii 00416706 f LIBC:_ctype.obj + 0001:0001570e ___iscsymf 0041670e f LIBC:_ctype.obj + 0001:0001574b ___iscsym 0041674b f LIBC:_ctype.obj + 0001:00015790 __allshl 00416790 f LIBC:llshl.obj + 0001:000157af _ungetc 004167af f LIBC:ungetc.obj + 0001:00015820 __alloca_probe 00416820 f LIBC:chkstk.obj + 0001:00015820 __chkstk 00416820 f LIBC:chkstk.obj + 0001:0001584f __open 0041684f f LIBC:open.obj + 0001:0001584f _open 0041684f f LIBC:open.obj + 0001:00015866 __sopen 00416866 f LIBC:open.obj + 0001:00015b20 _strncpy 00416b20 f LIBC:strncpy.obj + 0001:00015c20 _strcmp 00416c20 f LIBC:strcmp.obj + 0001:00015ca4 __setmbcp 00416ca4 f LIBC:mbctype.obj + 0001:00016068 __getmbcp 00417068 f LIBC:mbctype.obj + 0001:00016078 ___initmbctable 00417078 f LIBC:mbctype.obj + 0001:00016094 _strtol 00417094 f LIBC:strtol.obj + 0001:000162b3 _strtoul 004172b3 f LIBC:strtol.obj + 0001:000162d0 _strstr 004172d0 f LIBC:strstr.obj + 0001:00016350 _strncmp 00417350 f LIBC:strncmp.obj + 0001:00016388 ___crtMessageBoxA 00417388 f LIBC:crtmbox.obj + 0001:00016420 _memmove 00417420 f LIBC:memmove.obj + 0001:00016755 __fptrap 00417755 f LIBC:crt0fp.obj + 0001:00016760 _strrchr 00417760 f LIBC:strrchr.obj + 0001:00016787 ___crtCompareStringA 00417787 f LIBC:a_cmp.obj + 0001:00016a2f ___crtsetenv 00417a2f f LIBC:setenv.obj + 0001:00016c75 __chsize 00417c75 f LIBC:chsize.obj + 0001:00016dbb ___crtLCMapStringA 00417dbb f LIBC:a_map.obj + 0001:0001700a __toupper 0041800a f LIBC:toupper.obj + 0001:00017012 _toupper 00418012 f LIBC:toupper.obj + 0001:000170de _realloc 004180de f LIBC:realloc.obj + 0001:0001737e __strdup 0041837e f LIBC:strdup.obj + 0001:000173a9 __setmode 004183a9 f LIBC:setmode.obj + 0001:00017420 _ExitProcess@4 00418420 f kernel32:KERNEL32.dll + 0001:00017426 _TerminateProcess@8 00418426 f kernel32:KERNEL32.dll + 0001:0001742c _GetCurrentProcess@0 0041842c f kernel32:KERNEL32.dll + 0001:00017432 _GetTimeZoneInformation@4 00418432 f kernel32:KERNEL32.dll + 0001:00017438 _GetSystemTime@4 00418438 f kernel32:KERNEL32.dll + 0001:0001743e _GetLocalTime@4 0041843e f kernel32:KERNEL32.dll + 0001:00017444 _GetCommandLineA@0 00418444 f kernel32:KERNEL32.dll + 0001:0001744a _GetVersion@0 0041844a f kernel32:KERNEL32.dll + 0001:00017450 _SetHandleCount@4 00418450 f kernel32:KERNEL32.dll + 0001:00017456 _GetStdHandle@4 00418456 f kernel32:KERNEL32.dll + 0001:0001745c _GetFileType@4 0041845c f kernel32:KERNEL32.dll + 0001:00017462 _GetStartupInfoA@4 00418462 f kernel32:KERNEL32.dll + 0001:00017468 _HeapAlloc@12 00418468 f kernel32:KERNEL32.dll + 0001:0001746e _GetLastError@0 0041846e f kernel32:KERNEL32.dll + 0001:00017474 _FlushFileBuffers@4 00418474 f kernel32:KERNEL32.dll + 0001:0001747a _WriteFile@20 0041847a f kernel32:KERNEL32.dll + 0001:00017480 _GetFileAttributesA@4 00418480 f kernel32:KERNEL32.dll + 0001:00017486 _SetFilePointer@16 00418486 f kernel32:KERNEL32.dll + 0001:0001748c _MultiByteToWideChar@24 0041848c f kernel32:KERNEL32.dll + 0001:00017492 _GetStringTypeA@20 00418492 f kernel32:KERNEL32.dll + 0001:00017498 _GetStringTypeW@16 00418498 f kernel32:KERNEL32.dll + 0001:0001749e _HeapFree@12 0041849e f kernel32:KERNEL32.dll + 0001:000174a4 _CloseHandle@4 004184a4 f kernel32:KERNEL32.dll + 0001:000174aa _ReadFile@20 004184aa f kernel32:KERNEL32.dll + 0001:000174b0 _WideCharToMultiByte@32 004184b0 f kernel32:KERNEL32.dll + 0001:000174b6 _UnhandledExceptionFilter@4 004184b6 f kernel32:KERNEL32.dll + 0001:000174bc _GetModuleFileNameA@12 004184bc f kernel32:KERNEL32.dll + 0001:000174c2 _FreeEnvironmentStringsA@4 004184c2 f kernel32:KERNEL32.dll + 0001:000174c8 _FreeEnvironmentStringsW@4 004184c8 f kernel32:KERNEL32.dll + 0001:000174ce _GetEnvironmentStrings@0 004184ce f kernel32:KERNEL32.dll + 0001:000174d4 _GetEnvironmentStringsW@0 004184d4 f kernel32:KERNEL32.dll + 0001:000174da _GetModuleHandleA@4 004184da f kernel32:KERNEL32.dll + 0001:000174e0 _GetEnvironmentVariableA@12 004184e0 f kernel32:KERNEL32.dll + 0001:000174e6 _GetVersionExA@4 004184e6 f kernel32:KERNEL32.dll + 0001:000174ec _HeapDestroy@4 004184ec f kernel32:KERNEL32.dll + 0001:000174f2 _HeapCreate@12 004184f2 f kernel32:KERNEL32.dll + 0001:000174f8 _VirtualFree@12 004184f8 f kernel32:KERNEL32.dll + 0001:000174fe _RtlUnwind@16 004184fe f kernel32:KERNEL32.dll + 0001:00017504 _VirtualAlloc@16 00418504 f kernel32:KERNEL32.dll + 0001:0001750a _HeapReAlloc@16 0041850a f kernel32:KERNEL32.dll + 0001:00017510 _IsBadWritePtr@8 00418510 f kernel32:KERNEL32.dll + 0001:00017516 _SetStdHandle@8 00418516 f kernel32:KERNEL32.dll + 0001:0001751c _GetExitCodeProcess@8 0041851c f kernel32:KERNEL32.dll + 0001:00017522 _WaitForSingleObject@8 00418522 f kernel32:KERNEL32.dll + 0001:00017528 _CreateProcessA@40 00418528 f kernel32:KERNEL32.dll + 0001:0001752e _CreateFileA@28 0041852e f kernel32:KERNEL32.dll + 0001:00017534 _GetCPInfo@8 00418534 f kernel32:KERNEL32.dll + 0001:0001753a _GetACP@0 0041853a f kernel32:KERNEL32.dll + 0001:00017540 _GetOEMCP@0 00418540 f kernel32:KERNEL32.dll + 0001:00017546 _GetProcAddress@8 00418546 f kernel32:KERNEL32.dll + 0001:0001754c _LoadLibraryA@4 0041854c f kernel32:KERNEL32.dll + 0001:00017552 _CompareStringA@24 00418552 f kernel32:KERNEL32.dll + 0001:00017558 _CompareStringW@24 00418558 f kernel32:KERNEL32.dll + 0001:0001755e _SetEnvironmentVariableA@8 0041855e f kernel32:KERNEL32.dll + 0001:00017564 _SetEndOfFile@4 00418564 f kernel32:KERNEL32.dll + 0001:0001756a _LCMapStringA@24 0041856a f kernel32:KERNEL32.dll + 0001:00017570 _LCMapStringW@24 00418570 f kernel32:KERNEL32.dll + 0001:00017580 __stricmp 00418580 f LIBC:stricmp.obj + 0001:00017580 __strcmpi 00418580 f LIBC:stricmp.obj + 0001:00017580 _stricmp 00418580 f LIBC:stricmp.obj + 0001:0001760c _chdir 0041860c f LIBC:chdir.obj + 0001:0001760c __chdir 0041860c f LIBC:chdir.obj + 0001:000176a0 _memicmp 004186a0 f LIBC:memicmp.obj + 0001:000176a0 __memicmp 004186a0 f LIBC:memicmp.obj + 0001:0001773d _fileno 0041873d f LIBC:fileno.obj + 0001:0001773d __fileno 0041873d f LIBC:fileno.obj + 0001:00017745 __tolower 00418745 f LIBC:tolower.obj + 0001:0001774d _tolower 0041874d f LIBC:tolower.obj + 0001:00017818 __mbctoupper 00418818 f LIBC:mbtoupr.obj + 0001:00017894 _GetCurrentDirectoryA@8 00418894 f kernel32:KERNEL32.dll + 0001:0001789a _SetCurrentDirectoryA@4 0041889a f kernel32:KERNEL32.dll + 0002:0000001c ??_C@_07OOMJ@cmd?4exe?$AA@ 0041c01c LIBC:system.obj + 0002:00000024 ??_C@_0M@IPJP@command?4com?$AA@ 0041c024 LIBC:system.obj + 0002:00000030 ??_C@_02JMK@?1c?$AA@ 0041c030 LIBC:system.obj + 0002:00000034 ??_C@_07KFDO@COMSPEC?$AA@ 0041c034 LIBC:system.obj + 0002:0000004c ___lookuptable 0041c04c LIBC:output.obj + 0002:000000a8 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 0041c0a8 LIBC:output.obj + 0002:000000b8 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 0041c0b8 LIBC:output.obj + 0002:000000c0 ??_C@_01PCFE@?2?$AA@ 0041c0c0 LIBC:spawnvpe.obj + 0002:000000c4 ??_C@_04LNMG@PATH?$AA@ 0041c0c4 LIBC:spawnvpe.obj + 0002:000000cc ??_C@_04GGNP@?4com?$AA@ 0041c0cc LIBC:spawnve.obj + 0002:000000d4 ??_C@_04NFOM@?4exe?$AA@ 0041c0d4 LIBC:spawnve.obj + 0002:000000dc ??_C@_04KBDN@?4bat?$AA@ 0041c0dc LIBC:spawnve.obj + 0002:000000e4 ??_C@_04LFKF@?4cmd?$AA@ 0041c0e4 LIBC:spawnve.obj + 0002:000000ec ??_C@_02OFKN@?4?2?$AA@ 0041c0ec LIBC:spawnve.obj + 0002:000000f0 ??_C@_01A@?$AA?$AA@ 0041c0f0 LIBC:a_str.obj + 0002:000000f4 ??_C@_13A@?$AA?$AA?$AA?$AA@ 0041c0f4 LIBC:a_str.obj + 0002:00000104 ___dnames 0041c104 LIBC:timeset.obj + 0002:0000011c ___mnames 0041c11c LIBC:timeset.obj + 0002:00000144 ??_C@_02JHIA@TZ?$AA@ 0041c144 LIBC:tzset.obj + 0002:00000148 ??_C@_0BH@PHHF@__GLOBAL_HEAP_SELECTED?$AA@ 0041c148 LIBC:heapinit.obj + 0002:00000160 ??_C@_0BF@BBGL@__MSVCRT_HEAP_SELECT?$AA@ 0041c160 LIBC:heapinit.obj + 0002:00000178 ??_C@_0P@GGKG@runtime?5error?5?$AA@ 0041c178 LIBC:crt0msg.obj + 0002:00000188 ??_C@_02PIMC@?$AN?6?$AA@ 0041c188 LIBC:crt0msg.obj + 0002:0000018c ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 0041c18c LIBC:crt0msg.obj + 0002:0000019c ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 0041c19c LIBC:crt0msg.obj + 0002:000001ac ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 0041c1ac LIBC:crt0msg.obj + 0002:000001bc ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 0041c1bc LIBC:crt0msg.obj + 0002:000001e4 ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 0041c1e4 LIBC:crt0msg.obj + 0002:0000021c ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 0041c21c LIBC:crt0msg.obj + 0002:00000254 ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 0041c254 LIBC:crt0msg.obj + 0002:0000027c ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 0041c27c LIBC:crt0msg.obj + 0002:000002b4 ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 0041c2b4 LIBC:crt0msg.obj + 0002:000002e0 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 0041c2e0 LIBC:crt0msg.obj + 0002:00000304 ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 0041c304 LIBC:crt0msg.obj + 0002:00000334 ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 0041c334 LIBC:crt0msg.obj + 0002:00000360 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 0041c360 LIBC:crt0msg.obj + 0002:00000384 ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 0041c384 LIBC:crt0msg.obj + 0002:000003b0 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 0041c3b0 LIBC:crt0msg.obj + 0002:000003dc ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 0041c3dc LIBC:crt0msg.obj + 0002:00000404 ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 0041c404 LIBC:crt0msg.obj + 0002:0000042c ??_C@_02JJJH@?6?6?$AA@ 0041c42c LIBC:crt0msg.obj + 0002:00000430 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 0041c430 LIBC:crt0msg.obj + 0002:0000044c ??_C@_03NAME@?4?4?4?$AA@ 0041c44c LIBC:crt0msg.obj + 0002:00000450 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 0041c450 LIBC:crt0msg.obj + 0002:00000468 ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 0041c468 LIBC:crtmbox.obj + 0002:0000047c ??_C@_0BA@GILI@GetActiveWindow?$AA@ 0041c47c LIBC:crtmbox.obj + 0002:0000048c ??_C@_0M@PKCK@MessageBoxA?$AA@ 0041c48c LIBC:crtmbox.obj + 0002:00000498 ??_C@_0L@HKL@user32?4dll?$AA@ 0041c498 LIBC:crtmbox.obj + 0003:00000000 ___xc_a 0041d000 LIBC:crt0init.obj + 0003:00000104 ___xc_z 0041d104 LIBC:crt0init.obj + 0003:00000208 ___xi_a 0041d208 LIBC:crt0init.obj + 0003:00000418 ___xi_z 0041d418 LIBC:crt0init.obj + 0003:0000051c ___xp_a 0041d51c LIBC:crt0init.obj + 0003:00000724 ___xp_z 0041d724 LIBC:crt0init.obj + 0003:00000828 ___xt_a 0041d828 LIBC:crt0init.obj + 0003:0000092c ___xt_z 0041d92c LIBC:crt0init.obj + 0003:00000a30 _in 0041da30 ucp.obj + 0003:00000a34 _rdev 0041da34 ucp.obj + 0003:00000a38 _syserror 0041da38 ucp.obj + 0003:00000a3c _help 0041da3c ucp.obj + 0003:0000177c _cmdblk 0041e77c devhd.obj + 0003:00001784 _busid 0041e784 devhd.obj + 0003:000017c0 _dev_tab 0041e7c0 devio.obj + 0003:00001978 _tty_default 0041e978 devtty.obj + 0003:00001988 _tty_vector 0041e988 devtty.obj + 0003:000019b0 _ttyinq 0041e9b0 devtty.obj + 0003:00001ae0 _baddevmsg 0041eae0 filesys.obj + 0003:00001e84 _UZIX 0041ee84 main.obj + 0003:00001e94 _HOST 0041ee94 main.obj + 0003:000020ac _stringerr 0041f0ac xfs.obj + 0003:00002638 __iob 0041f638 LIBC:_file.obj + 0003:000028c0 __pctype 0041f8c0 LIBC:ctype.obj + 0003:000028c4 __pwctype 0041f8c4 LIBC:ctype.obj + 0003:000028c8 __ctype 0041f8c8 LIBC:ctype.obj + 0003:00002acc ___mb_cur_max 0041facc LIBC:nlsdata1.obj + 0003:00002ad0 ___decimal_point 0041fad0 LIBC:nlsdata1.obj + 0003:00002ad4 ___decimal_point_length 0041fad4 LIBC:nlsdata1.obj + 0003:00002ae0 __aexit_rtn 0041fae0 LIBC:crt0.obj + 0003:00002ae4 ___app_type 0041fae4 LIBC:crt0.obj + 0003:00002ae8 ___badioinfo 0041fae8 LIBC:ioinit.obj + 0003:00002af0 ___nullstring 0041faf0 LIBC:output.obj + 0003:00002af4 ___wnullstring 0041faf4 LIBC:output.obj + 0003:00002b20 __timezone 0041fb20 LIBC:timeset.obj + 0003:00002b24 __daylight 0041fb24 LIBC:timeset.obj + 0003:00002b28 __dstbias 0041fb28 LIBC:timeset.obj + 0003:00002bac __tzname 0041fbac LIBC:timeset.obj + 0003:00002bd8 __XcptActTab 0041fbd8 LIBC:winxfltr.obj + 0003:00002c50 __First_FPE_Indx 0041fc50 LIBC:winxfltr.obj + 0003:00002c54 __Num_FPE 0041fc54 LIBC:winxfltr.obj + 0003:00002c58 __XcptActTabCount 0041fc58 LIBC:winxfltr.obj + 0003:00002c5c __fpecode 0041fc5c LIBC:winxfltr.obj + 0003:00002c60 __amblksiz 0041fc60 LIBC:heapinit.obj + 0003:00002c64 __NLG_Destination 0041fc64 LIBC:exsup.obj + 0003:00002d10 ___old_small_block_heap 0041fd10 LIBC:sbheap.obj + 0003:00004d34 ___old_sbh_threshold 00421d34 LIBC:sbheap.obj + 0003:00004ea0 __cfltcvt_tab 00421ea0 LIBC:cmiscdat.obj + 0003:00004ec0 __p_overlay 00421ec0 LIBC:dospawn.obj + 0003:00004ed0 __lpdays 00421ed0 LIBC:days.obj + 0003:00004f04 __days 00421f04 LIBC:days.obj + 0003:000059a0 _f_pause 004229a0 ucp.obj + 0003:000059a1 _unix_locked_out 004229a1 + 0003:000059a2 _swapblk 004229a2 + 0003:000059a4 _hd_offset 004229a4 devhd.obj + 0003:000059a8 _hd_sector 004229a8 devhd.obj + 0003:000059ac _dptr 004229ac devhd.obj + 0003:000059b0 _dlen 004229b0 devhd.obj + 0003:000059b4 _cptr 004229b4 devhd.obj + 0003:000059b9 _dirty_mask 004229b9 + 0003:000059ba _inint 004229ba + 0003:000059bc _initproc 004229bc + 0003:000059c0 _bufclock 004229c0 devio.obj + 0003:000059c8 _swapcnt 004229c8 + 0003:000059cd _traceon 004229cd + 0003:000059ce _sec 004229ce + 0003:000059d9 _total 004229d9 + 0003:000059da _waitno 004229da + 0003:000059e4 _tod 004229e4 + 0003:000059f4 _runticks 004229f4 + 0003:000059f6 _root_dev 004229f6 + 0003:00005a08 __cflush 00422a08 LIBC:_file.obj + 0003:00005a0c _errno 00422a0c LIBC:crt0dat.obj + 0003:00005a10 __doserrno 00422a10 LIBC:crt0dat.obj + 0003:00005a14 __umaskval 00422a14 LIBC:crt0dat.obj + 0003:00005a18 __osver 00422a18 LIBC:crt0dat.obj + 0003:00005a1c __winver 00422a1c LIBC:crt0dat.obj + 0003:00005a20 __winmajor 00422a20 LIBC:crt0dat.obj + 0003:00005a24 __winminor 00422a24 LIBC:crt0dat.obj + 0003:00005a28 ___argc 00422a28 LIBC:crt0dat.obj + 0003:00005a2c ___argv 00422a2c LIBC:crt0dat.obj + 0003:00005a30 ___wargv 00422a30 LIBC:crt0dat.obj + 0003:00005a34 __environ 00422a34 LIBC:crt0dat.obj + 0003:00005a38 ___initenv 00422a38 LIBC:crt0dat.obj + 0003:00005a3c __wenviron 00422a3c LIBC:crt0dat.obj + 0003:00005a40 ___winitenv 00422a40 LIBC:crt0dat.obj + 0003:00005a44 __pgmptr 00422a44 LIBC:crt0dat.obj + 0003:00005a48 __wpgmptr 00422a48 LIBC:crt0dat.obj + 0003:00005a4c __exitflag 00422a4c LIBC:crt0dat.obj + 0003:00005a50 __C_Termination_Done 00422a50 LIBC:crt0dat.obj + 0003:00005a54 __C_Exit_Done 00422a54 LIBC:crt0dat.obj + 0003:00005a70 __aenvptr 00422a70 LIBC:crt0.obj + 0003:00005a74 __wenvptr 00422a74 LIBC:crt0.obj + 0003:00005a78 ___error_mode 00422a78 LIBC:crt0.obj + 0003:00005a7c __stdbuf 00422a7c LIBC:_sftbuf.obj + 0003:00005b44 _swapbase 00422b44 + 0003:00005b6c __pxcptinfoptrs 00422b6c LIBC:winxfltr.obj + 0003:00005c78 __adbgmsg 00422c78 LIBC:crt0msg.obj + 0003:00005c7c ?_pnhHeap@@3P6AHI@ZA 00422c7c LIBC:handler.obj + 0003:00005c80 __newmode 00422c80 LIBC:_newmode.obj + 0003:00005c88 ___lc_handle 00422c88 LIBC:nlsdata2.obj + 0003:00005ca0 ___lc_codepage 00422ca0 LIBC:nlsdata2.obj + 0003:00005ca4 ___lc_collate_cp 00422ca4 LIBC:nlsdata2.obj + 0003:00005ca8 __commode 00422ca8 LIBC:ncommode.obj + 0003:00005cc0 __fmode 00422cc0 LIBC:txtmode.obj + 0003:00005cc8 _ticks 00422cc8 + 0003:00005ccc _root_ino 00422ccc + 0003:00005cd0 _ibuf 00422cd0 + 0003:00005cdc _ncalls 00422cdc + 0003:00005ce0 _bufpool 00422ce0 + 0003:00007158 _osBank 00424158 + 0003:0000715c _disp_tab 0042415c + 0003:00007160 _fs_tab 00424160 + 0003:000071cc _buf_flsh 004241cc + 0003:000071d0 _buf_hits 004241d0 + 0003:000071d4 _buf_miss 004241d4 + 0003:000071e0 _of_tab 004241e0 + 0003:00007360 _i_tab 00424360 + 0003:00007f40 _ub 00424f40 + 0003:00008f40 _ptab 00425f40 + 0003:00009080 _kbuf 00426080 + 0003:000090c0 _recv_bufs 004260c0 + 0003:00009dc0 _stopflag 00426dc0 + 0003:00009e00 _flshflag 00426e00 + 0003:00009e40 _tty_data 00426e40 + 0003:00009ee0 _cwd 00426ee0 + 0003:00009f80 _line 00426f80 + 0003:0000ade4 ___mbcodepage 00427de4 + 0003:0000ae60 ___mbulinfo 00427e60 + 0003:0000ae6c ___ismbcodepage 00427e6c + 0003:0000ae80 __mbcasemap 00427e80 + 0003:0000af80 __mbctype 00427f80 + 0003:0000b084 ___mblcid 00428084 + 0003:0000b088 ___sbh_sizeHeaderList 00428088 + 0003:0000b09c ___sbh_indGroupDefer 0042809c + 0003:0000b0a0 ___sbh_pHeaderScan 004280a0 + 0003:0000b0a4 ___sbh_initialized 004280a4 + 0003:0000b0a8 ___sbh_pHeaderDefer 004280a8 + 0003:0000b0ac ___sbh_cntHeaderList 004280ac + 0003:0000b0b0 ___sbh_pHeaderList 004280b0 + 0003:0000b0b4 ___sbh_threshold 004280b4 + 0003:0000b0b8 __crtheap 004280b8 + 0003:0000b0c8 ___active_heap 004280c8 + 0003:0000b0e0 ___pioinfo 004280e0 + 0003:0000b21c __nhandle 0042821c + 0003:0000b220 __acmdln 00428220 + 0003:0000b22c ___env_initialized 0042822c + 0003:0000b23c ___mbctype_initialized 0042823c + 0003:0000b240 ___onexitend 00428240 + 0003:0000b244 ___onexitbegin 00428244 + 0003:0000b248 __FPinit 00428248 + 0003:0000b24c ___piob 0042824c + 0003:0000b5a0 __bufin 004285a0 + 0003:0000c5a0 __nstream 004295a0 + 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 0042a000 kernel32:KERNEL32.dll + 0004:00000014 __NULL_IMPORT_DESCRIPTOR 0042a014 kernel32:KERNEL32.dll + 0004:0000016c __imp__GetEnvironmentStringsW@0 0042a16c kernel32:KERNEL32.dll + 0004:00000170 __imp__TerminateProcess@8 0042a170 kernel32:KERNEL32.dll + 0004:00000174 __imp__GetCurrentProcess@0 0042a174 kernel32:KERNEL32.dll + 0004:00000178 __imp__GetTimeZoneInformation@4 0042a178 kernel32:KERNEL32.dll + 0004:0000017c __imp__GetSystemTime@4 0042a17c kernel32:KERNEL32.dll + 0004:00000180 __imp__GetLocalTime@4 0042a180 kernel32:KERNEL32.dll + 0004:00000184 __imp__GetCommandLineA@0 0042a184 kernel32:KERNEL32.dll + 0004:00000188 __imp__GetVersion@0 0042a188 kernel32:KERNEL32.dll + 0004:0000018c __imp__SetHandleCount@4 0042a18c kernel32:KERNEL32.dll + 0004:00000190 __imp__GetStdHandle@4 0042a190 kernel32:KERNEL32.dll + 0004:00000194 __imp__GetFileType@4 0042a194 kernel32:KERNEL32.dll + 0004:00000198 __imp__GetStartupInfoA@4 0042a198 kernel32:KERNEL32.dll + 0004:0000019c __imp__HeapAlloc@12 0042a19c kernel32:KERNEL32.dll + 0004:000001a0 __imp__GetLastError@0 0042a1a0 kernel32:KERNEL32.dll + 0004:000001a4 __imp__FlushFileBuffers@4 0042a1a4 kernel32:KERNEL32.dll + 0004:000001a8 __imp__WriteFile@20 0042a1a8 kernel32:KERNEL32.dll + 0004:000001ac __imp__GetFileAttributesA@4 0042a1ac kernel32:KERNEL32.dll + 0004:000001b0 __imp__SetFilePointer@16 0042a1b0 kernel32:KERNEL32.dll + 0004:000001b4 __imp__MultiByteToWideChar@24 0042a1b4 kernel32:KERNEL32.dll + 0004:000001b8 __imp__GetStringTypeA@20 0042a1b8 kernel32:KERNEL32.dll + 0004:000001bc __imp__GetStringTypeW@16 0042a1bc kernel32:KERNEL32.dll + 0004:000001c0 __imp__HeapFree@12 0042a1c0 kernel32:KERNEL32.dll + 0004:000001c4 __imp__CloseHandle@4 0042a1c4 kernel32:KERNEL32.dll + 0004:000001c8 __imp__ReadFile@20 0042a1c8 kernel32:KERNEL32.dll + 0004:000001cc __imp__WideCharToMultiByte@32 0042a1cc kernel32:KERNEL32.dll + 0004:000001d0 __imp__UnhandledExceptionFilter@4 0042a1d0 kernel32:KERNEL32.dll + 0004:000001d4 __imp__GetModuleFileNameA@12 0042a1d4 kernel32:KERNEL32.dll + 0004:000001d8 __imp__FreeEnvironmentStringsA@4 0042a1d8 kernel32:KERNEL32.dll + 0004:000001dc __imp__FreeEnvironmentStringsW@4 0042a1dc kernel32:KERNEL32.dll + 0004:000001e0 __imp__GetEnvironmentStrings@0 0042a1e0 kernel32:KERNEL32.dll + 0004:000001e4 __imp__ExitProcess@4 0042a1e4 kernel32:KERNEL32.dll + 0004:000001e8 __imp__GetModuleHandleA@4 0042a1e8 kernel32:KERNEL32.dll + 0004:000001ec __imp__GetEnvironmentVariableA@12 0042a1ec kernel32:KERNEL32.dll + 0004:000001f0 __imp__GetVersionExA@4 0042a1f0 kernel32:KERNEL32.dll + 0004:000001f4 __imp__HeapDestroy@4 0042a1f4 kernel32:KERNEL32.dll + 0004:000001f8 __imp__HeapCreate@12 0042a1f8 kernel32:KERNEL32.dll + 0004:000001fc __imp__VirtualFree@12 0042a1fc kernel32:KERNEL32.dll + 0004:00000200 __imp__RtlUnwind@16 0042a200 kernel32:KERNEL32.dll + 0004:00000204 __imp__VirtualAlloc@16 0042a204 kernel32:KERNEL32.dll + 0004:00000208 __imp__HeapReAlloc@16 0042a208 kernel32:KERNEL32.dll + 0004:0000020c __imp__IsBadWritePtr@8 0042a20c kernel32:KERNEL32.dll + 0004:00000210 __imp__SetStdHandle@8 0042a210 kernel32:KERNEL32.dll + 0004:00000214 __imp__GetExitCodeProcess@8 0042a214 kernel32:KERNEL32.dll + 0004:00000218 __imp__WaitForSingleObject@8 0042a218 kernel32:KERNEL32.dll + 0004:0000021c __imp__CreateProcessA@40 0042a21c kernel32:KERNEL32.dll + 0004:00000220 __imp__CreateFileA@28 0042a220 kernel32:KERNEL32.dll + 0004:00000224 __imp__GetCPInfo@8 0042a224 kernel32:KERNEL32.dll + 0004:00000228 __imp__GetACP@0 0042a228 kernel32:KERNEL32.dll + 0004:0000022c __imp__GetOEMCP@0 0042a22c kernel32:KERNEL32.dll + 0004:00000230 __imp__GetProcAddress@8 0042a230 kernel32:KERNEL32.dll + 0004:00000234 __imp__LoadLibraryA@4 0042a234 kernel32:KERNEL32.dll + 0004:00000238 __imp__CompareStringA@24 0042a238 kernel32:KERNEL32.dll + 0004:0000023c __imp__CompareStringW@24 0042a23c kernel32:KERNEL32.dll + 0004:00000240 __imp__SetEnvironmentVariableA@8 0042a240 kernel32:KERNEL32.dll + 0004:00000244 __imp__SetEndOfFile@4 0042a244 kernel32:KERNEL32.dll + 0004:00000248 __imp__LCMapStringA@24 0042a248 kernel32:KERNEL32.dll + 0004:0000024c __imp__LCMapStringW@24 0042a24c kernel32:KERNEL32.dll + 0004:00000250 __imp__GetCurrentDirectoryA@8 0042a250 kernel32:KERNEL32.dll + 0004:00000254 __imp__SetCurrentDirectoryA@4 0042a254 kernel32:KERNEL32.dll + 0004:00000258 \177KERNEL32_NULL_THUNK_DATA 0042a258 kernel32:KERNEL32.dll - entry point at 0001:0000f741 + entry point at 0001:0000f4d1 diff --git a/src/fsutil/ucpsub.c b/src/fsutil/ucpsub.c index c3b90ddc..a5ddbbeb 100644 --- a/src/fsutil/ucpsub.c +++ b/src/fsutil/ucpsub.c @@ -64,7 +64,11 @@ extern uchar *syserror; int xls(char *option, char *path); -int xchmod(char *path, char *modes); +int xchmod(char *modes, char *path); /* Nick reversed argument order */ +#if 1 /* Nick */ +int xchown(char *uidno, char *path); +int xchgrp(char *gidno, char *path); +#endif int xumask(char *masks); int xmknod(char *path, char *modes, char *devs, char *devs1); int xmkdir(char *path); @@ -232,7 +236,7 @@ int xls(option, thepath) /* just to make syntax equal to Solaris, Linux, etc */ int xchmod(modes, path) - char *path, *modes; + char *modes, *path; /* Nick reversed argument order */ { int mode = -1; @@ -250,6 +254,50 @@ int xchmod(modes, path) return 0; } +#if 1 /* Nick */ +int xchown(char *uidno, char *path) + { + int uid = -1; + struct stat statbuf; + + sscanf(uidno, "%d", &uid); + if (uid == -1) + { + PF("chown: bad uid\n"); + pse(); + return (-1); + } + if (UZIXstat(path, &statbuf) || UZIXchown(path, uid, statbuf.st_gid)) + { + PF("_chown: error %s\n", stringerr[*syserror]); + pse(); + return (-1); + } + return 0; + } + +int xchgrp(char *gidno, char *path) + { + int gid = -1; + struct stat statbuf; + + sscanf(gidno, "%d", &gid); + if (gid == -1) + { + PF("chgrp: bad gid\n"); + pse(); + return (-1); + } + if (UZIXstat(path, &statbuf) || UZIXchown(path, statbuf.st_uid, gid)) + { + PF("_chgrp: error %s\n", stringerr[*syserror]); + pse(); + return (-1); + } + return 0; +} +#endif + int xumask(masks) char *masks; { diff --git a/src/fsutil/utils.rel b/src/fsutil/utils.rel index 2aaadffb..1e9626ab 100644 --- a/src/fsutil/utils.rel +++ b/src/fsutil/utils.rel @@ -1,10 +1,10 @@ XL4 H 2 areas A global symbols M utils -S ?CL64180L_4_06_L00 Ref00000000 -S ?LEAVE_DIRECT_L09 Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 S ?ENT_PARM_DIRECT_L09 Ref00000000 S ?SS_CMP_L02 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 S .__.ABS. Def00000000 A _DEFAULT size 0 flags 0 A CODE size C5 flags 0 @@ -16,7 +16,7 @@ S int_max Def000000AF T 00 00 00 00 R 00 00 01 00 T 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 02 00 +R 00 00 01 00 02 05 01 00 T 03 00 00 00 R 00 00 01 00 T 03 00 00 00 @@ -34,18 +34,18 @@ R 00 00 01 00 T 27 00 00 00 R 00 00 01 00 T 27 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 01 00 +R 00 00 01 00 02 05 00 00 T 2A 00 00 00 R 00 00 01 00 T 2A 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 02 00 +R 00 00 01 00 02 05 01 00 T 2D 00 00 00 R 00 00 01 00 T 2D 00 00 00 R 00 00 01 00 -T 2D 00 00 00 DD 6E 08 DD 66 09 2B DD 75 08 DD +T 2D 00 00 00 DD 6E 0A DD 66 0B 2B DD 75 0A DD R 00 00 01 00 -T 38 00 00 00 74 09 23 7D B4 28 14 +T 38 00 00 00 74 0B 23 7D B4 28 14 R 00 00 01 00 T 3F 00 00 00 R 00 00 01 00 @@ -56,18 +56,18 @@ R 00 00 01 00 T 53 00 00 00 R 00 00 01 00 T 53 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 01 00 +R 00 00 01 00 02 05 00 00 T 56 00 00 00 R 00 00 01 00 T 56 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 02 00 +R 00 00 01 00 02 05 01 00 T 59 00 00 00 R 00 00 01 00 T 59 00 00 00 R 00 00 01 00 -T 59 00 00 00 DD 6E 08 DD 66 09 2B DD 75 08 DD +T 59 00 00 00 DD 6E 0A DD 66 0B 2B DD 75 0A DD R 00 00 01 00 -T 64 00 00 00 74 09 23 7D B4 28 20 +T 64 00 00 00 74 0B 23 7D B4 28 20 R 00 00 01 00 T 6B 00 00 00 R 00 00 01 00 @@ -80,13 +80,13 @@ R 00 00 01 00 T 8B 00 00 00 R 00 00 01 00 T 8B 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 01 00 +R 00 00 01 00 02 05 00 00 T 8E 00 00 00 R 00 00 01 00 T 8E 00 00 00 CD 00 00 00 00 4B 42 DD 6E 04 DD -R 00 00 01 00 02 05 02 00 +R 00 00 01 00 02 05 01 00 T 97 00 00 00 66 05 CD 00 00 00 00 30 08 DD 6E -R 00 00 01 00 02 07 03 00 +R 00 00 01 00 02 07 02 00 T A0 00 00 00 04 DD 66 05 18 06 R 00 00 01 00 T A6 00 00 00 @@ -96,11 +96,11 @@ R 00 00 01 00 T AC 00 00 00 R 00 00 01 00 T AC 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 01 00 +R 00 00 01 00 02 05 00 00 T AF 00 00 00 R 00 00 01 00 T AF 00 00 00 CD 00 00 00 00 EB CD 00 00 00 00 -R 00 00 01 00 02 05 02 00 02 0B 03 00 +R 00 00 01 00 02 05 01 00 02 0B 02 00 T B6 00 00 00 30 04 69 60 18 06 R 00 00 01 00 T BC 00 00 00 @@ -110,4 +110,4 @@ R 00 00 01 00 T C2 00 00 00 R 00 00 01 00 T C2 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 01 00 +R 00 00 01 00 02 05 00 00 diff --git a/src/gboot/build.ban b/src/gboot/build.ban new file mode 100644 index 00000000..fd61bc88 --- /dev/null +++ b/src/gboot/build.ban @@ -0,0 +1,35 @@ +copy ..\gboot.asm +copy ..\io64180.inc +copy ..\diag.inc +copy ..\copyr.inc +copy ..\clears.inc +as-z80 -l -o gboot +@if errorlevel 1 goto failure +link-z80 -f gboot +@if errorlevel 1 goto failure +ihex2bin gboot.i86 ..\..\..\bin\boot.bin +4dos /c crcd ..\..\..\bin\boot.bin +bin2c ..\..\..\bin\boot.bin ..\..\fsutil\boot.c + +copy ..\uzboot.asm +as-z80 -l -o uzboot +@if errorlevel 1 goto failure +copy ..\uzfile.asm +as-z80 -l -o uzfile +@if errorlevel 1 goto failure +copy ..\uzmain.asm +as-z80 -l -o uzmain +@if errorlevel 1 goto failure +copy ..\uzdata.asm +as-z80 -l -o uzdata +@if errorlevel 1 goto failure +link-z80 -f uzboot +@if errorlevel 1 goto failure +ihex2bin uzboot.i86 ..\..\..\bin\uzboot.ldr + +@echo SUCCESS +@goto done +:failure +@echo FAILURE +:done + diff --git a/src/gboot/gboot.asm$ b/src/gboot/gboot.asm$ deleted file mode 100644 index 29c12958..00000000 --- a/src/gboot/gboot.asm$ +++ /dev/null @@ -1,793 +0,0 @@ -; gboot.asm -; Generic Hytech boot loader program to occupy 4 sectors at start of each disk - -$ io64180.inc - -LDFILE equ 0f037h ; BOOTLDR.BIN entry point - -SUPERBLOCK equ 4 ; starting position of filesystem -SMOUNTED equ 12742 ; random number to specify mounted fs -ROOTINODE equ 1 ; inode number of / for all mounted fs - -BUFSIZE equ 200h ; how many bytes per disk block -BUFSIZELOG equ 9 ; shift count representing the above - -SIZEOF_DINODE_T equ 64 ; how many bytes per disk inode -DINODESPERBLOCK equ 8 ; how many disk inodes per disk block -DINODESPERBLOCKLOG equ 3 ; shift count representing the above - -DIRECTBLOCKS equ 18 -INDIRECTBLOCKS equ 1 ; MUST BE 1! -DINDIRECTBLOCKS equ 1 ; MUST BE 1! - -SIZEOF_DIRECT_T equ 16 ; how many bytes per directory entry -DIRNAMELEN equ 14 ; how many bytes of these are dir name - -REGION_LOG equ 14 -REGION_BYTES equ (1<> 14) & 1 - defb ((800h-(final-start)) >> 14) & 2 - defb ((0c00h-(final-start)) >> 14) & 3 - defb 0,0,0,0,0,0,0,0,0,0,0,0 - -entry: - call gmess - defb 'loading /boot/kernel.bin',0dh,0ah,0 - - ld de,SUPERBLOCK - ld hl,block - call block_read - - ld hl,(block) - ld de,SMOUNTED - or a - sbc hl,de - jr nz,black_magic - - ld hl,(block+2) - ld (reserv),hl - ld hl,(block+4) - ld (isize),hl - ld hl,(block+6) - ld (fsize),hl - - ld de,ROOTINODE - ld hl,name_boot - call dir_search ; returns de = the found inode - jr nz,bad_file - - ld hl,name_kernel_bin - call dir_search ; returns de = the found inode - jr nz,bad_file - - call file_scan - - call virtual_init ; modifies CBR (can't call EPROM now) - - ld bc,8080h ; initial spot in virt memory table - ld hl,region_list+2 ; -> block no. of 2nd found region - jr translate_loope - -translate_loop: - add hl,de ; restore hl value from comparison - - call block_to_bbr ; calculates a from word at hl (bumped) - ld (bc),a ; a = required bbr value to access page - inc bc - -translate_loope: - ld de,(region_ptr) ; indicates end of region list - or a - sbc hl,de ; see if we've gone past the end - jr c,translate_loop - - ld hl,region_list ; there is at least one entry - call block_to_bbr ; a = required bbr value for init code - -kazumi: ; please preserve a for entering kernel at label runsys! - ld sp,parameters-parameters_end ; stack just under copied params - - ld hl,parameters ; pre-initialised parameter block - ld de,parameters-parameters_end ; to fit neatly at top of memory - ld bc,parameters_end-parameters ; size in bytes to copy - ldir ; copy parameter block for kernel init - - .if 1 ; so as not to corrupt CBR when jumping to the loaded program - ld hl,runsys ; start of small stub program below - ld de,8100h ; -> just after virtual memory table - push de - ld c,runsys_end-runsys ; size of small stub program (b=0) - ldir ; copy stub program - ret ; enter stub program (jp 8100h) - .else - ld e,30h-8 - out0 (CBR),e ; window onto runsys (CBAR = 80h) - jp runsys+8000h ; run the remaining startup from window - .endif - -runsys: ld e,84h - out0 (CBAR),e ; CA0 = 16k, bank area = 16k, CA1 = 32k - - out0 (BBR),a ; bank area = logical 4000 = abs c:0000 - jp 4000h ; execute file from the 1st loaded page - .if 1 ; so as not to corrupt CBR when jumping to the loaded program -runsys_end: - .endif - -black_magic: - call gmess - defb 'bad magic: ',0 - add hl,de - jr reboot_ahexw - -bad_file: - call gmess - defb 'file not found',0dh,0ah,0 - jr reboot_plain - -; ----------------------------------------------------------------------------- -; had some kind of fatal error, the entry points are to save code space - -reboot_ahexw: - call ahexw - -reboot_acrlf: - call acrlf - -reboot_plain: - ; try not to surprise the user unnecessarily - call gmess - defb 'doing a clean boot',0dh,0ah,0 - - ; before rebooting, prepare to clobber CP/M drive A: directory - ld hl,block - ld de,block+1 - ld bc,BUFSIZE-1 - ld (hl),0aah ; clobbering pattern - ldir ; initialise temporary buffer - - ; perform the clobbering (this ensures a clean boot from EPROM) - ld de,304h - ld l,c - ld h,b ; ld hl,0 ; e:hl -> destination 4:0000 - - ld b,4 ; clobber until just before 4:0800 -clobber_loop: - push bc - - ld iy,block ; copy from d:iy -> destination - ld bc,BUFSIZE ; bytes to copy - call copyr ; copy them, one byte at a time - - pop bc - djnz clobber_loop - - ; ready to reboot, by instructing the WPO chip on motherboard - ld a,0aah - out0 (TRDR),A ; command byte to reboot the system - ld a,13h - out0 (CNTR),A ; TE=1, divisor = 3, start transmission - - ; wait for the reboot to occur, or else we're rather stuck - jr $ - -; ----------------------------------------------------------------------------- - -gmess: call amess - defb 'gboot: ',0 - jp amess - -rsel1: - .if 1 ; temporary only - ld de,2 ; save eprom serial no to 2:fc81 - call copy_serial_no - .endif - ld a,81h - out0 (TRDR),A ; command byte to set RSEL=1 - ld a,13h - out0 (CNTR),A ; TE=1, divisor = 3, start transmission - - sub a - dec a - jr nz,$-1 - dec a - jr nz,$-1 - dec a - jr nz,$-1 - dec a - jr nz,$-1 ; delay for command to be processed - .if 1 ; temporary only - ld de,200h ; restore eprom serial no from 2:fc81 -copy_serial_no: - ld hl,0fc81h - push hl - pop iy - ld bc,5 - jp copyr - .else - ret - .endif - -virtual_init: - call gmess - defb 'starting operating system',0dh,0ah,0 - - call rsel1 - - ld a,80h - out0 (CBAR),a ; CA0 = 0k, bank area = 32k, CA1 = 32k - - ld a,4-8 ;0 also works, see bstartup.s01 at label init - out0 (CBR),a ; window onto 0:8000, virt memory table - - ld hl,08000h - ld de,08001h - ld bc,0ffh - ld (hl),l ; 0 - ldir ; zero out the virtual memory table - ret - -; ----------------------------------------------------------------------------- - -file_scan: - ld hl,region_list - ld (region_ptr),hl - - ld hl,inode - call inode_read ; read inode of the target file - - call bmap_setup ; prepare counters to walk the file - call bmap_remain ; get hl = valid bytes in first block - ; and decrement the file size remaining - ld a,l - or h ; any bytes in file? - jr z,bad_file_size ; no, abort proceedings - -file_scan_loop: - call bmap_block ; get de = block no. of current block - ; and increment the block position - ld a,e - or d - jr z,bad_file_block -; ld l,e -; ld h,d -; call ahexw - - ld a,e - and PAGE_BLOCKS-1 ; check it starts on a page boundary - jr nz,bad_alignment - - ld hl,(region_ptr) - ld (hl),e - inc hl - ld (hl),d ; stash away the starting block no. - inc hl - ld (region_ptr),hl ; for the current region (bumped) - - ld b,REGION_BLOCKS-1 - -file_region_loop: - push bc - push de - - call bmap_remain ; get hl = valid bytes in current block - ; and decrement the file size remaining - ld a,l - or h - jr z,file_region_final - - call bmap_block ; get de = block no. of current block - ; and increment the block position - ld a,e - or d - jr z,bad_file_block -; ld a,' ' -; call abyte -; ld l,e -; ld h,d -; call ahexw - - ex de,hl ; hl = the actual block no. from file - pop de - inc de ; de = expected, contiguous block no. - - or a - sbc hl,de - jr nz,bad_alignment - - pop bc - djnz file_region_loop -; call acrlf - - call bmap_remain ; get hl = valid bytes in current block - ; and decrement the file size remaining - ld a,l - or h ; anything left to read? - jr nz,file_scan_loop ; yes (scan is limited by file size) - ret ; last region is = REGION_BLOCKS blocks - -file_region_final: -; call acrlf - pop hl ; last region is < REGION_BLOCKS blocks - pop hl ; clean up saved variables, and done - ret - -bad_file_size: - call gmess - defb 'null file',0dh,0ah,0 - jp reboot_plain - -bad_file_block: - call gmess - defb 'hole in file',0dh,0ah,0 - jp reboot_plain - -bad_alignment: - call gmess - defb 'not aligned',0dh,0ah,0 - jp reboot_plain - -; ----------------------------------------------------------------------------- - -dir_search: - ld (dir_name),hl - - ld hl,inode - call inode_read ; read inode of the dir to be searched - - call bmap_setup ; prepare counters to walk the file - jr dir_search_loope - -dir_search_loop: - push hl ; h = count of entries in current block - call bmap_block ; get de = block no. of current block - ; and increment the block position - ld a,e - or d - jr z,bad_dir_block - - ld hl,block - push hl - call block_read - pop hl - pop bc ; b = count of entries in current block - -dir_search_entry_loop: - push hl - inc hl - inc hl - - ld de,(dir_name) - ld c,DIRNAMELEN - -dir_search_compare_loop: - ld a,(de) - cp (hl) - jr nz,dir_search_compare_bad - or a - jr z,dir_search_compare_good - - inc hl - inc de - dec c - jr nz,dir_search_compare_loop - -dir_search_compare_good: - pop hl - ld e,(hl) - inc hl - ld d,(hl) - ret - -dir_search_compare_bad: - pop hl - ld de,SIZEOF_DIRECT_T - add hl,de - djnz dir_search_entry_loop - -dir_search_loope: - call bmap_remain ; get hl = valid bytes in current block - ; and decrement the file size remaining - add hl,hl - add hl,hl - add hl,hl - add hl,hl ; assumes SIZEOF_DIRECT_T = 16!! - - ld a,h ; a = valid bytes / SIZEOF_DIRECT_T - or a - jr nz,dir_search_loop - - ret - -bad_dir_block: - call gmess - defb 'hole in directory',0dh,0ah,0 - jp reboot_plain - -; ----------------------------------------------------------------------------- - -bmap_setup: - ld hl,(inode+8) - ld (size_remain),hl - ld hl,(inode+10) - ld (size_remain+2),hl - - ld hl,inode+24 - ld (direct_ptr),hl - ld hl,indirect_block+BUFSIZE - ld (indirect_ptr),hl - ld hl,dindirect_block+BUFSIZE - ld (dindirect_ptr),hl - ret - -bmap_remain: - ld hl,(size_remain) - ld de,(size_remain+2) - - ld bc,BUFSIZE - or a - sbc hl,bc - ex de,hl - ld b,0 ; ld bc,0 - sbc hl,bc - ex de,hl - jr c,bmap_remain_final - - ld (size_remain),hl - ld (size_remain+2),de - - ld hl,BUFSIZE - ret ; return a complete block of size hl - -bmap_remain_final: - ld hl,(size_remain) - ld (size_remain),bc ; 0 - ;ld (size_remain+2),bc ; 0 - ret ; return a partial block of size hl - -bmap_block: - ld hl,(direct_ptr) - ld de,inode+24+DIRECTBLOCKS*2 - or a - sbc hl,de - jr nc,bmap_indirect - - ld hl,(direct_ptr) - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld (direct_ptr),hl - ret - -bmap_indirect: - ld hl,(indirect_ptr) - ld de,indirect_block+BUFSIZE - or a - sbc hl,de - jr c,bmap_indirect_already - - ld hl,(direct_ptr) - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld (direct_ptr),hl - - ld hl,indirect_block - ld (indirect_ptr),hl - call block_read - -bmap_indirect_already: - ld hl,(direct_ptr) - ld de,inode+24+DIRECTBLOCKS*2+INDIRECTBLOCKS*2+1 ; fudge! - or a - sbc hl,de - jr nc,bmap_dindirect - - ld hl,(indirect_ptr) - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld (indirect_ptr),hl - ret - -bmap_dindirect: - ld hl,(dindirect_ptr) - ld de,dindirect_block+BUFSIZE - or a - sbc hl,de - jr c,bmap_dindirect_already - - ld hl,(indirect_ptr) - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld (indirect_ptr),hl - - ld hl,dindirect_block - ld (dindirect_ptr),hl - call block_read - -bmap_dindirect_already: - ld hl,(dindirect_ptr) - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld (dindirect_ptr),hl - ret - -; ----------------------------------------------------------------------------- -; enter with hl -> buffer, de = inode number - -inode_read: - push hl - - ld a,e - and DINODESPERBLOCK-1 ; find inode position within disk block - - ld b,DINODESPERBLOCKLOG ; shift count to find which disk block -inode_shift: - srl d - rr e - djnz inode_shift ; leaves de = block (relative to itab) - - ld hl,(isize) - scf - sbc hl,de ; check if block is beyond end of table - jr c,bad_inode - - ld hl,(reserv) - add hl,de - ex de,hl ; adjust block for start of inode table - - ld hl,block - push af - push hl - call block_read - pop hl - pop de ; d = inode position within block - - ld bc,SIZEOF_DINODE_T - ld e,c - mlt de - add hl,de - pop de ; de -> user's buffer for disk inode - ldir ; copy it, freeing up block buffer - ret - -bad_inode: - call gmess - defb 'bad inode: ',0 - add a,'0' - call abyte - call amess - defb ', ',0 - ex de,hl - jp reboot_ahexw - -; ----------------------------------------------------------------------------- -; enter with hl -> buffer, de = block number - -block_read: - push hl - call block_xlate ; a:hl -> data in ramdrive - - push hl - pop iy - ld d,a ; d:iy -> data in ramdrive - - pop hl - ld e,3 ; e:hl -> user's buffer in seg 3: - jp copyr ; copy BUFSIZE bytes from d:iy to e:hl - -block_write: - push hl - call block_xlate ; a:hl -> data in ramdrive - - pop iy - ld d,3 ; d:iy -> user's buffer in seg 3: - - ld e,a ; e:hl -> data in ramdrive - jp copyr ; copy BUFSIZE bytes from d:iy to e:hl - -block_xlate: - ld hl,HD0_SIZE - scf - sbc hl,de ; check whether block no is in range - jr c,bad_block - - ld bc,BUFSIZE ; bytes to be copied for 1 block - - ld hl,HD0_START - add hl,de ; hl = block index (from start of ram) - - ld a,h - ld h,l - ld l,c ;0 ; a:hl = block index * 100h - - add hl,hl - adc a,a ; a:hl = block index * BUFSIZE (200h!!) - ret - -block_to_bbr: - ld a,(hl) - inc hl - ld d,(hl) ; d:a = block no. from start of disk - inc hl - - srl d - rra - srl d - rra - srl d - rra ; a = block / 8 (PAGE_BLOCKS = 8!!) - - add a,HD0_START/PAGE_BLOCKS-4 - ret - -bad_block: - call gmess - defb 'bad block: ',0 - ex de,hl - jp reboot_ahexw - -; ----------------------------------------------------------------------------- - -initial_boot: - ld hl,UZINAM - call LDFILE ; copy entire KERNEL.BIN data to c:0000 - ret z ; halt if the file could not be found - - call gmess - defb 'loading A:KERNEL.BIN',0dh,0ah,0 - - ld a,'1' - ld (argument_1+7),a ; so kernel will use /dev/hd1 as root - -loop: ld de,(LDMAX) - or a - sbc hl,de ; did we load an entire extent? - jr nz,done ; no, assume the file is fully loaded - - add hl,de ; restore hl = LDMAX - ld (LDPTR),hl ; load from where we finished last time - - ld a,l - or h ; did we wrap around to a new segment? - jr nz,cont - - ld hl,LDSEG - inc (hl) ; yes, need to advance segment counter - -cont: ld hl,4000h - add hl,de - ld (LDMAX),hl ; advance LDMAX to load 4000h bytes - - ld hl,LDEXT - inc (hl) ; advance extent counter to next extent - - ld hl,UZINAM - call LDFILE ; copy more CMX.BIN data to LDSEG:LDPTR - jr nz,loop - - .if 1 ; virtual memory - ld hl,LDEXT - dec (hl) ; account for extent that wasn't found - .endif - -done: - .if 1 ; virtual memory - call virtual_init ; modifies CBR (can't call EPROM now) - - ld a,(LDEXT) - ld b,a ; how many extents were loaded ? (-1) - - ld hl,8080h ; initial spot in virt memory table - ld a,0c0h ; bbr value to access 2nd loaded page - -virtual_loop: - ld (hl),a ; map 16kbytes into virt memory space - inc hl - add a,4 - djnz virtual_loop - .else - call rsel1 ; select RAM for segments 0: and 1: - - ld a,80h - out0 (CBAR),a ; CA0 = 0k, bank area = 32k, CA1 = 32k - .endif - - ld a,0c0h-4 ; bbr value to access 1st loaded page - jp kazumi - -; ----------------------------------------------------------------------------- - -$ diag.inc -$ copyr.inc -$ clears.inc - -; ----------------------------------------------------------------------------- - -parameters: defw 2 ; argc - defw arguments-parameters_end ; argv - defw environment-parameters_end ; envp -arguments: defw argument_0-parameters_end - defw argument_1-parameters_end - defw 0 ; terminates the argument list -argument_0: defb '/boot/kernel.bin',0 -argument_1: defb 'root=hd0',0 -environment: defw environment_0-parameters_end - defw 0 ; termninates the environment list -environment_0: defb 'SN=00000',0 -parameters_end: ; this will equal address 0 after parameters are copied - -name_boot: defb 'boot',0 -name_kernel_bin: defb 'kernel.bin',0 - - ; note: defb 1 is very important here, because if UZINAM ends - ; up on a 32 byte boundary, the KERNEL.BIN filename (extent 0) - ; may be seen by the initial_boot routine, preventing the - ; proper loading of /boot/kernel after formatting the ramdrive -UZINAM: defb 1,'KERNEL BIN' ; LDNAM -LDEXT: defb 0 ; LDEXT -LDSEG: defb 0ch ; LDSEG -LDPTR: defw 0 ; LDPTR -LDMAX: defw 4000h ; LDMAX - -; ----------------------------------------------------------------------------- - -final: ; initialised code and data ends here - -reserv: -isize equ reserv+2 -fsize equ isize+2 - -dir_name equ fsize+2 -size_remain equ dir_name+2 - -direct_ptr equ size_remain+4 -indirect_ptr equ direct_ptr+2 -dindirect_ptr equ indirect_ptr+2 - -inode equ dindirect_ptr+2 -block equ inode+SIZEOF_DINODE_T - -indirect_block equ block+BUFSIZE -dindirect_block equ indirect_block+BUFSIZE - -region_ptr equ dindirect_block+BUFSIZE -region_list equ region_ptr+2 - -; ----------------------------------------------------------------------------- - - END diff --git a/src/gboot/gboot.map b/src/gboot/gboot.map deleted file mode 100644 index 9e67d797..00000000 --- a/src/gboot/gboot.map +++ /dev/null @@ -1,39 +0,0 @@ -Hexadecimal [32-Bits] - -Area Addr Size Decimal Bytes (Attributes) --------------------- ---- ---- ------- ----- ------------ -. .ABS. 00000000 00000000 = 0. bytes (ABS,OVR) - - Value Global Value Global Value Global - ----- ------ ----- ------ ----- ------ - 00000000 e__DEFAUL | 00000000 l__DEFAUL | 00000000 s__DEFAUL - 00000000 s_RCODE | 00000000 .__.ABS. | 00000728 e_RCODE - 00000728 l_RCODE -Hexadecimal [32-Bits] - -Area Addr Size Decimal Bytes (Attributes) --------------------- ---- ---- ------- ----- ------------ -_DEFAULT 00000000 00000000 = 0. bytes (REL,CON) - - Value Global Value Global Value Global - ----- ------ ----- ------ ----- ------ -Hexadecimal [32-Bits] - -Area Addr Size Decimal Bytes (Attributes) --------------------- ---- ---- ------- ----- ------------ -RCODE 00000000 00000728 = 1832. bytes (REL,CON) - - Value Global Value Global Value Global - ----- ------ ----- ------ ----- ------ - 0000059E abyte | 000005AB acrlf | 000005B4 ahexw - 000005B9 ahexb | 000005C2 ahexn | 000005CC amess - 000005DB copyr | 000006A3 clears - -Files Linked [ module(s) ] - -gboot [ ] - - -User Base Address Definitions - -_DEFAULT=0 diff --git a/src/gboot/gboot.rel b/src/gboot/gboot.rel deleted file mode 100644 index b7dfd70d..00000000 --- a/src/gboot/gboot.rel +++ /dev/null @@ -1,651 +0,0 @@ -XL4 -H 2 areas 9 global symbols -S .__.ABS. Def00000000 -A _DEFAULT size 0 flags 0 -A RCODE size 728 flags 0 -S ahexb Def000005B9 -S acrlf Def000005AB -S ahexn Def000005C2 -S abyte Def0000059E -S amess Def000005CC -S ahexw Def000005B4 -S copyr Def000005DB -S clears Def000006A3 -T 00 00 00 00 58 58 58 58 59 59 4D 4D 44 44 48 -R 00 00 01 00 -T 0B 00 00 00 48 4D 4D 53 53 31 00 80 CD -R 00 00 01 00 -T 14 00 00 00 A3 06 00 00 CD AB 05 00 00 CD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 1A 00 00 00 FD 04 00 00 18 22 00 00 00 42 4F -R 00 00 01 00 00 04 01 00 -T 23 00 00 00 4F 54 20 20 20 20 42 49 4E 00 00 -R 00 00 01 00 -T 2E 00 00 00 00 0F 00 01 00 00 00 00 00 00 00 -R 00 00 01 00 -T 39 00 00 00 00 00 00 00 00 00 00 -R 00 00 01 00 -T 40 00 00 00 -R 00 00 01 00 -T 40 00 00 00 CD D2 01 00 00 6C 6F 61 64 69 6E -R 00 00 01 00 00 05 01 00 -T 49 00 00 00 67 20 2F 62 6F 6F 74 2F 6B 65 72 -R 00 00 01 00 -T 54 00 00 00 6E 65 6C 2E 62 69 6E 0D 0A 00 CD -R 00 00 01 00 -T 5F 00 00 00 2C 02 00 00 11 04 00 21 -R 00 00 01 00 00 04 01 00 -T 65 00 00 00 7A 07 00 00 CD AB 04 00 00 2A -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 6B 00 00 00 7A 07 00 00 11 C6 31 B7 ED 52 C2 -R 00 00 01 00 00 04 01 00 -T 74 00 00 00 79 01 00 00 2A 7C 07 00 00 22 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 7A 00 00 00 28 07 00 00 2A 7E 07 00 00 22 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 80 00 00 00 2A 07 00 00 2A 80 07 00 00 22 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 86 00 00 00 2C 07 00 00 11 01 00 21 -R 00 00 01 00 00 04 01 00 -T 8C 00 00 00 06 07 00 00 CD 70 02 00 00 20 7B -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 93 00 00 00 21 0B 07 00 00 CD 70 02 00 00 20 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 9A 00 00 00 73 CD 99 03 00 00 21 94 0D 00 00 -R 00 00 01 00 00 06 01 00 00 0B 01 00 -T A1 00 00 00 01 14 00 CD 22 03 00 00 38 7B CD -R 00 00 01 00 00 08 01 00 -T AA 00 00 00 40 01 00 00 CD 5D 01 00 00 3E F8 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T B1 00 00 00 ED 39 38 CD 51 02 00 00 21 00 80 -R 00 00 01 00 00 08 01 00 -T BA 00 00 00 CD 22 03 00 00 3E FC ED 39 38 CD -R 00 00 01 00 00 05 01 00 -T C3 00 00 00 59 02 00 00 EB CD 22 03 00 00 CD -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T CA 00 00 00 62 02 00 00 D4 3F 02 00 00 CD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T D0 00 00 00 99 02 00 00 CD 0C 02 00 00 01 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T D6 00 00 00 80 80 21 AA 0D 00 00 18 06 -R 00 00 01 00 00 07 01 00 -T DD 00 00 00 -R 00 00 01 00 -T DD 00 00 00 19 CD DA 04 00 00 02 03 -R 00 00 01 00 00 06 01 00 -T E3 00 00 00 -R 00 00 01 00 -T E3 00 00 00 ED 5B A8 0D 00 00 B7 ED 52 38 F1 -R 00 00 01 00 00 06 01 00 -T EC 00 00 00 -R 00 00 01 00 -T EC 00 00 00 31 CD FF 21 D3 06 00 00 11 CD FF -R 00 00 01 00 00 08 01 00 -T F5 00 00 00 01 33 00 ED B0 21 3A 01 00 00 ED -R 00 00 01 00 00 0A 01 00 -T FE 00 00 00 5B A4 0D 00 00 D5 0E 06 ED B0 2A -R 00 00 01 00 00 05 01 00 -T 07 01 00 00 A0 0D 00 00 ED 5B A6 0D 00 00 C9 -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 0E 01 00 00 -R 00 00 01 00 -T 0E 01 00 00 CD D2 01 00 00 66 69 6C 65 20 6E -R 00 00 01 00 00 05 01 00 -T 17 01 00 00 6F 74 20 66 6F 75 6E 64 0D 0A 00 -R 00 00 01 00 -T 22 01 00 00 18 6B -R 00 00 01 00 -T 24 01 00 00 -R 00 00 01 00 -T 24 01 00 00 CD D2 01 00 00 66 69 6C 65 20 74 -R 00 00 01 00 00 05 01 00 -T 2D 01 00 00 6F 6F 20 73 68 6F 72 74 0D 0A 00 -R 00 00 01 00 -T 38 01 00 00 18 55 -R 00 00 01 00 -T 3A 01 00 00 -R 00 00 01 00 -T 3A 01 00 00 3E 84 ED 39 3A E9 -R 00 00 01 00 -T 40 01 00 00 -R 00 00 01 00 -T 40 01 00 00 -R 00 00 01 00 -T 40 01 00 00 2A 94 0D 00 00 11 C9 A6 B7 ED 52 -R 00 00 01 00 00 05 01 00 -T 49 01 00 00 C8 CD D2 01 00 00 62 61 64 20 65 -R 00 00 01 00 00 06 01 00 -T 52 01 00 00 5F 6D 61 67 69 63 3A 20 00 18 2B -R 00 00 01 00 -T 5D 01 00 00 -R 00 00 01 00 -T 5D 01 00 00 2A 96 0D 00 00 11 03 00 B7 ED 52 -R 00 00 01 00 00 05 01 00 -T 66 01 00 00 C8 CD D2 01 00 00 62 61 64 20 65 -R 00 00 01 00 00 06 01 00 -T 6F 01 00 00 5F 66 6F 72 6D 61 74 3A 20 00 -R 00 00 01 00 -T 79 01 00 00 -R 00 00 01 00 -T 79 01 00 00 CD D2 01 00 00 62 61 64 20 6D 61 -R 00 00 01 00 00 05 01 00 -T 82 01 00 00 67 69 63 3A 20 00 -R 00 00 01 00 -T 88 01 00 00 -R 00 00 01 00 -T 88 01 00 00 19 -R 00 00 01 00 -T 89 01 00 00 -R 00 00 01 00 -T 89 01 00 00 CD B4 05 00 00 -R 00 00 01 00 00 05 01 00 -T 8C 01 00 00 -R 00 00 01 00 -T 8C 01 00 00 CD AB 05 00 00 -R 00 00 01 00 00 05 01 00 -T 8F 01 00 00 -R 00 00 01 00 -T 8F 01 00 00 CD D2 01 00 00 64 6F 69 6E 67 20 -R 00 00 01 00 00 05 01 00 -T 98 01 00 00 61 20 63 6C 65 61 6E 20 62 6F 6F -R 00 00 01 00 -T A3 01 00 00 74 0D 0A 00 21 7A 07 00 00 11 -R 00 00 01 00 00 09 01 00 -T AB 01 00 00 7B 07 00 00 01 FF 01 36 AA ED B0 -R 00 00 01 00 00 04 01 00 -T B4 01 00 00 11 00 00 06 04 -R 00 00 01 00 -T B9 01 00 00 -R 00 00 01 00 -T B9 01 00 00 C5 D5 21 7A 07 00 00 CD -R 00 00 01 00 00 07 01 00 -T BF 01 00 00 B9 04 00 00 D1 C1 13 10 F3 3E AA -R 00 00 01 00 00 04 01 00 -T C8 01 00 00 ED 39 0B 3E 13 ED 39 0A 18 FE CD -R 00 00 01 00 -T D3 01 00 00 CC 05 00 00 67 62 6F 6F 74 3A 20 -R 00 00 01 00 00 04 01 00 -T DC 01 00 00 00 C3 CC 05 00 00 -R 00 00 01 00 00 06 01 00 -T E0 01 00 00 -R 00 00 01 00 -T E0 01 00 00 11 02 00 CD 00 02 00 00 3E 81 ED -R 00 00 01 00 00 08 01 00 -T E9 01 00 00 39 0B 3E 13 ED 39 0A 97 3D 20 FD -R 00 00 01 00 -T F4 01 00 00 3D 20 FD 3D 20 FD 3D 20 FD 11 -R 00 00 01 00 -T FE 01 00 00 00 02 -R 00 00 01 00 -T 00 02 00 00 -R 00 00 01 00 -T 00 02 00 00 21 81 FC E5 FD E1 01 05 00 C3 -R 00 00 01 00 -T 0A 02 00 00 DB 05 00 00 -R 00 00 01 00 00 04 01 00 -T 0C 02 00 00 -R 00 00 01 00 -T 0C 02 00 00 CD D2 01 00 00 73 74 61 72 74 69 -R 00 00 01 00 00 05 01 00 -T 15 02 00 00 6E 67 20 6F 70 65 72 61 74 69 6E -R 00 00 01 00 -T 20 02 00 00 67 20 73 79 73 74 65 6D 0D 0A 00 -R 00 00 01 00 -T 2B 02 00 00 C9 -R 00 00 01 00 -T 2C 02 00 00 -R 00 00 01 00 -T 2C 02 00 00 CD E0 01 00 00 3E 80 ED 39 3A 3E -R 00 00 01 00 00 05 01 00 -T 35 02 00 00 FC ED 39 38 11 01 80 01 FF 00 -R 00 00 01 00 -T 3F 02 00 00 -R 00 00 01 00 -T 3F 02 00 00 6B 62 2B 36 00 79 B0 C8 ED B0 C9 -R 00 00 01 00 -T 4A 02 00 00 -R 00 00 01 00 -T 4A 02 00 00 B7 ED 52 D0 19 EB C9 -R 00 00 01 00 -T 51 02 00 00 -R 00 00 01 00 -T 51 02 00 00 2A 9C 0D 00 00 11 14 00 18 11 -R 00 00 01 00 00 05 01 00 -T 59 02 00 00 -R 00 00 01 00 -T 59 02 00 00 2A A2 0D 00 00 ED 5B 9E 0D 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T 60 02 00 00 18 08 -R 00 00 01 00 -T 62 02 00 00 -R 00 00 01 00 -T 62 02 00 00 2A A6 0D 00 00 ED 5B A2 0D 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T 69 02 00 00 13 -R 00 00 01 00 -T 6A 02 00 00 -R 00 00 01 00 -T 6A 02 00 00 B7 ED 52 4D 44 C9 -R 00 00 01 00 -T 70 02 00 00 -R 00 00 01 00 -T 70 02 00 00 22 2E 07 00 00 CD 99 03 00 00 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 76 02 00 00 -R 00 00 01 00 -T 76 02 00 00 01 10 00 21 7A 0D 00 00 CD -R 00 00 01 00 00 08 01 00 -T 7D 02 00 00 22 03 00 00 D8 23 ED 5B -R 00 00 01 00 00 04 01 00 -T 83 02 00 00 2E 07 00 00 06 0E -R 00 00 01 00 00 04 01 00 -T 87 02 00 00 -R 00 00 01 00 -T 87 02 00 00 23 1A BE 20 EA B7 28 05 13 10 F5 -R 00 00 01 00 -T 92 02 00 00 1A B7 -R 00 00 01 00 -T 94 02 00 00 -R 00 00 01 00 -T 94 02 00 00 ED 5B 7A 0D 00 00 C9 -R 00 00 01 00 00 06 01 00 -T 99 02 00 00 -R 00 00 01 00 -T 99 02 00 00 21 AA 0D 00 00 22 A8 0D 00 00 CD -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T A0 02 00 00 A5 03 00 00 CD C4 03 00 00 7D B4 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T A7 02 00 00 28 3E -R 00 00 01 00 -T A9 02 00 00 -R 00 00 01 00 -T A9 02 00 00 CD EC 03 00 00 7B B2 28 49 7B E6 -R 00 00 01 00 00 05 01 00 -T B2 02 00 00 07 20 59 2A A8 0D 00 00 73 23 72 -R 00 00 01 00 00 08 01 00 -T BB 02 00 00 23 22 A8 0D 00 00 06 1F -R 00 00 01 00 00 06 01 00 -T C1 02 00 00 -R 00 00 01 00 -T C1 02 00 00 C5 D5 CD C4 03 00 00 7D B4 28 1A -R 00 00 01 00 00 07 01 00 -T CA 02 00 00 CD EC 03 00 00 7B B2 28 28 EB D1 -R 00 00 01 00 00 05 01 00 -T D3 02 00 00 13 B7 ED 52 20 35 C1 10 E5 CD -R 00 00 01 00 -T DD 02 00 00 C4 03 00 00 7D B4 20 C6 C9 -R 00 00 01 00 00 04 01 00 -T E4 02 00 00 -R 00 00 01 00 -T E4 02 00 00 E1 E1 C9 -R 00 00 01 00 -T E7 02 00 00 -R 00 00 01 00 -T E7 02 00 00 CD D2 01 00 00 6E 75 6C 6C 20 66 -R 00 00 01 00 00 05 01 00 -T F0 02 00 00 69 6C 65 0D 0A 00 C3 8F 01 00 00 -R 00 00 01 00 00 0B 01 00 -T F9 02 00 00 -R 00 00 01 00 -T F9 02 00 00 CD D2 01 00 00 68 6F 6C 65 20 69 -R 00 00 01 00 00 05 01 00 -T 02 03 00 00 6E 20 66 69 6C 65 0D 0A 00 C3 -R 00 00 01 00 -T 0C 03 00 00 8F 01 00 00 -R 00 00 01 00 00 04 01 00 -T 0E 03 00 00 -R 00 00 01 00 -T 0E 03 00 00 CD D2 01 00 00 6E 6F 74 20 61 6C -R 00 00 01 00 00 05 01 00 -T 17 03 00 00 69 67 6E 65 64 0D 0A 00 C3 -R 00 00 01 00 -T 20 03 00 00 8F 01 00 00 -R 00 00 01 00 00 04 01 00 -T 22 03 00 00 -R 00 00 01 00 -T 22 03 00 00 E5 C5 ED 43 8E 0D 00 00 22 -R 00 00 01 00 00 08 01 00 -T 29 03 00 00 90 0D 00 00 21 00 00 22 -R 00 00 01 00 00 04 01 00 -T 2F 03 00 00 92 0D 00 00 2A 8A 0D 00 00 7D B4 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 36 03 00 00 20 1A -R 00 00 01 00 -T 38 03 00 00 -R 00 00 01 00 -T 38 03 00 00 CD C4 03 00 00 7D B4 28 4F 22 -R 00 00 01 00 00 05 01 00 -T 40 03 00 00 8A 0D 00 00 CD EC 03 00 00 7B B2 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 47 03 00 00 28 B0 21 7A 07 00 00 22 -R 00 00 01 00 00 07 01 00 -T 4D 03 00 00 8C 0D 00 00 CD AB 04 00 00 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 52 03 00 00 -R 00 00 01 00 -T 52 03 00 00 2A 8A 0D 00 00 ED 5B 8E 0D 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T 59 03 00 00 CD 4A 02 00 00 2A 8A 0D 00 00 B7 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 60 03 00 00 ED 52 22 8A 0D 00 00 2A -R 00 00 01 00 00 07 01 00 -T 66 03 00 00 8E 0D 00 00 B7 ED 52 22 -R 00 00 01 00 00 04 01 00 -T 6C 03 00 00 8E 0D 00 00 2A 92 0D 00 00 19 22 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 73 03 00 00 92 0D 00 00 4B 42 ED 5B -R 00 00 01 00 00 04 01 00 -T 79 03 00 00 90 0D 00 00 2A 8C 0D 00 00 ED B0 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 80 03 00 00 22 8C 0D 00 00 ED 53 90 0D 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T 87 03 00 00 2A 8E 0D 00 00 7D B4 20 AA -R 00 00 01 00 00 05 01 00 -T 8E 03 00 00 -R 00 00 01 00 -T 8E 03 00 00 2A 92 0D 00 00 4D 44 D1 B7 ED 52 -R 00 00 01 00 00 05 01 00 -T 97 03 00 00 E1 C9 -R 00 00 01 00 -T 99 03 00 00 -R 00 00 01 00 -T 99 03 00 00 21 3A 07 00 00 CD 5F 04 00 00 21 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T A0 03 00 00 00 00 22 8A 0D 00 00 -R 00 00 01 00 00 07 01 00 -T A5 03 00 00 -R 00 00 01 00 -T A5 03 00 00 2A 42 07 00 00 22 30 07 00 00 2A -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T AC 03 00 00 44 07 00 00 22 32 07 00 00 21 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T B2 03 00 00 52 07 00 00 22 34 07 00 00 21 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T B8 03 00 00 7A 0B 00 00 22 36 07 00 00 21 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T BE 03 00 00 7A 0D 00 00 22 38 07 00 00 C9 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T C4 03 00 00 -R 00 00 01 00 -T C4 03 00 00 2A 30 07 00 00 ED 5B 32 07 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T CB 03 00 00 01 00 02 B7 ED 42 EB 06 00 ED 42 -R 00 00 01 00 -T D6 03 00 00 EB 38 0B 22 30 07 00 00 ED 53 -R 00 00 01 00 00 08 01 00 -T DE 03 00 00 32 07 00 00 21 00 02 C9 -R 00 00 01 00 00 04 01 00 -T E4 03 00 00 -R 00 00 01 00 -T E4 03 00 00 2A 30 07 00 00 ED 43 30 07 00 00 -R 00 00 01 00 00 05 01 00 00 0B 01 00 -T EB 03 00 00 C9 -R 00 00 01 00 -T EC 03 00 00 -R 00 00 01 00 -T EC 03 00 00 2A 34 07 00 00 11 76 07 00 00 B7 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T F3 03 00 00 ED 52 30 0B 2A 34 07 00 00 5E 23 -R 00 00 01 00 00 09 01 00 -T FC 03 00 00 56 23 22 34 07 00 00 C9 -R 00 00 01 00 00 07 01 00 -T 02 04 00 00 -R 00 00 01 00 -T 02 04 00 00 2A 36 07 00 00 11 7A 0B 00 00 B7 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 09 04 00 00 ED 52 38 13 2A 34 07 00 00 5E 23 -R 00 00 01 00 00 09 01 00 -T 12 04 00 00 56 23 22 34 07 00 00 21 -R 00 00 01 00 00 07 01 00 -T 18 04 00 00 7A 09 00 00 22 36 07 00 00 CD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 1E 04 00 00 AB 04 00 00 -R 00 00 01 00 00 04 01 00 -T 20 04 00 00 -R 00 00 01 00 -T 20 04 00 00 2A 34 07 00 00 11 79 07 00 00 B7 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 27 04 00 00 ED 52 30 0B 2A 36 07 00 00 5E 23 -R 00 00 01 00 00 09 01 00 -T 30 04 00 00 56 23 22 36 07 00 00 C9 -R 00 00 01 00 00 07 01 00 -T 36 04 00 00 -R 00 00 01 00 -T 36 04 00 00 2A 38 07 00 00 11 7A 0D 00 00 B7 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 3D 04 00 00 ED 52 38 13 2A 36 07 00 00 5E 23 -R 00 00 01 00 00 09 01 00 -T 46 04 00 00 56 23 22 36 07 00 00 21 -R 00 00 01 00 00 07 01 00 -T 4C 04 00 00 7A 0B 00 00 22 38 07 00 00 CD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 52 04 00 00 AB 04 00 00 -R 00 00 01 00 00 04 01 00 -T 54 04 00 00 -R 00 00 01 00 -T 54 04 00 00 2A 38 07 00 00 5E 23 56 23 22 -R 00 00 01 00 00 05 01 00 -T 5C 04 00 00 38 07 00 00 C9 -R 00 00 01 00 00 04 01 00 -T 5F 04 00 00 -R 00 00 01 00 -T 5F 04 00 00 E5 7B E6 07 06 03 -R 00 00 01 00 -T 65 04 00 00 -R 00 00 01 00 -T 65 04 00 00 CB 3A CB 1B 10 FA 2A 2A 07 00 00 -R 00 00 01 00 00 0B 01 00 -T 6E 04 00 00 37 ED 52 38 1A 2A 28 07 00 00 19 -R 00 00 01 00 00 0A 01 00 -T 77 04 00 00 EB 21 7A 07 00 00 F5 E5 CD -R 00 00 01 00 00 06 01 00 -T 7E 04 00 00 AB 04 00 00 E1 D1 01 40 00 59 ED -R 00 00 01 00 00 04 01 00 -T 87 04 00 00 5C 19 D1 ED B0 C9 -R 00 00 01 00 -T 8D 04 00 00 -R 00 00 01 00 -T 8D 04 00 00 CD D2 01 00 00 62 61 64 20 69 6E -R 00 00 01 00 00 05 01 00 -T 96 04 00 00 6F 64 65 3A 20 00 C6 30 CD -R 00 00 01 00 -T 9F 04 00 00 9E 05 00 00 CD CC 05 00 00 2C 20 -R 00 00 01 00 00 04 01 00 00 09 01 00 -T A6 04 00 00 00 EB C3 89 01 00 00 -R 00 00 01 00 00 07 01 00 -T AB 04 00 00 -R 00 00 01 00 -T AB 04 00 00 E5 CD C5 04 00 00 E5 FD E1 57 E1 -R 00 00 01 00 00 06 01 00 -T B4 04 00 00 1E 03 C3 DB 05 00 00 -R 00 00 01 00 00 07 01 00 -T B9 04 00 00 -R 00 00 01 00 -T B9 04 00 00 E5 CD C5 04 00 00 FD E1 16 03 5F -R 00 00 01 00 00 06 01 00 -T C2 04 00 00 C3 DB 05 00 00 -R 00 00 01 00 00 05 01 00 -T C5 04 00 00 -R 00 00 01 00 -T C5 04 00 00 21 00 06 37 ED 52 38 1D 01 00 02 -R 00 00 01 00 -T D0 04 00 00 21 00 02 19 7C 65 69 29 8F C9 -R 00 00 01 00 -T DA 04 00 00 -R 00 00 01 00 -T DA 04 00 00 7E 23 56 23 CB 3A 1F CB 3A 1F CB -R 00 00 01 00 -T E5 04 00 00 3A 1F C6 3C C9 -R 00 00 01 00 -T EA 04 00 00 -R 00 00 01 00 -T EA 04 00 00 CD D2 01 00 00 62 61 64 20 62 6C -R 00 00 01 00 00 05 01 00 -T F3 04 00 00 6F 63 6B 3A 20 00 EB C3 -R 00 00 01 00 -T FB 04 00 00 89 01 00 00 -R 00 00 01 00 00 04 01 00 -T FD 04 00 00 -R 00 00 01 00 -T FD 04 00 00 21 16 07 00 00 CD 37 F0 C8 CD -R 00 00 01 00 00 05 01 00 -T 05 05 00 00 D2 01 00 00 6C 6F 61 64 69 6E 67 -R 00 00 01 00 00 04 01 00 -T 0E 05 00 00 20 41 3A 4B 45 52 4E 45 4C 2E 42 -R 00 00 01 00 -T 19 05 00 00 49 4E 0D 0A 00 3E 31 32 -R 00 00 01 00 -T 21 05 00 00 F7 06 00 00 ED 5B 26 07 00 00 B7 -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 28 05 00 00 ED 52 20 23 19 22 24 07 00 00 7D -R 00 00 01 00 00 0A 01 00 -T 31 05 00 00 B4 20 04 21 23 07 00 00 34 21 -R 00 00 01 00 00 08 01 00 -T 39 05 00 00 00 40 19 22 26 07 00 00 21 -R 00 00 01 00 00 08 01 00 -T 40 05 00 00 22 07 00 00 34 21 16 07 00 00 CD -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 47 05 00 00 37 F0 20 D8 21 22 07 00 00 35 -R 00 00 01 00 00 09 01 00 -T 4F 05 00 00 -R 00 00 01 00 -T 4F 05 00 00 CD 2C 02 00 00 FD 21 00 00 21 -R 00 00 01 00 00 05 01 00 -T 57 05 00 00 94 0D 00 00 11 03 0C 01 14 00 CD -R 00 00 01 00 00 04 01 00 -T 60 05 00 00 DB 05 00 00 CD 40 01 00 00 CD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 66 05 00 00 5D 01 00 00 CD 51 02 00 00 D5 FD -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 6D 05 00 00 E1 11 00 0C 6B 63 CD DB 05 00 00 -R 00 00 01 00 00 0B 01 00 -T 76 05 00 00 D5 CD 59 02 00 00 21 00 C0 19 D1 -R 00 00 01 00 00 06 01 00 -T 7F 05 00 00 CD DB 05 00 00 CD 62 02 00 00 D4 -R 00 00 01 00 00 05 01 00 00 0A 01 00 -T 86 05 00 00 3F 02 00 00 CD 0C 02 00 00 3A -R 00 00 01 00 00 04 01 00 00 09 01 00 -T 8C 05 00 00 22 07 00 00 3C 47 21 80 80 3E BC -R 00 00 01 00 00 04 01 00 -T 95 05 00 00 -R 00 00 01 00 -T 95 05 00 00 77 23 C6 04 10 FA C3 EC 00 00 00 -R 00 00 01 00 00 0B 01 00 -T 9E 05 00 00 -R 00 00 01 00 -T 9E 05 00 00 F5 ED 38 05 E6 02 28 F9 F1 ED 39 -R 00 00 01 00 -T A9 05 00 00 07 C9 -R 00 00 01 00 -T AB 05 00 00 -R 00 00 01 00 -T AB 05 00 00 3E 0D CD 9E 05 00 00 3E 0A 18 EA -R 00 00 01 00 00 07 01 00 -T B4 05 00 00 -R 00 00 01 00 -T B4 05 00 00 7C CD B9 05 00 00 7D -R 00 00 01 00 00 06 01 00 -T B9 05 00 00 -R 00 00 01 00 -T B9 05 00 00 F5 0F 0F 0F 0F CD C2 05 00 00 F1 -R 00 00 01 00 00 0A 01 00 -T C2 05 00 00 -R 00 00 01 00 -T C2 05 00 00 E6 0F C6 90 27 CE 40 27 18 D2 -R 00 00 01 00 -T CC 05 00 00 -R 00 00 01 00 -T CC 05 00 00 E3 F5 7E 23 B7 28 05 CD -R 00 00 01 00 -T D4 05 00 00 9E 05 00 00 18 F6 F1 E3 C9 -R 00 00 01 00 00 04 01 00 -T DB 05 00 00 -R 00 00 01 00 -T DB 05 00 00 7B FE 04 D2 59 06 00 00 79 E6 1F -R 00 00 01 00 00 08 01 00 -T E4 05 00 00 C5 4F 06 00 CD 2B 06 00 00 0C 0D -R 00 00 01 00 00 09 01 00 -T ED 05 00 00 28 11 ED 38 30 EE 50 ED 39 30 FD -R 00 00 01 00 -T F8 05 00 00 09 DC 55 06 00 00 09 DC -R 00 00 01 00 00 06 01 00 -T FE 05 00 00 57 06 00 00 -R 00 00 01 00 00 04 01 00 -T 00 06 00 00 -R 00 00 01 00 -T 00 06 00 00 C1 3E 05 CB 38 CB 19 3D 20 F9 18 -R 00 00 01 00 -T 0B 06 00 00 1A C5 01 20 00 ED 09 26 ED 38 30 -R 00 00 01 00 -T 16 06 00 00 EE 50 ED 39 30 FD 09 DC -R 00 00 01 00 -T 1E 06 00 00 55 06 00 00 09 DC 57 06 00 00 C1 -R 00 00 01 00 00 04 01 00 00 0A 01 00 -T 25 06 00 00 0B 78 B1 20 E2 C9 -R 00 00 01 00 -T 2B 06 00 00 -R 00 00 01 00 -T 2B 06 00 00 ED 09 26 ED 01 27 18 05 3E 01 ED -R 00 00 01 00 -T 36 06 00 00 39 26 E5 FD E5 ED 29 23 ED 21 24 -R 00 00 01 00 -T 41 06 00 00 ED 19 25 E1 ED 29 20 ED 21 21 ED -R 00 00 01 00 -T 4C 06 00 00 11 22 E1 3E 02 ED 39 31 C9 14 C9 -R 00 00 01 00 -T 57 06 00 00 1C C9 C5 AF ED 39 26 ED 39 27 3E -R 00 00 01 00 -T 62 06 00 00 04 CB 38 CB 19 3D 20 F9 78 B1 28 -R 00 00 01 00 -T 6D 06 00 00 0D C5 01 10 00 CD 83 06 00 00 C1 -R 00 00 01 00 00 0A 01 00 -T 76 06 00 00 0B 78 B1 20 F3 C1 47 79 E6 0F 28 -R 00 00 01 00 -T 81 06 00 00 20 4F ED 30 26 CC 33 06 00 00 FD -R 00 00 01 00 00 0A 01 00 -T 8A 06 00 00 09 DC 55 06 00 00 09 DC -R 00 00 01 00 00 06 01 00 -T 90 06 00 00 57 06 00 00 41 0E 01 ED 38 30 EE -R 00 00 01 00 00 04 01 00 -T 99 06 00 00 50 ED 39 30 ED 09 26 10 F8 -R 00 00 01 00 -T A2 06 00 00 -R 00 00 01 00 -T A2 06 00 00 C9 -R 00 00 01 00 -T A3 06 00 00 -R 00 00 01 00 -T A3 06 00 00 3E 74 ED 39 00 ED 39 01 3E 22 ED -R 00 00 01 00 -T AE 06 00 00 39 02 ED 39 03 97 ED 39 04 ED 39 -R 00 00 01 00 -T B9 06 00 00 05 ED 30 08 ED 30 09 ED 39 27 ED -R 00 00 01 00 -T C4 06 00 00 39 2F ED 39 29 ED 39 2A ED 39 2B -R 00 00 01 00 -T CF 06 00 00 ED 39 2C C9 02 00 D3 FF F3 FF -R 00 00 01 00 -T D9 06 00 00 D9 FF EA FF 00 00 2F 62 6F 6F 74 -R 00 00 01 00 -T E4 06 00 00 2F 6B 65 72 6E 65 6C 2E 62 69 6E -R 00 00 01 00 -T EF 06 00 00 00 72 6F 6F 74 3D 68 64 30 00 -R 00 00 01 00 -T F9 06 00 00 F7 FF 00 00 53 4E 3D 30 30 30 30 -R 00 00 01 00 -T 04 07 00 00 30 00 -R 00 00 01 00 -T 06 07 00 00 -R 00 00 01 00 -T 06 07 00 00 62 6F 6F 74 00 6B 65 72 6E 65 6C -R 00 00 01 00 -T 11 07 00 00 2E 62 69 6E 00 01 4B 45 52 4E 45 -R 00 00 01 00 -T 1C 07 00 00 4C 20 20 42 49 4E 00 0C 00 00 -R 00 00 01 00 -T 26 07 00 00 00 40 -R 00 00 01 00 -T 28 07 00 00 -R 00 00 01 00 -T 28 07 00 00 -R 00 00 01 00 diff --git a/src/gboot/n.bat b/src/gboot/n.bat index 2a922e15..a9e801e6 100644 --- a/src/gboot/n.bat +++ b/src/gboot/n.bat @@ -1,25 +1,8 @@ -as-z80 -l -o gboot -@if errorlevel 1 goto failure -link-z80 -f gboot -@if errorlevel 1 goto failure - -ihex2bin gboot.i86 ..\..\bin\boot.bin -4dos /c crcd ..\..\bin\boot.bin -bin2c ..\..\bin\boot.bin ..\fsutil\boot.c - -copy checksum.dat \nlddl -copy checksum.dat \nlddl\crc.dat -copy ..\..\bin\boot.bin \nlddl -set country=NLD -crc -copy \nlddl\checksum ..\..\bin - -copy \nlddl\checksum \\darkstar\public\dos622\nlddl -copy \nlddl\boot.bin \\darkstar\public\dos622\nlddl - -@echo SUCCESS -@goto done -:failure -@echo FAILURE -:done +md build +cd build +copy ..\gboot.lnk +copy ..\uzboot.lnk +copy ..\build.ban n.bat +call n +cd .. diff --git a/src/gboot/uzboot.asm b/src/gboot/uzboot.asm new file mode 100644 index 00000000..99c710f6 --- /dev/null +++ b/src/gboot/uzboot.asm @@ -0,0 +1,67 @@ +; uzboot.asm by Nick, based on c0k.asm for UZI180 (creates a kernel executable) + +; ----------------------------------------------------------------------------- + +$ io64180.inc + +E_MAGIC equ 0a6c9h +E_FORMAT_KERNEL equ 3 +E_STACK_SIZE equ 1000h + +; ----------------------------------------------------------------------------- + + module _uzboot + + extern init + + extern e_RCODE ; e_hsize + extern s_ICODE ; e_idata + extern s_UDATA0 ; e_udata + extern s_CSTACK ; e_stack + extern e_CSTACK ; e_break + +; ----------------------------------------------------------------------------- +; forward definitions of segments, to set the linkage order (c0k must be first) + + rseg RCODE + rseg ICODE +; rseg TEMP +; rseg DATA0 +; rseg WCSTR + rseg CONST + rseg CSTR + rseg IDATA0(NUL) + rseg CDATA0 + rseg ECSTR(NUL) + rseg CCSTR + rseg CODE(NUL) ; needs to be at end for banked model + rseg UDATA0 + rseg CSTACK + +; ----------------------------------------------------------------------------- + + rseg _DEFAULT ; means header is discarded at loading + + defw E_MAGIC ; e_magic + defw E_FORMAT_KERNEL ; e_format + defd 12345678h ; e_size + defw e_RCODE+14h ; e_hsize (14h = l__DEFAULT) + defw s_ICODE ; e_idata + defw init ; e_entry + defw s_UDATA0 ; e_udata + defw s_CSTACK ; e_stack + defw e_CSTACK ; e_break + +; ----------------------------------------------------------------------------- + +$ diag.inc ; this will select RCODE segment +$ copyr.inc ; this will select RCODE segment + +; ----------------------------------------------------------------------------- + + rseg CSTACK + defs E_STACK_SIZE ; the default stack size is set here + +; ----------------------------------------------------------------------------- + + END diff --git a/src/gboot/uzboot.lnk b/src/gboot/uzboot.lnk new file mode 100644 index 00000000..6fc150b2 --- /dev/null +++ b/src/gboot/uzboot.lnk @@ -0,0 +1,12 @@ +-m +-u +-i +-o uzboot +-bl RCODE=0 +-bl ICODE=0x8100 +-bl CODE=0x804000,0x10000 +-bc CODE=0x4000 +uzboot +uzfile +uzmain +uzdata diff --git a/src/gboot/uzdata.asm b/src/gboot/uzdata.asm new file mode 100644 index 00000000..7f4bac37 --- /dev/null +++ b/src/gboot/uzdata.asm @@ -0,0 +1,22 @@ +; uzdata.asm by Nick, gunzipper, stub program providing label to access zdata + +; ----------------------------------------------------------------------------- + +$ io64180.inc + +; ----------------------------------------------------------------------------- + + module _uzdata + + public zdata + + rseg CODE + +; ----------------------------------------------------------------------------- + +zdata:: + ; the actual data is provided by concatenating it to the executable + +; ----------------------------------------------------------------------------- + + END diff --git a/src/gboot/uzfile.asm b/src/gboot/uzfile.asm new file mode 100644 index 00000000..16c12e9c --- /dev/null +++ b/src/gboot/uzfile.asm @@ -0,0 +1,1255 @@ +; uzfile.asm by Nick, gunzipper, based on zipfile.inc from Hytech EPROM 5.529+ + +; ----------------------------------------------------------------------------- + +$ io64180.inc + + module _uzfile + + public uzfgo + public gzhbuf + public gztbuf + extern abyte + extern ahexb + extern ahexw + extern acrlf + extern bomb + extern copyr + extern uzmess + + rseg RCODE + +; ----------------------------------------------------------------------------- + +bad_format: + call uzmess + db 'not in gzip format',0dh,0ah,0 + jp bomb + +uzfgo: ; file is deflated, inflate + ;in0 d,(BBR) + ;push de + + ;ld e,0 + ;call winehl ; e:hl -> input data + ;push hl + ;pop iy + ;out0 (BBR),e ; BBR:iy -> input data + + ld (outptr),hl + ld hl,outseg + ld (hl),e ; save absolute address -> output buffer for calls to copyr + + ld hl,virtbr + ld (hl),d ; save virtual base address to use when incrementing virtbr:ix + push iy + pop ix ; now reading the input data from (ix) instead of (iy) + + ld l,d + ld h,80h + ld a,(hl) ; translate BBR value via virtual memory table for actual use + out0 (BBR),a ; prepare to read the input data directly from (ix) + + sub a ; inflation_routine + ld (lblock),a ; last block flag + ld (dbits),a ; dead bits in low dbuf + call nxtix ; initialise dbuf + + ld iy,gzhbuf + ld b,10 + call pread + + ld hl,(gzhbuf) + ld de,8b1fh + or a + sbc hl,de ; ensure magic number is gzip + jr nz,bad_format + + ld hl,(gzhbuf+2) + ld de,8 + or a + sbc hl,de ; ensure compression method = 8 and no header options are present + jr nz,bad_format + + ld iy,outbuf ; non-repeated data will be stored temporarily at (iy) + +uzf0: ld a,(lblock) + dec a + .if 0 + jp z,uzfret + .else + jr z,uzfret ; inflate_done + .endif + + .if 0 + call acrlf + + ld a,(virtbr) + call ahexb + ld a,':' + call abyte + push ix + pop hl + call ahexw + + ld a,'=' + call abyte + + extern zdata + ld hl,LWRD zdata+10 + ld a,BYTE3 zdata+10 + add hl,hl + add hl,hl + rra + rr h + rr l + rra + rr h + rr l + ex de,hl + ld c,a ; c:de -> absolute start of compressed data + + push ix + pop hl + ld a,(virtbr) + add hl,hl + add hl,hl + rra + rr h + rr l + rra + rr h + rr l ; a:hl -> absolute position in compressed data + + or a + sbc hl,de + sbc a,c ; a:hl = absolute offset within compressed data + call ahexb + call ahexw + + ld a,' ' + call abyte + ld a,16 + ld hl,dbits + sub (hl) + call ahexb + ld a,' ' + call abyte + call peek + ld a,c + and 7 + call ahexb + call acrlf + .endif + + ld a,1 + call bits ; get_bit + ld (lblock),a + + call tbl ; read_tables + ;jr nz,uzfret ; bad table + +uzf1: + .if 0 + ld a,'a' + call abyte + .endif + + ;ld bc,wdog ; rwdog + ;in0 (c) + + ld hl,plit ; lit_parse_table + ld de,llit ; lit_bitlen_table + call parse ; returns de = item + dec d + .if 0 + jp z,uzf2 + .else + jr z,uzf2 + .endif + + ld (iy),e + inc iy + .if 0 + ld a,e + call ahexb + call acrlf + .endif + .if 0 + ld a,'b' + call abyte + .endif + + .if 1 + ld hl,plit ; lit_parse_table + ld de,llit ; lit_bitlen_table + call parse ; returns de = item + dec d + jr z,uzf2 + + ld (iy),e + inc iy + .if 0 + ld a,e + call ahexb + call acrlf + .endif + .if 0 + ld a,'c' + call abyte + .endif + + ld hl,plit ; lit_parse_table + ld de,llit ; lit_bitlen_table + call parse ; returns de = item + dec d + jr z,uzf2 + + ld (iy),e + inc iy + .if 0 + ld a,e + call ahexb + call acrlf + .endif + .if 0 + ld a,'d' + call abyte + .endif + + ld hl,plit ; lit_parse_table + ld de,llit ; lit_bitlen_table + call parse ; returns de = item + dec d + jr z,uzf2 + + ld (iy),e + inc iy + .if 0 + ld a,e + call ahexb + call acrlf + .endif + .if 0 + ld a,'e' + call abyte + .endif + + push iy + pop hl + ld de,outbuf+100h + or a + sbc hl,de + jr c,uzf1 ; output buffer still has room + .if 0 + ld a,'f' + call abyte + .endif + + inc h ; hl now = iy - outbuf (byte count) + call oflsh + .endif + jr uzf1 + +uzfret: ; enter with z = success, nz = failure + .if 0 + ld a,'g' + call abyte + .endif + + ;ld bc,(zdbuf+16h) ; uncompressed size, if success + ;pop de + ;out0 (BBR),d + push iy + pop hl + ld de,outbuf + or a + sbc hl,de + call nz,oflsh ; leaves outptr/seg valid for possible checking by our caller + + ld iy,gztbuf + ld b,8 + call pread ; retrieve crc/size, our caller is responsible for checking them + + ld hl,outseg + ld e,(hl) + ld hl,(outptr) ; so our caller can calculate the actual decompressed size + ret + +uzf2: + .if 0 + ld a,'h' + call abyte + .endif + + ld a,e + or a + .if 1 + jp z,uzf0 + .else + jr z,uzf0 ; new_table + .endif + + ex de,hl ; hl = basic length code + + cp 9 + jr c,uzf4 ; length 3-10 = hl+2, no extra bits + cp 1dh + jr c,uzf3 ; length 11-258, 1-5 extra bits + + ld hl,258 ; length 258 = hl, no extra bits + jr uzf5 + +uzf3: sub 5 ; a = 4-17h extra bits/4 + rrca + rrca + and 7 + ld b,a ; b = 1-5 extra bits + + ld a,l + dec a ; no need to sub 5 + and 3 ; 4 possible lengths for current b + or 4 + ld l,a ; hl = 4-7 for algorithm + + ld a,b + add hl,hl ; hl = base length, value 0-0e0h + djnz $-1 + + ex de,hl + call bitsb ; hl = 1-5 extra bits, value 0-1fh + add hl,de ; hl = 8-0ffh for lengths 11-258 + + inc hl +uzf4: inc hl + inc hl +uzf5: push hl + .if 0 + ld a,'i' + call abyte + .endif + + ld hl,pdist ; dist_parse_table + ld de,ldist ; dist_bitlen_table + call parse ; returns de = item + + ;ld a,e + ex de,hl + ld a,l + cp 4 + jr c,uzf6 ; de = distance 0-3, no extra bits + + ;ex de,hl ; hl = basic distance code + + rrca + and 0fh + dec a + ld b,a ; b = 1-0bh extra bits + + ld a,l + and 1 ; 2 possible distances for current b + or 2 + ld l,a ; hl = 2-3 for algorithm + + ld a,b + add hl,hl ; hl = base distance, value 0-6000h + djnz $-1 + + ex de,hl + call bitsw ; hl = 0-0bh extra bits, value 0-1fffh + add hl,de ; de = distance 4-7fffh + + ;ex de,hl +uzf6: ;inc de ; real distance + inc hl + push hl + .if 0 + ld a,'j' + call abyte + .endif + + push iy + pop hl + ld de,outbuf + sub a ;or a + sbc hl,de ; got anything in output buffer? + ld c,l + ld b,h ; zf, bc indicate how many bytes waiting + + ld iy,outbuf-4000h + ld d,a ;ld d,0 + + ld hl,outseg + ld e,(hl) + ld hl,(outptr) + + call nz,copyr ; flush anything still in output buffer + .if 0 + ld a,'k' + call abyte + .endif + + ;push iy + ;pop hl + ;push hl + ;or a + ;sbc hl,de + ;pop de + ;pop bc + ;ldir + ;push de + ;pop iy + ; e:hl = output location + ; can't use outptr/seg until e:hl has been saved back + .if 0 + ex (sp),hl + call ahexw + ex (sp),hl + ld a,',' + call abyte + .endif + pop bc ; bc = distance code + push hl + or a + sbc hl,bc ; go backwards as specified by distance code + ex (sp),hl ; restore e:hl = output location + pop iy + ld a,e + sbc a,0 + ld d,a ; d:iy = output location - distance code + + .if 0 + ex (sp),hl + call ahexw + ex (sp),hl + call acrlf + .endif + pop bc ; bc = length code + call copyr ; append bc bytes from d:iy to output buffer + + ld (outptr),hl + ld hl,outseg + ld (hl),e + + ld iy,outbuf ; restart output buffer + + .if 0 + ld a,(zfprog) + or a + jp z,uzf1 ; skip progress callouts if disabled + + push ix + pop hl + in0 a,(BBR) + rlca + rlca + rlca + rlca + add a,h ; minor absehl + call uzprog ; a = index = source address / 100h + .endif + jp uzf1 + +; ----------------------------------------------------------------------------- + +tbl: ld a,2 + call bits ; get_bits + dec a ; 1 = default tables + jr nz,tbldyn + + ld hl,llit ; lit_bitlen_table + ld de,llit+1 ; lit_bitlen_table+1 + ld bc,90h + ld (hl),8 + ldir ; 90h * bit length 8 + ld c,70h + ld (hl),9 + ldir ; 70h * bit length 9 + ld c,18h + ld (hl),7 + ldir ; 18h * bit length 7 + ld c,8-1 + ld (hl),8 ; 8 * bit length 8 + ldir + + ld hl,ldist ; dist_bitlen_table + ld de,ldist+1 + ld bc,20h-1 + ld (hl),5 + ldir ; 20h * bit length 5 + + ld hl,120h + ld (nlit),hl ; num_lit_codes = 120h + dec h + ld (ndist),hl ; num_dist_codes = 20h + jp tblmak ; make_parse_tables + +tbldyn: dec a ; 2 = dynamic tables + ;ret nz ; else bad table + jp nz,bad_block + + ld a,5 + call bitsb ; get_bits + ld bc,101h + add hl,bc + ld (nlit),hl ; num_lit_codes + + ld a,5 + call bitsb + inc hl + ld (ndist),hl ; num_dist_codes + + ld hl,ltbl ; bitlen_bitlens + ld bc,13h + call zfill ; initialise bitlen bitlen table + + ld a,4 + call bits ; get_bits + add a,4 + ld b,a ; count of bitlen bitlens + ld de,lxlat ; bitlen_order +tbl0: push bc + + ld a,(de) + inc de + ld c,a + ld b,0 + ld hl,ltbl ; bitlen_bitlens + add hl,bc + + ld a,3 + call bits ; get_bits + ld (hl),a + + pop bc + djnz tbl0 + + ld bc,13h + ld de,ltbl ; bitlen_bitlens + ld hl,ptbl ; bitlen_parse_table + call make ; make_parse_table + + ld de,llit ; lit_bitlen_table + ld hl,(nlit) ; num_lit_codes + ld bc,(ndist) ; num_dist_codes + add hl,bc + add hl,de + ld (lend),hl ; termination loop counter +tbl1: ex de,hl + push hl + + ld hl,ptbl ; bitlen_parse_table + ld de,ltbl ; bitlen_bitlens + call parse + + ld a,e + cp 10h + jr c,tbl5 ; single bitlen + jr z,tbl4 ; 10h = repeated bitlen * 3-6 + cp 11h + jr z,tbl2 ; 11h = repeated zeros * 3-10 + + ld a,7 ; 12h = repeated zeros * 11-138 + call bits ; get_bits + add a,11 + jr tbl3 + +tbl2: ld a,3 ; 11h = repeated zeros * 3-10 + call bits ; get_bits + add a,3 +tbl3: ld c,a + + pop hl + call zfill + jr tbl6 + +tbl4: ld a,2 ; 10h = repeated bitlen * 3-6 + call bits ; get_bits + add a,3 + ld c,a + + pop hl + dec hl + call hlfill + jr tbl6 + +tbl5: pop hl + ld (hl),e ; single bitlen + +tbl6: inc hl + ld e,l + ld d,h + + ld bc,(lend) ; termination loop counter + or a + sbc hl,bc + jr c,tbl1 + + ld bc,(ndist) + ld hl,ldist-1 + add hl,bc + ex de,hl + ld hl,(lend) + dec hl + lddr ; move dist_bitlen_table to proper spot + +tblmak: ld bc,(nlit) ; num_lit_codes + ld de,llit ; lit_bitlen_table + ld hl,plit ; lit_parse_table + lit_parse_tree + call make ; make_parse_table + + ld bc,(ndist) ; num_dist_codes + ld de,ldist ; dist_bitlen_table + ld hl,pdist ; dist_parse_table + dist_parse_tree + ;call make + ;ret + +; call with: +; bc = items +; de -> bitlen table, 1 byte per item +; hl -> parse table, 100h words +; parse tree is at hl+200h + +make: ld a,c + or b + ret z + + ld (nmake),bc ; count of items + ld (lmake),de ; pointer to bitlen table + ld (pmake),hl ; pointer to parse table + tree + + ; scan entries counting each bit length 0-15 to lcount + + ld hl,lcount ; bitlen_counts + ld bc,10h*2 + call zfill + + ld de,(lmake) ; pointer to bitlen table + ld bc,(nmake) ; count of items +make0: push bc + + ld a,(de) + inc de + + ld c,a + ld b,0 + ld hl,lcount ; bitlen_counts + add hl,bc + add hl,bc + inc (hl) + jr nz,$+4 + inc hl + inc (hl) + + pop bc + dec bc + ld a,c + or b + jr nz,make0 + + ; assign each bit length 1-15 a starting code to cmake + + ld de,0 + ld bc,2 +make1: push bc + + ld hl,cmake ; current_codes + add hl,bc + ld (hl),e + inc hl + ld (hl),d + + ld hl,lcount ; bitlen_counts + add hl,bc + ld c,(hl) + inc hl + ld b,(hl) + + ex de,hl + add hl,bc + add hl,hl + ex de,hl + + pop bc + inc c + inc c + ld a,c + cp 20h + jr c,make1 + + ld a,e + or d + jr z,make15 + + ; table is not full, allowed if sum lcount <= 1 + + ld hl,lcount+2 ; ignore bit length 0 + ld de,0 + ld a,15 ; bit lengths 1-15 +make14: ld c,(hl) + inc hl + ld b,(hl) + inc hl + ex de,hl + add hl,bc + ex de,hl + dec a + jr nz,make14 + ld hl,1 + or a + sbc hl,de + ;ret c ; bad table if 1 < sum lcount + jp c,bad_table + +make15: ; scan entries assigning codes to hmake from cmake + + ld de,(lmake) ; pointer to bitlen table + ld bc,(nmake) ; count of items + ld hl,hmake ; huffman_table +make2: push bc + + ld a,(de) + inc de + or a + ld bc,0 + jr z,make3 + + push hl + ld c,a + ld hl,cmake ; current_codes + add hl,bc + add hl,bc + + ld c,(hl) + inc (hl) + inc hl + ld b,(hl) + jr nz,$+3 + inc (hl) + pop hl + +make3: ld (hl),c + inc hl + ld (hl),b + inc hl + + pop bc + dec bc + ld a,c + or b + jr nz,make2 + + ; scan entries bit reversing each code in hmake + + ld de,(lmake) ; pointer to bitlen table + ld bc,(nmake) ; count of items + ld hl,hmake ; huffman_table +make4: push bc + + ld a,(de) + inc de + + push de + push hl + + ld e,(hl) + inc hl + ld d,(hl) + + or a + jr z,make6 + + ld hl,0 + ld b,a +make5: rr d + rr e + adc hl,hl + djnz make5 + ex de,hl + +make6: pop hl + ld (hl),e + inc hl + ld (hl),d + inc hl + pop de + + pop bc + dec bc + ld a,c + or b + jr nz,make4 + + ; construct parse table and tree + + ld hl,(pmake) ; pointer to parse table + tree + ld bc,100h*2 + call zfill + inc hl + ld (trptr),hl ; tree ptr + + ld de,0 ; index to lmake +make7: ld hl,hmake + add hl,de + add hl,de + ld c,(hl) + inc hl + ld b,(hl) + + ld hl,(lmake) ; pointer to bitlen table + add hl,de + ld a,(hl) + or a + jr z,make13 + cp 9 + jr nc,make10 + + ld b,a + ld hl,1 +make8: add hl,hl + djnz make8 ; b = 0 for <= 8 bit huffman code + ld (pinc),hl ; parse table increment + +make9: ld hl,(pmake) ; pointer to parse table + tree + add hl,bc + add hl,bc ; huffman code + + ld (hl),e + inc hl + ld (hl),d + + ld hl,(pinc) ; parse table increment + add hl,bc + ld c,l + ld b,h + + ld a,b + or a + jr z,make9 + jr make13 + +make10: push de + push af + + ld a,b + ld b,0 + ld hl,(pmake) ; pointer to parse table + tree + add hl,bc + add hl,bc ; huffman code, lo 8 bits + ld c,a ; huffman code, hi 8 bits + + pop af + sub 8 + ld b,a + +make11: ld e,(hl) + inc hl + ld d,(hl) + + ld a,e + or d + jr nz,make12 ; existing branch + + ld de,(trptr) ; tree ptr + ld (hl),d + dec hl + ld (hl),e + + push de +; rept 4 +; ld (de),a +; inc de +; endm + ld (de),a + inc de + ld (de),a + inc de + ld (de),a + inc de + ld (de),a + inc de + ld (trptr),de ; tree ptr + pop de + +make12: ex de,hl + + rr c + jr nc,$+4 + inc hl + inc hl + + djnz make11 + + pop de + ld (hl),e + inc hl + ld (hl),d + +make13: inc de + + ld hl,(nmake) + or a + sbc hl,de + jr nz,make7 + + ret ; z for caller of tbl + +bad_block: + call uzmess + db 'invalid table type',0dh,0ah,0 + jp bomb + +bad_table: + call uzmess + db 'file has bad table',0dh,0ah,0 + jp bomb + +; ----------------------------------------------------------------------------- +; enter with: +; a = bits to read (1-10h) + +; returns: +; de = preserved +; hl = value + +bitsw: cp 9 + jr c,bitsb + + sub 8 + ld h,a ; h = eventual bits in h + call peek + .if 0 + inc ix ; shortcut to flush 8 bits + .else + call nxtix + .endif + ld l,c ; l = bits 0-7 of result + + ld a,h + call bits + ld h,a ; h = bits 8-n of result + ret ; result in hl + +bitsb: call bits + ld l,a + ld h,b ; 0 + ret + +; enter with: +; a = bits to read (1-8) + +; returns: +; de = preserved +; a = value + +bits: push hl + ld l,a + call peek + call flush + ld a,c + ld c,l + ld hl,bmask-1 + add hl,bc + and (hl) + pop hl + ret ; result in hl and a + +; ----------------------------------------------------------------------------- +; enter with: +; hl -> parse table +; de -> bitlen table + +; returns: +; de = next item from input + +parse: call peek ; a = index for parse table lookup + add hl,bc + add hl,bc + ld a,(hl) + inc hl + ld h,(hl) + ld l,a ; hl = parse table entry + ex de,hl ; de = parse table entry, hl -> bitlens + + .if 0 + bit 4,d + .else + bit 7,d + .endif + jr z,parse2 ; parse from table + ; parse from tree + .if 0 + inc ix ; shortcut to flush 8 bits + .else + call nxtix + .endif + call peek ; c = bit buffer for tree lookup + + ld a,(dbits) + +parse0: rr c + jr nc,$+4 + inc de + inc de + + inc a + cp 8 ; dbits = 8? + jr c,parse1 ; no, bit buffer ok + + .if 0 + inc ix ; shortcut to flush 8 bits + ld c,(ix) ; refresh bit buffer + .else + call nxtix + ld a,(dbuf) + ld c,a + .endif + + sub a ; new byte, no dead bits + +parse1: ex de,hl + ld e,(hl) + inc hl + ld d,(hl) + + .if 0 + bit 4,d + .else + bit 7,d + .endif + jr nz,parse0 + + ld (dbits),a + ret + +parse2: add hl,de + ld l,(hl) ; l = bitlen table entry + ;call flush + ;ret + +; enter with: +; l = bits to kill +; BBR:ix -> input data +; dbuf = 8 bits from input +; dbits = dead bits 0-7 + +; returns: +; bc = preserved +; de = preserved +; hl = preserved +; BBR:ix = advanced +; dbuf = updated +; dbits = advanced + +flush: ld a,(dbits) + add a,l + ld (dbits),a + sub 8 + ret c + ld (dbits),a + +nxtix: ld a,(ix) + ld (dbuf),a + ;push bc + ;ld bc,1 + ;add ix,bc + ;pop bc + ;ret nc ; still in same window + inc ix + push ix + ex (sp),hl + bit 7,h + pop hl + ret z ; still in same window (ix < 8000h) + + .if 0 + ld a,(zfprog) + or a ; progress callouts enabled? + jr z,skprog ; skip if not + + in0 a,(BBR) + push af + push bc + push de + push hl + push iy + + add a,0fh+1 + rlca + rlca + rlca + rlca ; convert window to segment + ld h,a + ld l,0 ; absolute 0:hl -> new source data + call uzprog ; call boot1 + + pop iy + pop hl + pop de + pop bc + pop af + jr dnprog + .endif + +skprog: ;in0 a,(BBR) +dnprog: ;inc a + push hl + ld hl,virtbr + inc (hl) + ld l,(hl) + ld h,80h + ld a,(hl) ; translate BBR value via virtual memory table for actual use + pop hl + out0 (BBR),a ; wrapped into new window + + ;ld ix,0f000h ; BBR:ix -> new source data + ld ix,4000h + ret + +; ----------------------------------------------------------------------------- + +; enter with: +; BBR:ix -> input data +; dbuf = 8 bits from input +; dbits = dead bits 0-7 + +; returns: +; bc = next 8 bits (b = 0) +; de = preserved +; hl = preserved + +peek: ld bc,(dbuf) ; b = dbits + ld a,b + or a + ret z + ld a,(ix) +peeklp: rra + rr c + djnz peeklp + ret + +; ----------------------------------------------------------------------------- + +zfill: sub a +afill: ld (hl),a + dec bc +hlfill: ld e,l + ld d,h + inc de + ldir + ret + +; ----------------------------------------------------------------------------- + +pread: ; plain_read + ld hl,dbits + ld a,(hl) ; see if we were already byte aligned + or a + jr z,preade + ld (hl),0 ; no, we need to flush up to 7 bits + +preadl: call nxtix ; refresh bit buffer, then advance ix +preade: ld a,(dbuf) ; enter here with a valid bit buffer + + ld (iy),a ; save in output (no shifting needed) + inc iy + + djnz preadl ; copy up to 100h bytes + jp nxtix ; refresh bit buffer for our caller + +oflsh: ; output_flush + ld c,l + ld b,h ; bc now = iy - outbuf (byte count) + + ld iy,outbuf-4000h ; because IDATA0 is phys 4000, log 8000 + ld d,0 + + ld hl,outseg + ld e,(hl) + ld hl,(outptr) + + call copyr ; flush output buffer to output + + ld (outptr),hl + ld hl,outseg + ld (hl),e + + ld iy,outbuf ; restart output buffer + ret + +; ----------------------------------------------------------------------------- + + rseg IDATA0 +bmask: defs 8 + rseg CDATA0 + defb 1,3,7,0fh,1fh,3fh,7fh,0ffh + + rseg IDATA0 +lxlat: defs 19 + rseg CDATA0 + defb 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 + +; ----------------------------------------------------------------------------- + + rseg UDATA0 + +; tbl data + +nlit: defs 2 ; num_lit_codes +ndist: defs 2 ; num_dist_codes +lend: defs 2 ; llit + nlit + ndist, loop terminator + +; make data + +nmake: defs 2 ; count of items +lmake: defs 2 ; pointer to bitlen table +pmake: defs 2 ; pointer to parse table + tree +trptr: defs 2 ; tree ptr +pinc: defs 2 ; parse table increment + +; peek + flush data + +; retain ordering % +dbuf: defs 1 +dbits: defs 1 ; dead bits in low dbuf +; % + +; uzfile data + +lblock: defs 1 ; last_block_flag + +virtbr: defs 1 ; virtual base register before xlat +gzhbuf: defs 10 ; gzip header (no extra fields allowed) +gztbuf: defs 8 ; gzip trailer (crc-32, orig size-32) + +outptr: defs 2 ; absolute output offset +outseg: defs 1 ; absolute output segment +outbuf: defs 103h ; minimises the need to call copyr + ; outbuf should be 100h, but we allow an extra 3 bytes, due to + ; the main loop for decompressing non-repeated data, which is + ; unrolled 4 times (we test against outbuf+100h every 4 chars) + +; buffers + +ltbl: defs 13h ; bitlen_bitlens +lcount: defs 10h*2 ; bitlen_counts +cmake: defs 10h*2 ; current_codes +hmake: defs 120h*2 ; huffman_table + +; llit must be followed by ldist because we unpack lit bitlens and +; dist bitlens together, then move dist bitlens to start at ldist + +; retain ordering % +llit: defs 120h ; lit_bitlen_table +ldist: defs 20h ; dist_bitlen_table +; % + +ptbl: defs 100h*2 ; bitlen_parse_table +plit: defs (100h+240h)*2 ; lit_parse_table + lit_parse_tree +pdist: defs (100h+40h)*2 ; dist_parse_table + dist_parse_tree + +;ztop: defs 1 ; must be < 0e000h + +; ----------------------------------------------------------------------------- + + \ No newline at end of file diff --git a/src/gboot/uzmain.asm b/src/gboot/uzmain.asm new file mode 100644 index 00000000..e5642f82 --- /dev/null +++ b/src/gboot/uzmain.asm @@ -0,0 +1,233 @@ +; uzmain.asm by Nick, gunzipper, main program and error handling routines + +; ----------------------------------------------------------------------------- + +$ io64180.inc + +BUFSIZE equ 200h ; how many bytes per disk block +BUFSIZELOG equ 9 ; shift count representing the above + +HD0_START equ 512 +HD0_SIZE equ 1536 + +; ----------------------------------------------------------------------------- + + module _uzmain + + public init + public bomb + public uzmess + extern abyte + extern ahexb + extern ahexw + extern acrlf + extern amess + extern copyr + extern uzfgo + extern gztbuf + extern zdata + + extern s_CODE + extern e_CODE + + rseg ICODE + +; ----------------------------------------------------------------------------- + +init:: +; now there are the next stack structure: +; +4 envp +; +2 argv +; sp-> +0 argc + + call uzmess + defb 'unzipping root filesystem',0dh,0ah,0 + + ld hl,0 + ld iy,LWRD zdata + defb 11h ; ld de, + defb 4 ; e:hl -> destination, absolute 4:0000 (CP/M A: and B:) + defb BYTE3 zdata ; d:iy -> source, virtual zdata (gzipped input) + + call uzfgo ; we return here only if successful + + ld a,e + sub 4 + ld e,a + ld d,0 ; de:hl = 32-bit actual size unpacked + .if 0 + push hl + ex de,hl + call ahexw + ex de,hl + call ahexw + ld a,' ' + call abyte + ld hl,(gztbuf+6) + call ahexw + ld hl,(gztbuf+4) + call ahexw + call acrlf + pop hl + .endif + + ld bc,(gztbuf+4) + or a + sbc hl,bc + jr nz,bad_size ; check low order 16 bits of size + + ld hl,(gztbuf+6) + ;or a + sbc hl,de + jr nz,bad_size ; check high order 16 bits of size + + .if 0 ; intentionally corrupt inode 20 so that fsck won't run + jr poox +poo: + defw 0c1h + defw 0c0h +poox: + ld iy,poo-4000h + ld hl,0f18h + ld de,4 + ld bc,poox-poo + call copyr + .endif + + .if 0 ; check for accidental corruption of inode 18 + ; dump block 7 + ld a,40h-4 + out0 (BBR),a + ld hl,4e00h + ld c,20h +dline: + ld b,10h +ditem: + ld a,(hl) + inc hl + call ahexb + ld a,' ' + call abyte + djnz ditem + call acrlf + dec c + jr nz,dline + .endif + + call uzmess + defb 'starting kernel via reboot',0dh,0ah,0 + + ld hl,0 + ; wait for last character to be sent @ 9600 +reboot_delay: + dec hl + ld a,l + or h + jr nz,reboot_delay + + jr success ; reboot and run ramdrive boot sector + +bad_size: + call uzmess + db 'bad uncompressed size',0dh,0ah,0 + ;jr bomb + +bomb:: + ; try not to surprise the user unnecessarily + call uzmess + defb 'doing a clean boot',0dh,0ah,0 + + ; before rebooting, prepare to clobber CP/M drive A: directory + ld hl,block + ld de,block+1 + ld bc,BUFSIZE-1 + ld (hl),0aah ; clobbering pattern + ldir ; initialise temporary buffer + + ; perform the clobbering (this ensures a clean boot from EPROM) + .if 1 + ld de,0 + ld b,4 +clobber_loop: + push bc + push de + + ld hl,block + call block_write + + pop de + pop bc + inc de + djnz clobber_loop + .else + ld de,304h + ld l,c + ld h,b ; ld hl,0 ; e:hl -> destination 4:0000 + + ld b,4 ; clobber until just before 4:0800 +clobber_loop: + push bc + + ld iy,block ; copy from d:iy -> destination + ld bc,BUFSIZE ; bytes to copy + call copyr ; copy them, one byte at a time + + pop bc + djnz clobber_loop + .endif + +success: + ; ready to reboot, by instructing the WPO chip on motherboard + ld a,0aah + out0 (TRDR),A ; command byte to reboot the system + ld a,13h + out0 (CNTR),A ; TE=1, divisor = 3, start transmission + + ; wait for the reboot to occur, or else we're rather stuck + jr $ + +block_write: + push hl + call block_xlate ; a:hl -> data in ramdrive + + pop iy + ld d,3 ; d:iy -> user's buffer in seg 3: + + ld e,a ; e:hl -> data in ramdrive + jp copyr ; copy BUFSIZE bytes from d:iy to e:hl + +block_xlate: + ;ld hl,HD0_SIZE + ;scf + ;sbc hl,de ; check whether block no is in range + ;jr c,bad_block + + ld bc,BUFSIZE ; bytes to be copied for 1 block + + ld hl,HD0_START + add hl,de ; hl = block index (from start of ram) + + ld a,h + ld h,l + ld l,c ;0 ; a:hl = block index * 100h + + add hl,hl + adc a,a ; a:hl = block index * BUFSIZE (200h!!) + ret + +; ----------------------------------------------------------------------------- + +uzmess:: + call amess + defb 'uzboot: ',0 + jp amess + +; ----------------------------------------------------------------------------- + + rseg UDATA0 + +block: defs BUFSIZE ; temporary buffer for clobbering disc + +; ----------------------------------------------------------------------------- + + END diff --git a/src/gui/0000.scr b/src/gui/0000.scr new file mode 100644 index 00000000..cea4476d Binary files /dev/null and b/src/gui/0000.scr differ diff --git a/src/gui/0001.scr b/src/gui/0001.scr new file mode 100644 index 00000000..a9efc69b Binary files /dev/null and b/src/gui/0001.scr differ diff --git a/src/gui/0001.tmp b/src/gui/0001.tmp new file mode 100644 index 00000000..e69de29b diff --git a/src/gui/0002.scr b/src/gui/0002.scr new file mode 100644 index 00000000..bb846eea Binary files /dev/null and b/src/gui/0002.scr differ diff --git a/src/gui/0003.scr b/src/gui/0003.scr new file mode 100644 index 00000000..43d8958e Binary files /dev/null and b/src/gui/0003.scr differ diff --git a/src/gui/0004.scr b/src/gui/0004.scr new file mode 100644 index 00000000..3f812b16 Binary files /dev/null and b/src/gui/0004.scr differ diff --git a/src/gui/Copy (2) of wnd.c b/src/gui/Copy (2) of wnd.c new file mode 100644 index 00000000..da577936 --- /dev/null +++ b/src/gui/Copy (2) of wnd.c @@ -0,0 +1,1138 @@ +/************************************************ + * Graphical User Interface driver (GUI) * + * By J.W. Morsink for Retail Vision B.V. * + ************************************************/ + +#include +#include "..\libc\malloc-l.h" +#undef NULL +#define NULL 0 + +/*void *malloc(size_t size) + { + void *ptr; + + ptr = (void *)sbrk(size); + return (ptr == (void *)-1) ? NULL : ptr; + } + +void free(void *ptr) + { + } + +*/ +#define JOOST_DEBUG +/*#define STR_DEBUG*/ +/*#define MALLOC_DEBUG + +/************************************************ + * Global variables for GUI * + ************************************************/ + +struct Global_GUI* global; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(){ + struct sgttyb temp; + char init[]={0x1B,'K'}; + + global->lcd=open("/dev/lcd0",O_RDWR); + gtty(global->lcd,&temp); + temp.sg_flags=RAW | UNBUFF; + stty(global->lcd,&temp); + + write(global->lcd,init,2); +} + +void GraphicsClose(){ + close(global->lcd); +} + +void Move(int x, int y){ + unsigned char cmd[]={0x1B,'S',0,0}; + cmd[2]=(unsigned char) (x); + cmd[3]=(unsigned char) (y); + write(global->lcd,cmd,4); +} + +void ClearRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'C',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void DrawRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'N',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'R',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'F',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void GrayRect(int sx,int sy){ + unsigned char cmd[]={0x1B,'h',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void Text(char *s){ + int c=strlen(s); + write(global->lcd,s,c); +} + +void TouchRegion(int msg, int x, int y, int sx, int sy){ + char touch[]={0x1B,'Z',0,0,0,0,0}; + touch[2]=(unsigned char) (msg); + touch[3]=(unsigned char) (x); + touch[4]=(unsigned char) (y); + touch[5]=(unsigned char) (sx); + touch[6]=(unsigned char) (sy); + write(global->lcd,touch,7); +#ifdef JOOST_DEBUG + printf("Touch: %x,%x,%x,%x,%x\n",msg,x,y,sx,sy); fflush(stdout); +#endif +} + +void ClearScreen(){ + Move(0,0); + ClearRect(0,0x80); + TouchRegion(0,0,0,0,0x80); +} + +void EnableScreen(unsigned char c){ + char cmd[]={0x1B,'E',0}; + cmd[2]=c; + write(global->lcd,cmd,3); +} + +void grSetFont(int f){ + char cmd[]={0x1B,0}; + cmd[1]=f & 0xff; + write(global->lcd,cmd,2); +} + +/************************************************ + * Fonts * + ************************************************/ + +struct Font* fontSearch(int f){ + struct Font* current=global->firstfont; + while(current!=NULL && current->id!=f) + current=current->nextfont; + return current; +} + +void setCurrentFont(int f){ + if(fontSearch(f)!=NULL){ + grSetFont(f); + global->currentfont=fontSearch(f); + } +} + +void loadFont(int id,int (*sw)(char*),int (*sh)(char*),int sizedata, void* data){ + struct Font* font=(struct Font*) malloc(sizeof(struct Font)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",font); fflush(stdout); +#endif + font->id=id; + font->stringwidth=sw; + font->stringheight=sh; + font->nextfont=NULL; + font->sizefontdata=sizedata; + font->fontdata=data; + if(global->firstfont==NULL){ + global->firstfont=font; + global->currentfont=font; + } + else + { + struct Font* current=global->firstfont; + while(current->nextfont!=NULL) + current=current->nextfont; + current->nextfont=font; + } +} + +int stringwidth(char *str,int extra){ + int w=0,i=0; + while(str[i]!=0x00){ + switch(str[i]){ + case 'i': + case 'I': + case '!': + w+=2; + break; + case 'l': + w+=3; + break; + case ',': + case '1': + case '.': + w+=4; + break; + case 'r': + case 'k': + case 'j': + w+=5; + break; + default: + w+=6; + } + i++; + w+=extra; + } + return w; +} + +int stringheight(char ch, int extra){ + if(ch<0x80) return 7+extra; + if(ch>=0xcc && ch<=0xdf) return 1+extra; +} + +int stringheight01(char* ch){ + return stringheight(ch[0],0); +} + +int stringheight2(char* ch){ + return stringheight(ch[0],5); +} + +int stringwidth0(char *str){ + return stringwidth(str,0); +} + +int stringwidth1(char *str){ + return stringwidth(str,2); +} + +int stringwidth2(char *str){ + return stringwidth(str,3); +} +/************************************************ + * Components * + ************************************************/ + +struct Component* Component_new(int x,int y,int sx,int sy){ + struct Component* this=(struct Component*) (malloc(sizeof(struct Component))); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",this); fflush(stdout); +#endif + + this->id=(++global->id); + this->x=x; + this->y=y; + this->sizex=sx; + this->sizey=sy; + this->state=0; + this->order=0; + this->font=0; + this->msg=0; + this->parent=NULL; + this->next_sibling=NULL; + this->first_child=NULL; + this->handler=NULL; + this->paint=NULL; + this->add=NULL; + this->sizexds=0; + this->xds=NULL; + this->label=NULL; + this->label2=NULL; + return this; +} + +void Component_setlabel(struct Component* this, char* s){ + int i=0; + while(s[i]!=0 && ilabel[i]=s[i]; + i++; + } + this->label[i]=0; +} + +void Component_add(struct Component* this, struct Component* comp){ + struct Component* current=this->first_child; + if(this->first_child==NULL){ + this->first_child=comp; + comp->next_sibling=NULL; + } + else + { + while(current->next_sibling!=NULL){ + current=current->next_sibling; + } + current->next_sibling=comp; + comp->next_sibling=NULL; + } + comp->parent=this; +} + +void Component_paint(struct Component* this){ + struct Component* current=this->first_child; + EnableScreen(0); + while(current!=NULL){ + current->paint(current); + current=current->next_sibling; + } + EnableScreen(1); +} + +void Component_findXY(struct Component* this, int* x, int* y){ + struct Component* current=this; + do{ + *x+=current->x; + *y+=current->y; + current=current->parent; + } while(current!=NULL); +} + +struct Component* Component_find(struct Component* this, int msg){ + struct Component* current=this->first_child; +#ifdef JOOST_DEBUG + printf("Find %x in %x:\n",msg, this->id); fflush(stdout); +#endif + while(current!=NULL){ +#ifdef JOOST_DEBUG + printf("Comp_find: %x, %x\n",msg, current->msg); fflush(stdout); +#endif + if(current->msg==msg) + return current; + current=current->next_sibling; + } + return NULL; +} + +struct Component* Component_delete(struct Component* this){ + struct Component* current=this->first_child; + int id=this->id; + if(this!=NULL){ +#ifdef JOOST_DEBUG + printf("Deleting component: %d\n",id); fflush(stdout); +#endif + while(current!=NULL){ + current=Component_delete(current); + } + if(this->parent!=NULL){ + if(this==this->parent->first_child) + this->parent->first_child=this->parent->first_child->next_sibling; + else{ + current=this->parent->first_child; + while(this!=current->next_sibling && current->next_sibling!=NULL) + current=current->next_sibling; + if(current->next_sibling!=NULL) + current->next_sibling=current->next_sibling->next_sibling; + } + } + current=this->next_sibling; + if(this->sizexds==sizeof(struct StringTableXDS)) + { + struct Component* par=this->parent; + struct StringTableXDS* stx=(struct StringTableXDS*) this->xds; + +#ifdef STR_DEBUG + printf("Stringtable @ %x freed!\n",stx->stringtabledata); fflush(stdout); +#endif + +#ifdef MALLOC_DEBUG + printf("free: %x\n",stx->stringtabledata); fflush(stdout); +#endif + free(stx->stringtabledata); +#ifdef MALLOC_DEBUG + printf("free: %x\n",stx->stringtable); fflush(stdout); +#endif + free(stx->stringtable); + + while((par!=NULL) && (par->sizexds!=sizeof(struct StringTableXDS))) + par=par->parent; + if(par!=NULL) + { + stx=(struct StringTableXDS*) par->xds; + global->stringtabledata=stx->stringtabledata; + global->stringtable=stx->stringtable; + } + } + if(this->sizexds>0){ +#ifdef MALLOC_DEBUG + printf("free: %x\n",this->xds); fflush(stdout); +#endif + free(this->xds); + } + if((this->state & STRING_FROMTABLE)==0 && this->label!=NULL){ +#ifdef MALLOC_DEBUG + printf("free: %x\n",this->label); fflush(stdout); +#endif + free(this->label); + } +#ifdef MALLOC_DEBUG + printf("free: %x\n",this); fflush(stdout); +#endif + + free(this); +#ifdef JOOST_DEBUG + printf("Deleted component: %d\n",id); fflush(stdout); +#endif + } + return current; +} + +void Component_delete_children(struct Component* this){ + struct Component* current=this->first_child; + while(current!=NULL) + current=Component_delete(current); +} + +void Component_changestate_children(struct Component* this, int andmask, int ormask, int xormask){ + struct Component* current=this->first_child; + while(current!=NULL){ + current->state&=(0xffff-andmask); + current->state|=ormask; + current->state^=xormask; + current=current->next_sibling; + } + fflush(stdout); +} + +void Component_linkstringtable(struct Component* this){ + struct Component* child=this->first_child; +#ifdef STR_DEBUG + printf("%d: %x -> %x\n",this->id,this->label-1,global->stringtable[(int) (this->label)-1]); fflush(stdout); +#endif + if(((int)(this->label))<0x1000 && ((int)(this->label))>0) + this->label=global->stringtable[(int) (this->label)-1]; + if(((int)(this->label2))<0x1000 && ((int)(this->label2))>0) + this->label2=global->stringtable[(int) (this->label2)-1]; + while(child!=NULL){ + Component_linkstringtable(child); + child=child->next_sibling; + } + +} + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param){ + struct Component* current,current2; + int x=0,y=0; +#ifdef JOOST_DEBUG + printf("Message in window %d, Msg: %x, Param: %x\n",this->id,msg,param); fflush(stdout); +#endif + switch(msg){ + case KEY_PRESSED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)) + current->handler(current,msg,param); + current=current->next_sibling; + } + break; + case KEY_RELEASED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)) + current->handler(current,msg,param); + current->handler(current,KEY_TYPED,param); + current=current->next_sibling; + } + break; + case KEY_TYPED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)){ + current->handler(current,msg,param); + if((current->state & STATE_ACTION)!=0 && current->msg==param){ + struct ActionXDS* act=(struct ActionXDS*) (current->xds); +#ifdef JOOST_DEBUG + printf("Before actionhandler...\n"); +#endif + act->actionhandler(current); + if((act->action & 0xff00)==0){ + current=NULL; + } +#ifdef JOOST_DEBUG + printf("After actionhandler...\n"); +#endif + } + } + if(current!=NULL) + current=current->next_sibling; + } + break; + case WND_REDRAW: + this->paint(this); + break; + case WND_CLOSE: + this->state=this->state & (0xffff-(STATE_VISIBLE | STATE_ENABLED)); + Component_findXY(this,&x,&y); + TouchRegion(0,x,y,this->sizex,this->sizey); + this->parent->handler(this->parent,WND_REDRAW,0); + break; + case WND_DESTROY: + current=this->parent; + Component_delete(this); + current->handler(current,WND_REDRAW,0); + break; + case WND_BROADCAST: + current=this->first_child; + while(current!=NULL){ + if(current!=(struct Component*) (param) && (current->state & STATE_FOCUS)!=0) + current->handler(current,CMP_BROADCAST,param); + current=current->next_sibling; + } + break; + case APP_QUIT: + if(this->parent==NULL) + global->willquit=1; + else if((this->state & STATE_APPLICATION)==0) + this->parent->handler(this->parent,APP_QUIT,param); + else{ + current=this->parent; + current->state|=STATE_VISIBLE | STATE_ENABLED; + Component_changestate_children(current,0,STATE_VISIBLE,0); + this->handler(this,WND_DESTROY,0); + } + break; + } +} + +void Window_paint(struct Component* this){ + int x=0,y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + + EnableScreen(0); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion(0,x,y,this->sizex,this->sizey); + Move(x,y+global->currentfont->stringheight(this->label)+4); + DrawRectNC(this->sizex,this->sizey-global->currentfont->stringheight(this->label)-4); + Move(x,y); + FillRect(this->sizex,global->currentfont->stringheight(this->label)+5); + Move(x+2,y+2); + Text(this->label); + Component_paint(this); + } +} + +void Root_paint(struct Component* this){ + EnableScreen(0); + Move(0,0); + ClearRect(0,0x80); + GrayRect(0,0x80); + TouchRegion(0,0,0,0,0x80); + + Component_paint(this); +/* EnableScreen(0); + Window_paint(this); + EnableScreen(1);*/ +} + +void Window_add(struct Component* this, struct Component* comp){ + Component_add(this,comp); +} + +struct Component* Window_new(int x,int y,int sx,int sy){ + struct Component* this=Component_new(x,y,sx,sy); + this->handler=Window_handler; + this->paint=Window_paint; + this->add=Window_add; + return this; +} + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->parent->handler(this->parent, CMP_ACTION, param); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void Button_drawtext(struct Component* this, int x, int y){ + if((this->state & STYLE_MULTILINE)!=0){ + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-2*global->currentfont->stringheight(this->label))/2); + Text(this->label); + Move(x+(this->sizex-global->currentfont->stringwidth(this->label2))/2,y+(this->sizey)/2+1); + Text(this->label2); + } else { + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-global->currentfont->stringheight(this->label))/2+1); + Text(this->label); + } +#ifdef STR_DEBUG + printf("Drawtext (%d): ""%s"" @ %x\n",this->id,this->label,this->label); fflush(stdout); +#endif +} + +void Button_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & (STATE_ENABLED | STYLE_INVERTED))!=0 && (this->state & (STATE_ENABLED | STYLE_INVERTED))!=(STATE_ENABLED | STYLE_INVERTED) ) + FillRectNC(this->sizex,this->sizey); + else + DrawRectNC(this->sizex,this->sizey); + Button_drawtext(this,x,y); + } +} + +void Button_add(struct Component* this, struct Component* comp){ + return; +} + +struct Component* Button_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE; + this->msg=msg; + this->handler=Button_handler; + this->paint=Button_paint; + this->add=Button_add; + + return this; +} + +/*void Numpad(struct Component* this, int x, int y){ + int i; + char s[2]={0,0}; + struct Component* button; + for(i=0; i<9; i++){ + s[0]=0x31+(char) i; + button=Button_new(x+(i%3)*0x18,y+0x30-(i/3)*0x18,0x16,0x16,i+0x31); + Component_setlabel(button,s); + button->state|=STATE_CASTING; + this->add(this,button); + } + button=Button_new(x+0x18,y+0x48,0x16,0x16,0x30); + Component_setlabel(button,"0"); + button->state|=STATE_CASTING; + this->add(this,button); + + button=Button_new(x+0x30,y+0x48,0x16,0x16,0x08); + Component_setlabel(button,"CE"); + button->state|=STATE_CASTING; + this->add(this,button); +}*/ + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->state^=STATE_CHECKED; + this->parent->handler(this->parent, CMP_STATECHANGE, param); + this->handler(this, WND_REDRAW, 0); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void ToggleButton_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + if((this->state & STATE_ENABLED)!=0 && (this->state & STATE_CHECKED)!=0){ + FillRectNC(this->sizex,this->sizey); + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + }else{ + DrawRectNC(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + } + Button_drawtext(this,x,y); + } +} + +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE | STATE_CHECKED; + this->msg=msg; + this->handler=ToggleButton_handler; + this->paint=ToggleButton_paint; + this->add=Button_add; + + return this; +} + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==CMP_ACTION && param==0xff){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_OK, this->msg); + } + if(msg==CMP_ACTION && param==0xfe){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_CANCEL, this->msg); + + } +} + +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* ok; + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_VISIBLE; + this->msg=msg; + this->handler=Dialog_handler; + this->paint=Window_paint; + this->add=Window_add; + + ok=Button_new(sx-0x30,sy-0x1c,0x28,0x14,0xff); + ok->label=(char*) malloc(3); + Component_setlabel(ok,"OK"); + this->add(this,ok); + + ok=Button_new(sx-0x30,sy-0x38,0x28,0x14,0xfe); /*Cancel*/ + ok->label=(char*) malloc(7); + Component_setlabel(ok,"Cancel"); + this->add(this,ok); + + return this; +} + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param){ + Button_handler(this,msg,param); + if(msg==CMP_BROADCAST && (this->state & STATE_FOCUS)!=0){ +#ifdef JOOST_DEBUG + printf("strlen = %d->",strlen(this->label)); fflush(stdout); +#endif + if(param==0x08){ + if(strlen(this->label)!=0) + this->label[strlen(this->label)-1]=0; + }else{ + this->label[strlen(this->label)+1]=0; + this->label[strlen(this->label)]=(char) param; + } +#ifdef JOOST_DEBUG + printf("%d\n",strlen(this->label)); fflush(stdout); +#endif + this->handler(this,WND_REDRAW,0); + } +} + +void Display_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + char pwd[64]; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & STYLE_INVERTED)==0) + FillRectNC(this->sizex,this->sizey); + else + DrawRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2); + if(this->state & STYLE_PASSWORD){ + int i; + for(i=0; ilabel); i++) + pwd[i]='*'; + pwd[i]=0; + Text(pwd); + }else + Text(this->label); + +/* Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + + FillRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2); + Text(this->label); + TouchRegion((this->state&STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); +*/ + } +} + +struct Component* Display_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Button_new(x,y,sx,sy,msg); + this->state|=STATE_FOCUS; + Component_setlabel(this,""); + this->paint=Display_paint; + this->handler=Display_handler; + return this; +} + +/************************************************ + * Labels * + ************************************************/ +void Label_handler(struct Component* this, int msg, int param){ + return; +} + +void Label_paint(struct Component* this){ + int x=0, y=0; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Button_drawtext(this,x,y); + } +} + +struct Component* Label_new(int x, int y, int sx, int sy,char* l){ + struct Component* comp=Component_new(x,y,sx,sy); + comp->label=l; + comp->state=STATE_VISIBLE; + comp->handler=Label_handler; + comp->paint=Label_paint; + comp->add=Button_add; + return comp; +} + /************************************************ + * Implementation * + ************************************************/ +/* +void ScreenDialog_handler(struct Component* this, int msg, int param){ + char cmd[]={0x1B,'V',0}; + Dialog_handler(this,msg,param); + if(msg==CMP_ACTION){ + if(param=='U') + cmd[2]=0; + else if(param=='D') + cmd[2]=1; + else + return; + write(global->lcd,cmd,3); + } +} + +struct Component* ScreenDialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* button; + struct Component* this=Dialog_new(x,y,sx,sy,msg); + + button=Button_new(0x04,0x10,0x20,0x14,'U'); + Component_setlabel(button,"Up"); + this->add(this,button); + + button=Button_new(0x04,0x28,0x20,0x14,'D'); + Component_setlabel(button,"Down"); + this->add(this,button); + + this->handler=ScreenDialog_handler; + + return this; +} +*/ +void rootWindow_handler(struct Component* this, int msg, int param){ + struct Component* dummy; + Window_handler(this,msg,param); +} + + +void screenbuilder(struct Component* root, char* filename){ + struct Component* subw; + struct ActionXDS* action; + int mode; + int fh,rd; + char buf[SIZE_SCRBLD_RECORD]; + long l; + int xs,ys; + xs=0x2b; + ys=0x1a; + buf[0]=0; + fh=open(filename,O_RDONLY); + do{ + char comp=0; + if(buf[0]=='s'){ /* Change size */ + xs=*((int*)(buf+0x1)); + ys=*((int*)(buf+0x3)); + } + + if(buf[0]=='B' || buf[0]=='M'){ /* Button, Multi-line button */ + subw=Button_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + if(buf[0]=='M') subw->state|=STYLE_MULTILINE; + comp=1; + } + if(buf[0]=='T'){ /* Toggle-button */ + subw=ToggleButton_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='D'){ /* Display button */ + subw=Display_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='L'){ /* Label */ + subw=Label_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf+0x12); + comp=1; + } + if(buf[0]=='A'){ + struct ActionXDS a; + root->xds=&a; + a.action=*((int*)(buf+0x6)); + a.wParam=*((int*)(buf+0x8)); + a.lParam=*((long*)(buf+0xa)); + root_actionhandler(root); + } + + if(buf[0]=='S'){ + struct StringTableXDS* stx; + read_stringtable(fh,buf); + root->xds=(void*) malloc(sizeof(struct StringTableXDS)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",root->xds); fflush(stdout); +#endif + + stx=(struct StringTableXDS*) root->xds; + root->sizexds=sizeof(struct StringTableXDS); + stx->stringtable=global->stringtable; + stx->stringtabledata=global->stringtabledata; +#ifdef STR_DEBUG + printf("Stringtable created @ %x\n",stx->stringtabledata); fflush(stdout); +#endif + comp=0; + } + if(comp!=0){ + if((buf[6] | buf[7])!=0){ + subw->state|=STATE_ACTION; + subw->sizexds=sizeof(struct ActionXDS); + subw->xds=(void*) malloc(sizeof(struct ActionXDS)); +#ifdef MALLOC_DEBUG + printf("malloc Action: %x\n",subw->xds); fflush(stdout); +#endif + + action=(struct ActionXDS*) (subw->xds); + action->actionhandler=root_actionhandler; + action->action=*((int*)(buf+0x6)); + action->wParam=*((int*)(buf+0x8)); + action->lParam=*((long*)(buf+0xa)); + } + if((buf[0x0e] | buf[0x0f])!=0) + subw->state=*((int*)(buf+0x0e)); + subw->font=*((int*)(buf+0x10)); + + subw->label=(char*) (*((int*) (buf+0x12)) & 0x0fff); + if(subw->label==NULL) { + subw->label=(char*) malloc(LABEL_LENGTH); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",subw->label); fflush(stdout); +#endif + subw->label[0]=0; + } + else + subw->state|=STRING_FROMTABLE; + + if((*((int*) (buf+0x12)) &0xf000)>0x1000) + subw->label2=(char*)((*((int*) (buf+0x12)) & 0x0fff)+1); + + root->add(root,subw); + } + + rd=read(fh,buf,SIZE_SCRBLD_RECORD); + } while(rd==SIZE_SCRBLD_RECORD); + close(fh); + Component_linkstringtable(root); + root->paint(root); +} + +void root_actionhandler(struct Component* this){ + struct ActionXDS *act; + struct Component* subw; + char filename[]={'0','0','0','0','.','s','c','r',0}; + + act=(struct ActionXDS*) (this->xds); +#ifdef JOOST_DEBUG + printf("0x%x: (0x%x, 0x%x, 0x%lx)",act, act->action, act->wParam, act->lParam); +#endif + if(act->action==0x0001){ /*QUIT*/ + this->handler(this,APP_QUIT,0); + } + if((act->action & 0xfffe)==0x0002){ /*Open Screen*/ + Component_changestate_children(this->parent,STATE_VISIBLE,0,0); + subw=Window_new(0,0,this->parent->sizex,this->parent->sizey); + subw->state=STATE_VISIBLE | STATE_ENABLED; + if((act->action & 1)!=0) + subw->state|=STATE_APPLICATION; + subw->handler=rootWindow_handler; + subw->paint=Root_paint; + filename[0]=(char) ((act->lParam) &0xff); + filename[1]=(char) ((act->lParam>>8) &0xff); + filename[2]=(char) ((act->lParam>>16) &0xff); + filename[3]=(char) ((act->lParam>>24) &0xff); + screenbuilder(subw,filename); + this->parent->add(this->parent,subw); + } + if(act->action==0x0004) { /* Open MessageBox */ + /*Component_changestate_children(this->parent,0,0,0);*/ + struct Component* label; + int i; + subw=Dialog_new(0x05,0x05,this->parent->sizex-0x0a,this->parent->sizey-0x0a,1); + subw->state=STATE_VISIBLE | STATE_ENABLED | STYLE_SELFDESTRUCT; + subw->font=0x0030; + for(i=0; i<(act->wParam>>12)&0x0f; i++){ + label=Label_new(0x08,0x14+i*0x0c,(subw->sizex & 0xff)-0x10,0x10,global->stringtable[(act->wParam&0xfff)+i-1]); + label->font=0x0030; + subw->add(subw,label); + } + Component_setlabel(subw,"Message Box"); + Component_find(subw,0xff)->font=0x0030; + Component_delete(Component_find(subw,0xfe)); + this->parent->add(this->parent,subw); + this->parent->handler(this->parent,WND_REDRAW,0); + } +#ifdef JOOST_DEBUG + printf("Before external handler...\n"); fflush(stdout); +#endif + if(global->actionhandler!=NULL) + global->actionhandler(this); + +#ifdef JOOST_DEBUG + printf("After external handler...\n"); fflush(stdout); +#endif +} + +void read_stringtable(int fh,char* buf){ + int siz,bsiz; + int i=0,j=0; + char **ptrs; + char *rawdata; + + siz=*((int*) (buf+0x01)); + bsiz=*((int*) (buf+0x03)); +#ifdef STR_DEBUG + printf("%d %d\n",siz,bsiz); +#endif + + ptrs=(char**) malloc(sizeof(char*)*siz); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",ptrs); fflush(stdout); +#endif + + rawdata=(char*) malloc(bsiz); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",rawdata); fflush(stdout); +#endif + + read(fh,rawdata,bsiz); + while(istringtabledata=rawdata; + global->stringtable=ptrs; +#ifdef STR_DEBUG + for(i=0; i""%s""\n",i,global->stringtable[i],global->stringtable[i]); + fflush(stdout); +#endif + +} + +struct Global_GUI* gui_globals(){ + return global; +} + + +void GUIinit(void){ + global=(struct Global_GUI*) malloc(sizeof(struct Global_GUI)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",global); fflush(stdout); +#endif + + global->id=0; + global->willquit=0; + global->currentfont=NULL; + global->firstfont=NULL; + global->stringtable=NULL; + global->stringtabledata=NULL; + global->actionhandler=NULL; + GraphicsOpen(); + loadFont(0x0030,stringwidth0,stringheight01,0,NULL); + loadFont(0x0031,stringwidth1,stringheight01,0,NULL); + loadFont(0x0032,stringwidth2,stringheight2,0,NULL); + global->root=Window_new(0x0,0x0,0x00,0x80); + global->root->state=STATE_VISIBLE; + global->root->handler=rootWindow_handler; + global->root->paint=Root_paint; +} + +void GUIunit(void){ + Component_delete(global->root); + ClearScreen(); + GraphicsClose(); +} + +void GUIgo(char* scr){ + char buf,obuf; + screenbuilder(global->root,scr); + + while(read(global->lcd,&buf,1)==1); + + while(!global->willquit){ + if(read(global->lcd,&buf,1)==1){ + if(buf!=0) + global->root->handler(global->root,KEY_PRESSED,buf); + else + global->root->handler(global->root,KEY_RELEASED,obuf); + obuf=buf; + } + } +} + +/*void main(void){ + GUIinit(); + GUIgo(); + GUIunit(); +}*/ + diff --git a/src/gui/Copy of wnd.c b/src/gui/Copy of wnd.c new file mode 100644 index 00000000..d2397708 --- /dev/null +++ b/src/gui/Copy of wnd.c @@ -0,0 +1,941 @@ +/************************************************ + * Graphical User Interface driver (GUI) * + * By J.W. Morsink for Retail Vision B.V. * + ************************************************/ + +#include + +#define JOOST_DEBUG + +/************************************************ + * Global variables for GUI * + ************************************************/ +struct Global_GUI { + int id; + int lcd; + int willquit; + char *stringtabledata; + char **stringtable; + struct Font* currentfont; + struct Font* firstfont; + struct Component* root; +}; + +struct Global_GUI* global; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(){ + struct sgttyb temp; + char init[]={0x1B,'K'}; + + global->lcd=open("/dev/lcd0",O_RDWR); + gtty(global->lcd,&temp); + temp.sg_flags=RAW | UNBUFF; + stty(global->lcd,&temp); + + write(global->lcd,init,2); +} + +void GraphicsClose(){ + close(global->lcd); +} + +void Move(int x, int y){ + unsigned char cmd[]={0x1B,'S',0,0}; + cmd[2]=(unsigned char) (x); + cmd[3]=(unsigned char) (y); + write(global->lcd,cmd,4); +} + +void ClearRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'C',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void DrawRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'N',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'R',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'F',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void Text(char *s){ + int c=strlen(s); + write(global->lcd,s,c); +} + +void TouchRegion(int msg, int x, int y, int sx, int sy){ + char touch[]={0x1B,'Z',0,0,0,0,0}; + touch[2]=(unsigned char) (msg); + touch[3]=(unsigned char) (x); + touch[4]=(unsigned char) (y); + touch[5]=(unsigned char) (sx); + touch[6]=(unsigned char) (sy); + write(global->lcd,touch,7); +#ifdef JOOST_DEBUG + printf("Touch: %x,%x,%x,%x,%x\n",msg,x,y,sx,sy); fflush(stdout); +#endif +} + +void ClearScreen(){ + Move(0,0); + ClearRect(0,0x80); + TouchRegion(0,0,0,0,0x80); +} + +void EnableScreen(unsigned char c){ + char cmd[]={0x1B,'E',0}; + cmd[2]=c; + write(global->lcd,cmd,3); +} + +void grSetFont(int f){ + char cmd[]={0x1B,0}; + cmd[1]=f & 0xff; + write(global->lcd,cmd,2); +} + +/************************************************ + * Fonts * + ************************************************/ + +struct Font* fontSearch(int f){ + struct Font* current=global->firstfont; + while(current!=NULL && current->id!=f) + current=current->nextfont; + return current; +} + +void setCurrentFont(int f){ + if(fontSearch(f)!=NULL){ + grSetFont(f); + global->currentfont=fontSearch(f); + } +} + +void loadFont(int id,int (*sw)(char*),int (*sh)(char*),int sizedata, void* data){ + struct Font* font=(struct Font*) malloc(sizeof(struct Font)); + font->id=id; + font->stringwidth=sw; + font->stringheight=sh; + font->nextfont=NULL; + font->sizefontdata=sizedata; + font->fontdata=data; + if(global->firstfont==NULL){ + global->firstfont=font; + global->currentfont=font; + } + else + { + struct Font* current=global->firstfont; + while(current->nextfont!=NULL) + current=current->nextfont; + current->nextfont=font; + } +} + +int stringwidth(char *str,int extra){ + int w=0,i=0; + while(str[i]!=0x00){ + switch(str[i]){ + case 'i': + case 'I': + case '!': + w+=2; + break; + case 'l': + w+=3; + break; + case ',': + case '1': + case '.': + w+=4; + break; + case 'r': + case 'k': + case 'j': + w+=5; + break; + default: + w+=6; + } + i++; + w+=extra; + } + return w; +} + +int stringheight(char ch, int extra){ + if(ch<0x80) return 7+extra; + if(ch>=0xcc && ch<=0xdf) return 1+extra; +} + +int stringheight01(char* ch){ + return stringheight(ch[0],0); +} + +int stringheight2(char* ch){ + return stringheight(ch[0],5); +} + +int stringwidth0(char *str){ + return stringwidth(str,0); +} + +int stringwidth1(char *str){ + return stringwidth(str,2); +} + +int stringwidth2(char *str){ + return stringwidth(str,3); +} +/************************************************ + * Components * + ************************************************/ + +struct Component* Component_new(int x,int y,int sx,int sy){ + struct Component* this=(struct Component*) (malloc(sizeof(struct Component))); + this->id=(++global->id); + this->x=x; + this->y=y; + this->sizex=sx; + this->sizey=sy; + this->state=0; + this->order=0; + this->font=0; + this->msg=0; + this->parent=NULL; + this->next_sibling=NULL; + this->first_child=NULL; + this->handler=NULL; + this->paint=NULL; + this->add=NULL; + this->sizexds=0; + this->xds=NULL; + this->label[0]=0; + this->label[LABEL_LENGTH]=0; + return this; +} + +void Component_setlabel(struct Component* this, char* s){ + int i=0; + while(s[i]!=0 && ilabel[i]=s[i]; + i++; + } + this->label[i]=0; +} + +void Component_add(struct Component* this, struct Component* comp){ + struct Component* current=this->first_child; + if(this->first_child==NULL){ + this->first_child=comp; + comp->next_sibling=NULL; + } + else + { + while(current->next_sibling!=NULL){ + current=current->next_sibling; + } + current->next_sibling=comp; + comp->next_sibling=NULL; + } + comp->parent=this; +} + +void Component_paint(struct Component* this){ + struct Component* current=this->first_child; + while(current!=NULL){ + current->paint(current); + current=current->next_sibling; + } +} + +void Component_findXY(struct Component* this, int* x, int* y){ + struct Component* current=this; + do{ + *x+=current->x; + *y+=current->y; + current=current->parent; + } while(current!=NULL); +} + +struct Component* Component_find(struct Component* this, int msg){ + struct Component* current=this->first_child; +#ifdef JOOST_DEBUG + printf("Find %x in %x:\n",msg, this->id); fflush(stdout); +#endif + while(current!=NULL){ +#ifdef JOOST_DEBUG + printf("Comp_find: %x, %x\n",msg, current->msg); fflush(stdout); +#endif + if(current->msg==msg) + return current; + current=current->next_sibling; + } + return NULL; +} + +struct Component* Component_delete(struct Component* this){ + struct Component* current=this->first_child; + int id=this->id; + if(this!=NULL){ +#ifdef JOOST_DEBUG + printf("Deleting component: %d\n",id); fflush(stdout); +#endif + while(current!=NULL){ + current=Component_delete(current); + } + if(this->parent!=NULL){ + if(this==this->parent->first_child) + this->parent->first_child=this->parent->first_child->next_sibling; + else{ + current=this->parent->first_child; + while(this!=current->next_sibling && current->next_sibling!=NULL) + current=current->next_sibling; + if(current->next_sibling!=NULL) + current->next_sibling=current->next_sibling->next_sibling; + } + } + current=this->next_sibling; + if(this->sizexds>0) + free(this->xds); + free(this); +#ifdef JOOST_DEBUG + printf("Deleted component: %d\n",id); fflush(stdout); +#endif + } + return current; +} + +void Component_delete_children(struct Component* this){ + struct Component* current=this->first_child; + while(current!=NULL) + current=Component_delete(current); +} + +void Component_changestate_children(struct Component* this, int andmask, int ormask, int xormask){ + struct Component* current=this->first_child; + while(current!=NULL){ + current->state&=(0xffff-andmask); + current->state|=ormask; + current->state^=xormask; + current=current->next_sibling; + } + fflush(stdout); +} + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param){ + struct Component* current,current2; + int x=0,y=0; +#ifdef JOOST_DEBUG + printf("Message in window %d, Msg: %x, Param: %x\n",this->id,msg,param); fflush(stdout); +#endif + switch(msg){ + case KEY_TYPED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)){ + current->handler(current,msg,param); + if((current->state & STATE_ACTION)!=0 && current->msg==param){ + struct ActionXDS* act=(struct ActionXDS*) (current->xds); +#ifdef JOOST_DEBUG + printf("Before actionhandler...\n"); +#endif + act->actionhandler(current); + if((act->action & 0xff00)==0){ + current=NULL; + } +#ifdef JOOST_DEBUG + printf("After actionhandler...\n"); +#endif + } + } + if(current!=NULL) + current=current->next_sibling; + } + break; + case WND_REDRAW: + this->paint(this); + break; + case WND_CLOSE: + this->state=this->state & (0xffff-(STATE_VISIBLE | STATE_ENABLED)); + Component_findXY(this,&x,&y); + TouchRegion(0,x,y,this->sizex,this->sizey); + this->parent->handler(this->parent,WND_REDRAW,0); + break; + case WND_DESTROY: + current=this->parent; + Component_delete(this); + current->handler(current,WND_REDRAW,0); + break; + case WND_BROADCAST: + current=this->first_child; + while(current!=NULL){ + if(current!=(struct Component*) (param) && (current->state & STATE_FOCUS)!=0) + current->handler(current,CMP_BROADCAST,param); + current=current->next_sibling; + } + break; + case APP_QUIT: + if(this->parent==NULL) + global->willquit=1; + else if((this->state & STATE_APPLICATION)==0) + this->parent->handler(this->parent,APP_QUIT,param); + else{ + current=this->parent; + current->state|=STATE_VISIBLE | STATE_ENABLED; + Component_changestate_children(current,0,STATE_VISIBLE,0); + this->handler(this,WND_DESTROY,0); + } + break; + } +} + +void Window_paint(struct Component* this){ + int x=0,y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion(0,x,y,this->sizex,this->sizey); + Move(x,y+global->currentfont->stringheight(this->label)+4); + DrawRect(this->sizex,this->sizey-global->currentfont->stringheight(this->label)-4); + Move(x,y); + FillRect(this->sizex,global->currentfont->stringheight(this->label)+5); + Move(x+2,y+2); + Text(this->label); + Component_paint(this); + } +} + +void Root_paint(struct Component* this){ + Move(0,0); + ClearRect(0,0x80); + TouchRegion(0,0,0,0,0x80); + + Component_paint(this); +/* EnableScreen(0); + Window_paint(this); + EnableScreen(1);*/ +} + +void Window_add(struct Component* this, struct Component* comp){ + Component_add(this,comp); +} + +struct Component* Window_new(int x,int y,int sx,int sy){ + struct Component* this=Component_new(x,y,sx,sy); + this->handler=Window_handler; + this->paint=Window_paint; + this->add=Window_add; + return this; +} + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->parent->handler(this->parent, CMP_ACTION, param); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void Button_drawtext(struct Component* this, int x, int y){ + if((this->state & STYLE_MULTILINE)!=0){ + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-2*global->currentfont->stringheight(this->label))/2); + Text(this->label); + Move(x+(this->sizex-global->currentfont->stringwidth(this->label+LABEL_LENGTH/2))/2,y+(this->sizey)/2+1); + Text((this->label)+0x0a); + } else { + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-global->currentfont->stringheight(this->label))/2+1); + Text(this->label); + } +} + +void Button_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & (STATE_ENABLED | STYLE_INVERTED))!=0 && (this->state & (STATE_ENABLED | STYLE_INVERTED))!=(STATE_ENABLED | STYLE_INVERTED) ) + FillRectNC(this->sizex,this->sizey); + else + DrawRect(this->sizex,this->sizey); + Button_drawtext(this,x,y); + } +} + +void Button_add(struct Component* this, struct Component* comp){ + return; +} + +struct Component* Button_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE; + this->msg=msg; + this->handler=Button_handler; + this->paint=Button_paint; + this->add=Button_add; + + return this; +} + +void Numpad(struct Component* this, int x, int y){ + int i; + char s[2]={0,0}; + struct Component* button; + for(i=0; i<9; i++){ + s[0]=0x31+(char) i; + button=Button_new(x+(i%3)*0x18,y+0x30-(i/3)*0x18,0x16,0x16,i+0x31); + Component_setlabel(button,s); + button->state|=STATE_CASTING; + this->add(this,button); + } + button=Button_new(x+0x18,y+0x48,0x16,0x16,0x30); + Component_setlabel(button,"0"); + button->state|=STATE_CASTING; + this->add(this,button); + + button=Button_new(x+0x30,y+0x48,0x16,0x16,0x08); + Component_setlabel(button,"CE"); + button->state|=STATE_CASTING; + this->add(this,button); +} + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->state^=STATE_CHECKED; + this->parent->handler(this->parent, CMP_STATECHANGE, param); + this->handler(this, WND_REDRAW, 0); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void ToggleButton_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + if((this->state & STATE_ENABLED)!=0 && (this->state & STATE_CHECKED)!=0){ + FillRectNC(this->sizex,this->sizey); + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + }else{ + DrawRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + } + Button_drawtext(this,x,y); + } +} + +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE | STATE_CHECKED; + this->msg=msg; + this->handler=ToggleButton_handler; + this->paint=ToggleButton_paint; + this->add=Button_add; + + return this; +} + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==CMP_ACTION && param==0xff){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_OK, this->msg); + } + if(msg==CMP_ACTION && param==0xfe){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_CANCEL, this->msg); + + } +} + +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* ok; + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_VISIBLE; + this->msg=msg; + this->handler=Dialog_handler; + this->paint=Window_paint; + this->add=Window_add; + + ok=Button_new(sx-0x30,sy-0x1c,0x28,0x14,0xff); + Component_setlabel(ok,"OK"); + this->add(this,ok); + + ok=Button_new(sx-0x30,sy-0x38,0x28,0x14,0xfe); /*Cancel*/ + Component_setlabel(ok,"Cancel"); + this->add(this,ok); + + return this; +} + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param){ + Button_handler(this,msg,param); + if(msg==CMP_BROADCAST && (this->state & STATE_FOCUS)!=0){ +#ifdef JOOST_DEBUG + printf("strlen = %d->",strlen(this->label)); fflush(stdout); +#endif + if(param==0x08){ + if(strlen(this->label)!=0) + this->label[strlen(this->label)-1]=0; + }else{ + this->label[strlen(this->label)+1]=0; + this->label[strlen(this->label)]=(char) param; + } +#ifdef JOOST_DEBUG + printf("%d\n",strlen(this->label)); fflush(stdout); +#endif + this->handler(this,WND_REDRAW,0); + } +} + +void Display_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & STYLE_INVERTED)==0) + FillRectNC(this->sizex,this->sizey); + else + DrawRect(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2); + Text(this->label); + +/* Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + + FillRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2); + Text(this->label); + TouchRegion((this->state&STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); +*/ + } +} + +struct Component* Display_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Button_new(x,y,sx,sy,msg); + this->state|=STATE_FOCUS; + Component_setlabel(this,""); + this->paint=Display_paint; + this->handler=Display_handler; + return this; +} + +/************************************************ + * Labels * + ************************************************/ +void Label_handler(struct Component* this, int msg, int param){ + return; +} + +void Label_paint(struct Component* this){ + int x=0, y=0; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Button_drawtext(this,x,y); + } +} + +struct Component* Label_new(int x, int y, int sx, int sy,char* l){ + struct Component* comp=Component_new(x,y,sx,sy); + Component_setlabel(comp,l); + comp->state=STATE_VISIBLE; + comp->handler=Label_handler; + comp->paint=Label_paint; + comp->add=Button_add; + return comp; +} +/************************************************ + * Implementation * + ************************************************/ +/* +void ScreenDialog_handler(struct Component* this, int msg, int param){ + char cmd[]={0x1B,'V',0}; + Dialog_handler(this,msg,param); + if(msg==CMP_ACTION){ + if(param=='U') + cmd[2]=0; + else if(param=='D') + cmd[2]=1; + else + return; + write(global->lcd,cmd,3); + } +} + +struct Component* ScreenDialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* button; + struct Component* this=Dialog_new(x,y,sx,sy,msg); + + button=Button_new(0x04,0x10,0x20,0x14,'U'); + Component_setlabel(button,"Up"); + this->add(this,button); + + button=Button_new(0x04,0x28,0x20,0x14,'D'); + Component_setlabel(button,"Down"); + this->add(this,button); + + this->handler=ScreenDialog_handler; + + return this; +} +*/ +void rootWindow_handler(struct Component* this, int msg, int param){ + struct Component* dummy; + Window_handler(this,msg,param); +} + + +void screenbuilder(struct Component* root, char* filename){ + struct Component* subw; + struct ActionXDS* action; + int mode; + int fh,rd; + char buf[SIZE_SCRBLD_RECORD]; + long l; + int xs,ys; + xs=0x2b; + ys=0x1a; + buf[0]=0; + fh=open(filename,O_RDONLY); + do{ + char comp=0; + if(buf[0]=='s'){ /* Change size */ + xs=*((int*)(buf+0x1)); + ys=*((int*)(buf+0x3)); + } + + if(buf[0]=='B' || buf[0]=='M'){ /* Button, Multi-line button */ + subw=Button_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + if(buf[0]=='M') subw->state|=STYLE_MULTILINE; + comp=1; + } + if(buf[0]=='T'){ /* Toggle-button */ + subw=ToggleButton_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='D'){ /* Display button */ + subw=Display_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='L'){ /* Label */ + subw=Label_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf+0x12); + comp=1; + } + if(comp!=0){ + if((buf[6] | buf[7])!=0){ + subw->state|=STATE_ACTION; + subw->sizexds=sizeof(struct ActionXDS); + subw->xds=(void*) malloc(sizeof(struct ActionXDS)); + action=(struct ActionXDS*) (subw->xds); + action->actionhandler=root_actionhandler; + action->action=*((int*)(buf+0x6)); + action->wParam=*((int*)(buf+0x8)); + action->lParam=*((long*)(buf+0xa)); + } + if((buf[0x0e] | buf[0x0f])!=0) + subw->state=*((int*)(buf+0x0e)); + subw->font=*((int*)(buf+0x10)); + for(rd=0; rd<20; rd++) + subw->label[rd]=buf[rd+0x12]; + root->add(root,subw); + } + + rd=read(fh,buf,SIZE_SCRBLD_RECORD); + } while(rd==SIZE_SCRBLD_RECORD); + close(fh); + root->paint(root); +} + +void root_actionhandler(struct Component* this){ + struct ActionXDS *act; + struct Component* subw; + char filename[]={'0','0','0','0','.','s','c','r',0}; + + act=(struct ActionXDS*) (this->xds); + + if(act->action==0x0001){ /*QUIT*/ + this->handler(this,APP_QUIT,0); + } + if((act->action & 0xfffe)==0x0002){ /*Open Screen*/ + Component_changestate_children(this->parent,STATE_VISIBLE,0,0); + subw=Window_new(0,0,this->parent->sizex,this->parent->sizey); + subw->state=STATE_VISIBLE | STATE_ENABLED; + if((act->action & 1)!=0) + subw->state|=STATE_APPLICATION; + subw->handler=rootWindow_handler; + subw->paint=Root_paint; + filename[0]=(char) ((act->lParam) &0xff); + filename[1]=(char) ((act->lParam>>8) &0xff); + filename[2]=(char) ((act->lParam>>16) &0xff); + filename[3]=(char) ((act->lParam>>24) &0xff); + screenbuilder(subw,filename); + this->parent->add(this->parent,subw); + } + if(act->action==0x0004) { /* Open MessageBox */ + /*Component_changestate_children(this->parent,0,0,0);*/ + struct Component* label; + int i; + subw=Dialog_new(0x05,0x05,this->parent->sizex-0x0a,this->parent->sizey-0x0a,1); + subw->state=STATE_VISIBLE | STATE_ENABLED | STYLE_SELFDESTRUCT; + subw->font=0x0030; + for(i=0; i<(act->wParam>>12)&0x0f; i++){ + label=Label_new(0x08,0x14+i*0x0c,(subw->sizex & 0xff)-0x10,0x10,global->stringtable[(act->wParam&0xfff)+i]); + label->font=0x0030; + subw->add(subw,label); + } + Component_setlabel(subw,"Message Box"); + Component_find(subw,0xff)->font=0x0030; + Component_delete(Component_find(subw,0xfe)); + this->parent->add(this->parent,subw); + this->parent->handler(this->parent,WND_REDRAW,0); + } +} + +void read_stringtable(){ + int siz,bsiz; + int i=0,j=0; + char buf[12]; + char **ptrs; + char *rawdata; + int fh=open("strings.txt",O_RDONLY); + read(fh,buf,12); + siz=(buf[0]-0x30)*10000+(buf[1]-0x30)*1000+(buf[2]-0x30)*100+(buf[3]-0x30)*10+(buf[4]-0x30); + bsiz=(buf[5]-0x30)*10000+(buf[6]-0x30)*1000+(buf[7]-0x30)*100+(buf[8]-0x30)*10+(buf[9]-0x30); + + ptrs=(char**) malloc(sizeof(char*)*siz); + rawdata=(char*) malloc(bsiz); + read(fh,rawdata,bsiz); + while(istringtabledata=rawdata; + global->stringtable=ptrs; + +} + +void GUIinit(void){ + global=(struct Global_GUI*) malloc(sizeof(struct Global_GUI)); + global->id=0; + global->willquit=0; + global->currentfont=NULL; + global->firstfont=NULL; + GraphicsOpen(); + loadFont(0x0030,stringwidth0,stringheight01,0,NULL); + loadFont(0x0031,stringwidth1,stringheight01,0,NULL); + loadFont(0x0032,stringwidth2,stringheight2,0,NULL); + read_stringtable(); + global->root=Window_new(0x0,0x0,0x00,0x80); + global->root->state=STATE_VISIBLE; + global->root->handler=rootWindow_handler; + global->root->paint=Root_paint; + Component_setlabel(global->root,"Test-window"); + +} + +void GUIunit(void){ + Component_delete(global->root); + ClearScreen(); + GraphicsClose(); +} + +void GUIgo(void){ + char buf; + screenbuilder(global->root,"0000.scr"); + + while(read(global->lcd,&buf,1)==1); + + while(!global->willquit){ + if(read(global->lcd,&buf,1)==1) + global->root->handler(global->root,KEY_TYPED,buf); + } +} + +void main(void){ + GUIinit(); + GUIgo(); + GUIunit(); +} + diff --git a/src/gui/Copy of wnd.h b/src/gui/Copy of wnd.h new file mode 100644 index 00000000..13fe89d1 --- /dev/null +++ b/src/gui/Copy of wnd.h @@ -0,0 +1,180 @@ +#ifndef JOOST_WND_H +#define JOOST_WND_H +#include +#include +#include +#include +#include +#include + +#define FONT_HEIGHT global->currentfont->stringheight +#define FONT_WIDTH(x) global->currentfont->stringwidth(x) +#define LABEL_LENGTH 0x14 +#define SIZE_SCRBLD_RECORD 0x12+LABEL_LENGTH + + +#define STATE_VISIBLE 0x0001 +#define STATE_ENABLED 0x0002 +#define STATE_CHECKED 0x0004 +#define STATE_FOCUS 0x0008 +#define STATE_CASTING 0x0010 +#define STATE_ACTION 0x0020 +#define STYLE_MULTILINE 0x0040 +#define STYLE_INVERTED 0x0080 +#define STYLE_SELFDESTRUCT 0x2000 +#define STATE_APPLICATION 0x4000 +#define STATE_DUMMY 0x8000 + +#define KEY_TYPED 0x0001 +#define WND_OPEN 0x0101 +#define WND_CLOSE 0x0102 +#define WND_REDRAW 0x0103 +#define WND_BROADCAST 0x0104 +#define WND_DESTROY 0x0105 +#define CMP_ACTION 0x0201 +#define CMP_STATECHANGE 0x0202 +#define CMP_BROADCAST 0x0203 +#define DLG_OK 0x0301 +#define DLG_CANCEL 0x0302 +#define APP_QUIT 0x0401 + +struct Font; +struct Component; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(); +void GraphicsClose(); +void Move(int x, int y); +void ClearRect(int sx, int sy); +void DrawRect(int sx, int sy); +void FillRect(int sx, int sy); +void FillRectNC(int sx, int sy); +void Text(char *s); +void TouchRegion(int msg, int x, int y, int sx, int sy); +void ClearScreen(); +void EnableScreen(unsigned char c); +void grSetFont(int f); + +/************************************************ + * Fonts * + ************************************************/ + +struct Font { + int id; + int (*stringwidth)(char*); + int (*stringheight)(char*); + struct Font* nextfont; + int sizefontdata; + void* fontdata; +}; + +struct Font* fontSearch(int f); +void setCurrentFont(int f); +void loadFont(int id,int (*sw)(char*),int (*sh)(char*),int sizedata, void* data); + + +/************************************************ + * Components * + ************************************************/ + +struct Component { + int id; + int x,y; + int sizex,sizey; + int state; + int order; + int font; + char msg; + struct Component* parent; + struct Component *next_sibling; + struct Component *first_child; + void (*handler) (struct Component*, int, int); + void (*paint) (struct Component*); + void (*add) (struct Component*, struct Component*); + char label[LABEL_LENGTH+1]; + int sizexds; + void *xds; +}; + +struct ActionXDS { + void (*actionhandler)(struct Component*); + int action; + int wParam; + long lParam; +}; + +struct Component* Component_new(int x,int y,int sx,int sy); +void Component_setlabel(struct Component* this, char* s); +void Component_add(struct Component* this, struct Component* comp); +void Component_paint(struct Component* this); +void Component_findXY(struct Component* this, int* x, int* y); +struct Component* Component_find(struct Component* this, int msg); +struct Component* Component_delete(struct Component* this); +void Component_delete_children(struct Component* this); +void Component_changestate_children(struct Component* this, int andmask, int ormask, int xormask); + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param); +void Window_paint(struct Component* this); +void Root_paint(struct Component* this); +void Window_add(struct Component* this, struct Component* comp); +struct Component* Window_new(int x,int y,int sx,int sy); + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param); +void Button_drawtext(struct Component* this, int x, int y); +void Button_paint(struct Component* this); +void Button_add(struct Component* this, struct Component* comp); +struct Component* Button_new(int x, int y, int sx, int sy, int msg); +void Numpad(struct Component* this, int x, int y); + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param); +void ToggleButton_paint(struct Component* this); +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param); +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param); +void Display_paint(struct Component* this); +struct Component* Display_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Labels * + ************************************************/ +void Label_handler(struct Component* this, int msg, int param); +void Label_paint(struct Component* this); +struct Component* Label_new(int x, int y, int sx, int sy,char* l); + +/************************************************ + * Implementation * + ************************************************/ +void rootWindow_handler(struct Component* this, int msg, int param); +void root_actionhandler(struct Component*); +void screenbuilder(struct Component* root, char* filename); +void read_stringtable(); +void GUIinit(); +void GUIgo(); +void GUIunit(); + +#endif \ No newline at end of file diff --git a/src/gui/cl64180.r01 b/src/gui/cl64180.r01 new file mode 100644 index 00000000..19dd6c15 Binary files /dev/null and b/src/gui/cl64180.r01 differ diff --git a/src/gui/grlogin.map b/src/gui/grlogin.map new file mode 100644 index 00000000..8f8c2e6c --- /dev/null +++ b/src/gui/grlogin.map @@ -0,0 +1,272 @@ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +. .ABS. 00000000 00000000 = 0. bytes (ABS,OVR) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR + 00000000 .__.ABS. | 00000000 ?CL64180L | 00000000 ?CL64180B + 00000014 e__DEFAUL | 00000014 l__DEFAUL | 00000034 l_CONST + 000000A0 l_CSTR | 00000158 l_CDATA0 | 00000158 l_IDATA0 + 00000381 l_RCODE | 000003B3 l_UDATA0 | 00001000 l_CSTACK + 00004000 s_CODE | 00008100 s_RCODE | 00008481 e_RCODE + 00008481 s_CONST | 000084B5 s_CSTR | 000084B5 e_CONST + 00008555 e_CSTR | 00008555 s_IDATA0 | 00008555 s_CDATA0 + 000086AD s_UDATA0 | 000086AD e_CCSTR | 000086AD e_ECSTR + 000086AD s_CCSTR | 000086AD e_CDATA0 | 000086AD s_ECSTR + 000086AD e_IDATA0 | 00008A60 e_UDATA0 | 00008A60 s_CSTACK + 00009A60 e_CSTACK | 0000C00E l_CODE | 0001000E e_CODE +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +_DEFAULT 00000000 00000014 = 20. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +RCODE 00008100 00000381 = 897. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008100 __init | 0000811F ?BANK_LEA | 00008125 ?BANK_FAS + 0000812A ?S_MUL_L0 | 00008140 ?C_V_SWIT | 00008152 ?ENT_PARM + 0000815E ?BANK_CAL | 0000816B ?S_V_SWIT | 00008188 ?ENT_AUTO + 0000819C ?V_SWITCH | 000081A6 ?SS_CMP_L | 000081B8 ?SS_DIV_L + 000081D4 ?UL_RSHAS | 000081E2 ?SL_RSH_L | 000081F0 ?UL_RSH_L + 0000820B ?BANK_LEA | 00008217 ?SS_RSH_L | 00008221 ?L_LSH_L0 + 00008239 ?S_DIVMOD | 0000824F ?L_END_AS | 00008258 ?L_XOR_L0 + 00008276 ?L_ORASG_ | 0000828F ?LEAVE_DI | 00008296 ?L_ADDASG + 000082AF ?S_S_SWIT | 000082C3 ?S_SWITCH | 000082D1 ?S_FIND_S + 000082ED ?L_NEG_L0 | 000082FF ?US_MOD_L | 00008308 ?US_DIV_L + 00008316 ?L_MULASG | 00008326 ?L_MUL_L0 | 000083AA ?S_MULASG + 000083B4 ?L_END_MU | 000083BD ?UL_DIVAS | 000083CD ?UL_MOD_L + 000083F2 ?UL_DIV_L | 0000841A ?L_DIVMOD | 00008472 ?L_NOT_L0 +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CONST 00008481 00000034 = 52. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTR 000084B5 000000A0 = 160. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +IDATA0 00008555 00000158 = 344. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008555 __IO_list | 00008557 stdin | 0000856F stdout + 00008587 stderr | 000085A5 _path_pas | 000085A7 __sys_err + 000085A9 __sys_ner | 000085AB __on_exit | 000085AD __ctype +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CDATA0 00008555 00000158 = 344. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +ECSTR 000086AD 00000000 = 0. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CCSTR 000086AD 00000000 = 0. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CODE 00004000 0000C00E = 49166. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 000045C1 GraphicsO | 0000464F GraphicsC | 00004664 Move + 000046A3 ClearRect | 000046E6 DrawRectN | 0000472B FillRect + 00004770 FillRectN | 000047B5 GrayRect | 000047FA Text + 00004827 TouchRegi | 0000487E ClearScre | 000048BB EnableScr + 000048F9 grSetFont | 00004936 fontSearc | 00004966 setCurren + 000049F4 loadFont | 00004A9B stringwid | 00004B14 stringhei + 00004B31 stringhei | 00004B44 stringhei | 00004B4D stringwid + 00004B5E stringwid | 00004B67 stringwid | 00004B70 Component + 00004C1A Component | 00004C67 Component | 00004CC5 Component + 00004D0B Component | 00004D4F Component | 00004D87 Component + 00004F58 Component | 00004F77 Component | 00004FE0 Component + 00005093 Window_ha | 00005360 Window_pa | 000054ED Root_pain + 00005524 Window_ad | 00005532 Window_ne | 00005584 Button_ha + 0000563B Button_dr | 000056F7 Button_pa | 000057F0 Button_ad + 000057F6 Button_ne | 00005848 ToggleBut | 000058E4 ToggleBut + 000059D0 ToggleBut | 00005A22 Dialog_ha | 00005ADB Dialog_ne + 00005BCA Display_h | 00005C4B Display_p | 00005D97 Display_n + 00005DF1 Label_han | 00005DF7 Label_pai | 00005E58 Label_new + 00005EB1 rootWindo | 00005ECF screenbui | 000062A9 root_acti + 000065E1 read_stri | 000066B6 gui_globa | 000066BC GUIinit + 000067E3 GUIunit | 00006808 GUIgo | 000068BD login + 000069CC login_act | 00006AC5 main | 00006AFA setgid + 00006B14 unix | 00006B2E strrchr | 00006B96 fflush + 00006DA9 chdir | 00006DBE _write | 00006DDD setuid + 00006DF7 lseek | 00006E24 __stdio_c | 00006E8F __stdio_i + 00006ECD setenv | 00007149 unsetenv | 000071E9 close + 000071FE strlen | 00007235 strcmp | 000072D6 perror + 00007313 execv | 00007326 ioctl | 00007351 isatty + 0000738C fstat | 000073A3 free | 00007483 getpwnam + 000074E5 setpwent | 0000752A endpwent | 00007549 getpwent + 00007567 strcpy | 0000758E __getpwen | 00007816 crypt + 00007AC3 open | 00007AEE malloc | 00007D1A exit + 00007D4A _read | 00007D69 memcmp | 00007DD6 execve + 00007DF5 strerror | 00007FB2 memset | 00014000 memcpy + 000140CE on_exit | 00014147 atexit | 0001415A printf + 00014189 unix_long | 000141A3 strchr | 000141DE _exit + 00014279 strtoul | 000143D0 toupper | 000143F5 tolower + 0001441A atoi | 00014430 __longtoa | 000145C4 itoa + 000147AD vfprintf | 00014D08 ltoa | 00014D6B sbrk + 00014D80 strcat | 00014DA0 fputc | 00014EB2 ultoa + 00014F07 strtol +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +UDATA0 000086AD 000003B3 = 947. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 000086AD _argc | 000086AF _argv | 000086B1 environ + 000086B3 errno | 000086B5 __cleanup | 000086B8 global + 000089D8 __malloc_ | 000089DC __malloc_ | 00008A2E __on_exit +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTACK 00008A60 00001000 = 4096. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + +Files Linked [ module(s) ] + +..\..\lib\c0b.rel [ _c0b ] +wnd [ wnd ] +login [ login ] + + +Libraries Linked [ object file ] + +..\..\lib\libsysb.lib [ relsysb\setgid.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strrchr.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\chdir.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libiar.lib [ reliar\SMUL.rel ] +..\..\lib\libsysb.lib [ relsysb\setuid.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libcb.lib [ relcb\setenv.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libcb.lib [ relcb\strcmp.rel ] +..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] +..\..\lib\libcb.lib [ relcb\perror.rel ] +..\..\lib\libcb.lib [ relcb\execv.rel ] +..\..\lib\libsysb.lib [ relsysb\ioctl.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libcb.lib [ relcb\getpwnam.rel ] +..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\setpwent.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\SVSWITCH.rel ] +..\..\lib\libcb.lib [ relcb\getpwent.rel ] +..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] +..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] +..\..\lib\libiar.lib [ reliar\SSCMP.rel ] +..\..\lib\libcb.lib [ relcb\crypt.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] +..\..\lib\libiar.lib [ reliar\SSDIV.rel ] +..\..\lib\libiar.lib [ reliar\ULRSHASG.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] +..\..\lib\libiar.lib [ reliar\SLRSH.rel ] +..\..\lib\libiar.lib [ reliar\ULRSH.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] +..\..\lib\libiar.lib [ reliar\SSRSH.rel ] +..\..\lib\libiar.lib [ reliar\LLSH.rel ] +..\..\lib\libcb.lib [ relcb\memcmp.rel ] +..\..\lib\libsysb.lib [ relsysb\execve.rel ] +..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] +..\..\lib\libcb.lib [ relcb\error.rel ] +..\..\lib\libiar.lib [ reliar\LENDASG.rel ] +..\..\lib\libcb.lib [ relcb\memset.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libiar.lib [ reliar\LXOR.rel ] +..\..\lib\libcb.lib [ relcb\printf.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libiar.lib [ reliar\LORASG.rel ] +..\..\lib\libcb.lib [ relcb\strchr.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libiar.lib [ reliar\LADDASG.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] +..\..\lib\libiar.lib [ reliar\SSSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SSWITCHEND.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libiar.lib [ reliar\SFINDSIGN.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] +..\..\lib\libiar.lib [ reliar\LNEG.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] +..\..\lib\libiar.lib [ reliar\USMOD.rel ] +..\..\lib\libiar.lib [ reliar\USDIV.rel ] +..\..\lib\libiar.lib [ reliar\LMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LMUL.rel ] +..\..\lib\libiar.lib [ reliar\SMULASG.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] +..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] +..\..\lib\libiar.lib [ reliar\ULMOD.rel ] +..\..\lib\libiar.lib [ reliar\ULDIV.rel ] +..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] +..\..\lib\libiar.lib [ reliar\LNOT.rel ] + + +User Base Address Definitions + +l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/gui/hello.map b/src/gui/hello.map new file mode 100644 index 00000000..44a45a1b --- /dev/null +++ b/src/gui/hello.map @@ -0,0 +1 @@ +Error[e12]: Unable to open file 'hello' diff --git a/src/gui/login.c b/src/gui/login.c new file mode 100644 index 00000000..598cf056 --- /dev/null +++ b/src/gui/login.c @@ -0,0 +1,93 @@ +/* login.c + * descripton: login into a user account + * author: Alistair Riddoch + * modification: David Murn + * Added password entry + * modification: Shane Kerr + * More work on password entry + */ + +/* todo: add a timeout for serial and network logins */ +/* ??? need a signal mechanism (i.e. alarm() and SIGALRM) */ +/* real getpass() ! */ + +#include +#include +#include +#include +#include +#include + +void login(pwd, argv) + struct passwd *pwd; + char **argv; +{ + char pname[64]; + char *bname; + +#if 1 /* addition by Nick, please see linux manpage passwd.5 */ + if (!*pwd->pw_shell) + { + pwd->pw_shell = "/bin/sh"; + } +#endif + +/* chown("/dev/tty",pwd->pw_uid,pwd->pw_gid); */ + pname[0] = '-'; + if ((bname = strrchr(pwd->pw_shell, '/')) != NULL) + bname++; + else bname = pwd->pw_shell; + strcpy(pname+1, bname); + argv[0] = pname; + argv[1] = NULL; + /* we must set first GID, because we're still root + if UID is set first and we aren't logging as root, + we won't have permission to change our GID */ + setgid(pwd->pw_gid); + setuid(pwd->pw_uid); + chdir(pwd->pw_dir); + setenv("HOME", pwd->pw_dir, 1); + setenv("USER", pwd->pw_name, 1); + execv(pwd->pw_shell, argv); + perror(pwd->pw_shell); + exit(1); +} + +void login_actionhandler(struct Component* this){ + char lbuf[20], *pbuf, salt[3], *s; + struct passwd *pwd; + int n; + struct ActionXDS *act; + struct Component* disp=this; + + act=(struct ActionXDS*) (this->xds); + if(act->action==0x0101){ + lbuf[0]=disp->label[0]; + lbuf[1]=disp->label[1]; + lbuf[2]=0; + disp->label[0]=0; + pwd = getpwnam(lbuf); + pbuf=disp->label+2; + if (pwd != NULL) { + salt[0] = pwd->pw_passwd[0]; + salt[1] = pwd->pw_passwd[1]; + salt[2] = 0; + s = crypt(pbuf, salt); + if (!strcmp(s, pwd->pw_passwd)){ + ClearScreen(); + login(pwd, NULL); + } + } + disp->paint(disp); + } +} + +void main(int argc, char** argv) +{ + GUIinit(); + gui_globals()->actionhandler=login_actionhandler; + GUIgo("/wnd/logn.scr"); + GUIunit(); +} + + diff --git a/src/gui/login.map b/src/gui/login.map new file mode 100644 index 00000000..297c5c7d --- /dev/null +++ b/src/gui/login.map @@ -0,0 +1,283 @@ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +. .ABS. 00000000 00000000 = 0. bytes (ABS,OVR) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR + 00000000 .__.ABS. | 00000000 ?CL64180L | 00000000 ?CL64180B + 00000014 e__DEFAUL | 00000014 l__DEFAUL | 0000002F l_CONST + 00000148 l_CSTR | 00000170 l_CDATA0 | 00000170 l_IDATA0 + 000003B5 l_UDATA0 | 00000430 l_RCODE | 00001000 l_CSTACK + 00004000 s_CODE | 00008100 s_RCODE | 00008530 e_RCODE + 00008530 s_CONST | 0000855F s_CSTR | 0000855F e_CONST + 000086A7 e_CSTR | 000086A7 s_IDATA0 | 000086A7 s_CDATA0 + 00008817 s_UDATA0 | 00008817 e_CCSTR | 00008817 e_ECSTR + 00008817 s_CCSTR | 00008817 e_CDATA0 | 00008817 s_ECSTR + 00008817 e_IDATA0 | 00008BCC e_UDATA0 | 00008BCC s_CSTACK + 00009BCC e_CSTACK | 0000C27F l_CODE | 0001027F e_CODE +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +_DEFAULT 00000000 00000014 = 20. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +RCODE 00008100 00000430 = 1072. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008100 __init | 0000811F ?L_MUL_L0 | 000081A3 ?BANK_LEA + 000081A9 ?BANK_FAS | 000081AE ?S_MUL_L0 | 000081C4 ?C_V_SWIT + 000081D6 ?L_ADDASG | 000081EF ?ENT_PARM | 000081FB ?BANK_CAL + 00008208 ?S_S_SWIT | 0000821C ?S_V_SWIT | 00008239 ?S_SWITCH + 00008247 ?SL_MOD_L | 0000827A ?ENT_AUTO | 0000828E ?V_SWITCH + 00008298 ?SL_DIV_L | 000082C8 ?SS_CMP_L | 000082DA ?L_INC_L0 + 000082E2 ?US_MOD_L | 000082EB ?SS_DIV_L | 00008307 ?UL_RSHAS + 00008315 ?US_DIV_L | 00008323 ?SL_RSH_L | 00008331 ?UL_RSH_L + 0000834C ?L_DIVMOD | 000083A4 ?BANK_LEA | 000083B0 ?SS_RSH_L + 000083BA ?L_LSH_L0 | 000083D2 ?S_DIVMOD | 000083E8 ?S_MULASG + 000083F2 ?L_END_AS | 000083FB ?L_NOT_L0 | 0000840A ?L_XOR_L0 + 00008428 ?L_ORASG_ | 00008441 ?LEAVE_DI | 00008448 ?L_FIND_S + 0000848C ?UL_DIVAS | 0000849C ?UL_MOD_L | 000084C1 ?S_FIND_S + 000084DD ?UL_DIV_L | 00008505 ?L_NEG_L0 | 00008517 ?L_MULASG + 00008527 ?L_END_MU +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CONST 00008530 0000002F = 47. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTR 0000855F 00000148 = 328. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +IDATA0 000086A7 00000170 = 368. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 000086BF __IO_list | 000086C1 stdin | 000086D9 stdout + 000086F1 stderr | 0000870F _path_pas | 00008711 __sys_err + 00008713 __sys_ner | 00008715 __on_exit | 00008717 __ctype +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CDATA0 000086A7 00000170 = 368. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +ECSTR 00008817 00000000 = 0. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CCSTR 00008817 00000000 = 0. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CODE 00004000 0000C27F = 49791. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 0000472B GraphicsO | 000047C7 GraphicsC | 000047DF Move + 0000481E ClearRect | 00004861 DrawRectN | 000048A6 FillRect + 000048EB FillRectN | 00004930 GrayRect | 00004975 Text + 000049A1 TouchRegi | 000049F8 ClearScre | 00004A35 EnableScr + 00004A73 grSetFont | 00004AB0 fontSearc | 00004AE0 setCurren + 00004B7C loadFont | 00004C23 stringwid | 00004C9C stringhei + 00004CB9 stringhei | 00004CCC stringhei | 00004CD5 stringwid + 00004CE6 stringwid | 00004CEF stringwid | 00004CF8 Component + 00004DA2 Component | 00004DEF Component | 00004E4D Component + 00004E93 Component | 00004ED7 Component | 00004F0F Component + 000050E0 Component | 000050FF Component | 00005168 Component + 0000521B Window_ha | 00005485 Window_pa | 00005611 Root_pain + 00005648 Window_ad | 00005656 Window_ne | 000056A8 Button_ha + 0000575F Button_dr | 0000582D Button_pa | 00005900 Button_ad + 00005906 Button_ne | 00005958 ToggleBut | 000059F1 ToggleBut + 00005ADD ToggleBut | 00005B2F Dialog_ha | 00005BE8 Dialog_ne + 00005CD7 Display_h | 00005D55 Display_p | 00005E72 Display_n + 00005ECC Label_han | 00005ED2 Label_pai | 00005F33 Label_new + 00005F8C Transacti | 000065CA rootWindo | 000065E8 screenbui + 000069B0 root_acti | 00006CE5 read_stri | 00006DBA gui_globa + 00006DC0 GUIinit | 00006EF0 GUIunit | 00006F15 GUIgo + 00006F94 login | 000070BD login_act | 00007213 main + 0000727A setgid | 00007294 unix | 000072AE sprintf + 000072F2 strrchr | 0000735A fflush | 0000756D chdir + 00007582 _write | 000075A1 setuid | 000075BB printf + 000075EA lseek | 00007617 __stdio_c | 00007682 __stdio_i + 000076C0 setenv | 0000793C unsetenv | 000079DC close + 000079F1 strlen | 00007A28 strcmp | 00007AC9 perror + 00007B06 execv | 00007B19 ioctl | 00007B44 isatty + 00007B7F fstat | 00007B96 free | 00007C76 getpwnam + 00007CD8 setpwent | 00007D1D endpwent | 00007D3C getpwent + 00007D5A strcpy | 00014000 __getpwen | 00014288 atoi + 0001441E vfprintf | 00014979 ltoa | 000149DC atol + 000149F2 __longtoa | 00014B86 itoa | 00014BEF crypt + 00014E9C fputs | 00014EFA open | 00014F25 malloc + 00015151 exit | 00015181 _read | 000151A0 memcmp + 0001520D execve | 0001522C strerror | 000153E9 memset + 00015429 memcpy | 000154F7 on_exit | 00015570 atexit + 00015583 strcat | 000155A3 unix_long | 000155BD strchr + 000155F8 _exit | 00015693 strtoul | 000157EA fputc + 000158FC toupper | 00015921 tolower | 00015946 ultoa + 0001599B strtol | 00015A43 sbrk +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +UDATA0 00008817 000003B5 = 949. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008817 _argc | 00008819 _argv | 0000881B environ + 0000881D errno | 0000881F __cleanup | 00008822 global + 00008824 trans | 00008B44 __malloc_ | 00008B48 __malloc_ + 00008B9A __on_exit +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTACK 00008BCC 00001000 = 4096. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + +Files Linked [ module(s) ] + +..\..\lib\c0b.rel [ _c0b ] +wnd [ wnd ] +login [ login ] + + +Libraries Linked [ object file ] + +..\..\lib\libsysb.lib [ relsysb\setgid.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] +..\..\lib\libcb.lib [ relcb\sprintf.rel ] +..\..\lib\libiar.lib [ reliar\LMUL.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strrchr.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\chdir.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libiar.lib [ reliar\SMUL.rel ] +..\..\lib\libsysb.lib [ relsysb\setuid.rel ] +..\..\lib\libcb.lib [ relcb\printf.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libcb.lib [ relcb\setenv.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libcb.lib [ relcb\strcmp.rel ] +..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] +..\..\lib\libcb.lib [ relcb\perror.rel ] +..\..\lib\libcb.lib [ relcb\execv.rel ] +..\..\lib\libsysb.lib [ relsysb\ioctl.rel ] +..\..\lib\libiar.lib [ reliar\LADDASG.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libcb.lib [ relcb\getpwnam.rel ] +..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\setpwent.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\SSSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SVSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SSWITCHEND.rel ] +..\..\lib\libiar.lib [ reliar\SLMOD.rel ] +..\..\lib\libcb.lib [ relcb\getpwent.rel ] +..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] +..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] +..\..\lib\libiar.lib [ reliar\SLDIV.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] +..\..\lib\libcb.lib [ relcb\atol.rel ] +..\..\lib\libiar.lib [ reliar\SSCMP.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] +..\..\lib\libiar.lib [ reliar\LINC.rel ] +..\..\lib\libcb.lib [ relcb\crypt.rel ] +..\..\lib\libcb.lib [ relcb\fputs.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] +..\..\lib\libiar.lib [ reliar\USMOD.rel ] +..\..\lib\libiar.lib [ reliar\SSDIV.rel ] +..\..\lib\libiar.lib [ reliar\ULRSHASG.rel ] +..\..\lib\libiar.lib [ reliar\USDIV.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] +..\..\lib\libiar.lib [ reliar\SLRSH.rel ] +..\..\lib\libiar.lib [ reliar\ULRSH.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] +..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] +..\..\lib\libiar.lib [ reliar\SSRSH.rel ] +..\..\lib\libiar.lib [ reliar\LLSH.rel ] +..\..\lib\libcb.lib [ relcb\memcmp.rel ] +..\..\lib\libsysb.lib [ relsysb\execve.rel ] +..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] +..\..\lib\libcb.lib [ relcb\error.rel ] +..\..\lib\libiar.lib [ reliar\SMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LENDASG.rel ] +..\..\lib\libiar.lib [ reliar\LNOT.rel ] +..\..\lib\libcb.lib [ relcb\memset.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libiar.lib [ reliar\LXOR.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libiar.lib [ reliar\LORASG.rel ] +..\..\lib\libcb.lib [ relcb\strchr.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] +..\..\lib\libiar.lib [ reliar\LFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] +..\..\lib\libiar.lib [ reliar\ULMOD.rel ] +..\..\lib\libiar.lib [ reliar\SFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIV.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] +..\..\lib\libiar.lib [ reliar\LNEG.rel ] +..\..\lib\libiar.lib [ reliar\LMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] + + +User Base Address Definitions + +l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/gui/login.rel b/src/gui/login.rel new file mode 100644 index 00000000..ca893803 --- /dev/null +++ b/src/gui/login.rel @@ -0,0 +1,231 @@ +XL4 +H 3 areas 1B global symbols +M login +S setgid Ref00000000 +S GUIunit Ref00000000 +S ?BANK_FAST_LEAVE_L08 Ref00000000 +S ClearScreen Ref00000000 +S strrchr Ref00000000 +S gui_globals Ref00000000 +S chdir Ref00000000 +S setuid Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S setenv Ref00000000 +S strcmp Ref00000000 +S perror Ref00000000 +S execv Ref00000000 +S GUIgo Ref00000000 +S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S getpwnam Ref00000000 +S strcpy Ref00000000 +S ?ENT_AUTO_DIRECT_L09 Ref00000000 +S crypt Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S GUIinit Ref00000000 +S exit Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 23D flags 0 +S login_actionhandler Def0000010F +S login Def00000000 +S main Def00000208 +A CSTR size 20 flags 0 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 FD E5 DD E5 C5 21 C0 FF 39 F9 D5 +R 00 00 01 00 +T 0B 00 00 00 DD E1 21 0C 00 19 7E 23 66 6F AF +R 00 00 01 00 +T 16 00 00 00 B6 20 08 +R 00 00 01 00 +T 19 00 00 00 +R 00 00 01 00 +T 19 00 00 00 DD 36 0C 00 00 00 00 DD 36 0D +R 00 00 01 00 09 07 02 00 +T 20 00 00 00 00 00 00 00 +R 00 00 01 00 89 04 02 00 +T 21 00 00 00 +R 00 00 01 00 +T 21 00 00 00 21 00 00 39 36 2D 01 2F 00 DD 5E +R 00 00 01 00 +T 2C 00 00 00 0C DD 56 0D 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 04 00 +T 33 00 00 00 00 00 00 00 CD 00 00 00 00 E5 FD +R 00 00 01 00 02 04 04 00 02 09 0F 00 +T 3A 00 00 00 E1 7D B4 28 04 +R 00 00 01 00 +T 3F 00 00 00 +R 00 00 01 00 +T 3F 00 00 00 FD 23 18 09 +R 00 00 01 00 +T 43 00 00 00 +R 00 00 01 00 +T 43 00 00 00 DD 6E 0C DD 66 0D E5 FD E1 +R 00 00 01 00 +T 4C 00 00 00 +R 00 00 01 00 +T 4C 00 00 00 FD E5 C1 21 00 00 39 11 01 00 19 +R 00 00 01 00 +T 57 00 00 00 EB 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 11 00 02 0B 11 00 +T 5D 00 00 00 CD 00 00 00 00 21 00 00 39 E5 21 +R 00 00 01 00 02 05 0F 00 +T 66 00 00 00 42 00 39 7E 23 66 6F C1 71 23 70 +R 00 00 01 00 +T 71 00 00 00 21 40 00 39 47 23 66 68 23 23 AF +R 00 00 01 00 +T 7C 00 00 00 77 23 77 DD 5E 06 DD 56 07 3E +R 00 00 01 00 +T 86 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 00 00 02 09 00 00 +T 8B 00 00 00 00 00 00 00 DD 5E 04 DD 56 05 3E +R 00 00 01 00 02 04 0F 00 +T 94 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 99 00 00 00 00 00 00 00 DD 5E 0A DD 56 0B 3E +R 00 00 01 00 02 04 0F 00 +T A2 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 06 00 02 09 06 00 +T A7 00 00 00 00 00 00 00 21 01 00 E5 DD 4E 0A +R 00 00 01 00 02 04 0F 00 +T B0 00 00 00 DD 46 0B 11 08 00 00 00 3E +R 00 00 01 00 00 08 02 00 +T B7 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 09 00 02 09 09 00 +T BC 00 00 00 00 00 00 00 F1 21 01 00 E5 DD 4E +R 00 00 01 00 02 04 0F 00 +T C5 00 00 00 00 DD 46 01 11 0D 00 00 00 3E +R 00 00 01 00 00 09 02 00 +T CD 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 09 00 02 09 09 00 +T D2 00 00 00 00 00 00 00 F1 21 40 00 39 4E 23 +R 00 00 01 00 02 04 0F 00 +T DB 00 00 00 46 DD 5E 0C DD 56 0D 3E +R 00 00 01 00 +T E3 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0C 00 02 09 0C 00 +T E8 00 00 00 00 00 00 00 DD 5E 0C DD 56 0D 3E +R 00 00 01 00 02 04 0F 00 +T F1 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +T F6 00 00 00 00 00 00 00 11 01 00 3E +R 00 00 01 00 02 04 0F 00 +T FC 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 16 00 02 09 16 00 +T 01 01 00 00 00 00 00 00 21 42 00 39 F9 DD E1 +R 00 00 01 00 02 04 0F 00 +T 0A 01 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 02 00 +T 0F 01 00 00 +R 00 00 01 00 +T 0F 01 00 00 CD 00 00 00 00 E0 FF FD E5 DD 6E +R 00 00 01 00 02 05 12 00 +T 18 01 00 00 02 DD 66 03 E5 FD E1 21 26 00 DD +R 00 00 01 00 +T 23 01 00 00 4E 02 DD 46 03 09 46 23 66 68 23 +R 00 00 01 00 +T 2E 01 00 00 23 23 46 23 66 68 01 01 01 A7 ED +R 00 00 01 00 +T 39 01 00 00 42 C2 03 02 00 00 +R 00 00 01 00 00 06 01 00 +T 3D 01 00 00 +R 00 00 01 00 +T 3D 01 00 00 FD 6E 20 FD 66 21 46 DD 70 EC FD +R 00 00 01 00 +T 48 01 00 00 6E 20 FD 66 21 23 46 DD 70 ED DD +R 00 00 01 00 +T 53 01 00 00 36 EE 00 FD 6E 20 FD 66 21 36 00 +R 00 00 01 00 +T 5E 01 00 00 21 0E 00 39 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 10 00 +T 66 01 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 10 00 02 09 0F 00 +T 6D 01 00 00 E0 DD 74 E1 FD 4E 20 FD 46 21 03 +R 00 00 01 00 +T 78 01 00 00 03 DD 71 EA DD 70 EB 7D B4 28 71 +R 00 00 01 00 +T 83 01 00 00 +R 00 00 01 00 +T 83 01 00 00 23 23 7E 23 66 6F 46 DD 70 E2 DD +R 00 00 01 00 +T 8E 01 00 00 6E E0 DD 66 E1 23 23 46 23 66 68 +R 00 00 01 00 +T 99 01 00 00 23 46 DD 70 E3 DD 36 E4 00 21 +R 00 00 01 00 +T A3 01 00 00 04 00 39 4D 44 DD 5E EA DD 56 EB +R 00 00 01 00 +T AE 01 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 13 00 02 0A 13 00 +T B4 01 00 00 00 00 00 00 DD 75 E8 DD 74 E9 DD +R 00 00 01 00 02 04 0F 00 +T BD 01 00 00 4E E0 DD 46 E1 03 03 69 60 4E 23 +R 00 00 01 00 +T C8 01 00 00 46 DD 5E E8 DD 56 E9 3E +R 00 00 01 00 +T D0 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0A 00 02 09 0A 00 +T D5 01 00 00 00 00 00 00 7D B4 20 19 +R 00 00 01 00 02 04 0F 00 +T DB 01 00 00 +R 00 00 01 00 +T DB 01 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 03 00 02 0A 03 00 +T E1 01 00 00 00 00 00 00 01 00 00 DD 5E E0 DD +R 00 00 01 00 02 04 0F 00 +T EA 01 00 00 56 E1 3E 00 00 00 00 21 +R 00 00 01 00 29 07 01 00 +T EF 01 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 0F 00 +T F4 01 00 00 +R 00 00 01 00 +T F4 01 00 00 +R 00 00 01 00 +T F4 01 00 00 FD E5 D1 FD 7E 1C FD 6E 1A FD 66 +R 00 00 01 00 +T FF 01 00 00 1B CD 00 00 00 00 +R 00 00 01 00 02 06 0F 00 +T 03 02 00 00 +R 00 00 01 00 +T 03 02 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 08 00 +T 08 02 00 00 +R 00 00 01 00 +T 08 02 00 00 CD 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 0E 00 2B 0A 15 00 +T 0E 02 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 15 00 02 09 0F 00 +T 14 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 05 00 02 09 05 00 +T 19 02 00 00 00 00 00 00 01 10 00 09 36 +R 00 00 01 00 02 04 0F 00 +T 20 02 00 00 0F 01 00 00 23 36 0F 01 00 00 23 +R 00 00 01 00 09 04 01 00 89 0A 01 00 +T 25 02 00 00 36 0F 01 00 00 11 12 00 00 00 3E +R 00 00 01 00 29 05 01 00 00 0A 02 00 +T 2B 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0D 00 02 09 0D 00 +T 30 02 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 0F 00 2B 09 01 00 +T 35 02 00 00 00 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 02 04 01 00 02 09 0F 00 +T 3B 02 00 00 00 00 00 00 +R 00 00 01 00 02 04 08 00 +T 00 00 00 00 +R 00 00 02 00 +T 00 00 00 00 2F 62 69 6E 2F 73 68 00 +R 00 00 02 00 +T 08 00 00 00 +R 00 00 02 00 +T 08 00 00 00 48 4F 4D 45 00 +R 00 00 02 00 +T 0D 00 00 00 +R 00 00 02 00 +T 0D 00 00 00 55 53 45 52 00 +R 00 00 02 00 +T 12 00 00 00 +R 00 00 02 00 +T 12 00 00 00 2F 77 6E 64 2F 6C 6F 67 6E 2E 73 +R 00 00 02 00 +T 1D 00 00 00 63 72 00 +R 00 00 02 00 diff --git a/src/gui/m.bat b/src/gui/m.bat new file mode 100644 index 00000000..b5bd020f --- /dev/null +++ b/src/gui/m.bat @@ -0,0 +1,27 @@ +iccz80 -S -w -mb -v1 -z9 -A -I..\..\include\ wnd +@if errorlevel 1 goto failure +del wnd.r01 +as-z80 -l -o wnd.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z9 -A -I..\..\include\ login +@if errorlevel 1 goto failure +del login.r01 +as-z80 -l -o login.s01 +@if errorlevel 1 goto failure + +link-z80 -f wnd +@if errorlevel 1 goto failure +ihex2bin -l grlogin.i86 ..\..\bin\banked\grlogin +@if errorlevel 1 goto failure + +cd ..\..\bin +call appinst.bat +cd ..\src\gui + +@echo SUCCESS +@goto done +:failure +@echo FAILURE +:done + diff --git a/src/gui/p.bat b/src/gui/p.bat new file mode 100644 index 00000000..43e20c84 --- /dev/null +++ b/src/gui/p.bat @@ -0,0 +1,2 @@ +@echo off +set path=c:\iar\z80\bin;%path% diff --git a/src/gui/t.bat b/src/gui/t.bat new file mode 100644 index 00000000..f7e61fb0 --- /dev/null +++ b/src/gui/t.bat @@ -0,0 +1,33 @@ +iccz80 -S -w -mb -v1 -z9 -A -I..\..\include\ wnd +@if errorlevel 1 goto failure +del wnd.r01 +as-z80 -l -o wnd.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z9 -A -I..\..\include\ trans +@if errorlevel 1 goto failure +del trans.r01 +as-z80 -l -o trans.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z9 -A -I..\..\include\ test +@if errorlevel 1 goto failure +del test.r01 +as-z80 -l -o test.s01 +@if errorlevel 1 goto failure + +link-z80 -f test +@if errorlevel 1 goto failure +ihex2bin -l test.i86 ..\..\bin\banked\test +@if errorlevel 1 goto failure + +cd ..\..\bin +call appinst.bat +cd ..\src\gui + +@echo SUCCESS +@goto done +:failure +@echo FAILURE +:done + diff --git a/src/gui/test.c b/src/gui/test.c new file mode 100644 index 00000000..2ef63cbe --- /dev/null +++ b/src/gui/test.c @@ -0,0 +1,10 @@ +#include +#include + +void main(void){ + GUIinit(); + Transaction_init(); + gui_globals()->actionhandler=Transaction_handler; + GUIgo("/wnd/0000.scr"); /* Nick added /wnd/ */ + GUIunit(); +} \ No newline at end of file diff --git a/src/gui/test.lnk b/src/gui/test.lnk new file mode 100644 index 00000000..e1e593e3 --- /dev/null +++ b/src/gui/test.lnk @@ -0,0 +1,15 @@ +-k ..\..\lib +-l libcb.lib +-l libsysb.lib +-l libiar.lib +-m +-u +-i +-o test +-bl RCODE=0x8100 +-bl CODE=0x4000,0x10000 +-bc CODE=0x4000 +..\..\lib\c0b.rel +wnd +trans +test diff --git a/src/gui/test.map b/src/gui/test.map new file mode 100644 index 00000000..6cb50e55 --- /dev/null +++ b/src/gui/test.map @@ -0,0 +1,248 @@ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +. .ABS. 00000000 00000000 = 0. bytes (ABS,OVR) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR + 00000000 .__.ABS. | 00000000 ?CL64180L | 00000000 ?CL64180B + 00000014 e__DEFAUL | 00000014 l__DEFAUL | 00000034 l_CONST + 000000E3 l_CSTR | 00000166 l_CDATA0 | 00000166 l_IDATA0 + 00000247 l_UDATA0 | 000003AF l_RCODE | 00001000 l_CSTACK + 00004000 s_CODE | 00008100 s_RCODE | 000084AF e_RCODE + 000084AF s_CONST | 000084E3 s_CSTR | 000084E3 e_CONST + 000085C6 e_CSTR | 000085C6 s_IDATA0 | 000085C6 s_CDATA0 + 0000872C s_UDATA0 | 0000872C e_CCSTR | 0000872C e_ECSTR + 0000872C s_CCSTR | 0000872C e_CDATA0 | 0000872C s_ECSTR + 0000872C e_IDATA0 | 00008973 e_UDATA0 | 00008973 s_CSTACK + 00009973 e_CSTACK | 0000C141 l_CODE | 00010141 e_CODE +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +_DEFAULT 00000000 00000014 = 20. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +RCODE 00008100 000003AF = 943. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008100 __init | 0000811F ?L_MUL_L0 | 000081A3 ?BANK_LEA + 000081A9 ?BANK_FAS | 000081AE ?S_MUL_L0 | 000081C4 ?C_V_SWIT + 000081D6 ?L_ADDASG | 000081EF ?ENT_PARM | 000081FB ?BANK_CAL + 00008208 ?S_S_SWIT | 0000821C ?S_V_SWIT | 00008239 ?S_SWITCH + 00008247 ?SL_MOD_L | 0000827A ?ENT_AUTO | 0000828E ?V_SWITCH + 00008298 ?SL_DIV_L | 000082C8 ?SS_CMP_L | 000082DA ?L_INC_L0 + 000082E2 ?US_MOD_L | 000082EB ?SS_DIV_L | 00008307 ?US_DIV_L + 00008315 ?SL_RSH_L | 00008323 ?L_DIVMOD | 0000837B ?BANK_LEA + 00008387 ?SS_RSH_L | 00008391 ?S_DIVMOD | 000083A7 ?S_MULASG + 000083B1 ?L_NOT_L0 | 000083C0 ?LEAVE_DI | 000083C7 ?L_FIND_S + 0000840B ?UL_DIVAS | 0000841B ?UL_MOD_L | 00008440 ?S_FIND_S + 0000845C ?UL_DIV_L | 00008484 ?L_NEG_L0 | 00008496 ?L_END_MU + 0000849F ?L_MULASG +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CONST 000084AF 00000034 = 52. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTR 000084E3 000000E3 = 227. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +IDATA0 000085C6 00000166 = 358. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 000085DE __IO_list | 000085E0 stdin | 000085F8 stdout + 00008610 stderr | 0000862A __on_exit | 0000862C __ctype +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CDATA0 000085C6 00000166 = 358. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +ECSTR 0000872C 00000000 = 0. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CCSTR 0000872C 00000000 = 0. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CODE 00004000 0000C141 = 49473. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00004640 GraphicsO | 000046CE GraphicsC | 000046E3 Move + 00004722 ClearRect | 00004765 DrawRectN | 000047AA FillRect + 000047EF FillRectN | 00004834 GrayRect | 00004879 Text + 000048A6 TouchRegi | 000048FD ClearScre | 0000493A EnableScr + 00004978 grSetFont | 000049B5 fontSearc | 000049E5 setCurren + 00004A73 loadFont | 00004B1A stringwid | 00004B93 stringhei + 00004BB0 stringhei | 00004BC3 stringhei | 00004BCC stringwid + 00004BDD stringwid | 00004BE6 stringwid | 00004BEF Component + 00004C99 Component | 00004CE6 Component | 00004D44 Component + 00004D8A Component | 00004DCE Component | 00004E06 Component + 00004FD7 Component | 00004FF6 Component | 0000505F Component + 00005112 Window_ha | 000053DF Window_pa | 0000556C Root_pain + 000055A3 Window_ad | 000055B1 Window_ne | 00005603 Button_ha + 000056BA Button_dr | 00005776 Button_pa | 0000586F Button_ad + 00005875 Button_ne | 000058C7 ToggleBut | 00005963 ToggleBut + 00005A4F ToggleBut | 00005AA1 Dialog_ha | 00005B5A Dialog_ne + 00005C49 Display_h | 00005CCA Display_p | 00005E16 Display_n + 00005E70 Label_han | 00005E76 Label_pai | 00005ED7 Label_new + 00005F30 rootWindo | 00005F4E screenbui | 00006328 root_acti + 00006660 read_stri | 00006735 gui_globa | 0000673B GUIinit + 00006862 GUIunit | 00006887 GUIgo | 0000693C Transacti + 000069B1 Transacti | 00006FD3 main | 00007011 sprintf + 00007055 fflush | 00007268 _write | 00007287 lseek + 000072B4 __stdio_c | 0000731F __stdio_i | 0000735D close + 00007372 strlen | 000073A9 ioctl | 000073D4 isatty + 0000740F fstat | 00007426 free | 00007506 strcpy + 0000752D atoi | 000076C3 vfprintf | 00007C1E ltoa + 00007C81 atol | 00007C97 __longtoa | 00007E2B itoa + 00007E94 open | 00014000 malloc | 0001422C exit + 0001425C _read | 0001427B unix | 00014295 memcpy + 00014363 on_exit | 000143DC atexit | 000143EF strcat + 0001440F unix_long | 00014429 _exit | 0001443E fputc + 00014550 ultoa | 000145A5 strtol | 0001464D sbrk + 000146E8 strtoul | 0001483F toupper | 00014864 tolower +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +UDATA0 0000872C 00000247 = 583. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 0000872C _argc | 0000872E _argv | 00008730 environ + 00008732 errno | 00008734 __cleanup | 00008737 global + 00008739 trans | 0000893B __malloc_ | 0000893F __malloc_ + 00008941 __on_exit +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTACK 00008973 00001000 = 4096. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + +Files Linked [ module(s) ] + +..\..\lib\c0b.rel [ _c0b ] +wnd [ wnd ] +trans [ trans ] +test [ test ] + + +Libraries Linked [ object file ] + +..\..\lib\libcb.lib [ relcb\sprintf.rel ] +..\..\lib\libiar.lib [ reliar\LMUL.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libiar.lib [ reliar\SMUL.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] +..\..\lib\libsysb.lib [ relsysb\ioctl.rel ] +..\..\lib\libiar.lib [ reliar\LADDASG.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\SSSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SVSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SSWITCHEND.rel ] +..\..\lib\libiar.lib [ reliar\SLMOD.rel ] +..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] +..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] +..\..\lib\libiar.lib [ reliar\SLDIV.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] +..\..\lib\libcb.lib [ relcb\atol.rel ] +..\..\lib\libiar.lib [ reliar\SSCMP.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] +..\..\lib\libiar.lib [ reliar\LINC.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] +..\..\lib\libiar.lib [ reliar\USMOD.rel ] +..\..\lib\libiar.lib [ reliar\SSDIV.rel ] +..\..\lib\libiar.lib [ reliar\USDIV.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] +..\..\lib\libiar.lib [ reliar\SLRSH.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] +..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] +..\..\lib\libiar.lib [ reliar\SSRSH.rel ] +..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] +..\..\lib\libiar.lib [ reliar\SMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LNOT.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] +..\..\lib\libiar.lib [ reliar\LFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] +..\..\lib\libiar.lib [ reliar\ULMOD.rel ] +..\..\lib\libiar.lib [ reliar\SFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIV.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] +..\..\lib\libiar.lib [ reliar\LNEG.rel ] +..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] +..\..\lib\libiar.lib [ reliar\LMULASG.rel ] + + +User Base Address Definitions + +l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/gui/test.rel b/src/gui/test.rel new file mode 100644 index 00000000..3862ba0b --- /dev/null +++ b/src/gui/test.rel @@ -0,0 +1,47 @@ +XL4 +H 3 areas B global symbols +M test +S GUIunit Ref00000000 +S ?BANK_FAST_LEAVE_L08 Ref00000000 +S gui_globals Ref00000000 +S GUIgo Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S Transaction_handler Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S Transaction_init Ref00000000 +S GUIinit Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 3E flags 0 +S main Def00000000 +A CSTR size E flags 0 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 C5 D5 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 08 00 +T 05 00 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 08 00 02 09 04 00 +T 0B 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 10 00 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 04 04 00 2B 09 02 00 +T 15 00 00 00 00 00 00 00 CD 00 00 00 00 01 +R 00 00 01 00 02 04 02 00 02 09 04 00 +T 1B 00 00 00 10 00 09 36 00 00 00 00 23 36 +R 00 00 01 00 0B 08 05 00 +T 22 00 00 00 00 00 00 00 23 36 00 00 00 00 11 +R 00 00 01 00 8B 04 05 00 2B 0A 05 00 +T 27 00 00 00 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 03 00 +T 2C 00 00 00 00 00 00 00 CD 00 00 00 00 3E +R 00 00 01 00 02 04 03 00 02 09 04 00 +T 32 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 00 00 02 09 00 00 +T 37 00 00 00 00 00 00 00 D1 C1 C3 00 00 00 00 +R 00 00 01 00 02 04 04 00 02 0B 01 00 +T 00 00 00 00 +R 00 00 02 00 +T 00 00 00 00 2F 77 6E 64 2F 30 30 30 30 2E 73 +R 00 00 02 00 +T 0B 00 00 00 63 72 00 +R 00 00 02 00 diff --git a/src/gui/trans.c b/src/gui/trans.c new file mode 100644 index 00000000..c41491a0 --- /dev/null +++ b/src/gui/trans.c @@ -0,0 +1,124 @@ +#include +#include +#include "..\libc\malloc-l.h" +#undef NULL +#define NULL 0 + +/************************************************ + * Transactions * + ************************************************/ + +struct Global_Trans* trans; + +void Transaction_init(){ + trans=(struct Global_Trans*) malloc(sizeof(struct Global_Trans)); + trans->first=(struct Transaction*) malloc(sizeof(struct Transaction)); + trans->first->next=NULL; + trans->first->barcode[0]=0; + trans->first->stuks=0; + trans->first->prijs=0; +} + +void Transaction_handler(struct Component* this){ + struct ActionXDS *act; + + act=(struct ActionXDS*) (this->xds); + + if(trans==NULL){ + Transaction_init(); + } + + if(act->action==0x1000) /* Transaction module init*/ + { + trans->barcode=act->lParam & 0xff; + trans->stuks=(act->lParam>>8) & 0xff; + trans->prijs=(act->lParam>>16) & 0xff; + Component_setlabel(Component_find(this,trans->barcode),"Barcode"); + Component_setlabel(Component_find(this,trans->stuks),"Stuks"); + Component_setlabel(Component_find(this,trans->prijs),"Prijs"); + } + + if(act->action>=0x1010 && act->action<=0x1012){ + struct Component* display; + struct Transaction* tr=trans->first; + while(tr->next!=NULL) + tr=tr->next; + display=Component_find(this->parent,act->wParam); + Component_setlabel(this, display->label); + Component_setlabel(display,""); + display->paint(display); + switch(act->action){ + case 0x1010: + strcpy(tr->barcode,this->label); + break; + case 0x1011: + tr->stuks=atoi(this->label); + break; + case 0x1012: + tr->prijs=atol(this->label); + break; + } + this->paint(this); + } + + if(act->action==0x101e){ + int prn,i; + struct sgttyb temp; + struct Transaction* tr; + long totaal=0; + char s[80]; + + tr=trans->first; + + prn=open("/dev/printer",O_WRONLY); + gtty(prn,&temp); + temp.sg_flags=RAW | UNBUFF; + stty(prn,&temp); + while(tr!=NULL){ + if(tr->stuks!=0){ + if(tr->stuks==1) + sprintf(s,"%13s Verkoopartikel \x7c%7ld,%02ld\r\n",tr->barcode,tr->prijs/100,tr->prijs%100); + else + sprintf(s,"%13s Verkoopartikel\r\n%4dx @ \x7c %7ld,%02ld \x7c%7ld,%02ld\r\n",tr->barcode,tr->stuks,tr->prijs/100,tr->prijs%100,(tr->stuks*tr->prijs)/100,(tr->stuks*tr->prijs)%100); + totaal+=tr->stuks*tr->prijs; + write(prn,s,strlen(s)); + } + tr=tr->next; + } + sprintf(s,"\r\n%13sTotaal:%10s\x7c%7ld,%02ld\r\n\r\n\r\n","","",totaal/100,totaal%100); + write(prn,s,strlen(s)); + close(prn); + tr=trans->first; + while(tr!=NULL){ + free(tr); + tr=tr->next; + } + trans->first=(struct Transaction*) malloc(sizeof(struct Transaction)); + trans->first->next=NULL; + trans->first->barcode[0]=0; + trans->first->stuks=0; + trans->first->prijs=0; + + } + + if(act->action==0x101f){ + struct Transaction* tr=trans->first; + while(tr->next!=NULL) + tr=tr->next; + trans->barcode=act->lParam & 0xff; + trans->stuks=(act->lParam>>8) & 0xff; + trans->prijs=(act->lParam>>16) & 0xff; + Component_setlabel(Component_find(this->parent,trans->barcode),"Barcode"); + Component_setlabel(Component_find(this->parent,trans->stuks),"Stuks"); + Component_setlabel(Component_find(this->parent,trans->prijs),"Prijs"); + this->parent->paint(this->parent); + tr->next=(struct Transaction*) malloc(sizeof(struct Transaction)); + tr=tr->next; + tr->next=NULL; + tr->barcode[0]=0; + tr->stuks=0; + tr->prijs=0; + } + +} + diff --git a/src/gui/trans.h b/src/gui/trans.h new file mode 100644 index 00000000..b4833438 --- /dev/null +++ b/src/gui/trans.h @@ -0,0 +1,16 @@ +#include +struct Transaction{ + char barcode[14]; + int stuks; + long prijs; + struct Transaction* next; +}; + +struct Global_Trans{ + int barcode,stuks,prijs; + struct Transaction* first; +}; + +void Transaction_init(); +void Transaction_handler(struct Component* this); + diff --git a/src/gui/trans.rel b/src/gui/trans.rel new file mode 100644 index 00000000..0fc49de1 --- /dev/null +++ b/src/gui/trans.rel @@ -0,0 +1,638 @@ +XL4 +H 4 areas 1D global symbols +M trans +S ?L_MUL_L03 Ref00000000 +S sprintf Ref00000000 +S ?BANK_FAST_LEAVE_L08 Ref00000000 +S _write Ref00000000 +S Component_find Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S close Ref00000000 +S strlen Ref00000000 +S ioctl Ref00000000 +S ?L_ADDASG_L03 Ref00000000 +S free Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S strcpy Ref00000000 +S ?S_S_SWITCH_L06 Ref00000000 +S ?SL_MOD_L03 Ref00000000 +S ?ENT_AUTO_DIRECT_L09 Ref00000000 +S atoi Ref00000000 +S ?SL_DIV_L03 Ref00000000 +S atol Ref00000000 +S ?SS_CMP_L02 Ref00000000 +S open Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S ?SL_RSH_L03 Ref00000000 +S malloc Ref00000000 +S Component_setlabel Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 697 flags 0 +S Transaction_handler Def00000075 +S Transaction_init Def00000000 +A CSTR size A8 flags 0 +A UDATA0 size 2 flags 0 +S trans Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 C5 D5 11 08 00 CD 6D 00 00 00 22 +R 00 00 01 00 00 0A 01 00 +T 09 00 00 00 00 00 00 00 01 06 00 09 E5 CD +R 00 00 01 00 00 04 03 00 +T 11 00 00 00 6A 00 00 00 4D 44 E1 71 23 70 21 +R 00 00 01 00 00 04 01 00 +T 1A 00 00 00 06 00 ED 4B 00 00 00 00 09 56 23 +R 00 00 01 00 00 08 03 00 +T 23 00 00 00 66 6A 11 14 00 19 AF 77 23 77 21 +R 00 00 01 00 +T 2E 00 00 00 06 00 ED 4B 00 00 00 00 09 7E 23 +R 00 00 01 00 00 08 03 00 +T 37 00 00 00 66 6F 72 21 06 00 ED 4B +R 00 00 01 00 +T 3F 00 00 00 00 00 00 00 09 56 23 66 6A 11 +R 00 00 01 00 00 04 03 00 +T 47 00 00 00 0E 00 19 AF 77 23 77 21 06 00 ED +R 00 00 01 00 +T 52 00 00 00 4B 00 00 00 00 09 46 23 66 68 01 +R 00 00 01 00 00 05 03 00 +T 5B 00 00 00 10 00 09 77 23 77 23 77 23 77 D1 +R 00 00 01 00 +T 66 00 00 00 C1 C3 00 00 00 00 +R 00 00 01 00 02 06 02 00 +T 6A 00 00 00 +R 00 00 01 00 +T 6A 00 00 00 11 16 00 +R 00 00 01 00 +T 6D 00 00 00 +R 00 00 01 00 +T 6D 00 00 00 3E 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 05 17 00 02 0A 17 00 +T 73 00 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 75 00 00 00 +R 00 00 01 00 +T 75 00 00 00 CD 00 00 00 00 9E FF FD E5 21 +R 00 00 01 00 02 05 0F 00 +T 7D 00 00 00 26 00 DD 4E 02 DD 46 03 09 46 DD +R 00 00 01 00 +T 88 00 00 00 70 9E 23 66 DD 74 9F 2A +R 00 00 01 00 +T 90 00 00 00 00 00 00 00 7D B4 20 08 +R 00 00 01 00 00 04 03 00 +T 96 00 00 00 +R 00 00 01 00 +T 96 00 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 9C 00 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 9E 00 00 00 +R 00 00 01 00 +T 9E 00 00 00 68 DD 66 9F 23 23 23 3E 10 23 AE +R 00 00 01 00 +T A9 00 00 00 2B B6 20 64 +R 00 00 01 00 +T AD 00 00 00 +R 00 00 01 00 +T AD 00 00 00 21 07 00 48 DD 46 9F 09 6E 67 E5 +R 00 00 01 00 +T B8 00 00 00 2A 00 00 00 00 C1 71 23 70 2A +R 00 00 01 00 00 05 03 00 +T C0 00 00 00 00 00 00 00 23 23 E5 CD +R 00 00 01 00 00 04 03 00 +T C6 00 00 00 D7 05 00 00 E1 71 23 70 21 04 00 +R 00 00 01 00 00 04 01 00 +T CF 00 00 00 ED 4B 00 00 00 00 09 E5 21 07 00 +R 00 00 01 00 00 06 03 00 +T D8 00 00 00 DD 5E 9E DD 56 9F 19 5E 23 56 23 +R 00 00 01 00 +T E3 00 00 00 4E 23 46 EB 3E 10 CD EB 05 00 00 +R 00 00 01 00 00 0B 01 00 +T EC 00 00 00 E1 71 23 70 2A 00 00 00 00 4E 23 +R 00 00 01 00 00 09 03 00 +T F5 00 00 00 46 DD 5E 02 DD 56 03 CD +R 00 00 01 00 +T FD 00 00 00 12 06 00 00 DD 5E 02 DD 56 03 CD +R 00 00 01 00 00 04 01 00 +T 06 01 00 00 F2 05 00 00 DD 5E 02 DD 56 03 CD +R 00 00 01 00 00 04 01 00 +T 0F 01 00 00 2F 06 00 00 +R 00 00 01 00 00 04 01 00 +T 11 01 00 00 +R 00 00 01 00 +T 11 01 00 00 DD 6E 9E DD 66 9F 23 23 23 46 23 +R 00 00 01 00 +T 1C 01 00 00 66 68 01 10 90 3E 80 AC 67 ED 42 +R 00 00 01 00 +T 27 01 00 00 DA 56 02 00 00 DD 6E 9E DD 66 9F +R 00 00 01 00 00 05 01 00 +T 30 01 00 00 23 23 23 4E 23 46 21 12 10 CD +R 00 00 01 00 +T 3A 01 00 00 00 00 00 00 DA 56 02 00 00 +R 00 00 01 00 02 04 13 00 00 09 01 00 +T 3F 01 00 00 +R 00 00 01 00 +T 3F 01 00 00 +R 00 00 01 00 +T 3F 01 00 00 +R 00 00 01 00 +T 3F 01 00 00 21 06 00 ED 4B 00 00 00 00 09 46 +R 00 00 01 00 00 09 03 00 +T 48 01 00 00 23 66 68 +R 00 00 01 00 +T 4B 01 00 00 +R 00 00 01 00 +T 4B 01 00 00 DD 75 A2 DD 74 A3 +R 00 00 01 00 +T 51 01 00 00 +R 00 00 01 00 +T 51 01 00 00 21 14 00 DD 4E A2 DD 46 A3 09 7E +R 00 00 01 00 +T 5C 01 00 00 23 B6 28 0A +R 00 00 01 00 +T 60 01 00 00 +R 00 00 01 00 +T 60 01 00 00 21 14 00 09 56 23 66 6A 18 E1 +R 00 00 01 00 +T 6A 01 00 00 +R 00 00 01 00 +T 6A 01 00 00 21 05 00 DD 4E 9E DD 46 9F 09 4E +R 00 00 01 00 +T 75 01 00 00 23 46 21 11 00 DD 5E 02 DD 56 03 +R 00 00 01 00 +T 80 01 00 00 19 5E 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 04 00 +T 87 01 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 04 00 02 09 0B 00 +T 8E 01 00 00 A0 DD 74 A1 01 20 00 09 4E 23 46 +R 00 00 01 00 +T 99 01 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 +R 00 00 01 00 2B 0B 18 00 +T A1 01 00 00 21 00 00 00 00 CD 00 00 00 00 01 +R 00 00 01 00 02 05 18 00 02 0A 0B 00 +T A8 01 00 00 14 00 00 00 DD 5E A0 DD 56 A1 3E +R 00 00 01 00 00 04 02 00 +T B1 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 18 00 02 09 18 00 +T B6 01 00 00 00 00 00 00 DD 5E A0 4B DD 56 A1 +R 00 00 01 00 02 04 0B 00 +T BF 01 00 00 CD 43 06 00 00 DD 6E 9E DD 66 9F +R 00 00 01 00 00 05 01 00 +T C8 01 00 00 23 23 23 5E 23 56 CD 00 00 00 00 +R 00 00 01 00 02 0B 0D 00 +T D1 01 00 00 10 10 03 00 4C 02 00 00 +R 00 00 01 00 00 08 01 00 +T D7 01 00 00 DD 01 00 00 FA 01 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T DB 01 00 00 1F 02 00 00 +R 00 00 01 00 00 04 01 00 +T DD 01 00 00 +R 00 00 01 00 +T DD 01 00 00 21 20 00 DD 4E 02 DD 46 03 09 4E +R 00 00 01 00 +T E8 01 00 00 23 46 DD 5E A2 DD 56 A3 3E +R 00 00 01 00 +T F1 01 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0C 00 02 09 0C 00 +T F6 01 00 00 00 00 00 00 18 52 +R 00 00 01 00 02 04 0B 00 +T FA 01 00 00 +R 00 00 01 00 +T FA 01 00 00 21 0E 00 DD 4E A2 DD 46 A3 09 E5 +R 00 00 01 00 +T 05 02 00 00 21 20 00 DD 4E 02 DD 46 03 09 5E +R 00 00 01 00 +T 10 02 00 00 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 10 00 +T 15 02 00 00 00 00 00 00 CD 00 00 00 00 4D 44 +R 00 00 01 00 02 04 10 00 02 09 0B 00 +T 1C 02 00 00 E1 18 2A +R 00 00 01 00 +T 1F 02 00 00 +R 00 00 01 00 +T 1F 02 00 00 21 20 00 DD 4E 02 DD 46 03 09 5E +R 00 00 01 00 +T 2A 02 00 00 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 12 00 +T 2F 02 00 00 00 00 00 00 CD 00 00 00 00 7C 07 +R 00 00 01 00 02 04 12 00 02 09 0B 00 +T 36 02 00 00 9F 4F 41 E5 21 10 00 DD 5E A2 DD +R 00 00 01 00 +T 41 02 00 00 56 A3 19 D1 73 23 72 23 +R 00 00 01 00 +T 49 02 00 00 +R 00 00 01 00 +T 49 02 00 00 71 23 70 +R 00 00 01 00 +T 4C 02 00 00 +R 00 00 01 00 +T 4C 02 00 00 DD 5E 02 4B DD 56 03 CD +R 00 00 01 00 +T 54 02 00 00 43 06 00 00 +R 00 00 01 00 00 04 01 00 +T 56 02 00 00 +R 00 00 01 00 +T 56 02 00 00 DD 6E 9E DD 66 9F 23 23 23 46 23 +R 00 00 01 00 +T 61 02 00 00 66 68 01 1E 10 A7 ED 42 C2 +R 00 00 01 00 +T 6A 02 00 00 B3 04 00 00 +R 00 00 01 00 00 04 01 00 +T 6C 02 00 00 +R 00 00 01 00 +T 6C 02 00 00 AF DD 77 AC DD 77 AD DD 77 AE DD +R 00 00 01 00 +T 77 02 00 00 77 AF 21 06 00 ED 4B 00 00 00 00 +R 00 00 01 00 00 0B 03 00 +T 80 02 00 00 09 46 23 66 68 E5 FD E1 21 01 00 +R 00 00 01 00 +T 8B 02 00 00 E5 21 15 00 00 00 E5 3E +R 00 00 01 00 00 06 02 00 +T 91 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 14 00 02 09 14 00 +T 96 02 00 00 00 00 00 00 F1 F1 DD 75 A0 DD 74 +R 00 00 01 00 02 04 0B 00 +T 9F 02 00 00 A1 21 08 00 39 E5 21 00 00 E5 DD +R 00 00 01 00 +T AA 02 00 00 6E A0 DD 66 A1 E5 3E 00 00 00 00 +R 00 00 01 00 2B 0B 08 00 +T B2 02 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 08 00 02 0A 0B 00 +T B9 02 00 00 F1 F1 DD 36 A8 60 DD 36 A9 00 21 +R 00 00 01 00 +T C4 02 00 00 08 00 39 E5 21 01 00 E5 DD 6E A0 +R 00 00 01 00 +T CF 02 00 00 DD 66 A1 E5 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 08 00 +T D6 02 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 0B 00 +T DD 02 00 00 F1 +R 00 00 01 00 +T DE 02 00 00 +R 00 00 01 00 +T DE 02 00 00 FD E5 E1 7D B4 CA C8 03 00 00 +R 00 00 01 00 00 0A 01 00 +T E6 02 00 00 +R 00 00 01 00 +T E6 02 00 00 FD 7E 0E FD B6 0F CA BC 03 00 00 +R 00 00 01 00 00 0B 01 00 +T EF 02 00 00 +R 00 00 01 00 +T EF 02 00 00 3E 01 FD AE 0E FD B6 0F 20 29 +R 00 00 01 00 +T F9 02 00 00 +R 00 00 01 00 +T F9 02 00 00 6F 67 E5 2E 64 E5 CD 5A 06 00 00 +R 00 00 01 00 00 0B 01 00 +T 02 03 00 00 C5 E5 6F 67 E5 2E 64 E5 CD +R 00 00 01 00 +T 0B 03 00 00 69 06 00 00 C5 E5 FD E5 21 +R 00 00 01 00 00 04 01 00 +T 12 03 00 00 22 00 00 00 E5 21 20 00 39 E5 CD +R 00 00 01 00 00 04 02 00 +T 1B 03 00 00 52 06 00 00 21 0E 00 18 68 +R 00 00 01 00 00 04 01 00 +T 22 03 00 00 +R 00 00 01 00 +T 22 03 00 00 21 00 00 E5 2E 64 E5 FD 6E 0E FD +R 00 00 01 00 +T 2D 03 00 00 66 0F 7C 07 9F 4F 41 C5 E5 CD +R 00 00 01 00 +T 37 03 00 00 78 06 00 00 CD 00 00 00 00 C5 E5 +R 00 00 01 00 00 04 01 00 02 09 0E 00 +T 3E 03 00 00 21 00 00 E5 2E 64 E5 FD 6E 0E FD +R 00 00 01 00 +T 49 03 00 00 66 0F 7C 07 9F 4F 41 C5 E5 CD +R 00 00 01 00 +T 53 03 00 00 78 06 00 00 CD 00 00 00 00 C5 E5 +R 00 00 01 00 00 04 01 00 02 09 11 00 +T 5A 03 00 00 21 00 00 E5 2E 64 E5 CD +R 00 00 01 00 +T 62 03 00 00 5A 06 00 00 C5 E5 21 00 00 E5 2E +R 00 00 01 00 00 04 01 00 +T 6B 03 00 00 64 E5 CD 69 06 00 00 C5 E5 FD 6E +R 00 00 01 00 00 07 01 00 +T 74 03 00 00 0E FD 66 0F E5 FD E5 21 +R 00 00 01 00 +T 7C 03 00 00 45 00 00 00 E5 21 2A 00 39 E5 CD +R 00 00 01 00 00 04 02 00 +T 85 03 00 00 52 06 00 00 21 18 00 +R 00 00 01 00 00 04 01 00 +T 8A 03 00 00 +R 00 00 01 00 +T 8A 03 00 00 39 F9 +R 00 00 01 00 +T 8C 03 00 00 +R 00 00 01 00 +T 8C 03 00 00 21 10 00 39 E5 FD 5E 0E FD 56 0F +R 00 00 01 00 +T 97 03 00 00 7A 07 9F 4F 41 C5 D5 CD +R 00 00 01 00 +T 9F 03 00 00 78 06 00 00 EB E1 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 0B 09 00 +T A6 03 00 00 21 14 00 39 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 07 00 +T AE 03 00 00 00 00 00 00 CD 00 00 00 00 E5 21 +R 00 00 01 00 02 04 07 00 02 09 0B 00 +T B5 03 00 00 16 00 39 CD 87 06 00 00 F1 +R 00 00 01 00 00 08 01 00 +T BC 03 00 00 +R 00 00 01 00 +T BC 03 00 00 FD 6E 14 FD 66 15 E5 FD E1 C3 +R 00 00 01 00 +T C6 03 00 00 DE 02 00 00 +R 00 00 01 00 00 04 01 00 +T C8 03 00 00 +R 00 00 01 00 +T C8 03 00 00 6F 67 E5 2E 64 E5 DD 4E AE DD 46 +R 00 00 01 00 +T D3 03 00 00 AF DD 6E AC DD 66 AD CD +R 00 00 01 00 +T DB 03 00 00 00 00 00 00 C5 E5 6F 67 E5 2E 64 +R 00 00 01 00 02 04 0E 00 +T E4 03 00 00 E5 DD 4E AE DD 46 AF DD 6E AC DD +R 00 00 01 00 +T EF 03 00 00 66 AD CD 00 00 00 00 C5 E5 21 +R 00 00 01 00 02 07 11 00 +T F7 03 00 00 14 00 00 00 E5 E5 21 85 00 00 00 +R 00 00 01 00 00 04 02 00 00 0B 02 00 +T FE 03 00 00 E5 21 22 00 39 E5 CD 52 06 00 00 +R 00 00 01 00 00 0B 01 00 +T 07 04 00 00 21 10 00 39 F9 21 14 00 39 EB 3E +R 00 00 01 00 +T 12 04 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 17 04 00 00 00 00 00 00 E5 21 16 00 39 CD +R 00 00 01 00 02 04 0B 00 +T 1F 04 00 00 87 06 00 00 F1 DD 5E A0 DD 56 A1 +R 00 00 01 00 00 04 01 00 +T 28 04 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 06 00 02 0A 06 00 +T 2E 04 00 00 00 00 00 00 21 06 00 ED 4B +R 00 00 01 00 02 04 0B 00 +T 35 04 00 00 00 00 00 00 09 46 23 66 68 +R 00 00 01 00 00 04 03 00 +T 3C 04 00 00 +R 00 00 01 00 +T 3C 04 00 00 E5 FD E1 +R 00 00 01 00 +T 3F 04 00 00 +R 00 00 01 00 +T 3F 04 00 00 7D B4 28 13 +R 00 00 01 00 +T 43 04 00 00 +R 00 00 01 00 +T 43 04 00 00 FD E5 D1 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 0A 00 +T 49 04 00 00 00 00 00 00 CD 00 00 00 00 FD 6E +R 00 00 01 00 02 04 0A 00 02 09 0B 00 +T 50 04 00 00 14 FD 66 15 18 E6 +R 00 00 01 00 +T 56 04 00 00 +R 00 00 01 00 +T 56 04 00 00 21 06 00 ED 4B 00 00 00 00 09 E5 +R 00 00 01 00 00 09 03 00 +T 5F 04 00 00 CD 6A 00 00 00 EB E1 73 23 72 21 +R 00 00 01 00 00 05 01 00 +T 68 04 00 00 06 00 ED 4B 00 00 00 00 09 56 23 +R 00 00 01 00 00 08 03 00 +T 71 04 00 00 66 6A 11 14 00 19 AF 77 23 77 21 +R 00 00 01 00 +T 7C 04 00 00 06 00 ED 4B 00 00 00 00 09 7E 23 +R 00 00 01 00 00 08 03 00 +T 85 04 00 00 66 6F 72 21 06 00 ED 4B +R 00 00 01 00 +T 8D 04 00 00 00 00 00 00 09 56 23 66 6A 11 +R 00 00 01 00 00 04 03 00 +T 95 04 00 00 0E 00 19 AF 77 23 77 21 06 00 ED +R 00 00 01 00 +T A0 04 00 00 4B 00 00 00 00 09 46 23 66 68 01 +R 00 00 01 00 00 05 03 00 +T A9 04 00 00 10 00 09 77 23 77 23 77 23 77 +R 00 00 01 00 +T B3 04 00 00 +R 00 00 01 00 +T B3 04 00 00 DD 6E 9E DD 66 9F 23 23 23 46 23 +R 00 00 01 00 +T BE 04 00 00 66 68 01 1F 10 A7 ED 42 C2 +R 00 00 01 00 +T C7 04 00 00 D2 05 00 00 +R 00 00 01 00 00 04 01 00 +T C9 04 00 00 +R 00 00 01 00 +T C9 04 00 00 21 06 00 ED 4B 00 00 00 00 09 46 +R 00 00 01 00 00 09 03 00 +T D2 04 00 00 23 66 68 +R 00 00 01 00 +T D5 04 00 00 +R 00 00 01 00 +T D5 04 00 00 DD 75 A0 DD 74 A1 +R 00 00 01 00 +T DB 04 00 00 +R 00 00 01 00 +T DB 04 00 00 21 14 00 DD 4E A0 DD 46 A1 09 7E +R 00 00 01 00 +T E6 04 00 00 23 B6 28 0A +R 00 00 01 00 +T EA 04 00 00 +R 00 00 01 00 +T EA 04 00 00 21 14 00 09 56 23 66 6A 18 E1 +R 00 00 01 00 +T F4 04 00 00 +R 00 00 01 00 +T F4 04 00 00 21 07 00 DD 4E 9E DD 46 9F 09 6E +R 00 00 01 00 +T FF 04 00 00 67 E5 2A 00 00 00 00 C1 71 23 70 +R 00 00 01 00 00 07 03 00 +T 08 05 00 00 2A 00 00 00 00 23 23 E5 CD +R 00 00 01 00 00 05 03 00 +T 0F 05 00 00 D7 05 00 00 E1 71 23 70 21 04 00 +R 00 00 01 00 00 04 01 00 +T 18 05 00 00 ED 4B 00 00 00 00 09 E5 21 07 00 +R 00 00 01 00 00 06 03 00 +T 21 05 00 00 DD 5E 9E DD 56 9F 19 5E 23 56 23 +R 00 00 01 00 +T 2C 05 00 00 4E 23 46 EB 3E 10 CD EB 05 00 00 +R 00 00 01 00 00 0B 01 00 +T 35 05 00 00 E1 71 23 70 2A 00 00 00 00 4E 23 +R 00 00 01 00 00 09 03 00 +T 3E 05 00 00 46 21 11 00 DD 5E 02 DD 56 03 19 +R 00 00 01 00 +T 49 05 00 00 5E 23 56 CD 12 06 00 00 21 11 00 +R 00 00 01 00 00 08 01 00 +T 52 05 00 00 DD 5E 02 DD 56 03 19 5E 23 56 CD +R 00 00 01 00 +T 5D 05 00 00 F2 05 00 00 21 11 00 DD 5E 02 DD +R 00 00 01 00 00 04 01 00 +T 66 05 00 00 56 03 19 5E 23 56 CD 2F 06 00 00 +R 00 00 01 00 00 0B 01 00 +T 6F 05 00 00 21 11 00 DD 4E 02 DD 46 03 09 5E +R 00 00 01 00 +T 7A 05 00 00 23 56 21 11 00 09 46 23 66 68 01 +R 00 00 01 00 +T 85 05 00 00 1A 00 CD 47 06 00 00 21 14 00 DD +R 00 00 01 00 00 07 01 00 +T 8E 05 00 00 4E A0 DD 46 A1 09 E5 CD +R 00 00 01 00 +T 96 05 00 00 6A 00 00 00 EB E1 73 23 72 21 +R 00 00 01 00 00 04 01 00 +T 9E 05 00 00 14 00 09 56 23 66 6A DD 75 A0 DD +R 00 00 01 00 +T A9 05 00 00 74 A1 01 14 00 09 AF 77 23 77 DD +R 00 00 01 00 +T B4 05 00 00 6E A0 DD 66 A1 70 21 0E 00 DD 4E +R 00 00 01 00 +T BF 05 00 00 A0 DD 46 A1 09 77 23 77 21 10 00 +R 00 00 01 00 +T CA 05 00 00 09 77 23 77 23 77 23 77 +R 00 00 01 00 +T D2 05 00 00 +R 00 00 01 00 +T D2 05 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 05 00 +T D7 05 00 00 +R 00 00 01 00 +T D7 05 00 00 21 07 00 DD 4E 9E DD 46 9F 09 5E +R 00 00 01 00 +T E2 05 00 00 23 56 23 4E 23 46 EB 3E 08 +R 00 00 01 00 +T EB 05 00 00 +R 00 00 01 00 +T EB 05 00 00 CD 00 00 00 00 06 00 4D C9 +R 00 00 01 00 02 05 16 00 +T F2 05 00 00 +R 00 00 01 00 +T F2 05 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 04 00 02 0A 04 00 +T F8 05 00 00 00 00 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 02 04 0B 00 2B 0A 18 00 +T FE 05 00 00 00 00 00 00 01 08 00 00 00 CD +R 00 00 01 00 02 04 18 00 00 09 02 00 +T 04 06 00 00 00 00 00 00 21 04 00 ED 5B +R 00 00 01 00 02 04 0B 00 +T 0B 06 00 00 00 00 00 00 19 4E 23 46 C9 +R 00 00 01 00 00 04 03 00 +T 12 06 00 00 +R 00 00 01 00 +T 12 06 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 04 00 02 0A 04 00 +T 18 06 00 00 00 00 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 02 04 0B 00 2B 0A 18 00 +T 1E 06 00 00 00 00 00 00 01 00 00 00 00 CD +R 00 00 01 00 02 04 18 00 00 09 02 00 +T 24 06 00 00 00 00 00 00 2A 00 00 00 00 23 23 +R 00 00 01 00 02 04 0B 00 00 09 03 00 +T 2B 06 00 00 4E 23 46 C9 +R 00 00 01 00 +T 2F 06 00 00 +R 00 00 01 00 +T 2F 06 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 04 00 02 0A 04 00 +T 35 06 00 00 00 00 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 02 04 0B 00 2B 0A 18 00 +T 3B 06 00 00 00 00 00 00 01 0E 00 00 00 C3 +R 00 00 01 00 02 04 18 00 00 09 02 00 +T 41 06 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 43 06 00 00 +R 00 00 01 00 +T 43 06 00 00 42 21 1A 00 +R 00 00 01 00 +T 47 06 00 00 +R 00 00 01 00 +T 47 06 00 00 09 4E 23 46 23 7E 69 60 C3 +R 00 00 01 00 +T 50 06 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 52 06 00 00 +R 00 00 01 00 +T 52 06 00 00 3E 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 05 01 00 02 0A 01 00 +T 58 06 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 5A 06 00 00 +R 00 00 01 00 +T 5A 06 00 00 FD 4E 12 FD 46 13 FD 6E 10 FD 66 +R 00 00 01 00 +T 65 06 00 00 11 C3 00 00 00 00 +R 00 00 01 00 02 06 0E 00 +T 69 06 00 00 +R 00 00 01 00 +T 69 06 00 00 FD 4E 12 FD 46 13 FD 6E 10 FD 66 +R 00 00 01 00 +T 74 06 00 00 11 C3 00 00 00 00 +R 00 00 01 00 02 06 11 00 +T 78 06 00 00 +R 00 00 01 00 +T 78 06 00 00 FD 4E 12 FD 46 13 FD 6E 10 FD 66 +R 00 00 01 00 +T 83 06 00 00 11 C3 00 00 00 00 +R 00 00 01 00 02 06 00 00 +T 87 06 00 00 +R 00 00 01 00 +T 87 06 00 00 4D 44 DD 5E A0 DD 56 A1 3E +R 00 00 01 00 +T 90 06 00 00 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 04 03 00 02 09 03 00 +T 95 06 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 00 00 00 00 +R 00 00 02 00 +T 00 00 00 00 42 61 72 63 6F 64 65 00 +R 00 00 02 00 +T 08 00 00 00 +R 00 00 02 00 +T 08 00 00 00 53 74 75 6B 73 00 +R 00 00 02 00 +T 0E 00 00 00 +R 00 00 02 00 +T 0E 00 00 00 50 72 69 6A 73 00 +R 00 00 02 00 +T 14 00 00 00 +R 00 00 02 00 +T 14 00 00 00 00 +R 00 00 02 00 +T 15 00 00 00 +R 00 00 02 00 +T 15 00 00 00 2F 64 65 76 2F 70 72 69 6E 74 65 +R 00 00 02 00 +T 20 00 00 00 72 00 +R 00 00 02 00 +T 22 00 00 00 +R 00 00 02 00 +T 22 00 00 00 25 31 33 73 20 56 65 72 6B 6F 6F +R 00 00 02 00 +T 2D 00 00 00 70 61 72 74 69 6B 65 6C 20 20 7C +R 00 00 02 00 +T 38 00 00 00 25 37 6C 64 2C 25 30 32 6C 64 0D +R 00 00 02 00 +T 43 00 00 00 0A 00 +R 00 00 02 00 +T 45 00 00 00 +R 00 00 02 00 +T 45 00 00 00 25 31 33 73 20 56 65 72 6B 6F 6F +R 00 00 02 00 +T 50 00 00 00 70 61 72 74 69 6B 65 6C 0D 0A 25 +R 00 00 02 00 +T 5B 00 00 00 34 64 78 20 40 20 7C 20 25 37 6C +R 00 00 02 00 +T 66 00 00 00 64 2C 25 30 32 6C 64 20 20 20 20 +R 00 00 02 00 +T 71 00 00 00 20 20 20 20 20 20 7C 25 37 6C 64 +R 00 00 02 00 +T 7C 00 00 00 2C 25 30 32 6C 64 0D 0A 00 +R 00 00 02 00 +T 85 00 00 00 +R 00 00 02 00 +T 85 00 00 00 0D 0A 25 31 33 73 54 6F 74 61 61 +R 00 00 02 00 +T 90 00 00 00 6C 3A 25 31 30 73 7C 25 37 6C 64 +R 00 00 02 00 +T 9B 00 00 00 2C 25 30 32 6C 64 0D 0A 0D 0A 0D +R 00 00 02 00 +T A6 00 00 00 0A 00 +R 00 00 02 00 +T 00 00 00 00 +R 00 00 03 00 +T 00 00 00 00 +R 00 00 03 00 diff --git a/src/gui/wnd.c b/src/gui/wnd.c new file mode 100644 index 00000000..bb795a9b --- /dev/null +++ b/src/gui/wnd.c @@ -0,0 +1,1141 @@ +/************************************************ + * Graphical User Interface driver (GUI) * + * By J.W. Morsink for Retail Vision B.V. * + ************************************************/ + +#include +#include "..\libc\malloc-l.h" +#undef NULL +#define NULL 0 + +/*void *malloc(size_t size) + { + void *ptr; + + ptr = (void *)sbrk(size); + return (ptr == (void *)-1) ? NULL : ptr; + } + +void free(void *ptr) + { + } + +*/ +/*#define JOOST_DEBUG +/*#define STR_DEBUG*/ +/*#define MALLOC_DEBUG + +/************************************************ + * Global variables for GUI * + ************************************************/ + +struct Global_GUI* global; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(){ + struct sgttyb temp; + char init[]={0x1B,'K'}; + + global->lcd=open("/dev/lcd0",O_RDWR); + gtty(global->lcd,&temp); + temp.sg_flags=RAW | UNBUFF; + stty(global->lcd,&temp); + + write(global->lcd,init,2); +} + +void GraphicsClose(){ + close(global->lcd); +} + +void Move(int x, int y){ + unsigned char cmd[]={0x1B,'S',0,0}; + cmd[2]=(unsigned char) (x); + cmd[3]=(unsigned char) (y); + write(global->lcd,cmd,4); +} + +void ClearRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'C',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void DrawRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'N',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'R',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void FillRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'F',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void GrayRect(int sx,int sy){ + unsigned char cmd[]={0x1B,'h',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(global->lcd,cmd,4); +} + +void Text(char *s){ + int c=strlen(s); + write(global->lcd,s,c); +} + +void TouchRegion(int msg, int x, int y, int sx, int sy){ + char touch[]={0x1B,'Z',0,0,0,0,0}; + touch[2]=(unsigned char) (msg); + touch[3]=(unsigned char) (x); + touch[4]=(unsigned char) (y); + touch[5]=(unsigned char) (sx); + touch[6]=(unsigned char) (sy); + write(global->lcd,touch,7); +#ifdef JOOST_DEBUG + printf("Touch: %x,%x,%x,%x,%x\n",msg,x,y,sx,sy); fflush(stdout); +#endif +} + +void ClearScreen(){ + Move(0,0); + ClearRect(0,0x80); + TouchRegion(0,0,0,0,0x80); +} + +void EnableScreen(unsigned char c){ + char cmd[]={0x1B,'E',0}; + cmd[2]=c; + write(global->lcd,cmd,3); +} + +void grSetFont(int f){ + char cmd[]={0x1B,0}; + cmd[1]=f & 0xff; + write(global->lcd,cmd,2); +} + +/************************************************ + * Fonts * + ************************************************/ + +struct Font* fontSearch(int f){ + struct Font* current=global->firstfont; + while(current!=NULL && current->id!=f) + current=current->nextfont; + return current; +} + +void setCurrentFont(int f){ + if(fontSearch(f)!=NULL){ + grSetFont(f); + global->currentfont=fontSearch(f); + } +} + +void loadFont(int id,int (*sw)(char*),int (*sh)(char*),int sizedata, void* data){ + struct Font* font=(struct Font*) malloc(sizeof(struct Font)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",font); fflush(stdout); +#endif + font->id=id; + font->stringwidth=sw; + font->stringheight=sh; + font->nextfont=NULL; + font->sizefontdata=sizedata; + font->fontdata=data; + if(global->firstfont==NULL){ + global->firstfont=font; + global->currentfont=font; + } + else + { + struct Font* current=global->firstfont; + while(current->nextfont!=NULL) + current=current->nextfont; + current->nextfont=font; + } +} + +int stringwidth(char *str,int extra){ + int w=0,i=0; + while(str[i]!=0x00){ + switch(str[i]){ + case 'i': + case 'I': + case '!': + w+=2; + break; + case 'l': + w+=3; + break; + case ',': + case '1': + case '.': + w+=4; + break; + case 'r': + case 'k': + case 'j': + w+=5; + break; + default: + w+=6; + } + i++; + w+=extra; + } + return w; +} + +int stringheight(char ch, int extra){ + if(ch<0x80) return 7+extra; + if(ch>=0xcc && ch<=0xdf) return 1+extra; +} + +int stringheight01(char* ch){ + return stringheight(ch[0],0); +} + +int stringheight2(char* ch){ + return stringheight(ch[0],5); +} + +int stringwidth0(char *str){ + return stringwidth(str,0); +} + +int stringwidth1(char *str){ + return stringwidth(str,2); +} + +int stringwidth2(char *str){ + return stringwidth(str,3); +} +/************************************************ + * Components * + ************************************************/ + +struct Component* Component_new(int x,int y,int sx,int sy){ + struct Component* this=(struct Component*) (malloc(sizeof(struct Component))); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",this); fflush(stdout); +#endif + + this->id=(++global->id); + this->x=x; + this->y=y; + this->sizex=sx; + this->sizey=sy; + this->state=0; + this->order=0; + this->font=0; + this->msg=0; + this->parent=NULL; + this->next_sibling=NULL; + this->first_child=NULL; + this->handler=NULL; + this->paint=NULL; + this->add=NULL; + this->sizexds=0; + this->xds=NULL; + this->label=NULL; + this->label2=NULL; + return this; +} + +void Component_setlabel(struct Component* this, char* s){ + int i=0; + while(s[i]!=0 && ilabel[i]=s[i]; + i++; + } + this->label[i]=0; +} + +void Component_add(struct Component* this, struct Component* comp){ + struct Component* current=this->first_child; + if(this->first_child==NULL){ + this->first_child=comp; + comp->next_sibling=NULL; + } + else + { + while(current->next_sibling!=NULL){ + current=current->next_sibling; + } + current->next_sibling=comp; + comp->next_sibling=NULL; + } + comp->parent=this; +} + +void Component_paint(struct Component* this){ + struct Component* current=this->first_child; + EnableScreen(0); + while(current!=NULL){ + current->paint(current); + current=current->next_sibling; + } + EnableScreen(1); +} + +void Component_findXY(struct Component* this, int* x, int* y){ + struct Component* current=this; + do{ + *x+=current->x; + *y+=current->y; + current=current->parent; + } while(current!=NULL); +} + +struct Component* Component_find(struct Component* this, int msg){ + struct Component* current=this->first_child; +#ifdef JOOST_DEBUG + printf("Find %x in %x:\n",msg, this->id); fflush(stdout); +#endif + while(current!=NULL){ +#ifdef JOOST_DEBUG + printf("Comp_find: %x, %x\n",msg, current->msg); fflush(stdout); +#endif + if(current->msg==msg) + return current; + current=current->next_sibling; + } + return NULL; +} + +struct Component* Component_delete(struct Component* this){ + struct Component* current=this->first_child; + int id=this->id; + if(this!=NULL){ +#ifdef JOOST_DEBUG + printf("Deleting component: %d\n",id); fflush(stdout); +#endif + while(current!=NULL){ + current=Component_delete(current); + } + if(this->parent!=NULL){ + if(this==this->parent->first_child) + this->parent->first_child=this->parent->first_child->next_sibling; + else{ + current=this->parent->first_child; + while(this!=current->next_sibling && current->next_sibling!=NULL) + current=current->next_sibling; + if(current->next_sibling!=NULL) + current->next_sibling=current->next_sibling->next_sibling; + } + } + current=this->next_sibling; + if(this->sizexds==sizeof(struct StringTableXDS)) + { + struct Component* par=this->parent; + struct StringTableXDS* stx=(struct StringTableXDS*) this->xds; + +#ifdef STR_DEBUG + printf("Stringtable @ %x freed!\n",stx->stringtabledata); fflush(stdout); +#endif + +#ifdef MALLOC_DEBUG + printf("free: %x\n",stx->stringtabledata); fflush(stdout); +#endif + free(stx->stringtabledata); +#ifdef MALLOC_DEBUG + printf("free: %x\n",stx->stringtable); fflush(stdout); +#endif + free(stx->stringtable); + + while((par!=NULL) && (par->sizexds!=sizeof(struct StringTableXDS))) + par=par->parent; + if(par!=NULL) + { + stx=(struct StringTableXDS*) par->xds; + global->stringtabledata=stx->stringtabledata; + global->stringtable=stx->stringtable; + } + } + if(this->sizexds>0){ +#ifdef MALLOC_DEBUG + printf("free: %x\n",this->xds); fflush(stdout); +#endif + free(this->xds); + } + if((this->state & STRING_FROMTABLE)==0 && this->label!=NULL){ +#ifdef MALLOC_DEBUG + printf("free: %x\n",this->label); fflush(stdout); +#endif + free(this->label); + } +#ifdef MALLOC_DEBUG + printf("free: %x\n",this); fflush(stdout); +#endif + + free(this); +#ifdef JOOST_DEBUG + printf("Deleted component: %d\n",id); fflush(stdout); +#endif + } + return current; +} + +void Component_delete_children(struct Component* this){ + struct Component* current=this->first_child; + while(current!=NULL) + current=Component_delete(current); +} + +void Component_changestate_children(struct Component* this, int andmask, int ormask, int xormask){ + struct Component* current=this->first_child; + while(current!=NULL){ + current->state&=(0xffff-andmask); + current->state|=ormask; + current->state^=xormask; + current=current->next_sibling; + } + fflush(stdout); +} + +void Component_linkstringtable(struct Component* this){ + struct Component* child=this->first_child; +#ifdef STR_DEBUG + printf("%d: %x -> %x\n",this->id,this->label-1,global->stringtable[(int) (this->label)-1]); fflush(stdout); +#endif + if(((int)(this->label))<0x1000 && ((int)(this->label))>0) + this->label=global->stringtable[(int) (this->label)-1]; + if(((int)(this->label2))<0x1000 && ((int)(this->label2))>0) + this->label2=global->stringtable[(int) (this->label2)-1]; + while(child!=NULL){ + Component_linkstringtable(child); + child=child->next_sibling; + } + +} + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param){ + struct Component* current,current2; + int x=0,y=0; +#ifdef JOOST_DEBUG + printf("Message in window %d, Msg: %x, Param: %x\n",this->id,msg,param); fflush(stdout); +#endif + switch(msg){ + case KEY_PRESSED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)) + current->handler(current,msg,param); + current=current->next_sibling; + } + break; + case KEY_RELEASED: + current=this->first_child; + while(current!=NULL) { + if((current->state & STATE_VISIBLE)!=0){ + current->handler(current,msg,param); + current->handler(current,KEY_TYPED,param); + if((current->state & (STATE_ACTION | STATE_ENABLED))==(STATE_ACTION | STATE_ENABLED) && current->msg==param) + current=NULL; + } + if(current!=NULL) + current=current->next_sibling; + } + break; + case KEY_TYPED: + current=this; + if((current->state & STATE_VISIBLE)==(STATE_VISIBLE)){ + + if((current->state & STATE_ACTION)!=0 && current->msg==param){ + struct ActionXDS* act=(struct ActionXDS*) (current->xds); +#ifdef JOOST_DEBUG + printf("Before actionhandler...\n"); +#endif + act->actionhandler(current); + if((act->action & 0xff00)==0){ + current=NULL; + } +#ifdef JOOST_DEBUG + printf("After actionhandler...\n"); +#endif + } + } + if(current!=NULL) + current=current->next_sibling; + + break; + case WND_REDRAW: + this->paint(this); + break; + case WND_CLOSE: + this->state=this->state & (0xffff-(STATE_VISIBLE | STATE_ENABLED)); + Component_findXY(this,&x,&y); + TouchRegion(0,x,y,this->sizex,this->sizey); + this->parent->handler(this->parent,WND_REDRAW,0); + break; + case WND_DESTROY: + current=this->parent; + Component_delete(this); + current->handler(current,WND_REDRAW,0); + break; + case WND_BROADCAST: + current=this->first_child; + while(current!=NULL){ + if(current!=(struct Component*) (param) && (current->state & STATE_FOCUS)!=0) + current->handler(current,CMP_BROADCAST,param); + current=current->next_sibling; + } + break; + case APP_QUIT: + if(this->parent==NULL) + global->willquit=1; + else if((this->state & STATE_APPLICATION)==0) + this->parent->handler(this->parent,APP_QUIT,param); + else{ + current=this->parent; + current->state|=STATE_VISIBLE | STATE_ENABLED; + Component_changestate_children(current,0,STATE_VISIBLE,0); + this->handler(this,WND_DESTROY,0); + } + break; + } +} + +void Window_paint(struct Component* this){ + int x=0,y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + + EnableScreen(0); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion(0,x,y,this->sizex,this->sizey); + Move(x,y+global->currentfont->stringheight(this->label)+4); + DrawRectNC(this->sizex,this->sizey-global->currentfont->stringheight(this->label)-4); + Move(x,y); + FillRect(this->sizex,global->currentfont->stringheight(this->label)+5); + Move(x+2,y+14); /* Nick 2); */ + Text(this->label); + Component_paint(this); + } +} + +void Root_paint(struct Component* this){ + EnableScreen(0); + Move(0,0); + ClearRect(0,0x80); + GrayRect(0,0x80); + TouchRegion(0,0,0,0,0x80); + + Component_paint(this); +/* EnableScreen(0); + Window_paint(this); + EnableScreen(1);*/ +} + +void Window_add(struct Component* this, struct Component* comp){ + Component_add(this,comp); +} + +struct Component* Window_new(int x,int y,int sx,int sy){ + struct Component* this=Component_new(x,y,sx,sy); + this->handler=Window_handler; + this->paint=Window_paint; + this->add=Window_add; + return this; +} + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->parent->handler(this->parent, CMP_ACTION, param); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void Button_drawtext(struct Component* this, int x, int y){ + if((this->state & STYLE_MULTILINE)!=0){ + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-2*global->currentfont->stringheight(this->label))/2+12); /* Nick +7 */ + Text(this->label); + Move(x+(this->sizex-global->currentfont->stringwidth(this->label2))/2,y+(this->sizey)/2+10); /* Nick 1); */ + Text(this->label2); + } else { + Move(x+(this->sizex-global->currentfont->stringwidth(this->label))/2,y+(this->sizey-global->currentfont->stringheight(this->label))/2+13); /* Nick 1); */ + Text(this->label); + } +#ifdef STR_DEBUG + printf("Drawtext (%d): ""%s"" @ %x\n",this->id,this->label,this->label); fflush(stdout); +#endif +} + +void Button_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & (STATE_ENABLED | STYLE_INVERTED))!=0 && (this->state & (STATE_ENABLED | STYLE_INVERTED))!=(STATE_ENABLED | STYLE_INVERTED) ) + FillRectNC(this->sizex,this->sizey); + else + DrawRectNC(this->sizex,this->sizey); + Button_drawtext(this,x,y); + } +} + +void Button_add(struct Component* this, struct Component* comp){ + return; +} + +struct Component* Button_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE; + this->msg=msg; + this->handler=Button_handler; + this->paint=Button_paint; + this->add=Button_add; + + return this; +} + +/*void Numpad(struct Component* this, int x, int y){ + int i; + char s[2]={0,0}; + struct Component* button; + for(i=0; i<9; i++){ + s[0]=0x31+(char) i; + button=Button_new(x+(i%3)*0x18,y+0x30-(i/3)*0x18,0x16,0x16,i+0x31); + Component_setlabel(button,s); + button->state|=STATE_CASTING; + this->add(this,button); + } + button=Button_new(x+0x18,y+0x48,0x16,0x16,0x30); + Component_setlabel(button,"0"); + button->state|=STATE_CASTING; + this->add(this,button); + + button=Button_new(x+0x30,y+0x48,0x16,0x16,0x08); + Component_setlabel(button,"CE"); + button->state|=STATE_CASTING; + this->add(this,button); +}*/ + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->state^=STATE_CHECKED; + this->parent->handler(this->parent, CMP_STATECHANGE, param); + this->handler(this, WND_REDRAW, 0); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void ToggleButton_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + if((this->state & STATE_ENABLED)!=0 && (this->state & STATE_CHECKED)!=0){ + FillRectNC(this->sizex,this->sizey); + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + }else{ + DrawRectNC(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + } + Button_drawtext(this,x,y); + } +} + +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_ENABLED | STATE_VISIBLE | STATE_CHECKED; + this->msg=msg; + this->handler=ToggleButton_handler; + this->paint=ToggleButton_paint; + this->add=Button_add; + + return this; +} + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==CMP_ACTION && param==0xff){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_OK, this->msg); + } + if(msg==CMP_ACTION && param==0xfe){ + if((this->state & STYLE_SELFDESTRUCT)!=0) + this->handler(this,WND_DESTROY,0); + else + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_CANCEL, this->msg); + + } +} + +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* ok; + struct Component* this=Component_new(x,y,sx,sy); + this->state|=STATE_VISIBLE; + this->msg=msg; + this->handler=Dialog_handler; + this->paint=Window_paint; + this->add=Window_add; + + ok=Button_new(sx-0x30,sy-0x1c,0x28,0x14,0xff); + ok->label=(char*) malloc(3); + Component_setlabel(ok,"OK"); + this->add(this,ok); + + ok=Button_new(sx-0x30,sy-0x38,0x28,0x14,0xfe); /*Cancel*/ + ok->label=(char*) malloc(7); + Component_setlabel(ok,"Cancel"); + this->add(this,ok); + + return this; +} + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param){ + Button_handler(this,msg,param); + if(msg==CMP_BROADCAST && (this->state & STATE_FOCUS)!=0){ +#ifdef JOOST_DEBUG + printf("strlen = %d->",strlen(this->label)); fflush(stdout); +#endif + if(param==0x08){ + if(strlen(this->label)!=0) + this->label[strlen(this->label)-1]=0; + }else{ + this->label[strlen(this->label)+1]=0; + this->label[strlen(this->label)]=(char) param; + } +#ifdef JOOST_DEBUG + printf("%d\n",strlen(this->label)); fflush(stdout); +#endif + this->handler(this,WND_REDRAW,0); + } +} + +void Display_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + char pwd[64]; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + + if( (this->state & STYLE_INVERTED)==0) + FillRectNC(this->sizex,this->sizey); + else + DrawRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2+7); + if(this->state & STYLE_PASSWORD){ + int i; + for(i=0; ilabel); i++) + pwd[i]='*'; + pwd[i]=0; + Text(pwd); + }else + Text(this->label); + +/* Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + + FillRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-global->currentfont->stringheight(this->label))/2+12); /x Nick +7 x/ + Text(this->label); + TouchRegion((this->state&STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); +*/ + } +} + +struct Component* Display_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Button_new(x,y,sx,sy,msg); + this->state|=STATE_FOCUS; + Component_setlabel(this,""); + this->paint=Display_paint; + this->handler=Display_handler; + return this; +} + +/************************************************ + * Labels * + ************************************************/ +void Label_handler(struct Component* this, int msg, int param){ + return; +} + +void Label_paint(struct Component* this){ + int x=0, y=0; + if(global->currentfont->id!=this->font) + setCurrentFont(this->font); + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Button_drawtext(this,x,y); + } +} + +struct Component* Label_new(int x, int y, int sx, int sy,char* l){ + struct Component* comp=Component_new(x,y,sx,sy); + comp->label=l; + comp->state=STATE_VISIBLE; + comp->handler=Label_handler; + comp->paint=Label_paint; + comp->add=Button_add; + return comp; +} + /************************************************ + * Implementation * + ************************************************/ +/* +void ScreenDialog_handler(struct Component* this, int msg, int param){ + char cmd[]={0x1B,'V',0}; + Dialog_handler(this,msg,param); + if(msg==CMP_ACTION){ + if(param=='U') + cmd[2]=0; + else if(param=='D') + cmd[2]=1; + else + return; + write(global->lcd,cmd,3); + } +} + +struct Component* ScreenDialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* button; + struct Component* this=Dialog_new(x,y,sx,sy,msg); + + button=Button_new(0x04,0x10,0x20,0x14,'U'); + Component_setlabel(button,"Up"); + this->add(this,button); + + button=Button_new(0x04,0x28,0x20,0x14,'D'); + Component_setlabel(button,"Down"); + this->add(this,button); + + this->handler=ScreenDialog_handler; + + return this; +} +*/ +void rootWindow_handler(struct Component* this, int msg, int param){ + struct Component* dummy; + Window_handler(this,msg,param); +} + + +void screenbuilder(struct Component* root, char* filename){ + struct Component* subw; + struct ActionXDS* action; + int mode; + int fh,rd; + char buf[SIZE_SCRBLD_RECORD]; + long l; + int xs,ys; + xs=0x2b; + ys=0x1a; + buf[0]=0; + fh=open(filename,O_RDONLY); + do{ + char comp=0; + if(buf[0]=='s'){ /* Change size */ + xs=*((int*)(buf+0x1)); + ys=*((int*)(buf+0x3)); + } + + if(buf[0]=='B' || buf[0]=='M'){ /* Button, Multi-line button */ + subw=Button_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + if(buf[0]=='M') subw->state|=STYLE_MULTILINE; + comp=1; + } + if(buf[0]=='T'){ /* Toggle-button */ + subw=ToggleButton_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='D'){ /* Display button */ + subw=Display_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf[5]); + comp=1; + } + if(buf[0]=='L'){ /* Label */ + subw=Label_new(buf[1]*xs,buf[2]*ys,buf[3]*xs-3,buf[4]*ys-3,buf+0x12); + comp=1; + } + if(buf[0]=='A'){ + struct ActionXDS a; + root->xds=&a; + a.action=*((int*)(buf+0x6)); + a.wParam=*((int*)(buf+0x8)); + a.lParam=*((long*)(buf+0xa)); + root_actionhandler(root); + } + + if(buf[0]=='S'){ + struct StringTableXDS* stx; + read_stringtable(fh,buf); + root->xds=(void*) malloc(sizeof(struct StringTableXDS)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",root->xds); fflush(stdout); +#endif + + stx=(struct StringTableXDS*) root->xds; + root->sizexds=sizeof(struct StringTableXDS); + stx->stringtable=global->stringtable; + stx->stringtabledata=global->stringtabledata; +#ifdef STR_DEBUG + printf("Stringtable created @ %x\n",stx->stringtabledata); fflush(stdout); +#endif + comp=0; + } + if(comp!=0){ + if((buf[6] | buf[7])!=0){ + subw->state|=STATE_ACTION; + subw->sizexds=sizeof(struct ActionXDS); + subw->xds=(void*) malloc(sizeof(struct ActionXDS)); +#ifdef MALLOC_DEBUG + printf("malloc Action: %x\n",subw->xds); fflush(stdout); +#endif + + action=(struct ActionXDS*) (subw->xds); + action->actionhandler=root_actionhandler; + action->action=*((int*)(buf+0x6)); + action->wParam=*((int*)(buf+0x8)); + action->lParam=*((long*)(buf+0xa)); + } + if((buf[0x0e] | buf[0x0f])!=0) + subw->state=*((int*)(buf+0x0e)); + subw->font=*((int*)(buf+0x10)); + + subw->label=(char*) (*((int*) (buf+0x12)) & 0x0fff); + if(subw->label==NULL) { + subw->label=(char*) malloc(LABEL_LENGTH); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",subw->label); fflush(stdout); +#endif + subw->label[0]=0; + } + else + subw->state|=STRING_FROMTABLE; + + if((*((int*) (buf+0x12)) &0xf000)>0x1000) + subw->label2=(char*)((*((int*) (buf+0x12)) & 0x0fff)+1); + + root->add(root,subw); + } + + rd=read(fh,buf,SIZE_SCRBLD_RECORD); + } while(rd==SIZE_SCRBLD_RECORD); + close(fh); + Component_linkstringtable(root); + root->paint(root); +} + +void root_actionhandler(struct Component* this){ + struct ActionXDS *act; + struct Component* subw; + char filename[]={'/','w','n','d','/','0','0','0','0','.','s','c','r',0}; /* Nick added /wnd/ */ + + act=(struct ActionXDS*) (this->xds); +#ifdef JOOST_DEBUG + printf("0x%x: (0x%x, 0x%x, 0x%lx)",act, act->action, act->wParam, act->lParam); +#endif + if(act->action==0x0001){ /*QUIT*/ + this->handler(this,APP_QUIT,0); + } + if((act->action & 0xfffe)==0x0002){ /*Open Screen*/ + Component_changestate_children(this->parent,STATE_VISIBLE,0,0); + subw=Window_new(0,0,this->parent->sizex,this->parent->sizey); + subw->state=STATE_VISIBLE | STATE_ENABLED; + if((act->action & 1)!=0) + subw->state|=STATE_APPLICATION; + subw->handler=rootWindow_handler; + subw->paint=Root_paint; + filename[5]=(char) ((act->lParam) &0xff); /* Nick 5 formerly 0 */ + filename[6]=(char) ((act->lParam>>8) &0xff); /* Nick 6 formerly 1 */ + filename[7]=(char) ((act->lParam>>16) &0xff); /* Nick 7 formerly 2 */ + filename[8]=(char) ((act->lParam>>24) &0xff); /* Nick 8 formerly 3 */ + screenbuilder(subw,filename); + this->parent->add(this->parent,subw); + } + if(act->action==0x0004) { /* Open MessageBox */ + /*Component_changestate_children(this->parent,0,0,0);*/ + struct Component* label; + int i; + subw=Dialog_new(0x05,0x05,this->parent->sizex-0x0a,this->parent->sizey-0x0a,1); + subw->state=STATE_VISIBLE | STATE_ENABLED | STYLE_SELFDESTRUCT; + subw->font=0x0030; + for(i=0; i<(act->wParam>>12)&0x0f; i++){ + label=Label_new(0x08,0x14+i*0x0c,(subw->sizex & 0xff)-0x10,0x10,global->stringtable[(act->wParam&0xfff)+i-1]); + label->font=0x0030; + subw->add(subw,label); + } + Component_setlabel(subw,"Message Box"); + Component_find(subw,0xff)->font=0x0030; + Component_delete(Component_find(subw,0xfe)); + this->parent->add(this->parent,subw); + this->parent->handler(this->parent,WND_REDRAW,0); + } +#ifdef JOOST_DEBUG + printf("Before external handler...\n"); fflush(stdout); +#endif + if(global->actionhandler!=NULL) + global->actionhandler(this); + +#ifdef JOOST_DEBUG + printf("After external handler...\n"); fflush(stdout); +#endif +} + +void read_stringtable(int fh,char* buf){ + int siz,bsiz; + int i=0,j=0; + char **ptrs; + char *rawdata; + + siz=*((int*) (buf+0x01)); + bsiz=*((int*) (buf+0x03)); +#ifdef STR_DEBUG + printf("%d %d\n",siz,bsiz); +#endif + + ptrs=(char**) malloc(sizeof(char*)*siz); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",ptrs); fflush(stdout); +#endif + + rawdata=(char*) malloc(bsiz); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",rawdata); fflush(stdout); +#endif + + read(fh,rawdata,bsiz); + while(istringtabledata=rawdata; + global->stringtable=ptrs; +#ifdef STR_DEBUG + for(i=0; i""%s""\n",i,global->stringtable[i],global->stringtable[i]); + fflush(stdout); +#endif + +} + +struct Global_GUI* gui_globals(){ + return global; +} + + +void GUIinit(void){ + global=(struct Global_GUI*) malloc(sizeof(struct Global_GUI)); +#ifdef MALLOC_DEBUG + printf("malloc: %x\n",global); fflush(stdout); +#endif + + global->id=0; + global->willquit=0; + global->currentfont=NULL; + global->firstfont=NULL; + global->stringtable=NULL; + global->stringtabledata=NULL; + global->actionhandler=NULL; + GraphicsOpen(); + loadFont(0x0030,stringwidth0,stringheight01,0,NULL); + loadFont(0x0031,stringwidth1,stringheight01,0,NULL); + loadFont(0x0032,stringwidth2,stringheight2,0,NULL); + global->root=Window_new(0x0,0x0,0x00,0x80); + global->root->state=STATE_VISIBLE; + global->root->handler=rootWindow_handler; + global->root->paint=Root_paint; +} + +void GUIunit(void){ + Component_delete(global->root); + ClearScreen(); + GraphicsClose(); +} + +void GUIgo(char* scr){ + char buf,obuf; + screenbuilder(global->root,scr); + + while(read(global->lcd,&buf,1)==1); + + while(!global->willquit){ + if(read(global->lcd,&buf,1)==1){ + if(buf!=0) + global->root->handler(global->root,KEY_PRESSED,buf); + else + global->root->handler(global->root,KEY_RELEASED,obuf); + obuf=buf; + } + } +} + +/*void main(void){ + GUIinit(); + GUIgo(); + GUIunit(); +}*/ + diff --git a/src/gui/wnd.cbackup b/src/gui/wnd.cbackup new file mode 100644 index 00000000..d7f96dac --- /dev/null +++ b/src/gui/wnd.cbackup @@ -0,0 +1,658 @@ +#include +#include +#include +#include +#include +#include + +/*#define JOOST_DEBUG*/ + +#define FONT_HEIGHT 7 +#define FONT_WIDTH 6 + +#define STATE_VISIBLE 0x0001 +#define STATE_ENABLED 0x0002 +#define STATE_CHECKED 0x0004 +#define STATE_FOCUS 0x0008 +#define STATE_CASTING 0x0010 +#define STATE_ACTION 0x0020 + +#define KEY_TYPED 0x0001 +#define WND_OPEN 0x0101 +#define WND_CLOSE 0x0102 +#define WND_REDRAW 0x0103 +#define WND_BROADCAST 0x0104 +#define CMP_ACTION 0x0201 +#define CMP_STATECHANGE 0x0202 +#define CMP_BROADCAST 0x0203 +#define DLG_OK 0x0301 +#define DLG_CANCEL 0x0302 + +int id=0; +int lcd; +int willquit; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(){ + struct sgttyb temp; + char init[]={0x1B,'K'}; + + lcd=open("/dev/lcd0",O_RDWR); + gtty(lcd,&temp); + temp.sg_flags=RAW | UNBUFF; + stty(lcd,&temp); + + write(lcd,init,2); +} + +void Move(int x, int y){ + unsigned char cmd[]={0x1B,'S',0,0}; + cmd[2]=(unsigned char) (x); + cmd[3]=(unsigned char) (y); + write(lcd,cmd,4); +} + +void ClearRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'C',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(lcd,cmd,4); +} + +void DrawRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'N',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(lcd,cmd,4); +} + +void FillRect(int sx, int sy){ + unsigned char cmd[]={0x1B,'R',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(lcd,cmd,4); +} + +void FillRectNC(int sx, int sy){ + unsigned char cmd[]={0x1B,'F',0,0}; + cmd[2]=(unsigned char) (sx); + cmd[3]=(unsigned char) (sy); + write(lcd,cmd,4); +} + +void Text(char *s){ + int c=strlen(s); + write(lcd,s,c); +} + +void TouchRegion(int msg, int x, int y, int sx, int sy){ + char touch[]={0x1B,'Z',0,0,0,0,0}; + touch[2]=(unsigned char) (msg); + touch[3]=(unsigned char) (x); + touch[4]=(unsigned char) (y); + touch[5]=(unsigned char) (sx); + touch[6]=(unsigned char) (sy); + write(lcd,touch,7); +#ifdef JOOST_DEBUG + printf("Touch: %x,%x,%x,%x,%x\n",msg,x,y,sx,sy); fflush(stdout); +#endif +} + +void ClearScreen(){ + Move(0,0); + ClearRect(0,0x80); + TouchRegion(0,0,0,0,0x80); +} + +void EnableScreen(unsigned char c){ + char cmd[]={0x1B,'E',0}; + cmd[2]=c; + write(lcd,cmd,3); +} + +/************************************************ + * Components * + ************************************************/ + +struct Component { + int id; + int x,y; + int sizex,sizey; + int state; + int order; + char msg; + struct Component* parent; + struct Component *next_sibling; + struct Component *first_child; + void (*handler) (struct Component*, int, int); + void (*paint) (struct Component*); + void (*add) (struct Component*, struct Component*); + char label[20]; + int sizexds; + void *xds; +}; + +struct ActionXDS { + void (*actionhandler)(struct Component*, int); + int action; + int wParam; + long lParam; +}; + +struct Component* root; + +struct Component* Component_new(int x,int y,int sx,int sy){ + struct Component* this=(struct Component*) (malloc(sizeof(struct Component))); + this->id=(++id); + this->x=x; + this->y=y; + this->sizex=sx; + this->sizey=sy; + this->state=0; + this->order=0; + this->msg=0; + this->parent=NULL; + this->next_sibling=NULL; + this->first_child=NULL; + this->handler=NULL; + this->paint=NULL; + this->add=NULL; + this->sizexds=0; + this->xds=NULL; + this->label[0]=0; + return this; +} + +void Component_setlabel(struct Component* this, char* s){ + int i=0; + while(s[i]!=0 && i<20){ + this->label[i]=s[i]; + i++; + } + this->label[i]=0; +} + +void Component_add(struct Component* this, struct Component* comp){ + struct Component* current=this->first_child; + if(this->first_child==NULL){ + this->first_child=comp; + comp->next_sibling=NULL; + } + else + { + while(current->next_sibling!=NULL){ + current=current->next_sibling; + } + current->next_sibling=comp; + comp->next_sibling=NULL; + } + comp->parent=this; +} +void Component_paint(struct Component* this){ + struct Component* current=this->first_child; + while(current!=NULL){ + current->paint(current); + current=current->next_sibling; + } +} + + +void Component_findXY(struct Component* this, int* x, int* y){ + struct Component* current=this; + do{ + *x+=current->x; + *y+=current->y; + current=current->parent; + } while(current!=NULL); +} + +struct Component* Component_find(struct Component* this, int msg){ + struct Component* current=this->first_child; +#ifdef JOOST_DEBUG + printf("Find %x in %x:\n",msg, this->id); fflush(stdout); +#endif + while(current!=NULL){ +#ifdef JOOST_DEBUG + printf("Comp_find: %x, %x\n",msg, current->msg); fflush(stdout); +#endif + if(current->msg==msg) + return current; + current=current->next_sibling; + } + return NULL; +} + +struct Component* Component_delete(struct Component* this){ + struct Component* current=this->first_child; + int id=this->id; + if(this!=NULL){ +#ifdef JOOST_DEBUG + printf("Deleting component: %d\n",id); fflush(stdout); +#endif + while(current!=NULL){ + current=Component_delete(current); + } + if(this->parent!=NULL){ + if(this==this->parent->first_child) + this->parent->first_child=this->parent->first_child->next_sibling; + else{ + current=this->parent->first_child; + while(this!=current->next_sibling && current->next_sibling!=NULL) + current=current->next_sibling; + if(current->next_sibling!=NULL) + current->next_sibling=current->next_sibling->next_sibling; + } + } + current=this->next_sibling; + if(this->sizexds>0) + free(this->xds); + free(this); +#ifdef JOOST_DEBUG + printf("Deleted component: %d\n",id); fflush(stdout); +#endif + } + return current; +} + + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param){ + struct Component* current; + int x=0,y=0; +#ifdef JOOST_DEBUG + printf("Message in window %d, Msg: %x, Param: %x\n",this->id,msg,param); fflush(stdout); +#endif + switch(msg){ + case KEY_TYPED: + current=this->first_child; + while(current!=NULL) { + current->handler(current,msg,param); + current=current->next_sibling; + } + break; + case WND_REDRAW: + this->paint(this); + break; + case WND_CLOSE: + Component_findXY(this,&x,&y); + TouchRegion(0,x,y,this->sizex,this->sizey); + this->parent->handler(this->parent,WND_REDRAW,0); + break; + case WND_BROADCAST: + current=this->first_child; + while(current!=NULL){ + if(current!=(struct Component*) (param) && (current->state & STATE_FOCUS)!=0) + current->handler(current,CMP_BROADCAST,param); + current=current->next_sibling; + } + break; + } +} + +void Window_paint(struct Component* this){ + int x=0,y=0; + struct Component* current; + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + TouchRegion(0,x,y,this->sizex,this->sizey); + Move(x,y+FONT_HEIGHT+4); + DrawRect(this->sizex,this->sizey-FONT_HEIGHT-4); + Move(x,y); + FillRect(this->sizex, FONT_HEIGHT+5); + Move(x+2,y+2); + Text(this->label); + Component_paint(this); + } +} + +void Root_paint(struct Component* this){ + Move(0,0); + ClearRect(0,0x80); + Component_paint(this); +/* EnableScreen(0); + Window_paint(this); + EnableScreen(1);*/ +} + +void Window_add(struct Component* this, struct Component* comp){ + Component_add(this,comp); +} + +struct Component* Window_new(int x,int y,int sx,int sy){ + struct Component* this=Component_new(x,y,sx,sy); + this->handler=Window_handler; + this->paint=Window_paint; + this->add=Window_add; + return this; +} + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->parent->handler(this->parent, CMP_ACTION, param); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void Button_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + if((this->state & STATE_ENABLED)!=0){ + FillRectNC(this->sizex,this->sizey); + Move(x+(this->sizex-FONT_WIDTH*strlen(this->label))/2,y+(this->sizey-FONT_HEIGHT)/2); + Text(this->label); + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + }else{ + DrawRect(this->sizex,this->sizey); + Move(x+(this->sizex-FONT_WIDTH*strlen(this->label))/2,y+(this->sizey-FONT_HEIGHT)/2); + Text(this->label); + TouchRegion(0,x,y,this->sizex,this->sizey); + } + } +} + +void Button_add(struct Component* this, struct Component* comp){ + +} + +struct Component* Button_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state=this->state | STATE_ENABLED | STATE_VISIBLE; + this->msg=msg; + this->handler=Button_handler; + this->paint=Button_paint; + this->add=Button_add; + + return this; +} + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==KEY_TYPED && this->msg==param && (this->state & (STATE_VISIBLE | STATE_ENABLED))!=0){ + this->state^=STATE_CHECKED; + this->parent->handler(this->parent, CMP_STATECHANGE, param); + this->handler(this, WND_REDRAW, 0); + if((this->state & STATE_CASTING)!=0) + this->parent->handler(this->parent, WND_BROADCAST, this->msg); + } + if(msg==CMP_ACTION) + this->parent->handler(this->parent, CMP_ACTION, param); +} + +void ToggleButton_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + Move(x,y); + ClearRect(this->sizex,this->sizey); + if((this->state & STATE_ENABLED)!=0 && (this->state & STATE_CHECKED)!=0){ + FillRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-FONT_HEIGHT)/2); + Text(this->label); + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + }else{ + DrawRect(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-FONT_HEIGHT)/2); + Text(this->label); + TouchRegion((this->state & STATE_ENABLED)?this->msg:0,x,y,this->sizex,this->sizey); + } + } +} + +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Component_new(x,y,sx,sy); + this->state=this->state | STATE_ENABLED | STATE_VISIBLE | STATE_CHECKED; + this->msg=msg; + this->handler=ToggleButton_handler; + this->paint=ToggleButton_paint; + this->add=Button_add; + + return this; +} + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param){ + Window_handler(this,msg,param); + if(msg==CMP_ACTION && param=='O'){ + this->state=this->state & (0xffff-(STATE_VISIBLE | STATE_ENABLED)); + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_OK, this->msg); + } + if(msg==CMP_ACTION && param=='C'){ + this->state=this->state & (0xffff-(STATE_VISIBLE | STATE_ENABLED)); + this->handler(this,WND_CLOSE,0); + this->parent->handler(this->parent, DLG_CANCEL, this->msg); + } +} + +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* ok; + struct Component* this=Component_new(x,y,sx,sy); + this->state=this->state | STATE_VISIBLE; + this->msg=msg; + this->handler=Dialog_handler; + this->paint=Window_paint; + this->add=Window_add; + + ok=Button_new(sx-0x30,sy-0x1c,0x28,0x14,'O'); + Component_setlabel(ok,"OK"); + this->add(this,ok); + + ok=Button_new(sx-0x30,sy-0x38,0x28,0x14,'C'); /*Cancel*/ + Component_setlabel(ok,"Cancel"); + this->add(this,ok); + + return this; +} + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param){ + Button_handler(this,msg,param); + if(msg==CMP_BROADCAST && (this->state & STATE_FOCUS)!=0){ +#ifdef JOOST_DEBUG + printf("strlen = %d->",strlen(this->label)); fflush(stdout); +#endif + if(param==0x08){ + if(strlen(this->label)!=0) + this->label[strlen(this->label)-1]=0; + }else{ + this->label[strlen(this->label)+1]=0; + this->label[strlen(this->label)]=(char) param; + } +#ifdef JOOST_DEBUG + printf("%d\n",strlen(this->label)); fflush(stdout); +#endif + this->handler(this,WND_REDRAW,0); + } +} + +void Display_paint(struct Component* this){ + int x=0, y=0; + struct Component* current; + if((this->state & STATE_VISIBLE)!=0){ + Component_findXY(this,&x,&y); + + Move(x,y); + ClearRect(this->sizex,this->sizey); + + FillRectNC(this->sizex,this->sizey); + Move(x+2,y+(this->sizey-FONT_HEIGHT)/2); + Text(this->label); + if((this->state & STATE_ENABLED)!=0) + TouchRegion(this->msg,x,y,this->sizex,this->sizey); + } +} + +struct Component* Display_new(int x, int y, int sx, int sy, int msg){ + struct Component* this=Button_new(x,y,sx,sy,msg); + this->state|=STATE_FOCUS; + Component_setlabel(this,""); + this->paint=Display_paint; + this->handler=Display_handler; + return this; +} + +/************************************************ + * Implementation * + ************************************************/ + +void ScreenDialog_handler(struct Component* this, int msg, int param){ + char cmd[]={0x1B,'V',0}; + Dialog_handler(this,msg,param); + if(msg==CMP_ACTION){ + if(param=='U') + cmd[2]=0; + else if(param=='D') + cmd[2]=1; + else + return; + write(lcd,cmd,3); + } +} + +struct Component* ScreenDialog_new(int x, int y, int sx, int sy, int msg){ + struct Component* button; + struct Component* this=Dialog_new(x,y,sx,sy,msg); + + button=Button_new(0x04,0x10,0x20,0x14,'U'); + Component_setlabel(button,"Up"); + this->add(this,button); + + button=Button_new(0x04,0x28,0x20,0x14,'D'); + Component_setlabel(button,"Down"); + this->add(this,button); + + this->handler=ScreenDialog_handler; + + return this; +} + +void rootWindow_handler(struct Component* this, int msg, int param){ + struct Component* dummy; + Window_handler(this,msg,param); + if(msg==DLG_OK && param=='!') + willquit=1; + if(msg==DLG_CANCEL && param=='!'){ + Component_delete(Component_find(this,'!')); + Component_find(this,'Q')->state|=STATE_ENABLED; + this->handler(this,WND_REDRAW,0); + } + + if((msg==DLG_CANCEL || msg==DLG_OK) && param=='#'){ + Component_delete(Component_find(this,'#')); + Component_find(this,'S')->state|=STATE_ENABLED; + this->handler(this,WND_REDRAW,0); + } + + if(msg==CMP_ACTION && param=='Q'){ + dummy=Dialog_new(0x02,0x02,0xfc,0x7c,'!'); + dummy->state=dummy->state | STATE_VISIBLE; + Component_setlabel(dummy,"Really quit?"); + this->add(root,dummy); + Component_find(this,'Q')->state&=0xffff-STATE_ENABLED; + this->handler(this,WND_REDRAW,0); + } + + if(msg==CMP_ACTION && param=='S'){ + dummy=ScreenDialog_new(0x02,0x02,0xfc,0x7c,'#'); + dummy->state=dummy->state | STATE_VISIBLE; + Component_setlabel(dummy,"Screen contrast"); + + this->add(root,dummy); + Component_find(this,'S')->state&=0xffff-STATE_ENABLED; + this->handler(this,WND_REDRAW,0); + } +} + +void Numpad(struct Component* this, int x, int y){ + int i; + char s[2]={0,0}; + struct Component* button; + for(i=0; i<9; i++){ + s[0]=0x31+(char) i; + button=Button_new(x+(i%3)*0x18,y+0x30-(i/3)*0x18,0x16,0x16,i+0x31); + Component_setlabel(button,s); + button->state|=STATE_CASTING; + this->add(this,button); + } + button=Button_new(x+0x18,y+0x48,0x16,0x16,0x30); + Component_setlabel(button,"0"); + button->state|=STATE_CASTING; + this->add(this,button); + + button=Button_new(x+0x30,y+0x48,0x16,0x16,0x08); + Component_setlabel(button,"CE"); + button->state|=STATE_CASTING; + this->add(this,button); +} + +void main(void){ + struct Component* subw; + char buf; + willquit=0; + GraphicsOpen(); + root=Window_new(0x0,0x0,0x00,0x80); + root->state=STATE_VISIBLE; + root->handler=rootWindow_handler; + root->paint=Root_paint; + Component_setlabel(root,"Test-window"); + + subw=Button_new(0xc0,0x60,0x30,0x18,'Q'); + Component_setlabel(subw,"Quit"); + root->add(root,subw); + + subw=ToggleButton_new(0xc0,0x40,0x30,0x18,'T'); + Component_setlabel(subw," Toggle!"); + root->add(root,subw); + + subw=Button_new(0xc0,0x20,0x30,0x18,'S'); + Component_setlabel(subw,"Screen"); + root->add(root,subw); + + subw=Display_new(0x10,0x02,0x46,0x18,'@'); + root->add(root,subw); + + Numpad(root,0x10,0x1f); + + root->paint(root); + + while(read(lcd,&buf,1)==1); + + while(!willquit){ + if(read(lcd,&buf,1)==1) + root->handler(root,KEY_TYPED,buf); + } + + Component_delete(root); + ClearScreen(); +} \ No newline at end of file diff --git a/src/gui/wnd.h b/src/gui/wnd.h new file mode 100644 index 00000000..dcf45c3d --- /dev/null +++ b/src/gui/wnd.h @@ -0,0 +1,201 @@ +#ifndef JOOST_WND_H +#define JOOST_WND_H +#include +#include +#include +#include +#include +#include + +#define FONT_HEIGHT global->currentfont->stringheight +#define FONT_WIDTH(x) global->currentfont->stringwidth(x) +#define LABEL_LENGTH 0x14 +#define SIZE_SCRBLD_RECORD 0x14 + + +#define STATE_VISIBLE 0x0001 +#define STATE_ENABLED 0x0002 +#define STATE_CHECKED 0x0004 +#define STATE_FOCUS 0x0008 +#define STATE_CASTING 0x0010 +#define STATE_ACTION 0x0020 +#define STYLE_MULTILINE 0x0040 +#define STYLE_INVERTED 0x0080 +#define STYLE_PASSWORD 0x0100 +#define STYLE_SELFDESTRUCT 0x1000 +#define STATE_APPLICATION 0x2000 +#define STRING_FROMTABLE 0x4000 +#define STATE_DUMMY 0x8000 + +#define KEY_PRESSED 0x0001 +#define KEY_RELEASED 0x0002 +#define KEY_TYPED 0x0003 +#define WND_OPEN 0x0101 +#define WND_CLOSE 0x0102 +#define WND_REDRAW 0x0103 +#define WND_BROADCAST 0x0104 +#define WND_DESTROY 0x0105 +#define CMP_ACTION 0x0201 +#define CMP_STATECHANGE 0x0202 +#define CMP_BROADCAST 0x0203 +#define DLG_OK 0x0301 +#define DLG_CANCEL 0x0302 +#define APP_QUIT 0x0401 + +struct Global_GUI { + int id; + int lcd; + int willquit; + char *stringtabledata; + char **stringtable; + struct Font* currentfont; + struct Font* firstfont; + struct Component* root; + void (*actionhandler) (struct Component*); +}; + +/************************************************ + * Graphics * + ************************************************/ + +void GraphicsOpen(); +void GraphicsClose(); +void Move(int x, int y); +void ClearRect(int sx, int sy); +void DrawRect(int sx, int sy); +void FillRect(int sx, int sy); +void FillRectNC(int sx, int sy); +void GrayRect(int sx, int sy); +void Text(char *s); +void TouchRegion(int msg, int x, int y, int sx, int sy); +void ClearScreen(); +void EnableScreen(unsigned char c); +void grSetFont(int f); + +/************************************************ + * Fonts * + ************************************************/ + +struct Font { + int id; + int (*stringwidth)(char*); + int (*stringheight)(char*); + struct Font* nextfont; + int sizefontdata; + void* fontdata; +}; + +struct Font* fontSearch(int f); +void setCurrentFont(int f); +void loadFont(int id,int (*sw)(char*),int (*sh)(char*),int sizedata, void* data); + + +/************************************************ + * Components * + ************************************************/ + +struct Component { + int id; + int x,y; + int sizex,sizey; + int state; + int order; + int font; + char msg; + struct Component* parent; + struct Component *next_sibling; + struct Component *first_child; + void (*handler) (struct Component*, int, int); + void (*paint) (struct Component*); + void (*add) (struct Component*, struct Component*); + char* label; + char* label2; + int sizexds; + void *xds; +}; + +struct ActionXDS { + void (*actionhandler)(struct Component*); + int action; + int wParam; + long lParam; +}; + +struct StringTableXDS { + char *stringtabledata; + char **stringtable; +}; + +struct Component* Component_new(int x,int y,int sx,int sy); +void Component_setlabel(struct Component* this, char* s); +void Component_add(struct Component* this, struct Component* comp); +void Component_paint(struct Component* this); +void Component_findXY(struct Component* this, int* x, int* y); +struct Component* Component_find(struct Component* this, int msg); +struct Component* Component_delete(struct Component* this); +void Component_delete_children(struct Component* this); +void Component_changestate_children(struct Component* this, int andmask, int ormask, int xormask); +void Component_linkstringtable(struct Component* this); + +/************************************************ + * Windows * + ************************************************/ + +void Window_handler (struct Component* this, int msg, int param); +void Window_paint(struct Component* this); +void Root_paint(struct Component* this); +void Window_add(struct Component* this, struct Component* comp); +struct Component* Window_new(int x,int y,int sx,int sy); + +/************************************************ + * Buttons * + ************************************************/ + +void Button_handler(struct Component* this, int msg, int param); +void Button_drawtext(struct Component* this, int x, int y); +void Button_paint(struct Component* this); +void Button_add(struct Component* this, struct Component* comp); +struct Component* Button_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Toggle-buttons * + ************************************************/ + +void ToggleButton_handler(struct Component* this, int msg, int param); +void ToggleButton_paint(struct Component* this); +struct Component* ToggleButton_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Dialogs * + ************************************************/ + +void Dialog_handler(struct Component* this, int msg, int param); +struct Component* Dialog_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Displays * + ************************************************/ +void Display_handler(struct Component* this, int msg, int param); +void Display_paint(struct Component* this); +struct Component* Display_new(int x, int y, int sx, int sy, int msg); + +/************************************************ + * Labels * + ************************************************/ +void Label_handler(struct Component* this, int msg, int param); +void Label_paint(struct Component* this); +struct Component* Label_new(int x, int y, int sx, int sy,char* l); + +/************************************************ + * Implementation * + ************************************************/ +void rootWindow_handler(struct Component* this, int msg, int param); +void root_actionhandler(struct Component*); +void screenbuilder(struct Component* root, char* filename); +void read_stringtable(int fh,char* buf); +struct Global_GUI* gui_globals(); +void GUIinit(); +void GUIgo(char* scr); +void GUIunit(); + +#endif \ No newline at end of file diff --git a/src/gui/wnd.ihx b/src/gui/wnd.ihx new file mode 100644 index 00000000..be61cb6f --- /dev/null +++ b/src/gui/wnd.ihx @@ -0,0 +1,1068 @@ +:020000040000FA +:10810000C30381ED73A6C3114AC7CDF9BFCD458125 +:10811000DD210000DD39DD6E04DD66052212C5DDDE +:108120004E02DD4603ED4310C5DD5E00DD5601ED78 +:10813000530EC5CD3AABEBD52A16C57DB4C44481E8 +:10814000D1C319C0E9214AC7110EC5CD6E8111A056 +:10815000C321A0C30132C2CD6381114AC721A0C38C +:1081600001A0C3AFED42C54D44E1C8EDB0C9AFE5D4 +:10817000ED52E1C8121318F77BF5ED3804E602283A +:10818000F9F1ED3906C93E0DCD79813E0A18EAEBC9 +:108190007CCD95817DF50F0F0F0FCD9E81F1E60F00 +:1081A000C69027CE402718D1E3F57E23B72805CD0A +:1081B000798118F6F1E3C90405C8CB2ACB1B10FA64 +:1081C000C9F5E5CD2C827B2F5F7A2F57E1F1C9F5F8 +:1081D000C5E5AFCD1082F5CD2C82F1B72803131879 +:1081E000067B2F5F7A2F57E1C1F1C9F5E5CD2C82CF +:1081F000EBE1F1C9F5E5C53E01CD1082F5CD2C824C +:10820000F1EBB72007AF935F3E009A57C1E1F1C988 +:10821000CB782809AF914F3E0098473E01CB7AC8F2 +:10822000F5AF935F3E009A57F1EE01C92100003E81 +:1082300011CB13CB123DC8CB15CB14ED4230F20954 +:1082400018EFF5C5E5784251676BED4CED6CED5CD0 +:1082500079858257E1C1F1C9C5E5F57CEE80677883 +:10826000EE8047F1A7ED42E1C1C95E2356CD4282BF +:10827000722B73C9B7C8CB28CB19CB1CCB1D3D20A3 +:10828000F5C9E3D5DDE5DD210000DD39DD5609DD89 +:108290007409DD5E08DD7508D5C5F5DD6E0462ED97 +:1082A0006CDD5605ED5C1959DD5607ED5C19DD5E98 +:1082B0000650ED5C19E5DD5E04DD56FEED5CDD6E1D +:1082C00005DD6607ED6C19DD4606ED4C09E5DD5E62 +:1082D00004DD5607ED5CDD6E05DD6606ED6CAF195D +:1082E00017F5DD5E04DD5606ED5C4A0600AF0917A2 +:1082F00055C14CE10984C1814D47EBF1D1D1DDE19C +:10830000D133333333C9EBE3F5DDE5DD210000DDA7 +:1083100039C5D5DD5609DD7409DD5E08DD7508CD8A +:10832000FA83E1C1CD5A84DDE1F1D13333C9EBE306 +:10833000F5DDE5DD210000DD39C5D5DD5609DD744B +:1083400009DD5E08DD7508AFCDB683CDFA83E1C1E6 +:10835000B7CC5A84C45284DDE1F1D13333C9EBE3A5 +:10836000F5DDE5DD210000DD39C5D5DD5609DD741B +:1083700009DD5E08DD7508CDFA83DDF9DDE1F1D1B7 +:108380003333C9EBE3F5DDE5DD210000DD39C5D58B +:10839000DD5609DD7409DD5E08DD75083E01CDB6E8 +:1083A00083CDFA83B72006CD5A84CD5284DDF9DD22 +:1083B000E1F1D13333C9CB7A2818424BDD6607DDB2 +:1083C0006E06CD5A84CD52845059DD7407DD750692 +:1083D0003E01DDCBFF7EC8F5DD46FFDD4EFEDD66EE +:1083E000FDDD6EFCCD5A84CD5284DD70FFDD71FE63 +:1083F000DD74FDDD75FCF1EE01C9F5210000010021 +:1084000000DD36F82118021937DDCBFC16DDCBFD77 +:1084100016DDCBFE16DDCBFF16DD35F8282ECB1191 +:10842000CB10CB15CB14ED5238DD201078DD96073C +:1084300038D5200879DD960638CD180479DD960602 +:108440004F78DD9E074730C12BA718BDF1E5606965 +:10845000C1C92CC024C00CC004C9F57D2F6F7C2F6E +:1084600067792F4F782F47F1C9F5AF956F3E009C84 +:10847000673E00994F3E009847F1C9C5D55E235627 +:10848000234E2346EBCD8282C39B84C5D55E235603 +:10849000234E2346EBCD0683C39B84EB702B712BBD +:1084A000722B73C9F57E83775F237E8A7757237E8D +:1084B00089774F237E8877472B2B2BF1C9E3F5D59E +:1084C0007B96235F7A9E23577B96237A9E23C3D184 +:1084D000843004EB2329195E2356EBD1F1E3C9E381 +:1084E000F5C54E2346237BEDB12002232309C30E9D +:1084F00085E3F5C54E23462378B1280D0B7B9623E3 +:1085000020F57A9620F12323230909C30E85090952 +:108510007E23666FC1F1E3C9E1C5D5DDE5DD21004C +:1085200000DD39E9E1C5D5DDE5DD210000DD395E9D +:10853000235623EB39F9EBE9DDF9DDE1D1C1C9DDE2 +:10854000F9DDE1D13333C9E9CD2485F8FF210600F7 +:1085500039EB2123C1010200EDB02A18C52323E520 +:108560000303C50150C1C5CD89C0F1F14D44E1718E +:10857000237021000039E5210000E52A18C52323D6 +:108580004E2346C5CD3BC0F1F1F1DD36FC60DD3652 +:10859000FD0021000039E5210100E52A18C523234B +:1085A0004E2346C5CD3BC0F1F1F1210200E52E0876 +:1085B000394D442A18C523235E2356CD09C1F1C382 +:1085C0003885D52A18C523235E2356CD09C0D1C9C5 +:1085D000CD2485FCFF21000039EB2125C1010400D9 +:1085E000EDB0DD4602DD70FEDD4604DD70FF2104E6 +:1085F00000E52B2BC3B0854DC3B2852A18C52323B4 +:108600005E23C3BA85CD09C1F1C33885CD2485FC6D +:10861000FF21000039EB2129C1010400EDB0DD4646 +:1086200002DD70FEDD4604DD70FF210400E52B2B2A +:10863000C3B0854DC3F8852A18C5C3B68523C300CA +:108640008623C3BA85CD09C1F1C33885CD2485FC05 +:10865000FF21000039EB212DC1010400EDB0DD4602 +:1086600002DD70FEDD4604DD70FF210400E52B2BEA +:10867000C3B0854DC3F8852A18C5C33A8623C3B84D +:108680008523C30286CD09C1F1C33885CD2485FC7D +:10869000FF21000039EB2131C1010400EDB0DD46BE +:1086A00002DD70FEDD4604DD70FF210400E52B2BAA +:1086B000C3B0854DC3F8852A18C5C33A8623C37E47 +:1086C0008623C3BA85CD09C1F1C33885CD2485FC85 +:1086D000FF21000039EB2135C1010400EDB0DD467A +:1086E00002DD70FEDD4604DD70FF210400E52B2B6A +:1086F000C3B0854DC3F8852A18C5C33A8623C37E07 +:108700008623C3C286CD09C1F1C33885C5FDE5DD29 +:10871000E5D5DDE1CD4EB6E5DDE5C12A18C523235B +:108720005E2356CD09C1F1DDE1FDE1C1C9CD24854E +:10873000F8FF21000039EB2139C1010700EDB0DD60 +:108740004602DD70FADD4604DD70FBDD4608DD70B3 +:10875000FCDD460ADD70FDDD460CDD70FE21070004 +:10876000E52E02C3B0854DC3F8852A18C5C33A86E5 +:1087700023C37E8623C3C286CD09C1F1C33885C514 +:10878000D5CD9487E56CE5E54D44EBCD2D87E1E152 +:10879000E1D1C1C90100005950CDD08501800058F8 +:1087A00050CD0C86218000C9CD2485FCFF2100001E +:1087B00039EB2140C1010300EDB0DD4602DD70FE62 +:1087C000210300E52BC3B0854DC3F8852A18C5C326 +:1087D0003A8623C37E8623C3C286CD09C1F1C3383E +:1087E00085CD2485FEFF21000039EB2143C1010224 +:1087F00000EDB0DD4602DD70FF210200E5C3B0856B +:108800004DC3F8852A18C5C33A8623C37E8623C381 +:10881000C286CD09C1F1C33885CD24850000210C65 +:1088200000ED4B18C50946236668EB7BB228166B32 +:108830006246236668DD4E02DD4603ED42280621CE +:1088400006001918E1EBC33885C5DDE5D5DDE1CDBE +:1088500019887DB4281BDDE5D1CDE187210A00ED23 +:108860004B18C509E5DDE5D1CD19884D44E17123EB +:1088700070DDE1C1C9CD2485FCFFFDE5110C00CD03 +:108880000489DD4E0271DD46032370DD6E04FD7543 +:1088900002DD6605FD7403DD6E08FD7504DD660905 +:1088A000FD7405AFFD7706FD7707DD6E0AFD7508DF +:1088B000DD660BFD7409DD6E0CFD750ADD660DFDD0 +:1088C000740B210C00ED4B18C5097E23B6210C005A +:1088D000ED4B18C5092010FDE5C1712370210A0078 +:1088E000ED4B18C509181246236668EB21060019DE +:1088F0007E23B62106001920EEFDE5C1712370FD2F +:10890000E1C33885CDE3B2E5FDE1C9FDE5DDE5C5AF +:10891000D5DD210000FD210000FDE5210200394EDA +:108920002346E1097EB72850FDE5E1095ECDDF84ED +:108930000A00212C2E3149696A6B6C726689618943 +:10894000578961896189528952895C895C895C890E +:1089500052890102001812010300180D01040018C9 +:10896000080105001803010600DD09210200394E47 +:108970002346DD09FD2318A1DDE5E1F1F1DDE1FD8F +:10898000E1C9CD18857BFE80300621070009180C4F +:10899000FECC38083EDFBB3803696023C33885CD81 +:1089A00018850100001A5FCD8289C33885CD1885EE +:1089B000010500C3A589C5D5010000CD0B89F1C112 +:1089C000C9C5D5010200CD0B89F1C1C9C5D50103C7 +:1089D00000CD0B89F1C1C9CD24850000FDE511252D +:1089E00000CD04892A18C55E235613722B73FDE54A +:1089F000E1732372DD6E02FD7502DD6603FD740313 +:108A0000FD7104FD7005DD6E08FD7506DD6609FD6E +:108A10007407DD6E0AFD7508DD660BFD7409AFFD98 +:108A2000770AFD770BFD770CFD770DFD770EFD774F +:108A30000FFD7710FD7711FD7712FD7713FD771489 +:108A4000FD7715FD7716FD7717FD7718FD7719FD72 +:108A5000771AFD771BFD771CFD7721FD7722FD77C7 +:108A600023FD7724FD771DFD771EFD771FFD772001 +:108A7000FDE5E1FDE1C33885CD24850000FDE5DDA0 +:108A80006E02DD6603E5FDE1110000DD6E04DD66CA +:108A900005197EB728210114806B6278AC67ED421E +:108AA0003015FD6E1DFD661E19E5DD6E04DD6605E3 +:108AB0001946E1701318D4FD6E1DFD661E193600AF +:108AC000FDE1C33885CD24850000FDE55950211511 +:108AD00000DD4E02DD4603097E23666FE5FDE121E0 +:108AE0001500097E23B62009211500097323721889 +:108AF00019FD7E13FDB614280BFD6E13FD6614E5FB +:108B0000FDE118EDFD7313FD721421130019772395 +:108B10007721110019DD4E0271DD46032370FDE15E +:108B2000C33885C5FDE5DDE52115001946236668D6 +:108B3000E5DDE17DB42814DDE5D1DD6E19DD661AD1 +:108B4000CD4785DD6E13DD661418E5DDE1FDE1C17D +:108B5000C9CD24850000FDE5DD6E02DD6603E5FD7F +:108B6000E1DD6E04DD66057EFD860277237EFD8EE7 +:108B70000377DD6E08DD66097EFD860477237EFDC2 +:108B80008E0577FD6E11FD6612E5FDE17DB420D105 +:108B9000FDE1C33885CD24850000211500DD4E029E +:108BA000DD46030946236668EB7BB2281B211000D3 +:108BB000194E0600DD6E04DD6605A7ED422003EBCD +:108BC00018082113001918DC6F67C33885CD248578 +:108BD000F8FFFDE5DD6E02DD6603E5FDE1FD6E15E6 +:108BE000DD75F8FD6616DD74F9FDE5E17DB4CA8634 +:108BF0008DDD7EF8DDB6F92811DD5EF8DD56F9CDA4 +:108C0000CD8BDD75F8DD74F918E7FD7E11FDB61228 +:108C1000CA9C8CFD6E11FD66120115000946236683 +:108C200068FDE5C1A7ED42FD6E11FD66120115005C +:108C3000092009E5FD6E11FD66121850462366688D +:108C4000DD75F8DD74F9211300DD4EF8DD46F90914 +:108C500046236668FDE5C1A7ED422819211300DD12 +:108C60004EF8DD46F9097E23B6280A21130009567D +:108C700023666A18CB211300DD4EF8DD46F9097E24 +:108C800023B6281821130009E5211300094623669D +:108C900068011300094E2346E1712370FD6E13DD58 +:108CA00075F8FD6614DD74F93E04FDAE21FDB622B3 +:108CB000C2528DFD6E11DD75FCFD6612DD74FDFD89 +:108CC0006E23DD75FEFD6624DD74FF5E2356CD77D1 +:108CD000AFDD6EFEDD66FF23235E2356CD77AFDD6D +:108CE0007EFCDDB6FD2820212100DD4EFCDD46FDA9 +:108CF000093E04AE23B6280F2111000956DD72FC8F +:108D00002366DD74FD18D8DD7EFCDDB6FD28432129 +:108D10002300DD4EFCDD46FD0946DD70FE2366DDE9 +:108D200074FF210600ED4B18C509E5DD6EFEDD661A +:108D3000FF5E2356E1732372210800ED4B18C5092D +:108D4000E5DD4EFEDD46FF030369604E2346E1711B +:108D50002370FD4E21FD4622210000CD58823009AE +:108D6000FD5E23FD5624CD77AFFDCB0B762011FDA4 +:108D70007E1DFDB61E2809FD5E1DFD561ECD77AF7A +:108D8000FDE5D1CD77AFDD6EF8DD66F9FDE1C338E5 +:108D900085C5FDE5DDE52115001946236668E5DD9D +:108DA000E17DB42808DDE5D1CDCD8B18F1DDE1FD05 +:108DB000E1C1C9CD24850000FDE5211500DD5E027D +:108DC000DD5603195623666AE5FDE17DB4283D2191 +:108DD0000A00FDE5C109DD7E04DD56052F5F7A2F0F +:108DE000577EA377237EA277210A00097EDDB6088D +:108DF00077237EDDB60977210A00097EDDAE0A778A +:108E0000237EDDAE0B772113000918B811DCC4CD29 +:108E100084ACFDE1C33885C5FDE5DDE5D5DDE121A7 +:108E200015001946236668E5FDE1211D001946235A +:108E300066680100903E80AC67ED42302EDD4E1D2D +:108E4000DD461E210000CD58823020DD6E1DDD661E +:108E50001E29E5210800ED4B18C5094E2346E109FE +:108E60002B2B46DD701D2366DD741EDD6E1FDD6657 +:108E7000200100903E80AC67ED42302EDD4E1FDDBC +:108E80004620210000CD58823020DD6E1FDD662097 +:108E900029E5210800ED4B18C5094E2346E1092BB1 +:108EA0002B46DD701F2366DD7420FDE5E17DB428CF +:108EB00011FDE5D1CD178EFD6E13FD6614E5FDE1C4 +:108EC00018E8DDE1FDE1C1C9CD2485D2FFFDE5AFA4 +:108ED000DD77F9DD77FADD77FBDD77FC5950CDF1F1 +:108EE000840600010002010301040105010104F3ED +:108EF000906C9002902B90798F8A8FFD8E211500B7 +:108F0000DD4E02DD46030946236668E5FDE17DB4DA +:108F10002864FDCB0A46284FDD6E08DD6609E5DDD5 +:108F20004E04DD4605CD3191E1FDCB0A6E2838FDBA +:108F30004E100600DD6E08DD6609A7ED422028FD13 +:108F40006E23DD75FDFD6624DD74FEFDE5D146234F +:108F50006668CD4785DD6EFDDD66FE23232366AFA3 +:108F6000B42004FD210000FDE5E17DB428A0FD6EE4 +:108F700013FD66141895C3F390DD5E024BDD5603B6 +:108F800042211900CD2991C3F390210A00DD4E0240 +:108F9000DD4603097EE6FC77212B0039E52B2B4DBE +:108FA00044DD5E02DD5603CD518BE1210800DD4E2C +:108FB00002DD4603095E2356D5210600095E2356CD +:108FC000D5DD6EFBDD66FCE5DD4EF9DD46FA110010 +:108FD00000CD2D87E1E1E1210000E52E11DD5E02EB +:108FE000DD5603195E2356211100DD4E02DD4603D6 +:108FF00009462366680117000946236668010301D4 +:109000001826211100DD4E02DD4603095623666A4B +:10901000E5FDE15950CDCD8B210000E5010301FDB7 +:10902000E5D1FD6E17FD6618C3EF90211500DD4EEA +:1090300002DD46030946236668E5FDE17DB4282983 +:10904000DD6E08DD6609FDE5C1ED422814FDCB0AA1 +:109050005E280EDD6E08DD6609E5010302CD319163 +:10906000E1FD6E13FD661418D0C3F390211100DDED +:109070004E02DD4603097E23B6200E210400ED4B8F +:1090800018C50936012377186A210A000923CB6E17 +:109090002025DD6E08DD6609E52111005950195EB5 +:1090A000235621110009462366680117000946234B +:1090B00066680101041838211100095623666AE523 +:1090C000FDE1110A00197EF603776A62E523E54A9D +:1090D00042FDE5D1CDB38DE1E1210000E5DD5E0289 +:1090E0004BDD5603422E170946236668010501CD64 +:1090F0004785E1FDE1C338852346211100DD5E028D +:10910000DD5603195E2356CD958BEB0178C1CD78E2 +:109110008A211100DD4E02DD4603095E235621112E +:109120000009462366680119000946236668C3479B +:1091300085FDE5D1FD6E17FD6618C34785C5DDE5E4 +:10914000F5F5D5DDE121020039AF7723772B2B2B05 +:10915000772377210A00ED4B18C5097E23666F46F9 +:10916000236668E5210E00194E2346E1A7ED42284B +:1091700003CD6092DDCB0A46CA1B9221000039E57F +:10918000CD5692E121000039CD2192E5DD6E06DD5C +:109190006607E5210400394E2346C5234E234611B8 +:1091A0000000CD2D87E1E1E1DD5E1DDD561E210AC7 +:1091B00000ED4B18C509CDAC92E5210200394E23D4 +:1091C00046E109010400094D4421020039CD4192D4 +:1091D000CDAC924D44DD6E08DD6609A7ED4201FC81 +:1091E000FF094D44CDC192210000394E234623CDC5 +:1091F000419246236668CDB092010500094D44DDD9 +:109200005E06DD5607CD8C86210000394E234603CD +:109210000323CDCA92DDE5D1CD238BE1E1DDE1C1B0 +:10922000C94E2346235E2356CDD085DD4E08DD464C +:1092300009DD5E06DD5607CD0C86DD6E08DD6609AC +:10924000C95E2356CDD085DD5E1DDD561E210A0088 +:10925000ED4B18C509C923234D44DDE5D1C3518B1E +:10926000DD5E0EDD560FC34988210A00ED4B18C59F +:109270000946236668232346236668CD47854D4407 +:10928000DD6E06DD6607A7ED42EB010200CDCF8162 +:10929000FDE5E119EBC9CD47854D44DD6E08DD667E +:1092A00009A7ED42EB010200CDCF81C97E23666F95 +:1092B0000104000946236668C34785DD4E08DD4684 +:1092C00009DD5E06DD5607C34C865E23561313CDBB +:1092D000D085DD5E1DDD561EC30C87CD1885CD946F +:1092E00087E56CE5E54D44EBCD2D87E1E1E1DD5E01 +:1092F00002DD5603CD238BC33885C5D5CDC58AE1A4 +:10930000E1C9DDE5C5D5210A00394E2346C52B2B21 +:109310002B4E2346C5210600394E2346CDD789F171 +:10932000F1E5DDE10117000936C823368EDD361977 +:109330003DDD361A91DD361BFADD361C92DDE5E1A6 +:10934000F1F1DDE1C9CD1885FDE5D5FDE1DD6E0862 +:10935000DD6609E5CDC88EE13E01DDAE04DDB60572 +:109360002054FD4E1047DD6E08DD6609ED422046B3 +:10937000FD7E0AE603283FDD6E08DD6609E5FD5E39 +:1093800011FD5612FD6E11FD66120E17CDE393E12D +:10939000FDCB0A662820FD4E100600C5FD5E11FDBE +:1093A0005612FD6E11FD66120E17094623666801FE +:1093B0000401CD4785E1210102DD4E04DD4605A70C +:1093C000ED42200BDD6E08DD6609E5CDD493E1FDAD +:1093D000E1C33885FD5E11FD5612FD6E11FD66126A +:1093E0000117000946236668010102C34785FDE5B0 +:1093F000DDE5D5DDE1C5FDE1210A0019CB76DD5EB5 +:109400001DDD561E210A00ED4B18C5097E23666F2F +:109410000104000946236668CA9E94CD4785294DFC +:1094200044DD6E08DD6609A7ED42EB010200CDCFF9 +:1094300081210600394623666819E5DD5E1DDD568B +:109440001E210A00ED4B18C5097E23666F23237E7B +:1094500023666FCD4785EBDD6E06DD6607A7ED520F +:10946000EB010200CDCF81FDE5E119EBC1CDCF923B +:10947000DD5E08DD5609010200CDCF8121060039ED +:1094800046236668194D4403C5DD5E1FDD5620CDB9 +:109490006992C1CDD085DD5E1FDD56201823CD96A3 +:1094A000922106003946236668194D4403C5DD5EE6 +:1094B0001DDD561ECD6992C1CDD085DD5E1DDD5608 +:1094C0001ECD0C87DDE1FDE1C9C5DDE5F5F5D5DD96 +:1094D000E121020039AF7723772B2B2B77237721DC +:1094E0000A00ED4B18C5097E23666F46236668E5C2 +:1094F000210E00194E2346E1A7ED422803CD6092CC +:10950000DDCB0A46285E21000039E5CD5692E121E7 +:10951000000039CD2192E5DD6E06DD6607E5210408 +:1095200000394E2346C5234E2346DDCB0A4E28077D +:10953000DD5E1016001803110000CD2D87E1E1E17A +:10954000DD7E0AE682280EDD7E0AE682EE822805AE +:10955000CD6A951803CDBB92210000394E2346C534 +:10956000CD7995E1E1E1DDE1C1C9DD4E08DD4609D6 +:10957000DD5E06DD5607C3CC86234E2346DDE5D1EE +:10958000C3EE93C5D5E1E1C9CD24850000FDE5DD3D +:109590006E0ADD660BE5DD6E08DD6609E5CDCE956C +:1095A000F1F1E5FDE1010A00097EF60377DD460CE5 +:1095B000FD7010FD361745FD361893FD3619C9FDAF +:1095C000361A94FD361B83FD361C95C3708ADD5E0A +:1095D00002DD5603C3D789CD2485FCFFFDE52104B8 +:1095E0000039EB2145C1010200EDB0AFDD77FCDDB4 +:1095F00077FD010980DD6EFCDD66FD78AC67ED422C +:10960000D28896DD7EFCC631DD77FE213100DD4E4D +:10961000FCDD46FD09E5211600E5E5010300DD5E00 +:10962000FCDD56FDCDCF810E18CD4282DD6E08DD0A +:109630006609A7ED520E3009E50E03DD5EFCDD562E +:10964000FDCDF4810E18CD4282DD6E04DD66051974 +:10965000EBC1CD8895F1F1F1E5FDE1210400394D33 +:1096600044FDE5D1CD1097FDE5DD5E024BDD5603EF +:1096700042211B000946236668C1CD4785DD34FCC5 +:109680002003DD34FDC3F295213000E52E16E5E51B +:109690002E48DD4E08DD4609094D44211800DD5EE7 +:1096A00004DD5605CD2A97F1F1F1E5FDE1015AC13E +:1096B000CD0F97FDE5DD5E024BDD560342211B0019 +:1096C000097E23666FC1CD4785210800E52E16E58A +:1096D000E52E48DD4E08DD4609094D44213000DD08 +:1096E0005E04DD5605CD2A97F1F1F1E5FDE1015C5F +:1096F000C1CD0F97FDE5DD5E024BDD560342211B18 +:10970000000946236668C1CD4785FDE1C33885EB76 +:10971000CD788AFDCB0AE6C9DD4E0ADD460B094D40 +:109720004421D0FFDD5E08DD560919EBC38895CDD5 +:109730001885FDE5D5FDE1DD6E08DD6609E5CDC8DE +:109740008EE13E01DDAE04DDB6052078FD4E10470A +:10975000DD6E08DD6609ED42206AFD7E0AE603281B +:1097600063FD7E0AEE04FD770ADD6E08DD6609E51D +:10977000FD5E11FD5612FD6E11FD66120E170946B3 +:10978000236668010202CD4785E1210000E501035F +:1097900001FDE5D1FD6E17FD6618CD4785E1FDCBD6 +:1097A0000A662820FD4E100600C5FD5E11FD56120A +:1097B000FD6E11FD66120E1709462366680104014D +:1097C000CD4785E1210102DD4E04DD4605A7ED42CE +:1097D000200BDD6E08DD6609E5CDD493E1FDE1C324 +:1097E0003885C5DDE5F5F5D5DDE121020039AF7736 +:1097F00023772B2B2B772377210A00ED4B18C509F4 +:109800007E23666F46236668E5210E00194E2346C7 +:10981000E1A7ED422803CD6092DDCB0A46CAB0989D +:1098200021000039E5CD5692E1210000394E234652 +:10983000235E2356CDD085DD4E08DD4609DD5E066C +:10984000DD5607CD0C86DDCB0A4E2825DDCB0A562A +:10985000281FCD6A95DD6E08DD6609E5DD6E06DD43 +:109860006607E5210400394E2346C5234E234618DA +:1098700023CDBB92DD6E08DD6609E5DD6E06DD6693 +:1098800007E5210400394E2346C5234E2346DDCB90 +:109890000A4E2807DD5E1016001803110000CD2DBA +:1098A00087E1E1E1210000394E2346C5CD7995E1FC +:1098B000E1E1DDE1C1C9CD24850000FDE5DD6E0AF1 +:1098C000DD660BE5DD6E08DD6609E5CDCE95F1F1CF +:1098D000E5FDE1010A00097EF60777DD460CFD7023 +:1098E00010FD36172FFD361897FD3619E2FD361A92 +:1098F00097FD361B83FD361C95C3708ACD1885FDF8 +:10990000E5D5FDE1DD6E08DD6609E5CDC88EE12116 +:109910000102DD4E04DD4605A7ED4220463EFFDD97 +:10992000AE08DDB609203CFDCB0B66E52805010538 +:10993000011803010201FDE5D1FD6E17FD6618CD8A +:109940004785E1FD4E100600C5FD5E11FD5612FD76 +:109950006E11FD66120E170946236668010103CDDC +:109960004785E1210102DD4E04DD4605A7ED4220D9 +:10997000463EFEDDAE08DDB609203CFDCB0B66E5BC +:1099800028050105011803010201FDE5D1FD6E174F +:10999000FD6618CD4785E1FD4E100600C5FD5E1140 +:1099A000FD5612FD6E11FD66120E170946236668FC +:1099B000010203CD4785E1FDE1C33885CD2485FE55 +:1099C000FFFDE5DD6E0ADD660BE5DD6E08DD66098F +:1099D000E5CDCE95F1F1E5FDE1010A0009CBC6DD4B +:1099E000460CFD7010FD3617FCFD361898FD361933 +:1099F0003DFD361A91FD361BFAFD361C9221FF0003 +:109A0000E52E14E52E28E521E4FFCD1897F1F1F1BC +:109A1000DD75FEDD74FF011D0009E5110300CDE3D6 +:109A2000B24D44E1712370015FC1CD609A21FE0007 +:109A3000E52E14E52E28E521C8FFCD1897F1F1F1A8 +:109A4000DD75FEDD74FF011D0009E5110700CDE3A2 +:109A5000B24D44E17123700162C1CD609AC3708A36 +:109A6000DD5EFEDD56FFCD788ADD4EFEDD46FFFD74 +:109A7000E5D1FD6E1BFD661CCD4785C9CD1885FD62 +:109A8000E5D5FDE1DD6E08DD6609E5CD4593E12113 +:109A90000302DD4E04DD4605A7ED422046FDCB0A5C +:109AA0005E28403E08DDAE08DDB609FD5E1DFD56B0 +:109AB0001E200FCD4EB67DB42815CDE89A2B36006A +:109AC000180DCDEE9A233600CDE89ADD46087021B8 +:109AD0000000E5010301FDE5D1FD6E17FD6618CD1F +:109AE0004785E1FDE1C33885FD5E1DFD561ECD4E67 +:109AF000B6FD4E1DFD461E09C9C5DDE5F5F5D5DDF2 +:109B0000E121020039AF7723772B2B2B77237721A5 +:109B10000A00ED4B18C5097E23666F46236668E58B +:109B2000210E00194E2346E1A7ED422803CD609295 +:109B3000DDCB0A46CAB99B21000039E5CD5692E13A +:109B400021000039CD2192E5DD6E06DD6607E521B5 +:109B50000400394E2346C5234E2346DDCB0A4E284A +:109B600007DD5E1016001803110000CD2D87E1E11E +:109B7000E1DDCB0A7EDD4E08DD4609DD5E06DD5601 +:109B8000072005CDCC861803CD4C86DD5E1DDD5645 +:109B90001E210A00ED4B18C5094623666801040022 +:109BA0000946236668CD969268603946236668192F +:109BB0004D4421020039CDCA92E1E1DDE1C1C9DDA8 +:109BC000E5C5D5210C00394E2346C52B2B2B4E2342 +:109BD00046C52B2B2B4E2346C5210800394E234664 +:109BE000CD8895F1F1F1E5DDE1010A0009CBDE0157 +:109BF00069C1DDE5D1CD788ADD3619F9DD361A9AED +:109C0000DD36177CDD36189AC33D93C5D5E1E1C931 +:109C1000C5DDE5F5F5D5DDE121020039AF77237724 +:109C20002B2B2B772377210A00ED4B18C5097E23B8 +:109C3000666F46236668E5210E00194E2346E1A7AC +:109C4000ED422803CD6092DDCB0A462815210000A5 +:109C500039E5CD5692E1210000394E2346C5CD7934 +:109C600095E1E1E1DDE1C1C9CD24850000FDE5DD3F +:109C70006E0ADD660BE5DD6E08DD6609E5CDCE9585 +:109C8000F1F1E5FDE1011D0009DD4E0C71DD460D30 +:109C90002370FD360A01FD360B00FD36170BFD362D +:109CA000189CFD361910FD361A9CFD361B83FD36B7 +:109CB0001C95C3708ACD24859EFFFDE5212300DD20 +:109CC0004E02DD46030946DD709E2366DD749F2A41 +:109CD0001AC57DB42066110800CDE3B2221AC50171 +:109CE000060009E5111600CDE3B24D44E171237081 +:109CF000210600ED4B1AC5095623666A1114001996 +:109D0000AF772377210600ED4B1AC5097E23666FD6 +:109D100072210600ED4B1AC5095623666A110E0022 +:109D200019AF772377210600ED4B1AC50946236644 +:109D3000680110000977237723772377DD6E9EDD96 +:109D4000669F23233E1023AE2BB6204B210600DD59 +:109D50004E9EDD469F096E67E52A1AC5C1712370C4 +:109D60002A1AC52323E5CD2FA2E171237021040017 +:109D7000ED4B1AC509E5210600DD5E9EDD569F19F3 +:109D80005E2356234E2346EB3E10CD43A2E1CDE5A4 +:109D9000A1CD22A2CDF890DD6E9EDD669F232346E5 +:109DA0002366680110903E80AC67ED42DAC39EDD09 +:109DB0006E9EDD669F23234E2346211210CD5882CE +:109DC000DAC39E210600ED4B1AC50946236668DDFD +:109DD00075A2DD74A3211400DD4EA2DD46A3097E29 +:109DE00023B6280A211400095623666A18E12104C3 +:109DF00000DD4E9EDD469F094E2346211100DD5EAB +:109E000002DD5603195E2356CD958BDD75A0DD74FA +:109E1000A1011D00094E2346DD5E02DD5603CD780B +:109E20008A0169C1DD5EA0DD56A1CD788ADD5EA024 +:109E30004BDD56A142211900CD2991DD6E9EDD66D4 +:109E40009F23235E2356CDBD8410100300B59E557D +:109E50009E6D9E8D9E211D00DD4E02DD4603094E46 +:109E60002346DD5EA2DD56A3CD31B61848210E0093 +:109E7000DD4EA2DD46A309E5211D00DD4E02DD46D3 +:109E800003095E2356CD18AC4D44E11825211D0071 +:109E9000DD4E02DD4603095E2356CD29AC7C079FCB +:109EA0004F41E5211000DD5EA2DD56A319D17323D9 +:109EB0007223712370DD5E024BDD560342211900CF +:109EC000CD2991DD6E9EDD669F23234623666801C2 +:109ED0001E10A7ED42C2FFA0AFDD77ACDD77ADDD90 +:109EE00077AEDD77AF210600ED4B1AC50946236634 +:109EF00068E5FDE1210100E5217EC1E5CD89C0F1E4 +:109F0000F1DD75A0DD74A121080039E5210000E52F +:109F1000DD6EA0DD66A1E5CD3BC0F1F1F1DD36A837 +:109F200060DD36A90021080039E5210100E5DD6E7C +:109F3000A0DD66A1E5CD3BC0F1F1F1FDE5E17DB429 +:109F4000CA20A0FD7E0EFDB60FCA14A03E01FDAED4 +:109F50000EFDB60F20296F67E52E64E5CD4AA2C538 +:109F6000E56F67E52E64E5CD59A2C5E5FDE5218BDA +:109F7000C1E521200039E5CD57B5210E0018682133 +:109F80000000E52E64E5FD6E0EFD660F7C079F4F19 +:109F900041C5E5CD68A2CD8383C5E5210000E52E4E +:109FA00064E5FD6E0EFD660F7C079F4F41C5E5CD54 +:109FB00068A2CD2E83C5E5210000E52E64E5CD4ADB +:109FC000A2C5E5210000E52E64E5CD59A2C5E5FD59 +:109FD0006E0EFD660FE5FDE521AEC1E5212A0039D3 +:109FE000E5CD57B521180039F921100039E5FD5E9E +:109FF0000EFD560F7A079F4F41C5D5CD68A2EBE104 +:10A00000CDA48421140039EBCD4EB6E521160039DC +:10A01000CDDAA1F1FD6E14FD6615E5FDE1C33B9FB0 +:10A020006F67E52E64E5DD4EAEDD46AFDD6EACDD7F +:10A0300066ADCD8383C5E56F67E52E64E5DD4EAE85 +:10A04000DD46AFDD6EACDD66ADCD2E83C5E52169A5 +:10A05000C1E5E521EEC1E521220039E5CD57B52165 +:10A06000100039F921140039EBCD4EB6E521160068 +:10A0700039CDDAA1F1DD5EA0DD56A1CD09C0210602 +:10A0800000ED4B1AC50946236668E5FDE17DB4285D +:10A090000EFDE5D1CD77AFFD6E14FD661518EB21F1 +:10A0A0000600ED4B1AC509E5111600CDE3B2EBE150 +:10A0B000732372210600ED4B1AC5095623666A11F7 +:10A0C000140019AF772377210600ED4B1AC5097EDE +:10A0D00023666F72210600ED4B1AC5095623666A86 +:10A0E000110E0019AF772377210600ED4B1AC50931 +:10A0F000462366680110000977237723772377DDED +:10A100006E9EDD669F232346236668011F10A7ED20 +:10A1100042C2D5A1210600ED4B1AC5094623666847 +:10A12000DD75A0DD74A1211400DD4EA0DD46A1097E +:10A130007E23B6280A211400095623666A18E121F5 +:10A140000600DD4E9EDD469F096E67E52A1AC5C1F1 +:10A150007123702A1AC52323E5CD2FA2E171237044 +:10A16000210400ED4B1AC509E5210600DD5E9EDDE8 +:10A17000569F195E2356234E2346EB3E10CD43A235 +:10A18000E1CDE5A1CD22A2CDF890211400DD4EA0B5 +:10A19000DD46A109E5111600CDE3B2EBE1732372B0 +:10A1A000211400095623666ADD75A0DD74A101142F +:10A1B0000009AF772377DD6EA0DD66A170210E0068 +:10A1C000DD4EA0DD46A10977237721100009772312 +:10A1D0007723772377FDE1C338854D44DD5EA0DD2D +:10A1E00056A1C309C17123702A1AC54E23462111F5 +:10A1F00000DD5E02DD5603195E2356CD958BEB0123 +:10A200006AC1CD788A2A1AC523234E23462111001C +:10A21000DD5E02DD5603195E2356CD958BEB017290 +:10A22000C1C9CD788A210400ED5B1AC5194EC92138 +:10A230000600DD4E9EDD469F095E2356234E2346D3 +:10A24000EB3E08CD748206004DC9FD4E12FD46134B +:10A25000FD6E10FD6611C38383FD4E12FD4613FD96 +:10A260006E10FD6611C32E83FD4E12FD4613FD6E6A +:10A2700010FD6611C38282C5D5210600394E2346E2 +:10A28000C5210400394E2346CDC88EE1E1E1C9CD98 +:10A290002485CEFFFDE5DD36D800210000E5C5CDE3 +:10A2A00089C0F1F1DD75D4DD74D5DD36F02BDD36F6 +:10A2B000F100DD36F21ADD36F300DD36F400DD7E26 +:10A2C000D8FE732018DD6ED9DD66DADD75F0DD7439 +:10A2D000F1DD6EDBDD66DCDD75F2DD74F3DD7ED88D +:10A2E000FE422807DD7ED8FE4D2037DD4EDD06001C +:10A2F000C5CDBCA5D5DD4EDBDD5EF0DD56F1CDC5AF +:10A30000A5D5CDD9A5D5CDCCA5C1CD8895F1F1F1F7 +:10A31000E5FDE1DD7ED8FE4D2004FDCB0AF6DD36FD +:10A32000F401DD7ED8FE54202CDD4EDD0600C5CDC7 +:10A33000BCA5D5DD4EDBDD5EF0DD56F1CDC5A5D586 +:10A34000CDD9A5D5CDCCA5C1CDB698F1F1F1E5FD1E +:10A35000E1DD36F401DD7ED8FE44202CDD4EDD0645 +:10A3600000C5CDBCA5D5DD4EDBDD5EF0DD56F1CD03 +:10A37000C5A5D5CDD9A5D5CDCCA5C1CDBF9BF1F176 +:10A38000F1E5FDE1DD36F401DD7ED8FE4C202F2124 +:10A390000C003901120009E5CDBCA5D5DD4EDBDD91 +:10A3A0005EF0DD56F1CDC5A5D5CDD9A5D5CDCCA5D1 +:10A3B000C1CD689CF1F1F1E5FDE1DD36F401DD7E12 +:10A3C000D8FE41204C212300DD4E02DD460309E585 +:10A3D000212B0039EBE1732372DD6EDEDD66DFDDFC +:10A3E00075F7DD74F8DD6EE0DD66E1DD75F9DD74CD +:10A3F000FA211600394E2346235E2356DD71FBDD1C +:10A4000070FCDD73FDDD72FEDD5E02DD5603CDE521 +:10A41000A5DD7ED8FE53206C210C00394D44DD5E55 +:10A42000D4DD56D5CDDAA8212300DD4E02DD46036A +:10A4300009E5110400CDE3B2EBE17323722123009F +:10A440000956DD72F52366DD74F621210009360414 +:10A450002336006ADD66F62323E5210800ED4B185C +:10A46000C5095E2356E1732372210600ED4B18C522 +:10A470000946236668E5DD6EF5DD66F6C171237079 +:10A48000DD36F400AFDDB6F4CA7DA5DD7EDEDDB6D7 +:10A49000DF2865FDCB0AEEFD36210AFD36220011CC +:10A4A0000A00CDE3B2FD7523FD7424FD6E23DD7536 +:10A4B000D0FD6624DD74D136E52336A5DD6ED0DD12 +:10A4C00066D12323DD4EDE71DD46DF2370210400DB +:10A4D000DD4ED0DD46D109DD5EE073DD56E123724D +:10A4E00021060009E5211800395E2356234E234634 +:10A4F000E173237223712370DD7EE6DDB6E7280C5D +:10A50000DD6EE6FD750ADD66E7FD740BDD6EE8FDC8 +:10A51000750EDD66E9FD740FDD6EEAFD751DDD7EED +:10A52000EBE60FFD771EFD7E1DFDB61E20161114F5 +:10A5300000CDE3B2FD751DFD741EFD6E1DFD661E92 +:10A5400036001804FDCB0BF6DD7EEB2E004DE6F059 +:10A55000472610ED423010DD6EEADD7EEBE60F6738 +:10A5600023FD751FFD7420FDE5DD5E024BDD560306 +:10A5700042211B000946236668C1CD47852114008E +:10A58000E52E0E394D44DD5ED4DD56D5CDAFC0F19C +:10A590003E14ADB4CABAA2DD5ED4DD56D5CD09C035 +:10A5A000DD5E02DD5603CD178EDD5E024BDD560308 +:10A5B00042211900CD2991FDE1C33885DD4EDCDD56 +:10A5C0005EF2DD56F3CD42821B1B1BC9DD5ED95006 +:10A5D000DD4EF0DD46F1C34282DD4EDADD5EF2DDB6 +:10A5E00056F3C34282CD2485EEFFFDE5DD6E02DD2C +:10A5F0006603E5FDE121060039EB2147C1010900B1 +:10A60000EDB0FD6E23DD75EEFD6624DD74EF2323D2 +:10A610003E01AE23B62011C5010104FDE5D1FD6E5A +:10A6200017FD6618CD4785E1DD6EEEDD66EF23236D +:10A6300046236668CB853E02ADB4C23EA76F67E590 +:10A64000E5010100FD5E11FD5612CDB38DE1E1FD86 +:10A650006E11FD6612010800094E2346C5FD6E11FC +:10A66000FD6612010600094E2346C501000059503F +:10A67000CD0293F1F1DD75F0DD74F1010A000936C8 +:10A68000032370DD6EEEDD66EF2323CB46280C69D5 +:10A6900060DD4EF0DD46F10923CBEE211700DD4EE3 +:10A6A000F0DD46F10936772336A22119000936DBA1 +:10A6B000233692210600DD5EEEDD56EF195EEBDDFE +:10A6C00075F2210600DD4EEEDD46EF095E235623CE +:10A6D0004E2346EB3E08CD7482DD75F3210600DD86 +:10A6E0004EEEDD46EF095E2356234E2346EB3E1029 +:10A6F000CD7482DD75F4210600DD4EEEDD46EF09F6 +:10A700005E2356234E2346EB3E18CD7482DD75F54D +:10A71000210600394D44DD5EF0DD56F1CD8FA2DD1E +:10A720004EF0DD46F1C5FD5E11FD5612FD6E11FDC8 +:10A730006612011B000946236668C1CD4785DD6EA0 +:10A74000EEDD66EF23233E04AE23B6C2CFA821017F +:10A7500000E5FD6E11FD66120108000946236668DA +:10A7600001F6FF09E5FD6E11FD66120106000946BE +:10A7700023666801F6FF09E50105005950CDBC9933 +:10A78000F1F1F1DD75F0DD74F1010A000936032302 +:10A790003610210E00DD4EF0DD46F109363023364D +:10A7A00000AFDD77FDDD77FE210400DD4EEEDD46F6 +:10A7B000EF095E2356060CCDB7814B42DD6EFDDD01 +:10A7C00066FECD588230043E011801AFE60FCA6222 +:10A7D000A8210400DD4EEEDD46EF0946237E68E643 +:10A7E0000F67DD4EFDDD46FE0929E5210800ED5B22 +:10A7F00018C5195E2356E1192B2B5E2356D521105F +:10A8000000E52E06DD5EF0DD56F1196E260001F042 +:10A81000FF09E5DD6EFDDD66FE29294D44290901AC +:10A820001400094D44110800CD689CF1F1F1DD756B +:10A83000FBDD74FC010E000936302370DD4EFBDDBC +:10A8400046FCC5DD5EF04BDD56F142211B0009469A +:10A85000236668C1CD4785DD34FD2003DD34FEC3AA +:10A86000A8A70111C2DD5EF0DD56F1CD788A01FFA7 +:10A8700000DD5EF0DD56F1CD958B010E000936301E +:10A8800023700EFEDD5EF0DD56F1CD958BEBCDCD68 +:10A890008BDD4EF0DD46F1C5FD5E11FD5612FD6EFD +:10A8A00011FD6612011B000946236668C1CD47856C +:10A8B000210000E5FD5E11FD5612FD6E11FD6612D0 +:10A8C0000117000946236668010301CD4785E1FDB4 +:10A8D000E5D1CDB59CFDE1C33885CD2485F8FFFDDC +:10A8E000E5030ADD77FE030ADD77FF0369604EDDCD +:10A8F00071FC2346DD70FDDD6EFE6729EBCDE3B212 +:10A90000DD75FADD74FB5950CD0489C54D44DD5E1B +:10A9100002DD5603CDAFC0F1110000AFDD77F8DDE9 +:10A9200077F9DD4EFCDD46FD6B62CD58823035CDCA +:10A93000A0A9303023DD75F8DD74F92B29DD4EFA3E +:10A94000DD46FB09E5FDE5E1194D44E1712370FDAC +:10A95000E5E1197EB728031318F56B6213FDE5C115 +:10A96000097718BECDA0A9301329DD4EFADD46FBCC +:10A9700009E5FDE5E1194D44E1712370210600ED83 +:10A980004B18C509FDE5C1712370210800ED4B1876 +:10A99000C509DD4EFA71DD46FB2370FDE1C3388544 +:10A9A000DD4EFEDD46FFDD6EF8DD66F9C35882C57B +:10A9B000D5111000CDE3B22218C5210000221AC51E +:10A9C0002A18C5AF772377210400ED4B18C5097706 +:10A9D0002377210A00ED4B18C509772377210C0056 +:10A9E000ED4B18C509772377210800ED4B18C509F1 +:10A9F000772377210600ED4B18C509772377CD48DB +:10AA000085210000E5E5219F89E501B68911300027 +:10AA1000CD7588E1E1E1210000E5E5219F89E501AF +:10AA2000C189113100CD7588E1E1E1210000E5E542 +:10AA300021AD89E501CC89113200CD7588E1E1E1D4 +:10AA4000210E00ED4B18C509E5118000D55AD54BF4 +:10AA500042CD0293F1F14D44E1712370210E00EDDE +:10AA60004B18C5095623666A110A0019360123726C +:10AA7000210E00ED4B18C5095623666A11170019FF +:10AA800036772336A2210E00ED4B18C50946236602 +:10AA9000680119000936DB233692D1C1C9C5D52119 +:10AAA0000E00ED4B18C5095E2356CDCD8BCD7F87AB +:10AAB000CDC285D1C1C9CD2485FEFF011DC2210EA5 +:10AAC00000ED5B18C5195E2356CD8FA2210100E56C +:10AAD0002339CD2DABF13E01ADB428F0210400EDBA +:10AAE0004B18C5097E23B62041210100E52339CD4D +:10AAF0002DABF13E01ADB420E3DDB6FE28DE4F06FE +:10AB000000C5210E00ED5B18C5195E2356210E000D +:10AB1000ED4B18C5094623666801170009462366F0 +:10AB200068010100CD4785E118B2C338854D442A3C +:10AB300018C523235E2356C3AFC0CDAFA9CDB6AA97 +:10AB4000C39DAACD2485FCFF2AA8C32BDD75FCDD9F +:10AB500074FD21FFFF22A8C32100002216C5DDCB12 +:10AB6000FD7E2043DD6EFCDD66FD2929011CC50943 +:10AB700046236668DD75FEDD74FFDD6EFCDD66FD77 +:10AB80002929011EC5094E2346DD5E02DD5603DD7F +:10AB90006EFEDD66FFCD4785DD6EFCDD66FD2BDDDF +:10ABA00075FCDD74FD18B7C33885CD18852AA8C398 +:10ABB000CB7C200E010A802AA8C33E80AC67ED4200 +:10ABC000380B210C002214C521FFFF183C2143AB98 +:10ABD0002216C5DD7E02DDB603282B2AA8C329294B +:10ABE000011CC509DD4E02DD46037123702AA8C38E +:10ABF0002929011EC509DD4E04DD46057123702A91 +:10AC0000A8C32322A8C3210000C33885CD1885011D +:10AC10000000CDAAABC33885CD1885210A00E50117 +:10AC20000000CD85B6F1C33885CD1885210A00E531 +:10AC3000010000CD85B6F1C33F85CD1885160021F2 +:10AC4000AAC3197EE604280EDD7E02EE206FDD7EAB +:10AC500003EE00671806DD6E02DD6603C33885CD9E +:10AC60001885160021AAC3197EE602280EDD7E0291 +:10AC7000EE206FDD7E03EE00671806DD6E02DD66F6 +:10AC800003C33885CD2485F8FFAFDD77FEDD77FF80 +:10AC9000DD7E02DDB603206411C4C4CD84AC7DB476 +:10ACA000201411DCC4CD84AC7DB4200A11F4C4CDD1 +:10ACB00084AC7DB4280621FFFFC376AE2AC2C4DD72 +:10ACC0007502DD7403DD7E02DDB6032829DD5E0238 +:10ACD000DD5603CD84AC7DB4280621FFFFC376AEDC +:10ACE000211600DD4E02DD4603095623666ADD7536 +:10ACF00002DD740318CF210000C376AE210C00DD05 +:10AD00004E02DD4603097EE680CAD1AD210600DD94 +:10AD10004E02DD4603095E23560A6F030A67A7ED5C +:10AD200052DD75FADD74FB7DB4CACFAD210600DDBE +:10AD30004E02DD46030946236668DD75F8DD74F9C9 +:10AD4000DD6EFADD66FBE5DD4EF8DD46F9210A0031 +:10AD5000DD5E02DD5603195E2356CD09C1F1DD75B6 +:10AD6000FCDD74FD4D44210000CD5882301E2100D1 +:10AD700000397EDD86FC77237EDD8EFD77210200A3 +:10AD8000397EDD96FC77237EDD9EFD77DD4EFCDD92 +:10AD900046FD210000CD588238A6DD7EFCDDA6FDF3 +:10ADA0003C20092A14C53E04ADB42894DD7EFADDAA +:10ADB000B6FB281B210C00DD4E02DD4603097EF6A2 +:10ADC0000077237EF60277DD36FEFFDD36FFFF18C3 +:10ADD00065210C00DD4E02DD4603097EE640285663 +:10ADE000DD6E02DD66034E2346DD6E02DD66032363 +:10ADF000235623666AA7ED42DD75FADD74FB4D44E8 +:10AE0000210000CD5882302E210100E5DD4EFADD13 +:10AE100046FBA7210000ED427C079F4F41C5E5217D +:10AE20000A00DD4E02DD4603095E2356CD61C0F106 +:10AE3000F1F1CB782800210C00DD4E02DD4603093C +:10AE40007EE63F77237EE6FA7769602323E52104D7 +:10AE500000DD4E02DD460309E521060009562366A2 +:10AE60006AE56960C1712370E1712370E17123703B +:10AE7000DD6EFEDD66FFC33885CD2485FEFFCDED9A +:10AE8000B5210C000946236668DD75FEDD74FF7D83 +:10AE9000E6402813DD5E04DD5605CD84AC7DB42884 +:10AEA0000621FFFFC374AFDD7EFEE6206FDD7EFF6F +:10AEB000E603673E20ADB4280621FFFFC374AF212F +:10AEC0000800DD4E04DD4605095E23560A6F030ABD +:10AED00067A7ED523813DD5E04DD5605CD84AC7DE9 +:10AEE000B4280621FFFFC374AFDD6E04DD66054E96 +:10AEF000234603702B710B6960DD460270210C0044 +:10AF0000DD4E04DD4605097EF68077237EF6007768 +:10AF10003E0ADDAE02DDB6032007DD7EFEE601203F +:10AF200007DD7EFEE6022812DD5E04DD5605CD84D7 +:10AF3000AC7DB4280521FFFF183ADD7EFEE603282C +:10AF400018210400DD4E04DD460509E5210600094F +:10AF50004E2346E17123701816210400DD4E04DDF6 +:10AF6000460509E5210800094E2346E1712370DDFD +:10AF70006E022600C33885CD2485FCFF21FCFFDD51 +:10AF80004E02DD460309DD75FEDD74FF23237E23BB +:10AF9000B6280621FFFFC354B02A48C5DD75FCDD85 +:10AFA00074FDDD4EFCDD46FDDD6EFEDD66FFA7EDCA +:10AFB000423817DD6EFCDD66FD232346236668DD1F +:10AFC0004EFEDD46FFA7ED423053DD6EFCDD66FD33 +:10AFD00023234E2346DD6EFCDD66FDA7ED423829B6 +:10AFE000DD4EFEDD46FFDD6EFCDD66FDA7ED423881 +:10AFF00016DD6EFCDD66FD23234E2346DD6EFEDD91 +:10B0000066FFA7ED4230021814DD6EFCDD66FD23FD +:10B010002346236668DD75FCDD74FD1885DD6EFE54 +:10B02000DD66FF2323E5DD4EFCDD46FD030369609D +:10B030004E2346E1712370DD6EFCDD66FD2323DDCA +:10B040004EFEDD46FF712370DD6EFCDD66FD22489D +:10B05000C5210000C33885CD2485E2FF21000039D9 +:10B060004D44DD5E02DD5603CD29C07DA43C28128F +:10B07000DD7EE6E6006FDD7EE7E6F0673E20ACB5FC +:10B0800028052100001803210100C33885CD24853F +:10B09000D6FFDD6E08DD6609DD75F8DD74F9210087 +:10B0A0000039DD75FADD74FB212C0039DD75FCDD1E +:10B0B00074FD213800397ED60A77DD4E0ADD460B55 +:10B0C000212400CD58823811010280DD6E0ADD6630 +:10B0D0000B3E80AC67ED423003C310B2DD6EFCDD89 +:10B0E00066FD23237EE60047237EE680B02831AF4D +:10B0F000DDB60C282BDD6EF8DD66F923DD75F8DD95 +:10B1000074F92B362DDD4E04DD4605DD6E02DD665D +:10B1100003CD6984DD7502DD7403DD7104DD700526 +:10B12000DD6EFCDD66FD23237E23B62002184EDD96 +:10B130006E0ADD660B7C079F4F41C5E5DD4E04DDE1 +:10B140004605DD6E02DD6603CD5E83E5DD6EFADD6C +:10B1500066FB23DD75FADD74FB2BC171212C0039F0 +:10B16000DD5E0ADD560B7A079F4F41CD8B84DD6E85 +:10B17000FCDD66FD23237E23B620B41830DD5E029D +:10B18000DD5603DD4E0ADD460BCDEB81DD6EFADDCB +:10B1900066FB23DD75FADD74FB2B73DD5E02DD5685 +:10B1A00003CDC181DD6EFCDD66FD732372DD6EFCB7 +:10B1B000DD66FD7E23B620C5210000394D44DD6EDD +:10B1C000FADD66FBA7ED42DD75FFAFDDB6FF284077 +:10B1D000DD6EFADD66FB2BDD75FADD74FB46DD7096 +:10B1E000FE78FE0A300ADD7EFEC630DD77FE1809E5 +:10B1F000DD7EFEDD860EDD77FEDD6EF8DD66F92391 +:10B20000DD75F8DD74F92BDD46FE70DD35FF18BA0B +:10B21000DD6EF8DD66F93600DD6E08DD6609C338DF +:10B2200085CD2485FEFFDD36FE41DDCB097E281667 +:10B23000DD36FE61DD4E08DD4609A7210000ED4246 +:10B24000DD7508DD7409DD6EFEE50E01C5DD6E08F5 +:10B25000DD6609E5DD6E04DD6605E53E0ADDAE0866 +:10B26000DDB609200DDD5E02DD56037A079F4F41F2 +:10B270001809DD5E02DD5603010000CD8DB0F1F14D +:10B28000F1F1C33885CD2485FEFFDD36FE41DDCBEF +:10B290000B7E2816DD36FE61DD4E0ADD460BA7214A +:10B2A0000000ED42DD750ADD740BDD6EFEE53E0A41 +:10B2B000DDAE0ADDB60B20043E011801AF4FC5DD3F +:10B2C0006E0ADD660BE5DD6E08DD6609E5DD4E0420 +:10B2D000DD4605DD5E02DD5603CD8DB0F1F1F1F105 +:10B2E000C33885CD2485FAFFDD6E02DD6603232396 +:10B2F00023CB3CCB1DCB3CCB1D23DD75FEDD74FF8A +:10B300002A48C5DD75FCDD74FD7DB42011DD36FCF9 +:10B3100044DD36FDC52144C52246C52248C5DD6E43 +:10B32000FCDD66FD232346236668DD75FADD74FBCC +:10B33000DD6EFADD66FB232346236668DD4EFADD0B +:10B3400046FBA7ED42CAD3B3DD6EFADD66FB4623AA +:10B3500066682929DD4EFADD46FB09E503036960CD +:10B360004E2346E1A7ED42206ADD6EFADD66FB233F +:10B370002346236668ED4B48C5A7ED422015DD6ED8 +:10B38000FADD66FB2323462366682323462366688B +:10B390002248C5DD6EFADD66FB23237E23666F4EF1 +:10B3A0002346DD6EFADD66FB7E8177237E8877DDBE +:10B3B0006EFADD66FB2323E5DD4EFADD46FB030373 +:10B3C00069604E2346030369604E2346E171237092 +:10B3D000C330B3DD6EFADD66FB46236668DD4EFEE4 +:10B3E000DD46FFA7ED42DA91B4DD6EFADD66FB467D +:10B3F000236668DD4EFEDD46FFA7ED42201CDD6EB4 +:10B40000FCDD66FD2323E5DD4EFADD46FB03036923 +:10B41000604E2346E17123701856DD6EFEDD66FF37 +:10B420002929DD4EFADD46FB092248C5DD6EFCDD2B +:10B4300066FD2323ED5B48C57323722A48C5232389 +:10B44000E5030369604E2346E1712370DD6EFADD8A +:10B4500066FB46236668DD4EFEDD46FFA7ED42E54E +:10B460002A48C5D1732372DD6EFADD66FB71237045 +:10B47000DD6EFCDD66FD2248C5DD6EFADD66FB2370 +:10B4800023AF772377210400DD4EFADD46FB091850 +:10B49000222A48C5DD4EFADD46FBA7ED42204511C4 +:10B4A0000004CDC9C0DD75FADD74FB7DA43C200627 +:10B4B000210000C33885DD6EFADD66FB36002336D9 +:10B4C00001DD6EFADD66FB2323AF772377210400CD +:10B4D000DD4EFADD46FB09EBCD77AF2A48C5DD75B9 +:10B4E000FADD74FBDD6EFADD66FBDD75FCDD74FDF7 +:10B4F000DD6EFADD66FB232346236668DD75FADD23 +:10B5000074FBC330B3CD2485FCFFDD6E02DD660322 +:10B51000DD75FCDD74FDDD71FEDD70FFDD6E08DDC7 +:10B5200066092BDD7508DD7409237DB42820DD6EE6 +:10B53000FEDD66FF23DD75FEDD74FF2B46DD6EFC50 +:10B54000DD66FD23DD75FCDD74FD2B7018CEDD6E30 +:10B5500002DD6603C33885CD2485FCFF210E00394A +:10B5600001020009DD75FCDD74FDDD4E08DD4609D4 +:10B57000ED43AAC4E5DD4E0ADD460B11AAC4CDC6D3 +:10B58000BAF1DD75FEDD74FF2AAAC43600DD6EFE59 +:10B59000DD66FFC33885CD2485FEFF2AC2C4DD7574 +:10B5A000FEDD74FF11DCC4CD84AC11F4C4CD84ACD9 +:10B5B000DD7EFEDDB6FF2832DD5EFEDD56FFCD848A +:10B5C000AC210A00DD4EFEDD46FF095E2356CD09A3 +:10B5D000C0210A000936FF2336FF21160009562331 +:10B5E000666ADD75FEDD74FF18C6C33885D52A0C82 +:10B5F000C57DB420021822210000220CC5110100D3 +:10B60000CD57B07DB4280C21E8C47EF60177237EA7 +:10B61000F600771196B5CD0CACD1C9CD1885D5CD36 +:10B620004EB6D119EBCD31B6DD6E02DD6603C338FF +:10B6300085CD18855950CD4EB623E5DD4E04DD4647 +:10B6400005DD5E02DD5603CD05B5F1C33885CD2499 +:10B6500085FEFFDD6E02DD6603DD75FEDD74FFDD58 +:10B660006EFEDD66FFAFB6280ADD34FE2003DD3452 +:10B67000FF18ECDD4E02DD4603DD6EFEDD66FFA742 +:10B68000ED42C33885CD2485F8FFAFDD77FCDD774B +:10B69000FDDD6E02DD6603DD75FEDD74FFDD6EFE31 +:10B6A000DD66FF4E060021AAC3097EE610280ADDEA +:10B6B00034FE2003DD34FF18E4DD6EFEDD66FF7E20 +:10B6C000FE2D2012DD34FC2003DD34FDDD34FE20B0 +:10B6D00003DD34FF1813DD6EFEDD66FF7EFE2B20DA +:10B6E00008DD34FE2003DD34FFDD6E08DD6609E58C +:10B6F000DD4E04DD4605DD5EFEDD56FFCDAEB7F165 +:10B70000DD75F8DD74F9DD71FADD70FBDD7EFCDDE1 +:10B71000B6FD2805CD6984180CDD4EFADD46FBDD4B +:10B720006EF8DD66F9C33F85CD2485FEFFDD36FE6C +:10B73000FFDD36FFFFDD5E02160021AAC3197EE69B +:10B7400008280FDD4E02060021D0FF09DD75FEDD61 +:10B7500074FFDD4E02060021AAC3097EE604280F0D +:10B76000DD4E02060021A9FF09DD75FEDD74FFDD57 +:10B770004E02060021AAC3097EE602280FDD4E0212 +:10B78000060021B0FF09DD75FEDD74FFDD4E04DD2E +:10B790004605DD6EFEDD66FFCD58823808DD36FEDB +:10B7A000FFDD36FFFFDD6EFEDD66FFC33885CD248D +:10B7B00085FAFF110280DD6E08DD66093E80AC6708 +:10B7C000ED52380EDD4E08DD4609212400CD5882A9 +:10B7D0003007AFDD7708DD7709DD6E02DD66034EE9 +:10B7E000060021AAC3097EE610280ADD34022003E0 +:10B7F000DD340318E4DD6E02DD66037EFE2B200AD5 +:10B80000DD34022003DD3403186DDD7E08DDB6096A +:10B810002065DD6E02DD66037EFE30205ADD6E029D +:10B82000DD6603237EEE20FE582017DD360810DD8E +:10B83000360900210800397EC60277237ECE0077C4 +:10B840001835DD6E02DD6603237EEE20FE422017F2 +:10B85000DD360802DD360900210800397EC6027790 +:10B86000237ECE00771810DD360808DD360900DDAE +:10B8700034022003DD3403DD7E08DDB6092008DD57 +:10B8800036080ADD360900AFDD77FADD77FBDD77B4 +:10B89000FCDD77FDDD4E08DD4609DD6E02DD660369 +:10B8A0005ECD28B7DD75FEDD74FF7DA43C282E211A +:10B8B000000039DD5E08DD56097A079F4F41CD7BD8 +:10B8C0008421000039DD5EFEDD56FF7A079F4F417F +:10B8D000CDA484DD34022003DD340318B7DD7E04FB +:10B8E000DDB6052811DD6E02DD6603E5DD6E04DDE3 +:10B8F0006605C1712370DD4EFCDD46FDDD6EFADDAF +:10B9000066FBC33F85CD2485FEFFDD36FE41DDCBE2 +:10B910000B7E2816DD36FE61DD4E0ADD460BA721C3 +:10B920000000ED42DD750ADD740BDD6EFEE50E00F4 +:10B93000C5DD6E0ADD660BE5DD6E08DD6609E5DD59 +:10B940004E04DD4605DD5E02DD5603CD8DB0F1F11E +:10B95000F1F1C33885CD2485FAFFAFDD77FBDD77C4 +:10B96000FC5950CD4EB6DD75FDDD74FEDD6E04DD97 +:10B9700066057EFE2D2014DD6E04DD660523DD7573 +:10B9800004DD74052B46DD700A180EAFDDB60A28FB +:10B9900008DD34FD2003DD34FEDD7E10DDA6113C24 +:10B9A000281DDD4EFDDD46FEDD6E10DD6611CD5835 +:10B9B00082300CDD6E10DD6611DD75FDDD74FEDD9F +:10B9C0004EFDDD46FEDD6E0EDD660FCD5882300C7D +:10B9D000DD6EFDDD66FEDD750EDD740FDD6E0EDDE8 +:10B9E000660FDD75FBDD74FC211400397EDD96FDEC +:10B9F00077237EDD9EFE77DD7E0EDDB60F2009DD2E +:10BA00007EFDDDB6FECABDBADD7E08DDB609203496 +:10BA1000DD7E0EDDB60F282CDD7EFDDDB6FE280FA7 +:10BA2000AFDDB60A2809DD7E0CFE3020021823DDCA +:10BA3000460CDD70FADD6E0EDD660F2BDD750EDD5A +:10BA4000740F184EDD7EFDDDB6FE2833AFDDB60A7D +:10BA5000280CDD460ADD70FADD360A001812DD6EAC +:10BA600004DD660523DD7504DD74052B46DD70FA03 +:10BA7000DD6EFDDD66FE2BDD75FDDD74FE1813DD6C +:10BA8000460CDD70FADD6E0EDD660F2BDD750EDD0A +:10BA9000740FDD4E02DD4603DD5EFA1600CD79AE91 +:10BAA000DD7EFAFE0A20133E01DDAE12DDB6132064 +:10BAB00009DD5E02DD5603CD84ACC3F7B9DD6EFB54 +:10BAC000DD66FCC33885CD2485A2FFAFDD77B0DD10 +:10BAD00077B1210C00DD5E02DD5603197EE6034FCF +:10BAE000237EE60047DD71FDDD70FE210C00197E2E +:10BAF000E6FC77237EE6FF77DD6E04DD6605AFB6F4 +:10BB0000CAA8BFDD6E04DD66057EFE25C265BF3EA8 +:10BB100002DDAEFDDDB6FE2009DD5E02DD5603CDA1 +:10BB200084ACAFDD77A4DD77A5DD36B300DD36B2BA +:10BB300020DD36ACFFDD36ADFFAFDD77AADD77ABBC +:10BB4000DD36A8FFDD36A9FFDD36AE0ADD36AF00F3 +:10BB5000211B0039DD75B5DD74B6DD36B400AFDD0F +:10BB600077A6DD77A7AFDD77A2DD77A3DD340420EC +:10BB700003DD3405DD6E04DD66057EFE30380BDD49 +:10BB80006E04DD66053E39BE3002186521000039BD +:10BB9000010A00CD6A82DD6E04DD66054E060021D5 +:10BBA000D0FF094D44210000397E8177237E8877BC +:10BBB000DD7EAADDB6AB280EDD6EA2DD66A3DD75E7 +:10BBC000A8DD74A91821DD7EA2DDB6A3200DDD7EDF +:10BBD000B2FE202006DD36B230188ADD6EA2DD66A8 +:10BBE000A3DD75ACDD74ADDD34042003DD34051850 +:10BBF00083DD6E04DD66055ECDDF84140000202148 +:10BC0000232A2B2D2E5862636468696C6F707375DC +:10BC10007861BF78BD80BDF4BE53BD49BDD4BCE9D9 +:10BC2000BCDFBCE9BCB1BE3FBD6EBDC9BC4BBC56A0 +:10BC3000BC6ABC63BC93BE56BC3BBCDD6E04DD6617 +:10BC4000052BDD7504DD7405C365BFDD36A401DD9C +:10BC500036A500C365BBDD6E04DD660546DD70B349 +:10BC6000C365BBDD36B401C365BB216600397EC642 +:10BC70000277237ECE00772B6E672B2B46236668D8 +:10BC8000DD75A2DD74A3DD7EAADDB6AB280EDD6E08 +:10BC9000A2DD66A3DD75A8DD74A9182ADD6EA2DD1C +:10BCA00066A3DD75ACDD74ADCB7C281ADD36A4014E +:10BCB000DD36A500DD4EA2DD46A3A7210000ED4242 +:10BCC000DD75ACDD74ADC365BBDD36AA01DD36AB19 +:10BCD00000C365BBDD36A601DD36A700C365BBAF7B +:10BCE000DD77A6DD77A7C365BB210A00E5211D002E +:10BCF00039E5DD7EA6DDB6A7281D216A00397EC69E +:10BD00000477237ECE00772B6E6701FCFF095E234C +:10BD100056234E2346181A216A00397EC60277231D +:10BD20007ECE00772B6E672B2B5E23567A079F4FB4 +:10BD300041CD85B2F1F1DD75B5DD74B6C318BFDD57 +:10BD400036AE02DD36AF001837DD36AE08DD36AF71 +:10BD500000182DAFDD77A6DD77A7DD36B230DD36F2 +:10BD6000AC05DD36AD00DD36A808DD36A900DD36D0 +:10BD7000AE10DD36AF001808DD36AEF0DD36AFFFB1 +:10BD8000DD7EA6DDB6A7281E216600397EC60477B3 +:10BD9000237ECE00772B6E6701FCFF095E235623BE +:10BDA0004E2346EB1819216600397EC60277237EA2 +:10BDB000CE00772B6E672B2B46236668010000DDD3 +:10BDC00075B9DD74BADD71BBDD70BCDD5EAEDD560C +:10BDD000AFD5211D003901040009E5DD4EBBDD466C +:10BDE000BCDD5EB9DD56BACD05B9F1F1DD75B5DD65 +:10BDF00074B6DD36B726DD36B8C2AFDDB6B4CA904C +:10BE0000BE3E02DDAEAEDDB6AF200ADD36B727DDC1 +:10BE100036B8C218493E08DDAEAEDDB6AF2018DD3B +:10BE20007EB9DDB6BADDB6BBDDB6BC2808DD36B7F7 +:10BE30002ADD36B8C218273E10DDAEAEDDB6AF2023 +:10BE40000ADD36B72CDD36B8C218133E0FDDAEAEB4 +:10BE5000DDA6AF3C2008DD36B72FDD36B8C2DD6E7B +:10BE6000B7DD66B8AFB62828DD36B200DD4EB7DDE7 +:10BE700046B8211B00395D54CD31B6DD4EB5DD46E7 +:10BE8000B6211B00395D54CD1BB6DD75B5DD74B62A +:10BE9000C318BFDD6E04DD6605234E0600DD71A20A +:10BEA000DD70A379B02808DD34042003DD340518E3 +:10BEB0001C216600397EC60277237ECE00772B6E6A +:10BEC000672B2B46236668DD75A2DD74A3DD46A2D1 +:10BED000DD6EB5DD66B670DD6EB5DD66B6233600A7 +:10BEE000AFDDB6B4280CDD6EB5DD66B646DD70B2EA +:10BEF0001822181C216600397EC60277237ECE00E8 +:10BF0000772B6E672B2B46236668DD75B5DD74B61F +:10BF1000DD36B220DD36B300DD6EFDDD66FEE5DD2B +:10BF20006EA8DD66A9E5DD6EACDD66ADE5DD6EB261 +:10BF3000E5DD6EB3E5DD6EA4DD66A5E5DD4EB5DDC0 +:10BF400046B6DD5E02DD5603CD55B9EB210C003956 +:10BF5000F9EB4D44210E00397E8177237E887718D6 +:10BF60000218021838DD4E02DD4603DD6E04DD6680 +:10BF7000055E1600CD79AEDD34B02003DD34B1DDD1 +:10BF80006E04DD66057EFE0A20133E01DDAEFDDD9A +:10BF9000B6FE2009DD5E02DD5603CD84ACDD34043F +:10BFA0002003DD3405C3F8BA210C00DD4E02DD4666 +:10BFB00003097EDDB6FD77237EDDB6FE773E02DD2A +:10BFC000AEFDDDB6FE2009DD5E02DD5603CD84AC9C +:10BFD0003E01DDAEFDDDB6FE2016210400DD4E0281 +:10BFE000DD460309E5210600094E2346E171237071 +:10BFF000DD6EB0DD66B1C33885CD1885D521020070 +:10C00000E5CDD9C0F1F1C33885CD1885D52106001D +:10C01000E5CDD9C0F1F1C33885CD1885D5210B0008 +:10C02000E5CDD9C0F1F1C33885CD1885C5D5210D31 +:10C0300000E5CDD9C0F1F1F1C33885CD1885DD6EAD +:10C040000CDD660DE5DD6E0ADD660BE5DD6E08DDF7 +:10C050006609E5210F00E5CDD9C0F1F1F1F1C33852 +:10C0600085CD1885DD6E0CDD660DE5DD6E0ADD66BD +:10C070000BE5DD6E08DD6609E5D5211900E5CDF19A +:10C08000C0F1F1F1F1F1C33F85CD1885DD6E0CDD16 +:10C09000660DE5DD6E0ADD660BE5DD6E08DD660921 +:10C0A000E5211400E5CDD9C0F1F1F1F1C33885CD1A +:10C0B0001885DD6E08DD6609E5C5D5211700E5CDDB +:10C0C000D9C0F1F1F1F1C33885CD1885D52118001B +:10C0D000E5CDD9C0F1F1C3388521020039C5D55E5F +:10C0E0002356234D44F730062214C521FFFFD1C14A +:10C0F000C921020039D55E2356234D44F73008226A +:10C1000014C521FFFF4D44D1C9CD1885DD6E08DD72 +:10C110006609E5C5D5212400E5CDD9C0F1F1F1F1DD +:10C12000C338851B4B1B5300001B4300001B4E00F4 +:10C13000001B5200001B4600001B5A0000000000BC +:10C140001B45001B000000303030302E736372003E +:10C150002F6465762F6C6364300030004345004FD8 +:10C160004B0043616E63656C0000426172636F64F3 +:10C1700065005374756B73005072696A73002F64A5 +:10C1800065762F7072696E74657200253133732085 +:10C190005665726B6F6F70617274696B656C20208D +:10C1A0007C25376C642C2530326C640D0A002531F7 +:10C1B0003373205665726B6F6F70617274696B6553 +:10C1C0006C0D0A253464782040207C2025376C646F +:10C1D0002C2530326C64202020202020202020209C +:10C1E0007C25376C642C2530326C640D0A000D0AF6 +:10C1F00025313373546F7461616C3A253130737C2F +:10C2000025376C642C2530326C640D0A0D0A0D0A3A +:10C21000004D65737361676520426F780030303080 +:10C22000302E7363720000306200300030780030CE +:10C2300058004AC74AC74AC700000000010101016F +:10C24000010101010111111111110101010101018E +:10C250000101010101010101010101011020202062 +:10C26000202020202020202020202020484848482E +:10C270004848484848482020202020202042424268 +:10C2800042424202020202020202020202020202CE +:10C290000202020202020220202020202044444404 +:10C2A000444444040404040404040404040404048E +:10C2B00004040404040404202020200100000000E1 +:10C2C000000000000000000000000000000000006E +:10C2D000000000000000000000000000000000005E +:10C2E000000000000000000000000000000000004E +:10C2F000000000000000000000000000000000003E +:10C30000000000000000000000000000000000002D +:10C31000000000000000000000000000000000001D +:10C32000000000000000000000000000000000000D +:10C3300000000000000000000000000000000000FD +:10C34000FFFF0000FFFFFFFF2000000000000000D3 +:10C350000000000000004AC54AC54AC54AC54AC691 +:10C3600000001000000000000000000000004AC6AD +:10C370004AC64AC64AC64AC701002000000000005B +:10C3800000000000000002C502C502C502C504C5C8 +:10C390000200220000000000000000000000010078 +:00000001FF diff --git a/src/gui/wnd.lnk b/src/gui/wnd.lnk new file mode 100644 index 00000000..5db953de --- /dev/null +++ b/src/gui/wnd.lnk @@ -0,0 +1,14 @@ +-k ..\..\lib +-l libcb.lib +-l libsysb.lib +-l libiar.lib +-m +-u +-i +-o grlogin +-bl RCODE=0x8100 +-bl CODE=0x4000,0x10000 +-bc CODE=0x4000 +..\..\lib\c0b.rel +wnd +login diff --git a/src/gui/wnd.map b/src/gui/wnd.map new file mode 100644 index 00000000..b5732b9f --- /dev/null +++ b/src/gui/wnd.map @@ -0,0 +1,283 @@ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +. .ABS. 00000000 00000000 = 0. bytes (ABS,OVR) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00000000 s__DEFAUL | 00000000 l_CCSTR | 00000000 l_ECSTR + 00000000 .__.ABS. | 00000000 ?CL64180L | 00000000 ?CL64180B + 00000014 e__DEFAUL | 00000014 l__DEFAUL | 0000002F l_CONST + 00000153 l_CSTR | 00000170 l_CDATA0 | 00000170 l_IDATA0 + 000003B5 l_UDATA0 | 00000430 l_RCODE | 00001000 l_CSTACK + 00004000 s_CODE | 00008100 s_RCODE | 00008530 e_RCODE + 00008530 s_CONST | 0000855F s_CSTR | 0000855F e_CONST + 000086B2 e_CSTR | 000086B2 s_IDATA0 | 000086B2 s_CDATA0 + 00008822 s_UDATA0 | 00008822 e_CCSTR | 00008822 e_ECSTR + 00008822 s_CCSTR | 00008822 e_CDATA0 | 00008822 s_ECSTR + 00008822 e_IDATA0 | 00008BD7 e_UDATA0 | 00008BD7 s_CSTACK + 00009BD7 e_CSTACK | 0000C257 l_CODE | 00010257 e_CODE +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +_DEFAULT 00000000 00000014 = 20. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +RCODE 00008100 00000430 = 1072. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008100 __init | 0000811F ?L_MUL_L0 | 000081A3 ?BANK_LEA + 000081A9 ?BANK_FAS | 000081AE ?S_MUL_L0 | 000081C4 ?C_V_SWIT + 000081D6 ?L_ADDASG | 000081EF ?ENT_PARM | 000081FB ?BANK_CAL + 00008208 ?S_S_SWIT | 0000821C ?S_V_SWIT | 00008239 ?S_SWITCH + 00008247 ?SL_MOD_L | 0000827A ?ENT_AUTO | 0000828E ?V_SWITCH + 00008298 ?SL_DIV_L | 000082C8 ?SS_CMP_L | 000082DA ?L_INC_L0 + 000082E2 ?US_MOD_L | 000082EB ?SS_DIV_L | 00008307 ?UL_RSHAS + 00008315 ?US_DIV_L | 00008323 ?SL_RSH_L | 00008331 ?UL_RSH_L + 0000834C ?L_DIVMOD | 000083A4 ?BANK_LEA | 000083B0 ?SS_RSH_L + 000083BA ?L_LSH_L0 | 000083D2 ?S_DIVMOD | 000083E8 ?S_MULASG + 000083F2 ?L_END_AS | 000083FB ?L_NOT_L0 | 0000840A ?L_XOR_L0 + 00008428 ?L_ORASG_ | 00008441 ?LEAVE_DI | 00008448 ?L_FIND_S + 0000848C ?UL_DIVAS | 0000849C ?UL_MOD_L | 000084C1 ?S_FIND_S + 000084DD ?UL_DIV_L | 00008505 ?L_NEG_L0 | 00008517 ?L_MULASG + 00008527 ?L_END_MU +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CONST 00008530 0000002F = 47. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTR 0000855F 00000153 = 339. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +IDATA0 000086B2 00000170 = 368. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 000086CA __IO_list | 000086CC stdin | 000086E4 stdout + 000086FC stderr | 0000871A _path_pas | 0000871C __sys_err + 0000871E __sys_ner | 00008720 __on_exit | 00008722 __ctype +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CDATA0 000086B2 00000170 = 368. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +ECSTR 00008822 00000000 = 0. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CCSTR 00008822 00000000 = 0. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CODE 00004000 0000C257 = 49751. bytes (NUL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00004736 GraphicsO | 000047D2 GraphicsC | 000047EA Move + 00004829 ClearRect | 0000486C DrawRectN | 000048B1 FillRect + 000048F6 FillRectN | 0000493B GrayRect | 00004980 Text + 000049AC TouchRegi | 00004A03 ClearScre | 00004A40 EnableScr + 00004A7E grSetFont | 00004ABB fontSearc | 00004AEB setCurren + 00004B87 loadFont | 00004C2E stringwid | 00004CA7 stringhei + 00004CC4 stringhei | 00004CD7 stringhei | 00004CE0 stringwid + 00004CF1 stringwid | 00004CFA stringwid | 00004D03 Component + 00004DAD Component | 00004DFA Component | 00004E58 Component + 00004E9E Component | 00004EE2 Component | 00004F1A Component + 000050EB Component | 0000510A Component | 00005173 Component + 00005226 Window_ha | 00005490 Window_pa | 0000561C Root_pain + 00005653 Window_ad | 00005661 Window_ne | 000056B3 Button_ha + 0000576A Button_dr | 00005838 Button_pa | 0000590B Button_ad + 00005911 Button_ne | 00005963 ToggleBut | 000059FC ToggleBut + 00005AE8 ToggleBut | 00005B3A Dialog_ha | 00005BF3 Dialog_ne + 00005CE2 Display_h | 00005D60 Display_p | 00005E7D Display_n + 00005ED7 Label_han | 00005EDD Label_pai | 00005F3E Label_new + 00005F97 Transacti | 000065D5 rootWindo | 000065F3 screenbui + 000069BB root_acti | 00006CF0 read_stri | 00006DC5 gui_globa + 00006DCB GUIinit | 00006EFB GUIunit | 00006F20 GUIgo + 00006F9F login | 000070C8 login_act | 0000723B main + 000072A2 setgid | 000072BC unix | 000072D6 sprintf + 0000731A strrchr | 00007382 fflush | 00007595 chdir + 000075AA _write | 000075C9 setuid | 000075E3 printf + 00007612 lseek | 0000763F __stdio_c | 000076AA __stdio_i + 000076E8 setenv | 00007964 unsetenv | 00007A04 close + 00007A19 strlen | 00007A50 strcmp | 00007AF1 perror + 00007B2E execv | 00007B41 ioctl | 00007B6C isatty + 00007BA7 fstat | 00007BBE free | 00007C9E getpwnam + 00007D00 setpwent | 00007D45 endpwent | 00007D64 getpwent + 00007D82 strcpy | 00014000 __getpwen | 00014288 atoi + 0001441E vfprintf | 00014979 ltoa | 000149DC atol + 000149F2 __longtoa | 00014B86 itoa | 00014BEF crypt + 00014E9C fputs | 00014EFA open | 00014F25 malloc + 00015151 exit | 00015181 _read | 000151A0 memcmp + 0001520D execve | 0001522C strerror | 000153E9 memset + 00015429 memcpy | 000154F7 on_exit | 00015570 atexit + 00015583 strcat | 000155A3 unix_long | 000155BD strchr + 000155F8 _exit | 00015693 strtoul | 000157EA fputc + 000158FC toupper | 00015921 tolower | 00015946 ultoa + 0001599B strtol | 00015A43 sbrk +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +UDATA0 00008822 000003B5 = 949. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + 00008822 _argc | 00008824 _argv | 00008826 environ + 00008828 errno | 0000882A __cleanup | 0000882D global + 0000882F trans | 00008B4F __malloc_ | 00008B53 __malloc_ + 00008BA5 __on_exit +Hexadecimal [32-Bits] + +Area Addr Size Decimal Bytes (Attributes) +-------------------- ---- ---- ------- ----- ------------ +CSTACK 00008BD7 00001000 = 4096. bytes (REL,CON) + + Value Global Value Global Value Global + ----- ------ ----- ------ ----- ------ + +Files Linked [ module(s) ] + +..\..\lib\c0b.rel [ _c0b ] +wnd [ wnd ] +login [ login ] + + +Libraries Linked [ object file ] + +..\..\lib\libsysb.lib [ relsysb\setgid.rel ] +..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] +..\..\lib\libcb.lib [ relcb\sprintf.rel ] +..\..\lib\libiar.lib [ reliar\LMUL.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strrchr.rel ] +..\..\lib\libcb.lib [ relcb\fflush.rel ] +..\..\lib\libsysb.lib [ relsysb\chdir.rel ] +..\..\lib\libsysb.lib [ relsysb\write.rel ] +..\..\lib\libiar.lib [ reliar\SMUL.rel ] +..\..\lib\libsysb.lib [ relsysb\setuid.rel ] +..\..\lib\libcb.lib [ relcb\printf.rel ] +..\..\lib\libsysb.lib [ relsysb\lseek.rel ] +..\..\lib\libcb.lib [ relcb\stdio0.rel ] +..\..\lib\libcb.lib [ relcb\setenv.rel ] +..\..\lib\libsysb.lib [ relsysb\close.rel ] +..\..\lib\libcb.lib [ relcb\strlen.rel ] +..\..\lib\libcb.lib [ relcb\strcmp.rel ] +..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] +..\..\lib\libcb.lib [ relcb\perror.rel ] +..\..\lib\libcb.lib [ relcb\execv.rel ] +..\..\lib\libsysb.lib [ relsysb\ioctl.rel ] +..\..\lib\libiar.lib [ reliar\LADDASG.rel ] +..\..\lib\libcb.lib [ relcb\isatty.rel ] +..\..\lib\libsysb.lib [ relsysb\fstat.rel ] +..\..\lib\libcb.lib [ relcb\free.rel ] +..\..\lib\libcb.lib [ relcb\getpwnam.rel ] +..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] +..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\setpwent.rel ] +..\..\lib\libcb.lib [ relcb\strcpy.rel ] +..\..\lib\libiar.lib [ reliar\SSSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SVSWITCH.rel ] +..\..\lib\libiar.lib [ reliar\SSWITCHEND.rel ] +..\..\lib\libiar.lib [ reliar\SLMOD.rel ] +..\..\lib\libcb.lib [ relcb\getpwent.rel ] +..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] +..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] +..\..\lib\libcb.lib [ relcb\atoi.rel ] +..\..\lib\libiar.lib [ reliar\SLDIV.rel ] +..\..\lib\libcb.lib [ relcb\vfprintf.rel ] +..\..\lib\libcb.lib [ relcb\ltoa.rel ] +..\..\lib\libcb.lib [ relcb\atol.rel ] +..\..\lib\libiar.lib [ reliar\SSCMP.rel ] +..\..\lib\libcb.lib [ relcb\itoa.rel ] +..\..\lib\libiar.lib [ reliar\LINC.rel ] +..\..\lib\libcb.lib [ relcb\crypt.rel ] +..\..\lib\libcb.lib [ relcb\fputs.rel ] +..\..\lib\libsysb.lib [ relsysb\open.rel ] +..\..\lib\libiar.lib [ reliar\USMOD.rel ] +..\..\lib\libiar.lib [ reliar\SSDIV.rel ] +..\..\lib\libiar.lib [ reliar\ULRSHASG.rel ] +..\..\lib\libiar.lib [ reliar\USDIV.rel ] +..\..\lib\libiar.lib [ reliar\LIBVERSION.rel ] +..\..\lib\libcb.lib [ relcb\malloc.rel ] +..\..\lib\libiar.lib [ reliar\SLRSH.rel ] +..\..\lib\libiar.lib [ reliar\ULRSH.rel ] +..\..\lib\libcb.lib [ relcb\exit.rel ] +..\..\lib\libiar.lib [ reliar\LDIVMOD.rel ] +..\..\lib\libsysb.lib [ relsysb\read.rel ] +..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] +..\..\lib\libiar.lib [ reliar\SSRSH.rel ] +..\..\lib\libiar.lib [ reliar\LLSH.rel ] +..\..\lib\libcb.lib [ relcb\memcmp.rel ] +..\..\lib\libsysb.lib [ relsysb\execve.rel ] +..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] +..\..\lib\libcb.lib [ relcb\error.rel ] +..\..\lib\libiar.lib [ reliar\SMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LENDASG.rel ] +..\..\lib\libiar.lib [ reliar\LNOT.rel ] +..\..\lib\libcb.lib [ relcb\memset.rel ] +..\..\lib\libcb.lib [ relcb\memcpy.rel ] +..\..\lib\libcb.lib [ relcb\atexit.rel ] +..\..\lib\libiar.lib [ reliar\LXOR.rel ] +..\..\lib\libcb.lib [ relcb\strcat.rel ] +..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] +..\..\lib\libiar.lib [ reliar\LORASG.rel ] +..\..\lib\libcb.lib [ relcb\strchr.rel ] +..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] +..\..\lib\libcb.lib [ relcb\strtoul.rel ] +..\..\lib\libcb.lib [ relcb\fputc.rel ] +..\..\lib\libcb.lib [ relcb\ctype.rel ] +..\..\lib\libcb.lib [ relcb\ultoa.rel ] +..\..\lib\libcb.lib [ relcb\strtol.rel ] +..\..\lib\libiar.lib [ reliar\LFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIVASG.rel ] +..\..\lib\libiar.lib [ reliar\ULMOD.rel ] +..\..\lib\libiar.lib [ reliar\SFINDSIGN.rel ] +..\..\lib\libiar.lib [ reliar\ULDIV.rel ] +..\..\lib\libsysb.lib [ relsysb\sbrk.rel ] +..\..\lib\libiar.lib [ reliar\LNEG.rel ] +..\..\lib\libiar.lib [ reliar\LMULASG.rel ] +..\..\lib\libiar.lib [ reliar\LENDMULDIVASG.rel ] + + +User Base Address Definitions + +l RCODE=0x8100 +l CODE=0x4000,0x10000 +c CODE=0x4000 diff --git a/src/gui/wnd.rel b/src/gui/wnd.rel new file mode 100644 index 00000000..cec1bfdc --- /dev/null +++ b/src/gui/wnd.rel @@ -0,0 +1,3437 @@ +XL4 +H 5 areas 57 global symbols +M wnd +S ?BANK_FAST_LEAVE_L08 Ref00000000 +S fflush Ref00000000 +S _write Ref00000000 +S ?S_MUL_L02 Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S close Ref00000000 +S strlen Ref00000000 +S ?C_V_SWITCH_L06 Ref00000000 +S ioctl Ref00000000 +S free Ref00000000 +S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S stdout Ref00000000 +S ?S_V_SWITCH_L06 Ref00000000 +S ?ENT_AUTO_DIRECT_L09 Ref00000000 +S ?SS_CMP_L02 Ref00000000 +S open Ref00000000 +S ?SS_DIV_L02 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S ?SL_RSH_L03 Ref00000000 +S malloc Ref00000000 +S _read Ref00000000 +S ?SS_RSH_L02 Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 22FC flags 0 +S Window_new Def00000F71 +S stringheight2 Def00000583 +S GraphicsOpen Def00000000 +S Component_findXY Def0000074A +S Text Def00000239 +S GUIunit Def00002222 +S Button_new Def00001235 +S setCurrentFont Def000003A5 +S ToggleButton_new Def0000140F +S ClearScreen Def000002BD +S gui_globals Def000020F5 +S Component_delete_children Def00000997 +S Component_paint Def00000704 +S stringheight Def00000553 +S Window_paint Def00000D9F +S Component_find Def0000078E +S Window_handler Def00000AD2 +S FillRect Def0000016A +S loadFont Def00000433 +S Button_paint Def00001136 +S rootWindow_handler Def000018F0 +S ToggleButton_paint Def00001323 +S Dialog_new Def0000151A +S Button_handler Def00000FC3 +S read_stringtable Def00002020 +S ToggleButton_handler Def00001287 +S GUIgo Def00002247 +S Component_add Def000006A6 +S grSetFont Def00000338 +S Display_new Def000017D6 +S Window_add Def00000F63 +S GrayRect Def000001F4 +S Component_changestate_children Def000009B6 +S Button_add Def0000122F +S Component_delete Def000007C6 +S FillRectNC Def000001AF +S stringwidth0 Def0000058C +S screenbuilder Def0000190E +S TouchRegion Def00000266 +S GraphicsClose Def0000008E +S EnableScreen Def000002FA +S stringwidth1 Def0000059D +S stringwidth2 Def000005A6 +S Label_new Def00001897 +S fontSearch Def00000375 +S DrawRectNC Def00000125 +S Dialog_handler Def00001461 +S Button_drawtext Def0000107A +S stringheight01 Def00000570 +S Display_paint Def0000168A +S Display_handler Def00001609 +S ClearRect Def000000E2 +S stringwidth Def000004DA +S Move Def000000A3 +S GUIinit Def000020FB +S Label_paint Def00001836 +S Component_new Def000005AF +S Label_handler Def00001830 +S Component_setlabel Def00000659 +S root_actionhandler Def00001CE8 +S Root_paint Def00000F2C +S Component_linkstringtable Def00000A1F +A CSTR size 21 flags 0 +A CONST size 34 flags 0 +A UDATA0 size 2 flags 0 +S global Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 F8 FF 21 06 00 39 +R 00 00 01 00 02 05 0E 00 +T 09 00 00 00 EB 21 00 00 00 00 01 02 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 12 00 00 00 2A 00 00 00 00 23 23 E5 03 03 C5 +R 00 00 01 00 00 05 04 00 +T 1B 00 00 00 01 00 00 00 00 C5 3E 00 00 00 00 +R 00 00 01 00 00 05 02 00 2B 0B 10 00 +T 21 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 10 00 02 0A 0B 00 +T 28 00 00 00 F1 4D 44 E1 71 23 70 21 00 00 39 +R 00 00 01 00 +T 33 00 00 00 E5 21 00 00 E5 2A 00 00 00 00 23 +R 00 00 01 00 00 0A 04 00 +T 3C 00 00 00 23 4E 23 46 C5 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 08 00 +T 44 00 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 02 04 08 00 02 09 0B 00 +T 4B 00 00 00 F1 DD 36 FC 60 DD 36 FD 00 21 +R 00 00 01 00 +T 55 00 00 00 00 00 39 E5 21 01 00 E5 2A +R 00 00 01 00 +T 5E 00 00 00 00 00 00 00 23 23 4E 23 46 C5 3E +R 00 00 01 00 00 04 04 00 +T 67 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 08 00 02 09 08 00 +T 6C 00 00 00 00 00 00 00 F1 F1 F1 21 02 00 E5 +R 00 00 01 00 02 04 0B 00 +T 75 00 00 00 2E 08 +R 00 00 01 00 +T 77 00 00 00 +R 00 00 01 00 +T 77 00 00 00 39 4D +R 00 00 01 00 +T 79 00 00 00 +R 00 00 01 00 +T 79 00 00 00 44 2A 00 00 00 00 +R 00 00 01 00 00 06 04 00 +T 7D 00 00 00 +R 00 00 01 00 +T 7D 00 00 00 23 23 +R 00 00 01 00 +T 7F 00 00 00 +R 00 00 01 00 +T 7F 00 00 00 5E 23 +R 00 00 01 00 +T 81 00 00 00 +R 00 00 01 00 +T 81 00 00 00 56 3E 00 00 00 00 +R 00 00 01 00 2B 06 02 00 +T 84 00 00 00 +R 00 00 01 00 +T 84 00 00 00 21 00 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 02 05 02 00 02 0A 0B 00 +T 8B 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T 8E 00 00 00 +R 00 00 01 00 +T 8E 00 00 00 D5 2A 00 00 00 00 23 23 5E 23 56 +R 00 00 01 00 00 06 04 00 +T 97 00 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 05 00 02 0A 05 00 +T 9D 00 00 00 00 00 00 00 D1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 00 00 +T A3 00 00 00 +R 00 00 01 00 +T A3 00 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T AC 00 00 00 EB 21 02 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T B5 00 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T C0 00 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T C8 00 00 00 77 00 00 00 4D +R 00 00 01 00 00 04 01 00 +T CB 00 00 00 +R 00 00 01 00 +T CB 00 00 00 C3 79 00 00 00 2A 00 00 00 00 23 +R 00 00 01 00 00 05 01 00 00 0A 04 00 +T D2 00 00 00 23 +R 00 00 01 00 +T D3 00 00 00 +R 00 00 01 00 +T D3 00 00 00 5E 23 +R 00 00 01 00 +T D5 00 00 00 +R 00 00 01 00 +T D5 00 00 00 56 3E 00 00 00 00 +R 00 00 01 00 2B 06 02 00 +T D8 00 00 00 +R 00 00 01 00 +T D8 00 00 00 C3 84 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T DF 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T E2 00 00 00 +R 00 00 01 00 +T E2 00 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T EB 00 00 00 EB 21 06 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T F4 00 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T FF 00 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T 07 01 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 0E 01 00 00 00 00 00 00 +R 00 00 01 00 00 04 04 00 +T 10 01 00 00 +R 00 00 01 00 +T 10 01 00 00 C3 7D 00 00 00 23 C3 D3 00 00 00 +R 00 00 01 00 00 05 01 00 00 0B 01 00 +T 17 01 00 00 23 56 3E 00 00 00 00 +R 00 00 01 00 2B 07 02 00 +T 1B 01 00 00 +R 00 00 01 00 +T 1B 01 00 00 C3 84 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T 22 01 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T 25 01 00 00 +R 00 00 01 00 +T 25 01 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T 2E 01 00 00 EB 21 0A 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 37 01 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T 42 01 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T 4A 01 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 51 01 00 00 00 00 00 00 C3 10 01 00 00 23 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T 57 01 00 00 +R 00 00 01 00 +T 57 01 00 00 C3 7F 00 00 00 23 C3 D5 00 00 00 +R 00 00 01 00 00 05 01 00 00 0B 01 00 +T 5E 01 00 00 3E 00 00 00 00 C3 1B 01 00 00 CD +R 00 00 01 00 2B 05 02 00 00 0A 01 00 +T 64 01 00 00 00 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 04 00 +T 6A 01 00 00 +R 00 00 01 00 +T 6A 01 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T 73 01 00 00 EB 21 0E 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 7C 01 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T 87 01 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T 8F 01 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 96 01 00 00 00 00 00 00 C3 10 01 00 00 23 C3 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T 9D 01 00 00 57 01 00 00 23 +R 00 00 01 00 00 04 01 00 +T A0 01 00 00 +R 00 00 01 00 +T A0 01 00 00 C3 81 00 00 00 3E 00 00 00 00 C3 +R 00 00 01 00 00 05 01 00 2B 0A 02 00 +T A6 01 00 00 D8 00 00 00 CD 00 00 00 00 F1 C3 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T AD 01 00 00 00 00 00 00 +R 00 00 01 00 02 04 04 00 +T AF 01 00 00 +R 00 00 01 00 +T AF 01 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T B8 01 00 00 EB 21 12 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T C1 01 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T CC 01 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T D4 01 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T DB 01 00 00 00 00 00 00 C3 10 01 00 00 23 C3 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T E2 01 00 00 57 01 00 00 23 C3 A0 01 00 00 3E +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T E9 01 00 00 00 00 00 00 +R 00 00 01 00 2B 04 02 00 +T EA 01 00 00 +R 00 00 01 00 +T EA 01 00 00 C3 84 00 00 00 CD 00 00 00 00 F1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T F1 01 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T F4 01 00 00 +R 00 00 01 00 +T F4 01 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T FD 01 00 00 EB 21 16 00 00 00 01 04 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 06 02 00 00 DD 46 02 DD 70 FE DD 46 04 DD 70 +R 00 00 01 00 +T 11 02 00 00 FF 21 04 00 E5 2B 2B C3 +R 00 00 01 00 +T 19 02 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 20 02 00 00 00 00 00 00 C3 10 01 00 00 23 C3 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T 27 02 00 00 57 01 00 00 23 C3 A0 01 00 00 3E +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 2E 02 00 00 00 00 00 00 C3 EA 01 00 00 CD +R 00 00 01 00 2B 04 02 00 00 09 01 00 +T 33 02 00 00 00 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 04 00 +T 39 02 00 00 +R 00 00 01 00 +T 39 02 00 00 C5 FD E5 DD E5 D5 DD E1 3E +R 00 00 01 00 +T 42 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 06 00 02 09 06 00 +T 47 02 00 00 00 00 00 00 E5 DD E5 C1 2A +R 00 00 01 00 02 04 0B 00 +T 4E 02 00 00 00 00 00 00 23 23 5E 23 56 3E +R 00 00 01 00 00 04 04 00 +T 56 02 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 02 00 02 09 02 00 +T 5B 02 00 00 00 00 00 00 F1 +R 00 00 01 00 02 04 0B 00 +T 5E 02 00 00 +R 00 00 01 00 +T 5E 02 00 00 DD E1 FD E1 C1 C3 00 00 00 00 +R 00 00 01 00 02 0A 00 00 +T 66 02 00 00 +R 00 00 01 00 +T 66 02 00 00 CD 00 00 00 00 F8 FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T 6F 02 00 00 EB 21 1A 00 00 00 01 07 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 78 02 00 00 DD 46 02 DD 70 FA DD 46 04 DD 70 +R 00 00 01 00 +T 83 02 00 00 FB DD 46 0A DD 70 FC DD 46 0C DD +R 00 00 01 00 +T 8E 02 00 00 70 FD DD 46 0E DD 70 FE 21 07 00 +R 00 00 01 00 +T 99 02 00 00 E5 2E 02 C3 77 00 00 00 4D C3 +R 00 00 01 00 00 08 01 00 +T A1 02 00 00 CB 00 00 00 2A 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 00 09 04 00 +T A7 02 00 00 10 01 00 00 23 C3 57 01 00 00 23 +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T AE 02 00 00 C3 A0 01 00 00 3E 00 00 00 00 C3 +R 00 00 01 00 00 05 01 00 2B 0A 02 00 +T B4 02 00 00 EA 01 00 00 CD 00 00 00 00 F1 C3 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T BB 02 00 00 00 00 00 00 +R 00 00 01 00 02 04 04 00 +T BD 02 00 00 +R 00 00 01 00 +T BD 02 00 00 C5 D5 CD D7 02 00 00 CD +R 00 00 01 00 00 07 01 00 +T C3 02 00 00 00 00 00 00 21 80 00 E5 6C E5 E5 +R 00 00 01 00 02 04 0B 00 +T CC 02 00 00 CD EF 02 00 00 E1 E1 E1 D1 C1 C3 +R 00 00 01 00 00 05 01 00 +T D5 02 00 00 00 00 00 00 +R 00 00 01 00 02 04 00 00 +T D7 02 00 00 +R 00 00 01 00 +T D7 02 00 00 01 00 00 59 50 3E A3 00 00 00 21 +R 00 00 01 00 29 0A 01 00 +T DF 02 00 00 A3 00 00 00 CD 00 00 00 00 01 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T E5 02 00 00 80 00 58 50 3E E2 00 00 00 21 +R 00 00 01 00 29 09 01 00 +T EC 02 00 00 E2 00 00 00 C9 +R 00 00 01 00 00 04 01 00 +T EF 02 00 00 +R 00 00 01 00 +T EF 02 00 00 4D 44 EB +R 00 00 01 00 +T F2 02 00 00 +R 00 00 01 00 +T F2 02 00 00 3E 66 02 00 00 21 66 02 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T F8 02 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T FA 02 00 00 +R 00 00 01 00 +T FA 02 00 00 CD 00 00 00 00 FC FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T 03 03 00 00 EB 21 21 00 00 00 01 03 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 0C 03 00 00 DD 46 02 DD 70 FE 21 03 00 E5 2B +R 00 00 01 00 +T 17 03 00 00 C3 77 00 00 00 4D C3 CB 00 00 00 +R 00 00 01 00 00 05 01 00 00 0B 01 00 +T 1E 03 00 00 2A 00 00 00 00 C3 10 01 00 00 23 +R 00 00 01 00 00 05 04 00 00 0A 01 00 +T 25 03 00 00 C3 57 01 00 00 23 C3 A0 01 00 00 +R 00 00 01 00 00 05 01 00 00 0B 01 00 +T 2C 03 00 00 3E 00 00 00 00 C3 EA 01 00 00 CD +R 00 00 01 00 2B 05 02 00 00 0A 01 00 +T 32 03 00 00 00 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 04 00 +T 38 03 00 00 +R 00 00 01 00 +T 38 03 00 00 CD 00 00 00 00 FE FF 21 00 00 39 +R 00 00 01 00 02 05 0E 00 +T 41 03 00 00 EB 21 24 00 00 00 01 02 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 4A 03 00 00 DD 46 02 DD 70 FF 21 02 00 E5 C3 +R 00 00 01 00 +T 55 03 00 00 77 00 00 00 4D C3 CB 00 00 00 2A +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 5C 03 00 00 00 00 00 00 C3 10 01 00 00 23 C3 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T 63 03 00 00 57 01 00 00 23 C3 A0 01 00 00 3E +R 00 00 01 00 00 04 01 00 00 0A 01 00 +T 6A 03 00 00 00 00 00 00 C3 EA 01 00 00 CD +R 00 00 01 00 2B 04 02 00 00 09 01 00 +T 6F 03 00 00 00 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 04 00 +T 75 03 00 00 +R 00 00 01 00 +T 75 03 00 00 CD 00 00 00 00 00 00 21 0C 00 ED +R 00 00 01 00 02 05 0E 00 +T 7E 03 00 00 4B 00 00 00 00 09 +R 00 00 01 00 00 05 04 00 +T 82 03 00 00 +R 00 00 01 00 +T 82 03 00 00 46 23 66 68 EB +R 00 00 01 00 +T 87 03 00 00 +R 00 00 01 00 +T 87 03 00 00 7B B2 28 16 6B 62 46 23 66 68 DD +R 00 00 01 00 +T 92 03 00 00 4E 02 DD 46 03 ED 42 28 06 +R 00 00 01 00 +T 9B 03 00 00 +R 00 00 01 00 +T 9B 03 00 00 +R 00 00 01 00 +T 9B 03 00 00 +R 00 00 01 00 +T 9B 03 00 00 21 08 00 19 18 E1 +R 00 00 01 00 +T A1 03 00 00 +R 00 00 01 00 +T A1 03 00 00 EB C3 00 00 00 00 +R 00 00 01 00 02 06 04 00 +T A5 03 00 00 +R 00 00 01 00 +T A5 03 00 00 CD 00 00 00 00 3E 75 03 00 00 21 +R 00 00 01 00 02 05 0A 00 29 0A 01 00 +T AB 03 00 00 75 03 00 00 CD 22 04 00 00 28 29 +R 00 00 01 00 00 04 01 00 00 09 01 00 +T B2 03 00 00 +R 00 00 01 00 +T B2 03 00 00 DD 5E 02 DD 56 03 3E 38 03 00 00 +R 00 00 01 00 29 0B 01 00 +T BA 03 00 00 21 38 03 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T C1 03 00 00 0A 00 ED 4B 00 00 00 00 09 E5 DD +R 00 00 01 00 00 08 04 00 +T CA 03 00 00 5E 02 DD 56 03 3E 75 03 00 00 21 +R 00 00 01 00 29 0A 01 00 +T D2 03 00 00 75 03 00 00 CD 2D 04 00 00 E1 71 +R 00 00 01 00 00 04 01 00 00 09 01 00 +T D9 03 00 00 23 70 +R 00 00 01 00 +T DB 03 00 00 +R 00 00 01 00 +T DB 03 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T DE 03 00 00 +R 00 00 01 00 +T DE 03 00 00 ED 4B 00 00 00 00 09 46 23 66 68 +R 00 00 01 00 00 06 04 00 +T E7 03 00 00 +R 00 00 01 00 +T E7 03 00 00 23 23 4E 23 46 23 7E 69 60 CD +R 00 00 01 00 +T F1 03 00 00 00 00 00 00 4D 44 FD 6E 06 FD 66 +R 00 00 01 00 02 04 0B 00 +T FA 03 00 00 07 A7 ED 42 EB 01 02 00 CD +R 00 00 01 00 +T 03 04 00 00 00 00 00 00 DD 6E 04 DD 66 05 19 +R 00 00 01 00 02 04 11 00 +T 0C 04 00 00 EB 3E A3 00 00 00 21 A3 00 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 12 04 00 00 C9 +R 00 00 01 00 +T 13 04 00 00 +R 00 00 01 00 +T 13 04 00 00 CD 00 00 00 00 4D 44 FD 6E 08 FD +R 00 00 01 00 02 05 0B 00 +T 1C 04 00 00 66 09 A7 ED 42 C9 +R 00 00 01 00 +T 22 04 00 00 +R 00 00 01 00 +T 22 04 00 00 CD 00 00 00 00 7D B4 C9 +R 00 00 01 00 02 05 0B 00 +T 28 04 00 00 +R 00 00 01 00 +T 28 04 00 00 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 05 14 00 02 0A 14 00 +T 2D 04 00 00 +R 00 00 01 00 +T 2D 04 00 00 CD 00 00 00 00 4D 44 C9 +R 00 00 01 00 02 05 0B 00 +T 33 04 00 00 +R 00 00 01 00 +T 33 04 00 00 CD 00 00 00 00 FC FF FD E5 11 +R 00 00 01 00 02 05 0E 00 +T 3B 04 00 00 0E 00 CD CE 04 00 00 DD 4E 02 71 +R 00 00 01 00 00 07 01 00 +T 44 04 00 00 DD 46 03 23 70 DD 46 0C DD 6E 0A +R 00 00 01 00 +T 4F 04 00 00 FD 75 02 DD 66 0B FD 74 03 FD 70 +R 00 00 01 00 +T 5A 04 00 00 04 DD 46 10 DD 6E 0E FD 75 05 DD +R 00 00 01 00 +T 65 04 00 00 66 0F FD 74 06 FD 70 07 AF FD 77 +R 00 00 01 00 +T 70 04 00 00 08 FD 77 09 DD 6E 12 FD 75 0A DD +R 00 00 01 00 +T 7B 04 00 00 66 13 FD 74 0B DD 6E 14 FD 75 0C +R 00 00 01 00 +T 86 04 00 00 DD 66 15 FD 74 0D 21 0C 00 ED 4B +R 00 00 01 00 +T 91 04 00 00 00 00 00 00 09 7E 23 B6 21 0C 00 +R 00 00 01 00 00 04 04 00 +T 9A 04 00 00 ED 4B 00 00 00 00 09 20 10 +R 00 00 01 00 00 06 04 00 +T A1 04 00 00 +R 00 00 01 00 +T A1 04 00 00 FD E5 C1 71 23 70 21 0A 00 ED 4B +R 00 00 01 00 +T AC 04 00 00 00 00 00 00 09 18 12 +R 00 00 01 00 00 04 04 00 +T B1 04 00 00 +R 00 00 01 00 +T B1 04 00 00 46 23 66 68 EB +R 00 00 01 00 +T B6 04 00 00 +R 00 00 01 00 +T B6 04 00 00 21 08 00 19 7E 23 B6 21 08 00 19 +R 00 00 01 00 +T C1 04 00 00 20 EE +R 00 00 01 00 +T C3 04 00 00 +R 00 00 01 00 +T C3 04 00 00 +R 00 00 01 00 +T C3 04 00 00 FD E5 C1 71 23 70 +R 00 00 01 00 +T C9 04 00 00 +R 00 00 01 00 +T C9 04 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T CE 04 00 00 +R 00 00 01 00 +T CE 04 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 14 00 02 0A 14 00 +T D4 04 00 00 00 00 00 00 E5 FD E1 C9 +R 00 00 01 00 02 04 0B 00 +T DA 04 00 00 +R 00 00 01 00 +T DA 04 00 00 FD E5 DD E5 C5 D5 DD 21 00 00 FD +R 00 00 01 00 +T E5 04 00 00 21 00 00 +R 00 00 01 00 +T E8 04 00 00 +R 00 00 01 00 +T E8 04 00 00 FD E5 21 02 00 39 4E 23 46 E1 09 +R 00 00 01 00 +T F3 04 00 00 7E B7 28 50 +R 00 00 01 00 +T F7 04 00 00 +R 00 00 01 00 +T F7 04 00 00 FD E5 E1 09 5E CD 00 00 00 00 +R 00 00 01 00 02 0A 07 00 +T FF 04 00 00 0A 00 21 2C 2E 31 49 69 6A 6B 6C +R 00 00 01 00 +T 0A 05 00 00 72 35 05 00 00 30 05 00 00 +R 00 00 01 00 00 05 01 00 00 09 01 00 +T 0F 05 00 00 26 05 00 00 30 05 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 13 05 00 00 30 05 00 00 21 05 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 17 05 00 00 21 05 00 00 2B 05 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 1B 05 00 00 2B 05 00 00 2B 05 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 1F 05 00 00 21 05 00 00 +R 00 00 01 00 00 04 01 00 +T 21 05 00 00 +R 00 00 01 00 +T 21 05 00 00 01 02 00 18 12 +R 00 00 01 00 +T 26 05 00 00 +R 00 00 01 00 +T 26 05 00 00 01 03 00 18 0D +R 00 00 01 00 +T 2B 05 00 00 +R 00 00 01 00 +T 2B 05 00 00 01 04 00 18 08 +R 00 00 01 00 +T 30 05 00 00 +R 00 00 01 00 +T 30 05 00 00 01 05 00 18 03 +R 00 00 01 00 +T 35 05 00 00 +R 00 00 01 00 +T 35 05 00 00 01 06 00 +R 00 00 01 00 +T 38 05 00 00 +R 00 00 01 00 +T 38 05 00 00 DD 09 +R 00 00 01 00 +T 3A 05 00 00 +R 00 00 01 00 +T 3A 05 00 00 21 02 00 39 4E 23 46 DD 09 FD 23 +R 00 00 01 00 +T 45 05 00 00 18 A1 +R 00 00 01 00 +T 47 05 00 00 +R 00 00 01 00 +T 47 05 00 00 DD E5 E1 F1 F1 DD E1 FD E1 C3 +R 00 00 01 00 +T 51 05 00 00 00 00 00 00 +R 00 00 01 00 02 04 00 00 +T 53 05 00 00 +R 00 00 01 00 +T 53 05 00 00 CD 00 00 00 00 7B FE 80 30 06 +R 00 00 01 00 02 05 0A 00 +T 5B 05 00 00 +R 00 00 01 00 +T 5B 05 00 00 21 07 00 09 18 0C +R 00 00 01 00 +T 61 05 00 00 +R 00 00 01 00 +T 61 05 00 00 FE CC 38 08 3E DF BB 38 03 +R 00 00 01 00 +T 6A 05 00 00 +R 00 00 01 00 +T 6A 05 00 00 +R 00 00 01 00 +T 6A 05 00 00 +R 00 00 01 00 +T 6A 05 00 00 69 60 23 +R 00 00 01 00 +T 6D 05 00 00 +R 00 00 01 00 +T 6D 05 00 00 +R 00 00 01 00 +T 6D 05 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T 70 05 00 00 +R 00 00 01 00 +T 70 05 00 00 CD 00 00 00 00 01 00 00 +R 00 00 01 00 02 05 0A 00 +T 76 05 00 00 +R 00 00 01 00 +T 76 05 00 00 1A 5F 3E 53 05 00 00 21 +R 00 00 01 00 29 07 01 00 +T 7B 05 00 00 53 05 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 81 05 00 00 00 00 00 00 +R 00 00 01 00 02 04 04 00 +T 83 05 00 00 +R 00 00 01 00 +T 83 05 00 00 CD 00 00 00 00 01 05 00 C3 +R 00 00 01 00 02 05 0A 00 +T 8A 05 00 00 76 05 00 00 +R 00 00 01 00 00 04 01 00 +T 8C 05 00 00 +R 00 00 01 00 +T 8C 05 00 00 CD 00 00 00 00 01 00 00 +R 00 00 01 00 02 05 0A 00 +T 92 05 00 00 +R 00 00 01 00 +T 92 05 00 00 3E DA 04 00 00 21 DA 04 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 98 05 00 00 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 09 04 00 +T 9D 05 00 00 +R 00 00 01 00 +T 9D 05 00 00 CD 00 00 00 00 01 02 00 C3 +R 00 00 01 00 02 05 0A 00 +T A4 05 00 00 92 05 00 00 +R 00 00 01 00 00 04 01 00 +T A6 05 00 00 +R 00 00 01 00 +T A6 05 00 00 CD 00 00 00 00 01 03 00 C3 +R 00 00 01 00 02 05 0A 00 +T AD 05 00 00 92 05 00 00 +R 00 00 01 00 00 04 01 00 +T AF 05 00 00 +R 00 00 01 00 +T AF 05 00 00 CD 00 00 00 00 00 00 FD E5 11 +R 00 00 01 00 02 05 0E 00 +T B7 05 00 00 28 00 CD CE 04 00 00 2A +R 00 00 01 00 00 07 01 00 +T BD 05 00 00 00 00 00 00 5E 23 56 13 72 2B 73 +R 00 00 01 00 00 04 04 00 +T C6 05 00 00 FD E5 E1 73 23 72 DD 6E 02 FD 75 +R 00 00 01 00 +T D1 05 00 00 02 DD 66 03 FD 74 03 FD 71 04 FD +R 00 00 01 00 +T DC 05 00 00 70 05 DD 6E 0A FD 75 06 DD 66 0B +R 00 00 01 00 +T E7 05 00 00 FD 74 07 DD 6E 0C FD 75 08 DD 66 +R 00 00 01 00 +T F2 05 00 00 0D FD 74 09 AF FD 77 0A FD 77 0B +R 00 00 01 00 +T FD 05 00 00 FD 77 0C FD 77 0D FD 77 0E FD 77 +R 00 00 01 00 +T 08 06 00 00 0F FD 77 10 FD 77 11 FD 77 12 FD +R 00 00 01 00 +T 13 06 00 00 77 13 FD 77 14 FD 77 15 FD 77 16 +R 00 00 01 00 +T 1E 06 00 00 FD 77 17 FD 77 18 FD 77 19 FD 77 +R 00 00 01 00 +T 29 06 00 00 1A FD 77 1B FD 77 1C FD 77 1D FD +R 00 00 01 00 +T 34 06 00 00 77 1E FD 77 1F FD 77 24 FD 77 25 +R 00 00 01 00 +T 3F 06 00 00 FD 77 26 FD 77 27 FD 77 20 FD 77 +R 00 00 01 00 +T 4A 06 00 00 21 FD 77 22 FD 77 23 +R 00 00 01 00 +T 51 06 00 00 +R 00 00 01 00 +T 51 06 00 00 FD E5 E1 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 0A 04 00 +T 59 06 00 00 +R 00 00 01 00 +T 59 06 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 62 06 00 00 02 DD 66 03 E5 FD E1 11 00 00 +R 00 00 01 00 +T 6C 06 00 00 +R 00 00 01 00 +T 6C 06 00 00 DD 6E 04 DD 66 05 19 7E B7 28 21 +R 00 00 01 00 +T 77 06 00 00 01 14 80 6B 62 78 AC 67 ED 42 30 +R 00 00 01 00 +T 82 06 00 00 15 +R 00 00 01 00 +T 83 06 00 00 +R 00 00 01 00 +T 83 06 00 00 +R 00 00 01 00 +T 83 06 00 00 +R 00 00 01 00 +T 83 06 00 00 FD 6E 20 FD 66 21 19 E5 DD 6E 04 +R 00 00 01 00 +T 8E 06 00 00 DD 66 05 19 46 E1 70 13 18 D4 +R 00 00 01 00 +T 98 06 00 00 +R 00 00 01 00 +T 98 06 00 00 FD 6E 20 FD 66 21 19 36 00 FD E1 +R 00 00 01 00 +T A3 06 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T A6 06 00 00 +R 00 00 01 00 +T A6 06 00 00 CD 00 00 00 00 00 00 FD E5 59 50 +R 00 00 01 00 02 05 0E 00 +T AF 06 00 00 21 15 00 DD 4E 02 DD 46 03 09 7E +R 00 00 01 00 +T BA 06 00 00 23 66 6F E5 FD E1 21 15 00 09 7E +R 00 00 01 00 +T C5 06 00 00 23 B6 20 09 +R 00 00 01 00 +T C9 06 00 00 +R 00 00 01 00 +T C9 06 00 00 21 15 00 09 73 23 72 18 19 +R 00 00 01 00 +T D2 06 00 00 +R 00 00 01 00 +T D2 06 00 00 +R 00 00 01 00 +T D2 06 00 00 FD 7E 13 FD B6 14 28 0B +R 00 00 01 00 +T DA 06 00 00 +R 00 00 01 00 +T DA 06 00 00 FD 6E 13 FD 66 14 E5 FD E1 18 ED +R 00 00 01 00 +T E5 06 00 00 +R 00 00 01 00 +T E5 06 00 00 FD 73 13 FD 72 14 +R 00 00 01 00 +T EB 06 00 00 +R 00 00 01 00 +T EB 06 00 00 21 13 00 19 77 23 77 +R 00 00 01 00 +T F2 06 00 00 +R 00 00 01 00 +T F2 06 00 00 21 11 00 19 DD 4E 02 71 DD 46 03 +R 00 00 01 00 +T FD 06 00 00 23 70 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 09 04 00 +T 04 07 00 00 +R 00 00 01 00 +T 04 07 00 00 C5 FD E5 DD E5 21 15 00 19 46 23 +R 00 00 01 00 +T 0F 07 00 00 66 68 E5 DD E1 CD 40 07 00 00 +R 00 00 01 00 00 0A 01 00 +T 17 07 00 00 +R 00 00 01 00 +T 17 07 00 00 DD E5 E1 7D B4 28 1A +R 00 00 01 00 +T 1E 07 00 00 +R 00 00 01 00 +T 1E 07 00 00 DD E5 D1 DD 7E 1C DD 6E 1A DD 66 +R 00 00 01 00 +T 29 07 00 00 1B CD 00 00 00 00 DD 6E 13 DD 66 +R 00 00 01 00 02 06 0B 00 +T 32 07 00 00 14 E5 DD E1 18 DF +R 00 00 01 00 +T 38 07 00 00 +R 00 00 01 00 +T 38 07 00 00 1E 01 CD 42 07 00 00 C3 +R 00 00 01 00 00 07 01 00 +T 3E 07 00 00 5E 02 00 00 +R 00 00 01 00 00 04 01 00 +T 40 07 00 00 +R 00 00 01 00 +T 40 07 00 00 1E 00 +R 00 00 01 00 +T 42 07 00 00 +R 00 00 01 00 +T 42 07 00 00 3E FA 02 00 00 21 FA 02 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 48 07 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 4A 07 00 00 +R 00 00 01 00 +T 4A 07 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 53 07 00 00 02 DD 66 03 E5 FD E1 +R 00 00 01 00 +T 5A 07 00 00 +R 00 00 01 00 +T 5A 07 00 00 DD 6E 04 DD 66 05 7E FD 86 02 77 +R 00 00 01 00 +T 65 07 00 00 23 7E FD 8E 03 77 DD 6E 0A DD 66 +R 00 00 01 00 +T 70 07 00 00 0B 7E FD 86 04 77 23 7E FD 8E 05 +R 00 00 01 00 +T 7B 07 00 00 77 FD 6E 11 FD 66 12 E5 FD E1 7D +R 00 00 01 00 +T 86 07 00 00 B4 20 D1 +R 00 00 01 00 +T 89 07 00 00 +R 00 00 01 00 +T 89 07 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 8E 07 00 00 +R 00 00 01 00 +T 8E 07 00 00 CD 00 00 00 00 00 00 21 15 00 DD +R 00 00 01 00 02 05 0E 00 +T 97 07 00 00 4E 02 DD 46 03 09 +R 00 00 01 00 +T 9D 07 00 00 +R 00 00 01 00 +T 9D 07 00 00 46 23 66 68 EB +R 00 00 01 00 +T A2 07 00 00 +R 00 00 01 00 +T A2 07 00 00 7B B2 28 1B +R 00 00 01 00 +T A6 07 00 00 +R 00 00 01 00 +T A6 07 00 00 21 10 00 19 4E 06 00 DD 6E 04 DD +R 00 00 01 00 +T B1 07 00 00 66 05 A7 ED 42 20 03 +R 00 00 01 00 +T B8 07 00 00 +R 00 00 01 00 +T B8 07 00 00 EB 18 08 +R 00 00 01 00 +T BB 07 00 00 +R 00 00 01 00 +T BB 07 00 00 21 13 00 19 18 DC +R 00 00 01 00 +T C1 07 00 00 +R 00 00 01 00 +T C1 07 00 00 6F 67 +R 00 00 01 00 +T C3 07 00 00 +R 00 00 01 00 +T C3 07 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T C6 07 00 00 +R 00 00 01 00 +T C6 07 00 00 CD 00 00 00 00 F8 FF FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T CF 07 00 00 02 DD 66 03 E5 FD E1 FD 6E 15 DD +R 00 00 01 00 +T DA 07 00 00 75 F8 FD 66 16 DD 74 F9 FD E5 E1 +R 00 00 01 00 +T E5 07 00 00 7D B4 CA 79 09 00 00 +R 00 00 01 00 00 07 01 00 +T EA 07 00 00 +R 00 00 01 00 +T EA 07 00 00 +R 00 00 01 00 +T EA 07 00 00 DD 7E F8 DD B6 F9 28 11 +R 00 00 01 00 +T F2 07 00 00 +R 00 00 01 00 +T F2 07 00 00 DD 5E F8 DD 56 F9 CD 8F 09 00 00 +R 00 00 01 00 00 0B 01 00 +T FB 07 00 00 DD 75 F8 DD 74 F9 18 E7 +R 00 00 01 00 +T 03 08 00 00 +R 00 00 01 00 +T 03 08 00 00 FD 7E 11 FD B6 12 CA 95 08 00 00 +R 00 00 01 00 00 0B 01 00 +T 0C 08 00 00 +R 00 00 01 00 +T 0C 08 00 00 FD 6E 11 FD 66 12 01 15 00 09 46 +R 00 00 01 00 +T 17 08 00 00 23 66 68 FD E5 C1 A7 ED 42 FD 6E +R 00 00 01 00 +T 22 08 00 00 11 FD 66 12 01 15 00 09 20 09 +R 00 00 01 00 +T 2C 08 00 00 +R 00 00 01 00 +T 2C 08 00 00 E5 FD 6E 11 FD 66 12 18 50 +R 00 00 01 00 +T 35 08 00 00 +R 00 00 01 00 +T 35 08 00 00 46 23 66 68 +R 00 00 01 00 +T 39 08 00 00 +R 00 00 01 00 +T 39 08 00 00 DD 75 F8 DD 74 F9 +R 00 00 01 00 +T 3F 08 00 00 +R 00 00 01 00 +T 3F 08 00 00 21 13 00 DD 4E F8 DD 46 F9 09 46 +R 00 00 01 00 +T 4A 08 00 00 23 66 68 FD E5 C1 A7 ED 42 28 19 +R 00 00 01 00 +T 55 08 00 00 21 13 00 DD 4E F8 DD 46 F9 09 7E +R 00 00 01 00 +T 60 08 00 00 23 B6 28 0A +R 00 00 01 00 +T 64 08 00 00 +R 00 00 01 00 +T 64 08 00 00 +R 00 00 01 00 +T 64 08 00 00 +R 00 00 01 00 +T 64 08 00 00 21 13 00 09 56 23 66 6A 18 CB +R 00 00 01 00 +T 6E 08 00 00 +R 00 00 01 00 +T 6E 08 00 00 21 13 00 DD 4E F8 DD 46 F9 09 7E +R 00 00 01 00 +T 79 08 00 00 23 B6 28 18 +R 00 00 01 00 +T 7D 08 00 00 +R 00 00 01 00 +T 7D 08 00 00 21 13 00 09 E5 21 13 00 +R 00 00 01 00 +T 85 08 00 00 +R 00 00 01 00 +T 85 08 00 00 09 46 23 66 68 01 13 00 09 4E 23 +R 00 00 01 00 +T 90 08 00 00 46 E1 71 23 70 +R 00 00 01 00 +T 95 08 00 00 +R 00 00 01 00 +T 95 08 00 00 +R 00 00 01 00 +T 95 08 00 00 +R 00 00 01 00 +T 95 08 00 00 FD 6E 13 DD 75 F8 FD 66 14 DD 74 +R 00 00 01 00 +T A0 08 00 00 F9 3E 04 FD AE 24 FD B6 25 C2 +R 00 00 01 00 +T AA 08 00 00 45 09 00 00 +R 00 00 01 00 00 04 01 00 +T AC 08 00 00 +R 00 00 01 00 +T AC 08 00 00 FD 6E 11 DD 75 FC FD 66 12 DD 74 +R 00 00 01 00 +T B7 08 00 00 FD FD 6E 26 DD 75 FE FD 66 27 DD +R 00 00 01 00 +T C2 08 00 00 74 FF CD 84 09 00 00 DD 6E FE DD +R 00 00 01 00 00 07 01 00 +T CB 08 00 00 66 FF 23 23 CD 84 09 00 00 +R 00 00 01 00 00 09 01 00 +T D2 08 00 00 +R 00 00 01 00 +T D2 08 00 00 DD 7E FC DD B6 FD 28 20 21 24 00 +R 00 00 01 00 +T DD 08 00 00 DD 4E FC DD 46 FD 09 3E 04 AE 23 +R 00 00 01 00 +T E8 08 00 00 B6 28 0F +R 00 00 01 00 +T EB 08 00 00 +R 00 00 01 00 +T EB 08 00 00 +R 00 00 01 00 +T EB 08 00 00 +R 00 00 01 00 +T EB 08 00 00 21 11 00 09 56 DD 72 FC 23 66 DD +R 00 00 01 00 +T F6 08 00 00 74 FD 18 D8 +R 00 00 01 00 +T FA 08 00 00 +R 00 00 01 00 +T FA 08 00 00 DD 7E FC DD B6 FD 28 43 +R 00 00 01 00 +T 02 09 00 00 +R 00 00 01 00 +T 02 09 00 00 21 26 00 DD 4E FC DD 46 FD 09 46 +R 00 00 01 00 +T 0D 09 00 00 DD 70 FE 23 66 DD 74 FF 21 06 00 +R 00 00 01 00 +T 18 09 00 00 ED 4B 00 00 00 00 09 E5 DD 6E FE +R 00 00 01 00 00 06 04 00 +T 21 09 00 00 DD 66 FF 5E 23 56 E1 73 23 72 21 +R 00 00 01 00 +T 2C 09 00 00 08 00 ED 4B 00 00 00 00 09 E5 DD +R 00 00 01 00 00 08 04 00 +T 35 09 00 00 4E FE DD 46 FF 03 03 69 60 4E 23 +R 00 00 01 00 +T 40 09 00 00 46 E1 71 23 70 +R 00 00 01 00 +T 45 09 00 00 +R 00 00 01 00 +T 45 09 00 00 +R 00 00 01 00 +T 45 09 00 00 FD 4E 24 FD 46 25 21 00 00 CD +R 00 00 01 00 +T 4F 09 00 00 00 00 00 00 30 09 +R 00 00 01 00 02 04 0F 00 +T 53 09 00 00 +R 00 00 01 00 +T 53 09 00 00 FD 5E 26 FD 56 27 CD 87 09 00 00 +R 00 00 01 00 00 0B 01 00 +T 5C 09 00 00 +R 00 00 01 00 +T 5C 09 00 00 FD CB 0B 76 20 11 FD 7E 20 FD B6 +R 00 00 01 00 +T 67 09 00 00 21 28 09 +R 00 00 01 00 +T 6A 09 00 00 +R 00 00 01 00 +T 6A 09 00 00 +R 00 00 01 00 +T 6A 09 00 00 +R 00 00 01 00 +T 6A 09 00 00 FD 5E 20 FD 56 21 CD 87 09 00 00 +R 00 00 01 00 00 0B 01 00 +T 73 09 00 00 +R 00 00 01 00 +T 73 09 00 00 FD E5 D1 CD 87 09 00 00 +R 00 00 01 00 00 08 01 00 +T 79 09 00 00 +R 00 00 01 00 +T 79 09 00 00 DD 6E F8 DD 66 F9 FD E1 C3 +R 00 00 01 00 +T 82 09 00 00 00 00 00 00 +R 00 00 01 00 02 04 04 00 +T 84 09 00 00 +R 00 00 01 00 +T 84 09 00 00 5E 23 56 +R 00 00 01 00 +T 87 09 00 00 +R 00 00 01 00 +T 87 09 00 00 3E 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 05 09 00 02 0A 09 00 +T 8D 09 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 8F 09 00 00 +R 00 00 01 00 +T 8F 09 00 00 3E C6 07 00 00 21 C6 07 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 95 09 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 97 09 00 00 +R 00 00 01 00 +T 97 09 00 00 C5 FD E5 DD E5 21 15 00 19 46 23 +R 00 00 01 00 +T A2 09 00 00 66 68 +R 00 00 01 00 +T A4 09 00 00 +R 00 00 01 00 +T A4 09 00 00 E5 DD E1 +R 00 00 01 00 +T A7 09 00 00 +R 00 00 01 00 +T A7 09 00 00 7D B4 28 08 +R 00 00 01 00 +T AB 09 00 00 +R 00 00 01 00 +T AB 09 00 00 DD E5 D1 CD 8F 09 00 00 18 F1 +R 00 00 01 00 00 08 01 00 +T B3 09 00 00 +R 00 00 01 00 +T B3 09 00 00 C3 5E 02 00 00 +R 00 00 01 00 00 05 01 00 +T B6 09 00 00 +R 00 00 01 00 +T B6 09 00 00 CD 00 00 00 00 00 00 FD E5 21 +R 00 00 01 00 02 05 0E 00 +T BE 09 00 00 15 00 DD 5E 02 DD 56 03 19 +R 00 00 01 00 +T C7 09 00 00 +R 00 00 01 00 +T C7 09 00 00 56 23 66 6A E5 FD E1 +R 00 00 01 00 +T CE 09 00 00 +R 00 00 01 00 +T CE 09 00 00 7D B4 28 3D +R 00 00 01 00 +T D2 09 00 00 +R 00 00 01 00 +T D2 09 00 00 21 0A 00 FD E5 C1 09 DD 7E 04 DD +R 00 00 01 00 +T DD 09 00 00 56 05 2F 5F 7A 2F 57 7E A3 77 23 +R 00 00 01 00 +T E8 09 00 00 7E A2 77 21 0A 00 09 7E DD B6 0A +R 00 00 01 00 +T F3 09 00 00 77 23 7E DD B6 0B 77 21 0A 00 09 +R 00 00 01 00 +T FE 09 00 00 7E DD AE 0C 77 23 7E DD AE 0D 77 +R 00 00 01 00 +T 09 0A 00 00 21 13 00 09 18 B8 +R 00 00 01 00 +T 0F 0A 00 00 +R 00 00 01 00 +T 0F 0A 00 00 11 00 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 02 05 0C 00 2B 0A 01 00 +T 15 0A 00 00 00 00 00 00 CD 00 00 00 00 FD E1 +R 00 00 01 00 02 04 01 00 02 09 0B 00 +T 1C 0A 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T 1F 0A 00 00 +R 00 00 01 00 +T 1F 0A 00 00 C5 FD E5 DD E5 D5 DD E1 21 15 00 +R 00 00 01 00 +T 2A 0A 00 00 19 46 23 66 68 E5 FD E1 21 20 00 +R 00 00 01 00 +T 35 0A 00 00 19 46 23 66 68 01 00 90 3E 80 AC +R 00 00 01 00 +T 40 0A 00 00 67 ED 42 30 2E DD 4E 20 DD 46 21 +R 00 00 01 00 +T 4B 0A 00 00 21 00 00 CD 00 00 00 00 30 20 +R 00 00 01 00 02 08 0F 00 +T 53 0A 00 00 +R 00 00 01 00 +T 53 0A 00 00 +R 00 00 01 00 +T 53 0A 00 00 +R 00 00 01 00 +T 53 0A 00 00 DD 6E 20 DD 66 21 29 E5 21 08 00 +R 00 00 01 00 +T 5E 0A 00 00 ED 4B 00 00 00 00 09 4E 23 46 E1 +R 00 00 01 00 00 06 04 00 +T 67 0A 00 00 09 2B 2B 46 DD 70 20 23 66 DD 74 +R 00 00 01 00 +T 72 0A 00 00 21 +R 00 00 01 00 +T 73 0A 00 00 +R 00 00 01 00 +T 73 0A 00 00 DD 6E 22 DD 66 23 01 00 90 3E 80 +R 00 00 01 00 +T 7E 0A 00 00 AC 67 ED 42 30 2E DD 4E 22 DD 46 +R 00 00 01 00 +T 89 0A 00 00 23 21 00 00 CD 00 00 00 00 30 20 +R 00 00 01 00 02 09 0F 00 +T 92 0A 00 00 +R 00 00 01 00 +T 92 0A 00 00 +R 00 00 01 00 +T 92 0A 00 00 +R 00 00 01 00 +T 92 0A 00 00 DD 6E 22 DD 66 23 29 E5 21 08 00 +R 00 00 01 00 +T 9D 0A 00 00 ED 4B 00 00 00 00 09 4E 23 46 E1 +R 00 00 01 00 00 06 04 00 +T A6 0A 00 00 09 2B 2B 46 DD 70 22 23 66 DD 74 +R 00 00 01 00 +T B1 0A 00 00 23 +R 00 00 01 00 +T B2 0A 00 00 +R 00 00 01 00 +T B2 0A 00 00 +R 00 00 01 00 +T B2 0A 00 00 FD E5 E1 7D B4 28 16 +R 00 00 01 00 +T B9 0A 00 00 +R 00 00 01 00 +T B9 0A 00 00 FD E5 D1 3E 1F 0A 00 00 21 +R 00 00 01 00 29 08 01 00 +T BF 0A 00 00 1F 0A 00 00 CD 00 00 00 00 FD 6E +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T C6 0A 00 00 13 FD 66 14 E5 FD E1 18 E3 +R 00 00 01 00 +T CF 0A 00 00 +R 00 00 01 00 +T CF 0A 00 00 C3 5E 02 00 00 +R 00 00 01 00 00 05 01 00 +T D2 0A 00 00 +R 00 00 01 00 +T D2 0A 00 00 CD 00 00 00 00 D0 FF FD E5 AF DD +R 00 00 01 00 02 05 0E 00 +T DB 0A 00 00 77 FA DD 77 FB DD 77 FC DD 77 FD +R 00 00 01 00 +T E6 0A 00 00 59 50 CD 00 00 00 00 08 00 01 00 +R 00 00 01 00 02 07 0D 00 +T EF 0A 00 00 02 00 03 00 02 01 03 01 04 01 +R 00 00 01 00 +T F9 0A 00 00 05 01 01 04 6B 0D 00 00 +R 00 00 01 00 00 08 01 00 +T FF 0A 00 00 D9 0C 00 00 6C 0C 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 03 0B 00 00 98 0C 00 00 E0 0B 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 07 0B 00 00 F1 0B 00 00 A5 0B 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 0B 0B 00 00 40 0B 00 00 0F 0B 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 0F 0B 00 00 +R 00 00 01 00 +T 0F 0B 00 00 21 15 00 DD 4E 02 DD 46 03 09 46 +R 00 00 01 00 +T 1A 0B 00 00 23 66 68 +R 00 00 01 00 +T 1D 0B 00 00 +R 00 00 01 00 +T 1D 0B 00 00 E5 FD E1 +R 00 00 01 00 +T 20 0B 00 00 +R 00 00 01 00 +T 20 0B 00 00 7D B4 28 19 +R 00 00 01 00 +T 24 0B 00 00 +R 00 00 01 00 +T 24 0B 00 00 FD CB 0A 46 28 0B +R 00 00 01 00 +T 2A 0B 00 00 +R 00 00 01 00 +T 2A 0B 00 00 DD 6E 0A DD 66 0B E5 CD +R 00 00 01 00 +T 32 0B 00 00 70 0D 00 00 E1 +R 00 00 01 00 00 04 01 00 +T 35 0B 00 00 +R 00 00 01 00 +T 35 0B 00 00 FD 6E 13 FD 66 14 18 E0 +R 00 00 01 00 +T 3D 0B 00 00 +R 00 00 01 00 +T 3D 0B 00 00 C3 6B 0D 00 00 +R 00 00 01 00 00 05 01 00 +T 40 0B 00 00 +R 00 00 01 00 +T 40 0B 00 00 21 15 00 DD 4E 02 DD 46 03 09 46 +R 00 00 01 00 +T 4B 0B 00 00 23 66 68 +R 00 00 01 00 +T 4E 0B 00 00 +R 00 00 01 00 +T 4E 0B 00 00 E5 FD E1 +R 00 00 01 00 +T 51 0B 00 00 +R 00 00 01 00 +T 51 0B 00 00 7D B4 28 4D +R 00 00 01 00 +T 55 0B 00 00 +R 00 00 01 00 +T 55 0B 00 00 FD CB 0A 46 28 38 +R 00 00 01 00 +T 5B 0B 00 00 +R 00 00 01 00 +T 5B 0B 00 00 DD 6E 0A DD 66 0B E5 CD +R 00 00 01 00 +T 63 0B 00 00 70 0D 00 00 E1 DD 6E 0A DD 66 0B +R 00 00 01 00 00 04 01 00 +T 6C 0B 00 00 E5 01 03 00 CD 76 0D 00 00 E1 FD +R 00 00 01 00 00 09 01 00 +T 75 0B 00 00 7E 0A E6 22 6F 26 00 3E 22 AD 20 +R 00 00 01 00 +T 80 0B 00 00 12 FD 4E 10 44 DD 6E 0A DD 66 0B +R 00 00 01 00 +T 8B 0B 00 00 ED 42 20 04 +R 00 00 01 00 +T 8F 0B 00 00 +R 00 00 01 00 +T 8F 0B 00 00 +R 00 00 01 00 +T 8F 0B 00 00 +R 00 00 01 00 +T 8F 0B 00 00 FD 21 00 00 +R 00 00 01 00 +T 93 0B 00 00 +R 00 00 01 00 +T 93 0B 00 00 +R 00 00 01 00 +T 93 0B 00 00 FD E5 E1 7D B4 28 B7 +R 00 00 01 00 +T 9A 0B 00 00 +R 00 00 01 00 +T 9A 0B 00 00 FD 6E 13 FD 66 14 18 AC +R 00 00 01 00 +T A2 0B 00 00 +R 00 00 01 00 +T A2 0B 00 00 +R 00 00 01 00 +T A2 0B 00 00 C3 6B 0D 00 00 +R 00 00 01 00 00 05 01 00 +T A5 0B 00 00 +R 00 00 01 00 +T A5 0B 00 00 DD 6E 02 DD 66 03 E5 FD E1 21 +R 00 00 01 00 +T AF 0B 00 00 0A 00 DD 4E 02 DD 46 03 09 CB 46 +R 00 00 01 00 +T BA 0B 00 00 28 21 +R 00 00 01 00 +T BC 0B 00 00 +R 00 00 01 00 +T BC 0B 00 00 FD CB 0A 6E 28 1B FD 4E 10 47 DD +R 00 00 01 00 +T C7 0B 00 00 6E 0A DD 66 0B A7 ED 42 20 0C +R 00 00 01 00 +T D1 0B 00 00 +R 00 00 01 00 +T D1 0B 00 00 +R 00 00 01 00 +T D1 0B 00 00 +R 00 00 01 00 +T D1 0B 00 00 FD 6E 26 FD 66 27 FD E5 D1 CD +R 00 00 01 00 +T DB 0B 00 00 95 0D 00 00 +R 00 00 01 00 00 04 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 +R 00 00 01 00 +T DD 0B 00 00 C3 6B 0D 00 00 +R 00 00 01 00 00 05 01 00 +T E0 0B 00 00 +R 00 00 01 00 +T E0 0B 00 00 DD 5E 02 4B DD 56 03 42 21 1A 00 +R 00 00 01 00 +T EB 0B 00 00 CD 94 0D 00 00 C3 6B 0D 00 00 +R 00 00 01 00 00 05 01 00 00 0A 01 00 +T F1 0B 00 00 +R 00 00 01 00 +T F1 0B 00 00 21 0A 00 DD 4E 02 DD 46 03 09 7E +R 00 00 01 00 +T FC 0B 00 00 E6 FC 77 21 2E 00 39 E5 2B 2B 4D +R 00 00 01 00 +T 07 0C 00 00 44 DD 5E 02 DD 56 03 CD +R 00 00 01 00 +T 0F 0C 00 00 8C 0D 00 00 E1 21 08 00 DD 4E 02 +R 00 00 01 00 00 04 01 00 +T 18 0C 00 00 DD 46 03 09 5E 23 56 D5 21 06 00 +R 00 00 01 00 +T 23 0C 00 00 09 5E 23 56 D5 DD 6E FC DD 66 FD +R 00 00 01 00 +T 2E 0C 00 00 E5 DD 4E FA DD 46 FB 11 00 00 CD +R 00 00 01 00 +T 39 0C 00 00 F2 02 00 00 E1 E1 E1 21 00 00 E5 +R 00 00 01 00 00 04 01 00 +T 42 0C 00 00 2E 11 DD 5E 02 DD 56 03 19 5E 23 +R 00 00 01 00 +T 4D 0C 00 00 56 21 11 00 DD 4E 02 DD 46 03 09 +R 00 00 01 00 +T 58 0C 00 00 46 23 66 68 01 17 00 09 4E 23 46 +R 00 00 01 00 +T 63 0C 00 00 23 7E 69 60 01 03 01 18 29 +R 00 00 01 00 +T 6C 0C 00 00 +R 00 00 01 00 +T 6C 0C 00 00 21 11 00 DD 4E 02 DD 46 03 09 56 +R 00 00 01 00 +T 77 0C 00 00 23 66 6A E5 FD E1 59 50 CD +R 00 00 01 00 +T 80 0C 00 00 8F 09 00 00 21 00 00 E5 01 03 01 +R 00 00 01 00 00 04 01 00 +T 89 0C 00 00 FD E5 D1 FD 7E 19 FD 6E 17 FD 66 +R 00 00 01 00 +T 94 0C 00 00 18 +R 00 00 01 00 +T 95 0C 00 00 +R 00 00 01 00 +T 95 0C 00 00 C3 67 0D 00 00 +R 00 00 01 00 00 05 01 00 +T 98 0C 00 00 +R 00 00 01 00 +T 98 0C 00 00 21 15 00 DD 4E 02 DD 46 03 09 46 +R 00 00 01 00 +T A3 0C 00 00 23 66 68 +R 00 00 01 00 +T A6 0C 00 00 +R 00 00 01 00 +T A6 0C 00 00 E5 FD E1 +R 00 00 01 00 +T A9 0C 00 00 +R 00 00 01 00 +T A9 0C 00 00 7D B4 28 29 +R 00 00 01 00 +T AD 0C 00 00 +R 00 00 01 00 +T AD 0C 00 00 DD 6E 0A DD 66 0B FD E5 C1 ED 42 +R 00 00 01 00 +T B8 0C 00 00 28 14 FD CB 0A 5E 28 0E +R 00 00 01 00 +T C0 0C 00 00 +R 00 00 01 00 +T C0 0C 00 00 +R 00 00 01 00 +T C0 0C 00 00 +R 00 00 01 00 +T C0 0C 00 00 DD 6E 0A DD 66 0B E5 01 03 02 CD +R 00 00 01 00 +T CB 0C 00 00 76 0D 00 00 E1 +R 00 00 01 00 00 04 01 00 +T CE 0C 00 00 +R 00 00 01 00 +T CE 0C 00 00 FD 6E 13 FD 66 14 18 D0 +R 00 00 01 00 +T D6 0C 00 00 +R 00 00 01 00 +T D6 0C 00 00 C3 6B 0D 00 00 +R 00 00 01 00 00 05 01 00 +T D9 0C 00 00 +R 00 00 01 00 +T D9 0C 00 00 21 11 00 DD 4E 02 DD 46 03 09 7E +R 00 00 01 00 +T E4 0C 00 00 23 B6 20 0E +R 00 00 01 00 +T E8 0C 00 00 +R 00 00 01 00 +T E8 0C 00 00 21 04 00 ED 4B 00 00 00 00 09 36 +R 00 00 01 00 00 09 04 00 +T F1 0C 00 00 01 23 77 18 75 +R 00 00 01 00 +T F6 0C 00 00 +R 00 00 01 00 +T F6 0C 00 00 21 0A 00 09 23 CB 6E 20 28 +R 00 00 01 00 +T FF 0C 00 00 +R 00 00 01 00 +T FF 0C 00 00 DD 6E 0A DD 66 0B E5 21 11 00 59 +R 00 00 01 00 +T 0A 0D 00 00 50 19 5E 23 56 21 11 00 09 46 23 +R 00 00 01 00 +T 15 0D 00 00 66 68 01 17 00 09 4E 23 46 23 7E +R 00 00 01 00 +T 20 0D 00 00 69 60 01 01 04 18 40 +R 00 00 01 00 +T 27 0D 00 00 +R 00 00 01 00 +T 27 0D 00 00 21 11 00 09 56 23 66 6A E5 FD E1 +R 00 00 01 00 +T 32 0D 00 00 11 0A 00 19 7E F6 03 77 6A 62 E5 +R 00 00 01 00 +T 3D 0D 00 00 23 E5 4A 42 FD E5 D1 3E +R 00 00 01 00 +T 45 0D 00 00 B6 09 00 00 21 B6 09 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 4A 0D 00 00 00 00 00 00 E1 E1 21 00 00 E5 DD +R 00 00 01 00 02 04 0B 00 +T 53 0D 00 00 5E 02 4B DD 56 03 42 2E 17 09 4E +R 00 00 01 00 +T 5E 0D 00 00 23 46 23 7E 69 60 01 05 01 +R 00 00 01 00 +T 67 0D 00 00 +R 00 00 01 00 +T 67 0D 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 02 05 0B 00 +T 6B 0D 00 00 +R 00 00 01 00 +T 6B 0D 00 00 +R 00 00 01 00 +T 6B 0D 00 00 +R 00 00 01 00 +T 6B 0D 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 70 0D 00 00 +R 00 00 01 00 +T 70 0D 00 00 DD 4E 04 DD 46 05 +R 00 00 01 00 +T 76 0D 00 00 +R 00 00 01 00 +T 76 0D 00 00 FD E5 D1 FD 7E 19 FD 6E 17 FD 66 +R 00 00 01 00 +T 81 0D 00 00 18 C3 00 00 00 00 +R 00 00 01 00 02 06 0B 00 +T 85 0D 00 00 +R 00 00 01 00 +T 85 0D 00 00 23 23 +R 00 00 01 00 +T 87 0D 00 00 +R 00 00 01 00 +T 87 0D 00 00 4D 44 DD E5 D1 +R 00 00 01 00 +T 8C 0D 00 00 +R 00 00 01 00 +T 8C 0D 00 00 3E 4A 07 00 00 21 4A 07 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 92 0D 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 94 0D 00 00 +R 00 00 01 00 +T 94 0D 00 00 09 +R 00 00 01 00 +T 95 0D 00 00 +R 00 00 01 00 +T 95 0D 00 00 4E 23 46 23 7E 69 60 C3 +R 00 00 01 00 +T 9D 0D 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 9F 0D 00 00 +R 00 00 01 00 +T 9F 0D 00 00 CD 00 00 00 00 FC FF FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T A8 0D 00 00 02 DD 66 03 E5 FD E1 AF DD 77 FE +R 00 00 01 00 +T B3 0D 00 00 DD 77 FF DD 77 FC DD 77 FD 21 +R 00 00 01 00 +T BD 0D 00 00 0A 00 ED 4B 00 00 00 00 09 7E 23 +R 00 00 01 00 00 08 04 00 +T C6 0D 00 00 66 6F 46 23 66 68 FD 4E 0E FD 46 +R 00 00 01 00 +T D1 0D 00 00 0F A7 ED 42 28 09 +R 00 00 01 00 +T D7 0D 00 00 +R 00 00 01 00 +T D7 0D 00 00 FD 5E 0E FD 56 0F CD 24 0F 00 00 +R 00 00 01 00 00 0B 01 00 +T E0 0D 00 00 +R 00 00 01 00 +T E0 0D 00 00 FD CB 0A 46 CA DC 0E 00 00 +R 00 00 01 00 00 09 01 00 +T E7 0D 00 00 +R 00 00 01 00 +T E7 0D 00 00 21 02 00 39 E5 23 23 4D 44 FD E5 +R 00 00 01 00 +T F2 0D 00 00 D1 CD 8C 0D 00 00 E1 CD +R 00 00 01 00 00 06 01 00 +T F8 0D 00 00 40 07 00 00 DD 4E FC DD 46 FD DD +R 00 00 01 00 00 04 01 00 +T 01 0E 00 00 5E FE DD 56 FF 3E A3 00 00 00 21 +R 00 00 01 00 29 0A 01 00 +T 09 0E 00 00 A3 00 00 00 CD 00 00 00 00 FD 4E +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 10 0E 00 00 08 FD 46 09 FD 5E 06 FD 56 07 3E +R 00 00 01 00 +T 1B 0E 00 00 E2 00 00 00 21 E2 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 20 0E 00 00 00 00 00 00 FD 6E 08 FD 66 09 E5 +R 00 00 01 00 02 04 0B 00 +T 29 0E 00 00 FD 6E 06 FD 66 07 E5 DD 6E FC DD +R 00 00 01 00 +T 34 0E 00 00 66 FD E5 DD 4E FE DD 46 FF 11 +R 00 00 01 00 +T 3E 0E 00 00 00 00 CD F2 02 00 00 E1 E1 E1 FD +R 00 00 01 00 00 07 01 00 +T 47 0E 00 00 5E 20 FD 56 21 21 0A 00 ED 4B +R 00 00 01 00 +T 51 0E 00 00 00 00 00 00 09 7E 23 66 6F CD +R 00 00 01 00 00 04 04 00 +T 59 0E 00 00 E1 0E 00 00 DD 4E FC DD 46 FD 09 +R 00 00 01 00 00 04 01 00 +T 62 0E 00 00 11 04 00 19 4D 44 CD EF 0E 00 00 +R 00 00 01 00 00 0B 01 00 +T 6B 0E 00 00 7E 23 66 6F 01 05 00 09 4E 23 46 +R 00 00 01 00 +T 76 0E 00 00 23 7E 69 60 CD 13 04 00 00 01 +R 00 00 01 00 00 09 01 00 +T 7E 0E 00 00 FC FF 09 4D 44 FD 5E 06 FD 56 07 +R 00 00 01 00 +T 89 0E 00 00 3E 25 01 00 00 21 25 01 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 8F 0E 00 00 00 00 00 00 DD 4E FC DD 46 FD CD +R 00 00 01 00 02 04 0B 00 +T 98 0E 00 00 EF 0E 00 00 46 23 66 68 CD +R 00 00 01 00 00 04 01 00 +T 9F 0E 00 00 E1 0E 00 00 01 05 00 09 4D 44 FD +R 00 00 01 00 00 04 01 00 +T A8 0E 00 00 5E 06 FD 56 07 3E 6A 01 00 00 21 +R 00 00 01 00 29 0A 01 00 +T B0 0E 00 00 6A 01 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T B6 0E 00 00 0E 00 DD 4E FC DD 46 FD 09 4D 44 +R 00 00 01 00 +T C1 0E 00 00 DD 5E FE DD 56 FF 13 13 3E +R 00 00 01 00 +T CA 0E 00 00 A3 00 00 00 21 A3 00 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T CF 0E 00 00 0C 0F 00 00 FD E5 D1 3E +R 00 00 01 00 00 04 01 00 +T D5 0E 00 00 04 07 00 00 21 04 07 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T DA 0E 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T DC 0E 00 00 +R 00 00 01 00 +T DC 0E 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T E1 0E 00 00 +R 00 00 01 00 +T E1 0E 00 00 01 05 00 09 4E 23 46 23 7E 69 60 +R 00 00 01 00 +T EC 0E 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T EF 0E 00 00 +R 00 00 01 00 +T EF 0E 00 00 DD 5E FE DD 56 FF 3E A3 00 00 00 +R 00 00 01 00 29 0B 01 00 +T F7 0E 00 00 21 A3 00 00 00 CD 00 00 00 00 FD +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T FE 0E 00 00 5E 20 FD 56 21 21 0A 00 ED 4B +R 00 00 01 00 +T 08 0F 00 00 00 00 00 00 09 C9 +R 00 00 01 00 00 04 04 00 +T 0C 0F 00 00 +R 00 00 01 00 +T 0C 0F 00 00 CD 00 00 00 00 FD 5E 20 FD 56 21 +R 00 00 01 00 02 05 0B 00 +T 15 0F 00 00 3E 39 02 00 00 21 39 02 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 1B 0F 00 00 00 00 00 00 C9 +R 00 00 01 00 02 04 0B 00 +T 1E 0F 00 00 +R 00 00 01 00 +T 1E 0F 00 00 DD 5E 0E DD 56 0F +R 00 00 01 00 +T 24 0F 00 00 +R 00 00 01 00 +T 24 0F 00 00 3E A5 03 00 00 21 A5 03 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 2A 0F 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 2C 0F 00 00 +R 00 00 01 00 +T 2C 0F 00 00 CD 00 00 00 00 CD 40 07 00 00 CD +R 00 00 01 00 02 05 0A 00 00 0A 01 00 +T 33 0F 00 00 D7 02 00 00 CD 00 00 00 00 01 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 39 0F 00 00 80 00 58 50 3E F4 01 00 00 21 +R 00 00 01 00 29 09 01 00 +T 40 0F 00 00 F4 01 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 46 0F 00 00 80 00 E5 6C E5 E5 CD EF 02 00 00 +R 00 00 01 00 00 0B 01 00 +T 4F 0F 00 00 E1 E1 E1 DD 5E 02 DD 56 03 3E +R 00 00 01 00 +T 59 0F 00 00 04 07 00 00 21 04 07 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 5E 0F 00 00 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 09 04 00 +T 63 0F 00 00 +R 00 00 01 00 +T 63 0F 00 00 CD 00 00 00 00 3E A6 06 00 00 21 +R 00 00 01 00 02 05 0A 00 29 0A 01 00 +T 69 0F 00 00 A6 06 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 6F 0F 00 00 00 00 00 00 +R 00 00 01 00 02 04 04 00 +T 71 0F 00 00 +R 00 00 01 00 +T 71 0F 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 7A 0F 00 00 0C DD 66 0D E5 DD 6E 0A DD 66 0B +R 00 00 01 00 +T 85 0F 00 00 E5 CD B5 0F 00 00 F1 F1 E5 FD E1 +R 00 00 01 00 00 06 01 00 +T 8E 0F 00 00 01 17 00 09 36 D2 0A 00 00 23 36 +R 00 00 01 00 09 09 01 00 +T 96 0F 00 00 D2 0A 00 00 23 36 D2 0A 00 00 FD +R 00 00 01 00 89 04 01 00 29 0A 01 00 +T 9B 0F 00 00 36 1A 9F 0D 00 00 FD 36 1B +R 00 00 01 00 09 06 01 00 +T A1 0F 00 00 9F 0D 00 00 FD 36 1C 9F 0D 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T A6 0F 00 00 FD 36 1D 63 0F 00 00 FD 36 1E +R 00 00 01 00 09 07 01 00 +T AD 0F 00 00 63 0F 00 00 FD 36 1F 63 0F 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T B2 0F 00 00 C3 51 06 00 00 +R 00 00 01 00 00 05 01 00 +T B5 0F 00 00 +R 00 00 01 00 +T B5 0F 00 00 DD 5E 02 DD 56 03 3E AF 05 00 00 +R 00 00 01 00 29 0B 01 00 +T BD 0F 00 00 21 AF 05 00 00 C3 00 00 00 00 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T C3 0F 00 00 +R 00 00 01 00 +T C3 0F 00 00 CD 00 00 00 00 FD E5 D5 FD E1 DD +R 00 00 01 00 02 05 0A 00 +T CC 0F 00 00 6E 0A DD 66 0B E5 3E D2 0A 00 00 +R 00 00 01 00 29 0B 01 00 +T D4 0F 00 00 21 D2 0A 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T DB 0F 00 00 3E 03 DD AE 04 DD B6 05 20 3E FD +R 00 00 01 00 +T E6 0F 00 00 4E 10 47 DD 6E 0A DD 66 0B ED 42 +R 00 00 01 00 +T F1 0F 00 00 20 30 FD 7E 0A E6 03 28 29 +R 00 00 01 00 +T FA 0F 00 00 +R 00 00 01 00 +T FA 0F 00 00 +R 00 00 01 00 +T FA 0F 00 00 +R 00 00 01 00 +T FA 0F 00 00 DD 6E 0A DD 66 0B E5 FD 5E 11 FD +R 00 00 01 00 +T 05 10 00 00 56 12 FD 6E 11 FD 66 12 0E 17 CD +R 00 00 01 00 +T 10 10 00 00 50 10 00 00 E1 FD CB 0A 66 28 0A +R 00 00 01 00 00 04 01 00 +T 19 10 00 00 +R 00 00 01 00 +T 19 10 00 00 FD 4E 10 06 00 C5 CD 5E 10 00 00 +R 00 00 01 00 00 0B 01 00 +T 22 10 00 00 E1 +R 00 00 01 00 +T 23 10 00 00 +R 00 00 01 00 +T 23 10 00 00 +R 00 00 01 00 +T 23 10 00 00 21 01 02 DD 4E 04 DD 46 05 A7 ED +R 00 00 01 00 +T 2E 10 00 00 42 20 0B +R 00 00 01 00 +T 31 10 00 00 +R 00 00 01 00 +T 31 10 00 00 DD 6E 0A DD 66 0B E5 CD +R 00 00 01 00 +T 39 10 00 00 41 10 00 00 E1 +R 00 00 01 00 00 04 01 00 +T 3C 10 00 00 +R 00 00 01 00 +T 3C 10 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 41 10 00 00 +R 00 00 01 00 +T 41 10 00 00 FD 5E 11 FD 56 12 FD 6E 11 FD 66 +R 00 00 01 00 +T 4C 10 00 00 12 01 17 00 +R 00 00 01 00 +T 50 10 00 00 +R 00 00 01 00 +T 50 10 00 00 09 4E 23 46 23 7E 69 60 01 01 02 +R 00 00 01 00 +T 5B 10 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T 5E 10 00 00 +R 00 00 01 00 +T 5E 10 00 00 FD 5E 11 FD 56 12 FD 6E 11 FD 66 +R 00 00 01 00 +T 69 10 00 00 12 0E 17 09 4E 23 46 23 7E 69 60 +R 00 00 01 00 +T 74 10 00 00 01 04 01 C3 00 00 00 00 +R 00 00 01 00 02 08 0B 00 +T 7A 10 00 00 +R 00 00 01 00 +T 7A 10 00 00 CD 00 00 00 00 FD E5 D5 FD E1 21 +R 00 00 01 00 02 05 0A 00 +T 83 10 00 00 0A 00 19 CB 76 FD 5E 20 FD 56 21 +R 00 00 01 00 +T 8E 10 00 00 21 0A 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T 97 10 00 00 23 66 6F 01 05 00 09 4E 23 46 23 +R 00 00 01 00 +T A2 10 00 00 7E 69 60 28 53 +R 00 00 01 00 +T A7 10 00 00 +R 00 00 01 00 +T A7 10 00 00 CD 00 00 00 00 29 4D 44 FD 6E 08 +R 00 00 01 00 02 05 0B 00 +T B0 10 00 00 FD 66 09 A7 ED 42 CD 27 11 00 00 +R 00 00 01 00 00 0B 01 00 +T B9 10 00 00 0E 0C 09 E5 FD 5E 20 FD 56 21 21 +R 00 00 01 00 +T C4 10 00 00 0A 00 ED 4B 00 00 00 00 09 7E 23 +R 00 00 01 00 00 08 04 00 +T CD 10 00 00 66 6F CD E7 03 00 00 C1 CD +R 00 00 01 00 00 07 01 00 +T D4 10 00 00 0C 0F 00 00 FD 5E 08 FD 56 09 CD +R 00 00 01 00 00 04 01 00 +T DD 10 00 00 28 11 00 00 0E 0A 09 E5 FD 5E 22 +R 00 00 01 00 00 04 01 00 +T E6 10 00 00 FD 56 23 69 60 CD DE 03 00 00 C1 +R 00 00 01 00 00 0A 01 00 +T EF 10 00 00 CD 00 00 00 00 FD 5E 22 FD 56 23 +R 00 00 01 00 02 05 0B 00 +T F8 10 00 00 18 20 +R 00 00 01 00 +T FA 10 00 00 +R 00 00 01 00 +T FA 10 00 00 CD 13 04 00 00 CD 27 11 00 00 0E +R 00 00 01 00 00 05 01 00 00 0A 01 00 +T 01 11 00 00 0D 09 E5 FD 5E 20 FD 56 21 21 +R 00 00 01 00 +T 0B 11 00 00 0A 00 CD DE 03 00 00 C1 CD +R 00 00 01 00 00 07 01 00 +T 12 11 00 00 00 00 00 00 FD 5E 20 FD 56 21 +R 00 00 01 00 02 04 0B 00 +T 1A 11 00 00 +R 00 00 01 00 +T 1A 11 00 00 3E 39 02 00 00 21 39 02 00 00 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 1F 11 00 00 +R 00 00 01 00 +T 1F 11 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T 22 11 00 00 +R 00 00 01 00 +T 22 11 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 27 11 00 00 +R 00 00 01 00 +T 27 11 00 00 EB +R 00 00 01 00 +T 28 11 00 00 +R 00 00 01 00 +T 28 11 00 00 01 02 00 CD 00 00 00 00 DD 6E 0A +R 00 00 01 00 02 08 11 00 +T 31 11 00 00 DD 66 0B 19 C9 +R 00 00 01 00 +T 36 11 00 00 +R 00 00 01 00 +T 36 11 00 00 C5 DD E5 F5 F5 D5 DD E1 21 02 00 +R 00 00 01 00 +T 41 11 00 00 39 AF 77 23 77 2B 2B 2B 77 23 77 +R 00 00 01 00 +T 4C 11 00 00 21 0A 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T 55 11 00 00 23 66 6F 46 23 66 68 E5 21 0E 00 +R 00 00 01 00 +T 60 11 00 00 19 4E 23 46 E1 A7 ED 42 28 03 +R 00 00 01 00 +T 6A 11 00 00 +R 00 00 01 00 +T 6A 11 00 00 CD 1E 0F 00 00 +R 00 00 01 00 00 05 01 00 +T 6D 11 00 00 +R 00 00 01 00 +T 6D 11 00 00 DD CB 0A 46 CA 06 12 00 00 +R 00 00 01 00 00 09 01 00 +T 74 11 00 00 +R 00 00 01 00 +T 74 11 00 00 21 00 00 39 E5 CD 85 0D 00 00 E1 +R 00 00 01 00 00 0A 01 00 +T 7D 11 00 00 21 00 00 39 CD 0E 12 00 00 CD +R 00 00 01 00 00 09 01 00 +T 85 11 00 00 00 00 00 00 DD 6E 08 DD 66 09 E5 +R 00 00 01 00 02 04 0B 00 +T 8E 11 00 00 DD 6E 06 DD 66 07 E5 21 04 00 39 +R 00 00 01 00 +T 99 11 00 00 4E 23 46 C5 23 4E 23 46 DD CB 0A +R 00 00 01 00 +T A4 11 00 00 4E 28 07 DD 5E 10 16 00 18 03 +R 00 00 01 00 +T AE 11 00 00 +R 00 00 01 00 +T AE 11 00 00 11 00 00 +R 00 00 01 00 +T B1 11 00 00 +R 00 00 01 00 +T B1 11 00 00 CD F2 02 00 00 E1 E1 E1 DD 7E 0A +R 00 00 01 00 00 05 01 00 +T BA 11 00 00 E6 82 28 1C DD 7E 0A E6 82 EE 82 +R 00 00 01 00 +T C5 11 00 00 28 13 +R 00 00 01 00 +T C7 11 00 00 +R 00 00 01 00 +T C7 11 00 00 +R 00 00 01 00 +T C7 11 00 00 +R 00 00 01 00 +T C7 11 00 00 DD 4E 08 DD 46 09 DD 5E 06 DD 56 +R 00 00 01 00 +T D2 11 00 00 07 3E AF 01 00 00 21 AF 01 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T D8 11 00 00 18 11 +R 00 00 01 00 +T DA 11 00 00 +R 00 00 01 00 +T DA 11 00 00 DD 4E 08 DD 46 09 DD 5E 06 DD 56 +R 00 00 01 00 +T E5 11 00 00 07 3E 25 01 00 00 21 25 01 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T EB 11 00 00 +R 00 00 01 00 +T EB 11 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T EE 11 00 00 +R 00 00 01 00 +T EE 11 00 00 21 00 00 39 4E 23 46 C5 23 4E 23 +R 00 00 01 00 +T F9 11 00 00 46 DD E5 D1 3E 7A 10 00 00 21 +R 00 00 01 00 29 09 01 00 +T 00 12 00 00 7A 10 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 06 12 00 00 +R 00 00 01 00 +T 06 12 00 00 E1 E1 DD E1 C1 C3 00 00 00 00 +R 00 00 01 00 02 0A 00 00 +T 0E 12 00 00 +R 00 00 01 00 +T 0E 12 00 00 4E 23 46 23 +R 00 00 01 00 +T 12 12 00 00 +R 00 00 01 00 +T 12 12 00 00 5E 23 56 3E A3 00 00 00 21 +R 00 00 01 00 29 08 01 00 +T 18 12 00 00 A3 00 00 00 CD 00 00 00 00 DD 4E +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 1F 12 00 00 08 DD 46 09 DD 5E 06 DD 56 07 3E +R 00 00 01 00 +T 2A 12 00 00 E2 00 00 00 21 E2 00 00 00 C9 +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 2F 12 00 00 +R 00 00 01 00 +T 2F 12 00 00 CD 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 0A 00 02 0A 04 00 +T 35 12 00 00 +R 00 00 01 00 +T 35 12 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 3E 12 00 00 0C DD 66 0D E5 DD 6E 0A DD 66 0B +R 00 00 01 00 +T 49 12 00 00 E5 CD B5 0F 00 00 F1 F1 E5 FD E1 +R 00 00 01 00 00 06 01 00 +T 52 12 00 00 01 0A 00 09 7E F6 03 77 DD 46 0E +R 00 00 01 00 +T 5D 12 00 00 FD 70 10 FD 36 17 C3 0F 00 00 FD +R 00 00 01 00 09 0A 01 00 +T 65 12 00 00 36 18 C3 0F 00 00 FD 36 19 +R 00 00 01 00 89 06 01 00 +T 6B 12 00 00 C3 0F 00 00 FD 36 1A 36 11 00 00 +R 00 00 01 00 29 04 01 00 09 0B 01 00 +T 70 12 00 00 FD 36 1B 36 11 00 00 FD 36 1C +R 00 00 01 00 89 07 01 00 +T 77 12 00 00 36 11 00 00 FD 36 1D 2F 12 00 00 +R 00 00 01 00 29 04 01 00 09 0B 01 00 +T 7C 12 00 00 FD 36 1E 2F 12 00 00 FD 36 1F +R 00 00 01 00 89 07 01 00 +T 83 12 00 00 2F 12 00 00 C3 51 06 00 00 +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 87 12 00 00 +R 00 00 01 00 +T 87 12 00 00 CD 00 00 00 00 FD E5 D5 FD E1 DD +R 00 00 01 00 02 05 0A 00 +T 90 12 00 00 6E 0A DD 66 0B E5 3E D2 0A 00 00 +R 00 00 01 00 29 0B 01 00 +T 98 12 00 00 21 D2 0A 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T 9F 12 00 00 3E 03 DD AE 04 DD B6 05 20 5C FD +R 00 00 01 00 +T AA 12 00 00 4E 10 47 DD 6E 0A DD 66 0B ED 42 +R 00 00 01 00 +T B5 12 00 00 20 4E FD 7E 0A E6 03 28 47 +R 00 00 01 00 +T BE 12 00 00 +R 00 00 01 00 +T BE 12 00 00 +R 00 00 01 00 +T BE 12 00 00 +R 00 00 01 00 +T BE 12 00 00 FD 7E 0A EE 04 FD 77 0A DD 6E 0A +R 00 00 01 00 +T C9 12 00 00 DD 66 0B E5 FD 5E 11 FD 56 12 FD +R 00 00 01 00 +T D4 12 00 00 6E 11 FD 66 12 0E 17 09 4E 23 46 +R 00 00 01 00 +T DF 12 00 00 23 7E 69 60 01 02 02 CD +R 00 00 01 00 +T E7 12 00 00 00 00 00 00 E1 21 00 00 E5 01 +R 00 00 01 00 02 04 0B 00 +T EF 12 00 00 03 01 CD 76 0D 00 00 E1 FD CB 0A +R 00 00 01 00 00 07 01 00 +T F8 12 00 00 66 28 0A +R 00 00 01 00 +T FB 12 00 00 +R 00 00 01 00 +T FB 12 00 00 FD 4E 10 06 00 C5 CD 5E 10 00 00 +R 00 00 01 00 00 0B 01 00 +T 04 13 00 00 E1 +R 00 00 01 00 +T 05 13 00 00 +R 00 00 01 00 +T 05 13 00 00 +R 00 00 01 00 +T 05 13 00 00 21 01 02 DD 4E 04 DD 46 05 A7 ED +R 00 00 01 00 +T 10 13 00 00 42 20 0B +R 00 00 01 00 +T 13 13 00 00 +R 00 00 01 00 +T 13 13 00 00 DD 6E 0A DD 66 0B E5 CD +R 00 00 01 00 +T 1B 13 00 00 41 10 00 00 E1 +R 00 00 01 00 00 04 01 00 +T 1E 13 00 00 +R 00 00 01 00 +T 1E 13 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 23 13 00 00 +R 00 00 01 00 +T 23 13 00 00 C5 DD E5 F5 F5 D5 DD E1 21 02 00 +R 00 00 01 00 +T 2E 13 00 00 39 AF 77 23 77 2B 2B 2B 77 23 77 +R 00 00 01 00 +T 39 13 00 00 21 0A 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T 42 13 00 00 23 66 6F 46 23 66 68 E5 21 0E 00 +R 00 00 01 00 +T 4D 13 00 00 19 4E 23 46 E1 A7 ED 42 28 03 +R 00 00 01 00 +T 57 13 00 00 +R 00 00 01 00 +T 57 13 00 00 CD 1E 0F 00 00 +R 00 00 01 00 00 05 01 00 +T 5A 13 00 00 +R 00 00 01 00 +T 5A 13 00 00 DD CB 0A 46 CA 0C 14 00 00 +R 00 00 01 00 00 09 01 00 +T 61 13 00 00 +R 00 00 01 00 +T 61 13 00 00 21 00 00 39 E5 CD 85 0D 00 00 E1 +R 00 00 01 00 00 0A 01 00 +T 6A 13 00 00 21 00 00 39 CD 0E 12 00 00 CD +R 00 00 01 00 00 09 01 00 +T 72 13 00 00 00 00 00 00 DD CB 0A 4E 28 36 DD +R 00 00 01 00 02 04 0B 00 +T 7B 13 00 00 CB 0A 56 28 30 +R 00 00 01 00 +T 80 13 00 00 +R 00 00 01 00 +T 80 13 00 00 +R 00 00 01 00 +T 80 13 00 00 +R 00 00 01 00 +T 80 13 00 00 DD 4E 08 DD 46 09 DD 5E 06 DD 56 +R 00 00 01 00 +T 8B 13 00 00 07 3E AF 01 00 00 21 AF 01 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 91 13 00 00 CD 00 00 00 00 DD 6E 08 DD 66 09 +R 00 00 01 00 02 05 0B 00 +T 9A 13 00 00 E5 DD 6E 06 DD 66 07 E5 21 04 00 +R 00 00 01 00 +T A5 13 00 00 39 4E 23 46 C5 23 4E 23 46 18 34 +R 00 00 01 00 +T B0 13 00 00 +R 00 00 01 00 +T B0 13 00 00 DD 4E 08 DD 46 09 DD 5E 06 DD 56 +R 00 00 01 00 +T BB 13 00 00 07 3E 25 01 00 00 21 25 01 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T C1 13 00 00 CD 00 00 00 00 DD 6E 08 DD 66 09 +R 00 00 01 00 02 05 0B 00 +T CA 13 00 00 E5 DD 6E 06 DD 66 07 E5 21 04 00 +R 00 00 01 00 +T D5 13 00 00 39 4E 23 46 C5 23 4E 23 46 DD CB +R 00 00 01 00 +T E0 13 00 00 0A 4E 28 07 +R 00 00 01 00 +T E4 13 00 00 +R 00 00 01 00 +T E4 13 00 00 DD 5E 10 16 00 18 03 +R 00 00 01 00 +T EB 13 00 00 +R 00 00 01 00 +T EB 13 00 00 11 00 00 +R 00 00 01 00 +T EE 13 00 00 +R 00 00 01 00 +T EE 13 00 00 CD F2 02 00 00 E1 E1 E1 +R 00 00 01 00 00 05 01 00 +T F4 13 00 00 +R 00 00 01 00 +T F4 13 00 00 21 00 00 39 4E 23 46 C5 23 4E 23 +R 00 00 01 00 +T FF 13 00 00 46 DD E5 D1 3E 7A 10 00 00 21 +R 00 00 01 00 29 09 01 00 +T 06 14 00 00 7A 10 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 0C 14 00 00 +R 00 00 01 00 +T 0C 14 00 00 C3 06 12 00 00 +R 00 00 01 00 00 05 01 00 +T 0F 14 00 00 +R 00 00 01 00 +T 0F 14 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 18 14 00 00 0C DD 66 0D E5 DD 6E 0A DD 66 0B +R 00 00 01 00 +T 23 14 00 00 E5 CD B5 0F 00 00 F1 F1 E5 FD E1 +R 00 00 01 00 00 06 01 00 +T 2C 14 00 00 01 0A 00 09 7E F6 07 77 DD 46 0E +R 00 00 01 00 +T 37 14 00 00 FD 70 10 FD 36 17 87 12 00 00 FD +R 00 00 01 00 09 0A 01 00 +T 3F 14 00 00 36 18 87 12 00 00 FD 36 19 +R 00 00 01 00 89 06 01 00 +T 45 14 00 00 87 12 00 00 FD 36 1A 23 13 00 00 +R 00 00 01 00 29 04 01 00 09 0B 01 00 +T 4A 14 00 00 FD 36 1B 23 13 00 00 FD 36 1C +R 00 00 01 00 89 07 01 00 +T 51 14 00 00 23 13 00 00 FD 36 1D 2F 12 00 00 +R 00 00 01 00 29 04 01 00 09 0B 01 00 +T 56 14 00 00 FD 36 1E 2F 12 00 00 FD 36 1F +R 00 00 01 00 89 07 01 00 +T 5D 14 00 00 2F 12 00 00 C3 51 06 00 00 +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 61 14 00 00 +R 00 00 01 00 +T 61 14 00 00 CD 00 00 00 00 FD E5 D5 FD E1 DD +R 00 00 01 00 02 05 0A 00 +T 6A 14 00 00 6E 0A DD 66 0B E5 3E D2 0A 00 00 +R 00 00 01 00 29 0B 01 00 +T 72 14 00 00 21 D2 0A 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T 79 14 00 00 21 01 02 DD 4E 04 DD 46 05 A7 ED +R 00 00 01 00 +T 84 14 00 00 42 20 40 3E FF DD AE 0A DD B6 0B +R 00 00 01 00 +T 8F 14 00 00 20 36 +R 00 00 01 00 +T 91 14 00 00 +R 00 00 01 00 +T 91 14 00 00 +R 00 00 01 00 +T 91 14 00 00 +R 00 00 01 00 +T 91 14 00 00 FD CB 0B 66 E5 28 05 +R 00 00 01 00 +T 98 14 00 00 +R 00 00 01 00 +T 98 14 00 00 01 05 01 18 03 +R 00 00 01 00 +T 9D 14 00 00 +R 00 00 01 00 +T 9D 14 00 00 01 02 01 +R 00 00 01 00 +T A0 14 00 00 +R 00 00 01 00 +T A0 14 00 00 CD 76 0D 00 00 E1 +R 00 00 01 00 00 05 01 00 +T A4 14 00 00 +R 00 00 01 00 +T A4 14 00 00 FD 4E 10 06 00 C5 FD 5E 11 FD 56 +R 00 00 01 00 +T AF 14 00 00 12 FD 6E 11 FD 66 12 0E 17 09 4E +R 00 00 01 00 +T BA 14 00 00 23 46 23 7E 69 60 01 01 03 CD +R 00 00 01 00 +T C4 14 00 00 00 00 00 00 E1 +R 00 00 01 00 02 04 0B 00 +T C7 14 00 00 +R 00 00 01 00 +T C7 14 00 00 21 01 02 DD 4E 04 DD 46 05 A7 ED +R 00 00 01 00 +T D2 14 00 00 42 20 40 3E FE DD AE 0A DD B6 0B +R 00 00 01 00 +T DD 14 00 00 20 36 +R 00 00 01 00 +T DF 14 00 00 +R 00 00 01 00 +T DF 14 00 00 +R 00 00 01 00 +T DF 14 00 00 +R 00 00 01 00 +T DF 14 00 00 FD CB 0B 66 E5 28 05 +R 00 00 01 00 +T E6 14 00 00 +R 00 00 01 00 +T E6 14 00 00 01 05 01 18 03 +R 00 00 01 00 +T EB 14 00 00 +R 00 00 01 00 +T EB 14 00 00 01 02 01 +R 00 00 01 00 +T EE 14 00 00 +R 00 00 01 00 +T EE 14 00 00 CD 76 0D 00 00 E1 +R 00 00 01 00 00 05 01 00 +T F2 14 00 00 +R 00 00 01 00 +T F2 14 00 00 FD 4E 10 06 00 C5 FD 5E 11 FD 56 +R 00 00 01 00 +T FD 14 00 00 12 FD 6E 11 FD 66 12 0E 17 09 4E +R 00 00 01 00 +T 08 15 00 00 23 46 23 7E 69 60 01 02 03 CD +R 00 00 01 00 +T 12 15 00 00 00 00 00 00 E1 +R 00 00 01 00 02 04 0B 00 +T 15 15 00 00 +R 00 00 01 00 +T 15 15 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 1A 15 00 00 +R 00 00 01 00 +T 1A 15 00 00 CD 00 00 00 00 FE FF FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T 23 15 00 00 0C DD 66 0D E5 DD 6E 0A DD 66 0B +R 00 00 01 00 +T 2E 15 00 00 E5 CD B5 0F 00 00 F1 F1 E5 FD E1 +R 00 00 01 00 00 06 01 00 +T 37 15 00 00 01 0A 00 09 CB C6 DD 46 0E FD 70 +R 00 00 01 00 +T 42 15 00 00 10 FD 36 17 61 14 00 00 FD 36 18 +R 00 00 01 00 09 08 01 00 +T 4A 15 00 00 61 14 00 00 FD 36 19 61 14 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T 4F 15 00 00 FD 36 1A 9F 0D 00 00 FD 36 1B +R 00 00 01 00 09 07 01 00 +T 56 15 00 00 9F 0D 00 00 FD 36 1C 9F 0D 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T 5B 15 00 00 FD 36 1D 63 0F 00 00 FD 36 1E +R 00 00 01 00 09 07 01 00 +T 62 15 00 00 63 0F 00 00 FD 36 1F 63 0F 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T 67 15 00 00 21 FF 00 E5 2E 14 E5 2E 28 E5 21 +R 00 00 01 00 +T 72 15 00 00 E4 FF CD CC 15 00 00 F1 F1 F1 DD +R 00 00 01 00 00 07 01 00 +T 7B 15 00 00 75 FE DD 74 FF 01 20 00 09 E5 11 +R 00 00 01 00 +T 86 15 00 00 03 00 CD 28 04 00 00 E1 71 23 70 +R 00 00 01 00 00 07 01 00 +T 8F 15 00 00 01 0A 00 00 00 CD E8 15 00 00 CD +R 00 00 01 00 00 05 02 00 00 0A 01 00 +T 96 15 00 00 00 00 00 00 21 FE 00 E5 2E 14 E5 +R 00 00 01 00 02 04 0B 00 +T 9F 15 00 00 2E 28 E5 21 C8 FF CD CC 15 00 00 +R 00 00 01 00 00 0B 01 00 +T A8 15 00 00 F1 F1 F1 DD 75 FE DD 74 FF 01 +R 00 00 01 00 +T B2 15 00 00 20 00 09 E5 11 07 00 CD +R 00 00 01 00 +T BA 15 00 00 28 04 00 00 E1 71 23 70 01 +R 00 00 01 00 00 04 01 00 +T C1 15 00 00 0D 00 00 00 CD E8 15 00 00 CD +R 00 00 01 00 00 04 02 00 00 09 01 00 +T C7 15 00 00 00 00 00 00 C3 51 06 00 00 +R 00 00 01 00 02 04 0B 00 00 09 01 00 +T CC 15 00 00 +R 00 00 01 00 +T CC 15 00 00 DD 4E 0C DD 46 0D 09 4D 44 21 +R 00 00 01 00 +T D6 15 00 00 D0 FF DD 5E 0A DD 56 0B 19 EB +R 00 00 01 00 +T E0 15 00 00 +R 00 00 01 00 +T E0 15 00 00 3E 35 12 00 00 21 35 12 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T E6 15 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T E8 15 00 00 +R 00 00 01 00 +T E8 15 00 00 DD 5E FE DD 56 FF 3E 59 06 00 00 +R 00 00 01 00 29 0B 01 00 +T F0 15 00 00 21 59 06 00 00 CD 00 00 00 00 DD +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T F7 15 00 00 4E FE DD 46 FF FD E5 D1 FD 7E 1F +R 00 00 01 00 +T 02 16 00 00 FD 6E 1D FD 66 1E C9 +R 00 00 01 00 +T 09 16 00 00 +R 00 00 01 00 +T 09 16 00 00 CD 00 00 00 00 FD E5 D5 FD E1 DD +R 00 00 01 00 02 05 0A 00 +T 12 16 00 00 6E 0A DD 66 0B E5 3E C3 0F 00 00 +R 00 00 01 00 29 0B 01 00 +T 1A 16 00 00 21 C3 0F 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T 21 16 00 00 21 03 02 DD 4E 04 DD 46 05 A7 ED +R 00 00 01 00 +T 2C 16 00 00 42 20 40 FD CB 0A 5E 28 3A +R 00 00 01 00 +T 35 16 00 00 +R 00 00 01 00 +T 35 16 00 00 +R 00 00 01 00 +T 35 16 00 00 +R 00 00 01 00 +T 35 16 00 00 3E 08 DD AE 0A DD B6 0B FD 5E 20 +R 00 00 01 00 +T 40 16 00 00 FD 56 21 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 06 00 +T 46 16 00 00 00 00 00 00 20 0D +R 00 00 01 00 02 04 06 00 +T 4A 16 00 00 +R 00 00 01 00 +T 4A 16 00 00 CD 22 04 00 00 28 15 +R 00 00 01 00 00 05 01 00 +T 4F 16 00 00 +R 00 00 01 00 +T 4F 16 00 00 CD 74 16 00 00 2B 36 00 +R 00 00 01 00 00 05 01 00 +T 55 16 00 00 +R 00 00 01 00 +T 55 16 00 00 18 0D +R 00 00 01 00 +T 57 16 00 00 +R 00 00 01 00 +T 57 16 00 00 CD 7F 16 00 00 23 36 00 CD +R 00 00 01 00 00 05 01 00 +T 5E 16 00 00 74 16 00 00 DD 46 0A 70 +R 00 00 01 00 00 04 01 00 +T 64 16 00 00 +R 00 00 01 00 +T 64 16 00 00 21 00 00 E5 01 03 01 CD +R 00 00 01 00 +T 6C 16 00 00 76 0D 00 00 E1 +R 00 00 01 00 00 04 01 00 +T 6F 16 00 00 +R 00 00 01 00 +T 6F 16 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 74 16 00 00 +R 00 00 01 00 +T 74 16 00 00 FD 5E 20 FD 56 21 3E 00 00 00 00 +R 00 00 01 00 2B 0B 06 00 +T 7C 16 00 00 21 00 00 00 00 +R 00 00 01 00 02 05 06 00 +T 7F 16 00 00 +R 00 00 01 00 +T 7F 16 00 00 CD 00 00 00 00 FD 4E 20 FD 46 21 +R 00 00 01 00 02 05 0B 00 +T 88 16 00 00 09 C9 +R 00 00 01 00 +T 8A 16 00 00 +R 00 00 01 00 +T 8A 16 00 00 C5 FD E5 DD E5 21 B8 FF 39 F9 D5 +R 00 00 01 00 +T 95 16 00 00 DD E1 AF 77 23 77 23 77 23 77 21 +R 00 00 01 00 +T A0 16 00 00 0A 00 ED 4B 00 00 00 00 09 7E 23 +R 00 00 01 00 00 08 04 00 +T A9 16 00 00 66 6F 46 23 66 68 E5 21 0E 00 19 +R 00 00 01 00 +T B4 16 00 00 4E 23 46 E1 A7 ED 42 28 03 +R 00 00 01 00 +T BD 16 00 00 +R 00 00 01 00 +T BD 16 00 00 CD 1E 0F 00 00 +R 00 00 01 00 00 05 01 00 +T C0 16 00 00 +R 00 00 01 00 +T C0 16 00 00 DD CB 0A 46 CA CE 17 00 00 +R 00 00 01 00 00 09 01 00 +T C7 16 00 00 +R 00 00 01 00 +T C7 16 00 00 21 02 00 39 E5 2B 2B CD +R 00 00 01 00 +T CF 16 00 00 87 0D 00 00 E1 21 02 00 39 4E 23 +R 00 00 01 00 00 04 01 00 +T D8 16 00 00 46 2B 2B 2B CD 12 12 00 00 CD +R 00 00 01 00 00 09 01 00 +T E0 16 00 00 00 00 00 00 DD 6E 08 DD 66 09 E5 +R 00 00 01 00 02 04 0B 00 +T E9 16 00 00 DD 6E 06 DD 66 07 E5 21 06 00 39 +R 00 00 01 00 +T F4 16 00 00 4E 23 46 C5 2B 2B 2B 4E 23 46 DD +R 00 00 01 00 +T FF 16 00 00 CB 0A 4E 28 07 DD 5E 10 16 00 18 +R 00 00 01 00 +T 0A 17 00 00 03 +R 00 00 01 00 +T 0B 17 00 00 +R 00 00 01 00 +T 0B 17 00 00 11 00 00 +R 00 00 01 00 +T 0E 17 00 00 +R 00 00 01 00 +T 0E 17 00 00 CD F2 02 00 00 E1 E1 E1 DD CB 0A +R 00 00 01 00 00 05 01 00 +T 17 17 00 00 7E DD 4E 08 DD 46 09 DD 5E 06 DD +R 00 00 01 00 +T 22 17 00 00 56 07 20 07 +R 00 00 01 00 +T 26 17 00 00 +R 00 00 01 00 +T 26 17 00 00 3E AF 01 00 00 21 AF 01 00 00 18 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 2C 17 00 00 05 +R 00 00 01 00 +T 2D 17 00 00 +R 00 00 01 00 +T 2D 17 00 00 3E 25 01 00 00 21 25 01 00 00 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 32 17 00 00 +R 00 00 01 00 +T 32 17 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T 35 17 00 00 +R 00 00 01 00 +T 35 17 00 00 DD 5E 20 DD 56 21 21 0A 00 ED 4B +R 00 00 01 00 +T 40 17 00 00 00 00 00 00 09 46 23 66 68 01 +R 00 00 01 00 00 04 04 00 +T 48 17 00 00 05 00 09 4E 23 46 23 7E 69 60 CD +R 00 00 01 00 +T 53 17 00 00 2D 04 00 00 DD 6E 08 DD 66 09 A7 +R 00 00 01 00 00 04 01 00 +T 5C 17 00 00 ED 42 EB 01 02 00 CD 00 00 00 00 +R 00 00 01 00 02 0B 11 00 +T 65 17 00 00 69 60 39 46 23 66 68 19 01 07 00 +R 00 00 01 00 +T 70 17 00 00 09 4D 44 21 00 00 39 5E 23 56 13 +R 00 00 01 00 +T 7B 17 00 00 13 3E A3 00 00 00 21 A3 00 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 81 17 00 00 CD 00 00 00 00 DD CB 0B 46 28 36 +R 00 00 01 00 02 05 0B 00 +T 8A 17 00 00 +R 00 00 01 00 +T 8A 17 00 00 FD 21 00 00 +R 00 00 01 00 +T 8E 17 00 00 +R 00 00 01 00 +T 8E 17 00 00 DD 5E 20 DD 56 21 3E 00 00 00 00 +R 00 00 01 00 2B 0B 06 00 +T 96 17 00 00 21 00 00 00 00 CD 2D 04 00 00 FD +R 00 00 01 00 02 05 06 00 00 0A 01 00 +T 9D 17 00 00 E5 E1 A7 ED 42 21 06 00 30 0B +R 00 00 01 00 +T A7 17 00 00 +R 00 00 01 00 +T A7 17 00 00 39 FD E5 C1 09 36 2A FD 23 18 DC +R 00 00 01 00 +T B2 17 00 00 +R 00 00 01 00 +T B2 17 00 00 39 FD E5 C1 09 36 00 21 06 00 39 +R 00 00 01 00 +T BD 17 00 00 EB 18 06 +R 00 00 01 00 +T C0 17 00 00 +R 00 00 01 00 +T C0 17 00 00 DD 5E 20 DD 56 21 +R 00 00 01 00 +T C6 17 00 00 +R 00 00 01 00 +T C6 17 00 00 3E 39 02 00 00 21 39 02 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T CC 17 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T CE 17 00 00 +R 00 00 01 00 +T CE 17 00 00 +R 00 00 01 00 +T CE 17 00 00 21 48 00 39 F9 C3 5E 02 00 00 +R 00 00 01 00 00 0A 01 00 +T D6 17 00 00 +R 00 00 01 00 +T D6 17 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T DF 17 00 00 0E DD 66 0F E5 DD 6E 0C DD 66 0D +R 00 00 01 00 +T EA 17 00 00 E5 DD 6E 0A DD 66 0B E5 DD 5E 02 +R 00 00 01 00 +T F5 17 00 00 DD 56 03 CD E0 15 00 00 F1 F1 F1 +R 00 00 01 00 00 08 01 00 +T FE 17 00 00 E5 FD E1 01 0A 00 09 CB DE 01 +R 00 00 01 00 +T 08 18 00 00 14 00 00 00 FD E5 D1 3E +R 00 00 01 00 00 04 02 00 +T 0E 18 00 00 59 06 00 00 21 59 06 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 13 18 00 00 00 00 00 00 FD 36 1A 8A 16 00 00 +R 00 00 01 00 02 04 0B 00 09 0B 01 00 +T 19 18 00 00 FD 36 1B 8A 16 00 00 FD 36 1C +R 00 00 01 00 89 07 01 00 +T 20 18 00 00 8A 16 00 00 FD 36 17 09 16 00 00 +R 00 00 01 00 29 04 01 00 09 0B 01 00 +T 25 18 00 00 FD 36 18 09 16 00 00 FD 36 19 +R 00 00 01 00 89 07 01 00 +T 2C 18 00 00 09 16 00 00 C3 51 06 00 00 +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 30 18 00 00 +R 00 00 01 00 +T 30 18 00 00 CD 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 0A 00 02 0A 04 00 +T 36 18 00 00 +R 00 00 01 00 +T 36 18 00 00 C5 DD E5 F5 F5 D5 DD E1 21 02 00 +R 00 00 01 00 +T 41 18 00 00 39 AF 77 23 77 2B 2B 2B 77 23 77 +R 00 00 01 00 +T 4C 18 00 00 21 0A 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T 55 18 00 00 23 66 6F 46 23 66 68 E5 21 0E 00 +R 00 00 01 00 +T 60 18 00 00 19 4E 23 46 E1 A7 ED 42 28 03 +R 00 00 01 00 +T 6A 18 00 00 +R 00 00 01 00 +T 6A 18 00 00 CD 1E 0F 00 00 +R 00 00 01 00 00 05 01 00 +T 6D 18 00 00 +R 00 00 01 00 +T 6D 18 00 00 DD CB 0A 46 28 21 +R 00 00 01 00 +T 73 18 00 00 +R 00 00 01 00 +T 73 18 00 00 21 00 00 39 E5 CD 85 0D 00 00 E1 +R 00 00 01 00 00 0A 01 00 +T 7C 18 00 00 21 00 00 39 4E 23 46 C5 23 4E 23 +R 00 00 01 00 +T 87 18 00 00 46 DD E5 D1 3E 7A 10 00 00 21 +R 00 00 01 00 29 09 01 00 +T 8E 18 00 00 7A 10 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 94 18 00 00 +R 00 00 01 00 +T 94 18 00 00 C3 06 12 00 00 +R 00 00 01 00 00 05 01 00 +T 97 18 00 00 +R 00 00 01 00 +T 97 18 00 00 CD 00 00 00 00 00 00 FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T A0 18 00 00 0C DD 66 0D E5 DD 6E 0A DD 66 0B +R 00 00 01 00 +T AB 18 00 00 E5 CD B5 0F 00 00 F1 F1 E5 FD E1 +R 00 00 01 00 00 06 01 00 +T B4 18 00 00 01 20 00 09 DD 4E 0E 71 DD 46 0F +R 00 00 01 00 +T BF 18 00 00 23 70 FD 36 0A 01 FD 36 0B 00 FD +R 00 00 01 00 +T CA 18 00 00 36 17 30 18 00 00 FD 36 18 +R 00 00 01 00 09 06 01 00 +T D0 18 00 00 30 18 00 00 FD 36 19 30 18 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T D5 18 00 00 FD 36 1A 36 18 00 00 FD 36 1B +R 00 00 01 00 09 07 01 00 +T DC 18 00 00 36 18 00 00 FD 36 1C 36 18 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T E1 18 00 00 FD 36 1D 2F 12 00 00 FD 36 1E +R 00 00 01 00 09 07 01 00 +T E8 18 00 00 2F 12 00 00 FD 36 1F 2F 12 00 00 +R 00 00 01 00 89 04 01 00 29 0B 01 00 +T ED 18 00 00 C3 51 06 00 00 +R 00 00 01 00 00 05 01 00 +T F0 18 00 00 +R 00 00 01 00 +T F0 18 00 00 CD 00 00 00 00 00 00 DD 6E 0A DD +R 00 00 01 00 02 05 0E 00 +T F9 18 00 00 66 0B E5 DD 5E 02 DD 56 03 3E +R 00 00 01 00 +T 03 19 00 00 D2 0A 00 00 21 D2 0A 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 08 19 00 00 00 00 00 00 E1 C3 00 00 00 00 +R 00 00 01 00 02 04 0B 00 02 0A 04 00 +T 0E 19 00 00 +R 00 00 01 00 +T 0E 19 00 00 CD 00 00 00 00 CE FF FD E5 DD 36 +R 00 00 01 00 02 05 0E 00 +T 17 19 00 00 D8 00 21 00 00 E5 C5 3E +R 00 00 01 00 +T 1F 19 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 10 00 02 09 10 00 +T 24 19 00 00 00 00 00 00 F1 F1 DD 75 D4 DD 74 +R 00 00 01 00 02 04 0B 00 +T 2D 19 00 00 D5 DD 36 F0 2B DD 36 F1 00 DD 36 +R 00 00 01 00 +T 38 19 00 00 F2 1A DD 36 F3 00 +R 00 00 01 00 +T 3E 19 00 00 +R 00 00 01 00 +T 3E 19 00 00 DD 36 F4 00 DD 7E D8 FE 73 20 18 +R 00 00 01 00 +T 49 19 00 00 +R 00 00 01 00 +T 49 19 00 00 DD 6E D9 DD 66 DA DD 75 F0 DD 74 +R 00 00 01 00 +T 54 19 00 00 F1 DD 6E DB DD 66 DC DD 75 F2 DD +R 00 00 01 00 +T 5F 19 00 00 74 F3 +R 00 00 01 00 +T 61 19 00 00 +R 00 00 01 00 +T 61 19 00 00 DD 7E D8 FE 42 28 07 DD 7E D8 FE +R 00 00 01 00 +T 6C 19 00 00 4D 20 4F +R 00 00 01 00 +T 6F 19 00 00 +R 00 00 01 00 +T 6F 19 00 00 +R 00 00 01 00 +T 6F 19 00 00 +R 00 00 01 00 +T 6F 19 00 00 DD 4E DD 06 00 C5 CD D8 1C 00 00 +R 00 00 01 00 00 0B 01 00 +T 78 19 00 00 D5 DD 4E DB DD 5E F0 DD 56 F1 CD +R 00 00 01 00 +T 83 19 00 00 E1 1C 00 00 D5 DD 4E DA DD 5E F2 +R 00 00 01 00 00 04 01 00 +T 8C 19 00 00 DD 56 F3 CD 00 00 00 00 D5 DD 5E +R 00 00 01 00 02 08 03 00 +T 95 19 00 00 D9 50 DD 4E F0 DD 46 F1 CD +R 00 00 01 00 +T 9E 19 00 00 00 00 00 00 3E 35 12 00 00 21 +R 00 00 01 00 02 04 03 00 29 09 01 00 +T A3 19 00 00 35 12 00 00 C1 CD 00 00 00 00 F1 +R 00 00 01 00 00 04 01 00 02 0A 0B 00 +T AA 19 00 00 F1 F1 E5 FD E1 DD 7E D8 FE 4D 20 +R 00 00 01 00 +T B5 19 00 00 04 +R 00 00 01 00 +T B6 19 00 00 +R 00 00 01 00 +T B6 19 00 00 FD CB 0A F6 +R 00 00 01 00 +T BA 19 00 00 +R 00 00 01 00 +T BA 19 00 00 DD 36 F4 01 +R 00 00 01 00 +T BE 19 00 00 +R 00 00 01 00 +T BE 19 00 00 DD 7E D8 FE 54 20 44 +R 00 00 01 00 +T C5 19 00 00 +R 00 00 01 00 +T C5 19 00 00 DD 4E DD 06 00 C5 CD D8 1C 00 00 +R 00 00 01 00 00 0B 01 00 +T CE 19 00 00 D5 DD 4E DB DD 5E F0 DD 56 F1 CD +R 00 00 01 00 +T D9 19 00 00 E1 1C 00 00 D5 DD 4E DA DD 5E F2 +R 00 00 01 00 00 04 01 00 +T E2 19 00 00 DD 56 F3 CD 00 00 00 00 D5 DD 5E +R 00 00 01 00 02 08 03 00 +T EB 19 00 00 D9 50 DD 4E F0 DD 46 F1 CD +R 00 00 01 00 +T F4 19 00 00 00 00 00 00 3E 0F 14 00 00 21 +R 00 00 01 00 02 04 03 00 29 09 01 00 +T F9 19 00 00 0F 14 00 00 C1 CD 00 00 00 00 F1 +R 00 00 01 00 00 04 01 00 02 0A 0B 00 +T 00 1A 00 00 F1 F1 E5 FD E1 DD 36 F4 01 +R 00 00 01 00 +T 09 1A 00 00 +R 00 00 01 00 +T 09 1A 00 00 DD 7E D8 FE 44 20 44 +R 00 00 01 00 +T 10 1A 00 00 +R 00 00 01 00 +T 10 1A 00 00 DD 4E DD 06 00 C5 CD D8 1C 00 00 +R 00 00 01 00 00 0B 01 00 +T 19 1A 00 00 D5 DD 4E DB DD 5E F0 DD 56 F1 CD +R 00 00 01 00 +T 24 1A 00 00 E1 1C 00 00 D5 DD 4E DA DD 5E F2 +R 00 00 01 00 00 04 01 00 +T 2D 1A 00 00 DD 56 F3 CD 00 00 00 00 D5 DD 5E +R 00 00 01 00 02 08 03 00 +T 36 1A 00 00 D9 50 DD 4E F0 DD 46 F1 CD +R 00 00 01 00 +T 3F 1A 00 00 00 00 00 00 3E D6 17 00 00 21 +R 00 00 01 00 02 04 03 00 29 09 01 00 +T 44 1A 00 00 D6 17 00 00 C1 CD 00 00 00 00 F1 +R 00 00 01 00 00 04 01 00 02 0A 0B 00 +T 4B 1A 00 00 F1 F1 E5 FD E1 DD 36 F4 01 +R 00 00 01 00 +T 54 1A 00 00 +R 00 00 01 00 +T 54 1A 00 00 DD 7E D8 FE 4C 20 47 +R 00 00 01 00 +T 5B 1A 00 00 +R 00 00 01 00 +T 5B 1A 00 00 21 0C 00 39 01 12 00 09 E5 CD +R 00 00 01 00 +T 65 1A 00 00 D8 1C 00 00 D5 DD 4E DB DD 5E F0 +R 00 00 01 00 00 04 01 00 +T 6E 1A 00 00 DD 56 F1 CD E1 1C 00 00 D5 DD 4E +R 00 00 01 00 00 08 01 00 +T 77 1A 00 00 DA DD 5E F2 DD 56 F3 CD +R 00 00 01 00 +T 7F 1A 00 00 00 00 00 00 D5 DD 5E D9 50 DD 4E +R 00 00 01 00 02 04 03 00 +T 88 1A 00 00 F0 DD 46 F1 CD 00 00 00 00 3E +R 00 00 01 00 02 09 03 00 +T 90 1A 00 00 97 18 00 00 21 97 18 00 00 C1 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 96 1A 00 00 00 00 00 00 F1 F1 F1 E5 FD E1 DD +R 00 00 01 00 02 04 0B 00 +T 9F 1A 00 00 36 F4 01 +R 00 00 01 00 +T A2 1A 00 00 +R 00 00 01 00 +T A2 1A 00 00 DD 7E D8 FE 41 20 51 +R 00 00 01 00 +T A9 1A 00 00 +R 00 00 01 00 +T A9 1A 00 00 21 26 00 DD 4E 02 DD 46 03 09 E5 +R 00 00 01 00 +T B4 1A 00 00 21 2B 00 39 EB E1 73 23 72 DD 6E +R 00 00 01 00 +T BF 1A 00 00 DE DD 66 DF DD 75 F8 DD 74 F9 DD +R 00 00 01 00 +T CA 1A 00 00 6E E0 DD 66 E1 DD 75 FA DD 74 FB +R 00 00 01 00 +T D5 1A 00 00 21 16 00 39 4E 23 46 23 5E 23 56 +R 00 00 01 00 +T E0 1A 00 00 DD 71 FC DD 70 FD DD 73 FE DD 72 +R 00 00 01 00 +T EB 1A 00 00 FF DD 5E 02 DD 56 03 3E +R 00 00 01 00 +T F3 1A 00 00 E8 1C 00 00 21 E8 1C 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T F8 1A 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T FA 1A 00 00 +R 00 00 01 00 +T FA 1A 00 00 DD 7E D8 FE 53 20 71 +R 00 00 01 00 +T 01 1B 00 00 +R 00 00 01 00 +T 01 1B 00 00 21 0C 00 39 4D 44 DD 5E D4 DD 56 +R 00 00 01 00 +T 0C 1B 00 00 D5 3E 20 20 00 00 21 20 20 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 12 1B 00 00 CD 00 00 00 00 21 26 00 DD 4E 02 +R 00 00 01 00 02 05 0B 00 +T 1B 1B 00 00 DD 46 03 09 E5 11 04 00 CD +R 00 00 01 00 +T 24 1B 00 00 D0 1C 00 00 EB E1 73 23 72 21 +R 00 00 01 00 00 04 01 00 +T 2C 1B 00 00 26 00 09 56 DD 72 F5 23 66 DD 74 +R 00 00 01 00 +T 37 1B 00 00 F6 21 24 00 09 36 04 23 36 00 6A +R 00 00 01 00 +T 42 1B 00 00 DD 66 F6 23 23 E5 21 08 00 ED 4B +R 00 00 01 00 +T 4D 1B 00 00 00 00 00 00 09 5E 23 56 E1 73 23 +R 00 00 01 00 00 04 04 00 +T 56 1B 00 00 72 21 06 00 ED 4B 00 00 00 00 09 +R 00 00 01 00 00 0A 04 00 +T 5F 1B 00 00 46 23 66 68 E5 DD 6E F5 DD 66 F6 +R 00 00 01 00 +T 6A 1B 00 00 C1 71 23 70 DD 36 F4 00 +R 00 00 01 00 +T 72 1B 00 00 +R 00 00 01 00 +T 72 1B 00 00 AF DD B6 F4 CA 72 1C 00 00 +R 00 00 01 00 00 09 01 00 +T 79 1B 00 00 +R 00 00 01 00 +T 79 1B 00 00 DD 7E DE DD B6 DF 28 69 +R 00 00 01 00 +T 81 1B 00 00 +R 00 00 01 00 +T 81 1B 00 00 FD CB 0A EE FD 36 24 0B FD 36 25 +R 00 00 01 00 +T 8C 1B 00 00 00 11 0B 00 CD D0 1C 00 00 FD 75 +R 00 00 01 00 00 09 01 00 +T 95 1B 00 00 26 FD 74 27 FD 6E 26 DD 75 D0 FD +R 00 00 01 00 +T A0 1B 00 00 66 27 DD 74 D1 36 E8 1C 00 00 23 +R 00 00 01 00 09 0A 01 00 +T A8 1B 00 00 36 E8 1C 00 00 23 36 E8 1C 00 00 +R 00 00 01 00 89 05 01 00 29 0B 01 00 +T AD 1B 00 00 DD 6E D0 DD 66 D1 23 23 23 DD 4E +R 00 00 01 00 +T B8 1B 00 00 DE 71 DD 46 DF 23 70 21 05 00 DD +R 00 00 01 00 +T C3 1B 00 00 4E D0 DD 46 D1 09 DD 5E E0 73 DD +R 00 00 01 00 +T CE 1B 00 00 56 E1 23 72 21 07 00 09 E5 21 +R 00 00 01 00 +T D8 1B 00 00 18 00 39 5E 23 56 23 4E 23 46 E1 +R 00 00 01 00 +T E3 1B 00 00 73 23 72 23 71 23 70 +R 00 00 01 00 +T EA 1B 00 00 +R 00 00 01 00 +T EA 1B 00 00 DD 7E E6 DD B6 E7 28 0C +R 00 00 01 00 +T F2 1B 00 00 +R 00 00 01 00 +T F2 1B 00 00 DD 6E E6 FD 75 0A DD 66 E7 FD 74 +R 00 00 01 00 +T FD 1B 00 00 0B +R 00 00 01 00 +T FE 1B 00 00 +R 00 00 01 00 +T FE 1B 00 00 DD 6E E8 FD 75 0E DD 66 E9 FD 74 +R 00 00 01 00 +T 09 1C 00 00 0F DD 6E EA FD 75 20 DD 7E EB E6 +R 00 00 01 00 +T 14 1C 00 00 0F FD 77 21 FD 7E 20 FD B6 21 20 +R 00 00 01 00 +T 1F 1C 00 00 16 +R 00 00 01 00 +T 20 1C 00 00 +R 00 00 01 00 +T 20 1C 00 00 11 14 00 CD D0 1C 00 00 FD 75 20 +R 00 00 01 00 00 08 01 00 +T 29 1C 00 00 FD 74 21 FD 6E 20 FD 66 21 36 00 +R 00 00 01 00 +T 34 1C 00 00 18 04 +R 00 00 01 00 +T 36 1C 00 00 +R 00 00 01 00 +T 36 1C 00 00 FD CB 0B F6 +R 00 00 01 00 +T 3A 1C 00 00 +R 00 00 01 00 +T 3A 1C 00 00 DD 7E EB 2E 00 4D E6 F0 47 26 10 +R 00 00 01 00 +T 45 1C 00 00 ED 42 30 10 +R 00 00 01 00 +T 49 1C 00 00 +R 00 00 01 00 +T 49 1C 00 00 DD 6E EA DD 7E EB E6 0F 67 23 FD +R 00 00 01 00 +T 54 1C 00 00 75 22 FD 74 23 +R 00 00 01 00 +T 59 1C 00 00 +R 00 00 01 00 +T 59 1C 00 00 FD E5 DD 5E 02 4B DD 56 03 42 21 +R 00 00 01 00 +T 64 1C 00 00 1D 00 09 4E 23 46 23 7E 69 60 C1 +R 00 00 01 00 +T 6F 1C 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 0B 00 +T 72 1C 00 00 +R 00 00 01 00 +T 72 1C 00 00 21 14 00 E5 2E 0E 39 4D 44 DD 5E +R 00 00 01 00 +T 7D 1C 00 00 D4 DD 56 D5 CD C8 1C 00 00 F1 3E +R 00 00 01 00 00 09 01 00 +T 86 1C 00 00 14 AD B4 CA 3E 19 00 00 +R 00 00 01 00 00 08 01 00 +T 8C 1C 00 00 +R 00 00 01 00 +T 8C 1C 00 00 DD 5E D4 DD 56 D5 3E 00 00 00 00 +R 00 00 01 00 2B 0B 05 00 +T 94 1C 00 00 21 00 00 00 00 CD 00 00 00 00 DD +R 00 00 01 00 02 05 05 00 02 0A 0B 00 +T 9B 1C 00 00 5E 02 DD 56 03 3E 1F 0A 00 00 21 +R 00 00 01 00 29 0A 01 00 +T A3 1C 00 00 1F 0A 00 00 CD 00 00 00 00 DD 5E +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T AA 1C 00 00 02 4B DD 56 03 42 21 1A 00 09 4E +R 00 00 01 00 +T B5 1C 00 00 23 46 23 7E 69 60 C3 1F 11 00 00 +R 00 00 01 00 00 0B 01 00 +T BE 1C 00 00 +R 00 00 01 00 +T BE 1C 00 00 4D 44 2A 00 00 00 00 23 23 5E 23 +R 00 00 01 00 00 07 04 00 +T C7 1C 00 00 56 +R 00 00 01 00 +T C8 1C 00 00 +R 00 00 01 00 +T C8 1C 00 00 3E 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 05 15 00 02 0A 15 00 +T CE 1C 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T D0 1C 00 00 +R 00 00 01 00 +T D0 1C 00 00 3E 00 00 00 00 21 00 00 00 00 C3 +R 00 00 01 00 2B 05 14 00 02 0A 14 00 +T D6 1C 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T D8 1C 00 00 +R 00 00 01 00 +T D8 1C 00 00 DD 4E DC DD 5E F2 DD 56 F3 +R 00 00 01 00 +T E1 1C 00 00 +R 00 00 01 00 +T E1 1C 00 00 CD 00 00 00 00 1B 1B 1B C9 +R 00 00 01 00 02 05 03 00 +T E8 1C 00 00 +R 00 00 01 00 +T E8 1C 00 00 CD 00 00 00 00 EA FF FD E5 DD 6E +R 00 00 01 00 02 05 0E 00 +T F1 1C 00 00 02 DD 66 03 E5 FD E1 21 06 00 39 +R 00 00 01 00 +T FC 1C 00 00 EB 21 26 00 00 00 01 0E 00 ED B0 +R 00 00 01 00 00 06 03 00 +T 05 1D 00 00 FD 6E 26 DD 75 EA FD 66 27 DD 74 +R 00 00 01 00 +T 10 1D 00 00 EB 23 23 23 3E 01 AE 23 B6 20 08 +R 00 00 01 00 +T 1B 1D 00 00 +R 00 00 01 00 +T 1B 1D 00 00 C5 01 01 04 CD 76 0D 00 00 E1 +R 00 00 01 00 00 09 01 00 +T 23 1D 00 00 +R 00 00 01 00 +T 23 1D 00 00 DD 6E EA DD 66 EB 23 23 23 46 23 +R 00 00 01 00 +T 2E 1D 00 00 66 68 CB 85 3E 02 AD B4 C2 +R 00 00 01 00 +T 37 1D 00 00 53 1E 00 00 +R 00 00 01 00 00 04 01 00 +T 39 1D 00 00 +R 00 00 01 00 +T 39 1D 00 00 6F 67 E5 E5 01 01 00 FD 5E 11 FD +R 00 00 01 00 +T 44 1D 00 00 56 12 3E B6 09 00 00 21 +R 00 00 01 00 29 07 01 00 +T 49 1D 00 00 B6 09 00 00 CD 00 00 00 00 E1 E1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 50 1D 00 00 FD 6E 11 FD 66 12 01 08 00 09 4E +R 00 00 01 00 +T 5B 1D 00 00 23 46 C5 FD 6E 11 FD 66 12 01 +R 00 00 01 00 +T 65 1D 00 00 06 00 09 4E 23 46 C5 01 00 00 59 +R 00 00 01 00 +T 70 1D 00 00 50 3E 71 0F 00 00 21 71 0F 00 00 +R 00 00 01 00 29 06 01 00 00 0B 01 00 +T 76 1D 00 00 CD 00 00 00 00 F1 F1 DD 75 EC DD +R 00 00 01 00 02 05 0B 00 +T 7F 1D 00 00 74 ED 01 0A 00 09 36 03 23 70 DD +R 00 00 01 00 +T 8A 1D 00 00 6E EA DD 66 EB 23 23 23 CB 46 28 +R 00 00 01 00 +T 95 1D 00 00 0C +R 00 00 01 00 +T 96 1D 00 00 +R 00 00 01 00 +T 96 1D 00 00 69 60 DD 4E EC DD 46 ED 09 23 CB +R 00 00 01 00 +T A1 1D 00 00 EE +R 00 00 01 00 +T A2 1D 00 00 +R 00 00 01 00 +T A2 1D 00 00 21 17 00 DD 4E EC DD 46 ED 09 36 +R 00 00 01 00 +T AD 1D 00 00 F0 18 00 00 23 36 F0 18 00 00 23 +R 00 00 01 00 09 04 01 00 89 0A 01 00 +T B2 1D 00 00 36 F0 18 00 00 21 1A 00 09 36 +R 00 00 01 00 29 05 01 00 +T B9 1D 00 00 2C 0F 00 00 23 36 2C 0F 00 00 23 +R 00 00 01 00 09 04 01 00 89 0A 01 00 +T BE 1D 00 00 36 2C 0F 00 00 21 07 00 DD 5E EA +R 00 00 01 00 29 05 01 00 +T C6 1D 00 00 DD 56 EB 19 5E EB DD 75 F3 21 +R 00 00 01 00 +T D0 1D 00 00 07 00 DD 4E EA DD 46 EB 09 5E 23 +R 00 00 01 00 +T DB 1D 00 00 56 23 4E 23 46 EB 3E 08 CD +R 00 00 01 00 +T E4 1D 00 00 00 00 00 00 DD 75 F4 21 07 00 DD +R 00 00 01 00 02 04 13 00 +T ED 1D 00 00 4E EA DD 46 EB 09 5E 23 56 23 4E +R 00 00 01 00 +T F8 1D 00 00 23 46 EB 3E 10 CD 00 00 00 00 DD +R 00 00 01 00 02 0A 13 00 +T 01 1E 00 00 75 F5 21 07 00 DD 4E EA DD 46 EB +R 00 00 01 00 +T 0C 1E 00 00 09 5E 23 56 23 4E 23 46 EB 3E 18 +R 00 00 01 00 +T 17 1E 00 00 CD 00 00 00 00 DD 75 F6 21 06 00 +R 00 00 01 00 02 05 13 00 +T 20 1E 00 00 39 4D 44 DD 5E EC DD 56 ED 3E +R 00 00 01 00 +T 2A 1E 00 00 0E 19 00 00 21 0E 19 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 2F 1E 00 00 00 00 00 00 DD 4E EC DD 46 ED C5 +R 00 00 01 00 02 04 0B 00 +T 38 1E 00 00 FD 5E 11 FD 56 12 FD 6E 11 FD 66 +R 00 00 01 00 +T 43 1E 00 00 12 01 1D 00 09 4E 23 46 23 7E 69 +R 00 00 01 00 +T 4E 1E 00 00 60 C1 CD 00 00 00 00 +R 00 00 01 00 02 07 0B 00 +T 53 1E 00 00 +R 00 00 01 00 +T 53 1E 00 00 DD 6E EA DD 66 EB 23 23 23 3E 04 +R 00 00 01 00 +T 5E 1E 00 00 AE 23 B6 C2 F1 1F 00 00 +R 00 00 01 00 00 08 01 00 +T 64 1E 00 00 +R 00 00 01 00 +T 64 1E 00 00 21 01 00 E5 FD 6E 11 FD 66 12 01 +R 00 00 01 00 +T 6F 1E 00 00 08 00 09 46 23 66 68 01 F6 FF 09 +R 00 00 01 00 +T 7A 1E 00 00 E5 FD 6E 11 FD 66 12 01 06 00 09 +R 00 00 01 00 +T 85 1E 00 00 46 23 66 68 01 F6 FF 09 E5 01 +R 00 00 01 00 +T 8F 1E 00 00 05 00 59 50 3E 1A 15 00 00 21 +R 00 00 01 00 29 09 01 00 +T 96 1E 00 00 1A 15 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 9D 1E 00 00 F1 DD 75 EC DD 74 ED 01 0A 00 09 +R 00 00 01 00 +T A8 1E 00 00 36 03 23 36 10 21 0E 00 DD 4E EC +R 00 00 01 00 +T B3 1E 00 00 DD 46 ED 09 36 30 23 36 00 AF DD +R 00 00 01 00 +T BE 1E 00 00 77 FE DD 77 FF +R 00 00 01 00 +T C3 1E 00 00 +R 00 00 01 00 +T C3 1E 00 00 21 05 00 DD 4E EA DD 46 EB 09 5E +R 00 00 01 00 +T CE 1E 00 00 23 56 06 0C CD 00 00 00 00 4B 42 +R 00 00 01 00 02 09 16 00 +T D7 1E 00 00 DD 6E FE DD 66 FF CD 00 00 00 00 +R 00 00 01 00 02 0B 0F 00 +T E0 1E 00 00 30 04 3E 01 18 01 +R 00 00 01 00 +T E6 1E 00 00 +R 00 00 01 00 +T E6 1E 00 00 AF +R 00 00 01 00 +T E7 1E 00 00 +R 00 00 01 00 +T E7 1E 00 00 E6 0F CA 85 1F 00 00 +R 00 00 01 00 00 07 01 00 +T EC 1E 00 00 +R 00 00 01 00 +T EC 1E 00 00 21 05 00 DD 4E EA DD 46 EB 09 46 +R 00 00 01 00 +T F7 1E 00 00 23 7E 68 E6 0F 67 DD 4E FE DD 46 +R 00 00 01 00 +T 02 1F 00 00 FF 09 29 E5 21 08 00 ED 5B +R 00 00 01 00 +T 0B 1F 00 00 00 00 00 00 19 5E 23 56 E1 19 2B +R 00 00 01 00 00 04 04 00 +T 14 1F 00 00 2B 5E 23 56 D5 21 10 00 E5 2E 06 +R 00 00 01 00 +T 1F 1F 00 00 DD 5E EC DD 56 ED 19 6E 26 00 01 +R 00 00 01 00 +T 2A 1F 00 00 F0 FF 09 E5 DD 6E FE DD 66 FF 29 +R 00 00 01 00 +T 35 1F 00 00 29 4D 44 29 09 01 14 00 09 4D 44 +R 00 00 01 00 +T 40 1F 00 00 11 08 00 3E 97 18 00 00 21 +R 00 00 01 00 29 08 01 00 +T 46 1F 00 00 97 18 00 00 CD 00 00 00 00 F1 F1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 4D 1F 00 00 F1 DD 75 FC DD 74 FD 01 0E 00 09 +R 00 00 01 00 +T 58 1F 00 00 36 30 23 70 DD 4E FC DD 46 FD C5 +R 00 00 01 00 +T 63 1F 00 00 DD 5E EC 4B DD 56 ED 42 21 1D 00 +R 00 00 01 00 +T 6E 1F 00 00 09 4E 23 46 23 7E 69 60 C1 CD +R 00 00 01 00 +T 78 1F 00 00 00 00 00 00 DD 34 FE 20 03 DD 34 +R 00 00 01 00 02 04 0B 00 +T 81 1F 00 00 FF +R 00 00 01 00 +T 82 1F 00 00 +R 00 00 01 00 +T 82 1F 00 00 C3 C3 1E 00 00 +R 00 00 01 00 00 05 01 00 +T 85 1F 00 00 +R 00 00 01 00 +T 85 1F 00 00 01 15 00 00 00 DD 5E EC DD 56 ED +R 00 00 01 00 00 05 02 00 +T 8E 1F 00 00 3E 59 06 00 00 21 59 06 00 00 CD +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 94 1F 00 00 00 00 00 00 01 FF 00 CD +R 00 00 01 00 02 04 0B 00 +T 9A 1F 00 00 12 20 00 00 01 0E 00 09 36 30 23 +R 00 00 01 00 00 04 01 00 +T A3 1F 00 00 70 0E FE CD 12 20 00 00 EB CD +R 00 00 01 00 00 08 01 00 +T AB 1F 00 00 8F 09 00 00 DD 4E EC DD 46 ED C5 +R 00 00 01 00 00 04 01 00 +T B4 1F 00 00 FD 5E 11 FD 56 12 FD 6E 11 FD 66 +R 00 00 01 00 +T BF 1F 00 00 12 01 1D 00 09 4E 23 46 23 7E 69 +R 00 00 01 00 +T CA 1F 00 00 60 C1 CD 00 00 00 00 21 00 00 E5 +R 00 00 01 00 02 07 0B 00 +T D3 1F 00 00 FD 5E 11 FD 56 12 FD 6E 11 FD 66 +R 00 00 01 00 +T DE 1F 00 00 12 01 17 00 09 4E 23 46 23 7E 69 +R 00 00 01 00 +T E9 1F 00 00 60 01 03 01 CD 00 00 00 00 E1 +R 00 00 01 00 02 09 0B 00 +T F1 1F 00 00 +R 00 00 01 00 +T F1 1F 00 00 21 10 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T FA 1F 00 00 23 B6 23 B6 28 0D +R 00 00 01 00 +T 00 20 00 00 +R 00 00 01 00 +T 00 20 00 00 FD E5 D1 21 10 00 ED 4B +R 00 00 01 00 +T 08 20 00 00 00 00 00 00 CD 94 0D 00 00 +R 00 00 01 00 00 04 04 00 00 09 01 00 +T 0D 20 00 00 +R 00 00 01 00 +T 0D 20 00 00 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 07 04 00 +T 12 20 00 00 +R 00 00 01 00 +T 12 20 00 00 DD 5E EC DD 56 ED 3E 8E 07 00 00 +R 00 00 01 00 29 0B 01 00 +T 1A 20 00 00 21 8E 07 00 00 C3 00 00 00 00 +R 00 00 01 00 00 05 01 00 02 0A 0B 00 +T 20 20 00 00 +R 00 00 01 00 +T 20 20 00 00 CD 00 00 00 00 F8 FF FD E5 03 0A +R 00 00 01 00 02 05 0E 00 +T 29 20 00 00 DD 77 FE 03 0A DD 77 FF 03 69 60 +R 00 00 01 00 +T 34 20 00 00 4E DD 71 FC 23 46 DD 70 FD DD 6E +R 00 00 01 00 +T 3F 20 00 00 FE 67 29 EB CD D0 1C 00 00 DD 75 +R 00 00 01 00 00 09 01 00 +T 48 20 00 00 FA DD 74 FB 59 50 CD CE 04 00 00 +R 00 00 01 00 00 0B 01 00 +T 51 20 00 00 C5 4D 44 DD 5E 02 DD 56 03 CD +R 00 00 01 00 +T 5B 20 00 00 C8 1C 00 00 F1 11 00 00 AF DD 77 +R 00 00 01 00 00 04 01 00 +T 64 20 00 00 F8 DD 77 F9 +R 00 00 01 00 +T 68 20 00 00 +R 00 00 01 00 +T 68 20 00 00 DD 4E FC DD 46 FD 6B 62 CD +R 00 00 01 00 +T 71 20 00 00 00 00 00 00 30 35 CD E6 20 00 00 +R 00 00 01 00 02 04 0F 00 00 0B 01 00 +T 78 20 00 00 30 30 +R 00 00 01 00 +T 7A 20 00 00 +R 00 00 01 00 +T 7A 20 00 00 +R 00 00 01 00 +T 7A 20 00 00 +R 00 00 01 00 +T 7A 20 00 00 23 DD 75 F8 DD 74 F9 2B 29 DD 4E +R 00 00 01 00 +T 85 20 00 00 FA DD 46 FB 09 E5 FD E5 E1 19 4D +R 00 00 01 00 +T 90 20 00 00 44 E1 71 23 70 +R 00 00 01 00 +T 95 20 00 00 +R 00 00 01 00 +T 95 20 00 00 FD E5 E1 19 7E B7 28 03 +R 00 00 01 00 +T 9D 20 00 00 +R 00 00 01 00 +T 9D 20 00 00 13 18 F5 +R 00 00 01 00 +T A0 20 00 00 +R 00 00 01 00 +T A0 20 00 00 6B 62 13 FD E5 C1 09 77 18 BE +R 00 00 01 00 +T AA 20 00 00 +R 00 00 01 00 +T AA 20 00 00 CD E6 20 00 00 30 13 +R 00 00 01 00 00 05 01 00 +T AF 20 00 00 +R 00 00 01 00 +T AF 20 00 00 29 DD 4E FA DD 46 FB 09 E5 FD E5 +R 00 00 01 00 +T BA 20 00 00 E1 19 4D 44 E1 71 23 70 +R 00 00 01 00 +T C2 20 00 00 +R 00 00 01 00 +T C2 20 00 00 21 06 00 ED 4B 00 00 00 00 09 FD +R 00 00 01 00 00 09 04 00 +T CB 20 00 00 E5 C1 71 23 70 21 08 00 ED 4B +R 00 00 01 00 +T D5 20 00 00 00 00 00 00 09 DD 4E FA 71 DD 46 +R 00 00 01 00 00 04 04 00 +T DE 20 00 00 FB 23 70 FD E1 C3 00 00 00 00 +R 00 00 01 00 02 0A 04 00 +T E6 20 00 00 +R 00 00 01 00 +T E6 20 00 00 DD 4E FE DD 46 FF DD 6E F8 DD 66 +R 00 00 01 00 +T F1 20 00 00 F9 C3 00 00 00 00 +R 00 00 01 00 02 06 0F 00 +T F5 20 00 00 +R 00 00 01 00 +T F5 20 00 00 2A 00 00 00 00 C3 00 00 00 00 +R 00 00 01 00 00 05 04 00 02 0A 00 00 +T FB 20 00 00 +R 00 00 01 00 +T FB 20 00 00 C5 D5 11 13 00 CD D0 1C 00 00 22 +R 00 00 01 00 00 0A 01 00 +T 04 21 00 00 00 00 00 00 AF 77 23 77 21 04 00 +R 00 00 01 00 00 04 04 00 +T 0D 21 00 00 ED 4B 00 00 00 00 09 77 23 77 21 +R 00 00 01 00 00 06 04 00 +T 16 21 00 00 0A 00 ED 4B 00 00 00 00 09 77 23 +R 00 00 01 00 00 08 04 00 +T 1F 21 00 00 77 21 0C 00 ED 4B 00 00 00 00 09 +R 00 00 01 00 00 0A 04 00 +T 28 21 00 00 77 23 77 21 08 00 ED 4B +R 00 00 01 00 +T 30 21 00 00 00 00 00 00 09 77 23 77 21 06 00 +R 00 00 01 00 00 04 04 00 +T 39 21 00 00 ED 4B 00 00 00 00 09 77 23 77 21 +R 00 00 01 00 00 06 04 00 +T 42 21 00 00 10 00 ED 4B 00 00 00 00 09 77 23 +R 00 00 01 00 00 08 04 00 +T 4B 21 00 00 77 23 77 3E 00 00 00 00 21 +R 00 00 01 00 29 08 01 00 +T 51 21 00 00 00 00 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 57 21 00 00 00 00 E5 E5 0E 70 05 00 00 C5 21 +R 00 00 01 00 29 09 01 00 +T 5F 21 00 00 70 05 00 00 E5 0E 8C 05 00 00 C5 +R 00 00 01 00 00 04 01 00 29 0A 01 00 +T 65 21 00 00 21 8C 05 00 00 E5 11 30 00 CD +R 00 00 01 00 00 05 01 00 +T 6D 21 00 00 1A 22 00 00 21 0C 00 39 F9 21 +R 00 00 01 00 00 04 01 00 +T 75 21 00 00 00 00 E5 E5 0E 70 05 00 00 C5 21 +R 00 00 01 00 29 09 01 00 +T 7D 21 00 00 70 05 00 00 E5 0E 9D 05 00 00 C5 +R 00 00 01 00 00 04 01 00 29 0A 01 00 +T 83 21 00 00 21 9D 05 00 00 E5 11 31 00 CD +R 00 00 01 00 00 05 01 00 +T 8B 21 00 00 1A 22 00 00 21 0C 00 39 F9 21 +R 00 00 01 00 00 04 01 00 +T 93 21 00 00 00 00 E5 E5 0E 83 05 00 00 C5 21 +R 00 00 01 00 29 09 01 00 +T 9B 21 00 00 83 05 00 00 E5 0E A6 05 00 00 C5 +R 00 00 01 00 00 04 01 00 29 0A 01 00 +T A1 21 00 00 21 A6 05 00 00 E5 11 32 00 CD +R 00 00 01 00 00 05 01 00 +T A9 21 00 00 1A 22 00 00 21 0C 00 39 F9 21 +R 00 00 01 00 00 04 01 00 +T B1 21 00 00 0E 00 ED 4B 00 00 00 00 09 E5 11 +R 00 00 01 00 00 08 04 00 +T BA 21 00 00 80 00 D5 5A D5 4B 42 3E +R 00 00 01 00 +T C2 21 00 00 71 0F 00 00 21 71 0F 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T C7 21 00 00 00 00 00 00 F1 F1 4D 44 E1 71 23 +R 00 00 01 00 02 04 0B 00 +T D0 21 00 00 70 21 0E 00 ED 4B 00 00 00 00 09 +R 00 00 01 00 00 0A 04 00 +T D9 21 00 00 56 23 66 6A 11 0A 00 19 36 01 23 +R 00 00 01 00 +T E4 21 00 00 72 21 0E 00 ED 4B 00 00 00 00 09 +R 00 00 01 00 00 0A 04 00 +T ED 21 00 00 56 23 66 6A 11 17 00 19 36 +R 00 00 01 00 +T F6 21 00 00 F0 18 00 00 23 36 F0 18 00 00 23 +R 00 00 01 00 09 04 01 00 89 0A 01 00 +T FB 21 00 00 36 F0 18 00 00 21 0E 00 ED 4B +R 00 00 01 00 29 05 01 00 +T 02 22 00 00 00 00 00 00 09 46 23 66 68 01 +R 00 00 01 00 00 04 04 00 +T 0A 22 00 00 1A 00 09 36 2C 0F 00 00 23 36 +R 00 00 01 00 09 08 01 00 +T 11 22 00 00 2C 0F 00 00 23 36 2C 0F 00 00 D1 +R 00 00 01 00 89 04 01 00 29 0A 01 00 +T 16 22 00 00 C1 C3 00 00 00 00 +R 00 00 01 00 02 06 00 00 +T 1A 22 00 00 +R 00 00 01 00 +T 1A 22 00 00 3E 33 04 00 00 21 33 04 00 00 C3 +R 00 00 01 00 29 05 01 00 00 0A 01 00 +T 20 22 00 00 00 00 00 00 +R 00 00 01 00 02 04 0B 00 +T 22 22 00 00 +R 00 00 01 00 +T 22 22 00 00 C5 D5 21 0E 00 ED 4B 00 00 00 00 +R 00 00 01 00 00 0B 04 00 +T 2B 22 00 00 09 5E 23 56 CD 8F 09 00 00 3E +R 00 00 01 00 00 09 01 00 +T 33 22 00 00 BD 02 00 00 21 BD 02 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 38 22 00 00 00 00 00 00 3E 8E 00 00 00 21 +R 00 00 01 00 02 04 0B 00 29 09 01 00 +T 3D 22 00 00 8E 00 00 00 CD 00 00 00 00 D1 C1 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 44 22 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 00 00 +T 47 22 00 00 +R 00 00 01 00 +T 47 22 00 00 CD 00 00 00 00 FE FF DD 4E 02 DD +R 00 00 01 00 02 05 0E 00 +T 50 22 00 00 46 03 21 0E 00 ED 5B 00 00 00 00 +R 00 00 01 00 00 0B 04 00 +T 59 22 00 00 19 5E 23 56 3E 0E 19 00 00 21 +R 00 00 01 00 29 09 01 00 +T 60 22 00 00 0E 19 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 0B 00 +T 65 22 00 00 +R 00 00 01 00 +T 65 22 00 00 21 01 00 E5 23 39 CD BE 1C 00 00 +R 00 00 01 00 00 0B 01 00 +T 6E 22 00 00 F1 3E 01 AD B4 28 F0 +R 00 00 01 00 +T 75 22 00 00 +R 00 00 01 00 +T 75 22 00 00 +R 00 00 01 00 +T 75 22 00 00 +R 00 00 01 00 +T 75 22 00 00 21 04 00 ED 4B 00 00 00 00 09 7E +R 00 00 01 00 00 09 04 00 +T 7E 22 00 00 23 B6 20 77 +R 00 00 01 00 +T 82 22 00 00 +R 00 00 01 00 +T 82 22 00 00 21 01 00 E5 23 39 CD BE 1C 00 00 +R 00 00 01 00 00 0B 01 00 +T 8B 22 00 00 F1 3E 01 AD B4 20 E3 +R 00 00 01 00 +T 92 22 00 00 +R 00 00 01 00 +T 92 22 00 00 DD B6 FE 28 2B +R 00 00 01 00 +T 97 22 00 00 +R 00 00 01 00 +T 97 22 00 00 4F 06 00 C5 21 0E 00 ED 5B +R 00 00 01 00 +T A0 22 00 00 00 00 00 00 19 5E 23 56 21 0E 00 +R 00 00 01 00 00 04 04 00 +T A9 22 00 00 ED 4B 00 00 00 00 09 46 23 66 68 +R 00 00 01 00 00 06 04 00 +T B2 22 00 00 01 17 00 09 4E 23 46 23 7E 69 60 +R 00 00 01 00 +T BD 22 00 00 01 01 00 18 2A +R 00 00 01 00 +T C2 22 00 00 +R 00 00 01 00 +T C2 22 00 00 DD 4E FF 47 C5 21 0E 00 ED 5B +R 00 00 01 00 +T CC 22 00 00 00 00 00 00 19 5E 23 56 21 0E 00 +R 00 00 01 00 00 04 04 00 +T D5 22 00 00 ED 4B 00 00 00 00 09 46 23 66 68 +R 00 00 01 00 00 06 04 00 +T DE 22 00 00 01 17 00 09 4E 23 46 23 7E 69 60 +R 00 00 01 00 +T E9 22 00 00 01 02 00 +R 00 00 01 00 +T EC 22 00 00 +R 00 00 01 00 +T EC 22 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 02 05 0B 00 +T F0 22 00 00 +R 00 00 01 00 +T F0 22 00 00 DD 46 FE DD 70 FF +R 00 00 01 00 +T F6 22 00 00 +R 00 00 01 00 +T F6 22 00 00 C3 75 22 00 00 +R 00 00 01 00 00 05 01 00 +T F9 22 00 00 +R 00 00 01 00 +T F9 22 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 04 00 +T 00 00 00 00 +R 00 00 02 00 +T 00 00 00 00 2F 64 65 76 2F 6C 63 64 30 00 +R 00 00 02 00 +T 0A 00 00 00 +R 00 00 02 00 +T 0A 00 00 00 4F 4B 00 +R 00 00 02 00 +T 0D 00 00 00 +R 00 00 02 00 +T 0D 00 00 00 43 61 6E 63 65 6C 00 +R 00 00 02 00 +T 14 00 00 00 +R 00 00 02 00 +T 14 00 00 00 00 +R 00 00 02 00 +T 15 00 00 00 +R 00 00 02 00 +T 15 00 00 00 4D 65 73 73 61 67 65 20 42 6F 78 +R 00 00 02 00 +T 20 00 00 00 00 +R 00 00 02 00 +T 00 00 00 00 +R 00 00 03 00 +T 00 00 00 00 1B 4B +R 00 00 03 00 +T 02 00 00 00 +R 00 00 03 00 +T 02 00 00 00 1B 53 00 00 +R 00 00 03 00 +T 06 00 00 00 +R 00 00 03 00 +T 06 00 00 00 1B 43 00 00 +R 00 00 03 00 +T 0A 00 00 00 +R 00 00 03 00 +T 0A 00 00 00 1B 4E 00 00 +R 00 00 03 00 +T 0E 00 00 00 +R 00 00 03 00 +T 0E 00 00 00 1B 52 00 00 +R 00 00 03 00 +T 12 00 00 00 +R 00 00 03 00 +T 12 00 00 00 1B 46 00 00 +R 00 00 03 00 +T 16 00 00 00 +R 00 00 03 00 +T 16 00 00 00 1B 68 00 00 +R 00 00 03 00 +T 1A 00 00 00 +R 00 00 03 00 +T 1A 00 00 00 1B 5A 00 00 00 00 00 +R 00 00 03 00 +T 21 00 00 00 +R 00 00 03 00 +T 21 00 00 00 1B 45 00 +R 00 00 03 00 +T 24 00 00 00 +R 00 00 03 00 +T 24 00 00 00 1B 00 +R 00 00 03 00 +T 26 00 00 00 +R 00 00 03 00 +T 26 00 00 00 2F 77 6E 64 2F 30 30 30 30 2E 73 +R 00 00 03 00 +T 31 00 00 00 63 72 00 +R 00 00 03 00 +T 00 00 00 00 +R 00 00 04 00 +T 00 00 00 00 +R 00 00 04 00 diff --git a/src/gui/wnd.xcl b/src/gui/wnd.xcl new file mode 100644 index 00000000..86b193b4 --- /dev/null +++ b/src/gui/wnd.xcl @@ -0,0 +1,13 @@ +-cz80 +-Z(CODE)RCODE,CODE,ZVECT,CONST,CSTR,CDATA0,CCSTR=8100 +-Z(DATA)DATA0,IDATA0,UDATA0,ECSTR,WCSTR,TEMP,CSTACK+200 +..\libc\cstartup +wnd +login +..\libc\libc +..\libc\syscalls\syscalls +cl64180 +-x +-l wnd.map +-FINTEL-EXTENDED -Y1 +-o wnd.ihx diff --git a/src/gui/wnd.xls b/src/gui/wnd.xls new file mode 100644 index 00000000..c3438cef Binary files /dev/null and b/src/gui/wnd.xls differ diff --git a/src/gui/wnd.zip b/src/gui/wnd.zip new file mode 100644 index 00000000..205d545e Binary files /dev/null and b/src/gui/wnd.zip differ diff --git a/src/init/init.c b/src/init/init.c index 90016bb2..46726c79 100644 --- a/src/init/init.c +++ b/src/init/init.c @@ -21,6 +21,7 @@ #include #include /* Nick */ #include +#include /* Nick */ #include static firsttime = 1; @@ -40,45 +41,126 @@ struct exec_struct tty_list[NUM_TTYS] = }; void process_inittab(void) -{ + { FILE *fdm; - char cmd[128], *p; /* [64], *p; */ - static char *_argv[3]; /* [2] = { 0, 0 }; */ + char cmd[128], *p; + char silent; + int i, argc; + char *argv[18]; int pid; - if ((fdm = fopen("/etc/inittab", "r")) != NULL) { - while (!feof(fdm)) { - if (fgets(cmd, sizeof(cmd)-1, fdm)==NULL) break; - if (cmd[0] != '#') { - if (NULL != (p = strchr(cmd, '\n'))) *p=0; - if (cmd[0] > ' ') { - printf("init: executing %s\n", cmd); - pid = fork(); - if (pid==-1) { - printf("init: can't execute %s\n", cmd); - continue; - } - if (pid==0) { - _argv[0] = cmd; - _argv[1] = NULL; - execve(_argv[0], _argv, environ); - if (errno == ESHELL) - { - _argv[0] = _PATH_BSHELL; - _argv[1] = cmd; - _argv[2] = NULL; - execve(_argv[0], _argv, environ); - } - printf("init: can't execute %s\n", cmd); - exit(1); - } - wait(&pid); + printf("Processing /etc/inittab\n"); + fflush(stdout); + + fdm = fopen("/etc/inittab", "r"); + if (fdm == NULL) + { + perror("can't open /etc/inittab"); + return; + } + + while (feof(fdm) == 0) + { + if (fgets(cmd, sizeof(cmd)-1, fdm) == NULL) + { + break; + } +/* printf("@@@ %s", cmd); */ + /* check for comment lines */ + p = cmd; + while (isspace(*p)) + { + p++; + } + + if (*p == '#') + { + continue; + } + + /* check for silent lines */ + silent = 0; + if (*p == '@') + { + silent = 1; + p++; + } + + /* convert line into arguments */ + argc = 0; + while (argc < 16) + { + while (isspace(*p)) + { + p++; + } + if (*p == 0) + { + break; + } + argv[1 + argc++] = p; + while (*p && isspace(*p) == 0) + { + p++; } + if (*p == 0) + { + break; + } + *p = 0; + } + + /* got a command to execute? */ + if (argc < 1) + { + continue; + } + + /* pacify the user, unless silent */ + if (silent == 0) + { + printf("%s", argv[1]); + for (i = 1; i < argc; i++) + { + printf(" %s", argv[1 + i]); + } + printf("\n"); + fflush(stdout); } + + /* fork and execute the program */ + pid = fork(); + if (pid == -1) + { + if (silent == 0) + { + perror("can't fork"); + } + continue; + } + + if (pid == 0) + { + argv[1 + argc] = NULL; + execve(argv[1], argv + 1, environ); + if (errno == ESHELL) + { + argv[0] = _PATH_BSHELL; + execve(argv[0], argv, environ); + } + if (silent == 0) + { + perror("can't execute"); + } + _exit(1); /* don't close handles in this case!!!!! */ + } + + /* wait for child to complete */ + wait(&pid); } - fclose(fdm); + + fclose(fdm); } -} int determine_tty(int pid) { @@ -92,7 +174,7 @@ int determine_tty(int pid) } void generate_mtab(void) -{ + { #if 1 /* Nick, new getfsys() convention */ filesys_t fsys; #else @@ -105,11 +187,11 @@ void generate_mtab(void) #else char mtabline[] = "/dev/fdX\t/\trw\n"; #endif - char *s = "failed"; FILE *fdm; #if 1 /* Nick */ - printf("init: creating /etc/mtab: "); + printf("Generating /etc/mtab\n"); + fflush(stdout); #else printf("Updating /etc/mtab: "); #endif @@ -127,66 +209,94 @@ void generate_mtab(void) { j = MINOR(fsys->s_dev); #endif - unlink("/etc/mtab"); + if (unlink("/etc/mtab") < 0) + { + perror("can't unlink /etc/mtab"); + break; + } mtabline[7] = j + '0'; - if ((fdm = fopen("/etc/mtab", "w")) != NULL) + if ((fdm = fopen("/etc/mtab", "w")) == NULL) { - if (fputs(mtabline, fdm) != EOF) - s = "ok"; - fclose(fdm); + perror("can't create /etc/mtab"); + break; } + if (fputs(mtabline, fdm) == EOF) + { + perror("can't write /etc/mtab"); + break; + } + fclose(fdm); break; } } - printf("%s\n", s); -} + } #if 1 /* Nick, we want mtab preserved over bootup */ #define PLENGTH 40 -void process_mtab(void) +void process_fstab(void) { int r; - FILE *mtb; + FILE *fdf, *fdm; char line[PLENGTH]; char mf1[PLENGTH], mf2[PLENGTH], mf3[PLENGTH]; - if ((mtb = fopen("/etc/mtab", "r")) == NULL) + printf("Processing /etc/fstab\n"); + fflush(stdout); + + if ((fdf = fopen("/etc/fstab", "r")) == NULL) { -#if 1 - generate_mtab(); -#else - printf("init: can't open /etc/mtab\n"); -#endif + perror("can't open /etc/fstab"); return; } - while (!feof(mtb)) + + while (feof(fdf) == 0) { - if (fgets(line, PLENGTH, mtb)) + if (fgets(line, PLENGTH, fdf) == NULL) { - mf1[0] = mf2[0] = mf3[0] = '\0'; - r = sscanf(line, "%s%s%s", mf1, mf2, mf3); - if (r > 1 && strcmp(mf2, "/")) - { - if (r > 2) - { - r = !strcmp(mf3, "ro"); - } - else - { - r = 0; /* default to read/write */ - } - r = mount(mf1, mf2, r); - if (r < 0) - { - fprintf(stderr, - "init: failed to mount %s on %s\n", - mf1, mf2); - } - } + break; + } + + mf1[0] = mf2[0] = mf3[0] = '\0'; + r = sscanf(line, "%s%s%s", mf1, mf2, mf3); + if (r < 2 || strcmp(mf2, "/") == 0) + { + continue; + } + + if (r > 2) + { + r = !strcmp(mf3, "ro"); + } + else + { + r = 0; /* default to read/write */ + } + r = mount(mf1, mf2, r); + if (r < 0) + { + perror("mount failed"); + continue; } + + fdm = fopen("/etc/mtab", "a"); + if (fdm == NULL) + { + perror("can't open /etc/mtab"); + continue; + } + + sprintf(line,"%s\t%s\tr%c\n", mf1, mf2, r ? 'o' : 'w'); + if (fputs(line, fdm) == EOF) + { + perror("can't write /etc/mtab"); + continue; + } + + fclose(fdm); } - fclose(mtb); + + fclose(fdf); } #endif @@ -224,13 +334,10 @@ int spawn_tty(unsigned num, char **argv) dup2(fd, STDOUT_FILENO); dup2(fd, STDERR_FILENO); if (firsttime) { -#if 1 /* Nick, we want mtab preserved over bootup */ - process_mtab(); -#else generate_mtab(); -#endif + process_fstab(); process_inittab(); - printf("Spawning tty #%d (%s): ok\n", num, p->tty_name); + printf("\nSpawning tty #%d (%s): ok\n", num, p->tty_name); } setenv("TTY", p->tty_name, 1); setenv("TERM", @@ -344,6 +451,7 @@ VOID main(int argc, char *argv[]) time_t mytimet; #if 1 /* Nick */ struct tm *tmbuf; + char *tmptr; #endif #endif @@ -360,7 +468,7 @@ VOID main(int argc, char *argv[]) #if 1 /* Nick */ /* reopen_console(); */ - printf("Date/time: "); + printf("Time/date: "); fflush(stdout); time(&mytimet); @@ -370,7 +478,17 @@ VOID main(int argc, char *argv[]) } tmbuf = localtime(&mytimet); +#if 1 + tmptr = asctime(tmbuf); + tmptr[3] = 0; /* terminate day of week */ + tmptr[7] = 0; /* terminate month */ + tmptr[10] = 0; /* terminate day of month */ + tmptr[19] = 0; /* terminate time of day */ + printf("%s %s %s %s %s", + tmptr + 11, tmptr, tmptr + 8, tmptr + 4, tmptr + 20); +#else printf("%s", asctime(tmbuf)); /* has embedded newline */ +#endif fflush(stdout); if (tmbuf->tm_year < 103) /* 2003 */ @@ -378,7 +496,7 @@ VOID main(int argc, char *argv[]) for (;;) #endif { - printf("Enter date/time (hh:mm[:ss] dd/mm/yyyy): "); + printf("Enter time/date (hh:mm[:ss] dd/mm/yyyy): "); fflush(stdout); read(0, buf, 39); p=strchr(buf, '\n'); @@ -387,7 +505,7 @@ VOID main(int argc, char *argv[]) *p=0; if (!conv_time(buf, p+1, &tt)) { - printf("Bad date/time format\n"); + printf("Bad time/date format\n"); #if 1 /* Nick */ } else @@ -399,8 +517,19 @@ VOID main(int argc, char *argv[]) } else { - printf("New date/time: %s", ctime(&mytimet)); +#if 1 + tmptr = ctime(&mytimet); + tmptr[3] = 0; /* terminate day of week */ + tmptr[7] = 0; /* terminate month */ + tmptr[10] = 0; /* terminate day of month */ + tmptr[19] = 0; /* terminate time of day */ + printf("New time/date: %s %s %s %s %s", + tmptr + 11, tmptr, tmptr + 8, tmptr + 4, + tmptr + 20); +#else + printf("New time/date: %s", ctime(&mytimet)); /* has embedded newline */ +#endif } } } diff --git a/src/kernel/build.ban b/src/kernel/build.ban index a1368824..e0f7b879 100644 --- a/src/kernel/build.ban +++ b/src/kernel/build.ban @@ -69,91 +69,91 @@ rem build uzi copy ..\uzi\asmdef.inc copy ..\uzi\z180.inc -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\main +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\main @if errorlevel 1 goto failure del main.r01 as-z80 -l -o main.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\data +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\data @if errorlevel 1 goto failure del data.r01 as-z80 -l -o data.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\devflop +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\devflop @if errorlevel 1 goto failure del devflop.r01 as-z80 -l -o devflop.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\devhd +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\devhd @if errorlevel 1 goto failure del devhd.r01 as-z80 -l -o devhd.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\devio +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\devio @if errorlevel 1 goto failure del devio.r01 as-z80 -l -o devio.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\devmisc +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\devmisc @if errorlevel 1 goto failure del devmisc.r01 as-z80 -l -o devmisc.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\devtty +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\devtty @if errorlevel 1 goto failure del devtty.r01 as-z80 -l -o devtty.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\filesys +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\filesys @if errorlevel 1 goto failure del filesys.r01 as-z80 -l -o filesys.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\machdep +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\machdep @if errorlevel 1 goto failure del machdep.r01 as-z80 -l -o machdep.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\process +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\process @if errorlevel 1 goto failure del process.r01 as-z80 -l -o process.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\scall1 +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\scall1 @if errorlevel 1 goto failure del scall1.r01 as-z80 -l -o scall1.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\scall2 +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\scall2 @if errorlevel 1 goto failure del scall2.r01 as-z80 -l -o scall2.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\scall3 +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\scall3 @if errorlevel 1 goto failure del scall3.r01 as-z80 -l -o scall3.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\systrace +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\systrace @if errorlevel 1 goto failure del systrace.r01 as-z80 -l -o systrace.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=1 ..\uzi\xip +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -I..\libc\ -DDEBUG=2 ..\uzi\xip @if errorlevel 1 goto failure del xip.r01 as-z80 -l -o xip.s01 @@ -185,73 +185,79 @@ copy ..\libc\_exit.asm _exit.s01 as-z80 -l -o _exit.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\kprintf +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\dprintf +@if errorlevel 1 goto failure +del dprintf.r01 +as-z80 -l -o dprintf.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\kprintf @if errorlevel 1 goto failure del kprintf.r01 as-z80 -l -o kprintf.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\vfprintf +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\vfprintf @if errorlevel 1 goto failure del vfprintf.r01 as-z80 -l -o vfprintf.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\itoa +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\itoa @if errorlevel 1 goto failure del itoa.r01 as-z80 -l -o itoa.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\ltoa +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\ltoa @if errorlevel 1 goto failure del ltoa.r01 as-z80 -l -o ltoa.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\ultoa +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\ultoa @if errorlevel 1 goto failure del ultoa.r01 as-z80 -l -o ultoa.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\strlen +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\strlen @if errorlevel 1 goto failure del strlen.r01 as-z80 -l -o strlen.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\strcat +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\strcat @if errorlevel 1 goto failure del strcat.r01 as-z80 -l -o strcat.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\strcpy +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\strcpy @if errorlevel 1 goto failure del strcpy.r01 as-z80 -l -o strcpy.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\strncmp +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\strncmp @if errorlevel 1 goto failure del strncmp.r01 as-z80 -l -o strncmp.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\memcpy +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\memcpy @if errorlevel 1 goto failure del memcpy.r01 as-z80 -l -o memcpy.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\abort +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\abort @if errorlevel 1 goto failure del abort.r01 as-z80 -l -o abort.s01 @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -DDEBUG=1 ..\libc\exit +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\cmx\ -I..\uzi\ -DDEBUG=2 ..\libc\exit @if errorlevel 1 goto failure del exit.r01 as-z80 -l -o exit.s01 @@ -264,13 +270,13 @@ link-z80 -f kernel ihex2bin -l kernel.i86 ..\..\..\bin\kernel.bin @if errorlevel 1 goto failure -copy ..\..\..\bin\kernel.bin \nlddl -set country=NLD -crc -copy \nlddl\checksum ..\..\..\bin +rem copy ..\..\..\bin\kernel.bin \nlddl +rem set country=NLD +rem crc +rem copy \nlddl\checksum ..\..\..\bin -copy \nlddl\checksum \\darkstar\public\dos622\nlddl -copy \nlddl\kernel.bin \\darkstar\public\dos622\nlddl +rem copy \nlddl\checksum \\darkstar\public\dos622\nlddl +rem copy \nlddl\kernel.bin \\darkstar\public\dos622\nlddl @echo SUCCESS @goto done diff --git a/src/kernel/cmx/apibus.asm b/src/kernel/cmx/apibus.asm index 53a0e924..3708d158 100644 --- a/src/kernel/cmx/apibus.asm +++ b/src/kernel/cmx/apibus.asm @@ -68,6 +68,7 @@ _apibus_setup:: public _apibus_priority _apibus_priority:: +if 0 ; 08apr03 patch to avoid BAD COMMAND error on TPG hardware ; enter with e = priority value to be set ; upper nibble is priority (1-7), lower nibble is device (1-8) @@ -99,6 +100,7 @@ set_priority: pop de pop bc +endif jp ?BANK_FAST_LEAVE_L08 ; ----------------------------------------------------------------------------- diff --git a/src/kernel/cmx/copyr.asm b/src/kernel/cmx/copyr.asm index 7b1af16d..ea8fc2d6 100644 --- a/src/kernel/cmx/copyr.asm +++ b/src/kernel/cmx/copyr.asm @@ -11,7 +11,7 @@ BITELOG equ 5 PBITE equ 16 PBITELOG equ 4 - extern abyte, ahexw, ahexn, acrlf + extern abyte, ahexn, ahexb, ahexw, acrlf ; copy routine ; ------------ @@ -93,6 +93,65 @@ copyr: call acrlf pop hl + .endif + .if 0 ; disk block monitor + ld a,e + cp 4 + jr nz,nowrm + push bc + push hl + ld bc,0e00h + or a + sbc hl,bc + pop hl + pop bc + jr nz,nowrm + ; e:hl -> 4:0e00, disk block 7 + call nomon + +mon: + push bc + push hl + in0 a,(BBR) + push af + ld a,40h-4 + out0 (BBR),a + ld hl,4e00h ; bbr:hl -> 4:0e00, disk block 7 + ld c,20h +dline: + ld b,10h +ditem: + ld a,(hl) + inc hl + call ahexb + ld a,' ' + call abyte + djnz ditem + call acrlf + dec c + jr nz,dline + pop af + out0 (BBR),a + pop hl + pop bc + ret + +nowrm: + ld a,d + cp 4 + jr nz,nomon + push bc + push hl + push iy + pop hl + ld bc,0e00h + or a + sbc hl,bc + pop hl + pop bc + call z,mon ; if d:iy -> 4:0e00, disk block 7 + +nomon: .endif ld a,e cp 4 diff --git a/src/kernel/cmx/diag.asm b/src/kernel/cmx/diag.asm index c741e491..b8c7f0f4 100644 --- a/src/kernel/cmx/diag.asm +++ b/src/kernel/cmx/diag.asm @@ -24,6 +24,10 @@ _abyte:: public abyte abyte:: + .if 1 + ei ; a bit naughty but avoids inadvertent BAD COMMAND when line is busy + .endif + .if 0 ; 0=enable abytes, 1=disable abytes (doesn't affect the code size) ret .else diff --git a/src/kernel/kernel.lnk b/src/kernel/kernel.lnk index 7a7a699f..2a389ec1 100644 --- a/src/kernel/kernel.lnk +++ b/src/kernel/kernel.lnk @@ -38,6 +38,7 @@ flopasm utils systrace xip +dprintf kprintf vfprintf itoa diff --git a/src/kernel/libc/vendor.h b/src/kernel/libc/VENDOR.H similarity index 79% rename from src/kernel/libc/vendor.h rename to src/kernel/libc/VENDOR.H index 7c5b7c44..ac96c04e 100644 --- a/src/kernel/libc/vendor.h +++ b/src/kernel/libc/VENDOR.H @@ -2,10 +2,13 @@ #ifndef UTIL /* ensures we don't do anything when compiling utils under MSVC */ +#define dprintf _dprintf #define kprintf _kprintf +#define ub _ub #if 1 /* Nick, see kprintf.c */ int kprintf(char *, ...); /* ensures IAR won't try to pass register params */ +int dprintf(char debuglevel, char *fmt, ...); #else void kprintf(char *, ...); /* ensures IAR won't try to pass register params */ #endif diff --git a/src/kernel/libc/dprintf.c b/src/kernel/libc/dprintf.c new file mode 100644 index 00000000..ea99c9a2 --- /dev/null +++ b/src/kernel/libc/dprintf.c @@ -0,0 +1,59 @@ +/* dprintf.c + * Dale Schumacher 399 Beacon Ave. + * (alias: Dalnefre') St. Paul, MN 55104 + * dal@syntel.UUCP United States of America + * + * Altered to use stdarg, made the core function vfprintf. + * Hooked into the stdio package using 'inside information' + * Altered sizeof() assumptions, now assumes all integers except chars + * will be either + * sizeof(xxx) == sizeof(long) or sizeof(xxx) == sizeof(short) + * + * -RDB + */ + +/* #include "printf.h" */ +#include "vendor.h" /* Nick, must come first */ + +#include +#include +#if 1 +#include +#define va_strt va_start +#else +#include +#define va_strt(p,i) va_start(p) +#endif + +#include +#include +#include + +#include "unix.h" /* Nick for udata.u_debugme */ +#include "config.h" /* Nick for udata.u_debugme */ +#include "extern.h" /* Nick for udata.u_debugme */ + +int dprintf(char debuglevel, char *fmt, ...) +{ +#ifdef DEBUG + va_list ptr; + int rv; + + if (udata.u_debugme < debuglevel) + { + return 0; + } + + va_strt(ptr, fmt); +#if 1 /* Nick */ + rv = vfprintf(NULL, fmt, ptr); +#else + rv = vfprintf(stdout, fmt, ptr); +#endif + va_end(ptr); + return rv; +#else + return 0; +#endif +} + diff --git a/src/kernel/libc/dprintf.h b/src/kernel/libc/dprintf.h new file mode 100644 index 00000000..20e582c6 --- /dev/null +++ b/src/kernel/libc/dprintf.h @@ -0,0 +1,9 @@ +/* dprintf.h for uzi180 by Nick - subroutines based on /uzi/libc source */ + +#ifndef __DPRINTF_H +#define __DPRINTF_H + +int dprintf(char *fmt, ...); + +#endif /* __DPRINTF_H */ + diff --git a/src/kernel/uzi/config.h b/src/kernel/uzi/config.h index 9e0ee5a9..6eb8a699 100644 --- a/src/kernel/uzi/config.h +++ b/src/kernel/uzi/config.h @@ -79,7 +79,7 @@ extern devsw_t dev_tab[]; /* Nick */ #define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */ #define SWAPDEV 3 /* Device for swapping. */ -#define NBUFS 20 /*10*/ /* Number of block buffers */ +#define NBUFS 10 /* DEBUGGING 20 */ /*10*/ /* Number of block buffers */ #if 1 /* Nick UZIX compatibility */ diff --git a/src/kernel/uzi/devhd.c b/src/kernel/uzi/devhd.c index a542b882..de95395d 100644 --- a/src/kernel/uzi/devhd.c +++ b/src/kernel/uzi/devhd.c @@ -73,9 +73,8 @@ int wd_read(uchar minor, uchar rawflag) int setup(); /* kputchar(minor + '0'); */ -#if DEBUG > 1 - kputchar('<'); - kputchar(8); +#if DEBUG >= 2 + dprintf(2, "<\x08"); #endif #ifdef APIBUS @@ -89,9 +88,8 @@ int wd_read(uchar minor, uchar rawflag) chkstat (scsiop(), 1); -#if DEBUG > 1 - kputchar(' '); - kputchar(8); +#if DEBUG >= 2 + dprintf(2, " \x08"); #endif return 0; /* success.. formerly count of bytes read */ @@ -103,9 +101,8 @@ int wd_write(uchar minor, uchar rawflag) int setup(); /* kputchar(minor + '0'); */ -#if DEBUG > 1 - kputchar('>'); - kputchar(8); +#if DEBUG >= 2 + dprintf(2, ">\x08"); #endif #ifdef APIBUS @@ -118,9 +115,8 @@ int wd_write(uchar minor, uchar rawflag) chkstat (scsiop(), 0); -#if DEBUG > 1 - kputchar(' '); - kputchar(8); +#if DEBUG >= 2 + dprintf(2, " \x08"); #endif return 0; /* success.. formerly count of bytes written */ diff --git a/src/kernel/uzi/devio.c b/src/kernel/uzi/devio.c index 703bf291..3c25b575 100644 --- a/src/kernel/uzi/devio.c +++ b/src/kernel/uzi/devio.c @@ -82,7 +82,7 @@ bufptr freebuf(uchar waitfor); uint bufclock = 0; /* Time-stamp counter for LRU */ -#if DEBUG > 0 +#if DEBUG uint buf_hits; /* buffer pool hits */ uint buf_miss; /* buffer pool misses */ uint buf_flsh; /* buffer pool flushes */ @@ -93,18 +93,22 @@ void *bread(dev_t dev, blkno_t blk, uchar rewrite) { register bufptr bp = bufpool; +#if DEBUG >= 3 + dprintf(3, "bread(%u, %u, %u) starting\n", dev, blk, rewrite); +#endif + #if 1 /* Nick */ if (bp = bfind(dev, blk)) { if (bp->bf_busy) panic("want busy block %d, device %d", blk, dev); -#if DEBUG > 0 +#if DEBUG ++buf_hits; #endif -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("chit 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("chit 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif goto Done; @@ -115,7 +119,7 @@ void *bread(dev_t dev, blkno_t blk, uchar rewrite) if (bp->bf_dev == dev && bp->bf_blk == blk) { if (bp->bf_busy) /* ??? */ panic("want busy block %d at dev %d",blk,dev); -#if DEBUG > 0 +#if DEBUG ++buf_hits; #endif goto Done; @@ -123,7 +127,7 @@ void *bread(dev_t dev, blkno_t blk, uchar rewrite) ++bp; } #endif -#if DEBUG > 0 +#if DEBUG ++buf_miss; #endif /* block not found in pool - allocate free buffer for them */ @@ -137,33 +141,44 @@ void *bread(dev_t dev, blkno_t blk, uchar rewrite) if (bdread(bp) < 0) { /* device can define the error */ if (udata.u_error == 0) udata.u_error = EIO; -Err: return NULL; +Err: +#if DEBUG >= 3 + dprintf(3, "bread() returning NULL, error %u\n", udata.u_error); +#endif + return NULL; } -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("read 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("read 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif } Done: if (rewrite > 1) /* we need really zeroed block */ { bzero(bp->bf_data, BUFSIZE); -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("zero 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("zero 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif } bp->bf_busy++; /* was always zero */ bp->bf_time = ++bufclock; /* Time stamp it */ +#if DEBUG >= 3 + dprintf(3, "bread() returning %u, success\n", bp - bufpool); +#endif return (bp->bf_data); } /* free not needed now buffer */ int bfree(bufptr bp, uchar dirty) { +#if DEBUG >= 3 + dprintf(3, "bfree(%u, %u) starting\n", bp - bufpool, dirty); +#endif + bp->bf_dirty |= dirty; bp->bf_busy = 0; if (bp->bf_dirty && bp->bf_dev == NULLDEV) @@ -174,29 +189,35 @@ int bfree(bufptr bp, uchar dirty) #else if (bp->bf_dirty >= 2 && !dirty_mask) { /* Extra dirty */ #endif -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("wri2 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("wri2 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif if (bdwrite(bp) < 0) { udata.u_error = EIO; +#if DEBUG >= 3 + dprintf(3, "bfree() returning -1, error %u\n", udata.u_error); +#endif return (-1); } bp->bf_prio = bp->bf_dirty = 0; } -#if DEBUG > 10 +#if DEBUG >= 5 else { if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("free 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("free 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } } #endif if (!bp->bf_prio) wakeup(bufpool); +#if DEBUG >= 3 + dprintf(3, "bfree() returning 0, success\n"); +#endif return 0; } @@ -207,7 +228,13 @@ int bfree(bufptr bp, uchar dirty) void *zerobuf(uchar waitfor) { static int blk = 0; - register bufptr bp = freebuf(waitfor); + register bufptr bp; /* = freebuf(waitfor); Nick see below */ + +#if DEBUG >= 3 + dprintf(3, "zerobuf(%u) starting\n", waitfor); +#endif + + bp = freebuf(waitfor); /* Nick see above */ if (bp) { bp->bf_dev = NULLDEV; @@ -215,8 +242,14 @@ void *zerobuf(uchar waitfor) bp->bf_busy = 1; bp->bf_time = ++bufclock; bzero(bp->bf_data, BUFSIZE); +#if DEBUG >= 3 + dprintf(3, "zerobuf() returning %d, found\n", bp - bufpool); +#endif return bp->bf_data; } +#if DEBUG >= 3 + dprintf(3, "zerobuf() returning NULL, not found\n", bp - bufpool); +#endif return NULL; } @@ -225,6 +258,10 @@ void bufsync(void) { register bufptr bp = bufpool; +#if DEBUG >= 3 + dprintf(3, "bufsync() starting\n"); +#endif + #if 0 /* dirty_mask logic is now handled by i_sync() and wr_inode() */ dirty_mask = 0; @@ -233,10 +270,10 @@ void bufsync(void) if (bp->bf_dev != NULLDEV && bp->bf_dirty && !bp->bf_prio) { -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("sync 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("sync 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif if (!bdwrite(bp)) @@ -244,6 +281,9 @@ void bufsync(void) } ++bp; } +#if DEBUG >= 3 + dprintf(3, "bufsync() returning\n"); +#endif } #if 1 /* Nick */ @@ -251,22 +291,22 @@ bufptr bfind(int dev, blkno_t blk) { register bufptr bp; -#if DEBUG > 1 - kprintf("bfind(%u, %u) starting\n", dev, blk); +#if DEBUG >= 3 + dprintf(3, "bfind(%u, %u) starting\n", dev, blk); #endif for (bp=bufpool; bp < bufpool+NBUFS; ++bp) { if (bp->bf_dev == dev && bp->bf_blk == blk) { -#if DEBUG > 1 - kprintf("bfind() returning %d, found\n", bp - bufpool); +#if DEBUG >= 3 + dprintf(3, "bfind() returning %d, found\n", bp - bufpool); #endif return (bp); } } -#if DEBUG > 1 - kprintf("bfind() returning NULL, not found\n"); +#if DEBUG >= 3 + dprintf(3, "bfind() returning NULL, not found\n"); #endif return (NULL); } @@ -283,6 +323,10 @@ bufptr freebuf(uchar waitfor) register bufptr oldest = NULL; register uint oldtime = 0; +#if DEBUG >= 3 + dprintf(3, "freebuf(%u) starting\n", waitfor); +#endif + /* Try to find a non-busy buffer and * write out the data if it is dirty */ @@ -316,13 +360,13 @@ bufptr freebuf(uchar waitfor) if (oldest->bf_dev == NULLDEV) panic("attempt to write-back zerobuf"); #endif -#if DEBUG > 0 +#if DEBUG ++buf_flsh; #endif -#if DEBUG > 10 +#if DEBUG >= 5 if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("wri1 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("wri1 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } #endif if (bdwrite(oldest) < 0) { @@ -331,19 +375,22 @@ Err: return NULL; } oldest->bf_dirty = 0; } -#if DEBUG > 10 +#if DEBUG >= 5 else { if (bp->bf_dev == 0 && bp->bf_blk == 222) { - kprintf("toss 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); + dprintf(5, ("toss 0x%04x 0x%02x\n", bp, bp->bf_data[0x3f]); } } +#endif +#if DEBUG >= 3 + dprintf(3, "freebuf() returning %d, found\n", oldest - bufpool); #endif return oldest; } -#if DEBUG > 0 +#if DEBUG /* dump buffers info for debug */ void bufdump(void) { diff --git a/src/kernel/uzi/devtty.c b/src/kernel/uzi/devtty.c index 0513ec19..17d55f15 100644 --- a/src/kernel/uzi/devtty.c +++ b/src/kernel/uzi/devtty.c @@ -86,8 +86,8 @@ int tty_read(uchar minor, uchar rawflag) char c; int remq(); -#if DEBUG > 1 - kprintf("tty_read(%d, %d) starting\n", minor, rawflag); +#if DEBUG >= 2 + dprintf(2, "tty_read(%d, %d) starting\n", minor, rawflag); #endif /* Minor == 0 means that it is the controlling tty of the process */ @@ -98,8 +98,8 @@ int tty_read(uchar minor, uchar rawflag) if ((minor < 1) || (minor > NTTYS+1)) { udata.u_error = ENODEV; -#if DEBUG > 1 - kprintf("tty_read() returning -1, error %d\n", udata.u_error); +#if DEBUG >= 2 + dprintf(2, "tty_read() returning -1, error %d\n", udata.u_error); #endif return (-1); } @@ -127,8 +127,8 @@ int tty_read(uchar minor, uchar rawflag) /* In unbuffered mode, don't wait when no input */ if (tty_data[minor].t_flags & UNBUFF) { -#if DEBUG > 1 - kprintf("tty_read() returning %d, success\n", nread); +#if DEBUG >= 2 + dprintf(2, "tty_read() returning %d, success\n", nread); #endif return(nread); } @@ -137,8 +137,8 @@ int tty_read(uchar minor, uchar rawflag) psleep (&ttyinq[minor]); if (udata.u_cursig || udata.u_ptab->p_pending) { /* messy */ udata.u_error = EINTR; -#if DEBUG > 1 - kprintf("tty_read() returning -1, error %d\n", udata.u_error); +#if DEBUG >= 2 + dprintf(2, "tty_read() returning -1, error %d\n", udata.u_error); #endif return (-1); } @@ -149,8 +149,8 @@ int tty_read(uchar minor, uchar rawflag) #endif if ((nread++ == 0) && (c == tty_data[minor].t_eof)) /* ^D */ { -#if DEBUG > 1 - kprintf("tty_read() returning 0, eof\n"); +#if DEBUG >= 2 + dprintf(2, "tty_read() returning 0, eof\n"); #endif return(0); } @@ -170,8 +170,8 @@ int tty_read(uchar minor, uchar rawflag) #endif ++udata.u_base; } -#if DEBUG > 1 - kprintf("tty_read() returning %d, success\n", nread); +#if DEBUG >= 2 + dprintf(2, "tty_read() returning %d, success\n", nread); #endif return(nread); } @@ -369,7 +369,7 @@ void tty_inproc(int minor, char c) { if ((mode & RAW) == 0) /* if mode == COOKED or CBREAK */ { -#ifdef DEBUG +#if DEBUG if (c == 0x1a) /* ^Z */ { idump(); /* (For debugging) */ diff --git a/src/kernel/uzi/extern.h b/src/kernel/uzi/extern.h index 649c4de3..3fbfbc94 100644 --- a/src/kernel/uzi/extern.h +++ b/src/kernel/uzi/extern.h @@ -84,7 +84,7 @@ extern blkno_t swapblk; extern uint16 waitno; /* Serial number of processes entering wait state */ #ifdef DEBUG -extern char traceon; /* Nick flag to enable/disable tracing via keyboard */ +extern char traceon; /* Nick to enable/disable tracing via keyboard */ #endif #if 1 /* Nick UZIX compatible */ @@ -125,6 +125,7 @@ extern char traceon; /* Nick flag to enable/disable tracing via keyboard */ #ifdef UTIL /* Nick */ #define kprintf printf +#define dprintf /* parameters will be evaluated, to no effect */ #define kputchar putchar #define _putc putchar #define uput(sptr, uptr, nbytes) (bcopy((sptr), (uptr), (nbytes))) diff --git a/src/kernel/uzi/filesys.c b/src/kernel/uzi/filesys.c index 1beaec05..efd385a2 100644 --- a/src/kernel/uzi/filesys.c +++ b/src/kernel/uzi/filesys.c @@ -105,8 +105,8 @@ int wr_inode(inoptr ino) { dinode_t *buf; -#if DEBUG > 1 - kprintf("wr_inode(%u) starting\n", ino - i_tab); +#if DEBUG >= 3 + dprintf(3, "wr_inode(%u) starting\n", ino - i_tab); #endif magic(ino, "wr_inode"); @@ -116,8 +116,8 @@ int wr_inode(inoptr ino) ino->c_num), 0)) == NULL) { Err: -#if DEBUG > 1 - kprintf("wr_inode() returning -1, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "wr_inode() returning -1, error %u\n", udata.u_error); #endif return -1; } @@ -132,8 +132,8 @@ Err: goto Err; } ino->c_dirty = 0; /* unmark modif flag */ -#if DEBUG > 1 - kprintf("wr_inode() returning 0, success\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "wr_inode() returning 0, success\n", udata.u_error); #endif return 0; } @@ -142,15 +142,15 @@ Err: */ void i_ref(inoptr ino) { -#if DEBUG > 1 - kprintf("i_ref(%u) starting\n", ino - i_tab); +#if DEBUG >= 4 + dprintf(4, "i_ref(%u) starting\n", ino - i_tab); #endif magic(ino, "i_ref"); if (++ino->c_refs >= 12 * ITABSIZE) /* Arbitrary limit */ panic(refstoinode, "too many", ino - i_tab); -#if DEBUG > 1 - kprintf("i_ref() returning, refs %u\n", ino->c_refs); +#if DEBUG >= 4 + dprintf(4, "i_ref() returning, refs %u\n", ino->c_refs); #endif } @@ -160,8 +160,8 @@ void i_ref(inoptr ino) */ void i_deref(inoptr ino) { -#if DEBUG > 1 - kprintf("i_deref(%u) starting\n", ino - i_tab); +#if DEBUG >= 4 + dprintf(4, "i_deref(%u) starting\n", ino - i_tab); #endif magic(ino, "i_deref"); @@ -184,8 +184,8 @@ void i_deref(inoptr ino) if (ino->c_dirty) wr_inode(ino); } -#if DEBUG > 1 - kprintf("i_deref() returning, refs %u\n", ino->c_refs); +#if DEBUG >= 4 + dprintf(4, "i_deref() returning, refs %u\n", ino->c_refs); #endif } @@ -197,8 +197,8 @@ void i_free(dev_t devno, ino_t ino) { register fsptr dev = getfs(devno); -#if DEBUG > 1 - kprintf("i_free(%u, %u) starting\n", devno, ino); +#if DEBUG >= 4 + dprintf(4, "i_free(%u, %u) starting\n", devno, ino); #endif if (ino <= ROOTINODE || ino >= devinodes(dev)) @@ -211,16 +211,16 @@ void i_free(dev_t devno, ino_t ino) if (bitmap_set(devno, ino, 0, dev->s_bitmap_inode, dev->s_bitmap_block) != 1) { -#if DEBUG > 1 - kprintf("i_free() returning, error\n"); +#if DEBUG >= 4 + dprintf(4, "i_free() returning, error\n"); #endif return; /* always an i/o error (or very bad !!) */ } ++dev->s_tinode; #if 0 /* remove support for the original UZI filesystem */ -#if DEBUG > 1 - kprintf("i_free() returning, success\n"); +#if DEBUG >= 4 + dprintf(4, "i_free() returning, success\n"); #endif return; /* crude way to skip inode list processing */ } @@ -232,8 +232,8 @@ void i_free(dev_t devno, ino_t ino) if (dev->s_ninode < FSFREEINODES) dev->s_inode[dev->s_ninode++] = ino; #endif -#if DEBUG > 1 - kprintf("i_free() returning, success\n"); +#if DEBUG >= 4 + dprintf(4, "i_free() returning, success\n"); #endif } @@ -540,10 +540,13 @@ inoptr i_open(dev_t devno, ino_t ino) dinode_t *buf; inoptr ip, nindex; uchar i, newn, mode0; +#if 1 /* Nick free bitmap */ + uchar refs0; +#endif static inoptr nexti = i_tab; /* rover ptr */ -#if DEBUG > 1 - kprintf("i_open(%u, %u) starting\n", devno, ino); +#if DEBUG >= 3 + dprintf(3, "i_open(%u, %u) starting\n", devno, ino); #endif if ((dev = findfs(devno)) == NULL) @@ -554,9 +557,9 @@ inoptr i_open(dev_t devno, ino_t ino) goto Err; /* errno is already set by i_alloc */ ++newn; } -/* kprintf("ino = %u\n", ino); */ -/* kprintf("dev -> %u\n", dev - fs_tab); */ -/* kprintf("devinodes(dev) = %u\n", devinodes(dev)); */ +/* dprintf(2, "ino = %u\n", ino); */ +/* dprintf(2, "dev -> %u\n", dev - fs_tab); */ +/* dprintf(2, "devinodes(dev) = %u\n", devinodes(dev)); */ if (ino < ROOTINODE || ino >= devinodes(dev)) { warning(badinomsg, "i_open", ino); goto Err; @@ -565,28 +568,28 @@ inoptr i_open(dev_t devno, ino_t ino) nindex = NULL; i = 0; ip = nexti; -/* kprintf("{ "); */ +/* dprintf(2, "{ "); */ while (i != ITABSIZE) { nexti = ip; if (++ip >= i_tab + ITABSIZE) ip = i_tab; -/* kprintf("%u ", ip - i_tab); */ +/* dprintf(2, "%u ", ip - i_tab); */ if (ip->c_refs == 0) nindex = ip; /* candidate for discarding */ if (ip->c_dev == devno && ip->c_num == ino) { nindex = ip; -/* kprintf("} "); */ +/* dprintf(2, "} "); */ goto found; /* really found */ } ++i; } -/* kprintf("} "); */ +/* dprintf(2, "} "); */ /* Not already in table - take last candidate */ if (nindex == NULL) { /* No unrefed slots in inode table */ udata.u_error = ENFILE; goto Err; } -/* kprintf("reading(%u, %u) ", inodeblock(dev, ino), inodeoffset(ino)); */ +/* dprintf(2, "reading(%u, %u) ", inodeblock(dev, ino), inodeoffset(ino)); */ /* discard oldest? inode from table and read the inode from disk */ buf = (dinode_t *)bread(devno, inodeblock(dev, ino), 0); if (buf == NULL) goto Err; @@ -598,25 +601,37 @@ inoptr i_open(dev_t devno, ino_t ino) nindex->c_num = ino; nindex->c_ro = dev->s_ronly; found: -/* kprintf("found(%u, 0%o) ", nindex->c_node.i_nlink, nindex->c_node.i_mode); */ +/* dprintf(2, "found(%u, 0%o) ", nindex->c_node.i_nlink, nindex->c_node.i_mode); */ mode0 = (getmode(nindex) == 0); +#if 1 /* Nick free bitmap */ + /* need to check for the special case of working on an erased file */ + refs0 = (nindex->c_refs == 0) && (nindex->c_node.i_nlink == 0); +#endif if (newn) { /* RO fs can't do i_alloc()! */ /* newly allocated disk inode must be clean */ +#if 1 /* Nick free bitmap */ + if (!refs0 || !mode0) +#else if (nindex->c_node.i_nlink || !mode0) +#endif goto badino; } /* and vice versa */ +#if 1 /* Nick free bitmap */ + else if (refs0 || mode0) +#else else if (nindex->c_node.i_nlink == 0 || mode0) +#endif goto badino; i_ref(nindex); /* yet one ref */ -#if DEBUG > 1 - kprintf("i_open() returning %u, success\n", nindex - i_tab); +#if DEBUG >= 3 + dprintf(3, "i_open() returning %u, success\n", nindex - i_tab); #endif return nindex; badino: warning(badinomsg, "i_open (disk)", ino); /* nindex - i_tab); */ Err: -#if DEBUG > 1 - kprintf("i_open() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "i_open() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -637,8 +652,8 @@ int ch_link(inoptr wd, char *oldname, char *newname, inoptr nindex) direct_t curentry; int i; -#if DEBUG > 1 - kprintf("ch_link(%u, \"%s\", \"%s\", %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "ch_link(%u, \"%s\", \"%s\", %u) starting\n", wd - i_tab, oldname, newname, nindex - i_tab); #endif @@ -693,8 +708,8 @@ int ch_link(inoptr wd, char *oldname, char *newname, inoptr nindex) if (udata.u_error) { Err: -#if DEBUG > 1 - kprintf("ch_link() returning 0, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "ch_link() returning 0, error %u\n", udata.u_error); #endif return 0; } @@ -704,8 +719,8 @@ Err: wd->c_node.i_size += BUFSIZE; } setftim(wd, A_TIME | M_TIME | C_TIME); /* And sets c_dirty */ -#if DEBUG > 1 - kprintf("ch_link() returning 1, success\n"); +#if DEBUG >= 3 + dprintf(3, "ch_link() returning 1, success\n"); #endif return 1; } @@ -763,8 +778,8 @@ int namecomp(uchar *n1, uchar *n2) { uchar n = DIRNAMELEN; -#if DEBUG > 2 - kprintf("namecomp(\"%s\", \"%s\") starting\n", n1, n2); +#if DEBUG >= 5 + dprintf(5, "namecomp(\"%s\", \"%s\") starting\n", n1, n2); #endif while (*n1 && *n1 != '/') { @@ -772,22 +787,22 @@ int namecomp(uchar *n1, uchar *n2) goto NotEq; if (--n == 0) { -#if DEBUG > 2 - kprintf("namecomp() returning -1, error\n"); +#if DEBUG >= 5 + dprintf(5, "namecomp() returning -1, error\n"); #endif return (-1); /* first name too long - ignore this */ } } if (*n2 == '\0' || *n2 == '/') { -#if DEBUG > 2 - kprintf("namecomp() returning -1, match\n"); +#if DEBUG >= 5 + dprintf(5, "namecomp() returning -1, match\n"); #endif return 1; /* names matched */ } NotEq: -#if DEBUG > 2 - kprintf("namecomp() returning 0, no match\n"); +#if DEBUG >= 5 + dprintf(5, "namecomp() returning 0, no match\n"); #endif return 0; } @@ -806,21 +821,21 @@ inoptr newfile(inoptr pino, char *name) { register inoptr nindex; -#if DEBUG > 1 - kprintf("newfile(%u, \"%s\") starting\n", pino - i_tab, name); +#if DEBUG >= 3 + dprintf(3, "newfile(%u, \"%s\") starting\n", pino - i_tab, name); #endif if ((getperm(pino) & S_IOWRITE) == 0) { udata.u_error = EPERM; -#if DEBUG > 1 - kprintf("newfile() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "newfile() returning NULL, error %u\n", udata.u_error); #endif return 0; } if ((nindex = i_open(pino->c_dev, NULLINO)) == NULL) { -#if DEBUG > 1 - kprintf("newfile() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "newfile() returning NULL, error %u\n", udata.u_error); #endif goto Ret; /* can't create new inode */ } @@ -839,14 +854,14 @@ inoptr newfile(inoptr pino, char *name) #endif i_deref(nindex); /* can't enter new file to directory */ nindex = NULL; -#if DEBUG > 1 - kprintf("newfile() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "newfile() returning NULL, error %u\n", udata.u_error); #endif } -#if DEBUG > 1 +#if DEBUG >= 3 else { - kprintf("newfile() returning %u, success\n", nindex - i_tab); + dprintf(3, "newfile() returning %u, success\n", nindex - i_tab); } #endif Ret: i_deref(pino); @@ -859,14 +874,14 @@ int doclose(uchar fd) register inoptr ino = getinode(fd); uchar oftindex; -#if DEBUG > 1 - kprintf("doclose(%u) starting\n", (unsigned int)fd); +#if DEBUG >= 3 + dprintf(3, "doclose(%u) starting\n", (unsigned int)fd); #endif if (ino == NULL) { -#if DEBUG > 1 - kprintf("doclose() returning -1, error\n"); +#if DEBUG >= 3 + dprintf(3, "doclose() returning -1, error\n"); #endif return (-1); } @@ -877,8 +892,8 @@ int doclose(uchar fd) d_close(DEVNUM(ino)); udata.u_files[fd] = -1; oft_deref(oftindex); -#if DEBUG > 1 - kprintf("doclose() returning 0, success\n"); +#if DEBUG >= 3 + dprintf(3, "doclose() returning 0, success\n"); #endif return 0; } @@ -894,8 +909,8 @@ ino_t i_alloc(dev_t devno) dinode_t *buf, *bp; fsptr dev = getfs(devno); -#if DEBUG > 1 - kprintf("i_alloc(%u) starting\n", devno); +#if DEBUG >= 4 + dprintf(4, "i_alloc(%u) starting\n", devno); #endif if (dev->s_ronly) { @@ -937,8 +952,8 @@ found_inode: if (ino <= ROOTINODE || ino >= devinodes(dev)) goto Corrupt; --dev->s_tinode; -#if DEBUG > 1 - kprintf("i_alloc() returning %u, success\n", ino); +#if DEBUG >= 4 + dprintf(4, "i_alloc() returning %u, success\n", ino); #endif return ino; #if 0 /* remove support for the original UZI filesystem */ @@ -949,7 +964,7 @@ found_inode: sys_sync(); /* Make on-disk inodes consistent */ k = 0; blk = 0; -/* kprintf("[ "); */ +/* dprintf(2, "[ "); */ while (blk != dev->s_isize) { if ((bp = buf = (dinode_t *)bread(devno, blk+dev->s_reserv, 0)) == NULL) goto Err; @@ -957,7 +972,7 @@ found_inode: while (j != DINODESPERBLOCK) { if (bp->i_mode == 0 && bp->i_nlink == 0) /* { */ -/* kprintf("%d ", blockinodes(blk) + j); */ +/* dprintf(2, "%d ", blockinodes(blk) + j); */ dev->s_inode[k++] = blockinodes(blk) + j; /* } */ if (k == FSFREEINODES) { @@ -973,7 +988,7 @@ found_inode: break; } Done: -/* kprintf("] "); */ +/* dprintf(2, "] "); */ if (k == 0) { /* no free inodes on disk */ if (dev->s_tinode) goto Corrupt; @@ -987,8 +1002,8 @@ Corrupt:warning(badfsmsg, "i_alloc", devno); dev->s_mounted = ~SMOUNTED; /* mark device as bad */ Err: udata.u_error = ENOSPC; Err1: -#if DEBUG > 1 - kprintf("i_alloc() returning NULLINO, error %u\n", udata.u_error); +#if DEBUG >= 4 + dprintf(4, "i_alloc() returning NULLINO, error %u\n", udata.u_error); #endif return NULLINO; } @@ -1011,8 +1026,8 @@ blkno_t blk_alloc(dev_t devno, uchar dirty) /* Nick dirty */ register fsptr dev = getfs(devno); /* int i; */ -#if DEBUG > 1 - kprintf("blk_alloc(%u, %u) starting\n", devno, (unsigned)dirty); +#if DEBUG >= 4 + dprintf(4, "blk_alloc(%u, %u) starting\n", devno, (unsigned)dirty); #endif if (dev->s_ronly) { @@ -1043,17 +1058,17 @@ blkno_t blk_alloc(dev_t devno, uchar dirty) /* Nick dirty */ goto Corrupt; #else nf = dev->s_nfree; -/* kprintf("nf = %u\n", nf); */ +/* dprintf(2, "nf = %u\n", nf); */ if (nf <= 0 || nf > FSFREEBLOCKS) /* { */ -/* kprintf("nf out of range\n"); */ +/* dprintf(2, "nf out of range\n"); */ goto Corrupt; /* } */ #endif if (0 == (newno = dev->s_free[--dev->s_nfree])) { if (dev->s_tfree != 0) /* { */ -/* kprintf("dev->s_tfree != 0\n"); */ +/* dprintf(2, "dev->s_tfree != 0\n"); */ goto Corrupt; /* } */ ++dev->s_nfree; @@ -1063,15 +1078,15 @@ blkno_t blk_alloc(dev_t devno, uchar dirty) /* Nick dirty */ if (dev->s_nfree == 0) { if ((buf = bread(devno, newno, 0)) == NULL) goto Err; -/* kprintf("buf[0] = %u\n", ((blkno_t *)buf)[0]); */ +/* dprintf(2, "buf[0] = %u\n", ((blkno_t *)buf)[0]); */ dev->s_nfree = ((blkno_t *)buf)[0]; bcopy(((blkno_t *)buf)+1,dev->s_free,sizeof(dev->s_free)); -/* kprintf("< "); */ +/* dprintf(2, "< "); */ /* for (i = 0; i < dev->s_nfree; i++) */ /* { */ -/* kprintf("%u ", dev->s_free[i]); */ +/* dprintf(2, "%u ", dev->s_free[i]); */ /* } */ -/* kprintf("> "); */ +/* dprintf(2, "> "); */ if (brelse((bufptr)buf) < 0) goto Err; } @@ -1082,7 +1097,7 @@ found_block: validblk(devno, newno); if (dev->s_tfree == 0) /* { */ -/* kprintf("dev->s_tfree == 0\n"); */ +/* dprintf(2, "dev->s_tfree == 0\n"); */ goto Corrupt; /* } */ --dev->s_tfree; @@ -1095,8 +1110,8 @@ found_block: if (bawrite((bufptr)buf) < 0) /* write back */ #endif goto Err; -#if DEBUG > 1 - kprintf("blk_alloc() returning %u, success\n", newno); +#if DEBUG >= 4 + dprintf(4, "blk_alloc() returning %u, success\n", newno); #endif return newno; @@ -1104,8 +1119,8 @@ Corrupt:warning(badfsmsg, "blk_alloc", devno); dev->s_mounted = ~SMOUNTED; Err: udata.u_error = ENOSPC; Err1: -#if DEBUG > 1 - kprintf("blk_alloc() returning 0, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "blk_alloc() returning 0, error %u\n", udata.u_error); #endif return 0; } @@ -1123,15 +1138,15 @@ void blk_free(dev_t devno, blkno_t blk) #endif register fsptr dev = getfs(devno); -#if DEBUG > 1 - kprintf("blk_free(%u, %u) starting\n", devno, blk); +#if DEBUG >= 4 + dprintf(4, "blk_free(%u, %u) starting\n", devno, blk); #endif if (dev->s_ronly || blk == 0) { End: -#if DEBUG > 1 - kprintf("blk_free() returning, error\n"); +#if DEBUG >= 4 + dprintf(4, "blk_free() returning, error\n"); #endif return; } @@ -1157,8 +1172,8 @@ End: ++dev->s_tfree; #if 0 /* remove support for the original UZI filesystem */ -#if DEBUG > 1 - kprintf("blk_free() returning, success\n"); +#if DEBUG >= 4 + dprintf(4, "blk_free() returning, success\n"); #endif return; /* crude way to skip free list processing */ } @@ -1179,8 +1194,8 @@ End: ++dev->s_tfree; dev->s_free[dev->s_nfree++] = blk; #endif -#if DEBUG > 1 - kprintf("blk_free() returning, success\n"); +#if DEBUG >= 4 + dprintf(4, "blk_free() returning, success\n"); #endif } @@ -1191,16 +1206,16 @@ uchar oft_alloc(void) register ofptr op = of_tab; uchar j = 0; -#if DEBUG > 1 - kprintf("oft_alloc() starting\n"); +#if DEBUG >= 4 + dprintf(4, "oft_alloc() starting\n"); #endif while (j != OFTSIZE) { if (op->o_refs == 0) { bzero(op, sizeof(oft_t)); /* zero out all fields */ op->o_refs++; -#if DEBUG > 1 - kprintf("oft_alloc() returning %u, success\n", (unsigned int)j); +#if DEBUG >= 4 + dprintf(4, "oft_alloc() returning %u, success\n", (unsigned int)j); #endif return j; } @@ -1208,8 +1223,8 @@ uchar oft_alloc(void) ++j; } udata.u_error = ENFILE; -#if DEBUG > 1 - kprintf("oft_alloc() returning -1, error %u\n", udata.u_error); +#if DEBUG >= 4 + dprintf(4, "oft_alloc() returning -1, error %u\n", udata.u_error); #endif return (-1); } @@ -1221,16 +1236,16 @@ void oft_deref(uchar of) { register ofptr op = of_tab + of; -#if DEBUG > 1 - kprintf("oft_deref(%u) starting\n", (unsigned int)of); +#if DEBUG >= 4 + dprintf(4, "oft_deref(%u) starting\n", (unsigned int)of); #endif if (--op->o_refs == 0 && op->o_inode != NULL) { i_deref(op->o_inode); op->o_inode = NULL; } -#if DEBUG > 1 - kprintf("oft_deref() returning, refs %u\n", op->o_refs); +#if DEBUG >= 4 + dprintf(4, "oft_deref() returning, refs %u\n", op->o_refs); #endif } @@ -1241,15 +1256,15 @@ uchar uf_alloc(void) register uchar j = 0; register uchar *p = udata.u_files; -#if DEBUG > 1 - kprintf("uf_alloc() starting\n"); +#if DEBUG >= 4 + dprintf(4, "uf_alloc() starting\n"); #endif while (j != UFTSIZE) { if (freefileentry(*p)) { -#if DEBUG > 1 - kprintf("uf_alloc() returning %u, success\n", (unsigned int)j); +#if DEBUG >= 4 + dprintf(4, "uf_alloc() returning %u, success\n", (unsigned int)j); #endif return j; } @@ -1257,8 +1272,8 @@ uchar uf_alloc(void) ++j; } udata.u_error = ENFILE; -#if DEBUG > 1 - kprintf("uf_alloc() returning -1, error %u\n", udata.u_error); +#if DEBUG >= 4 + dprintf(4, "uf_alloc() returning -1, error %u\n", udata.u_error); #endif return (-1); } @@ -1280,8 +1295,8 @@ uchar isdevice(inoptr ino) */ void freeblk(dev_t dev, blkno_t blk, uchar level) { -#if DEBUG > 2 - kprintf("freeblk(%u, %u, %u) starting\n", dev, blk, (unsigned int)level); +#if DEBUG >= 3 + dprintf(3, "freeblk(%u, %u, %u) starting\n", dev, blk, (unsigned int)level); #endif if (blk != 0) { @@ -1298,14 +1313,14 @@ void freeblk(dev_t dev, blkno_t blk, uchar level) } } blk_free(dev, blk); -#if DEBUG > 2 - kprintf("freeblk() returning, success\n"); +#if DEBUG >= 3 + dprintf(3, "freeblk() returning, success\n"); #endif } -#if DEBUG > 2 +#if DEBUG >= 3 else { - kprintf("freeblk() returning, error\n"); + dprintf(3, "freeblk() returning, error\n"); } #endif } @@ -1320,8 +1335,8 @@ void f_trunc(inoptr ino) blkno_t *blk = ip->i_addr; register uchar j; -#if DEBUG > 1 - kprintf("f_trunc(%u) starting\n", ino - i_tab); +#if DEBUG >= 3 + dprintf(3, "f_trunc(%u) starting\n", ino - i_tab); #endif /* First deallocate the double indirect blocks */ @@ -1337,8 +1352,8 @@ void f_trunc(inoptr ino) bzero(ip->i_addr, sizeof(blkno_t)*TOTALREFBLOCKS); ino->c_dirty = 1; ip->i_size = 0; -#if DEBUG > 1 - kprintf("f_trunc() returning\n"); +#if DEBUG >= 3 + dprintf(3, "f_trunc() returning\n"); #endif } @@ -1354,15 +1369,15 @@ blkno_t bmap(inoptr ip, blkno_t bn, uchar rdflg) register uint i, j, sh; register blkno_t *bp, nb; -#if DEBUG > 1 - kprintf("bmap(%u, %u, %u) starting\n", ip - i_tab, bn, (unsigned int)rdflg); -/* kprintf("xx %u %u\n", i_tab[38].c_node.i_addr[3], udata.u_page); */ +#if DEBUG >= 3 + dprintf(3, "bmap(%u, %u, %u) starting\n", ip - i_tab, bn, (unsigned int)rdflg); +/* dprintf(2, "xx %u %u\n", i_tab[38].c_node.i_addr[3], udata.u_page); */ #endif if (isdevice(ip)) /* block devices */ { -#if DEBUG > 1 - kprintf("bmap() returning %u, direct\n", bn); +#if DEBUG >= 3 + dprintf(3, "bmap() returning %u, direct\n", bn); #endif return bn; /* map directly */ } @@ -1406,8 +1421,8 @@ blkno_t bmap(inoptr ip, blkno_t bn, uchar rdflg) if ((bp = (blkno_t *)bread(dev, nb, 0)) == NULL) { Err: -#if DEBUG > 1 - kprintf("bmap() returning NULLBLK, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "bmap() returning NULLBLK, error %u\n", udata.u_error); #endif return NULLBLK; } @@ -1435,8 +1450,8 @@ Err: ++j; } Ok: -#if DEBUG > 1 - kprintf("bmap() returning %u, success\n", nb); +#if DEBUG >= 3 + dprintf(3, "bmap() returning %u, success\n", nb); #endif return nb; } @@ -1546,11 +1561,11 @@ Ok: fp->s_mounted = ~SMOUNTED; register int i; for (i = SUPERBLOCK; i < 0x400; ++i) { - kprintf("reading sector 0x%x\n", i); + dprintf(2, "reading sector 0x%x\n", i); buf = bread(dev, i, 0); if (*(int *)buf == SMOUNTED) { - kprintf("formatted at sector 0x%x\n", i - SUPERBLOCK); + dprintf(2, "formatted at sector 0x%x\n", i - SUPERBLOCK); panic("stop"); } brelse((bufptr)buf); diff --git a/src/kernel/uzi/hdconf.h b/src/kernel/uzi/hdconf.h index be331703..fae005f3 100644 --- a/src/kernel/uzi/hdconf.h +++ b/src/kernel/uzi/hdconf.h @@ -54,7 +54,7 @@ #define HD0_Start 0 /* sentinel value indicating the ramdrive */ #define HD0_Size 0x600 /* define a harddrive of size 768 kbytes */ -#define HD1_Start 0x39 /*0x239 /*0x259 /*0x2bb /* just after HYTDISK.DAT finishes */ +#define HD1_Start 0x59 /*0x239 /*0x259 /*0x2bb /* just after HYTDISK.DAT finishes */ #define HD1_Size 0x2000 /* define a harddrive of size 4 Mbytes */ #else #define HD0_Start 3000 /* 1st Drive Start. CP/M uses first 3000 "tracks" */ diff --git a/src/kernel/uzi/machdep.c b/src/kernel/uzi/machdep.c index 1a327888..a66309c4 100644 --- a/src/kernel/uzi/machdep.c +++ b/src/kernel/uzi/machdep.c @@ -176,7 +176,7 @@ void kputs(s) #endif #endif -#if DEBUG > 0 +#if DEBUG >= 1 /* _idump() dumps state of all inodes */ static void _idump(void) diff --git a/src/kernel/uzi/main.c b/src/kernel/uzi/main.c index eb3c2860..229c500f 100644 --- a/src/kernel/uzi/main.c +++ b/src/kernel/uzi/main.c @@ -1,6 +1,6 @@ /* main.c for uzi180 by Nick - initialises CMX and then starts UZI as a task */ -#define POLLED /* causes console I/O to be output via abyte() */ +/* #define POLLED */ /* causes console I/O to be output via abyte() */ #include "vendor.h" /* Nick, must come first */ #include @@ -429,12 +429,12 @@ int scsiop(void) return 0; #endif -#if DEBUG > 1 - kprintf("scsiop: %c %u+%u,%u -> 0x%x\n", cmdblk[1], - (unsigned int)hd_sector, - (unsigned int)hd_offset, - (unsigned int)cmdblk[7], - (unsigned int)dptr); +#if DEBUG >= 2 + dprintf(2, "scsiop: %c %u+%u,%u -> 0x%x\n", cmdblk[1], + (unsigned int)hd_sector, + (unsigned int)hd_offset, + (unsigned int)cmdblk[7], + (unsigned int)dptr); #endif /* check for special hd_offset indicating the ramdrive is wanted */ @@ -447,11 +447,11 @@ int scsiop(void) switch(cmdblk[1]) { case 'R': -/* kprintf("R %08lx -> %08lx, %04x\n", hd_sector, hd_offset, j); */ +/* dprintf(2, "R %08lx -> %08lx, %04x\n", hd_sector, hd_offset, j); */ copyr(hd_sector, hd_offset, j); break; case 'W': -/* kprintf("W %08lx -> %08lx, %04x\n", hd_offset, hd_sector, j); */ +/* dprintf(2, "W %08lx -> %08lx, %04x\n", hd_offset, hd_sector, j); */ copyr(hd_offset, hd_sector, j); break; } diff --git a/src/kernel/uzi/process.c b/src/kernel/uzi/process.c index 5ed822ff..98c7887c 100644 --- a/src/kernel/uzi/process.c +++ b/src/kernel/uzi/process.c @@ -72,7 +72,7 @@ init2() /* User's file table */ for (j=udata.u_files; j < (udata.u_files+UFTSIZE); ++j) - *j = -1; + *j = -1; /* please see freefileentry() macro in unix.h */ /* abyte('c'); */ ei_absolute(); /* Nick */ @@ -277,6 +277,9 @@ ptptr p; { register char *j; +/* abyte('['); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + /* Note that ptab_alloc clears most of the entry */ di_absolute(); /* Nick */ /* p_swap is replaced by p_page for UZI180 Banked memory access. It is @@ -317,10 +320,22 @@ ptptr p; p->p_priority = MAXTICKS; #endif +/* abyte('\\'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ +/* di_absolute(); */ + for (j=udata.u_files; j < (udata.u_files+UFTSIZE); ++j) +#if 1 /* Nick, to sidestep signed vs unsigned char issues */ + if (freefileentry(*j) == 0) +#else if (*j >= 0) +#endif ++of_tab[*j].o_refs; ei_absolute(); /* Nick */ + +/* abyte(']'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + } @@ -335,6 +350,9 @@ ptab_alloc() register ptptr pp; static int nextpid = 0; +/* abyte('('); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + di_absolute(); /* Nick */ for (p=ptab; p < ptab+PTABSIZE; ++p) { @@ -342,6 +360,14 @@ ptab_alloc() goto found; } ei_absolute(); /* Nick */ + +#if DEBUG >= 2 /* Nick */ + dprintf(2, "process table full\n"); +#endif + +/* abyte('*'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + return (NULL); found: @@ -364,6 +390,14 @@ nogood: p->p_status = P_FORKING; ei_absolute(); /* Nick */ + +#if DEBUG >= 2 /* Nick */ + dprintf(2, "process %d starting\n", p->p_pid); +#endif + +/* abyte(')'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + return (p); } @@ -457,7 +491,7 @@ unix2() ei_absolute(); /* Nick */ /* abyte('1'); */ -#if DEBUG > 0 && !defined(UTIL) +#if DEBUG && !defined(UTIL) if (traceon) { #if 1 @@ -476,7 +510,7 @@ unix2() udata.u_retval = (*disp_tab[udata.u_callno])(); /* abyte('3'); */ -#if DEBUG > 0 && !defined(UTIL) +#if DEBUG && !defined(UTIL) if (traceon) { #if 1 @@ -535,8 +569,8 @@ chksigs() if (udata.u_sigvec[j] == SIG_DFL) { ei_absolute(); /* Nick */ -#ifdef DEBUG - kprintf("process terminated by signal %d: ", j); /* Nick %d */ +#if DEBUG >= 2 + dprintf(2, "process terminated by signal %d: ", j); /* Nick %d */ #endif doexit (0, j); } diff --git a/src/kernel/uzi/scall1.c b/src/kernel/uzi/scall1.c index c6414fed..467b352a 100644 --- a/src/kernel/uzi/scall1.c +++ b/src/kernel/uzi/scall1.c @@ -949,12 +949,12 @@ inoptr n_creat(char *name, bool_t new, mode_t mode) #if 1 char fname[15]; #endif -#if DEBUG > 1 +#if DEBUG >= 3 char *buf; buf = tmpbuf(); ugets(name, buf, 512); - kprintf("n_creat(\"%s\", %d, 0%o)\n", buf, new, mode); + dprintf(3, "n_creat(\"%s\", %d, 0%o)\n", buf, new, mode); brelse((bufptr)buf); #endif @@ -1023,16 +1023,16 @@ inoptr n_creat(char *name, bool_t new, mode_t mode) #else goto Err; #endif -#if DEBUG > 1 - kprintf("n_creat() returning %u, success\n", ino - i_tab); +#if DEBUG >= 3 + dprintf(3, "n_creat() returning %u, success\n", ino - i_tab); #endif return ino; Err1: i_deref(parent); Err: if (ino) i_deref(ino); -#if DEBUG > 1 - kprintf("n_creat() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "n_creat() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -1049,14 +1049,14 @@ void readwritei(char write, inoptr ino) dev_t dev = ino->c_dev; bool_t ispipe = 0; -#if DEBUG > 1 - kprintf("readwritei(%u, %u) starting\n", (unsigned int)write, ino - i_tab); +#if DEBUG >= 3 + dprintf(3, "readwritei(%u, %u) starting\n", (unsigned int)write, ino - i_tab); #endif if (write && ino->c_ro) { UERR = EROFS; -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1065,8 +1065,8 @@ void readwritei(char write, inoptr ino) UCNT = write ? cdwrite(DEVNUM(ino)) : cdread(DEVNUM(ino)); if ((int)UCNT != -1) addoff(&UOFFS, UCNT); -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; case S_IFLNK: /* sym link */ @@ -1081,8 +1081,8 @@ void readwritei(char write, inoptr ino) /* See if offset is beyond end of file */ if ((unsigned long)UOFFS >= (unsigned long)ISIZE(ino)) { UCNT = 0; -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1102,8 +1102,8 @@ void readwritei(char write, inoptr ino) UCNT = -1; UERR = EPIPE; ssig(udata.u_ptab, SIGPIPE); -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1151,8 +1151,8 @@ loop: while (todo) { * it's not really an error. it just means EOF... */ if (UERR == EFAULT) UERR = 0; -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1172,8 +1172,8 @@ loop: while (todo) { bp = bread(dev, pblk, (amount == BUFSIZE)); if (bp == NULL) { -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1191,8 +1191,8 @@ loop: while (todo) { #endif if (bfree((bufptr)bp, 2) < 0) { -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1211,8 +1211,8 @@ loop: while (todo) { #endif if (brelse((bufptr)bp) < 0) { -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1240,16 +1240,16 @@ loop: while (todo) { ino->c_dirty = 1; } } -#if DEBUG > 1 - kprintf("readwritei() returning, success\n"); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, success\n"); #endif return; default: error: UERR = ENODEV; if (!write) UCNT = -1; -#if DEBUG > 1 - kprintf("readwritei() returning, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "readwritei() returning, error %u\n", udata.u_error); #endif return; } @@ -1261,16 +1261,16 @@ inoptr rwsetup(uchar fd, void *base, uint cnt, uchar rdflag) register inoptr ino; register ofptr oftp; -#if DEBUG > 1 - kprintf("rwsetup(%u, 0x%x, %u, %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "rwsetup(%u, 0x%x, %u, %u) starting\n", (unsigned int)fd, base, cnt, (unsigned int)rdflag); #endif if ((ino = getinode(fd)) == NULL) /* check fd */ { Err1: -#if DEBUG > 1 - kprintf("rwsetup() returning NULL, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "rwsetup() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -1287,8 +1287,8 @@ Err1: #if 1 /* Nick */ udata.u_sysio = 0; /* transfer is to be done on behalf of user */ #endif -#if DEBUG > 1 - kprintf("rwsetup() returning %u, success\n", ino - i_tab); +#if DEBUG >= 3 + dprintf(3, "rwsetup() returning %u, success\n", ino - i_tab); #endif return ino; } @@ -1322,7 +1322,7 @@ int pdat(struct s_pdata *ubuf) { bcopy(tmpbuf->u_name, ubuf->u_name, DIRNAMELEN); ubuf->u_insys = tmpbuf->u_insys; ubuf->u_callno = tmpbuf->u_callno; -#if DEBUG > 1 +#if DEBUG ubuf->u_traceme = tmpbuf->u_traceme; #else ubuf->u_traceme = 0; diff --git a/src/kernel/uzi/scall2.c b/src/kernel/uzi/scall2.c index 3635a151..33c691f8 100644 --- a/src/kernel/uzi/scall2.c +++ b/src/kernel/uzi/scall2.c @@ -318,15 +318,19 @@ int16 val2; register int16 j; register ptptr p; -#if DEBUG > 1 - kprintf ("process %d exiting\n", udata.u_ptab->p_pid); +#if DEBUG >= 2 + dprintf(2, "process %d exiting\n", udata.u_ptab->p_pid); #endif di(); for (j=0; j < UFTSIZE; ++j) { +#if 1 /* Nick, to sidestep signed vs unsigned char issues */ + if (freefileentry(udata.u_files[j]) == 0) +#else if (udata.u_files[j] >= 0) /* Portable equivalent of == -1 */ +#endif doclose (j); } @@ -347,7 +351,7 @@ int16 val2; /* See if we have any children. Set child's parents to our parent */ for (p=ptab; p < ptab+PTABSIZE; ++p) { - if (p->p_status && p->p_pptr == udata.u_ptab && p != udata.u_ptab) + if (p->p_status && p->p_pptr == udata.u_ptab && p != udata.u_ptab) p->p_pptr = udata.u_ptab->p_pptr; } ei(); @@ -597,13 +601,21 @@ int sys_getset(void) udata.u_mask = parm1 & S_UMASK; return old; case SET_TRACE: -#if DEBUG > 1 - if (parm1 < 0) traceon = 1; - else if (parm1 > 0) udata.u_traceme = 1; - else if (udata.u_traceme) udata.u_traceme = 0; - else traceon = 0; +#if DEBUG + old = udata.u_traceme; + udata.u_traceme = parm1; + return old; +#else + goto Ok; #endif + case SET_DEBUG: +#if DEBUG + old = udata.u_debugme; + udata.u_debugme = parm1; + return old; +#else goto Ok; +#endif } UERR = EPERM; Err: return (-1); diff --git a/src/kernel/uzi/systrace.c b/src/kernel/uzi/systrace.c index ffae234e..68c3e7df 100644 --- a/src/kernel/uzi/systrace.c +++ b/src/kernel/uzi/systrace.c @@ -180,6 +180,9 @@ void systrace_entry(void) unsigned int value; unsigned char type; +/* abyte('{'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + /* kprintf("word at 0x83f8 = 0x%x\n", ugetw(0x83f8)); */ kprintf ("\tpid %d, call %d", @@ -219,6 +222,9 @@ void systrace_exit(void) { register unsigned char type; +/* abyte('}'); */ +/* ahexw(*(int *)(0xc931 + 0x9a)); */ + kprintf ("\t\tpid %d, call %d, ret ", udata.u_ptab->p_pid, udata.u_callno); diff --git a/src/kernel/uzi/unix.h b/src/kernel/uzi/unix.h index d75b5c50..4ec9c3d3 100644 --- a/src/kernel/uzi/unix.h +++ b/src/kernel/uzi/unix.h @@ -709,7 +709,8 @@ typedef struct u_data { uzitime_t u_cstime; char u_page; /* Process' MMU Base Address */ inoptr u_root; /* Index into inode table of chroot target */ - char u_traceme; /* added by Nick, used only when DEBUG > 1 */ + char u_traceme; /* added by Nick, used only ifdef DEBUG */ + char u_debugme; /* added by Nick, used only ifdef DEBUG */ #if 1 char u_files[UFTSIZE]; /* Process file table: indices into open file table. */ @@ -962,6 +963,7 @@ typedef struct s_kdata { #define SET_PRIO 9 /* set process priority */ #define SET_UMASK 10 /* get/set umask */ #define SET_TRACE 11 /* set trace flag */ +#define SET_DEBUG 12 /* set debug flag */ #endif diff --git a/src/kernel/uzi/vendor.h b/src/kernel/uzi/vendor.h index 1884199c..32434c4f 100644 --- a/src/kernel/uzi/vendor.h +++ b/src/kernel/uzi/vendor.h @@ -18,6 +18,7 @@ #define di_absolute _di_absolute #define doexec _doexec #define dofork _dofork +#define dprintf _dprintf #define dptr _dptr #define dTbl _dTbl #define ei _ei @@ -64,6 +65,7 @@ #if 1 /* Nick, see kprintf.c */ int kprintf(char *, ...); /* ensures IAR won't try to pass register params */ +int dprintf(char debuglevel, char *fmt, ...); #else void kprintf(char *, ...); /* ensures IAR won't try to pass register params */ #endif diff --git a/src/kernel/uzi/xip.c b/src/kernel/uzi/xip.c index 1f4e3eff..af25ba8c 100644 --- a/src/kernel/uzi/xip.c +++ b/src/kernel/uzi/xip.c @@ -34,6 +34,11 @@ #include "filesys.h" /* prototypes added by Nick */ #include "xip.h" /* prototypes added by Nick */ +#if 0 +#undef DEBUG +#define DEBUG 3 /* TEMPORARY! */ +#endif + #ifdef UTIL /* rather a hack indeed */ #define EISALIGN 42 /* 42 File is already aligned */ #define ENOALIGN 43 /* 43 File is not aligned */ @@ -63,8 +68,8 @@ int bitmap_align(inoptr ino, off_t size) inoptr other; int flag, exclude, indirection; -#if DEBUG > 2 - kprintf("bitmap_align(%u, %ld) starting\n", ino - i_tab, size); +#if DEBUG >= 3 + dprintf(3, "bitmap_align(%u, %ld) starting\n", ino - i_tab, size); #endif /* return 0; */ @@ -75,8 +80,8 @@ int bitmap_align(inoptr ino, off_t size) if (dev->s_bitmap_immov >= dev->s_bitmap_final) { udata.u_error = ENOLCKFS; /* not a locking filesystem */ -#if DEBUG > 2 - kprintf("bitmap_align() returning -1 a\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_align() returning -1 a\n"); #endif return -1; } @@ -90,8 +95,8 @@ int bitmap_align(inoptr ino, off_t size) if ((ino->c_node.i_mode & S_IFMT) != S_IFREG) { udata.u_error = ENOREGALIGN; /* file not regular or aligned */ -#if DEBUG > 2 - kprintf("bitmap_ualign() returning -1 b\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_ualign() returning -1 b\n"); #endif return -1; } @@ -101,8 +106,8 @@ int bitmap_align(inoptr ino, off_t size) if (regions > (BUFSIZE / sizeof(blkno_t))) { udata.u_error = ENOSPC; /* size specified is too large */ -#if DEBUG > 2 - kprintf("bitmap_align() returning -1 c\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_align() returning -1 c\n"); #endif return -1; } @@ -149,7 +154,7 @@ int bitmap_align(inoptr ino, off_t size) } #if DEBUG > 1 - kprintf("processing my inode %d\n", ino->c_num); + dprintf(2, "processing my inode %d\n", ino->c_num); #endif /* move the file's data into unoccupied blocks of each region */ @@ -235,13 +240,15 @@ int bitmap_align(inoptr ino, off_t size) } #if DEBUG > 1 - kprintf("processing other inode %d\n", other->c_num); + dprintf(2, "processing other inode %d\n", other->c_num); #endif +#if 0 /* don't bother, since the S_IFMT bits will be invalid anyway */ if (other->c_node.i_mode == 0) { i_deref(other); continue; /* inode bitmap is bad, try to continue */ } +#endif /* check mode */ flag = other->c_node.i_mode & S_IFMT; @@ -282,7 +289,7 @@ int bitmap_align(inoptr ino, off_t size) indirection = 2; } blk = other->c_node.i_addr[i]; - if (blk == 3840) kprintf("bad @ %d,%d 0x%04x\n", other->c_num, i, &other->c_node.i_addr[i]); +/* if (blk == 3840) dprintf(3, "bad @ %d,%d 0x%04x\n", other->c_num, i, &other->c_node.i_addr[i]); */ if (blk) { pos = bitmap_align_recurse(dev, /*pos,*/ @@ -342,8 +349,8 @@ bitmap_align_error: dev->s_bitmap_final); } -#if DEBUG > 2 - kprintf("bitmap_align() returning -1 d\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_align() returning -1 d\n"); #endif return -1; } @@ -352,8 +359,8 @@ bitmap_align_error: ino->c_dirty = 1; i_sync(); /* flushing inodes */ -#if DEBUG > 2 - kprintf("bitmap_align() returning 0, success\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_align() returning 0, success\n"); #endif return 0; /* successfully aligned the file */ } @@ -365,8 +372,8 @@ int bitmap_ualign(inoptr ino, off_t size) fsptr dev; dev_t devno; -#if DEBUG > 2 - kprintf("bitmap_ualign(%u, %ld) starting\n", ino - i_tab, size); +#if DEBUG >= 3 + dprintf(3, "bitmap_ualign(%u, %ld) starting\n", ino - i_tab, size); #endif /* prepare to access the given inode */ @@ -377,8 +384,8 @@ int bitmap_ualign(inoptr ino, off_t size) region = bitmap_examine(dev, ino, size, ®ions, &blocks); if (region == NULL) { -#if DEBUG > 2 - kprintf("bitmap_ualign() returning -1 a\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_ualign() returning -1 a\n"); #endif return -1; /* error code has been setup by bitmap_examine() */ } @@ -397,8 +404,8 @@ int bitmap_ualign(inoptr ino, off_t size) { /* disk i/o error, or corrupt filesystem */ /* udata.u_error = ENXIO */; -#if DEBUG > 2 - kprintf("bitmap_ualign() returning -1 f\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_ualign() returning -1 f\n"); #endif return -1; } @@ -415,8 +422,8 @@ int bitmap_ualign(inoptr ino, off_t size) ino->c_dirty = 1; i_sync(); /* flushing inodes */ -#if DEBUG > 2 - kprintf("bitmap_ualign() returning 0\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_ualign() returning 0\n"); #endif return 0; } @@ -428,11 +435,16 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, blkno_t blk, pos, /*inc,*/ newno; blkno_t *region, regions, blocks; +#if DEBUG >= 3 + dprintf(3, "bitmap_examine(%d, %d, %ld, 0x%x, 0x%x) starting\n", + dev - fs_tab, ino - i_tab, size, regioncount, blockcount); +#endif + if (dev->s_bitmap_immov >= dev->s_bitmap_final) { udata.u_error = ENOLCKFS; /* not a locking filesystem */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL a\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -441,16 +453,16 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, if ((ino->c_node.i_mode & S_IFMT) == S_IFREG) { udata.u_error = ENOALIGN; /* file is not aligned */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL b\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u\n", udata.u_error); #endif return NULL; } if ((ino->c_node.i_mode & S_IFMT) != S_IFALIGN) { udata.u_error = ENOREGALIGN; /* file not regular or aligned */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL c\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -460,8 +472,8 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, if (regions > (BUFSIZE / sizeof(blkno_t))) { udata.u_error = ENOSPC; /* size specified is too large */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL c\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u\n", udata.u_error); #endif return NULL; } @@ -484,8 +496,8 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, if ((blk & (PAGE_BLOCKS-1)) || blk == NULLBLK) { udata.u_error = ENOALIGN; /* alignment bad */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL d\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u a\n", udata.u_error); #endif return NULL; } @@ -500,8 +512,8 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, if (newno != blk) /*|| newno == NULLBLK)*/ { udata.u_error = ENOALIGN; /* alignment bad */ -#if DEBUG > 2 - kprintf("bitmap_examine() returning NULL e\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning NULL, error %u b\n", udata.u_error); #endif return NULL; } @@ -511,6 +523,9 @@ blkno_t *bitmap_examine(fsptr dev, inoptr ino, off_t size, *regioncount = regions; *blockcount = blocks; +#if DEBUG >= 3 + dprintf(3, "bitmap_examine() returning 0x%x (%d, %d)\n", region, regions, blocks); +#endif return region; } @@ -521,12 +536,17 @@ blkno_t bitmap_align_chase(fsptr dev, inoptr ino, blkno_t blk, blkno_t pos, int i, occupied; bufptr buf, other; +#if DEBUG >= 3 + dprintf(3, "bitmap_align_chase(%d, %d, %d, %d, 0x%x, %d, %d) starting\n", + dev - fs_tab, ino - i_tab, blk, pos, region, regions, blocks); +#endif + /* check we have been passed a valid block number */ if (blk < (dev->s_reserv + dev->s_isize) || blk >= dev->s_fsize) { udata.u_error = ECORRUPTFS; -#if DEBUG > 0 - kprintf("bitmap_align_chase() 1 ino = %d, blk = %d, pos = %d\n", +#if DEBUG + dprintf(1, "bitmap_align_chase() 1 ino = %d, blk = %d, pos = %d\n", ino->c_num, blk, pos); #endif return (blkno_t)-1; /* filesystem is corrupt */ @@ -548,9 +568,12 @@ blkno_t bitmap_align_chase(fsptr dev, inoptr ino, blkno_t blk, blkno_t pos, blk >= dev->s_fsize) { udata.u_error = ECORRUPTFS; -#if DEBUG > 0 - kprintf("bitmap_align_chase() 2 ino = %d, blk = %d, pos = %d\n", +#if DEBUG + dprintf(1, "bitmap_align_chase() 2 ino = %d, blk = %d, pos = %d\n", ino->c_num, blk, pos); +#endif +#if DEBUG >= 3 + dprintf(3, "bitmap_align_chase() returning -1, error %u\n", udata.u_error); #endif return (blkno_t)-1; /* filesystem is corrupt */ } @@ -559,6 +582,9 @@ blkno_t bitmap_align_chase(fsptr dev, inoptr ino, blkno_t blk, blkno_t pos, pos = bitmap_align_reverse(blk, region, regions, blocks); if (pos == (blkno_t)-1) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_chase() returning %d, ok\n", blk); +#endif return blk; /* success, return the just-freed block */ } @@ -573,8 +599,8 @@ blkno_t bitmap_align_bmap(inoptr ino, blkno_t newno, blkno_t pos) blkno_t blk; bufptr buf, other; -#if DEBUG > 2 - kprintf("bitmap_align_bmap(%u, %u) starting\n", ino - i_tab, pos); +#if DEBUG >= 3 + dprintf(3, "bitmap_align_bmap(%u, %u) starting\n", ino - i_tab, pos); #endif devno = ino->c_dev; @@ -639,8 +665,8 @@ blkno_t bitmap_align_bmap(inoptr ino, blkno_t newno, blkno_t pos) if (buf == NULL) { Err: -#if DEBUG > 2 - kprintf("bitmap_align_bmap() returning -1, error %u\n", udata.u_error); +#if DEBUG >= 3 + dprintf(3, "bitmap_align_bmap() returning -1, error %u\n", udata.u_error); #endif return (blkno_t)-1; } @@ -665,29 +691,29 @@ Ok: goto Err; } -#if DEBUG > 2 - kprintf("getting block %d -> %d, errno = %d\n", blk, newno, udata.u_error); +#if DEBUG >= 2 + dprintf(2, "getting block %d -> %d, errno = %d\n", blk, newno, udata.u_error); #endif /* really move the block by manipulating cache entries */ other = (bufptr)bfind(devno, newno); /* hanging around in cache? */ if (other) { -/* kprintf("bufpool entry %d = block %d, dirty 0\n", other - bufpool, blk); */ +/* dprintf(3, "bufpool entry %d = block %d, dirty 0\n", other - bufpool, blk); */ other->bf_blk = blk; /* swap, for minimal overhead */ other->bf_dirty = 0; /* try to avoid writing back */ } /* revise the original cache entry to show the new block */ buf->bf_blk = newno; /* original value is in variable blk */ -/* kprintf("bufpool entry %d = block %d, dirty 1\n", buf - bufpool, newno); */ +/* dprintf(3, "bufpool entry %d = block %d, dirty 1\n", buf - bufpool, newno); */ if (bawrite(buf) < 0) /* dirty, but delay writing for the moment */ { goto Err; } -#if DEBUG > 2 - kprintf("bitmap_align_bmap() returning %u, success\n", blk); +#if DEBUG >= 3 + dprintf(3, "bitmap_align_bmap() returning %u, success\n", blk); #endif return blk; } @@ -698,8 +724,8 @@ blkno_t bitmap_align_reverse(blkno_t blk, blkno_t i, k; blkno_t pos; -#if DEBUG > 2 - kprintf("bitmap_align_reverse(%u) starting\n", blk); +#if DEBUG > 3 + dprintf(4, "bitmap_align_reverse(%u) starting\n", blk); #endif /* perform a reverse lookup of blk via the region list */ @@ -714,8 +740,8 @@ blkno_t bitmap_align_reverse(blkno_t blk, { /* yes, return the computed logical pos in file */ pos += blk - region[i]; -#if DEBUG > 2 - kprintf("bitmap_align_reverse() returning %u, found\n", pos); +#if DEBUG > 3 + dprintf(4, "bitmap_align_reverse() returning %u, found\n", pos); #endif return pos; } @@ -725,8 +751,8 @@ blkno_t bitmap_align_reverse(blkno_t blk, } /* the given blk was not found in any region of the list */ -#if DEBUG > 2 - kprintf("bitmap_align_reverse() returning -1, not found\n"); +#if DEBUG > 3 + dprintf(4, "bitmap_align_reverse() returning -1, not found\n"); #endif return -1; } @@ -745,15 +771,25 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, char tempdirty; blkno_t pos, chase; +#if DEBUG > 3 + dprintf(4, "bitmap_align_recurse" + "(%d, %d, %d, 0x%x, 0x%x, %d, 0x%x, %d, %d) starting\n", + dev - fs_tab, ino - i_tab, exclude, parent, dirty, indirection, + region, regions, blocks); +#endif + /* check we have been passed a valid block number */ blk = *parent; if (blk < (dev->s_reserv + dev->s_isize) || blk >= dev->s_fsize) { /* filesystem is corrupt, invalid block */ udata.u_error = ECORRUPTFS; -#if DEBUG > 0 - kprintf("bitmap_align_recurse() ino = %d, blk = %d, ind = %d, par = 0x%04x\n", +#if DEBUG + dprintf(1, "bitmap_align_recurse() ino = %d, blk = %d, ind = %d, par = 0x%04x\n", ino->c_num, blk, indirection, parent); +#endif +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); #endif return (blkno_t)-1; } @@ -785,6 +821,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, if (moveable == 0 && indirection == 0) { /* no action is needed (no move and not indirect) */ +#if DEBUG > 3 + dprintf(4, "bitmap_align_recurse() returning -1, no action, ok\n"); +#endif return (blkno_t)-1; } @@ -793,6 +832,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, buf = (bufptr)bread(devno, blk, 0); if (buf == NULL) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error reading the block itself */ } @@ -816,7 +858,7 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, for (i = 0; i < BUFSIZE / sizeof(blkno_t); i++) { newno = ((blkno_t *)buf)[i]; - if (newno == 3840) kprintf("bad # %d,%d 0x%04x\n", buf->bf_blk, i, &((blkno_t *)buf)[i]); +/* if (newno == 3840) dprintf(3, "bad # %d,%d 0x%04x\n", buf->bf_blk, i, &((blkno_t *)buf)[i]); */ if (newno) { if (exclude == 2) /* it's the target file */ @@ -826,6 +868,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, if (bfree(buf, buf->bf_dirty) < 0) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error */ } @@ -838,6 +883,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, buf = (bufptr)bread(devno, blk, 0); if (buf == NULL) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error */ } @@ -863,6 +911,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, { if (bfree(buf, buf->bf_dirty) < 0) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error */ } } @@ -876,12 +927,18 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, buf = (bufptr)bread(devno, blk, 0); if (buf == NULL) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error */ } } if (newno == (blkno_t)-1) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; } @@ -891,6 +948,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, dev->s_bitmap_immov) != 1) { /* i/o error, or corrupt filesystem */ +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; } } @@ -909,6 +969,9 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, newno >= dev->s_fsize) { udata.u_error = ENOSPC; /* may overwrite ENXIO !! */ +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; } @@ -918,37 +981,49 @@ blkno_t bitmap_align_recurse(fsptr dev, inoptr ino, int exclude, /* inform parent that its allocation entries were changed */ *dirty = 1; -#if DEBUG > 2 - kprintf("putting block %d -> %d, errno = %d\n", blk, newno, udata.u_error); +#if DEBUG >= 2 + dprintf(2, "putting block %d -> %d, errno = %d\n", blk, newno, udata.u_error); #endif /* really move the block by manipulating cache entries */ other = (bufptr)bfind(devno, newno); /* hanging around in cache? */ if (other) { -/* kprintf("bufpool entry %d = block %d, dirty 0\n", other - bufpool, blk); */ +/* dprintf(3, "bufpool entry %d = block %d, dirty 0\n", other - bufpool, blk); */ other->bf_blk = blk; /* swap, for minimal overhead */ other->bf_dirty = 0; /* try to avoid writing back */ } /* revise the original cache entry to show the new block */ -/* kprintf("bufpool entry %d = block %d, dirty 2\n", buf - bufpool, newno); */ +/* dprintf(3, "bufpool entry %d = block %d, dirty 2\n", buf - bufpool, newno); */ buf->bf_blk = newno; /* original value is in variable blk */ if (bfree(buf, 2) < 0) /* very dirty, write back immediately */ { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error writing back */ } +#if DEBUG > 3 + dprintf(4, "bitmap_align_recurse() returning %d, moved, ok\n", chase); +#endif return chase; /* indicate which spot was just freed */ } else { if (bfree(buf, buf->bf_dirty) < 0) { +#if DEBUG >= 3 + dprintf(3, "bitmap_align_recurse() returning -1, error %u\n", udata.u_error); +#endif return (blkno_t)-1; /* disk i/o error writing back */ } } +#if DEBUG > 3 + dprintf(4, "bitmap_align_recurse() returning -1, ok\n"); +#endif return (blkno_t)-1; /* successfully traversed the block and its children */ } @@ -958,8 +1033,8 @@ blkno_t bitmap_search(dev_t devno, int size, blkno_t start, blkno_t final) blkno_t i, j, lm, blk; unsigned long bits, mask; /* assumes REGION_BLOCKS <= 32 */ -#if DEBUG > 2 - kprintf("bitmap_search(%u, %d, %u, %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "bitmap_search(%u, %d, %u, %u) starting\n", devno, size, start, final); #endif @@ -1004,8 +1079,8 @@ blkno_t bitmap_search(dev_t devno, int size, blkno_t start, blkno_t final) buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_search() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_search() returning -1, i/o error\n"); #endif return (blkno_t)-1; /* should indicate i/o error */ } @@ -1027,14 +1102,14 @@ blkno_t bitmap_search(dev_t devno, int size, blkno_t start, blkno_t final) /* don't write it back, our caller will */ if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_search() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_search() returning -1, i/o error\n"); #endif return (blkno_t)-1; } -#if DEBUG > 2 - kprintf("bitmap_search() returning %u, success\n", blk); +#if DEBUG >= 3 + dprintf(3, "bitmap_search() returning %u, success\n", blk); #endif return blk; } @@ -1045,8 +1120,8 @@ blkno_t bitmap_search(dev_t devno, int size, blkno_t start, blkno_t final) /* nothing found this time, release block and loop */ if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_search() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_search() returning -1, i/o error\n"); #endif return (blkno_t)-1; } @@ -1056,8 +1131,8 @@ blkno_t bitmap_search(dev_t devno, int size, blkno_t start, blkno_t final) } /* no '0' string found within the bitmap limits */ -#if DEBUG > 2 - kprintf("bitmap_search() returning -1, bitmap full\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_search() returning -1, bitmap full\n"); #endif return (blkno_t)-1; /* not an error, bitmap was really full */ } @@ -1068,8 +1143,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, blkno_t i, j, lm; char *buf, *p, mask; -#if DEBUG > 2 - kprintf("bitmap_reserve(%u, %u, %d, %d, %u, %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve(%u, %u, %d, %d, %u, %u) starting\n", devno, blk, size, flag, start, final); #endif @@ -1077,8 +1152,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, j = start + (blk >> 3); if (j >= final) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, out of range\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, out of range\n"); #endif return -1; /* block out of range, very bad */ } @@ -1087,8 +1162,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } @@ -1109,8 +1184,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, /* gone past the end of the current bitmap block */ if (j >= final) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, out of range\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, out of range\n"); #endif return -1; /* out of range */ } @@ -1118,8 +1193,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, /* need to flush the modifications done so far */ if (bawrite((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, i/o error\n"); #endif return -1; /* i/o error */ } @@ -1128,8 +1203,8 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, i/o error\n"); #endif return -1; /* i/o error */ } @@ -1156,14 +1231,14 @@ int bitmap_reserve(dev_t devno, blkno_t blk, int size, int flag, /* ready to write back the modified bitmap block */ if (bawrite((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_reserve() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } -#if DEBUG > 2 - kprintf("bitmap_reserve() returning 0, success\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_reserve() returning 0, success\n"); #endif return 0; } @@ -1175,8 +1250,8 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, char *buf, *p, mask; blkno_t i, j, lm; -#if DEBUG > 2 - kprintf("bitmap_find(%u, %u, %d, %d, %u, %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "bitmap_find(%u, %u, %d, %d, %u, %u) starting\n", devno, blk, flag, toggle, start, final); #endif @@ -1197,8 +1272,8 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_find() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning -1, i/o error\n"); #endif return (blkno_t)-1; /* should indicate i/o error */ } @@ -1231,8 +1306,8 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, *p ^= 1 << i; if (bawrite((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_find() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning -1, i/o error\n"); #endif return (blkno_t)-1; /* i/o */ } @@ -1241,15 +1316,15 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, { if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_find() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning -1, i/o error\n"); #endif return (blkno_t)-1; /* i/o */ } } -#if DEBUG > 2 - kprintf("bitmap_find() returning %u, success\n", blk); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning %u, success\n", blk); #endif return blk; } @@ -1260,8 +1335,8 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, /* nothing found this time, release block and loop */ if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_find() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning -1, i/o error\n"); #endif return (blkno_t)-1; } @@ -1272,8 +1347,8 @@ blkno_t bitmap_find(dev_t devno, blkno_t blk, int flag, int toggle, /* no 'flag' bit found within the bitmap limits */ blk = (j - start) << 3; -#if DEBUG > 2 - kprintf("bitmap_find() returning %u, bitmap full\n", blk); +#if DEBUG >= 3 + dprintf(3, "bitmap_find() returning %u, bitmap full\n", blk); #endif return blk; /* not an error, bitmap was really full */ } @@ -1283,16 +1358,16 @@ int bitmap_get(dev_t devno, blkno_t blk, blkno_t start, blkno_t final) blkno_t i, j; char *buf, *p; -#if DEBUG > 2 - kprintf("bitmap_get(%u, %u, %u, %u) starting\n", devno, blk, start, final); +#if DEBUG >= 3 + dprintf(3, "bitmap_get(%u, %u, %u, %u) starting\n", devno, blk, start, final); #endif /* calculate byte position within bitmap for this block */ j = start + (blk >> 3); if (j >= final) { -#if DEBUG > 2 - kprintf("bitmap_get() returning -1, out of range\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_get() returning -1, out of range\n"); #endif return -1; /* block out of range, very bad */ } @@ -1302,8 +1377,8 @@ int bitmap_get(dev_t devno, blkno_t blk, blkno_t start, blkno_t final) buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_get() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_get() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } @@ -1314,14 +1389,14 @@ int bitmap_get(dev_t devno, blkno_t blk, blkno_t start, blkno_t final) if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_get() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_get() returning -1, i/o error\n"); #endif return -1; } -#if DEBUG > 2 - kprintf("bitmap_get() returning %d, success\n", i); +#if DEBUG >= 3 + dprintf(3, "bitmap_get() returning %d, success\n", i); #endif return i; } @@ -1332,8 +1407,8 @@ int bitmap_set(dev_t devno, blkno_t blk, int flag, blkno_t i, j; char *buf, *p, mask; -#if DEBUG > 2 - kprintf("bitmap_set(%u, %u, %d, %u, %u) starting\n", +#if DEBUG >= 3 + dprintf(3, "bitmap_set(%u, %u, %d, %u, %u) starting\n", devno, blk, flag, start, final); #endif @@ -1341,8 +1416,8 @@ int bitmap_set(dev_t devno, blkno_t blk, int flag, j = start + (blk >> 3); if (j >= final) { -#if DEBUG > 2 - kprintf("bitmap_set() returning -1, out of range\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_set() returning -1, out of range\n"); #endif return -1; /* block out of range, very bad */ } @@ -1352,8 +1427,8 @@ int bitmap_set(dev_t devno, blkno_t blk, int flag, buf = bread(devno, j >> BUFSIZELOG, 0); if (buf == NULL) { -#if DEBUG > 2 - kprintf("bitmap_set() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_set() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } @@ -1369,8 +1444,8 @@ int bitmap_set(dev_t devno, blkno_t blk, int flag, *p ^= mask; if (bawrite((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_set() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_set() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } @@ -1379,15 +1454,15 @@ int bitmap_set(dev_t devno, blkno_t blk, int flag, { if (brelse((bufptr)buf) < 0) { -#if DEBUG > 2 - kprintf("bitmap_set() returning -1, i/o error\n"); +#if DEBUG >= 3 + dprintf(3, "bitmap_set() returning -1, i/o error\n"); #endif return -1; /* should indicate i/o error */ } } -#if DEBUG > 2 - kprintf("bitmap_set() returning %d, success\n", j); +#if DEBUG >= 3 + dprintf(3, "bitmap_set() returning %d, success\n", j); #endif return j; } diff --git a/src/libiar/n.bat b/src/libiar/n.bat index 97a07cd8..d06db476 100644 --- a/src/libiar/n.bat +++ b/src/libiar/n.bat @@ -1,3 +1,4 @@ +md build cd build copy ..\build.ban n.bat call n diff --git a/src/libsys/build-b.ban b/src/libsys/build-b.ban index e834b895..403ff840 100644 --- a/src/libsys/build-b.ban +++ b/src/libsys/build-b.ban @@ -346,6 +346,13 @@ as-z80 -l -o systrace.s01 @if errorlevel 1 goto failure copy systrace.rel ..\..\..\lib\relsysb +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DMAKE_ALL -H_sysdebug ..\sysdebug +@if errorlevel 1 goto failure +del sysdebug.r01 +as-z80 -l -o sysdebug.s01 +@if errorlevel 1 goto failure +copy sysdebug.rel ..\..\..\lib\relsysb + iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DMAKE_ALL -H_time ..\time @if errorlevel 1 goto failure del time.r01 diff --git a/src/libsys/build-l.ban b/src/libsys/build-l.ban index da32baa5..32d2d4e6 100644 --- a/src/libsys/build-l.ban +++ b/src/libsys/build-l.ban @@ -346,6 +346,13 @@ as-z80 -l -o systrace.s01 @if errorlevel 1 goto failure copy systrace.rel ..\..\..\lib\relsysl +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DMAKE_ALL -H_sysdebug ..\sysdebug +@if errorlevel 1 goto failure +del sysdebug.r01 +as-z80 -l -o sysdebug.s01 +@if errorlevel 1 goto failure +copy sysdebug.rel ..\..\..\lib\relsysl + iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DMAKE_ALL -H_time ..\time @if errorlevel 1 goto failure del time.r01 diff --git a/src/libsys/libsysb.lib b/src/libsys/libsysb.lib index 6c982515..503b75f4 100644 --- a/src/libsys/libsysb.lib +++ b/src/libsys/libsysb.lib @@ -47,6 +47,7 @@ relsysb\symlink.rel relsysb\sync.rel relsysb\sys0b.rel relsysb\sys1b.rel +relsysb\sysdebug.rel relsysb\systrace.rel relsysb\time.rel relsysb\times.rel diff --git a/src/libsys/libsysl.lib b/src/libsys/libsysl.lib index 1cb0d327..e77395d9 100644 --- a/src/libsys/libsysl.lib +++ b/src/libsys/libsysl.lib @@ -47,6 +47,7 @@ relsysl\symlink.rel relsysl\sync.rel relsysl\sys0l.rel relsysl\sys1l.rel +relsysl\sysdebug.rel relsysl\systrace.rel relsysl\time.rel relsysl\times.rel diff --git a/src/libsys/syscalls.h b/src/libsys/syscalls.h index d9914c1f..c4aa93b2 100644 --- a/src/libsys/syscalls.h +++ b/src/libsys/syscalls.h @@ -77,6 +77,7 @@ #define L_setprio #define L_umask #define L_systrace +#define L_sysdebug /* Nick */ #endif #endif diff --git a/src/libsys/sysdebug.c b/src/libsys/sysdebug.c new file mode 100644 index 00000000..723b00be --- /dev/null +++ b/src/libsys/sysdebug.c @@ -0,0 +1,32 @@ +/********** MSX-UZIX version of syscalls ************/ +/* UNIX sysdebug(int onoff); */ + +#include "syscalls.h" + +#define __str3(x) __STRING(x) +#define __str2(x) __str3(x) +#define __str1(x) __str2(x) + +#ifdef L_sysdebug +#ifndef HI_TECH_C +UNIX sysdebug(int onoff) + { +#if 0 + return unix_set(SET_DEBUG, onoff); +#else + return unix(7, SET_DEBUG, onoff); +#endif + } +#else + asm(" psect text,class=CODE"); + asm(" global __setset"); + asm(" global _sysdebug"); + asm(" signat _sysdebug,4154"); + asm("_sysdebug:"); + asm(" push de"); + asm(" ld de," __str1(SET_DEBUG)); + asm(" jp __setset"); +#endif +#endif + + diff --git a/src/link-z80/link-z80.exe b/src/link-z80/link-z80.exe deleted file mode 100644 index f6760bf1..00000000 Binary files a/src/link-z80/link-z80.exe and /dev/null differ diff --git a/src/link-z80/link-z80.map b/src/link-z80/link-z80.map deleted file mode 100644 index 18e3cb58..00000000 --- a/src/link-z80/link-z80.map +++ /dev/null @@ -1,520 +0,0 @@ - link-z80 - - Timestamp is 3e663ef6 (Thu Mar 06 05:16:22 2003) - - Preferred load address is 00400000 - - Start Length Name Class - 0001:00000000 000112f3H .text CODE - 0002:00000000 000005ccH .rdata DATA - 0002:000005cc 00000000H .edata DATA - 0003:00000000 00000104H .CRT$XCA DATA - 0003:00000104 00000104H .CRT$XCZ DATA - 0003:00000208 00000104H .CRT$XIA DATA - 0003:0000030c 00000109H .CRT$XIC DATA - 0003:00000418 00000104H .CRT$XIZ DATA - 0003:0000051c 00000104H .CRT$XPA DATA - 0003:00000620 00000104H .CRT$XPX DATA - 0003:00000724 00000104H .CRT$XPZ DATA - 0003:00000828 00000104H .CRT$XTA DATA - 0003:0000092c 00000104H .CRT$XTZ DATA - 0003:00000a30 000023ddH .data DATA - 0003:00002e10 00001f34H .bss DATA - 0004:00000000 00000014H .idata$2 DATA - 0004:00000014 00000014H .idata$3 DATA - 0004:00000028 000000fcH .idata$4 DATA - 0004:00000124 000000fcH .idata$5 DATA - 0004:00000220 00000444H .idata$6 DATA - - Address Publics by Value Rva+Base Lib:Object - - 0001:00000350 _newarea 00401350 f lkarea.obj - 0001:00000466 _lkparea 00401466 f lkarea.obj - 0001:00000593 _lnkarea 00401593 f lkarea.obj - 0001:000007b5 _lnksect 004017b5 f lkarea.obj - 0001:00000ce0 _eval 00401ce0 f lkeval.obj - 0001:00000d68 _expr 00401d68 f lkeval.obj - 0001:00000faa _term 00401faa f lkeval.obj - 0001:0000131a _digit 0040231a f lkeval.obj - 0001:000013cf _oprio 004023cf f lkeval.obj - 0001:00001620 _newhead 00402620 f lkhead.obj - 0001:00001720 _module 00402720 f lkhead.obj - 0001:000017d0 _getid 004027d0 f lklex.obj - 0001:0000183c _getfid 0040283c f lklex.obj - 0001:0000188f _getnb 0040288f f lklex.obj - 0001:000018b0 _skip 004028b0 f lklex.obj - 0001:000018ea _get 004028ea f lklex.obj - 0001:00001918 _unget 00402918 f lklex.obj - 0001:00001930 _getmap 00402930 f lklex.obj - 0001:00001a80 _getline 00402a80 f lklex.obj - 0001:00001cc0 _more 00402cc0 f lklex.obj - 0001:00001cfd _endline 00402cfd f lklex.obj - 0001:00001e90 _addpath 00402e90 f lklibr.obj - 0001:00001f21 _addlib 00402f21 f lklibr.obj - 0001:00001f83 _addfile 00402f83 f lklibr.obj - 0001:000021a7 _search 004031a7 f lklibr.obj - 0001:00002228 _fndsym 00403228 f lklibr.obj - 0001:000026df _library 004036df f lklibr.obj - 0001:0000271c _loadfile 0040371c f lklibr.obj - 0001:00002a20 _newpag 00403a20 f lklist.obj - 0001:00002a62 _dgt 00403a62 f lklist.obj - 0001:00002aaf _slew 00403aaf f lklist.obj - 0001:000030cb _lstarea 004040cb f lklist.obj - 0001:0000361a _lkulist 0040461a f lklist.obj - 0001:0000374f _lkalist 0040474f f lklist.obj - 0001:00003a53 _lkglist 00404a53 f lklist.obj - 0001:00004430 _main 00405430 f lkmain.obj - 0001:000047a1 _lkexit 004057a1 f lkmain.obj - 0001:00004831 _link 00405831 f lkmain.obj - 0001:00004aea _map 00405aea f lkmain.obj - 0001:00004df3 _parse 00405df3 f lkmain.obj - 0001:000053bc _doparse 004063bc f lkmain.obj - 0001:0000546b _bassav 0040646b f lkmain.obj - 0001:000054fd _setbas 004064fd f lkmain.obj - 0001:00005828 _gblsav 00406828 f lkmain.obj - 0001:000058ba _setgbl 004068ba f lkmain.obj - 0001:000059d8 _afile 004069d8 f lkmain.obj - 0001:00005bbc _fndidx 00406bbc f lkmain.obj - 0001:00005c32 _usage 00406c32 f lkmain.obj - 0001:000062b0 _lkout 004072b0 f lkout.obj - 0001:000062f2 _ixx 004072f2 f lkout.obj - 0001:000064a2 _iflush 004074a2 f lkout.obj - 0001:00006617 _sxx 00407617 f lkout.obj - 0001:000067e1 _sflush 004077e1 f lkout.obj - 0001:00006ac0 _reloc 00407ac0 f lkrloc.obj - 0001:00006b50 _relt 00407b50 f lkrloc.obj - 0001:00006ba3 _relr 00407ba3 f lkrloc.obj - 0001:000071d1 _relp 004081d1 f lkrloc.obj - 0001:000073d5 _rele 004083d5 f lkrloc.obj - 0001:00007400 _evword 00408400 f lkrloc.obj - 0001:00007446 _adb_1b 00408446 f lkrloc.obj - 0001:0000746c _adb_2b 0040846c f lkrloc.obj - 0001:00007522 _adb_3b 00408522 f lkrloc.obj - 0001:00007632 _adb_4b 00408632 f lkrloc.obj - 0001:0000779b _adb_xb 0040879b f lkrloc.obj - 0001:000078d2 _adb_lo 004088d2 f lkrloc.obj - 0001:0000794e _adb_hi 0040894e f lkrloc.obj - 0001:000079ca _adb_byte3 004089ca f lkrloc.obj - 0001:00007a46 _adb_byte4 00408a46 f lkrloc.obj - 0001:00007ac2 _adw_xb 00408ac2 f lkrloc.obj - 0001:00007b31 _relerr 00408b31 f lkrloc.obj - 0001:00007b63 _errdmp 00408b63 f lkrloc.obj - 0001:00007ce8 _prntval 00408ce8 f lkrloc.obj - 0001:00007da7 _relerp 00408da7 f lkrloc.obj - 0001:00007dd9 _erpdmp 00408dd9 f lkrloc.obj - 0001:00008360 _syminit 00409360 f lksym.obj - 0001:0000838c _newsym 0040938c f lksym.obj - 0001:0000855a _lkpsym 0040955a f lksym.obj - 0001:00008601 _symval 00409601 f lksym.obj - 0001:0000862d _symdef 0040962d f lksym.obj - 0001:000086a4 _symmod 004096a4 f lksym.obj - 0001:00008760 _symeq 00409760 f lksym.obj - 0001:00008805 _hash 00409805 f lksym.obj - 0001:00008866 _strsto 00409866 f lksym.obj - 0001:000088e5 _new 004098e5 f lksym.obj - 0001:00008aa2 _fprintf 00409aa2 f LIBC:fprintf.obj - 0001:00008ad4 ___initstdio 00409ad4 f LIBC:_file.obj - 0001:00008b79 ___endstdio 00409b79 f LIBC:_file.obj - 0001:00008b90 _strcpy 00409b90 f LIBC:strcat.obj - 0001:00008ba0 _strcat 00409ba0 f LIBC:strcat.obj - 0001:00008c80 _strlen 00409c80 f LIBC:strlen.obj - 0001:00008cfb _fclose 00409cfb f LIBC:fclose.obj - 0001:00008d51 _fgets 00409d51 f LIBC:fgets.obj - 0001:00008da8 _free 00409da8 f LIBC:free.obj - 0001:00008dd7 __fsopen 00409dd7 f LIBC:fopen.obj - 0001:00008df7 _fopen 00409df7 f LIBC:fopen.obj - 0001:00008e0a _sprintf 00409e0a f LIBC:sprintf.obj - 0001:00008e5c _malloc 00409e5c f LIBC:malloc.obj - 0001:00008e6e __nh_malloc 00409e6e f LIBC:malloc.obj - 0001:00008e9a __heap_alloc 00409e9a f LIBC:malloc.obj - 0001:00008ee0 _strchr 00409ee0 f LIBC:strchr.obj - 0001:00008ee6 ___from_strstr_to_strchr 00409ee6 f LIBC:strchr.obj - 0001:00008fa0 _strncmp 00409fa0 f LIBC:strncmp.obj - 0001:00008fd8 _sscanf 00409fd8 f LIBC:sscanf.obj - 0001:00009010 _strcmp 0040a010 f LIBC:strcmp.obj - 0001:00009094 __flsbuf 0040a094 f LIBC:_flsbuf.obj - 0001:000091b0 _strncpy 0040a1b0 f LIBC:strncpy.obj - 0001:000092ae __cinit 0040a2ae f LIBC:crt0dat.obj - 0001:000092db _exit 0040a2db f LIBC:crt0dat.obj - 0001:000092ec __exit 0040a2ec f LIBC:crt0dat.obj - 0001:000092fd __cexit 0040a2fd f LIBC:crt0dat.obj - 0001:0000930c __c_exit 0040a30c f LIBC:crt0dat.obj - 0001:000093d0 _strrchr 0040a3d0 f LIBC:strrchr.obj - 0001:000093f7 _mainCRTStartup 0040a3f7 f LIBC:crt0.obj - 0001:000094d6 __amsg_exit 0040a4d6 f LIBC:crt0.obj - 0001:0000951f __stbuf 0040a51f f LIBC:_sftbuf.obj - 0001:000095ac __ftbuf 0040a5ac f LIBC:_sftbuf.obj - 0001:000095e9 __output 0040a5e9 f LIBC:output.obj - 0001:00009df3 __ioinit 0040adf3 f LIBC:ioinit.obj - 0001:00009f9e __ioterm 0040af9e f LIBC:ioinit.obj - 0001:00009fc1 _calloc 0040afc1 f LIBC:calloc.obj - 0001:0000a03e __fcloseall 0040b03e f LIBC:closeall.obj - 0001:0000a096 _fflush 0040b096 f LIBC:fflush.obj - 0001:0000a0d1 __flush 0040b0d1 f LIBC:fflush.obj - 0001:0000a12d __flushall 0040b12d f LIBC:fflush.obj - 0001:0000a1a3 __close 0040b1a3 f LIBC:close.obj - 0001:0000a256 __freebuf 0040b256 f LIBC:_freebuf.obj - 0001:0000a281 __filbuf 0040b281 f LIBC:_filbuf.obj - 0001:0000a35a __heap_init 0040b35a f LIBC:heapinit.obj - 0001:0000a396 __heap_term 0040b396 f LIBC:heapinit.obj - 0001:0000a40b __get_sbh_threshold 0040b40b f LIBC:sbheap.obj - 0001:0000a411 __set_sbh_threshold 0040b411 f LIBC:sbheap.obj - 0001:0000a428 ___sbh_heap_init 0040b428 f LIBC:sbheap.obj - 0001:0000a466 ___sbh_find_block 0040b466 f LIBC:sbheap.obj - 0001:0000a491 ___sbh_free_block 0040b491 f LIBC:sbheap.obj - 0001:0000a7bc ___sbh_alloc_block 0040b7bc f LIBC:sbheap.obj - 0001:0000aac5 ___sbh_alloc_new_region 0040bac5 f LIBC:sbheap.obj - 0001:0000ab76 ___sbh_alloc_new_group 0040bb76 f LIBC:sbheap.obj - 0001:0000ac71 ___sbh_resize_block 0040bc71 f LIBC:sbheap.obj - 0001:0000af67 ___sbh_heapmin 0040bf67 f LIBC:sbheap.obj - 0001:0000b038 ___sbh_heap_check 0040c038 f LIBC:sbheap.obj - 0001:0000b367 __openfile 0040c367 f LIBC:_open.obj - 0001:0000b4d7 __getstream 0040c4d7 f LIBC:stream.obj - 0001:0000b54f ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 0040c54f f LIBC:handler.obj - 0001:0000b55f ?_query_new_handler@@YAP6AHI@ZXZ 0040c55f f LIBC:handler.obj - 0001:0000b565 __callnewh 0040c565 f LIBC:handler.obj - 0001:0000b580 __input 0040c580 f LIBC:input.obj - 0001:0000c031 __lseek 0040d031 f LIBC:lseek.obj - 0001:0000c0cb __write 0040d0cb f LIBC:write.obj - 0001:0000c278 __getbuf 0040d278 f LIBC:_getbuf.obj - 0001:0000c2bc __isatty 0040d2bc f LIBC:isatty.obj - 0001:0000c2e2 __XcptFilter 0040d2e2 f LIBC:winxfltr.obj - 0001:0000c466 __setenvp 0040d466 f LIBC:stdenvp.obj - 0001:0000c51f __setargv 0040d51f f LIBC:stdargv.obj - 0001:0000c76c ___crtGetEnvironmentStringsA 0040d76c f LIBC:a_env.obj - 0001:0000c8a0 __global_unwind2 0040d8a0 f LIBC:exsup.obj - 0001:0000c8e2 __local_unwind2 0040d8e2 f LIBC:exsup.obj - 0001:0000c93a __NLG_Return2 0040d93a f LIBC:exsup.obj - 0001:0000c94a __abnormal_termination 0040d94a f LIBC:exsup.obj - 0001:0000c96d __NLG_Notify1 0040d96d f LIBC:exsup.obj - 0001:0000c976 __NLG_Notify 0040d976 f LIBC:exsup.obj - 0001:0000c989 __NLG_Dispatch 0040d989 f LIBC:exsup.obj - 0001:0000c998 __except_handler3 0040d998 f LIBC:exsup3.obj - 0001:0000ca55 __seh_longjmp_unwind@4 0040da55 f LIBC:exsup3.obj - 0001:0000ca70 __FF_MSGBANNER 0040da70 f LIBC:crt0msg.obj - 0001:0000caa9 __NMSG_WRITE 0040daa9 f LIBC:crt0msg.obj - 0001:0000cbfc __GET_RTERRMSG 0040dbfc f LIBC:crt0msg.obj - 0001:0000cc2d _wctomb 0040dc2d f LIBC:wctomb.obj - 0001:0000cca0 __aulldiv 0040dca0 f LIBC:ulldiv.obj - 0001:0000cd10 __aullrem 0040dd10 f LIBC:ullrem.obj - 0001:0000cd90 _memset 0040dd90 f LIBC:memset.obj - 0001:0000cde8 __commit 0040dde8 f LIBC:commit.obj - 0001:0000ce3f __dosmaperr 0040de3f f LIBC:dosmap.obj - 0001:0000cea6 __alloc_osfhnd 0040dea6 f LIBC:osfinfo.obj - 0001:0000cf3b __set_osfhnd 0040df3b f LIBC:osfinfo.obj - 0001:0000cfb2 __free_osfhnd 0040dfb2 f LIBC:osfinfo.obj - 0001:0000d02c __get_osfhandle 0040e02c f LIBC:osfinfo.obj - 0001:0000d069 __open_osfhandle 0040e069 f LIBC:osfinfo.obj - 0001:0000d106 __read 0040e106 f LIBC:read.obj - 0001:0000d300 _memmove 0040e300 f LIBC:memmove.obj - 0001:0000d635 __open 0040e635 f LIBC:open.obj - 0001:0000d64c __sopen 0040e64c f LIBC:open.obj - 0001:0000d905 _mbtowc 0040e905 f LIBC:mbtowc.obj - 0001:0000d9cd _isalpha 0040e9cd f LIBC:_ctype.obj - 0001:0000d9fb _isupper 0040e9fb f LIBC:_ctype.obj - 0001:0000da23 _islower 0040ea23 f LIBC:_ctype.obj - 0001:0000da4b _isdigit 0040ea4b f LIBC:_ctype.obj - 0001:0000da73 _isxdigit 0040ea73 f LIBC:_ctype.obj - 0001:0000daa0 _isspace 0040eaa0 f LIBC:_ctype.obj - 0001:0000dac8 _ispunct 0040eac8 f LIBC:_ctype.obj - 0001:0000daf0 _isalnum 0040eaf0 f LIBC:_ctype.obj - 0001:0000db1e _isprint 0040eb1e f LIBC:_ctype.obj - 0001:0000db4c _isgraph 0040eb4c f LIBC:_ctype.obj - 0001:0000db7a _iscntrl 0040eb7a f LIBC:_ctype.obj - 0001:0000dba2 ___isascii 0040eba2 f LIBC:_ctype.obj - 0001:0000dbaf ___toascii 0040ebaf f LIBC:_ctype.obj - 0001:0000dbb7 ___iscsymf 0040ebb7 f LIBC:_ctype.obj - 0001:0000dbf4 ___iscsym 0040ebf4 f LIBC:_ctype.obj - 0001:0000dc31 __isctype 0040ec31 f LIBC:isctype.obj - 0001:0000dcb0 __allmul 0040ecb0 f LIBC:llmul.obj - 0001:0000dcf0 __allshl 0040ecf0 f LIBC:llshl.obj - 0001:0000dd0f _ungetc 0040ed0f f LIBC:ungetc.obj - 0001:0000dd7d __setmbcp 0040ed7d f LIBC:mbctype.obj - 0001:0000e141 __getmbcp 0040f141 f LIBC:mbctype.obj - 0001:0000e151 ___initmbctable 0040f151 f LIBC:mbctype.obj - 0001:0000e170 _memcpy 0040f170 f LIBC:memcpy.obj - 0001:0000e4a5 ___crtMessageBoxA 0040f4a5 f LIBC:crtmbox.obj - 0001:0000e52e __fptrap 0040f52e f LIBC:crt0fp.obj - 0001:0000e537 __chsize 0040f537 f LIBC:chsize.obj - 0001:0000e67d ___crtGetStringTypeA 0040f67d f LIBC:a_str.obj - 0001:0000e7c6 ___crtLCMapStringA 0040f7c6 f LIBC:a_map.obj - 0001:0000ea15 __setmode 0040fa15 f LIBC:setmode.obj - 0001:0000ea90 __chkstk 0040fa90 f LIBC:chkstk.obj - 0001:0000ea90 __alloca_probe 0040fa90 f LIBC:chkstk.obj - 0001:0000eac0 _HeapFree@12 0040fac0 f kernel32:KERNEL32.dll - 0001:0000eac6 _HeapAlloc@12 0040fac6 f kernel32:KERNEL32.dll - 0001:0000eacc _ExitProcess@4 0040facc f kernel32:KERNEL32.dll - 0001:0000ead2 _TerminateProcess@8 0040fad2 f kernel32:KERNEL32.dll - 0001:0000ead8 _GetCurrentProcess@0 0040fad8 f kernel32:KERNEL32.dll - 0001:0000eade _GetCommandLineA@0 0040fade f kernel32:KERNEL32.dll - 0001:0000eae4 _GetVersion@0 0040fae4 f kernel32:KERNEL32.dll - 0001:0000eaea _SetHandleCount@4 0040faea f kernel32:KERNEL32.dll - 0001:0000eaf0 _GetStdHandle@4 0040faf0 f kernel32:KERNEL32.dll - 0001:0000eaf6 _GetFileType@4 0040faf6 f kernel32:KERNEL32.dll - 0001:0000eafc _GetStartupInfoA@4 0040fafc f kernel32:KERNEL32.dll - 0001:0000eb02 _GetLastError@0 0040fb02 f kernel32:KERNEL32.dll - 0001:0000eb08 _CloseHandle@4 0040fb08 f kernel32:KERNEL32.dll - 0001:0000eb0e _HeapDestroy@4 0040fb0e f kernel32:KERNEL32.dll - 0001:0000eb14 _HeapCreate@12 0040fb14 f kernel32:KERNEL32.dll - 0001:0000eb1a _VirtualFree@12 0040fb1a f kernel32:KERNEL32.dll - 0001:0000eb20 _VirtualAlloc@16 0040fb20 f kernel32:KERNEL32.dll - 0001:0000eb26 _HeapReAlloc@16 0040fb26 f kernel32:KERNEL32.dll - 0001:0000eb2c _IsBadWritePtr@8 0040fb2c f kernel32:KERNEL32.dll - 0001:0000eb32 _SetFilePointer@16 0040fb32 f kernel32:KERNEL32.dll - 0001:0000eb38 _WriteFile@20 0040fb38 f kernel32:KERNEL32.dll - 0001:0000eb3e _UnhandledExceptionFilter@4 0040fb3e f kernel32:KERNEL32.dll - 0001:0000eb44 _GetModuleFileNameA@12 0040fb44 f kernel32:KERNEL32.dll - 0001:0000eb4a _FreeEnvironmentStringsA@4 0040fb4a f kernel32:KERNEL32.dll - 0001:0000eb50 _FreeEnvironmentStringsW@4 0040fb50 f kernel32:KERNEL32.dll - 0001:0000eb56 _WideCharToMultiByte@32 0040fb56 f kernel32:KERNEL32.dll - 0001:0000eb5c _GetEnvironmentStrings@0 0040fb5c f kernel32:KERNEL32.dll - 0001:0000eb62 _GetEnvironmentStringsW@0 0040fb62 f kernel32:KERNEL32.dll - 0001:0000eb68 _RtlUnwind@16 0040fb68 f kernel32:KERNEL32.dll - 0001:0000eb6e _FlushFileBuffers@4 0040fb6e f kernel32:KERNEL32.dll - 0001:0000eb74 _SetStdHandle@8 0040fb74 f kernel32:KERNEL32.dll - 0001:0000eb7a _ReadFile@20 0040fb7a f kernel32:KERNEL32.dll - 0001:0000eb80 _CreateFileA@28 0040fb80 f kernel32:KERNEL32.dll - 0001:0000eb86 _MultiByteToWideChar@24 0040fb86 f kernel32:KERNEL32.dll - 0001:0000eb8c _GetCPInfo@8 0040fb8c f kernel32:KERNEL32.dll - 0001:0000eb92 _GetACP@0 0040fb92 f kernel32:KERNEL32.dll - 0001:0000eb98 _GetOEMCP@0 0040fb98 f kernel32:KERNEL32.dll - 0001:0000eb9e _GetProcAddress@8 0040fb9e f kernel32:KERNEL32.dll - 0001:0000eba4 _LoadLibraryA@4 0040fba4 f kernel32:KERNEL32.dll - 0001:0000ebaa _SetEndOfFile@4 0040fbaa f kernel32:KERNEL32.dll - 0001:0000ebb0 _GetStringTypeA@20 0040fbb0 f kernel32:KERNEL32.dll - 0001:0000ebb6 _GetStringTypeW@16 0040fbb6 f kernel32:KERNEL32.dll - 0001:0000ebbc _LCMapStringA@24 0040fbbc f kernel32:KERNEL32.dll - 0001:0000ebc2 _LCMapStringW@24 0040fbc2 f kernel32:KERNEL32.dll - 0002:0000002c ___lookuptable 0041302c LIBC:output.obj - 0002:00000088 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 00413088 LIBC:output.obj - 0002:00000098 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 00413098 LIBC:output.obj - 0002:000000a0 ??_C@_0P@GGKG@runtime?5error?5?$AA@ 004130a0 LIBC:crt0msg.obj - 0002:000000b0 ??_C@_02PIMC@?$AN?6?$AA@ 004130b0 LIBC:crt0msg.obj - 0002:000000b4 ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 004130b4 LIBC:crt0msg.obj - 0002:000000c4 ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 004130c4 LIBC:crt0msg.obj - 0002:000000d4 ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 004130d4 LIBC:crt0msg.obj - 0002:000000e4 ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 004130e4 LIBC:crt0msg.obj - 0002:0000010c ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 0041310c LIBC:crt0msg.obj - 0002:00000144 ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 00413144 LIBC:crt0msg.obj - 0002:0000017c ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 0041317c LIBC:crt0msg.obj - 0002:000001a4 ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 004131a4 LIBC:crt0msg.obj - 0002:000001dc ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 004131dc LIBC:crt0msg.obj - 0002:00000208 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 00413208 LIBC:crt0msg.obj - 0002:0000022c ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 0041322c LIBC:crt0msg.obj - 0002:0000025c ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 0041325c LIBC:crt0msg.obj - 0002:00000288 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 00413288 LIBC:crt0msg.obj - 0002:000002ac ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 004132ac LIBC:crt0msg.obj - 0002:000002d8 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 004132d8 LIBC:crt0msg.obj - 0002:00000304 ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 00413304 LIBC:crt0msg.obj - 0002:0000032c ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 0041332c LIBC:crt0msg.obj - 0002:00000354 ??_C@_02JJJH@?6?6?$AA@ 00413354 LIBC:crt0msg.obj - 0002:00000358 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 00413358 LIBC:crt0msg.obj - 0002:00000374 ??_C@_03NAME@?4?4?4?$AA@ 00413374 LIBC:crt0msg.obj - 0002:00000378 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 00413378 LIBC:crt0msg.obj - 0002:00000390 ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 00413390 LIBC:crtmbox.obj - 0002:000003a4 ??_C@_0BA@GILI@GetActiveWindow?$AA@ 004133a4 LIBC:crtmbox.obj - 0002:000003b4 ??_C@_0M@PKCK@MessageBoxA?$AA@ 004133b4 LIBC:crtmbox.obj - 0002:000003c0 ??_C@_0L@HKL@user32?4dll?$AA@ 004133c0 LIBC:crtmbox.obj - 0002:000003cc ??_C@_01A@?$AA?$AA@ 004133cc LIBC:a_str.obj - 0002:000003d0 ??_C@_13A@?$AA?$AA?$AA?$AA@ 004133d0 LIBC:a_str.obj - 0003:00000000 ___xc_a 00414000 LIBC:crt0init.obj - 0003:00000104 ___xc_z 00414104 LIBC:crt0init.obj - 0003:00000208 ___xi_a 00414208 LIBC:crt0init.obj - 0003:00000418 ___xi_z 00414418 LIBC:crt0init.obj - 0003:0000051c ___xp_a 0041451c LIBC:crt0init.obj - 0003:00000724 ___xp_z 00414724 LIBC:crt0init.obj - 0003:00000828 ___xt_a 00414828 LIBC:crt0init.obj - 0003:0000092c ___xt_z 0041492c LIBC:crt0init.obj - 0003:00000b14 __abs_ 00414b14 lkdata.obj - 0003:00000b18 _rtaflg 00414b18 lkdata.obj - 0003:00000b1c _ctype 00414b1c lkdata.obj - 0003:00000b9c _ccase 00414b9c lkdata.obj - 0003:00001370 _usetxt 00415370 lkmain.obj - 0003:00001d7c _errmsg 00415d7c lkrloc.obj - 0003:000022d0 __iob 004162d0 LIBC:_file.obj - 0003:00002550 __aexit_rtn 00416550 LIBC:crt0.obj - 0003:00002554 ___app_type 00416554 LIBC:crt0.obj - 0003:00002558 ___nullstring 00416558 LIBC:output.obj - 0003:0000255c ___wnullstring 0041655c LIBC:output.obj - 0003:00002560 ___badioinfo 00416560 LIBC:ioinit.obj - 0003:00002568 __amblksiz 00416568 LIBC:heapinit.obj - 0003:0000256c ___sbh_threshold 0041656c LIBC:sbheap.obj - 0003:00002580 __XcptActTab 00416580 LIBC:winxfltr.obj - 0003:000025f8 __First_FPE_Indx 004165f8 LIBC:winxfltr.obj - 0003:000025fc __Num_FPE 004165fc LIBC:winxfltr.obj - 0003:00002600 __XcptActTabCount 00416600 LIBC:winxfltr.obj - 0003:00002604 __fpecode 00416604 LIBC:winxfltr.obj - 0003:00002608 __NLG_Destination 00416608 LIBC:exsup.obj - 0003:000026a8 __cfltcvt_tab 004166a8 LIBC:cmiscdat.obj - 0003:000026c0 __pctype 004166c0 LIBC:ctype.obj - 0003:000026c4 __pwctype 004166c4 LIBC:ctype.obj - 0003:000026c8 __ctype 004166c8 LIBC:ctype.obj - 0003:00002a40 ___mb_cur_max 00416a40 LIBC:nlsdata1.obj - 0003:00002a44 ___decimal_point 00416a44 LIBC:nlsdata1.obj - 0003:00002a48 ___decimal_point_length 00416a48 LIBC:nlsdata1.obj - 0003:00002e10 _rtadr0 00416e10 lkdata.obj - 0003:00002e14 _rtadr1 00416e14 lkdata.obj - 0003:00002e18 _rtadr2 00416e18 lkdata.obj - 0003:00002e1c _obj_flag 00416e1c lkdata.obj - 0003:00002e20 _uflag 00416e20 - 0003:00002e44 _hilo 00416e44 - 0003:00002e48 __cflush 00416e48 LIBC:_file.obj - 0003:00002e4c _errno 00416e4c LIBC:crt0dat.obj - 0003:00002e50 __doserrno 00416e50 LIBC:crt0dat.obj - 0003:00002e54 __umaskval 00416e54 LIBC:crt0dat.obj - 0003:00002e58 __osver 00416e58 LIBC:crt0dat.obj - 0003:00002e5c __winver 00416e5c LIBC:crt0dat.obj - 0003:00002e60 __winmajor 00416e60 LIBC:crt0dat.obj - 0003:00002e64 __winminor 00416e64 LIBC:crt0dat.obj - 0003:00002e68 ___argc 00416e68 LIBC:crt0dat.obj - 0003:00002e6c ___argv 00416e6c LIBC:crt0dat.obj - 0003:00002e70 ___wargv 00416e70 LIBC:crt0dat.obj - 0003:00002e74 __environ 00416e74 LIBC:crt0dat.obj - 0003:00002e78 ___initenv 00416e78 LIBC:crt0dat.obj - 0003:00002e7c __wenviron 00416e7c LIBC:crt0dat.obj - 0003:00002e80 ___winitenv 00416e80 LIBC:crt0dat.obj - 0003:00002e84 __pgmptr 00416e84 LIBC:crt0dat.obj - 0003:00002e88 __wpgmptr 00416e88 LIBC:crt0dat.obj - 0003:00002e8c __exitflag 00416e8c LIBC:crt0dat.obj - 0003:00002e90 __C_Termination_Done 00416e90 LIBC:crt0dat.obj - 0003:00002e94 __C_Exit_Done 00416e94 LIBC:crt0dat.obj - 0003:00002e98 __aenvptr 00416e98 LIBC:crt0.obj - 0003:00002e9c __wenvptr 00416e9c LIBC:crt0.obj - 0003:00002ea0 ___error_mode 00416ea0 LIBC:crt0.obj - 0003:00002ea4 __stdbuf 00416ea4 LIBC:_sftbuf.obj - 0003:00002eac __newmode 00416eac LIBC:_newmode.obj - 0003:00002eb0 ?_pnhHeap@@3P6AHI@ZA 00416eb0 LIBC:handler.obj - 0003:00002eb4 __pxcptinfoptrs 00416eb4 LIBC:winxfltr.obj - 0003:00002fc0 __adbgmsg 00416fc0 LIBC:crt0msg.obj - 0003:00002fc4 __commode 00416fc4 LIBC:ncommode.obj - 0003:00002fd8 ___lc_handle 00416fd8 LIBC:nlsdata2.obj - 0003:00002ff0 ___lc_codepage 00416ff0 LIBC:nlsdata2.obj - 0003:00002ff4 ___lc_collate_cp 00416ff4 LIBC:nlsdata2.obj - 0003:00002ff8 __fmode 00416ff8 LIBC:txtmode.obj - 0003:00003004 _rtcnt 00417004 - 0003:00003008 _lbfhead 00417008 - 0003:0000300c _cfp 0041700c - 0003:00003010 _bsp 00417010 - 0003:00003014 _axp 00417014 - 0003:00003018 _lbnhead 00417018 - 0003:0000301c _gcntr 0041701c - 0003:00003020 _rtbuf 00417020 - 0003:00003070 _filep 00417070 - 0003:00003074 _gsp 00417074 - 0003:00003078 _globlp 00417078 - 0003:0000307c _lfp 0041707c - 0003:00003080 _rtflg 00417080 - 0003:000030c0 _symhash 004170c0 - 0003:000031c0 _mfp 004171c0 - 0003:000031c4 _a_mask 004171c4 - 0003:000031c8 _line 004171c8 - 0003:000031cc _lop 004171cc - 0003:000031d0 _ofp 004171d0 - 0003:000031d4 _headp 004171d4 - 0003:000031d8 _zflag 004171d8 - 0003:000031dc _rfp 004171dc - 0003:000031e0 _rtval 004171e0 - 0003:00003220 _oflag 00417220 - 0003:00003224 _sfp 00417224 - 0003:00003228 _areap 00417228 - 0003:0000322c _tfp 0041722c - 0003:00003230 _sdp 00417230 - 0003:0000323c _page 0041723c - 0003:00003240 _pass 00417240 - 0003:00003244 _ap 00417244 - 0003:00003248 _outfp 00417248 - 0003:0000324c _wflag 0041724c - 0003:00003250 _hp 00417250 - 0003:00003254 _ip 00417254 - 0003:00003258 _rp 00417258 - 0003:0000325c _a_bytes 0041725c - 0003:00003260 _ib 00417260 - 0003:00003328 _gline 00417328 - 0003:0000332c _pflag 0041732c - 0003:00003330 _s_mask 00417330 - 0003:00003334 _basep 00417334 - 0003:00003338 _lbphead 00417338 - 0003:0000333c _xflag 0041733c - 0003:00003340 _rb 00417340 - 0003:00003408 _startp 00417408 - 0003:0000340c _radix 0041740c - 0003:00003410 _mflag 00417410 - 0003:00003414 _linkp 00417414 - 0003:00003418 _objflg 00417418 - 0003:0000341c _lkerr 0041741c - 0003:00003420 _rerr 00417420 - 0003:00003434 _v_mask 00417434 - 0003:000035a4 ___mbcodepage 004175a4 - 0003:00003620 ___mbulinfo 00417620 - 0003:0000362c ___ismbcodepage 0041762c - 0003:00003640 __mbcasemap 00417640 - 0003:00003740 __mbctype 00417740 - 0003:00003844 ___mblcid 00417844 - 0003:00003848 ___sbh_sizeHeaderList 00417848 - 0003:00003858 ___sbh_indGroupDefer 00417858 - 0003:0000385c ___sbh_pHeaderScan 0041785c - 0003:00003860 ___sbh_pHeaderDefer 00417860 - 0003:00003864 ___sbh_cntHeaderList 00417864 - 0003:00003868 ___sbh_pHeaderList 00417868 - 0003:0000386c __crtheap 0041786c - 0003:00003880 ___pioinfo 00417880 - 0003:000039bc __nhandle 004179bc - 0003:000039c0 __acmdln 004179c0 - 0003:000039cc ___env_initialized 004179cc - 0003:000039dc ___mbctype_initialized 004179dc - 0003:000039e0 ___onexitend 004179e0 - 0003:000039e4 ___onexitbegin 004179e4 - 0003:000039e8 __FPinit 004179e8 - 0003:000039ec ___piob 004179ec - 0003:00003d40 __bufin 00417d40 - 0003:00004d40 __nstream 00418d40 - 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 00419000 kernel32:KERNEL32.dll - 0004:00000014 __NULL_IMPORT_DESCRIPTOR 00419014 kernel32:KERNEL32.dll - 0004:00000124 __imp__GetModuleFileNameA@12 00419124 kernel32:KERNEL32.dll - 0004:00000128 __imp__HeapAlloc@12 00419128 kernel32:KERNEL32.dll - 0004:0000012c __imp__ExitProcess@4 0041912c kernel32:KERNEL32.dll - 0004:00000130 __imp__TerminateProcess@8 00419130 kernel32:KERNEL32.dll - 0004:00000134 __imp__GetCurrentProcess@0 00419134 kernel32:KERNEL32.dll - 0004:00000138 __imp__GetCommandLineA@0 00419138 kernel32:KERNEL32.dll - 0004:0000013c __imp__GetVersion@0 0041913c kernel32:KERNEL32.dll - 0004:00000140 __imp__SetHandleCount@4 00419140 kernel32:KERNEL32.dll - 0004:00000144 __imp__GetStdHandle@4 00419144 kernel32:KERNEL32.dll - 0004:00000148 __imp__GetFileType@4 00419148 kernel32:KERNEL32.dll - 0004:0000014c __imp__GetStartupInfoA@4 0041914c kernel32:KERNEL32.dll - 0004:00000150 __imp__GetLastError@0 00419150 kernel32:KERNEL32.dll - 0004:00000154 __imp__CloseHandle@4 00419154 kernel32:KERNEL32.dll - 0004:00000158 __imp__HeapDestroy@4 00419158 kernel32:KERNEL32.dll - 0004:0000015c __imp__HeapCreate@12 0041915c kernel32:KERNEL32.dll - 0004:00000160 __imp__VirtualFree@12 00419160 kernel32:KERNEL32.dll - 0004:00000164 __imp__VirtualAlloc@16 00419164 kernel32:KERNEL32.dll - 0004:00000168 __imp__HeapReAlloc@16 00419168 kernel32:KERNEL32.dll - 0004:0000016c __imp__IsBadWritePtr@8 0041916c kernel32:KERNEL32.dll - 0004:00000170 __imp__SetFilePointer@16 00419170 kernel32:KERNEL32.dll - 0004:00000174 __imp__WriteFile@20 00419174 kernel32:KERNEL32.dll - 0004:00000178 __imp__UnhandledExceptionFilter@4 00419178 kernel32:KERNEL32.dll - 0004:0000017c __imp__HeapFree@12 0041917c kernel32:KERNEL32.dll - 0004:00000180 __imp__FreeEnvironmentStringsA@4 00419180 kernel32:KERNEL32.dll - 0004:00000184 __imp__FreeEnvironmentStringsW@4 00419184 kernel32:KERNEL32.dll - 0004:00000188 __imp__WideCharToMultiByte@32 00419188 kernel32:KERNEL32.dll - 0004:0000018c __imp__GetEnvironmentStrings@0 0041918c kernel32:KERNEL32.dll - 0004:00000190 __imp__GetEnvironmentStringsW@0 00419190 kernel32:KERNEL32.dll - 0004:00000194 __imp__RtlUnwind@16 00419194 kernel32:KERNEL32.dll - 0004:00000198 __imp__FlushFileBuffers@4 00419198 kernel32:KERNEL32.dll - 0004:0000019c __imp__SetStdHandle@8 0041919c kernel32:KERNEL32.dll - 0004:000001a0 __imp__ReadFile@20 004191a0 kernel32:KERNEL32.dll - 0004:000001a4 __imp__CreateFileA@28 004191a4 kernel32:KERNEL32.dll - 0004:000001a8 __imp__MultiByteToWideChar@24 004191a8 kernel32:KERNEL32.dll - 0004:000001ac __imp__GetCPInfo@8 004191ac kernel32:KERNEL32.dll - 0004:000001b0 __imp__GetACP@0 004191b0 kernel32:KERNEL32.dll - 0004:000001b4 __imp__GetOEMCP@0 004191b4 kernel32:KERNEL32.dll - 0004:000001b8 __imp__GetProcAddress@8 004191b8 kernel32:KERNEL32.dll - 0004:000001bc __imp__LoadLibraryA@4 004191bc kernel32:KERNEL32.dll - 0004:000001c0 __imp__SetEndOfFile@4 004191c0 kernel32:KERNEL32.dll - 0004:000001c4 __imp__GetStringTypeA@20 004191c4 kernel32:KERNEL32.dll - 0004:000001c8 __imp__GetStringTypeW@16 004191c8 kernel32:KERNEL32.dll - 0004:000001cc __imp__LCMapStringA@24 004191cc kernel32:KERNEL32.dll - 0004:000001d0 __imp__LCMapStringW@24 004191d0 kernel32:KERNEL32.dll - 0004:000001d4 \177KERNEL32_NULL_THUNK_DATA 004191d4 kernel32:KERNEL32.dll - - entry point at 0001:000093f7 - diff --git a/src/mkfont/bmp2txt.cpp b/src/mkfont/bmp2txt.cpp new file mode 100644 index 00000000..26122008 --- /dev/null +++ b/src/mkfont/bmp2txt.cpp @@ -0,0 +1,313 @@ +// bmp2txt.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#include +#pragma hdrstop +#include "hymb.h" +#include "hyfs.h" +#include "hyfile.h" +#include "hyimage.h" + +int main(int argc, char **argv); +int fiProcess(FILETAG *pftOut, BMPTAG *pbtIn); + +// ---------------------------------------------------------------------------- + +BMPTAG btIn; +char *pszInFileName; + +FILETAG ftOut; +char *pszOutFileName; +char szOutFileName[512]; + +// ---------------------------------------------------------------------------- + +int main(int argc, char **argv) + { + int i; + + if (argc > 1) + { + pszInFileName = argv[1]; + } + + if (argc > 2) + { + pszOutFileName = argv[2]; + } + + if (pszInFileName == NULL) + { + printf("usage: bmp2txt infile.bmp [outfile.txt]\n"); + exit(1); + } + + if (pszOutFileName == NULL) + { + pszOutFileName = szOutFileName; + strcpy(pszOutFileName, pszInFileName); + + i = strlen(pszOutFileName); + while (i--) + { + if (pszOutFileName[i] == '\\') + { + break; /* no extension, so don't strip it */ + } + if (pszOutFileName[i] == '.') + { + pszOutFileName[i] = 0; /* strip dot and extension */ + break; /* ready to concatenate our extension */ + } + } + + strcat(pszOutFileName, ".txt"); + } + + if (!strcmp(pszInFileName, pszOutFileName)) + { + printf("Input and output filenames identical\n"); + exit(1); + } + + // read the input bmp file entirely to a malloc'd block + if (fiBmpReadIn(&btIn, pszInFileName) == FALSE) + { + printf("Could not read %s\n", pszInFileName); + exit(1); + } + + printf("Loaded %s, 0x%08x samples\n", pszInFileName, + btIn.iSampleAppend); + + // prepare an output buffer for character set data + FileAllocate(&ftOut, 0x100000); // 64 kbytes + + // search for characters and write character set files + if (fiProcess(&ftOut, &btIn) == FALSE) + { + exit(1); + } + + // ready to write the output we found + FileWriteOut(&ftOut, pszOutFileName); + + // all done my friend + BmpFree(&btIn); + FileFree(&ftOut); + + return 0; + } + +// ---------------------------------------------------------------------------- + +int fiProcess(FILETAG *pftOut, BMPTAG *pbtIn) + { + int m, x, y, t; + int i, j, k, l; + int n, o, p, q /*, u*/; + int r, s; + int cx, cy; + int iCurrent, iState, iSample, iOffset; + int *piTotal, *piRow, *piColumn; + MBHANDLE mbhTotal, mbhRow, mbhColumn; + char *pc; + + cx = pbtIn->pbih->biWidth; + cy = pbtIn->pbih->biHeight; + +#if 0 + if (pbtIn->iChannels != 1) + { + printf("fiProcess: Channels %d (must be 1)\n", + pbtIn->iChannels); + return FALSE; + } +#endif + + // prepare to find total of black values per pixel row + MBAlloc(&mbhTotal, cy * sizeof(int)); + piTotal = (int *)mbhTotal.pcBase; + + // prepare to find row indices of the character lines + MBAlloc(&mbhRow, (cy + 1) * sizeof(int)); + piRow = (int *)mbhRow.pcBase; + + // find blackness of each row and divide into character lines + r = 0; + iState = 0; + iCurrent = cy * pbtIn->iSamplesLine; + for (y = cy - 1; y >= 0; y--) + { + iCurrent -= pbtIn->iSamplesLine; + iSample = iCurrent; + + t = 0; + for (x = 0; x < cx; x++) + { + for (m = 0; m < pbtIn->iChannels; m++) + { + t += pbtIn->pucSample[iSample++] ^ 0xff; + } + } + + piTotal[y] = t; // total of dark pixels for row + + m = (t != 0); // 0 = all white, 1 = something found + if (iState != m) + { + iState = m; + piRow[r++] = y + 1; // record change of state + } + } + + if (iState) + { + piRow[r++] = y + 1; // record change of state to white + } + + // prepare to find column indices of individual characters + MBAlloc(&mbhColumn, (cx + 1) * sizeof(int)); + piColumn = (int *)mbhColumn.pcBase; + + // loop through the character lines found + pc = pftOut->pcBase; + for (i = 0; i < r; i += 2) + { + j = piRow[i + 1]; // start line of region + k = piRow[i]; // line after end of region + + // optional feature to find baseline ignoring descenders + t = 0; + for (y = j; y < k; y++) + { + t += piTotal[y]; // total black counts for region + } + + l = j; // assume line after bottom is baseline + t = t * 2 / (3 * (k - j)); // 2/3 of the average black count + for (y = j; y < k; y++) + { + if (piTotal[y] >= t) // is line blacker than this? + { + l = y; // found the line after baseline + break; + } + } + + // find blackness of each column and divide into characters + s = 0; + iState = 0; + iCurrent = j * pbtIn->iSamplesLine; + iOffset = pbtIn->iSamplesLine - pbtIn->iChannels; + for (x = 0; x < cx; x++) + { + iSample = iCurrent; + iCurrent += pbtIn->iChannels; + + t = 0; + for (y = j; y < k; y++) + { + for (m = 0; m < pbtIn->iChannels; m++) + { + t += pbtIn->pucSample[iSample++] ^ + 0xff; + } + iSample += iOffset; + } + + m = (t != 0); // 0 = all white, 1 = something found + if (iState != m) + { + iState = m; + piColumn[s++] = x; // record change of state + } + } + + if (iState) + { + piColumn[s++] = x; // record change of state to white + } + + // loop through the individual characters found + for (n = 0; n < s; n += 2) + { + o = piColumn[n]; // start column of character + p = piColumn[n + 1]; // column after end of character + + pc += sprintf(pc, "at %d,%d size %d,%d\r\n", + o, cy - j, p + 1 - o, k - j); + + iCurrent = k * pbtIn->iSamplesLine; + iOffset = o * pbtIn->iChannels; + for (y = k - 1; y >= j; y--) + { + iCurrent -= pbtIn->iSamplesLine; + iSample = iCurrent + iOffset; + + q = (y == l) ? '_' : ' '; + /*u = '|';*/ + for (x = o; x < p; x++) + { + t = 0; + for (m = 0; m < pbtIn->iChannels; m++) + { + if + ((pbtIn->pucSample[iSample++] + ^ 0xff) >= 0x80) + { + t = 1; + } + } + if (t) + { + *pc++ = '#'; + *pc++ = '#'; + } + else + { + *pc++ = q; /*u;*/ + *pc++ = q; + } + /*u = q;*/ + } + + *pc++ = q; + *pc++ = q; + *pc++ = '\r'; + *pc++ = '\n'; + } + +#if 0 + /*u = '|';*/ + for (x = o; x < p; x++) + { + *pc++ = ' '; /*u;*/ + *pc++ = ' '; + /*u = ' ';*/ + } + + *pc++ = ' '; + *pc++ = ' '; + *pc++ = '\r'; + *pc++ = '\n'; +#endif + } + + } + + MBFree(&mbhColumn); + MBFree(&mbhRow); + MBFree(&mbhTotal); + + pftOut->pcAppend = pc; + + return TRUE; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/bmp2txt.exe b/src/mkfont/bmp2txt.exe new file mode 100644 index 00000000..fdf4e300 Binary files /dev/null and b/src/mkfont/bmp2txt.exe differ diff --git a/src/mkfont/chs2cmd.cpp b/src/mkfont/chs2cmd.cpp new file mode 100644 index 00000000..4a2af96e --- /dev/null +++ b/src/mkfont/chs2cmd.cpp @@ -0,0 +1,109 @@ +// chs2cmd.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#pragma hdrstop +#include "hymb.h" +#include "hyfs.h" +#include "hyfile.h" + +int main(int argc, char **argv); +int fiProcess(FILETAG *ftOut, FILETAG *ftIn, int iICS, int iILS); +int iCompare(const void *pvLeft, const void *pvRight); +int iUpdateCRC(char *pcBase, int iCount, int iCRC); + +// ---------------------------------------------------------------------------- + +FILETAG ftIn; +char *pszInFileName; + +FILETAG ftOut; +char *pszOutFileName; +char szOutFileName[512]; + +// ---------------------------------------------------------------------------- + +int main(int argc, char **argv) + { + int i, iSetNo; + + if (argc > 1) + { + pszInFileName = argv[1]; + } + + iSetNo = 0; + if (argc > 2) + { + iSetNo = atoi(argv[2]); + if (iSetNo < 1 || iSetNo > 0xff) + { + pszOutFileName = argv[2]; + if (argc > 3) + { + iSetNo = atoi(argv[3]); + } + } + } + + if (pszInFileName == NULL) + { + printf("usage: chs2cmd infile.txt [outfile.cmd] [setno]\n"); + exit(1); + } + + if (pszOutFileName == NULL) + { + pszOutFileName = szOutFileName; + strcpy(pszOutFileName, pszInFileName); + + i = strlen(pszOutFileName); + while (i--) + { + if (pszOutFileName[i] == '\\') + { + break; /* no extension, so don't strip it */ + } + if (pszOutFileName[i] == '.') + { + pszOutFileName[i] = 0; /* strip dot and extension */ + break; /* ready to concatenate our extension */ + } + } + + strcat(pszOutFileName, ".cmd"); + } + + if (!strcmp(pszInFileName, pszOutFileName)) + { + printf("Input and output filenames identical\n"); + exit(1); + } + + // read the input bmp file entirely to a malloc'd block + FileReadIn(&ftIn, pszInFileName); + + // create output buffer with esc plus character set data + FileCopyPadded(&ftOut, &ftIn, 5, 0); + ftOut.pcBase[0] = 0x1b; + ftOut.pcBase[1] = '.'; + ftOut.pcBase[2] = iSetNo + '0'; + *(short *)&ftOut.pcBase[3] = ftIn.pcAppend - ftIn.pcBase; + + // ready to write the output we found + FileWriteOut(&ftOut, pszOutFileName); + + // all done my friend + FileFree(&ftIn); + FileFree(&ftOut); + + return 0; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/chs2cmd.exe b/src/mkfont/chs2cmd.exe new file mode 100644 index 00000000..f355dbb7 Binary files /dev/null and b/src/mkfont/chs2cmd.exe differ diff --git a/src/mkfont/hyfile.cpp b/src/mkfont/hyfile.cpp new file mode 100644 index 00000000..f39efc35 --- /dev/null +++ b/src/mkfont/hyfile.cpp @@ -0,0 +1,307 @@ +// hyfile.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#pragma hdrstop +#include "hymb.h" +#include "hyfs.h" +#include "hyfile.h" + +// ---------------------------------------------------------------------------- + +int fiFileAllocate(FILETAG *pft, int iSize) + { + // zero the entire file tag item data area, avoiding leaks + memset(pft, 0, sizeof(FILETAG)); + + // allocate via the lower level wrapper, relying on the fact + // that the FILETAG structure is compatible with MBHANDLE !! + if (fiMBAlloc((MBHANDLE *) pft, iSize) == 0) + { + return FALSE; // indicates failure to allocate block + } + + // set position to start and file to null + pft->pcPosition = pft->pcBase; + pft->pcAppend = pft->pcBase; + + // say it is now allocated + return TRUE; + } + +int fiFileFree(FILETAG *pft) + { + // free via the lower level wrapper, relying on the fact + // that the FILETAG structure is compatible with MBHANDLE !! + if (fiMBFree((MBHANDLE *) pft) == 0) + { + return FALSE; // indicates failure to free block + } + + // zero the entire file tag item data area, avoiding leaks + memset(pft, 0, sizeof(FILETAG)); + + return TRUE; // indicates block freed and tag item zeroed + } + +// ---------------------------------------------------------------------------- + +int fiFileWriteOut(FILETAG *pft, char *pszName) + { + int iSize; + FSHANDLE fsh; + + // attempt to create or truncate file for writing + if (fiFSCreate(&fsh, pszName) == FALSE) + { + return FALSE; // probably directory not found + } + + // attempt to write the exact amount of data + iSize = iFileSize(pft); + if (iFSWrite(&fsh, pft->pcBase, iSize) != iSize) + { + fiFSClose(&fsh); + return FALSE; + } + + fiFSClose(&fsh); + return TRUE; // says we wrote the file + } + +int fiFileReadIn(FILETAG *pft, char *pszName) + { + int iSize; + FSHANDLE fsh; + + // zero the entire file tag item data area, avoiding leaks + memset(pft, 0, sizeof(FILETAG)); + + // attempt to open file for reading, get size + if (fiFSOpen(&fsh, pszName) == FALSE) + { + return FALSE; // probably file not found + } + iSize = filelength(fsh.iHandle); // assume can get size + +#if 0 + // sanity check for file much too large + if (iSize > 0x100000) // 1 megabyte + { + fiFSClose(&fsh); + return FALSE; + } +#endif + + // allocate heap to hold entire file + // note: simpler than the array or pool implementation, + // because the original limit, position, append info lost + if (fiFileAllocate(pft, iSize) == FALSE) + { + fiFSClose(&fsh); + return FALSE; + } + + // attempt read the exact amount of data + if (iFSRead(&fsh, pft->pcBase, iSize) != iSize) + { + fiFileFree(pft); + fiFSClose(&fsh); + return FALSE; + } + + fiFSClose(&fsh); + + // set position to start and length to length read + pft->pcPosition = pft->pcBase; + pft->pcAppend = pft->pcBase + iSize; + + return TRUE; // says we read the file + } + +// ---------------------------------------------------------------------------- + +int fiFileCopy(FILETAG *pft, FILETAG *pftIn) + { + int i, iSize; + + // zero the entire file tag item data area, avoiding leaks + memset(pft, 0, sizeof(FILETAG)); + + // allocate via the lower level wrapper, relying on the fact + // that the FILETAG structure is compatible with MBHANDLE !! + iSize = iFileSize(pftIn); + if (fiMBAlloc((MBHANDLE *) pft, iSize) == FALSE) + { + return FALSE; // indicates failure to allocate block + } + + // calculate the required adjustment, before clobbering pft! + i = pft->pcBase - pftIn->pcBase; + + // copy the entire file tag item data area, avoiding leaks + memcpy(pft, pftIn, iSize); + + // apply the required adjustment to all fields of filetag + pft->pcBase += i; + //pft->pcLimit += i; + pft->pcPosition += i; + pft->pcAppend += i; + + // another slight adjustment because the copy trims to size + pft->pcLimit = pft->pcAppend; + return TRUE; // indicates copied and new tag item filled out + } + +int fiFileCopyPadded(FILETAG *pft, FILETAG *pftIn, int iLeft, int iRight) + { + int i, iSize; + + // zero the entire file tag item data area, avoiding leaks + memset(pft, 0, sizeof(FILETAG)); + + // allocate via the lower level wrapper, relying on the fact + // that the FILETAG structure is compatible with MBHANDLE !! + iSize = iFileSize(pftIn); + if (fiMBAlloc((MBHANDLE *) pft, iLeft + iSize + iRight) == FALSE) + { + return FALSE; // indicates failure to allocate block + } + + // calculate the required adjustment, before clobbering pft! + i = pft->pcBase - pftIn->pcBase; + + // copy the entire file tag item data area, avoiding leaks + memcpy(pft, pftIn, sizeof(FILETAG)); + + // apply the required adjustment to all fields of filetag + pft->pcBase += i; + //pft->pcLimit += i; + pft->pcPosition += iLeft + i; + pft->pcAppend += iLeft + i + iRight; + + // another slight adjustment because the copy trims to size + pft->pcLimit = pft->pcAppend; + + // copy the actual data, with padding as specified by caller + memset(pft->pcBase, 0, iLeft); + memcpy(pft->pcBase + iLeft, pftIn->pcBase, iSize); + memset(pft->pcBase + iLeft + iSize, 0, iRight); + + return TRUE; // indicates copied and new tag item filled out + } + +// ---------------------------------------------------------------------------- + +int fiFilePutLine(FILETAG *pft, char *pszLine) + { + int iTemp; + + // calculate length once + iTemp = 0; + if (pszLine != NULL) + { + iTemp = strlen(pszLine); + } + + // do not go past end of memory + if ((pft->pcPosition + iTemp + 2) > pft->pcLimit) + { + return FALSE; + } + + // copy line and crlf terminator out to heap + if (pszLine != NULL) + { + memcpy(pft->pcPosition, pszLine, iTemp); + } + memcpy(pft->pcPosition + iTemp, "\r\n", 2); + pft->pcPosition += iTemp + 2; + + // set file length possibly truncating + pft->pcAppend = pft->pcPosition; + + // say we stored a line + return TRUE; + } + +int fiFileGetLine(FILETAG *pft, char *pszLine, int iLimit, int *piCount) + { + int i; + + // indicate eof to caller + if (pft->pcPosition >= pft->pcAppend) + { + // if caller requested the length of the result, return null + if (piCount != NULL) + { + *piCount = 0; + } + + // the return value from the function indicates eof or not + return FALSE; + } + + for (i = 0; i < iLimit; i++) + { + // terminate the loop for eof + if (pft->pcPosition >= pft->pcAppend) + { + break; + } + + // terminate the loop for lf by itself + if (*pft->pcPosition == 0x0a) + { + (pft->pcPosition)++; + break; + } + + // terminate the loop for cr optionally skipping lf + if (*pft->pcPosition == 0x0d) + { + (pft->pcPosition)++; + if (*pft->pcPosition == 0x0a) + { + pft->pcPosition++; + } + break; + } + + // copy character to caller buffer + if (pszLine != NULL) + { + pszLine[i] = *pft->pcPosition; // formerly ++ + } + pft->pcPosition++; + } + + // null terminate string for caller + if (pszLine != NULL) + { + // see hyprintf.cpp, but i decided to do this differently here!! + //// sentinel is not always placed, so use the length instead !! + //// callers wishing to bodgy can use count-1 and poke their own 0 + //if (i < iCount) + // { + pszLine[i] = 0; + // } + } + + // if caller requested the length of the result, return it + if (piCount != NULL) + { + *piCount = i; + } + + // the return value from the function indicates eof or not + return TRUE; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hyfile.h b/src/mkfont/hyfile.h new file mode 100644 index 00000000..0d8a1ddc --- /dev/null +++ b/src/mkfont/hyfile.h @@ -0,0 +1,125 @@ +// hyfile.h + +#ifndef _INC_HYFILE +#define _INC_HYFILE + +// ---------------------------------------------------------------------------- + +typedef struct +{ + char *pcBase; // also the handle for the malloc'd buffer + char *pcLimit; // offset just after end of malloc'd buffer + char *pcPosition; // offset of the next char to be clobbered + char *pcAppend; // offset just after end of valid char data +} FILETAG; + +// ---------------------------------------------------------------------------- + +int fiFileAllocate(FILETAG *pft, int iSize); +int fiFileFree(FILETAG *pft); + +int fiFileWriteOut(FILETAG *pft, char *pszName); +int fiFileReadIn(FILETAG *pft, char *pszName); + +int fiFileCopy(FILETAG *pft, FILETAG *pftIn); +int fiFileCopyPadded(FILETAG *pft, FILETAG *pftIn, int iLeft, int iRight); + +int fiFilePutLine(FILETAG *pft, char *pszLine); +int fiFileGetLine(FILETAG *pft, char *pszLine, int iLimit, int *piCount); + +// ---------------------------------------------------------------------------- + +inline int iFileSize(FILETAG *pft) + { + // return size in bytes, for use by FileReadIn etc family + return pft->pcAppend - pft->pcBase; // note: the trimmed size + } + +// ---------------------------------------------------------------------------- +// handy functions for the client, not important to the interface: + +#ifdef _INC_STDIO +inline void FileAllocate(FILETAG *pft, int iSize) + { + if (fiFileAllocate(pft, iSize) == FALSE) + { + printf("FileAllocate: Could not allocate %08x bytes\n", iSize); + exit(1); + } + +#ifdef DEBUG + printf("FileAllocate: " + "Allocated file %08x, %08x bytes\n", pft, iSize); +#endif + } + +inline void FileFree(FILETAG *pft) + { + if (fiFileFree(pft) == FALSE) + { + printf("FileFree: Could not free file %08x\n", pft); + exit(1); + } + +#ifdef DEBUG + printf("FileFree: Freed file %08x\n", pft); +#endif + } + +inline void FileReadIn(FILETAG *pft, char *pszName) + { + if (fiFileReadIn(pft, pszName) == FALSE) + { + printf("FileReadIn: Could not read %s\n", pszName); + exit(1); + } + + printf( +#ifdef DEBUG + "FileReadIn: " +#endif + "Loaded %s, 0x%08x bytes\n", + pszName, pft->pcAppend - pft->pcBase); + } + +inline void FileWriteOut(FILETAG *pft, char *pszName) + { + if (fiFileWriteOut(pft, pszName) == FALSE) + { + printf("FileWriteOut: Could not write %s\n", pszName); + exit(1); + } + + printf( +#ifdef DEBUG + "FileWriteOut: " +#endif + "Created %s, 0x%08x bytes\n", + pszName, pft->pcAppend - pft->pcBase); + } + +inline void FileCopy(FILETAG *pft, FILETAG *pftIn) + { + if (fiFileCopy(pft, pftIn) == FALSE) + { + printf("FileCopy: Could not copy 0x%08x bytes\n", + pftIn->pcAppend - pftIn->pcBase); + exit(1); + } + } + +inline void FileCopyPadded(FILETAG *pft, FILETAG *pftIn, int iLeft, int iRight) + { + if (fiFileCopyPadded(pft, pftIn, iLeft, iRight) == FALSE) + { + printf("FileCopyPadded: Could not copy 0x%08x bytes\n", + (pftIn->pcAppend - pftIn->pcBase) + iLeft + iRight); + exit(1); + } + } +#endif + +// ---------------------------------------------------------------------------- + +#endif + diff --git a/src/mkfont/hyfs.cpp b/src/mkfont/hyfs.cpp new file mode 100644 index 00000000..ebdf991f --- /dev/null +++ b/src/mkfont/hyfs.cpp @@ -0,0 +1,137 @@ +// hyfs.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#pragma hdrstop +#include "hyfs.h" + +// ---------------------------------------------------------------------------- + +void FSEntrySetup(void) + { + // for future expansion, including GetModuleFileName + } + +void FSExitCleanup(void) + { + // for future expansion + } + +// ---------------------------------------------------------------------------- + +int fiFSOpen(FSHANDLE *pfsh, char *pszName) + { + // clear filestreamtag, although we should also free name and error if + // not null, so calling convention needs to be revised (zero it for now) + memset(pfsh, 0, sizeof(FSHANDLE)); + + // set up fields to print a report on closure + //pfsh->iMode = 0; + //pfsh->iCount = 0; + + // attempt to open file or device for reading + pfsh->pszName = pszName; + pfsh->iHandle = open(pszName, O_RDONLY | O_BINARY); + if (pfsh->iHandle < 0) + { + pfsh->iError = IDS_ERROR_FS_OPEN; + return FALSE; + } + + // indicate successful operation + //pfsh->iError = 0; + return TRUE; + } + +int fiFSCreate(FSHANDLE *pfsh, char *pszName) + { + // clear filestreamtag, although we should also free name and error if + // not null, so calling convention needs to be revised (zero it for now) + memset(pfsh, 0, sizeof(FSHANDLE)); + + // set up fields to print a report on closure + pfsh->iMode = 1; + //pfsh->iCount = 0; + + // attempt to create file or open device for writing + pfsh->pszName = pszName; + pfsh->iHandle = open(pszName, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, + S_IREAD | S_IWRITE); + if (pfsh->iHandle < 0) + { + pfsh->iError = IDS_ERROR_FS_CREATE; + return FALSE; + } + + // indicate successful operation + //pfsh->iError = 0; + return TRUE; + } + +int fiFSClose(FSHANDLE *pfsh) + { + int i; + + // attempt to close file, noting success + i = close(pfsh->iHandle); + if (i < 0) // check msdn + { + pfsh->iError = IDS_ERROR_FS_CLOSE; + return FALSE; + } + pfsh->iHandle = -1; // for no good reason + + // indicate successful operation + pfsh->iError = 0; + return TRUE; + } + +// ---------------------------------------------------------------------------- + +int iFSRead(FSHANDLE *pfsh, char *pcOut, int iLimit) + { + int i; + + // attempt to open file or device for reading + i = read(pfsh->iHandle, pcOut, iLimit); + if (i < 0) // check msdn + { + pfsh->iError = IDS_ERROR_FS_READ; + return 0; + } + + // maintain fields to print a report on closure + pfsh->iCount += i; + + // indicate successful operation + pfsh->iError = 0; + return i; + } + +int iFSWrite(FSHANDLE *pfsh, char *pcIn, int iLimit) + { + int i; + + // attempt to open file or device for reading + i = write(pfsh->iHandle, pcIn, iLimit); + if (i < 0) // check msdn + { + pfsh->iError = IDS_ERROR_FS_WRITE; + return 0; + } + + // maintain fields to print a report on closure + pfsh->iCount += i; + + // indicate successful operation + pfsh->iError = 0; + return i; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hyfs.h b/src/mkfont/hyfs.h new file mode 100644 index 00000000..cb85160a --- /dev/null +++ b/src/mkfont/hyfs.h @@ -0,0 +1,121 @@ +// hyfs.h + +#define _INC_HYFS + +// ---------------------------------------------------------------------------- + +#define IDS_ERROR_FS_OPEN 12000 +#define IDS_ERROR_FS_CREATE 12001 +#define IDS_ERROR_FS_CLOSE 12002 +#define IDS_ERROR_FS_READ 12003 +#define IDS_ERROR_FS_WRITE 12004 + +// ---------------------------------------------------------------------------- + +typedef struct + { + int iHandle; + char *pszName; + + int iMode; + int iCount; + + int iError; + char *pszError; + } FSHANDLE; + +// ---------------------------------------------------------------------------- + +void FSEntrySetup(void); +void FSExitCleanup(void); + +int fiFSOpen(FSHANDLE *pfsh, char *pszName); +int fiFSCreate(FSHANDLE *pfsh, char *pszName); +int fiFSClose(FSHANDLE *pfsh); + +int iFSRead(FSHANDLE *pfsh, char *pcOut, int iLimit); +int iFSWrite(FSHANDLE *pfsh, char *pcIn, int iLimit); + +// ---------------------------------------------------------------------------- + +inline void FSOpen(FSHANDLE *pfsh, char *pszName) + { + if (fiFSOpen(pfsh, pszName) == 0) + { + printf("FSOpen: " + "Could not open file %s for reading, exiting\n", pszName); + exit(1); + } + + printf("FSOpen: " + "Handle %08x file %s opened, read mode\n", pfsh, pszName); + } + +inline void FSCreate(FSHANDLE *pfsh, char *pszName) + { + if (fiFSCreate(pfsh, pszName) == 0) + { + printf("FSCreate: " + "Could not create or truncate file %s, exiting\n", pszName); + exit(1); + } + + printf("FSCreate: " + "Handle %08x file %s opened, write mode\n", pfsh, pszName); + } + +inline void FSClose(FSHANDLE *pfsh) + { + if (fiFSClose(pfsh) == 0) + { + printf("FSClose: " + "Could not close handle %08x, exiting\n", pfsh); + exit(1); + } + + printf("FSClose: " + "Handle %08x file %s closed, %s mode\n", + pfsh, pfsh->pszName, pfsh->iMode ? "write" : "read"); + + printf("Loaded file %s, size %d bytes\n", + pfsh->pszName, pfsh->iCount); + } + +inline void FSRead(FSHANDLE *pfsh, char *pcOut, int iLimit) + { + int iCount; + + iCount = iFSRead(pfsh, pcOut, iLimit); + if (iCount != iLimit) + { + printf("FSRead: " + "End of file, handle %08x, request %d, return %d\n", + pfsh, iLimit, iCount); + exit(1); + } + + printf("FSRead: " + "Handle %08x file %s read, request %d, return %d\n", + pfsh, pfsh->pszName, iLimit, iCount); + } + +inline void FSWrite(FSHANDLE *pfsh, char *pcIn, int iLimit) + { + int iCount; + + iCount = iFSWrite(pfsh, pcIn, iLimit); + if (iCount != iLimit) + { + printf("FSWrite: " + "Disk full, handle %08x, request %d, return %d\n", + pfsh, iLimit, iCount); + exit(1); + } + + printf("FSWrite: " + "Handle %08x file %s written, request %d, return %d\n", + pfsh, pfsh->pszName, iLimit, iCount); + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hyimage.cpp b/src/mkfont/hyimage.cpp new file mode 100644 index 00000000..dfc111fc --- /dev/null +++ b/src/mkfont/hyimage.cpp @@ -0,0 +1,1230 @@ +// hyimage.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#pragma hdrstop +#include "hyfile.h" +#include "hyimage.h" + +// ---------------------------------------------------------------------------- + +BITMAPFILEHEADER bfhDefault = + { + 0x4D42, // bfType = 'BM' + 0, // bfSize + 0, // bfReserved1 + 0, // bfReserved2 + 0, // bfOffBits + }; + +/* +BITMAPINFOHEADER bihDefault = + { + 0x46465952, // iFileId = 'RIFF' + 0, // iFileSize + 0x45564157, // iTypeId = 'BMPE' + 0x20746d66, // iFormatId = 'fmt_' + 0x10, // iFormatSize + 1, // siFormatTag + 2, // siChannels + 44100, // iPixelRate + 176400, // iByteRate + 4, // siAlignment + 16, // siBitsPixel + 0x61746164, // iDataId = 'data' + 0 // iDataSize + }; +*/ + +// ---------------------------------------------------------------------------- + +int fiBmpAllocate(BMPTAG *pbt, BITMAPINFOHEADER *pbihIn, + int cxPixels, int cyPixels) + { + int iPalette; + int iBitsPixel, iBitsLine; + int iPixelsLine, iBytes; + + // fill important bmptag fields from the user's bmp header + pbt->iChannels = max(1, pbihIn->biBitCount / 8); + pbt->iBitsChannel = pbihIn->biBitCount / pbt->iChannels; + + // calculate overall image size and required storage + iBitsPixel = pbt->iChannels * pbt->iBitsChannel; + iBitsLine = (cxPixels * iBitsPixel + 0x1f) & 0xffffffe0; + + pbt->iSamplesLine = iBitsLine / pbt->iBitsChannel; + + iBytes = cyPixels * (iBitsLine / 8); + + iPalette = 0; + if (pbt->iChannels == 1) + { + iPalette = sizeof(RGBQUAD) << pbt->iBitsChannel; + } + + // allocate and initialise memory block for header + data + if (fiFileAllocate(&pbt->ft, sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER) + + iPalette + iBytes) == FALSE) + { + return FALSE; + } + + memset(pbt->ft.pcBase, 0, pbt->ft.pcLimit - pbt->ft.pcBase); + + // fill bmptag fields which refer to the allocated memory block + pbt->pbfh = (BITMAPFILEHEADER *) (pbt->ft.pcBase); + pbt->pbih = (BITMAPINFOHEADER *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER)); + pbt->prgbq = (RGBQUAD *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + pbt->pucSample = (unsigned char *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + if (pbt->iChannels == 1) + { + pbt->pucSample += sizeof(RGBQUAD) << pbt->iBitsChannel; + } + + // initialise bitmap header within the allocated block + memcpy(pbt->pbfh, &bfhDefault, sizeof(BITMAPFILEHEADER)); + pbt->pbfh->bfOffBits = (char *) (pbt->pucSample) - pbt->ft.pcBase; + pbt->pbfh->bfSize = pbt->pbfh->bfOffBits + iBytes; + + memcpy(pbt->pbih, pbihIn, sizeof(BITMAPINFOHEADER)); + pbt->pbih->biWidth = cxPixels; + pbt->pbih->biHeight = cyPixels; + + // initialise the remainder of the bmptag for client + pbt->iSampleBase = 0; + pbt->iSampleLimit = pbt->pbih->biHeight * pbt->iSamplesLine; + pbt->iSamplePosition = 0; + pbt->iSampleAppend = 0; + + //pbt->rPixelWindow.left = 0; + //pbt->rPixelWindow.right = pbt->pbih->biWidth; + //pbt->rPixelWindow.bottom = 0; + //pbt->rPixelWindow.top = pbt->pbih->biHeight; + + //pbt->rPixelSurface.left = 0; + //pbt->rPixelSurface.right = iBitsLine / iBitsPixel; + //pbt->rPixelSurface.bottom = 0; + //pbt->rPixelSurface.top = pbt->pbih->biHeight; + + // say we met with success + return TRUE; + } + +// ---------------------------------------------------------------------------- + +int fiBmpReadIn(BMPTAG *pbt, char *pszFileName) + { + int iBitsPixel, iBitsLine, iPixelsLine; + + // attempt to read the client's requested file fully + if (fiFileReadIn(&pbt->ft, pszFileName) == FALSE) + { + return FALSE; + } + + // fill bmptag fields which refer to the allocated memory block + pbt->pbfh = (BITMAPFILEHEADER *) (pbt->ft.pcBase); + pbt->pbih = (BITMAPINFOHEADER *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER)); + pbt->prgbq = (RGBQUAD *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + + // check the file format in place before using header fields + if ((pbt->pbih->biPlanes != 1) || + ((pbt->pbih->biBitCount != 1) && + (pbt->pbih->biBitCount != 8) && + (pbt->pbih->biBitCount != 24) && + (pbt->pbih->biBitCount != 32))) + { + printf("fiBmpReadIn: Invalid BMP file %s\n", pszFileName); + FileFree(&pbt->ft); + return FALSE; + } +// printf("%d %d\n", pbt->pbih->biWidth, pbt->pbih->biHeight); + + // fill important bmptag fields from the user's bmp header + pbt->iChannels = max(1, pbt->pbih->biBitCount / 8); + pbt->iBitsChannel = pbt->pbih->biBitCount / pbt->iChannels; +// printf("%d %d\n", pbt->iChannels, pbt->iBitsChannel); + + pbt->pucSample = (unsigned char *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + if (pbt->iChannels == 1) + { + pbt->pucSample += sizeof(RGBQUAD) << pbt->iBitsChannel; + } + + iBitsPixel = pbt->iChannels * pbt->iBitsChannel; + iBitsLine = (pbt->pbih->biWidth * iBitsPixel + 0x1f) & 0xffffffe0; + + pbt->iSamplesLine = iBitsLine / pbt->iBitsChannel; + + // initialise the remainder of the bmptag for client + pbt->iSampleBase = 0; + pbt->iSamplePosition = 0; + pbt->iSampleAppend = pbt->pbih->biHeight * pbt->iSamplesLine; + pbt->iSampleLimit = pbt->iSampleAppend; + + //pbt->rPixelWindow.left = 0; + //pbt->rPixelWindow.right = pbt->pbih->biWidth; + //pbt->rPixelWindow.bottom = 0; + //pbt->rPixelWindow.top = pbt->pbih->biHeight; + + //pbt->rPixelSurface.left = 0; + //pbt->rPixelSurface.right = iBitsLine / iBitsPixel; + //pbt->rPixelSurface.bottom = 0; + //pbt->rPixelSurface.top = pbt->pbih->biHeight; + + // say we met with success + return TRUE; + } + +// ---------------------------------------------------------------------------- + +int fiBmpWriteOut(BMPTAG *pbt, char *pszFileName) + { + int i, j, k; + int iBitsPixel, iBitsLine; + int iBytesLine, iBytes; + + // update bmp file and info header lengths from length generated + iBitsPixel = pbt->iChannels * pbt->iBitsChannel; + iBitsLine = (pbt->pbih->biWidth * iBitsPixel + 0x1f) & 0xffffffe0; + + iBytesLine = iBitsLine / 8; + iBytes = pbt->pbih->biHeight * iBytesLine; + + pbt->pbfh->bfOffBits = (char *) (pbt->pucSample) - pbt->ft.pcBase; + pbt->pbfh->bfSize = pbt->pbfh->bfOffBits + iBytes; + + // refresh palette within file data if any palette is required + if (pbt->iChannels == 1) + { + j = 0; + k = 1 << pbt->iBitsChannel; + for (i = 0; i < k; i++) + { + ((int *) (pbt->prgbq))[i] = j; + j += 0x00010101; + } + } + + // update bmp info header information for client selected format + pbt->pbih->biPlanes = 1; // the red baron + pbt->pbih->biBitCount = pbt->iChannels * pbt->iBitsChannel; + + // update length in output filetag then write out + pbt->ft.pcAppend = (char *) (pbt->pucSample) + iBytes; + return fiFileWriteOut(&pbt->ft, pszFileName); + } + +// ---------------------------------------------------------------------------- + +void BmpFree(BMPTAG *pbt) + { + FileFree(&pbt->ft); + } + +// ---------------------------------------------------------------------------- + +int fiBmpCopy(BMPTAG *pbt, BMPTAG *pbtIn) + { + // copy the tag item, which will then be modified + memcpy(pbt, pbtIn, sizeof(BMPTAG)); + + // redirect the new tag item to a new malloc'd buffer + pbt->ft.pcBase = (char *) malloc(pbt->ft.pcLimit - pbt->ft.pcBase); + if (pbt->ft.pcBase == NULL) + { + printf("fiBmpCopy: " + "Could not allocate copy buffer of %08x bytes\n", + pbt->ft.pcLimit - pbt->ft.pcBase); + return FALSE; + } + + // copy the original sample data into the new malloc'd buffer + memcpy(pbt->ft.pcBase, pbtIn->ft.pcBase, + pbtIn->ft.pcLimit - pbtIn->ft.pcBase); + + // fill bmptag fields which refer to the allocated memory block + pbt->pbfh = (BITMAPFILEHEADER *) (pbt->ft.pcBase); + pbt->pbih = (BITMAPINFOHEADER *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER)); + pbt->prgbq = (RGBQUAD *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + pbt->pucSample = (unsigned char *) (pbt->ft.pcBase + + sizeof(BITMAPFILEHEADER) + + sizeof(BITMAPINFOHEADER)); + if (pbt->iChannels == 1) + { + pbt->pucSample += sizeof(RGBQUAD) << pbt->iBitsChannel; + } + + // sneakily nudge the remaining fields of the new tag item + pbt->ft.pcLimit += pbt->ft.pcBase - pbtIn->ft.pcBase; + pbt->ft.pcPosition += pbt->ft.pcBase - pbtIn->ft.pcBase; + pbt->ft.pcAppend += pbt->ft.pcBase - pbtIn->ft.pcBase; + + // say we met with success + return TRUE; + } + +// ---------------------------------------------------------------------------- + +int fiLinearExpand2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxFactor, int cyFactor) + { + int i, j, k, l, m, x, y, t; + int cxIn, cyIn, cxOut, cyOut; + int cxCentre, cyCentre; + int cxLeftFraction, cxRightFraction; + int cyTopFraction, cyBottomFraction; + int iLine, iPixel, iSample; + int *pi, *piThis, *piPrev, *piTemp; + int iThis[4], iPrev[4], iNormal; + + cxIn = pbtIn->pbih->biWidth; + cyIn = pbtIn->pbih->biHeight; + + cxOut = cxIn * cxFactor; + cyOut = cyIn * cyFactor; + + if (fiBmpAllocate(pbtOut, pbtIn->pbih, cxOut, cyOut) == FALSE) + { + printf("fiLinearExpand2D: " + "Failed to allocate output buffer of %08x pixels\n", + cxOut * cyOut); + return FALSE; + } + + pi = (int *) malloc(cxOut * pbtIn->iChannels * 2 * sizeof(int)); + if (pi == NULL) + { + printf("fiLinearExpand2D: " + "Failed to allocate temporary buffer of %08x samples\n", + cxOut * pbtIn->iChannels * 2); + BmpFree(pbtOut); + return FALSE; + } + + piThis = pi; + piPrev = pi + cxOut * pbtIn->iChannels; + + cxCentre = cxFactor / 2; + cyCentre = cyFactor / 2; + + cyBottomFraction = cyCentre; + cyTopFraction = cyFactor; + memset(piThis, 0, cxOut * pbtIn->iChannels * sizeof(int)); + + iNormal = cxFactor * cyFactor; + + i = 0; + iLine = 0; + for (y = 0; y <= cyIn; y++) + { + iPixel = iLine; + iLine += pbtIn->iSamplesLine; + + piTemp = piPrev; + piPrev = piThis; + piThis = piTemp; + + if (y < cyIn) + { + cxLeftFraction = cxCentre; + cxRightFraction = cxFactor; + memset(iThis, 0, pbtIn->iChannels * sizeof(int)); + + t = 0; + iSample = iPixel; + for (x = 0; x <= cxIn; x++) + { + memcpy(iPrev, iThis, pbtIn->iChannels * sizeof(int)); + + if (x < cxIn) + { + for (m = 0; m < pbtIn->iChannels; m++) + { + iThis[m] = pbtIn->pucSample[iSample++]; + } + } + else + { + cxRightFraction = cxCentre; + memset(iThis, 0, pbtIn->iChannels * sizeof(int)); + } + + for (k = cxLeftFraction; k < cxRightFraction; k++) + { + for (m = 0; m < pbtIn->iChannels; m++) + { + piThis[t++] = + k * iThis[m] + (cxFactor - k) * iPrev[m]; + } + } + + cxLeftFraction = 0; + } + } + else + { + cyTopFraction = cyCentre; + memset(piThis, 0, cxOut * pbtIn->iChannels * sizeof(int)); + } + + for (l = cyBottomFraction; l < cyTopFraction; l++) + { + j = i; + i += pbtOut->iSamplesLine; + + t = 0; + for (x = 0; x < cxOut; x++) + { + +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiLinearExpand2D: " + "Overflowed output buffer at sample %08x\n", j); + free(pi); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + for (m = 0; m < pbtIn->iChannels; m++) + { + pbtOut->pucSample[j++] = + (l * piThis[t] + (cyFactor - l) * piPrev[t]) / + iNormal; + + t++; + } + + } + } + + cyBottomFraction = 0; + } + + free(pi); + +#if 1 + if (i < pbtOut->iSampleLimit) + { + printf("fiLinearExpand2D: " + "Partially filled output buffer to sample %08x\n", i); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = i; + return TRUE; + } + +// ---------------------------------------------------------------------------- + +int fiLinearShrink2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxFactor, int cyFactor) + { + int i, j, k, l, m, x, y, t, u; + int cxIn, cyIn, cxOut, cyOut; + int iLine, iPixel, iSample; + int *pi, iNormal; + + cxIn = pbtIn->pbih->biWidth; + cyIn = pbtIn->pbih->biHeight; + + cxOut = cxIn / cxFactor; + cyOut = cyIn / cyFactor; + + if (fiBmpAllocate(pbtOut, pbtIn->pbih, cxOut, cyOut) == FALSE) + { + printf("fiLinearShrink2D: " + "Failed to allocate output buffer of %08x samples\n", + cxOut * cyOut * pbtIn->iChannels); + return FALSE; + } + + pi = (int *) malloc(cxOut * pbtIn->iChannels * sizeof(int)); + if (pi == NULL) + { + printf("fiLinearShrink2D: " + "Failed to allocate temporary buffer of %08x pixels\n", + cxOut); + BmpFree(pbtOut); + return FALSE; + } + + iNormal = cxFactor * cyFactor; + + i = 0; + iLine = 0; + for (y = 0; y < cyOut; y++) + { + j = i; + i += pbtOut->iSamplesLine; + + memset(pi, 0, cxOut * pbtIn->iChannels * sizeof(int)); + + for (l = 0; l < cyFactor; l++) + { + iPixel = iLine; + iLine += pbtIn->iSamplesLine; + + t = 0; + iSample = iPixel; + for (x = 0; x < cxOut; x++) + { + for (k = 0; k < cxFactor; k++) + { + u = t; + for (m = 0; m < pbtIn->iChannels; m++) + { + pi[u++] += pbtIn->pucSample[iSample++]; + } + } + + t += pbtIn->iChannels; + } + } + + t = 0; + for (x = 0; x < cxOut; x++) + { +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiLinearShrink2D: " + "Overflowed output buffer at sample %08x\n", j); + free(pi); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + for (m = 0; m < pbtIn->iChannels; m++) + { + pbtOut->pucSample[j++] = pi[t++] / iNormal; + } + } + } + + free(pi); + +#if 1 + if (i < pbtOut->iSampleLimit) + { + printf("fiLinearShrink2D: " + "Partially filled output buffer to sample %08x\n", i); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = i; + return TRUE; + } + +// ---------------------------------------------------------------------------- + +#if 1 +int fiSincInterpolate2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxInterpolate, int cyInterpolate) + { + BMPTAG btFilter; + int i, j, k, l, m, x, y, t, u; + int iThis, iShift, iNormal; + int cxSize, cySize; + int cxPixelsIn, cyPixelsIn; + int cxPixelsOut, cyPixelsOut; + int cxFraction, cyFraction; + int cxLeft, cyBottom; + int cxCentre, cyCentre; + int cxLeftClipped, cxRightClipped; + int cxLeftFraction, cxRightFraction; + int cyBottomClipped, cyTopClipped; + int cyBottomFraction, cyTopFraction; + int cxLeftSample, cxRightSample; + int cxCoefficient, cyCoefficient; + int cxCoefficientSave, cyCoefficientSave; + int cxCoefficientStep, cyCoefficientStep; + int fiCoefficientStep; + + cxSize = cxInterpolate * FILTER_OVERLAP; + cySize = cyInterpolate * FILTER_OVERLAP; + + cxPixelsIn = pbtIn->pbih->biWidth; + cyPixelsIn = pbtIn->pbih->biHeight; + + cxPixelsOut = cxPixelsIn * cxInterpolate; + cyPixelsOut = cyPixelsIn * cyInterpolate; + + if (fiBmpAllocate(pbtOut, pbtIn->pbih, + cxPixelsOut, cyPixelsOut) == FALSE) + { + printf("fiSincInterpolate2D: " + "Failed to allocate output buffer of %08x samples\n", + cxPixelsOut * cyPixelsOut * pbtIn->iChannels); + return FALSE; + } + + if (fiMakeSincFilter2D(&btFilter, pbtIn, cxSize, cySize, + FILTER_CUTOFF, FILTER_CUTOFF) == FALSE) + { + BmpFree(pbtOut); + return FALSE; + } + + fiBmpWriteOut(&btFilter, "filtint.bmp"); + printf("Created filtint.bmp, 0x%08x samples\n", btFilter.iSampleAppend); + +#if 0 + iShift = 0; + for (x = cxInterpolate; x < cxSize; x <<= 1) + { + iShift++; + } + for (y = cyInterpolate; y < cySize; y <<= 1) + { + iShift++; + } + printf("shift %d\n", iShift); +#endif + + i = 0; + iNormal = 0; + for (y = 0; y < cySize; y++) + { + j = i; + i += btFilter.iSamplesLine; + + for (x = 0; x < cxSize; x++) + { + iNormal += (int) (btFilter.pucSample[j]) - 0x30; + j += btFilter.iChannels; // only 1st channel ! + } + } +#if 0 + printf("normal %d\n", iNormal); + iNormal >>= iShift; +#endif + iNormal = (iNormal << 8) / (cxInterpolate * cyInterpolate); + + if (iNormal == 0) + { + printf("fiSincInterpolate2D: " + "Inadequate precision to normalise filter response\n"); + BmpFree(&btFilter); + BmpFree(pbtOut); + return FALSE; + } + + cxCentre = FILTER_OVERLAP / 2; + cyCentre = FILTER_OVERLAP / 2; + + cxCoefficientStep = cxInterpolate * btFilter.iChannels; + cyCoefficientStep = cyInterpolate * btFilter.iSamplesLine; + + fiCoefficientStep = (btFilter.iChannels >= pbtIn->iChannels); + + cyBottomFraction = cyInterpolate / 2; + cyTopFraction = cyInterpolate; + + i = 0; + for (y = 0; y <= cyPixelsIn; y++) + { + if (y >= cyPixelsIn) + { + cyTopFraction = cyInterpolate / 2; + } + + cyBottom = y - cyCentre; + + cyBottomClipped = max(cyBottom, 0) * pbtIn->iSamplesLine; + cyTopClipped = min(cyBottom + FILTER_OVERLAP, cyPixelsIn) * + pbtIn->iSamplesLine; + + // the (cyInterpolate - 1) term below is completed when we also + // subtract iFraction, making (cyInterpolate - cyFraction - 1). + // same algorithm applies to cxCoefficientSave inside the loop. + + // this reversal is necessary because the window moves in the + // opposite direction, from the viewpoint of the coefficients, + // than our normal viewpoint which is relative to input data. + + cyCoefficientSave = (cyInterpolate - 1) + + max(0, -cyBottom) * cyInterpolate; + + for (cyFraction = cyBottomFraction; cyFraction < cyTopFraction; + cyFraction++) + { + j = i; + i += pbtOut->iSamplesLine; + + // fraction here ensures that we move through the + // available coefficients for smooth interpolation, + // compensation for clipping is done using quantised + // values especially to avoid disturbing this effect + cyCoefficient = (cyCoefficientSave - cyFraction) * + btFilter.iSamplesLine; + + cxLeftFraction = cxInterpolate / 2; + cxRightFraction = cxInterpolate; + + for (x = 0; x <= cxPixelsIn; x++) + { + if (x >= cxPixelsIn) + { + cxRightFraction = cxInterpolate / 2; + } + + cxLeft = x - cxCentre; + + cxLeftClipped = max(cxLeft, 0) * pbtIn->iChannels; + cxRightClipped = min(cxLeft + FILTER_OVERLAP, cxPixelsIn) * + pbtIn->iChannels; + + cxCoefficientSave = (cxInterpolate - 1) + + max(0, -cxLeft) * cxInterpolate; + + for (cxFraction = cxLeftFraction; + cxFraction < cxRightFraction; cxFraction++) + { +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiSincInterpolate2D: " + "Overflowed output buffer at sample %08x\n", j); + BmpFree(&btFilter); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + cxLeftSample = cxLeftClipped; + cxRightSample = cxRightClipped; + + // fraction here ensures that we move through the + // available coefficients for smooth interpolation, + // compensation for clipping is done using quantised + // values especially to avoid disturbing this effect + cxCoefficient = (cxCoefficientSave - cxFraction) * + btFilter.iChannels; + + for (m = 0; m < pbtIn->iChannels; m++) + { + iThis = 0; + + t = cyCoefficient + cxCoefficient; + + for (k = cyBottomClipped; k < cyTopClipped; + k += pbtIn->iSamplesLine) + { + u = t; + t += cyCoefficientStep; + + for (l = cxLeftSample; l < cxRightSample; + l += pbtIn->iChannels) + { + iThis += (pbtIn->pucSample[k + l] * + ((int) + (btFilter.pucSample[u]) - + 0x30)); //>> iShift; + u += cxCoefficientStep; + } + } + + cxLeftSample++; + cxRightSample++; + cxCoefficient += fiCoefficientStep; + + iThis = (iThis << 8) / iNormal; + if (iThis > 0xff) + { + iThis = 0xff; + } + if (iThis < 0) + { + iThis = 0; + } + pbtOut->pucSample[j++] = iThis; + } + } + + cxLeftFraction = 0; + } + } + + cyBottomFraction = 0; + } + + BmpFree(&btFilter); + +#if 0 //1 + if (j < pbtOut->iSampleLimit) + { + printf("fiSincInterpolate2D: " + "Partially filled output buffer to sample %08x\n", j); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = j; + return TRUE; + } +#endif + +// ---------------------------------------------------------------------------- + +#if 0 +int fiSincDecimate2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxDecimate, int cyDecimate) + { + BMPTAG btFilter; + int i, j, k, l, m, x, y, t, u; + int cxSize, cySize, iThis; + int iShift, iNormal; + int fiCoefficientStep; + int cxPixelsIn, cyPixelsIn; + int cxPixelsOut, cyPixelsOut; + int iCoefficient, iCentre, iLeft; + int iLeftClipped, iRightClipped; + + cxSize = cxDecimate * FILTER_OVERLAP; + cySize = cyDecimate * FILTER_OVERLAP; + + cxPixelsIn = pbtIn->pbih->biWidth; + cyPixelsIn = pbtIn->pbih->biHeight; + + cxPixelsOut = cxPixelsIn / cxDecimate; + cyPixelsOut = cyPixelsIn / cyDecimate; + + if (fiBmpAllocate(pbtOut, pbtIn->pbih, + cxPixelsOut, cyPixelsOut) == FALSE) + { + printf("fiSincDecimate2D: " + "Failed to allocate output buffer of %08x samples\n", + cxPixelsOut * cyPixelsOut * pbtIn->iChannels); + return FALSE; + } + + if (fiMakeSincFilter2D(&btFilter, pbtIn, cxSize, cySize, + FILTER_CUTOFF, FILTER_CUTOFF) == FALSE) + { + BmpFree(pbtOut); + return FALSE; + } + + fiBmpWriteOut(&btFilter, "filtdec.bmp"); + printf("Created filtdec.bmp, 0x%08x samples\n", btFilter.iSampleAppend); + + iShift = 0; + for (i = 1; i < iSize; i <<= 1) + { + iShift++; + } + + iNormal = 0; + for (i = 0; i < iSize; i++) + { + iNormal += btFilter.pucSample[i * btFilter.iChannels]; + } + iNormal >>= iShift; + + iCentre = iSize / 2; + fiCoefficientStep = (btFilter.iChannels >= pbtIn->iChannels); + + j = 0; + for (i = 0; i < iPixelsIn; i += iDecimate) + { +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiSincDecimate2D: " + "Overflowed output buffer at sample %08x\n", j); + BmpFree(&btFilter); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + iLeft = i - iCentre; + + iLeftClipped = max(iLeft, 0) * pbtIn->iChannels; + iRightClipped = min(iLeft + iSize, pbtIn->iSampleAppend) * + pbtIn->iChannels; + + iCoefficient = max(0, -iLeft) * btFilter.iChannels; + + for (m = 0; m < pbtIn->iChannels; m++) + { + iThis = 0; + + l = iCoefficient; + iCoefficient += fiCoefficientStep; + + for (k = iLeftClipped++; k < iRightClipped; + k += pbtIn->iChannels) + { + iThis += (pbtIn->pucSample[k] * btFilter.pucSample[l]) >> + iShift; + l += btFilter.iChannels; + } + + iRightClipped++; + + iThis /= iNormal; + if (iThis > 0xff) + { + iThis = 0xff; + } + if (iThis < 0) + { + iThis = 0; + } + + pbtOut->pucSample[j++] = iThis; + } + } + + BmpFree(&btFilter); + +#if 1 + if (j < pbtOut->iSampleLimit) + { + printf("fiSincDecimate2D: " + "Partially filled output buffer to sample %08x\n", j); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = j; + return TRUE; + } +#endif + +// ---------------------------------------------------------------------------- + +#if 0 +int fiSincResample2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxInterpolate, int cyInterpolate, + int cxDecimate, int cyDecimate) + { + BMPTAG btFilter; + int i, j, k, l, m, x, y, t, u; + int cxSize, cySize; + int cxSizeQuantised, cySizeQuantised; + int iShift, iNormal, iThis; + int iCoefficientStep, fiCoefficientStep; + int cxPixelsIn, cyPixelsIn; + int cxPixelsQuantised, cyPixelsQuantised; + int iCoefficient; + int iIntermediate, iInteger, iFraction; + int iLeftQuantised, iCentreQuantised; + int iLeftClipped, iRightClipped; + + // I think it is best to quantise the input data window size once, + // at the beginning, so all convolutions are done with the same width, + // avoiding normalisation issues. Therefore one coefficient will + // always skipped, on either side of the coefficient bank depending + // on the interpolation status, but it will be of low amplitude. + // + // window_size_quantised = window_size / output_rate + // = max(t, t * input_rate / output_rate) + + cxSizeQuantised = max(FILTER_OVERLAP, + (FILTER_OVERLAP * cxDecimate) / cxInterpolate); + cySizeQuantised = max(FILTER_OVERLAP, + (FILTER_OVERLAP * cyDecimate) / cyInterpolate); + + // So how many possible interpolation states are there? The + // interpolation has to be reset each time the base coefficient + // pointer overflows to a value => the input data rate unit + // (output_rate intermediate units). Thus, the base coefficient + // pointer is the state counter for the interpolation and it + // can have values 0 thru output_rate-1. + // + // Having calculated window_size_quantised we can then multiply + // by the number of possible interpolation states, thus: + // + // window_size_coefficient = window_size_quantised * output_rate + // = max(t * output_rate, t * input_rate) + // + // Note: The second derivation undoes the beneficial effect of + // the quantisation, meaning the window is now slightly larger + // than necessary, but this is necessary, because otherwise our + // use of s * t to set the cutoff would introduce a freq. error. + + cxSize = FILTER_OVERLAP * max(cxInterpolate, cxDecimate); + cySize = FILTER_OVERLAP * max(cyInterpolate, cyDecimate); + + cxPixelsIn = pbtIn->pbih->biWidth; + cyPixelsIn = pbtIn->pbih->biHeight; + + cxPixelsQuantised = (cxPixelsIn * cxInterpolate) / cxDecimate; + cyPixelsQuantised = (cyPixelsIn * cyInterpolate) / cyDecimate; + + if (fiBmpAllocate(pbtOut, pbtIn->pbih, + cxPixelsQuantised, cyPixelsQuantised) == FALSE) + { + printf("fiSincResample2D: " + "Failed to allocate output buffer of %08x samples\n", + cxPixelsQuantised * cyPixelsQuantised * pbtIn->iChannels); + return FALSE; + } + + if (fiMakeSincFilter2D(&btFilter, pbtIn, cxSize, cySize, + FILTER_CUTOFF, FILTER_CUTOFF) == FALSE) + { + BmpFree(pbtOut); + return FALSE; + } + + if (iInterpolate > iDecimate) + { + fiBmpWriteOut(&btFilter, "filtint.bmp"); + printf("Created filtint.bmp, 0x%08x samples\n", btFilter.iSampleAppend); + } + else + + { + fiBmpWriteOut(&btFilter, "filtdec.bmp"); + printf("Created filtdec.bmp, 0x%08x samples\n", btFilter.iSampleAppend); + } + + iShift = 0; + for (i = 1; i < iSizeQuantised; i <<= 1) + { + iShift++; + } + + iNormal = 0; + for (i = 0; i < iSizeQuantised; i++) + { + iNormal += btFilter.pucSample[i * iInterpolate * btFilter.iChannels]; + } + iNormal >>= iShift; + + // centre should also be compensated for the rounding down of + // (iPixelsIn * iInterpolate) / iDecimate, so must convert back + iCentreQuantised = iSizeQuantised / 2; + + iCoefficientStep = iInterpolate * btFilter.iChannels; + fiCoefficientStep = (btFilter.iChannels >= pbtIn->iChannels); + + j = 0; + iIntermediate = 0; + for (i = 0; i < iPixelsQuantised; i++) + { +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiSincResample2D: " + "Overflowed output buffer at sample %08x\n", j); + BmpFree(&btFilter); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + // integer and fraction variables are used for clarity, + // and could be optimised with modulo arithmetic, but + // there is little point optimising this part of the + // loop since we are doing vector multiplication later + iInteger = iIntermediate / iInterpolate; + iFraction = iIntermediate % iInterpolate; + iIntermediate += iDecimate; + + // left side of window is recalculated each time through, + // to avoid issues with the rounding of negative numbers + iLeftQuantised = iInteger - iCentreQuantised; + + // input data window size is constant, so the quantised + // value calculated in the beginning is used for clipping + iLeftClipped = max(iLeftQuantised, 0) * pbtIn->iChannels; + iRightClipped = min(iLeftQuantised + iSizeQuantised, iPixelsIn) * + pbtIn->iChannels; + + // fraction here ensures that we move through the + // available coefficients for smooth interpolation, the + // compensation for clipping is done using quantised + // values especially to avoid disturbing this effect + iCoefficient = ((iInterpolate - iFraction - 1) + + max(0, -iLeftQuantised) * iInterpolate) * + btFilter.iChannels; + + for (m = 0; m < pbtIn->iChannels; m++) + { + iThis = 0; + + l = iCoefficient; + iCoefficient += fiCoefficientStep; + + for (k = iLeftClipped++; k < iRightClipped; + k += pbtIn->iChannels) + { + iThis += (pbtIn->pucSample[k] * btFilter.pucSample[l]) >> + iShift; + l += iCoefficientStep; + } + + iRightClipped++; + + iThis /= iNormal; + if (iThis > 0xff) + { + iThis = 0xff; + } + if (iThis < 0) + { + iThis = 0; + } + + pbtOut->pucSample[j++] = iThis; + } + } + + BmpFree(&btFilter); + +#if 1 + if (j < pbtOut->iSampleLimit) + { + printf("fiSincResample2D: " + "Partially filled output buffer to sample %08x\n", j); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = j; + return TRUE; + } +#endif + +// ---------------------------------------------------------------------------- + +int fiMakeSincFilter2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxSize, int cySize, int cxCutoff, int cyCutoff) + { + BITMAPINFOHEADER bih; + int i, j, m, x, y, iThis; + float fxScale, fyScale; + float fxCentre, fyCentre; + float fxWindow, fyWindow; + float fxThis, fyThis; + + // the sinc filter will have the same file format as the input data, + // except that channels is set to 1 because the same filter will be + // used on all colour channels, and bits per sample is set to 8 + // to reduce the number of combinations to be handled when filtering. + // + // note: the sinc filter will adopt the same sample rate as the input, + // which is not exactly correct if overall interpolation will be used. + + memcpy(&bih, pbtIn->pbih, sizeof(BITMAPINFOHEADER)); + + bih.biBitCount = 8; + + if (fiBmpAllocate(pbtOut, &bih, cxSize, cySize) == FALSE) + { + printf("fiMakeSincFilter2D: " + "Failed to allocate output buffer of %08x samples\n", + cxSize, cySize); + return FALSE; + } + + fxCentre = (cxSize - 1) / 2.0; + fyCentre = (cySize - 1) / 2.0; + + fxScale = (6.283185307 * cxCutoff) / cxSize; + fyScale = (6.283185307 * cyCutoff) / cySize; + + i = 0; + for (y = 0; y < cySize; y++) + { + j = i; + i += pbtOut->iSamplesLine; + + fyWindow = 1 - min(y + 1, cySize - y) / fyCentre; + fyWindow = 1 - fyWindow * fyWindow; + + fyThis = fyScale * (y - fyCentre); + if (fyThis) + { + fyThis = sin(fyThis) / fyThis; + } + else + { + fyThis = 1; + } + + for (x = 0; x < cxSize; x++) + { + fxWindow = 1 - min(x + 1, cxSize - x) / fxCentre; + fxWindow = 1 - fxWindow * fxWindow; + + fxThis = fxScale * (x - fxCentre); + if (fxThis) + { + fxThis = sin(fxThis) / fxThis; + } + else + { + fxThis = 1; + } + + // the filter gain is fixed here, but will later be adjusted by + // normalisation (only the caller knows the interpolation in use) + iThis = fxThis * fyThis * fxWindow * fyWindow * 0xcf + 0x30; + +#if 1 + if (j >= pbtOut->iSampleLimit) + { + printf("fiMakeSincFilter2D: " + "Overflowed output buffer at sample %08x\n", j); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + //for (m = 0; m < pbtOut->iChannels; m++) // always 1 for now + { + pbtOut->pucSample[j++] = iThis; + } + } + } + +#if 1 + if (j < pbtOut->iSampleLimit) + { + printf("fiMakeSincFilter2D: " + "Partially filled output buffer to sample %08x\n", j); + BmpFree(pbtOut); + return FALSE; // should never happen + } +#endif + + pbtOut->iSampleAppend = j; + return TRUE; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hyimage.h b/src/mkfont/hyimage.h new file mode 100644 index 00000000..645f57cc --- /dev/null +++ b/src/mkfont/hyimage.h @@ -0,0 +1,104 @@ +// hyimage.h + +// ---------------------------------------------------------------------------- + +#define FILTER_CUTOFF 2 // cutoff/overlap should be 1/2 for nyquist frequency +#define FILTER_OVERLAP 4 // history size, in slow-samples, for interp/decimate + +// ---------------------------------------------------------------------------- + +/* +typedef struct tagBITMAPFILEHEADER { + WORD bfType; + DWORD bfSize; + WORD bfReserved1; + WORD bfReserved2; + DWORD bfOffBits; +} BITMAPFILEHEADER, FAR *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER; + +typedef struct tagBITMAPINFOHEADER{ + DWORD biSize; + LONG biWidth; + LONG biHeight; + WORD biPlanes; + WORD biBitCount; + DWORD biCompression; + DWORD biSizeImage; + LONG biXPelsPerMeter; + LONG biYPelsPerMeter; + DWORD biClrUsed; + DWORD biClrImportant; +} BITMAPINFOHEADER, FAR *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER; + +typedef struct tagRGBQUAD { + BYTE rgbBlue; + BYTE rgbGreen; + BYTE rgbRed; + BYTE rgbReserved; +} RGBQUAD; +typedef RGBQUAD FAR* LPRGBQUAD; + +typedef struct tagRECT +{ + LONG left; + LONG top; + LONG right; + LONG bottom; +} RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT; +*/ + +typedef struct + { + FILETAG ft; // ft.pcBase points to WAV_FILE_HEADER followed by data + + BITMAPFILEHEADER *pbfh; // easier than (BITMAPINFOHEADER *) ft.pcBase + BITMAPINFOHEADER *pbih; // easier than (BITMAPINFOHEADER *) (ft.pcBase+x) + RGBQUAD *prgbq; // easier than (RGBQUAD *) (ft.pcBase+y), base of palette + unsigned char *pucSample; // points after BITMAPINFOHEADER and palette + + int iChannels; // max(biBitCount / 8, 1), because usoft is so very lame + int iBitsChannel; // always biBitcount / iChannels, because usoft is lame + int iSamplesLine; // generally in bytes, this offset includes wasted part + + int iSampleBase; // usually 0 unless client wants to do advanced looping + int iSampleLimit; // iSampleAppend or larger if block is of arbitrary size + int iSamplePosition; // for general use, initialised to 0 for client + int iSampleAppend; // calculated for client, pbih->biHeight * iSamplesLine + + int iBackground; // dc bias per channel, to be removed for calculations + int cxHot, cyHot; // reference point on image for client use, or centre + + //RECT rPixelWindow; // set up from the exact pixel image size via pbih + //RECT rPixelSurface; // same as rPixelWindow, except rRight includes waste + } BMPTAG; + +// ---------------------------------------------------------------------------- + +int fiBmpAllocate(BMPTAG *pbt, BITMAPINFOHEADER *pbihIn, + int cxPixels, int cyPixels); +int fiBmpReadIn(BMPTAG *pbt, char *pszFileName); +int fiBmpWriteOut(BMPTAG *pbt, char *pszFileName); +void BmpFree(BMPTAG *pbt); +int fiBmpCopy(BMPTAG *pbt, BMPTAG *pbtIn); + +int fiLinearExpand2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxFactor, int cyFactor); + +int fiLinearShrink2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxFactor, int cyFactor); + +int fiSincInterpolate2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxInterpolate, int cyInterpolate); + +int fiSincDecimate2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxDecimate, int cyDecimate); + +int fiSincResample2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxInterpolate, int cyInterpolate, + int cxDecimate, int cyDecimate); + +int fiMakeSincFilter2D(BMPTAG *pbtOut, BMPTAG *pbtIn, + int cxSize, int cySize, int cxCutoff, int cyCutoff); + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hymb.cpp b/src/mkfont/hymb.cpp new file mode 100644 index 00000000..bd465734 --- /dev/null +++ b/src/mkfont/hymb.cpp @@ -0,0 +1,117 @@ +// hymb.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#pragma hdrstop +#include "hymb.h" + +// ---------------------------------------------------------------------------- + +void MBEntrySetup(void) + { + // for future expansion + } + +void MBExitCleanup(void) + { + // for future expansion + } + +// ---------------------------------------------------------------------------- + +int fiMBAlloc(MBHANDLE *pmbh, int iBytes) + { + // zero the entire memory block handle area, avoiding leaks + memset(pmbh, 0, sizeof(MBHANDLE)); + + pmbh->pcBase = (char *) malloc(iBytes); + if (pmbh->pcBase == NULL) + { + return FALSE; // indicates failure to allocate block + } + + pmbh->pcLimit = pmbh->pcBase + iBytes; + + return TRUE; // indicates success and handle set up + } + +int fiMBRealloc(MBHANDLE *pmbh, int iBytes) + { + char *pc; + + pc = (char *) realloc(pmbh->pcBase, iBytes); + if (pc == NULL) + { + return FALSE; // indicates failure to reallocate block + } + + pmbh->pcBase = pc; + pmbh->pcLimit = pmbh->pcBase + iBytes; + + return TRUE; // indicates success and handle updated + } + +int fiMBFree(MBHANDLE *pmbh) + { + if (pmbh->pcBase == NULL) + { + return FALSE; // indicates no such block allocated + } + + free(pmbh->pcBase); // this can't fail, apparently + + // zero the entire memory block handle area, avoiding leaks + memset(pmbh, 0, sizeof(MBHANDLE)); + + return TRUE; // indicates success, and handle zeroed + } + +// ---------------------------------------------------------------------------- + +#ifdef _INC_JLHANDLE +int hiMBNew(int iBytes) + { + int hi; + MBHANDLE *pmbh; + + // take a new handle, before bothering with memory + hi = hiJLHandleNew(patMBH); + pmbh = (MBHANDLE *) pcArrayElement(patMBH, 1, hi); + + // use inline wrapper to allocate the required bytes + MBAlloc(pmbh, iBytes); // this will bomb on failure + + return hi; // caller's reference is the opaque handle + } + +void MBResize(int hi, int iBytes) + { + MBHANDLE *pmbh; + + // find supplied handle, before bothering with memory + pmbh = (MBHANDLE *) pcArrayElement(patMBH, 1, hi); + + // use inline wrapper to reallocate the required bytes + MBRealloc(pmbh, iBytes); // this will bomb on failure + } + +void MBDelete(int hi) + { + // find supplied handle, before bothering with memory + pmbh = (MBHANDLE *) pcArrayElement(patMBH, 1, hi); + + // use inline wrapper to free up the allocated memory + MBFree(pmbh); // this will bomb on failure (null pcBase) + } + +int hiMBDelete(int hi) + { + MBDelete(hi); + return 0; // handy way for caller to zero out its copy of handle + } +#endif + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/hymb.h b/src/mkfont/hymb.h new file mode 100644 index 00000000..86e60e62 --- /dev/null +++ b/src/mkfont/hymb.h @@ -0,0 +1,95 @@ +// hymb.h + +#ifndef _INC_HYMB +#define _INC_HYMB + +// ---------------------------------------------------------------------------- + +typedef struct + { + char *pcBase; // also the 'handle' for malloc & free + char *pcLimit; // similar to Microsoft's _msize func. + } MBHANDLE; + +// ---------------------------------------------------------------------------- + +#ifdef _INC_JLHANDLE +// the optional registration of allocated memory blocks is based on a handle +// system identical to JLHANDLE.CPP, see comments for atJLHandle, patJLH etc + +extern ARRAYTAG atMBHandle; + +extern int hiMBHandleFree; // to head of most recently used free handles list +extern ARRAYTAG *patMBH; // patMBH is slightly more readable than &atMBHandle +#endif + +// ---------------------------------------------------------------------------- + +void MBEntrySetup(void); +void MBExitCleanup(void); + +int fiMBAlloc(MBHANDLE *pmbh, int iBytes); +int fiMBRealloc(MBHANDLE *pmbh, int iBytes); +int fiMBFree(MBHANDLE *pmbh); + +// ---------------------------------------------------------------------------- + +inline int iMBSize(MBHANDLE *pmbh) + { + return pmbh->pcLimit - pmbh->pcBase; + } + +// ---------------------------------------------------------------------------- +// handy functions for the client, not important to the interface: + +#ifdef _INC_STDIO +inline void MBAlloc(MBHANDLE *pmbh, int iBytes) + { + if (fiMBAlloc(pmbh, iBytes) == FALSE) + { + printf("MBAlloc: " + "Could not allocate %08x bytes, exiting\n", iBytes); + exit(1); + } + +#ifdef DEBUG + printf("MBAlloc: " + "Allocated memory block %08x size %08x\n", pmbh, iBytes); +#endif + } + +inline void MBRealloc(MBHANDLE *pmbh, int iBytes) + { + if (fiMBRealloc(pmbh, iBytes) == FALSE) + { + printf("MBRealloc: " + "Could not reallocate %08x bytes, exiting\n", iBytes); + exit(1); + } + +#ifdef DEBUG + printf("MBRealloc: " + "Reallocated memory block %08x size %08x\n", pmbh, iBytes); +#endif + } + +inline void MBFree(MBHANDLE *pmbh) + { + if (fiMBFree(pmbh) == FALSE) + { + printf("MBFree: " + "Could not free memory block %08x, exiting\n", pmbh); + exit(1); + } + +#ifdef DEBUG + printf("MBFree: " + "Freed memory block %08x\n", pmbh); +#endif + } +#endif + +// ---------------------------------------------------------------------------- + +#endif + diff --git a/src/mkfont/n.bat b/src/mkfont/n.bat new file mode 100644 index 00000000..c01cf7b4 --- /dev/null +++ b/src/mkfont/n.bat @@ -0,0 +1,18 @@ +cl -Zi -I. bmp2txt.cpp hyimage.cpp hyfile.cpp hyfs.cpp hymb.cpp +@if errorlevel 1 goto failure +copy bmp2txt.exe ..\bin + +cl -Zi -I. txt2chs.cpp hyfile.cpp hyfs.cpp hymb.cpp +@if errorlevel 1 goto failure +copy txt2chs.exe ..\bin + +cl -Zi -I. chs2cmd.cpp hyfile.cpp hyfs.cpp hymb.cpp +@if errorlevel 1 goto failure +copy chs2cmd.exe ..\bin + +@echo SUCCESS +@goto done +:failure +@echo FAILURE +:done + diff --git a/src/mkfont/txt2chs.cpp b/src/mkfont/txt2chs.cpp new file mode 100644 index 00000000..46f6c4ab --- /dev/null +++ b/src/mkfont/txt2chs.cpp @@ -0,0 +1,431 @@ +// txt2chs.cpp + +// ---------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#pragma hdrstop +#include "hymb.h" +#include "hyfs.h" +#include "hyfile.h" + +int main(int argc, char **argv); +int fiProcess(FILETAG *ftOut, FILETAG *ftIn, int iICS, int iILS); +int iCompare(const void *pvLeft, const void *pvRight); +int iUpdateCRC(char *pcBase, int iCount, int iCRC); + +// ---------------------------------------------------------------------------- + +FILETAG ftIn; +char *pszInFileName; + +FILETAG ftOut; +char *pszOutFileName; +char szOutFileName[512]; + +// ---------------------------------------------------------------------------- + +int main(int argc, char **argv) + { + int i, iICS, iILS; + + if (argc > 1) + { + pszInFileName = argv[1]; + } + + iICS = 0; + iILS = 0; + if (argc > 2) + { + iICS = atoi(argv[2]); + if (iICS < 1 || iICS > 0xff) + { + pszOutFileName = argv[2]; + if (argc > 3) + { + iICS = atoi(argv[3]); + if (argc > 4) + { + iILS = atoi(argv[4]); + } + } + } + else + { + if (argc > 3) + { + iILS = atoi(argv[3]); + } + } + } + + if (pszInFileName == NULL) + { + printf("usage: txt2chs infile.txt [outfile.chs] [ICS] [ILS]\n"); + exit(1); + } + + if (pszOutFileName == NULL) + { + pszOutFileName = szOutFileName; + strcpy(pszOutFileName, pszInFileName); + + i = strlen(pszOutFileName); + while (i--) + { + if (pszOutFileName[i] == '\\') + { + break; /* no extension, so don't strip it */ + } + if (pszOutFileName[i] == '.') + { + pszOutFileName[i] = 0; /* strip dot and extension */ + break; /* ready to concatenate our extension */ + } + } + + strcat(pszOutFileName, ".chs"); + } + + if (!strcmp(pszInFileName, pszOutFileName)) + { + printf("Input and output filenames identical\n"); + exit(1); + } + + // read the input bmp file entirely to a malloc'd block + FileReadIn(&ftIn, pszInFileName); + + // prepare an output buffer for character set data + FileAllocate(&ftOut, 0x100000); // 64 kbytes + + // search for characters and write character set files + if (fiProcess(&ftOut, &ftIn, iICS, iILS) == FALSE) + { + exit(1); + } + + // ready to write the output we found + FileWriteOut(&ftOut, pszOutFileName); + + // all done my friend + FileFree(&ftIn); + FileFree(&ftOut); + + return 0; + } + +// ---------------------------------------------------------------------------- + +int fiProcess(FILETAG *pftOut, FILETAG *pftIn, int iICS, int iILS) + { + char *pc; + char sz[0x203]; + int i, j, c, d; + int x, y, cx, cy; + int tx, ty, bx, fx; + int x0, x1, x2, y0, y1, y2; + int mx, my; + MBHANDLE mbh; + unsigned short *pus; + int iValue, iMask; + int iWidth[0x100], iHeight[0x100]; + int iCRC; + + pc = pftOut->pcBase; + + strcpy(pc, "XXXXYYMMDDHHMMSS"); + pc += 0x10; + pus = (unsigned short *)pc; + memset(pc, 0, 0x208); + pc += 0x208; + + // create the microspace characters + *pc++ = 1; // inter character space should be ignored here + pus[1] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = 2; // inter character space should be ignored here + pus[2] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = 3; // inter character space should be ignored here + pus[3] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = 4; // inter character space should be ignored here + pus[4] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = -4; // inter character space should be ignored here + pus[5] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = -3; // inter character space should be ignored here + pus[6] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = -2; // inter character space should be ignored here + pus[7] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = -1; // inter character space should be ignored here + pus[8] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = 12; // inter character space should be ignored here + pus[0x1c] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + *pc++ = -12; // inter character space should be ignored here + pus[0x1d] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + if (iICS < 1 || iICS > 0xff) + { + iICS = 1; + } + + if (iILS < 1 || iILS > 0xff) + { + iILS = 1; + } + + c = '!'; + d = 0; + while (fiFileGetLine(pftIn, sz, sizeof(sz) - 1, NULL)) + { + if (sscanf(sz, "at %d,%d size %d,%d", &x, &y, &cx, &cy) == 4) + { + /*printf("at %d,%d size %d,%d\n", x, y, cx, cy);*/ + + if (c >= 0x100 || d >= 0x100) + { + printf("Too many characters\n"); + break; /* exit(1); */ + } + + MBAlloc(&mbh, cx * cy); + i = 0; + + x0 = cx; + x1 = 0; + x2 = 0; + y0 = cy; + y1 = 0; + y2 = cy; + for (y = 0; y < cy; y++) + { + if (fiFileGetLine(pftIn, sz, sizeof(sz) - 1, + &j) == FALSE) + { + printf("Unexpected end of file\n"); + break; /* exit(1); */ + } + + if (j < (cx * 2)) + { + printf("Line too short in file\n"); + break; /* exit(1); */ + } + + for (x = 0; x < cx; x++) + { + if (sz[x * 2] == '#') + { + mbh.pcBase[i++] = 1; + x0 = min(x0, x); + x1 = max(x1, x + 1); + y0 = min(y0, y); + y1 = max(y1, y + 1); + } + else + { + mbh.pcBase[i++] = 0; + if (sz[x * 2] == '_') + { + y2 = y + 1; + } + } + } + } + + tx = max(0, x1 - x0); // trimmed width in pixels + ty = max(0, y1 - y0); // trimmed height in pixels + printf("at %d,%d trim %d,%d origin %d,%d\n", + x0, y0, tx, ty, x2, y2); + + iWidth[d] = tx; // save for median calculation + iHeight[d] = ty; // save for median calculation + + bx = (tx + 7) >> 3; // width in bytes + + if (x2) + { + *pc++ = x0 - x2; + *pc++ = y0 - y2; + *pc++ = tx + iICS; + pus[c] = pc - (char *)pus; + *pc++ = bx | 0xe0; + } + else if (y2) + { + *pc++ = y0 - y2; + *pc++ = tx + iICS; + pus[c] = pc - (char *)pus; + *pc++ = bx | 0x60; + } + else + { + *pc++ = tx + iICS; + pus[c] = pc - (char *)pus; + *pc++ = bx | 0x20; + } + + if (bx) + { + *pc++ = ty; + + i = y0 * cx; + for (y = y0; y < y1; y++) + { + j = i + x0; + i += cx; + + iValue = 0; + iMask = 0x80; + for (x = x0; x < x1; x++) + { + if (iMask == 0) + { + *pc++ = iValue; + + iValue = 0; + iMask = 0x80; + } + + if (mbh.pcBase[j++]) + { + iValue |= iMask; + } + + iMask >>= 1; + } + + *pc++ = iValue; + } + } + + MBFree(&mbh); + + c++; // character code for index updating + d++; // character code for median calculation + } + } + + printf("%d characters in range %d,%d inclusive\n", d, 0x21, c - 1); + + // post process widths/heights now we've had all characters + mx = 0; + my = 0; + if (d) + { + qsort(iWidth, d, sizeof(int), iCompare); + mx = iWidth[d / 2]; // find median width + + qsort(iHeight, d, sizeof(int), iCompare); + my = iHeight[d / 2]; // find median height + } + + printf("median %d,%d cell %d,%d space %d,%d\n", + mx, my, mx + iICS, my + iILS, iICS, iILS); + + // create the space character (now that we have width) + *pc++ = mx; // should be mx + iICS but we cheat a little + pus[' '] = pc - (char *)pus; + *pc++ = 0x60; // indicates we have width but nothing else + + // set file length, as all data has now been appended + pftOut->pcAppend = pc; + + // fill out the table with minus signs for undefined chars + for (c = 0; c < 0x100; c++) + { + if (pus[c] == 0) + { + pus[c] = pus['-']; + if (pus[c] == 0) + { + pus[c] = pus[' ']; // or space if no minus + } + } + } + + // fill in header fields that weren't known until now + pc = (char *)(pus + 0x100); + *pc++ = mx + iICS; + *pc++ = my + iILS; + *pc++ = iICS; + *pc++ = iILS; + *pc++ = 'O'; // character to use for uncrossed zero + *pc++ = 0; // spare + *(int *)pc = pftOut->pcAppend - pftOut->pcBase; + + // calculate and insert CRC using character set algorithm + pc = pftOut->pcBase + 4; + iCRC = iUpdateCRC(pc, pftOut->pcAppend - pc, 0xffff); + + pc = pftOut->pcBase; + for (i = 0; i < 4; i++) + { + *pc++ = "0123456789ABCDEF"[(iCRC >> 12) & 0xf]; + iCRC <<= 4; + } + + return TRUE; + } + +int iCompare(const void *pvLeft, const void *pvRight) + { + if (*(int *)pvLeft < *(int *)pvRight) + { + return -1; + } + + if (*(int *)pvLeft > *(int *)pvRight) + { + return 1; + } + + return 0; + } + +int iUpdateCRC(char *pcBase, int iCount, int iCRC) + { + int i, j; + + for (i = 0; i < iCount; i++) + { + iCRC ^= (pcBase[i] << 8); + for (j = 0; j < 8; j++) + { + if (iCRC & 0x8000) + { + iCRC = (iCRC << 1) ^ 0x1021; + } + else + { + iCRC <<= 1; + } + } + } + + return iCRC; + } + +// ---------------------------------------------------------------------------- + diff --git a/src/mkfont/txt2chs.exe b/src/mkfont/txt2chs.exe new file mode 100644 index 00000000..e5eb754e Binary files /dev/null and b/src/mkfont/txt2chs.exe differ diff --git a/src/mkutil/cr.exe b/src/mkutil/CR.EXE similarity index 51% rename from src/mkutil/cr.exe rename to src/mkutil/CR.EXE index 062bc409..dccde719 100644 Binary files a/src/mkutil/cr.exe and b/src/mkutil/CR.EXE differ diff --git a/src/mkutil/as-z80/as-z80.exe b/src/mkutil/as-z80/as-z80.exe new file mode 100644 index 00000000..912b5f73 Binary files /dev/null and b/src/mkutil/as-z80/as-z80.exe differ diff --git a/src/as-z80/as-z80.lnk b/src/mkutil/as-z80/as-z80.lnk similarity index 100% rename from src/as-z80/as-z80.lnk rename to src/mkutil/as-z80/as-z80.lnk diff --git a/src/mkutil/as-z80/as-z80.map b/src/mkutil/as-z80/as-z80.map new file mode 100644 index 00000000..5691b88b --- /dev/null +++ b/src/mkutil/as-z80/as-z80.map @@ -0,0 +1,567 @@ + as-z80 + + Timestamp is 3ebb8bd3 (Fri May 09 21:06:59 2003) + + Preferred load address is 00400000 + + Start Length Name Class + 0001:00000000 00012e00H .text CODE + 0002:00000000 0000060bH .rdata DATA + 0002:0000060b 00000000H .edata DATA + 0003:00000000 00000104H .CRT$XCA DATA + 0003:00000104 00000104H .CRT$XCZ DATA + 0003:00000208 00000104H .CRT$XIA DATA + 0003:0000030c 00000109H .CRT$XIC DATA + 0003:00000418 00000104H .CRT$XIZ DATA + 0003:0000051c 00000104H .CRT$XPA DATA + 0003:00000620 00000104H .CRT$XPX DATA + 0003:00000724 00000104H .CRT$XPZ DATA + 0003:00000828 00000104H .CRT$XTA DATA + 0003:0000092c 00000104H .CRT$XTZ DATA + 0003:00000a30 000053d2H .data DATA + 0003:00005e04 000035a0H .bss DATA + 0004:00000000 00000014H .idata$2 DATA + 0004:00000014 00000014H .idata$3 DATA + 0004:00000028 0000010cH .idata$4 DATA + 0004:00000134 0000010cH .idata$5 DATA + 0004:00000240 00000488H .idata$6 DATA + + Address Publics by Value Rva+Base Lib:Object + + 0001:000003d0 _expr 004013d0 f asexpr.obj + 0001:0000085b _getop 0040185b f asexpr.obj + 0001:00000892 _getnop 00401892 f asexpr.obj + 0001:000008e6 _getop_binary 004018e6 f asexpr.obj + 0001:00000965 _getop_unary 00401965 f asexpr.obj + 0001:000009ff _getop_srch 004019ff f asexpr.obj + 0001:00000aa3 _absexpr 00401aa3 f asexpr.obj + 0001:00000ad6 _term 00401ad6 f asexpr.obj + 0001:000015cc _digit 004025cc f asexpr.obj + 0001:00001681 _abscheck 00402681 f asexpr.obj + 0001:000016b0 _is_abs 004026b0 f asexpr.obj + 0001:000016d2 _oprio 004026d2 f asexpr.obj + 0001:0000173f _clrexpr 0040273f f asexpr.obj + 0001:0000176c _exprmasks 0040276c f asexpr.obj + 0001:00001d10 _getid 00402d10 f aslex.obj + 0001:00001dcd _getst 00402dcd f aslex.obj + 0001:00001e55 _getnb 00402e55 f aslex.obj + 0001:00001e76 _get 00402e76 f aslex.obj + 0001:00001ea4 _unget 00402ea4 f aslex.obj + 0001:00001ec8 _getmap 00402ec8 f aslex.obj + 0001:00002015 _getline 00403015 f aslex.obj + 0001:000021f4 _more 004031f4 f aslex.obj + 0001:00002231 _endline 00403231 f aslex.obj + 0001:000023c0 _list 004033c0 f aslist.obj + 0001:00002cbf _list1 00403cbf f aslist.obj + 0001:00002ee9 _list2 00403ee9 f aslist.obj + 0001:00003006 _slew 00404006 f aslist.obj + 0001:000030e6 _lstsym 004040e6 f aslist.obj + 0001:00003fc0 _main 00404fc0 f asmain.obj + 0001:00004598 _asexit 00405598 f asmain.obj + 0001:00004664 _asmbl 00405664 f asmain.obj + 0001:000058c4 _afile 004068c4 f asmain.obj + 0001:0000596a _afilex 0040696a f asmain.obj + 0001:00005ad1 _fndidx 00406ad1 f asmain.obj + 0001:00005b47 _newdot 00406b47 f asmain.obj + 0001:00005b93 _phase 00406b93 f asmain.obj + 0001:00005bb8 _usage 00406bb8 f asmain.obj + 0001:00006340 _outab 00407340 f asout.obj + 0001:00006353 _outaw 00407353 f asout.obj + 0001:00006366 _outa3b 00407366 f asout.obj + 0001:00006379 _outa4b 00407379 f asout.obj + 0001:0000638c _outaxb 0040738c f asout.obj + 0001:000063e2 _outatxb 004073e2 f asout.obj + 0001:00006541 _outrb 00407541 f asout.obj + 0001:00006558 _outrw 00407558 f asout.obj + 0001:0000656f _outr3b 0040756f f asout.obj + 0001:00006586 _outr4b 00407586 f asout.obj + 0001:0000659d _outrxb 0040759d f asout.obj + 0001:000067bb _outdp 004077bb f asout.obj + 0001:000068c3 _outall 004078c3 f asout.obj + 0001:000068e7 _outdot 004078e7 f asout.obj + 0001:0000699c _outchk 0040799c f asout.obj + 0001:00006a3e _outbuf 00407a3e f asout.obj + 0001:00006aed _outgsd 00407aed f asout.obj + 0001:00006dba _outarea 00407dba f asout.obj + 0001:00006e7a _outsym 00407e7a f asout.obj + 0001:00006fb3 _out 00407fb3 f asout.obj + 0001:00007083 _out_lb 00408083 f asout.obj + 0001:000070c6 _out_lw 004080c6 f asout.obj + 0001:000070dd _out_l3b 004080dd f asout.obj + 0001:000070f4 _out_l4b 004080f4 f asout.obj + 0001:0000710b _out_lxb 0040810b f asout.obj + 0001:000072d7 _out_rw 004082d7 f asout.obj + 0001:00007373 _out_txb 00408373 f asout.obj + 0001:000074d2 _lobyte 004084d2 f asout.obj + 0001:000074df _hibyte 004084df f asout.obj + 0001:000074ef _thrdbyte 004084ef f asout.obj + 0001:000074ff _frthbyte 004084ff f asout.obj + 0001:0000750f _outr11 0040850f f asout.obj + 0001:0000767f _outr19 0040867f f asout.obj + 0001:00007d20 _err 00408d20 f assubr.obj + 0001:00007d95 _diag 00408d95 f assubr.obj + 0001:00007eef _rerr 00408eef f assubr.obj + 0001:00007efe _aerr 00408efe f assubr.obj + 0001:00007f0d _qerr 00408f0d f assubr.obj + 0001:00007f1c _geterr 00408f1c f assubr.obj + 0001:00008020 _syminit 00409020 f assym.obj + 0001:00008125 _alookup 00409125 f assym.obj + 0001:00008165 _mlookup 00409165 f assym.obj + 0001:000081bd _slookup 004091bd f assym.obj + 0001:0000821e _lookup 0040921e f assym.obj + 0001:00008311 _symglob 00409311 f assym.obj + 0001:0000836b _allglob 0040936b f assym.obj + 0001:000083cf _symeq 004093cf f assym.obj + 0001:00008474 _hash 00409474 f assym.obj + 0001:000084d5 _strsto 004094d5 f assym.obj + 0001:00008554 _new 00409554 f assym.obj + 0001:000086f0 _addr 004096f0 f z80adr.obj + 0001:000089b9 _admode 004099b9 f z80adr.obj + 0001:00008a28 _srch 00409a28 f z80adr.obj + 0001:00008aed _any 00409aed f z80adr.obj + 0001:00008c30 _machine 00409c30 f z80mch.obj + 0001:00009cc9 _genop 0040acc9 f z80mch.obj + 0001:00009de3 _gixiy 0040ade3 f z80mch.obj + 0001:00009e59 _mchpcr 0040ae59 f z80mch.obj + 0001:00009e9b _comma 0040ae9b f z80mch.obj + 0001:00009eb4 _minit 0040aeb4 f z80mch.obj + 0001:0000a370 _strlen 0040b370 f LIBC:strlen.obj + 0001:0000a3f0 _strcpy 0040b3f0 f LIBC:strcat.obj + 0001:0000a400 _strcat 0040b400 f LIBC:strcat.obj + 0001:0000a4e0 _fclose 0040b4e0 f LIBC:fclose.obj + 0001:0000a536 _fgets 0040b536 f LIBC:fgets.obj + 0001:0000a58d __flsbuf 0040b58d f LIBC:_flsbuf.obj + 0001:0000a6a2 _fprintf 0040b6a2 f LIBC:fprintf.obj + 0001:0000a6e0 _strcmp 0040b6e0 f LIBC:strcmp.obj + 0001:0000a764 _malloc 0040b764 f LIBC:malloc.obj + 0001:0000a776 __nh_malloc 0040b776 f LIBC:malloc.obj + 0001:0000a7a2 __heap_alloc 0040b7a2 f LIBC:malloc.obj + 0001:0000a816 _rewind 0040b816 f LIBC:rewind.obj + 0001:0000a86a ___initstdio 0040b86a f LIBC:_file.obj + 0001:0000a90f ___endstdio 0040b90f f LIBC:_file.obj + 0001:0000a924 __setjmp3 0040b924 f LIBC:setjmp3.obj + 0001:0000a99f __cinit 0040b99f f LIBC:crt0dat.obj + 0001:0000a9cc _exit 0040b9cc f LIBC:crt0dat.obj + 0001:0000a9dd __exit 0040b9dd f LIBC:crt0dat.obj + 0001:0000a9ee __cexit 0040b9ee f LIBC:crt0dat.obj + 0001:0000a9fd __c_exit 0040b9fd f LIBC:crt0dat.obj + 0001:0000aabf __fsopen 0040babf f LIBC:fopen.obj + 0001:0000aadf _fopen 0040badf f LIBC:fopen.obj + 0001:0000ab00 _strncpy 0040bb00 f LIBC:strncpy.obj + 0001:0000ac00 _strrchr 0040bc00 f LIBC:strrchr.obj + 0001:0000ac28 _longjmp 0040bc28 f LIBC:longjmp.obj + 0001:0000aca1 _sprintf 0040bca1 f LIBC:sprintf.obj + 0001:0000acf3 _mainCRTStartup 0040bcf3 f LIBC:crt0.obj + 0001:0000add2 __amsg_exit 0040bdd2 f LIBC:crt0.obj + 0001:0000ae1b _free 0040be1b f LIBC:free.obj + 0001:0000ae84 __close 0040be84 f LIBC:close.obj + 0001:0000af37 __freebuf 0040bf37 f LIBC:_freebuf.obj + 0001:0000af62 _fflush 0040bf62 f LIBC:fflush.obj + 0001:0000af9d __flush 0040bf9d f LIBC:fflush.obj + 0001:0000aff9 __flushall 0040bff9 f LIBC:fflush.obj + 0001:0000b06f __filbuf 0040c06f f LIBC:_filbuf.obj + 0001:0000b148 __lseek 0040c148 f LIBC:lseek.obj + 0001:0000b1e2 __ioinit 0040c1e2 f LIBC:ioinit.obj + 0001:0000b38d __ioterm 0040c38d f LIBC:ioinit.obj + 0001:0000b3b0 __write 0040c3b0 f LIBC:write.obj + 0001:0000b55d __getbuf 0040c55d f LIBC:_getbuf.obj + 0001:0000b5a1 __isatty 0040c5a1 f LIBC:isatty.obj + 0001:0000b5c7 __stbuf 0040c5c7 f LIBC:_sftbuf.obj + 0001:0000b654 __ftbuf 0040c654 f LIBC:_sftbuf.obj + 0001:0000b691 __output 0040c691 f LIBC:output.obj + 0001:0000be9b ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 0040ce9b f LIBC:handler.obj + 0001:0000beab ?_query_new_handler@@YAP6AHI@ZXZ 0040ceab f LIBC:handler.obj + 0001:0000beb1 __callnewh 0040ceb1 f LIBC:handler.obj + 0001:0000becc __GetLinkerVersion 0040cecc f LIBC:heapinit.obj + 0001:0000bef9 ___heap_select 0040cef9 f LIBC:heapinit.obj + 0001:0000c041 __heap_init 0040d041 f LIBC:heapinit.obj + 0001:0000c09e __heap_term 0040d09e f LIBC:heapinit.obj + 0001:0000c146 __get_sbh_threshold 0040d146 f LIBC:sbheap.obj + 0001:0000c165 __set_sbh_threshold 0040d165 f LIBC:sbheap.obj + 0001:0000c218 ___sbh_heap_init 0040d218 f LIBC:sbheap.obj + 0001:0000c260 ___sbh_find_block 0040d260 f LIBC:sbheap.obj + 0001:0000c28b ___sbh_free_block 0040d28b f LIBC:sbheap.obj + 0001:0000c5b4 ___sbh_alloc_block 0040d5b4 f LIBC:sbheap.obj + 0001:0000c8bd ___sbh_alloc_new_region 0040d8bd f LIBC:sbheap.obj + 0001:0000c96e ___sbh_alloc_new_group 0040d96e f LIBC:sbheap.obj + 0001:0000ca69 ___sbh_resize_block 0040da69 f LIBC:sbheap.obj + 0001:0000cd5f ___sbh_heapmin 0040dd5f f LIBC:sbheap.obj + 0001:0000ce30 ___sbh_heap_check 0040de30 f LIBC:sbheap.obj + 0001:0000d15f __get_old_sbh_threshold 0040e15f f LIBC:sbheap.obj + 0001:0000d165 __set_old_sbh_threshold 0040e165 f LIBC:sbheap.obj + 0001:0000d181 ___old_sbh_new_region 0040e181 f LIBC:sbheap.obj + 0001:0000d2c5 ___old_sbh_release_region 0040e2c5 f LIBC:sbheap.obj + 0001:0000d31b ___old_sbh_decommit_pages 0040e31b f LIBC:sbheap.obj + 0001:0000d3dd ___old_sbh_find_block 0040e3dd f LIBC:sbheap.obj + 0001:0000d434 ___old_sbh_free_block 0040e434 f LIBC:sbheap.obj + 0001:0000d479 ___old_sbh_alloc_block 0040e479 f LIBC:sbheap.obj + 0001:0000d681 ___old_sbh_alloc_block_from_page 0040e681 f LIBC:sbheap.obj + 0001:0000d7a5 ___old_sbh_resize_block 0040e7a5 f LIBC:sbheap.obj + 0001:0000d84e ___old_sbh_heap_check 0040e84e f LIBC:sbheap.obj + 0001:0000d9ac _calloc 0040e9ac f LIBC:calloc.obj + 0001:0000da5d __fcloseall 0040ea5d f LIBC:closeall.obj + 0001:0000dab8 __global_unwind2 0040eab8 f LIBC:exsup.obj + 0001:0000dafa __local_unwind2 0040eafa f LIBC:exsup.obj + 0001:0000db52 __NLG_Return2 0040eb52 f LIBC:exsup.obj + 0001:0000db62 __abnormal_termination 0040eb62 f LIBC:exsup.obj + 0001:0000db85 __NLG_Notify1 0040eb85 f LIBC:exsup.obj + 0001:0000db8e __NLG_Notify 0040eb8e f LIBC:exsup.obj + 0001:0000dba1 __NLG_Dispatch 0040eba1 f LIBC:exsup.obj + 0001:0000dba6 __openfile 0040eba6 f LIBC:_open.obj + 0001:0000dd16 __getstream 0040ed16 f LIBC:stream.obj + 0001:0000dd8e __rt_probe_read4@4 0040ed8e f LIBC:sehsupp.obj + 0001:0000ddf3 __XcptFilter 0040edf3 f LIBC:winxfltr.obj + 0001:0000df77 __setenvp 0040ef77 f LIBC:stdenvp.obj + 0001:0000e030 __setargv 0040f030 f LIBC:stdargv.obj + 0001:0000e27d ___crtGetEnvironmentStringsA 0040f27d f LIBC:a_env.obj + 0001:0000e3b8 __except_handler3 0040f3b8 f LIBC:exsup3.obj + 0001:0000e475 __seh_longjmp_unwind@4 0040f475 f LIBC:exsup3.obj + 0001:0000e490 __FF_MSGBANNER 0040f490 f LIBC:crt0msg.obj + 0001:0000e4c9 __NMSG_WRITE 0040f4c9 f LIBC:crt0msg.obj + 0001:0000e61c __GET_RTERRMSG 0040f61c f LIBC:crt0msg.obj + 0001:0000e64d __dosmaperr 0040f64d f LIBC:dosmap.obj + 0001:0000e6b4 __alloc_osfhnd 0040f6b4 f LIBC:osfinfo.obj + 0001:0000e749 __set_osfhnd 0040f749 f LIBC:osfinfo.obj + 0001:0000e7c0 __free_osfhnd 0040f7c0 f LIBC:osfinfo.obj + 0001:0000e83a __get_osfhandle 0040f83a f LIBC:osfinfo.obj + 0001:0000e877 __open_osfhandle 0040f877 f LIBC:osfinfo.obj + 0001:0000e914 __commit 0040f914 f LIBC:commit.obj + 0001:0000e96b __read 0040f96b f LIBC:read.obj + 0001:0000eb61 _wctomb 0040fb61 f LIBC:wctomb.obj + 0001:0000ebd0 __aulldiv 0040fbd0 f LIBC:ulldiv.obj + 0001:0000ec40 __aullrem 0040fc40 f LIBC:ullrem.obj + 0001:0000ecb5 _strtol 0040fcb5 f LIBC:strtol.obj + 0001:0000eed4 _strtoul 0040fed4 f LIBC:strtol.obj + 0001:0000ef00 _strchr 0040ff00 f LIBC:strchr.obj + 0001:0000ef06 ___from_strstr_to_strchr 0040ff06 f LIBC:strchr.obj + 0001:0000efc0 _strstr 0040ffc0 f LIBC:strstr.obj + 0001:0000f040 _strncmp 00410040 f LIBC:strncmp.obj + 0001:0000f080 __alloca_probe 00410080 f LIBC:chkstk.obj + 0001:0000f080 __chkstk 00410080 f LIBC:chkstk.obj + 0001:0000f0b0 _memmove 004100b0 f LIBC:memmove.obj + 0001:0000f3f0 _memset 004103f0 f LIBC:memset.obj + 0001:0000f448 __open 00410448 f LIBC:open.obj + 0001:0000f45f __sopen 0041045f f LIBC:open.obj + 0001:0000f718 __setmbcp 00410718 f LIBC:mbctype.obj + 0001:0000fadc __getmbcp 00410adc f LIBC:mbctype.obj + 0001:0000faec ___initmbctable 00410aec f LIBC:mbctype.obj + 0001:0000fb10 _memcpy 00410b10 f LIBC:memcpy.obj + 0001:0000fe45 ___crtMessageBoxA 00410e45 f LIBC:crtmbox.obj + 0001:0000fece __fptrap 00410ece f LIBC:crt0fp.obj + 0001:0000fed7 __toupper 00410ed7 f LIBC:toupper.obj + 0001:0000fedf _toupper 00410edf f LIBC:toupper.obj + 0001:0000ffab __isctype 00410fab f LIBC:isctype.obj + 0001:00010020 __chsize 00411020 f LIBC:chsize.obj + 0001:00010166 ___crtLCMapStringA 00411166 f LIBC:a_map.obj + 0001:000103b5 ___crtGetStringTypeA 004113b5 f LIBC:a_str.obj + 0001:000104fe __setmode 004114fe f LIBC:setmode.obj + 0001:00010574 _HeapAlloc@12 00411574 f kernel32:KERNEL32.dll + 0001:0001057a _ExitProcess@4 0041157a f kernel32:KERNEL32.dll + 0001:00010580 _TerminateProcess@8 00411580 f kernel32:KERNEL32.dll + 0001:00010586 _GetCurrentProcess@0 00411586 f kernel32:KERNEL32.dll + 0001:0001058c _GetCommandLineA@0 0041158c f kernel32:KERNEL32.dll + 0001:00010592 _GetVersion@0 00411592 f kernel32:KERNEL32.dll + 0001:00010598 _HeapFree@12 00411598 f kernel32:KERNEL32.dll + 0001:0001059e _GetLastError@0 0041159e f kernel32:KERNEL32.dll + 0001:000105a4 _CloseHandle@4 004115a4 f kernel32:KERNEL32.dll + 0001:000105aa _SetFilePointer@16 004115aa f kernel32:KERNEL32.dll + 0001:000105b0 _SetHandleCount@4 004115b0 f kernel32:KERNEL32.dll + 0001:000105b6 _GetStdHandle@4 004115b6 f kernel32:KERNEL32.dll + 0001:000105bc _GetFileType@4 004115bc f kernel32:KERNEL32.dll + 0001:000105c2 _GetStartupInfoA@4 004115c2 f kernel32:KERNEL32.dll + 0001:000105c8 _WriteFile@20 004115c8 f kernel32:KERNEL32.dll + 0001:000105ce _GetModuleHandleA@4 004115ce f kernel32:KERNEL32.dll + 0001:000105d4 _GetModuleFileNameA@12 004115d4 f kernel32:KERNEL32.dll + 0001:000105da _GetEnvironmentVariableA@12 004115da f kernel32:KERNEL32.dll + 0001:000105e0 _GetVersionExA@4 004115e0 f kernel32:KERNEL32.dll + 0001:000105e6 _HeapDestroy@4 004115e6 f kernel32:KERNEL32.dll + 0001:000105ec _HeapCreate@12 004115ec f kernel32:KERNEL32.dll + 0001:000105f2 _VirtualFree@12 004115f2 f kernel32:KERNEL32.dll + 0001:000105f8 _VirtualAlloc@16 004115f8 f kernel32:KERNEL32.dll + 0001:000105fe _HeapReAlloc@16 004115fe f kernel32:KERNEL32.dll + 0001:00010604 _IsBadWritePtr@8 00411604 f kernel32:KERNEL32.dll + 0001:0001060a _RtlUnwind@16 0041160a f kernel32:KERNEL32.dll + 0001:00010610 _UnhandledExceptionFilter@4 00411610 f kernel32:KERNEL32.dll + 0001:00010616 _FreeEnvironmentStringsA@4 00411616 f kernel32:KERNEL32.dll + 0001:0001061c _FreeEnvironmentStringsW@4 0041161c f kernel32:KERNEL32.dll + 0001:00010622 _WideCharToMultiByte@32 00411622 f kernel32:KERNEL32.dll + 0001:00010628 _GetEnvironmentStrings@0 00411628 f kernel32:KERNEL32.dll + 0001:0001062e _GetEnvironmentStringsW@0 0041162e f kernel32:KERNEL32.dll + 0001:00010634 _SetStdHandle@8 00411634 f kernel32:KERNEL32.dll + 0001:0001063a _FlushFileBuffers@4 0041163a f kernel32:KERNEL32.dll + 0001:00010640 _ReadFile@20 00411640 f kernel32:KERNEL32.dll + 0001:00010646 _CreateFileA@28 00411646 f kernel32:KERNEL32.dll + 0001:0001064c _GetCPInfo@8 0041164c f kernel32:KERNEL32.dll + 0001:00010652 _GetACP@0 00411652 f kernel32:KERNEL32.dll + 0001:00010658 _GetOEMCP@0 00411658 f kernel32:KERNEL32.dll + 0001:0001065e _GetProcAddress@8 0041165e f kernel32:KERNEL32.dll + 0001:00010664 _LoadLibraryA@4 00411664 f kernel32:KERNEL32.dll + 0001:0001066a _SetEndOfFile@4 0041166a f kernel32:KERNEL32.dll + 0001:00010670 _MultiByteToWideChar@24 00411670 f kernel32:KERNEL32.dll + 0001:00010676 _LCMapStringA@24 00411676 f kernel32:KERNEL32.dll + 0001:0001067c _LCMapStringW@24 0041167c f kernel32:KERNEL32.dll + 0001:00010682 _GetStringTypeA@20 00411682 f kernel32:KERNEL32.dll + 0001:00010688 _GetStringTypeW@16 00411688 f kernel32:KERNEL32.dll + 0002:0000002c ___lookuptable 0041402c LIBC:output.obj + 0002:00000088 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 00414088 LIBC:output.obj + 0002:00000098 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 00414098 LIBC:output.obj + 0002:000000a0 ??_C@_0BH@PHHF@__GLOBAL_HEAP_SELECTED?$AA@ 004140a0 LIBC:heapinit.obj + 0002:000000b8 ??_C@_0BF@BBGL@__MSVCRT_HEAP_SELECT?$AA@ 004140b8 LIBC:heapinit.obj + 0002:000000dc ??_C@_0P@GGKG@runtime?5error?5?$AA@ 004140dc LIBC:crt0msg.obj + 0002:000000ec ??_C@_02PIMC@?$AN?6?$AA@ 004140ec LIBC:crt0msg.obj + 0002:000000f0 ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 004140f0 LIBC:crt0msg.obj + 0002:00000100 ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 00414100 LIBC:crt0msg.obj + 0002:00000110 ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 00414110 LIBC:crt0msg.obj + 0002:00000120 ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 00414120 LIBC:crt0msg.obj + 0002:00000148 ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 00414148 LIBC:crt0msg.obj + 0002:00000180 ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 00414180 LIBC:crt0msg.obj + 0002:000001b8 ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 004141b8 LIBC:crt0msg.obj + 0002:000001e0 ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 004141e0 LIBC:crt0msg.obj + 0002:00000218 ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 00414218 LIBC:crt0msg.obj + 0002:00000244 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 00414244 LIBC:crt0msg.obj + 0002:00000268 ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 00414268 LIBC:crt0msg.obj + 0002:00000298 ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 00414298 LIBC:crt0msg.obj + 0002:000002c4 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 004142c4 LIBC:crt0msg.obj + 0002:000002e8 ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 004142e8 LIBC:crt0msg.obj + 0002:00000314 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 00414314 LIBC:crt0msg.obj + 0002:00000340 ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 00414340 LIBC:crt0msg.obj + 0002:00000368 ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 00414368 LIBC:crt0msg.obj + 0002:00000390 ??_C@_02JJJH@?6?6?$AA@ 00414390 LIBC:crt0msg.obj + 0002:00000394 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 00414394 LIBC:crt0msg.obj + 0002:000003b0 ??_C@_03NAME@?4?4?4?$AA@ 004143b0 LIBC:crt0msg.obj + 0002:000003b4 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 004143b4 LIBC:crt0msg.obj + 0002:000003cc ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 004143cc LIBC:crtmbox.obj + 0002:000003e0 ??_C@_0BA@GILI@GetActiveWindow?$AA@ 004143e0 LIBC:crtmbox.obj + 0002:000003f0 ??_C@_0M@PKCK@MessageBoxA?$AA@ 004143f0 LIBC:crtmbox.obj + 0002:000003fc ??_C@_0L@HKL@user32?4dll?$AA@ 004143fc LIBC:crtmbox.obj + 0002:00000408 ??_C@_01A@?$AA?$AA@ 00414408 LIBC:a_map.obj + 0002:0000040c ??_C@_13A@?$AA?$AA?$AA?$AA@ 0041440c LIBC:a_map.obj + 0003:00000000 ___xc_a 00415000 LIBC:crt0init.obj + 0003:00000104 ___xc_z 00415104 LIBC:crt0init.obj + 0003:00000208 ___xi_a 00415208 LIBC:crt0init.obj + 0003:00000418 ___xi_z 00415418 LIBC:crt0init.obj + 0003:0000051c ___xp_a 0041551c LIBC:crt0init.obj + 0003:00000724 ___xp_z 00415724 LIBC:crt0init.obj + 0003:00000828 ___xt_a 00415828 LIBC:crt0init.obj + 0003:0000092c ___xt_z 0041592c LIBC:crt0init.obj + 0003:00000a30 _symtbl 00415a30 asdata.obj + 0003:00000a40 _aretbl 00415a40 asdata.obj + 0003:00000a50 _sym 00415a50 asdata.obj + 0003:00000a88 _area 00415a88 asdata.obj + 0003:00000aa0 _ctype 00415aa0 asdata.obj + 0003:00000b20 _ccase 00415b20 asdata.obj + 0003:00001214 _usetxt 00416214 asmain.obj + 0003:00001614 _txtp 00416614 asout.obj + 0003:00001618 _relp 00416618 asout.obj + 0003:000017c4 _errors 004167c4 assubr.obj + 0003:00001b18 _R8 00416b18 z80adr.obj + 0003:00001b58 _R8X 00416b58 z80adr.obj + 0003:00001b70 _R16 00416b70 z80adr.obj + 0003:00001ba8 _R16X 00416ba8 z80adr.obj + 0003:00001bc0 _CND 00416bc0 z80adr.obj + 0003:00001c44 _cpu 00416c44 z80ext.obj + 0003:00001c48 _dsft 00416c48 z80ext.obj + 0003:00001c74 _imtab 00416c74 z80mch.obj + 0003:00001c78 _mne 00416c78 z80pst.obj + 0003:00002c50 __iob 00417c50 LIBC:_file.obj + 0003:00002ed0 __aexit_rtn 00417ed0 LIBC:crt0.obj + 0003:00002ed4 ___app_type 00417ed4 LIBC:crt0.obj + 0003:00002ed8 ___badioinfo 00417ed8 LIBC:ioinit.obj + 0003:00002ee0 ___nullstring 00417ee0 LIBC:output.obj + 0003:00002ee4 ___wnullstring 00417ee4 LIBC:output.obj + 0003:00002ee8 __amblksiz 00417ee8 LIBC:heapinit.obj + 0003:00002ef0 ___old_small_block_heap 00417ef0 LIBC:sbheap.obj + 0003:00004f14 ___old_sbh_threshold 00419f14 LIBC:sbheap.obj + 0003:00004f18 __NLG_Destination 00419f18 LIBC:exsup.obj + 0003:00004f28 __XcptActTab 00419f28 LIBC:winxfltr.obj + 0003:00004fa0 __First_FPE_Indx 00419fa0 LIBC:winxfltr.obj + 0003:00004fa4 __Num_FPE 00419fa4 LIBC:winxfltr.obj + 0003:00004fa8 __XcptActTabCount 00419fa8 LIBC:winxfltr.obj + 0003:00004fac __fpecode 00419fac LIBC:winxfltr.obj + 0003:000051a8 __cfltcvt_tab 0041a1a8 LIBC:cmiscdat.obj + 0003:000051c0 __pctype 0041a1c0 LIBC:ctype.obj + 0003:000051c4 __pwctype 0041a1c4 LIBC:ctype.obj + 0003:000051c8 __ctype 0041a1c8 LIBC:ctype.obj + 0003:000054d0 ___mb_cur_max 0041a4d0 LIBC:nlsdata1.obj + 0003:000054d4 ___decimal_point 0041a4d4 LIBC:nlsdata1.obj + 0003:000054d8 ___decimal_point_length 0041a4d8 LIBC:nlsdata1.obj + 0003:00005e4c _hilo 0041ae4c z80ext.obj + 0003:00005e50 __cflush 0041ae50 LIBC:_file.obj + 0003:00005e54 _errno 0041ae54 LIBC:crt0dat.obj + 0003:00005e58 __doserrno 0041ae58 LIBC:crt0dat.obj + 0003:00005e5c __umaskval 0041ae5c LIBC:crt0dat.obj + 0003:00005e60 __osver 0041ae60 LIBC:crt0dat.obj + 0003:00005e64 __winver 0041ae64 LIBC:crt0dat.obj + 0003:00005e68 __winmajor 0041ae68 LIBC:crt0dat.obj + 0003:00005e6c __winminor 0041ae6c LIBC:crt0dat.obj + 0003:00005e70 ___argc 0041ae70 LIBC:crt0dat.obj + 0003:00005e74 ___argv 0041ae74 LIBC:crt0dat.obj + 0003:00005e78 ___wargv 0041ae78 LIBC:crt0dat.obj + 0003:00005e7c __environ 0041ae7c LIBC:crt0dat.obj + 0003:00005e80 ___initenv 0041ae80 LIBC:crt0dat.obj + 0003:00005e84 __wenviron 0041ae84 LIBC:crt0dat.obj + 0003:00005e88 ___winitenv 0041ae88 LIBC:crt0dat.obj + 0003:00005e8c __pgmptr 0041ae8c LIBC:crt0dat.obj + 0003:00005e90 __wpgmptr 0041ae90 LIBC:crt0dat.obj + 0003:00005e94 __exitflag 0041ae94 LIBC:crt0dat.obj + 0003:00005e98 __C_Termination_Done 0041ae98 LIBC:crt0dat.obj + 0003:00005e9c __C_Exit_Done 0041ae9c LIBC:crt0dat.obj + 0003:00005ea0 __aenvptr 0041aea0 LIBC:crt0.obj + 0003:00005ea4 __wenvptr 0041aea4 LIBC:crt0.obj + 0003:00005ea8 ___error_mode 0041aea8 LIBC:crt0.obj + 0003:00005eac __stdbuf 0041aeac LIBC:_sftbuf.obj + 0003:00005eb4 __newmode 0041aeb4 LIBC:_newmode.obj + 0003:00005eb8 ?_pnhHeap@@3P6AHI@ZA 0041aeb8 LIBC:handler.obj + 0003:00005ec0 __pxcptinfoptrs 0041aec0 LIBC:winxfltr.obj + 0003:00005fcc __adbgmsg 0041afcc LIBC:crt0msg.obj + 0003:00005fd0 __commode 0041afd0 LIBC:ncommode.obj + 0003:00005fe4 ___lc_handle 0041afe4 LIBC:nlsdata2.obj + 0003:00005ffc ___lc_codepage 0041affc LIBC:nlsdata2.obj + 0003:00006000 ___lc_collate_cp 0041b000 LIBC:nlsdata2.obj + 0003:00006004 __fmode 0041b004 LIBC:txtmode.obj + 0003:00006010 _hd64 0041b010 + 0003:00006020 _rel 0041b020 + 0003:00006040 _txt 0041b040 + 0003:00006050 _fflag 0041b050 + 0003:000064e0 _module 0041b4e0 + 0003:00006534 _tlevel 0041b534 + 0003:00006538 _symp 0041b538 + 0003:0000653c _inpfil 0041b53c + 0003:00006540 _afn 0041b540 + 0003:00006640 _afp 0041b640 + 0003:00006644 _lmode 0041b644 + 0003:00006660 _cbt 0041b660 + 0003:00006860 _symhash 0041b860 + 0003:00006960 _mnehash 0041b960 + 0003:00006a60 _srcfn 0041ba60 + 0003:00007060 _laddr 0041c060 + 0003:00007080 _srcfp 0041c080 + 0003:00007098 _cpt 0041c098 + 0003:0000709c _fuzz 0041c09c + 0003:000070a0 _erb 0041c0a0 + 0003:00007124 _incfil 0041c124 + 0003:00007140 _incfn 0041c140 + 0003:00007740 _incfp 0041c740 + 0003:00007760 _ifp 0041c760 + 0003:00007778 _cfile 0041c778 + 0003:0000777c _lfp 0041c77c + 0003:00007780 _gflag 0041c780 + 0003:00007784 _a_mask 0041c784 + 0003:00007788 _line 0041c788 + 0003:0000778c _lop 0041c78c + 0003:00007790 _ofp 0041c790 + 0003:00007794 _zflag 0041c794 + 0003:000077a0 _srcline 0041c7a0 + 0003:000077b8 _oflag 0041c7b8 + 0003:000077c0 _sfp 0041c7c0 + 0003:000077d8 _areap 0041c7d8 + 0003:000077dc _tfp 0041c7dc + 0003:000077e0 _page 0041c7e0 + 0003:00007800 _stb 0041c800 + 0003:00007850 _pass 0041c850 + 0003:00007854 _sflag 0041c854 + 0003:00007860 _cb 0041c860 + 0003:000078e0 _eb 0041c8e0 + 0003:000078e4 _cp 0041c8e4 + 0003:000078e8 _aserr 0041c8e8 + 0003:000078ec _ep 0041c8ec + 0003:00007900 _ib 0041c900 + 0003:00007980 _wflag 0041c980 + 0003:00007984 _ip 0041c984 + 0003:000079a0 _afntmp 0041c9a0 + 0003:00007aa0 _tb 0041caa0 + 0003:00007af0 _lflag 0041caf0 + 0003:00007af4 _a_bytes 0041caf4 + 0003:00007af8 _afptmp 0041caf8 + 0003:00007afc _pflag 0041cafc + 0003:00007b00 _incline 0041cb00 + 0003:00007b18 _aflag 0041cb18 + 0003:00007b20 _ifcnd 0041cb20 + 0003:00007b4c _s_mask 0041cb4c + 0003:00007b50 _xflag 0041cb50 + 0003:00007b54 _radix 0041cb54 + 0003:00007b58 _flevel 0041cb58 + 0003:00007b60 _jump_env 0041cb60 + 0003:00007ba0 _v_mask 0041cba0 + 0003:00007bc0 _iflvl 0041cbc0 + 0003:00007bec ___mbcodepage 0041cbec + 0003:00007c70 ___mbulinfo 0041cc70 + 0003:00007c7c ___ismbcodepage 0041cc7c + 0003:00007c80 __mbcasemap 0041cc80 + 0003:00007d80 __mbctype 0041cd80 + 0003:00007e84 ___mblcid 0041ce84 + 0003:00007e88 ___sbh_sizeHeaderList 0041ce88 + 0003:00007e9c ___sbh_indGroupDefer 0041ce9c + 0003:00007ea0 ___sbh_pHeaderScan 0041cea0 + 0003:00007ea4 ___sbh_initialized 0041cea4 + 0003:00007ea8 ___sbh_pHeaderDefer 0041cea8 + 0003:00007eac ___sbh_cntHeaderList 0041ceac + 0003:00007eb0 ___sbh_pHeaderList 0041ceb0 + 0003:00007eb4 ___sbh_threshold 0041ceb4 + 0003:00007eb8 __crtheap 0041ceb8 + 0003:00007ec8 ___active_heap 0041cec8 + 0003:00007ee0 ___pioinfo 0041cee0 + 0003:0000801c __nhandle 0041d01c + 0003:00008020 __acmdln 0041d020 + 0003:0000802c __setjmpexused 0041d02c + 0003:00008038 ___env_initialized 0041d038 + 0003:00008048 ___mbctype_initialized 0041d048 + 0003:0000804c ___onexitend 0041d04c + 0003:00008050 ___onexitbegin 0041d050 + 0003:00008054 __FPinit 0041d054 + 0003:00008058 ___piob 0041d058 + 0003:000083a0 __bufin 0041d3a0 + 0003:000093a0 __nstream 0041e3a0 + 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 0041f000 kernel32:KERNEL32.dll + 0004:00000014 __NULL_IMPORT_DESCRIPTOR 0041f014 kernel32:KERNEL32.dll + 0004:00000134 __imp__IsBadWritePtr@8 0041f134 kernel32:KERNEL32.dll + 0004:00000138 __imp__ExitProcess@4 0041f138 kernel32:KERNEL32.dll + 0004:0000013c __imp__TerminateProcess@8 0041f13c kernel32:KERNEL32.dll + 0004:00000140 __imp__GetCurrentProcess@0 0041f140 kernel32:KERNEL32.dll + 0004:00000144 __imp__GetCommandLineA@0 0041f144 kernel32:KERNEL32.dll + 0004:00000148 __imp__GetVersion@0 0041f148 kernel32:KERNEL32.dll + 0004:0000014c __imp__HeapFree@12 0041f14c kernel32:KERNEL32.dll + 0004:00000150 __imp__GetLastError@0 0041f150 kernel32:KERNEL32.dll + 0004:00000154 __imp__CloseHandle@4 0041f154 kernel32:KERNEL32.dll + 0004:00000158 __imp__SetFilePointer@16 0041f158 kernel32:KERNEL32.dll + 0004:0000015c __imp__SetHandleCount@4 0041f15c kernel32:KERNEL32.dll + 0004:00000160 __imp__GetStdHandle@4 0041f160 kernel32:KERNEL32.dll + 0004:00000164 __imp__GetFileType@4 0041f164 kernel32:KERNEL32.dll + 0004:00000168 __imp__GetStartupInfoA@4 0041f168 kernel32:KERNEL32.dll + 0004:0000016c __imp__WriteFile@20 0041f16c kernel32:KERNEL32.dll + 0004:00000170 __imp__GetModuleHandleA@4 0041f170 kernel32:KERNEL32.dll + 0004:00000174 __imp__GetModuleFileNameA@12 0041f174 kernel32:KERNEL32.dll + 0004:00000178 __imp__GetEnvironmentVariableA@12 0041f178 kernel32:KERNEL32.dll + 0004:0000017c __imp__GetVersionExA@4 0041f17c kernel32:KERNEL32.dll + 0004:00000180 __imp__HeapDestroy@4 0041f180 kernel32:KERNEL32.dll + 0004:00000184 __imp__HeapCreate@12 0041f184 kernel32:KERNEL32.dll + 0004:00000188 __imp__VirtualFree@12 0041f188 kernel32:KERNEL32.dll + 0004:0000018c __imp__VirtualAlloc@16 0041f18c kernel32:KERNEL32.dll + 0004:00000190 __imp__HeapReAlloc@16 0041f190 kernel32:KERNEL32.dll + 0004:00000194 __imp__HeapAlloc@12 0041f194 kernel32:KERNEL32.dll + 0004:00000198 __imp__RtlUnwind@16 0041f198 kernel32:KERNEL32.dll + 0004:0000019c __imp__UnhandledExceptionFilter@4 0041f19c kernel32:KERNEL32.dll + 0004:000001a0 __imp__FreeEnvironmentStringsA@4 0041f1a0 kernel32:KERNEL32.dll + 0004:000001a4 __imp__FreeEnvironmentStringsW@4 0041f1a4 kernel32:KERNEL32.dll + 0004:000001a8 __imp__WideCharToMultiByte@32 0041f1a8 kernel32:KERNEL32.dll + 0004:000001ac __imp__GetEnvironmentStrings@0 0041f1ac kernel32:KERNEL32.dll + 0004:000001b0 __imp__GetEnvironmentStringsW@0 0041f1b0 kernel32:KERNEL32.dll + 0004:000001b4 __imp__SetStdHandle@8 0041f1b4 kernel32:KERNEL32.dll + 0004:000001b8 __imp__FlushFileBuffers@4 0041f1b8 kernel32:KERNEL32.dll + 0004:000001bc __imp__ReadFile@20 0041f1bc kernel32:KERNEL32.dll + 0004:000001c0 __imp__CreateFileA@28 0041f1c0 kernel32:KERNEL32.dll + 0004:000001c4 __imp__GetCPInfo@8 0041f1c4 kernel32:KERNEL32.dll + 0004:000001c8 __imp__GetACP@0 0041f1c8 kernel32:KERNEL32.dll + 0004:000001cc __imp__GetOEMCP@0 0041f1cc kernel32:KERNEL32.dll + 0004:000001d0 __imp__GetProcAddress@8 0041f1d0 kernel32:KERNEL32.dll + 0004:000001d4 __imp__LoadLibraryA@4 0041f1d4 kernel32:KERNEL32.dll + 0004:000001d8 __imp__SetEndOfFile@4 0041f1d8 kernel32:KERNEL32.dll + 0004:000001dc __imp__MultiByteToWideChar@24 0041f1dc kernel32:KERNEL32.dll + 0004:000001e0 __imp__LCMapStringA@24 0041f1e0 kernel32:KERNEL32.dll + 0004:000001e4 __imp__LCMapStringW@24 0041f1e4 kernel32:KERNEL32.dll + 0004:000001e8 __imp__GetStringTypeA@20 0041f1e8 kernel32:KERNEL32.dll + 0004:000001ec __imp__GetStringTypeW@16 0041f1ec kernel32:KERNEL32.dll + 0004:000001f0 \177KERNEL32_NULL_THUNK_DATA 0041f1f0 kernel32:KERNEL32.dll + + entry point at 0001:0000acf3 + diff --git a/src/as-z80/asdata.c b/src/mkutil/as-z80/asdata.c similarity index 100% rename from src/as-z80/asdata.c rename to src/mkutil/as-z80/asdata.c diff --git a/src/as-z80/asexpr.c b/src/mkutil/as-z80/asexpr.c similarity index 100% rename from src/as-z80/asexpr.c rename to src/mkutil/as-z80/asexpr.c diff --git a/src/as-z80/aslex.c b/src/mkutil/as-z80/aslex.c similarity index 100% rename from src/as-z80/aslex.c rename to src/mkutil/as-z80/aslex.c diff --git a/src/as-z80/aslist.c b/src/mkutil/as-z80/aslist.c similarity index 100% rename from src/as-z80/aslist.c rename to src/mkutil/as-z80/aslist.c diff --git a/src/as-z80/asmain.c b/src/mkutil/as-z80/asmain.c similarity index 100% rename from src/as-z80/asmain.c rename to src/mkutil/as-z80/asmain.c diff --git a/src/as-z80/asout.c b/src/mkutil/as-z80/asout.c similarity index 100% rename from src/as-z80/asout.c rename to src/mkutil/as-z80/asout.c diff --git a/src/as-z80/assubr.c b/src/mkutil/as-z80/assubr.c similarity index 100% rename from src/as-z80/assubr.c rename to src/mkutil/as-z80/assubr.c diff --git a/src/as-z80/assym.c b/src/mkutil/as-z80/assym.c similarity index 100% rename from src/as-z80/assym.c rename to src/mkutil/as-z80/assym.c diff --git a/src/as-z80/asxxxx.h b/src/mkutil/as-z80/asxxxx.h similarity index 100% rename from src/as-z80/asxxxx.h rename to src/mkutil/as-z80/asxxxx.h diff --git a/src/as-z80/n.bat b/src/mkutil/as-z80/n.bat similarity index 93% rename from src/as-z80/n.bat rename to src/mkutil/as-z80/n.bat index b8d45f52..95e3d73c 100644 --- a/src/as-z80/n.bat +++ b/src/mkutil/as-z80/n.bat @@ -24,7 +24,7 @@ cl -Zi -I. -DWIN32 -c z80pst.c @if errorlevel 1 goto failure link @as-z80.lnk @if errorlevel 1 goto failure -copy as-z80.exe ..\bin +copy as-z80.exe ..\..\bin @echo SUCCESS @goto done diff --git a/src/as-z80/tz80.asm b/src/mkutil/as-z80/tz80.asm similarity index 100% rename from src/as-z80/tz80.asm rename to src/mkutil/as-z80/tz80.asm diff --git a/src/as-z80/tz80l.asm b/src/mkutil/as-z80/tz80l.asm similarity index 100% rename from src/as-z80/tz80l.asm rename to src/mkutil/as-z80/tz80l.asm diff --git a/src/as-z80/z80.h b/src/mkutil/as-z80/z80.h similarity index 100% rename from src/as-z80/z80.h rename to src/mkutil/as-z80/z80.h diff --git a/src/as-z80/z80adr.c b/src/mkutil/as-z80/z80adr.c similarity index 100% rename from src/as-z80/z80adr.c rename to src/mkutil/as-z80/z80adr.c diff --git a/src/as-z80/z80ext.c b/src/mkutil/as-z80/z80ext.c similarity index 100% rename from src/as-z80/z80ext.c rename to src/mkutil/as-z80/z80ext.c diff --git a/src/as-z80/z80mch.c b/src/mkutil/as-z80/z80mch.c similarity index 100% rename from src/as-z80/z80mch.c rename to src/mkutil/as-z80/z80mch.c diff --git a/src/as-z80/z80pst.c b/src/mkutil/as-z80/z80pst.c similarity index 100% rename from src/as-z80/z80pst.c rename to src/mkutil/as-z80/z80pst.c diff --git a/src/as-z80/z80pst.c$ b/src/mkutil/as-z80/z80pst.c$ similarity index 100% rename from src/as-z80/z80pst.c$ rename to src/mkutil/as-z80/z80pst.c$ diff --git a/src/mkutil/avra-0.8/COPYING b/src/mkutil/avra-0.8/COPYING new file mode 100644 index 00000000..1942c433 --- /dev/null +++ b/src/mkutil/avra-0.8/COPYING @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/src/mkutil/avra-0.8/ChangeLog b/src/mkutil/avra-0.8/ChangeLog new file mode 100644 index 00000000..f974ea4f --- /dev/null +++ b/src/mkutil/avra-0.8/ChangeLog @@ -0,0 +1,47 @@ +Release 0.8 released by Tobias Weber + (20030307) + - Added new macro assembler coding facilities + - Added error description for .include directives +Release 0.7 + (20000217) - Added supported() function to check in a .if if a instruction is + supported (From Lesha Bogdanow ). + - Added checking of which mnemonic that work on the different AVRs + (From Lesha Bogdanow ). + - Added constants __DEVICE__, __FLASH_SIZE__, __RAM_SIZE__ and + __EEPROM_SIZE__ (From Lesha Bogdanow ). + - Added tiny devices (From Lesha Bogdanow ). + (20000403) - Changed error on constant out of range into a warning. + (20010918) - Added support for instructions: (E)LPM Rd,Z(+), SPM, ESPM, BREAK, + MOVW, MULS, MULSU, FMUL, FMULS, FMULSU + - Added support for new devices: ATmega8, ATmega16, ATmega32, + ATmega128, ATmega162, ATmega163, ATmega323, AT94K + - Added --devices switch to list all supported devices. + (20010919) - Fixed bug in map file name when the name had more than one . (dot) + (20010920) - Added option --includedirs to add additional include dirs in + search path. + (20010925) - Added support for creation of intel hex 32 files to be able to + address memory above 64KB. Uses 02 records for addresses up to 1MB + and 04 record for addresses above 1MB. + +Release 0.6 + (20000124) - Added COFF support from Bob Harris + +Release 0.5 + (19990331) - Bugfix: a inline string copy did not terminate string. + (19990409) - Fixed bug causing --define symbol=value not to work. + (19990418) - Added output of memory usage. + (19990518) - Fixed bug when there was a { in a comment. + (19990715) - Fixed count for data segment. + (19990720) - Fix to make a forward referenced label in .db/.dw work. + (19990922) - Added ATmega161 and ATtiny15 in list. + - rjmp and rcall now wraps around with 4k word devices. + (19991220) - Fixed bug when branching backwards with BRBS or BRBC + +Release 0.4 + (19990202) - Added support for global keyword to use on labels in macros. + - Fixed get_next_token to handle commas inside ' ' + (19990204) - Fixed bug when searching for correct macro_call, so recursive + and nested macros will work. + - Now handles commas in strings. + - Added fix to handle semi colon in a string. + (19990205) - Improved mnemonic parsing for ld and st diff --git a/src/mkutil/avra-0.8/README b/src/mkutil/avra-0.8/README new file mode 100644 index 00000000..f520f32a --- /dev/null +++ b/src/mkutil/avra-0.8/README @@ -0,0 +1,274 @@ + + Avra - Assember for the Atmel AVR microcontroller series + Copyright (C) 1998-2003 Jon Anders Haugum, Tobias Weber + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + + Authors of avra can be reached at: + email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + www: http://www.omegav.ntnu.no/~jonah/el/avra.html + + +---------------------------------------------------------------------- + +1. Introduction + +avra is an assembler for the Atmel AVR microcontrollers, and it is +almost compatible with Atmel's own assembler AVRASM32. The difference +is that avra supports some extra preprocessor directives, and the macro- +support is better. + +Since avra is written in ANSI C it should be possible to compile on +most systems. + +I would also like to thank the following people for giving +contributions and bug reports: + + Bernt Hembre + Nils Strøm + Roberto Biancardi + Qwerty Jones + Ben Hitchcock (Maker of the mac port) + Daniel Drotos + Laurence Boyd II + Varuzhan Danielyan + Laurence Turner + Eugene R. O'Bryan + Dmitry Dicky + Bob Harris (Maker of coff support) + Tobias Weber (enhanced macro support) + +---------------------------------------------------------------------- + +2. Installation + +To install avra you should copy the avra-executeable to a apropriate location. + +To compile you should rename the apropritate makefile, and do a make (use smake +for Amiga SAS/C, and nmake for Mickeysoft visual c++). + + +2.1 Linux + +First you should compile the source by typing make. + +avra should be copied to /usr/local/bin/ or other apropriate directory. + +Doing a 'make install' will do the same thing. + + +2.2 AmigaOS + +avra should be copied to c: or other apropriate directory. + +If you are using the source-distribution a 'make install' will do the same. + + +2.3 win32 (Windows 95 (++) and Windows NT) + +avra.exe should be copied to an apropriate location. A 'nmake install' will +copy it and avra.def to c:\bin\ + +2.4 Dev-C++ enviroment + +Dev-C++ is a GNU development enviroment available for the most common platforms. +A project file created with Dev-C++ 4.9.6.0 has added to the package. +Just open the project file and 'compile' with Ctrl-F9. This nice software +you can get at http://www.bloodshed.net/ + + +---------------------------------------------------------------------- + + +3. Compatibility + +This Version of AVRA should work as replacement of the build in assembler of +Atmel AVR Studio(c). Just replace the AVRASM32.EXE in your AVRStudio +directories. This Version has been tested with AVRStudio V4.06 and V3.55 +it worked 'almost' bugfree. + + +---------------------------------------------------------------------- + +4. Adding support for other systems + +avra is written mostly in ANSI-C, so it should be possible to port it +to other 32-bit systems. + + +---------------------------------------------------------------------- + +5. New Macro possibilities + +As a person who never liked reading through lots of manual pages, I keep it +short and start with some simple examples. Sometimes you work with 16 Bit +or greater variables stored in registers. The new macro support allows you to +write short and flexible macro code. The extended mode is active, as soon +as you use brackets like this [ ] to wrap macro parameters. + +5.1 Examples + +To simplify the parameters in the demonstration below, we need to redefine +some registers. + +.def a = r16 ;general purpose registers +.def b = r17 +.def c = r18 +.def d = r19 + +.def w = r20 ;working register + +If we substract 16 Bit values stored in a, higher byte and b, lower byte with +that in c:d, we usually have to use the following command sequence: + + sub b,d + sbc a,c + +Now we can do the following steps to simplify 16 or more Bit manipulations + +.macro subs +.message "no parameters" +.endm + +.macro subs_16_16 + sub @1,@3 + sbc @0,@2 +.endm + +.macro subs_16_8 + sub @1,@2 + sbci @0,0 +.endm + + ;hence, we can write a 16 Bit subraction as: + + subs [a:b,c:d] + + ;or for doing 16 minus 8 Bit + + subs [a:b,c] + + +5.2 more examples: + +.macro load +.message "no parameters" +.endm + +.macro load_16_i + ldi @0,high(@2) + ldi @1,low(@2) +.endm + +.macro load_32_i + ldi @0,BYTE4(@4) + ldi @1,BYTE3(@4) + ldi @2,high(@4) + ldi @3,low(@4) +.endm + + + load [a:b,15] ;uses macro load_16_i to load immediate + + load [a:b:c:d,15] ;uses macro load_32_i to load immediate + +5.3 Datatypes + +There are 3 Datatypes which can be used. They will be added as character +separated by one underline character. + + immediate values _i + registers _8,_16,_24,_32,_40,_48,_56,_64 + void parameter _v + + +5.4 even more expamples: + +.dseg +counter .byte 2 +.cseg + +.macro poke +.message "no parameters" +.endm + +.macro poke_i_16_i + ldi @1,high(@3) + sts @0+0,@1 + ldi @2,low(@3) + sts @0+1,@2 +.endm + +.macro poke_i_i + ldi w,@1 + sts @0+0,w +.endm + +.macro poke_i_v_i + ldi w,high(@3) + sts @0+0,w + ldi w,low(@3) + sts @0+1,w +.endm + +.macro poke_i_v_v_v_i + ldi w,high(@3) + sts @0+0,w + ldi w,low(@3) + sts @0+1,w + ldi w,BYTE3(@3) + sts @0+2,w + ldi w,BYTE4(@3) + sts @0+3,w +.endm + + + ;this writes '9999' into the memory at 'counter' + ;uses only the working register for transfering the values. + + poke [counter,w:w,9999] + + ;works same as above, but the transferred value '9999' is also + ;kept in the pair of register a:b + + poke [counter,a:b,9999] + + ;in my design 'w' is always working reg. which implies that + ;it cannot be used for normal variables. The following example uses poke_i_i + ;because the parameter contains two immediate values. + + poke [counter,9999] ;uses poke_i_i + + ;to be able to choose between a 8,16 or 32 Bit operation, you just + ;add a void parameter. + + poke [counter,,9999] ;uses poke_i_v_i + + ;and the same for 32 Bit pokes + + poke [counter,,,,9999] ;uses poke_i_v_v_v_i + +What I was trying to do with this new macro speech, was to create a platform +indipendent assembling language. Sometimes, but only sometimes, it would +be nice be able to port the code to Microchip PIC family more or less directly. + +---------------------------------------------------------------------- +6.0 Links + +http://www.avrfreaks.com/ + + diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.gcc b/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.gcc new file mode 100644 index 00000000..a8752cfc --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.gcc @@ -0,0 +1,80 @@ +#******************************************************************** +# Makefile for gcc (Geek Gadget) on Amiga +#******************************************************************** + +CC = gcc +LD = gcc +CFLAGS = -Wall -O3 +LDFLAGS = -s + +SOURCES = avra.c device.c parser.c expr.c mnemonic.c directiv.c macro.c file.c map.c coff.c + +OBJECTS = $(SOURCES:.c=.o) + +OBJ_ALL = $(OBJECTS) args.o stdextra.o + +DISTFILES = *.c *.h README ChangeLog Makefile.* COPYING avra.1 avra.txt strip-headers TODO + +ARCHFILES = $(DISTFILES) + +BINFILES = avra README ChangeLog COPYING avra.1 avra.txt + +VERSION = 0.7 + +#******************************************************************** + +all: avra + +install: avra + copy avra c: + +clean: + rm -f avra *.o *.p *~ + +avra: $(OBJ_ALL) + $(LD) -o avra $(OBJ_ALL) $(LDFLAGS) + +args.o: args.c misc.h args.h +avra.o: avra.c misc.h args.h avra.h device.h +device.o: device.c misc.h avra.h device.h +directiv.o: directiv.c misc.h args.h avra.h device.h +expr.o: expr.c misc.h avra.h +file.o: file.c misc.h avra.h +macro.o: macro.c misc.h args.h avra.h +mnemonic.o: mnemonic.c misc.h avra.h device.h +parser.o: parser.c misc.h avra.h +stdextra.o: stdextra.c misc.h +coff.o: coff.c coff.h + +avra.txt: avra.1 + groff -man -Tascii avra.1 | ./strip-headers | col -bx > avra.txt + +#******************************************************************** + +disk: archive + copy avra.tar.gz pc0:avra.tgz + +archive: avra.tar.gz + +avra.tar.gz: $(ARCHFILES) + tar cvf avra.tar $(ARCHFILES) + gzip -9 -f avra.tar + +dist: avra-$(VERSION).tar.gz + +avra-$(VERSION).tar.gz: $(DISTFILES) + mkdir avra-$(VERSION) + cp $(DISTFILES) avra-$(VERSION)/ + tar cvf avra-$(VERSION).tar avra-$(VERSION)/* + gzip -9 -f avra-$(VERSION).tar + rm -r avra-$(VERSION) + +bin: avra-$(VERSION)-Amiga-ixemul.lha + +avra-$(VERSION)-Amiga-ixemul.lha: $(BINFILES) + mkdir avra-$(VERSION) + cp $(BINFILES) avra-$(VERSION)/ + lha -xr u avra-$(VERSION)-Amiga-ixemul.lha avra-$(VERSION)/* + rm -r avra-$(VERSION) + +#******************************************************************** diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.sas b/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.sas new file mode 100644 index 00000000..1242ad3e --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.amiga.sas @@ -0,0 +1,75 @@ +#******************************************************************** +# Makefile for SAS/C on Amiga +#******************************************************************** + +CC = sc +LD = sc +CFLAGS = NOVERSION OPTIMIZE STRINGMERGE +LDFLAGS = NOVERSION + +SOURCES = avra.c device.c parser.c expr.c mnemonic.c directiv.c macro.c file.c map.c coff.c + +OBJECTS = avra.o device.o parser.o expr.o mnemonic.o directiv.o macro.o file.o map.o coff.o + +OBJ_ALL = $(OBJECTS) args.o stdextra.o + +DISTFILES = *.c *.h README ChangeLog Makefile.* COPYING avra.1 avra.txt strip-headers TODO + +ARCHFILES = $(DISTFILES) + +BINFILES = avra README ChangeLog COPYING avra.1 avra.txt + +VERSION = 0.7 + +#******************************************************************** + +all: avra + +install: avra + copy avra c: + +clean: + delete avra avra.info \#?.o \#?.lnk + +avra: $(OBJ_ALL) + $(LD) link $(OBJ_ALL) $(LDFLAGS) + +args.o: args.c misc.h args.h +avra.o: avra.c misc.h args.h avra.h device.h +device.o: device.c misc.h avra.h device.h +directiv.o: directiv.c misc.h args.h avra.h device.h +expr.o: expr.c misc.h avra.h +file.o: file.c misc.h avra.h +macro.o: macro.c misc.h args.h avra.h +mnemonic.o: mnemonic.c misc.h avra.h device.h +parser.o: parser.c misc.h avra.h +stdextra.o: stdextra.c misc.h +coff.o: coff.c coff.h + +#******************************************************************** + +disk: archive + copy avra.tar.gz pc0:avra.tgz + +archive: avra.lha + +avra.lha: $(ARCHFILES) + lha -xr u avra.lha $(ARCHFILES) + +dist: avra-$(VERSION).lha + +avra-$(VERSION).lha: $(DISTFILES) + makedir avra-$(VERSION) + copy $(DISTFILES) TO avra-$(VERSION)/ + lha -xr u avra-$(VERSION).lha avra-$(VERSION)/* + delete ALL avra-$(VERSION) + +bin: avra-$(VERSION)-Amiga.lha + +avra-$(VERSION)-Amiga.lha: $(BINFILES) + makedir avra-$(VERSION) + copy $(BINFILES) avra-$(VERSION)/ + lha -xr u avra-$(VERSION)-Amiga.lha avra-$(VERSION)/* + delete ALL avra-$(VERSION) + +#******************************************************************** diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.emx b/src/mkutil/avra-0.8/SOURCE/Makefile.emx new file mode 100644 index 00000000..fac7433d --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.emx @@ -0,0 +1,69 @@ +#******************************************************************** +# Makefile for gcc/emx +#******************************************************************** + +CC = gcc +LD = gcc +CFLAGS = -Wall -O3 +LDFLAGS = -s + +SOURCES = avra.c device.c parser.c expr.c mnemonic.c directiv.c macro.c file.c map.c coff.c + +OBJECTS = $(SOURCES:.c=.o) + +OBJ_ALL = $(OBJECTS) args.o stdextra.o + +DISTFILES = *.c *.h README ChangeLog Makefile.* COPYING avra.1 avra.txt strip-headers TODO + +ARCHFILES = $(DISTFILES) + +BINFILES = avra README ChangeLog COPYING avra.1 avra.txt + +VERSION = 0.7 + +#******************************************************************** + +all: avra.exe + +clean: + rm -f avra.exe *.o *.p *~ + +avra.exe: $(OBJ_ALL) + $(LD) -o avra.exe $(OBJ_ALL) $(LDFLAGS) + +args.o: args.c misc.h args.h +avra.o: avra.c misc.h args.h avra.h device.h +device.o: device.c misc.h avra.h device.h +directiv.o: directiv.c misc.h args.h avra.h device.h +expr.o: expr.c misc.h avra.h +file.o: file.c misc.h avra.h +macro.o: macro.c misc.h args.h avra.h +mnemonic.o: mnemonic.c misc.h avra.h device.h +parser.o: parser.c misc.h avra.h +stdextra.o: stdextra.c misc.h +coff.o: coff.c coff.h + +avra.txt: avra.1 + groff -man -Tascii avra.1 | ./strip-headers | col -bx > avra.txt + +#******************************************************************** + +disk: archive + mcopy -ovm avra.tar.gz a:avra.tgz + +archive: avra.tar.gz + +avra.tar.gz: $(ARCHFILES) + tar cvf avra.tar $(ARCHFILES) + gzip -9 -f avra.tar + +dist: avra-$(VERSION).tar.gz + +avra-$(VERSION).tar.gz: $(DISTFILES) + mkdir avra-$(VERSION) + cp $(DISTFILES) avra-$(VERSION)/ + tar cvf avra-$(VERSION).tar avra-$(VERSION)/* + gzip -9 -f avra-$(VERSION).tar + rm -r avra-$(VERSION) + +#******************************************************************** diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.linux b/src/mkutil/avra-0.8/SOURCE/Makefile.linux new file mode 100644 index 00000000..5a3e6176 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.linux @@ -0,0 +1,74 @@ +#******************************************************************** +# Makefile for gcc +#******************************************************************** + +CC = gcc +LD = gcc +CFLAGS = -Wall -O3 +LDFLAGS = -s + +SOURCES = avra.c device.c parser.c expr.c mnemonic.c directiv.c macro.c file.c map.c coff.c + +OBJECTS = $(SOURCES:.c=.o) + +OBJ_ALL = $(OBJECTS) args.o stdextra.o + +DISTFILES = *.c *.h README ChangeLog Makefile.* COPYING avra.1 avra.txt strip-headers TODO + +ARCHFILES = $(DISTFILES) + +BINFILES = avra README ChangeLog COPYING avra.1 avra.txt + +VERSION = 0.7 + +#******************************************************************** + +all: avra + +install: avra + cp avra /usr/local/bin + cp avra.1 /usr/local/man/man1 + chmod +r /usr/local/man/man1/avra.1 + +clean: + rm -f avra *.o *.p *~ + +avra: $(OBJ_ALL) + $(LD) -o avra $(OBJ_ALL) $(LDFLAGS) + +args.o: args.c misc.h args.h +avra.o: avra.c misc.h args.h avra.h device.h +device.o: device.c misc.h avra.h device.h +directiv.o: directiv.c misc.h args.h avra.h device.h +expr.o: expr.c misc.h avra.h +file.o: file.c misc.h avra.h +macro.o: macro.c misc.h args.h avra.h +mnemonic.o: mnemonic.c misc.h avra.h device.h +parser.o: parser.c misc.h avra.h +stdextra.o: stdextra.c misc.h +coff.o: coff.c coff.h + +avra.txt: avra.1 + groff -man -Tascii avra.1 | ./strip-headers | col -bx > avra.txt + +#******************************************************************** + +disk: archive + mcopy -ovm avra.tar.gz a:avra.tgz + +archive: avra.tar.gz + +avra.tar.gz: $(ARCHFILES) + tar cvf avra.tar $(ARCHFILES) + gzip -9 -f avra.tar + +dist: avra-$(VERSION).tar.gz + +avra-$(VERSION).tar.gz: $(DISTFILES) + mkdir avra-$(VERSION) + cp $(DISTFILES) avra-$(VERSION)/ + tar cvf avra-$(VERSION).tar avra-$(VERSION)/* + gzip -9 -f avra-$(VERSION).tar + rm -r avra-$(VERSION) + +#******************************************************************** diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.win b/src/mkutil/avra-0.8/SOURCE/Makefile.win new file mode 100644 index 00000000..e801c031 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.win @@ -0,0 +1,58 @@ +# Project: Console App +# Makefile created by Dev-C++ 4.9.6.0 + +CC = gcc.exe +WINDRES = windres.exe +RES = +OBJ = avra.o args.o stdextra.o device.o directiv.o expr.o file.o map.o mnemonic.o parser.o coff.o macro.o $(RES) +LIBS = -L"D:/system/Dev-Cpp/lib" +INCS = -I"D:/system/Dev-Cpp/include" +BIN = avra.exe +CFLAGS = $(INCS) -pg -g3 + +.PHONY: all all-before all-after clean clean-custom + +all: all-before avra.exe all-after + + +clean: clean-custom + rm -f $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CC) $(OBJ) -o "avra.exe" $(LIBS) $(CFLAGS) + +avra.o: avra.c + $(CC) -c avra.c -o avra.o $(CFLAGS) + +args.o: args.c + $(CC) -c args.c -o args.o $(CFLAGS) + +stdextra.o: stdextra.c + $(CC) -c stdextra.c -o stdextra.o $(CFLAGS) + +device.o: device.c + $(CC) -c device.c -o device.o $(CFLAGS) + +directiv.o: directiv.c + $(CC) -c directiv.c -o directiv.o $(CFLAGS) + +expr.o: expr.c + $(CC) -c expr.c -o expr.o $(CFLAGS) + +file.o: file.c + $(CC) -c file.c -o file.o $(CFLAGS) + +map.o: map.c + $(CC) -c map.c -o map.o $(CFLAGS) + +mnemonic.o: mnemonic.c + $(CC) -c mnemonic.c -o mnemonic.o $(CFLAGS) + +parser.o: parser.c + $(CC) -c parser.c -o parser.o $(CFLAGS) + +coff.o: coff.c + $(CC) -c coff.c -o coff.o $(CFLAGS) + +macro.o: macro.c + $(CC) -c macro.c -o macro.o $(CFLAGS) diff --git a/src/mkutil/avra-0.8/SOURCE/Makefile.win32.mvc b/src/mkutil/avra-0.8/SOURCE/Makefile.win32.mvc new file mode 100644 index 00000000..1f1600fd --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/Makefile.win32.mvc @@ -0,0 +1,47 @@ +#******************************************************************** +# Makefile for Mickeysoft visual c++ +#******************************************************************** + +CC = cl -Zi +LD = link "/libpath:c:\Program Files\Microsoft Visual Studio\VC98\Lib" +CFLAGS = -nologo -Ox +LDFLAGS = -nologo + +SOURCES = avra.c device.c parser.c expr.c mnemonic.c directiv.c macro.c file.c map.c coff.c + +OBJECTS = $(SOURCES:.c=.obj) + +OBJ_ALL = $(OBJECTS) args.obj stdextra.obj + +#******************************************************************** + +all: avra.exe + +install: avra.exe + copy avra.exe ..\..\..\bin\ + +clean: + del *.obj + del avra.exe + +avra.exe: $(OBJ_ALL) + $(LD) $(OBJ_ALL) $(LDFLAGS) + +args.obj: args.c misc.h args.h +avra.obj: avra.c misc.h args.h avra.h device.h +device.obj: device.c misc.h avra.h device.h +directiv.obj: directiv.c misc.h args.h avra.h device.h +expr.obj: expr.c misc.h avra.h +file.obj: file.c misc.h avra.h +macro.obj: macro.c misc.h args.h avra.h +mnemonic.obj: mnemonic.c misc.h avra.h device.h +parser.obj: parser.c misc.h avra.h +stdextra.obj: stdextra.c misc.h +coff.obj: coff.c coff.h + +#******************************************************************** + + +#******************************************************************** + + diff --git a/src/mkutil/avra-0.8/SOURCE/args.c b/src/mkutil/avra-0.8/SOURCE/args.c new file mode 100644 index 00000000..e8004d2b --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/args.c @@ -0,0 +1,240 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include + +#include "misc.h" +#include "args.h" + + +struct args *alloc_args(int arg_count) + { + struct args *args; + + args = malloc(sizeof(struct args)); + if(args) + { + args->arg = malloc(sizeof(struct arg) * arg_count); + if(args->arg) + { + args->count = arg_count; + args->first_data = NULL; + return(args); + } + free(args); + } + printf("Error: Unable to allocate memory\n"); + return(NULL); + } + + + +int read_args(struct args *args, int argc, char *argv[]) + { + int i, j, k, ok = True, i_old; + struct data_list **last_data; + + args->first_data = NULL; + last_data = &args->first_data; + for(i = 1; (i < argc) && ok; i++) + { + + + if(argv[i][0] == '-') + { + last_data = &args->first_data; + if(argv[i][1] == '-') + { + j = 0; + while((args->arg[j].longarg ? strcmp(&argv[i][2], args->arg[j].longarg) : True) && (j != args->count)) + j++; + if(j == args->count) + { + printf("Error: Unknown option: %s\n", argv[i] ); + ok = False; + } + else + { + switch(args->arg[j].type) + { + case ARGTYPE_STRING: + case ARGTYPE_STRING_MULTISINGLE: + if((i + 1) == argc) + { + printf("Error: No argument supplied with option: %s\n", argv[i]); + ok = False; + } + else if(args->arg[j].type != ARGTYPE_STRING_MULTISINGLE) + args->arg[j].data = argv[++i]; + else + ok = add_arg((struct data_list **)&args->arg[j].data, argv[++i]); + break; + case ARGTYPE_BOOLEAN: + args->arg[j].data = (char *)True; + break; + case ARGTYPE_STRING_MULTI: + last_data = (struct data_list **)&args->arg[j].data; + break; + //added by TW + //case ARGTYPE_CHAR_ATTACHED: + // args->arg[j].data = argv[i]; + //break; + } + } + } + else + { + // ToDo: Sjekk for enkel - + for(k = 1, i_old = i; (argv[i][k] != '\0') && ok && (i == i_old); k++) + { + j = 0; + while((argv[i][k] != args->arg[j].letter) && (j != args->count)) + j++; + if(j == args->count) + { + printf("Error: Unknown option: -%c\n", argv[i][k]); + ok = False; + } + else + { + switch(args->arg[j].type) + { + case ARGTYPE_STRING: + case ARGTYPE_STRING_MULTISINGLE: + if(argv[i][k + 1] != '\0') + { + printf("Error: Option -%c must be followed by it's argument\n", argv[i][k]); + ok = False; + } + else + { + if((i + 1) == argc) + { + printf("Error: No argument supplied with option: -%c\n", argv[i][k]); + ok = False; + } + else if(args->arg[j].type != ARGTYPE_STRING_MULTISINGLE) + args->arg[j].data = argv[++i]; + else + ok = add_arg((struct data_list **)&args->arg[j].data, argv[++i]); + } + break; + case ARGTYPE_BOOLEAN: + args->arg[j].data = (char *)True; + break; + case ARGTYPE_STRING_MULTI: + last_data = (struct data_list **)&args->arg[j].data; + break; + //added by TW + case ARGTYPE_CHAR_ATTACHED: + if((i + 1) == argc) + { + printf("Error: missing arguments: asm file"); + ok = False; + } + else + { + switch(argv[i][++k]) + { + case 'O': args->arg[j].data = (char *)AVRSTUDIO; + break; + case 'G': args->arg[j].data = (char *)GENERIC; + break; + case 'I': args->arg[j].data = (char *)INTEL; + break; + case 'M': args->arg[j].data = (char *)MOTOROLA; + break; + default: printf("Error: wrong file type '%c'",argv[i][2]); + ok = False; + } + } + } + } + } + } + } + else + ok = add_arg(last_data, argv[i]); + } + return(ok); + } + + +int add_arg(struct data_list **last_data, char *argv) + { + struct data_list *data; + + while(*last_data) last_data = &((*last_data)->next); + data = malloc(sizeof(struct data_list)); + if(data) + { + data->next = NULL; + data->data = argv; + *last_data = data; + last_data = &data->next; + } + else + { + printf("Error: Unable to allocate memory\n"); + return(False); + } + return(True); + } + + +void free_args(struct args *args) + { + int i; + struct data_list *data, *temp; + + for(data = args->first_data; data;) + { + temp = data; + data = data->next; + free(temp); + } + for(i = 0; i != args->count; i++) + if((args->arg[i].type == ARGTYPE_STRING_MULTI) + || (args->arg[i].type == ARGTYPE_STRING_MULTISINGLE)) + for(data = args->arg[i].data; data;) + { + temp = data; + data = data->next; + free(temp); + } + free(args); + } + + +void define_arg(struct args *args, int index, int type, char letter, char *longarg, void *def_value) + { + args->arg[index].type = type; + args->arg[index].letter = letter; + args->arg[index].longarg = longarg; + args->arg[index].data = def_value; + } diff --git a/src/mkutil/avra-0.8/SOURCE/args.h b/src/mkutil/avra-0.8/SOURCE/args.h new file mode 100644 index 00000000..4bdc0c6d --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/args.h @@ -0,0 +1,65 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +enum + { + ARGTYPE_BOOLEAN = 0, /* boolean Value (0 = False) */ + ARGTYPE_STRING, /* Stringpointer in Data */ + ARGTYPE_STRING_MULTI, /* List of strings in Data */ + ARGTYPE_STRING_MULTISINGLE, /* List of strings in Data. requires an option for each elemtent */ + //added by TW + ARGTYPE_CHAR_ATTACHED + }; + +#define GET_ARG(args,argnum) (args->arg[argnum].data) +#define SET_ARG(args,argnum,value) (args->arg[argnum].data = (void *)value) + +struct args + { + struct arg *arg; + int count; + struct data_list *first_data; + }; + +struct arg + { + int type; + char letter; + char *longarg; + void *data; + }; + +struct data_list + { + struct data_list *next; + void *data; + }; + +struct args *alloc_args(int arg_count); +int read_args(struct args *args, int argc, char *argv[]); +int add_arg(struct data_list **last_data, char *argv); +void free_args(struct args *args); +void define_arg(struct args *args, int index, int type, char letter, char *longarg, void *def_value); diff --git a/src/mkutil/avra-0.8/SOURCE/avra.c b/src/mkutil/avra-0.8/SOURCE/avra.c new file mode 100644 index 00000000..408c4368 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/avra.c @@ -0,0 +1,333 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include + +#include "misc.h" +#include "args.h" +#include "avra.h" +#include "device.h" + +const char *title = "AVRA: advanced AVR macro assembler version %d.%d (%s)\n" + "Copyright (C) 2002-2003 Tobias Weber\n" + "Copyright (C) 1998-2001 Jon Anders Haugum\n" + "\n" + " AVRA is a replacement for the ATMEL AVR-Assembler 'AVRASM32.EXE'\n" + "\n" + " The words ATMEL and AVR are registered to Atmel Corp.\n" + " AVRA comes with NO WARRANTY, to the extent permitted by law.\n" + " You may redistribute copies of avra under the terms\n" + " of the GNU General Public License.\n" + " For more information about these matters, see the files named COPYING.\n" + "\n"; + +const char *usage = + "usage: AVRA [--define [=]] [--includedir ] [--listmac]\n" + " [--max_errors ] [--coff] [--devices] [--version]\n" + " [-h] [--help] general help\n" + " [-f][O|G|I|M] output file type\n" + " \n" + "\n" + " --define, -D : Define symbol.\n" + " --includedir, -I : Additional include dirs.\n" + " --listmac : List macro expansion in listfile.\n" + " --max_errors : Maximum number of errors before exit (default: 10)\n" + " --coff : Produce COFF output file for debugging with Atmel AVR Studio.\n" + " --devices : List out supported devices.\n" + " --version : Version information.\n" + " --help, -h : This help text.\n" + "\n" + "Don't bother about the command line options. Some may not work properly in V0.8\n" + "Just replace the AVRASM32.EXE in your AVRStudio directories. This Version has " + "been tested with AVRStudio V4.06 and it was 'almost' bugfree ;-)\n" + "\n" + "Report bugs to tobiw@suprafluid.com\n" + " or jonah@omegav.ntnu.no\n"; + + +int main(int argc, char *argv[]) + { + int show_usage = False; + struct prog_info *pi; + struct args *args; + + printf(title, VERSION, REVISION, DATESTRING); + + args = alloc_args(ARG_COUNT); + if(args) + { + define_arg(args, ARG_DEFINE, ARGTYPE_STRING_MULTISINGLE, 'D', "define", NULL); + define_arg(args, ARG_INCLUDEDIR, ARGTYPE_STRING_MULTISINGLE, 'I', "includedir", NULL); + define_arg(args, ARG_LISTMAC, ARGTYPE_BOOLEAN, 0, "listmac", "1"); + define_arg(args, ARG_MAX_ERRORS, ARGTYPE_STRING, 0, "max_errors", "10"); + define_arg(args, ARG_COFF, ARGTYPE_BOOLEAN, 0, "coff", "1"); + define_arg(args, ARG_DEVICES, ARGTYPE_BOOLEAN, 0, "devices", False); + define_arg(args, ARG_VER, ARGTYPE_BOOLEAN, 0, "version", False); + define_arg(args, ARG_HELP, ARGTYPE_BOOLEAN, 'h', "help", False); + //TW added + define_arg(args, ARG_WRAP, ARGTYPE_BOOLEAN, 'w', "wrap", False); + define_arg(args, ARG_FILEFORMAT, ARGTYPE_CHAR_ATTACHED, 'f', "filetype", "0"); + define_arg(args, ARG_LISTFILE, ARGTYPE_STRING, 'l', "listfile", False); + define_arg(args, ARG_OUTFILE, ARGTYPE_STRING, 'o', "outfile", False); + define_arg(args, ARG_MAPFILE, ARGTYPE_STRING, 'm', "mapfile", False); + define_arg(args, ARG_DEBUGFILE, ARGTYPE_STRING, 'd', "debugfile", False); + define_arg(args, ARG_EEPFILE, ARGTYPE_STRING, 'e', "eepfile", False); + + if(read_args(args, argc, argv)) + { + if(!GET_ARG(args, ARG_HELP) && (argc != 1)) + { + if(!GET_ARG(args, ARG_VER)) + { + if(!GET_ARG(args, ARG_DEVICES)) + { + pi = get_pi(args); + if(pi) + { + assemble(pi); + free_pi(pi); + } + } + else + list_devices(); + } + //else + } + else + show_usage = True; + } + free_args(args); + } + else + { + show_usage = True; + printf("\n"); + } + if(show_usage) + { +/* if(argc == 1) + { + printf(title, VERSION, REVISION, DATESTRING); + printf("\n"); + }*/ + printf("%s", usage); + } + exit(EXIT_SUCCESS); + } + + +void assemble(struct prog_info *pi) + { + if(pi->args->first_data) + { + printf("Pass 1... "); + if(!load_arg_defines(pi)) + return; + predef_dev(pi); + if(parse_file(pi, (char *)pi->args->first_data->data, PASS_1)) + { + if(pi->error_count == 0) + { + prepare_second_pass(pi); + if(!load_arg_defines(pi)) + return; + predef_dev(pi); + if(open_out_files(pi, pi->args->first_data->data)) + { + printf("done\nPass 2... "); + parse_file(pi, (char *)pi->args->first_data->data, PASS_2); + printf("done\n\n"); + + if(GET_ARG(pi->args, ARG_COFF) && (pi->error_count == 0)) + write_coff_file(pi); + write_map_file(pi); + close_out_files(pi); + if(pi->error_count) + printf("\nAssembly aborted with %d errors and %d warnings.\n", pi->error_count, pi->warning_count); + else if(pi->warning_count) + printf("\nAssembly complete with no errors (%d warnings).\n", pi->warning_count); + else + printf("\nAssembly complete with no errors.\n"); + } + } + } + } + else + printf("Error: You need to specify a file to assemble\n"); + } + + +int load_arg_defines(struct prog_info *pi) + { + int i; + char *expr, buff[256]; + struct data_list *define; + struct label *label; + + for(define = GET_ARG(pi->args, ARG_DEFINE); define; define = define->next) + { + strcpy(buff, define->data); + expr = get_next_token(buff, TERM_EQUAL); + if(expr) + { + if(!get_expr(pi, expr, &i)) + return(False); + } + else + i = 1; + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, buff)) + { + printf("Error: Can't define symbol %s twice\n", buff); + return(False); + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_constant) + pi->last_constant->next = label; + else + pi->first_constant = label; + pi->last_constant = label; + label->name = malloc(strlen(buff) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, buff); + label->value = i; + } + return(True); + } + + +struct prog_info *get_pi(struct args *args) + { + struct prog_info *pi; + + pi = (struct prog_info *)calloc(1, sizeof(struct prog_info)); + if(pi) + { + pi->args = args; + pi->device = get_device(pi,NULL); + pi->list_on = True; + pi->segment = SEGMENT_CODE; + pi->dseg_addr = DSEG_START; + pi->max_errors = atoi(GET_ARG(args, ARG_MAX_ERRORS)); + return(pi); + } + return(NULL); + } + + +void free_pi(struct prog_info *pi) + { + free(pi); + } + + +void prepare_second_pass(struct prog_info *pi) + { + struct def *def, *temp_def; + struct label *label, *temp_label; + + pi->segment = SEGMENT_CODE; + pi->cseg_addr = 0; + pi->dseg_addr = DSEG_START; + pi->eseg_addr = 0; + + for(def = pi->first_def; def;) + { + temp_def = def; + def = def->next; + free(temp_def->name); + free(temp_def); + } + pi->first_def = NULL; + pi->last_def = NULL; + + for(label = pi->first_constant; label;) + { + temp_label = label; + label = label->next; + free(temp_label->name); + free(temp_label); + } + pi->first_constant = NULL; + pi->last_constant = NULL; + + for(label = pi->first_variable; label;) + { + temp_label = label; + label = label->next; + free(temp_label->name); + free(temp_label); + } + pi->first_variable = NULL; + pi->last_variable = NULL; + } + + +void print_msg(struct prog_info *pi, int type, char *fmt, ... ) + { + va_list args; + + if(type == MSGTYPE_OUT_OF_MEM) + fprintf(stderr, "Error: Unable to allocate memory!\n"); + else + { + va_start(args, fmt); + fprintf(stderr, "%s(%d) : ", pi->fi->include_file->name, pi->fi->line_number); + + switch(type) + { + case MSGTYPE_ERROR: + pi->error_count++; + fprintf(stderr, "error : "); + break; + case MSGTYPE_WARNING: + pi->warning_count++; + fprintf(stderr, "warning : "); + break; + case MSGTYPE_MESSAGE: + break; + } + + if(pi->macro_call) + fprintf(stderr, "[Macro: %s: %d:] ", pi->macro_call->macro->include_file->name, pi->macro_call->line_index + pi->macro_call->macro->first_line_number); + + vfprintf(stderr, fmt, args); + fprintf(stderr, "\n"); + va_end(args); + } + } diff --git a/src/mkutil/avra-0.8/SOURCE/avra.dev b/src/mkutil/avra-0.8/SOURCE/avra.dev new file mode 100644 index 00000000..60911d12 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/avra.dev @@ -0,0 +1,179 @@ +[Project] +FileName=avra.dev +Name=Console App +UnitCount=15 +Type=1 +Ver=1 +ObjFiles= +Includes= +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Resources= +Compiler= +Linker= +IsCpp=0 +Icon= +ExeOutput= +ObjectOutput= +OverrideOutput=0 +OverrideOutputName=AVRASM32.exe +Folders= +CommandLine= +Focused=14 +Order=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + +[Unit1] +FileName=avra.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Views] +ProjectView=1 + +[Unit2] +FileName=args.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit3] +FileName=stdextra.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit4] +FileName=device.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit5] +FileName=directiv.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit6] +FileName=expr.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit7] +FileName=file.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit9] +FileName=mnemonic.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit10] +FileName=parser.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit11] +FileName=coff.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit12] +FileName=macro.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit13] +FileName=misc.h +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit8] +FileName=map.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit14] +FileName=args.h +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit15] +FileName=avra.h +Open=1 +Folder= +Top=1 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + diff --git a/src/mkutil/avra-0.8/SOURCE/avra.exe b/src/mkutil/avra-0.8/SOURCE/avra.exe new file mode 100644 index 00000000..5192df0b Binary files /dev/null and b/src/mkutil/avra-0.8/SOURCE/avra.exe differ diff --git a/src/mkutil/avra-0.8/SOURCE/avra.h b/src/mkutil/avra-0.8/SOURCE/avra.h new file mode 100644 index 00000000..464fc076 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/avra.h @@ -0,0 +1,295 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include + +#define VERSION 0 +#define REVISION 8 +#define DATESTRING "31 January 2003" + +#define IS_HOR_SPACE(x) ((x == ' ') || (x == 9)) +#define IS_LABEL(x) (isalnum(x) || (x == '_')) +#define IS_END(x) ((x == ';') || (x == 10) || (x == 13)|| (x == '\0')) +#define IS_ENDLINE(x) ( (x == 10) || (x == 13)|| (x == '\0')) + +#define LINEBUFFER_LENGTH 256 + +//added by TW +#define MAX_MACRO_ARGS 10 + +#define DSEG_START 0x60 + +/* Option enumeration */ +enum + { + ARG_DEFINE = 0, /* --define, -D */ + ARG_INCLUDEDIR, /* --includedir, -I */ + ARG_LISTMAC, /* --listmac */ + ARG_MAX_ERRORS, /* --max_errors */ + ARG_COFF, /* --coff */ + ARG_DEVICES, /* --devices */ + ARG_VER, /* --version */ + ARG_HELP, /* --help, -h */ + //added by TW + ARG_WRAP, /* --wrap */ + ARG_FILEFORMAT, /* --filetype */ + ARG_LISTFILE, /* --listfile */ + ARG_OUTFILE, /* --outfile */ + ARG_MAPFILE, /* --mapfile */ + ARG_DEBUGFILE, /* --debugfile */ + ARG_EEPFILE, /* --eepfile */ + ARG_COUNT + }; + +enum + { + MSGTYPE_ERROR = 0, + MSGTYPE_WARNING, + MSGTYPE_MESSAGE, + MSGTYPE_OUT_OF_MEM + }; + +enum + { + PASS_1 = 0, + PASS_2 + }; + +enum + { + SEGMENT_CODE = 0, + SEGMENT_DATA, + SEGMENT_EEPROM + }; + +enum + { + TERM_END = 0, + TERM_SPACE, + TERM_COMMA, + TERM_EQUAL, + TERM_DASH, + TERM_DOUBLEQUOTE, + TERM_COLON + }; + +/* Structures */ + +struct prog_info + { + struct args *args; + struct device *device; + struct file_info *fi; + struct macro_call *macro_call; + struct macro_line *macro_line; + FILE *list_file; + int list_on; + char *list_line; + FILE *obj_file; + struct hex_file_info *hfi; + struct hex_file_info *eep_hfi; + int segment; + int cseg_addr; + int dseg_addr; + int eseg_addr; + int cseg_count; + int dseg_count; + int eseg_count; + int error_count; + int max_errors; + int warning_count; + struct include_file *last_include_file; + struct include_file *first_include_file; + struct def *first_def; + struct def *last_def; + struct label *first_label; + struct label *last_label; + struct label *first_constant; + struct label *last_constant; + struct label *first_variable; + struct label *last_variable; + struct macro *first_macro; + struct macro *last_macro; + struct macro_call *first_macro_call; + struct macro_call *last_macro_call; + int conditional_depth; + /* coff additions */ + FILE *coff_file; + }; + +struct file_info + { + FILE *fp; + struct include_file *include_file; + char buff[LINEBUFFER_LENGTH]; + char scratch[LINEBUFFER_LENGTH]; + int line_number; + int exit_file; + struct label *label; + }; + +struct hex_file_info + { + FILE *fp; + int count; + int linestart_addr; + int segment; + unsigned char hex_line[16]; + }; + +struct include_file + { + struct include_file *next; + char *name; + int num; + }; + +struct def + { + struct def *next; + char *name; + int reg; + }; + +struct label + { + struct label *next; + char *name; + int value; + }; + +struct macro + { + struct macro *next; + char *name; + struct include_file *include_file; + int first_line_number; + struct macro_line *first_macro_line; + }; + +struct macro_line + { + struct macro_line *next; + char *line; + }; + +struct macro_call + { + struct macro_call *next; + int line_number; + struct include_file *include_file; + struct macro_call *prev_on_stack; + struct macro *macro; + int line_index; + int prev_line_index; + int nest_level; + struct label *first_label; + struct label *last_label; + }; + +/* Prototypes */ +/* avra.c */ +void assemble(struct prog_info *pi); +int load_arg_defines(struct prog_info *pi); +struct prog_info *get_pi(struct args *args); +void free_pi(struct prog_info *pi); +void prepare_second_pass(struct prog_info *pi); +void print_msg(struct prog_info *pi, int type, char *fmt, ... ); + +/* parser.c */ +int parse_file(struct prog_info *pi, char *filename, int pass); +int parse_line(struct prog_info *pi, char *line, int pass); +char *get_next_token(char *scratch, int term); + +/* expr.c */ +int get_expr(struct prog_info *pi, char *data, int *value); +int get_operator(char *op); +int test_operator_at_precedence(int operator, int precedence); +int calc(struct prog_info *pi, int left, int operator, int right); +int get_function(char *function); +int do_function(int function, int value); +int log2(int value); +int get_symbol(struct prog_info *pi, char *label_name, int *data); +int par_length(char *data); + +/* mnemonic.c */ +int parse_mnemonic(struct prog_info *pi, int pass); +int get_mnemonic_type(char *mnemonic); +int get_register(struct prog_info *pi, char *data); +int get_bitnum(struct prog_info *pi, char *data, int *ret); +int get_indirect(struct prog_info *pi, char *operand); +int is_supported(struct prog_info *pi, char *name); +int count_supported_instructions(int flags); + +/* directiv.c */ +int parse_directive(struct prog_info *pi, int pass); +int get_directive_type(char *directive); +char *term_string(struct prog_info *pi, char *string); +int parse_db(struct prog_info *pi, char *next, int pass); +void write_db(struct prog_info *pi, char byte, char *prev, int count, int pass); +int spool_conditional(struct prog_info *pi, int only_endif); +int check_conditional(struct prog_info *pi, char *buff, int *current_depth, int *do_next, int only_endif); +int test_include(const char *filename); + +/* macro.c */ +int read_macro(struct prog_info *pi, char *name, int pass); +struct macro *get_macro(struct prog_info *pi, char *name); +int expand_macro(struct prog_info *pi, struct macro *macro, char *rest_line, int pass); + +/* file.c */ +int open_out_files(struct prog_info *pi, char *filename); +void close_out_files(struct prog_info *pi); +struct hex_file_info *open_hex_file(char *filename); +void close_hex_file(struct hex_file_info *hfi); +void write_ee_byte(struct prog_info *pi, int address, unsigned char data); +void write_prog_word(struct prog_info *pi, int address, int data); +void do_hex_line(struct hex_file_info *hfi); +FILE *open_obj_file(struct prog_info *pi, char *filename); +void close_obj_file(struct prog_info *pi, FILE *fp); +void write_obj_record(struct prog_info *pi, int address, int data); + +/* map.c */ +void write_map_file(struct prog_info *pi); +char *Space(char *n); + +/* stdextra.c */ +char *nocase_strcmp(char *s, char *t); +char *nocase_strncmp(char *s, char *t, int n); +char *nocase_strstr(char *s, char *t); +int atox(char *s); +int atoi_n(char *s, int n); +int atox_n(char *s, int n); +char *my_strlwr(char *in); +char *my_strupr(char *in); + +/* coff.c */ +FILE *open_coff_file(struct prog_info *pi, char *filename); +void write_coff_file(struct prog_info *pi); +void write_coff_eeprom( struct prog_info *pi, int address, unsigned char data); +void write_coff_program( struct prog_info *pi, int address, unsigned int data); +void close_coff_file(struct prog_info *pi, FILE *fp); +int parse_stabs( struct prog_info *pi, char *p, int pass ); +int parse_stabn( struct prog_info *pi, char *p, int pass ); diff --git a/src/mkutil/avra-0.8/SOURCE/coff.c b/src/mkutil/avra-0.8/SOURCE/coff.c new file mode 100644 index 00000000..b9332b8c --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/coff.c @@ -0,0 +1,2074 @@ +// +// coff.c - Common Object File Format (COFF) support +// +// This file was developed for the avra assembler in order to produce COFF output files +// for use with the Atmel AVR Studio. The Lean C Compiler (LCC) debugging stabs +// output was used as input to the assembler. The information used to develop this file +// was obtained from various sources on the Internet, most notably, the Free Software Foundation, +// The "stabs" debug format, ??? Chapter 7: Common Object File Format (COFF), +// +// This software has absolutely no warrantee! The money you paid for this will be +// promptly refunded if not fully satisfied. +// +// Beta release 1/20/2000 by Bob Harris +// +// This software has not been fully tested and probably has a few software deficiencies. +// Some software support may be possible by sending a problem description report to +// rth@mclean.sparta.com + +#include +#include +#include +#include +#include + +#include "misc.h" +#include "avra.h" +#include "args.h" + +#include "coff.h" +#include "device.h" /* device flash and eeprom size */ + + +struct FundamentalType { + + char *pString; + int Type; + int Size; +}; + +struct FundamentalType FundamentalTypes[] = { + "null", T_NULL, 0, + "void", T_VOID, 0, + "char", T_CHAR, 1, + "short", T_SHORT, 1, + "int", T_INT, 1, + "long", T_LONG, 2, + "float", T_FLOAT, 4, + "double", T_DOUBLE, 4, + "struct", T_STRUCT, 0, + "union", T_UNION, 0, + "enum", T_ENUM, 0, + "moe", T_MOE, 0, + "unsigned char", T_UCHAR, 1, + "unsigned short", T_USHORT, 1, + "unsigned int", T_UINT, 1, + "unsigned long", T_ULONG, 2, + "long double", T_LNGDBL, 2, + "long long int", T_LONG, 2, + "long int", T_LONG, 2, + "unsigned long long", T_ULONG, 2, + "signed char", T_CHAR, 1, + 0, 0 +}; + +struct coff_info *ci; + +/****************************************************************************************/ + +FILE *open_coff_file(struct prog_info *pi, char *filename){ + + int ok /*, i*/; + FILE *fp; + //unsigned long *pu4; + char*p; + + + ci = calloc( 1, sizeof(struct coff_info) ); + if ( !ci ) + return( 0 ); + + ok = True; + /* default values */ + ci->CurrentFileNumber = 0; + ci->pRomMemory = 0; + ci->pEEPRomMemory = 0; + ci->MaxRomAddress = 0; + ci->MaxEepromAddress = 0; + ci->NeedLineNumberFixup = 0; + ci->GlobalStartAddress = -1; + ci->GlobalEndAddress = 0; + + /* Linked lists start out at zero */ + InitializeList( &ci->ListOfSectionHeaders ); + InitializeList( &ci->ListOfRawData ); + InitializeList( &ci->ListOfRelocations ); + InitializeList( &ci->ListOfLineNumbers ); + InitializeList( &ci->ListOfSymbols ); + InitializeList( &ci->ListOfGlobals ); + InitializeList( &ci->ListOfSpecials ); + InitializeList( &ci->ListOfUndefined ); + InitializeList( &ci->ListOfStrings ); + InitializeList( &ci->ListOfTypes ); + InitializeList( &ci->ListOfSplitLines ); + + /* add two default sections to SectionHeaders */ + if ( !AllocateListObject( &ci->ListOfSectionHeaders, sizeof(struct external_scnhdr) ) || + !AllocateListObject( &ci->ListOfSectionHeaders, sizeof(struct external_scnhdr) ) ) { + + fprintf(stderr, "\nOut of memory allocating section headers!"); + return( 0 ); + } + + /* add to string table */ + p = (char *)AllocateListObject( &ci->ListOfStrings, 4 ); + if ( !p ) { + fprintf(stderr, "\nOut of memory allocating string table space!"); + return( 0 ); + } + + /* Allocate space for binary output into ROM, and EEPROM memory buffers for COFF output */ + /* ASSUMES ci->device is accurate */ + if ( (ci->pRomMemory = AllocateListObject( &ci->ListOfRawData, pi->device->flash_size * 2 ) ) != 0) { + if ( (ci->pEEPRomMemory = AllocateListObject( &ci->ListOfRawData, pi->device->eeprom_size )) != 0) { + ok = True; /* only true if both buffers are properly allocated */ + /* now fill them with 0xff's to simulate flash erasure */ + memset( (void *)ci->pRomMemory, 0xff, pi->device->flash_size * 2 ); + memset( ( void *)ci->pEEPRomMemory, 0xff, pi->device->eeprom_size ); + } + } + if ( ok != True ) + return( 0 ); + + fp = fopen(filename,"wb"); + if ( fp == NULL ) { + fprintf(stderr,"Error: cannot write coff file\n"); + return( fp ); + } + /* simulate void type .stabs void:t15=r1;*/ + stab_add_local_type( "void", "15=r1;0;0;" ); + + return( fp ); +} + +/****************************************************************************************/ +void write_coff_file(struct prog_info *pi){ + + //FILE *fp; + //struct label *label; + char /* File[256],*/*p; + struct external_scnhdr *pSectionHdr; + struct syment *pEntry; + union auxent *pAux; + unsigned long *plong; + int NumberOfSymbols, SymbolIndex, LastFileIndex, LastFunctionIndex, LastFunctionAddress; + LISTNODE *pNode; + int LinesOffset, SymbolsOffset, StringsOffset, RawOffset; + struct lineno *pLine; + + /* add two special sections */ + /* one for .text */ + if ( ( pEntry = (struct syment*)AllocateTwoListObjects( &ci->ListOfSpecials, sizeof(struct syment) * 2 ) ) == 0 ) { + fprintf(stderr, "\nOut of memory allocating special headers for .text!"); + return; + } + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".text" ); + pEntry->n_value = 0; + pEntry->n_scnum = 1; + pEntry->n_type = 0; + pEntry->n_sclass = C_STAT; + pEntry->n_numaux = 1; + pEntry++; + pAux = (union auxent *)pEntry; + pAux->x_scn.x_scnlen = ci->MaxRomAddress + 2; + pAux->x_scn.x_nreloc = 0; + pAux->x_scn.x_nlinno = ci->ListOfLineNumbers.TotalItems; + /* one for .bss */ + if ( ( pEntry = (struct syment*)AllocateTwoListObjects( &ci->ListOfSpecials, sizeof(struct syment) * 2 ) ) == 0 ) { + fprintf(stderr, "\nOut of memory allocating special header for .bss!"); + return; + } + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".bss" ); + if ( ci->GlobalStartAddress == -1 ) { + ci->GlobalEndAddress = ci->GlobalStartAddress = 0x60; + } + pEntry->n_value = ci->GlobalStartAddress; + pEntry->n_scnum = 2; + pEntry->n_type = 0; + pEntry->n_sclass = C_STAT; + pEntry->n_numaux = 1; + pEntry++; + pAux = (union auxent *)pEntry; + pAux->x_scn.x_scnlen = 0; /* we don't store any data here */ + pAux->x_scn.x_nreloc = 0; + pAux->x_scn.x_nlinno = 0; + + /* one more for .data - eeprom ??? */ + + /* Calculate common offsets into the file */ + RawOffset = sizeof(struct external_filehdr) + ci->ListOfSectionHeaders.TotalBytes; + LinesOffset = RawOffset + ci->MaxRomAddress + 2; /* ignore eeprom for now */ + SymbolsOffset = LinesOffset + ci->ListOfLineNumbers.TotalBytes; + StringsOffset = SymbolsOffset + ci->ListOfSymbols.TotalBytes + ci->ListOfSpecials.TotalBytes + ci->ListOfGlobals.TotalBytes; + + /* Clean up loose ends in string table */ + if ( !(plong = (unsigned long *)FindFirstListObject(&ci->ListOfStrings)) ) { + fprintf(stderr,"\nInternal error in string table!"); + return; + } + *plong = ci->ListOfStrings.TotalBytes; /* Size of string table */ + + /* Clean up loose ends in symbol table */ + + /* symbol table - Filename value - index to next .file or global symbol */ + /* The value of that symbol equals the symbol table entry index of the next .file symbol or .global */ + LastFunctionAddress = ci->MaxRomAddress; + NumberOfSymbols = ci->ListOfSymbols.TotalItems + ci->ListOfSpecials.TotalItems + ci->ListOfGlobals.TotalItems; + SymbolIndex = LastFileIndex = NumberOfSymbols; + LastFunctionIndex = 0; /* set to zero on last function */ + for ( pEntry = (struct syment *)FindLastListObject(&ci->ListOfSymbols); + pEntry != 0; + pEntry = (struct syment *)FindNextLastListObject(&ci->ListOfSymbols) ) { + + /* Search for .file entries designated by C_FILE */ + if ( pEntry->n_sclass == C_FILE ) { + pEntry->n_value = LastFileIndex; + LastFileIndex = SymbolIndex; /* save current index */ + } + /* Search for Function entries C_EXT */ + else if ( pEntry->n_sclass == C_EXT ) { + pEntry++; + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_fsize = LastFunctionAddress - pEntry->n_value; /* function updated size */ + pAux->x_sym.x_fcnary.x_fcn.x_lnnoptr += LinesOffset; + LastFunctionAddress = pEntry->n_value; + pAux->x_sym.x_fcnary.x_fcn.x_endndx = LastFunctionIndex; /* point to next function index */ + pAux->x_sym.x_tvndx = 0; /* ??? */ + LastFunctionIndex = SymbolIndex; + } else if ( (pEntry->n_sclass == C_FCN ) || ( pEntry->n_sclass == C_BLOCK) ) { + if ( pEntry->n_name[1] == 'b' ) { + /* .bf and .bb */ + pEntry++; + pAux = (union auxent *)pEntry; + pAux->x_sym.x_fcnary.x_fcn.x_endndx = LastFunctionIndex; + } + } + /* else do nothing */ + + /* update current symbol index */ + pNode = GetCurrentNode( &ci->ListOfSymbols ); + SymbolIndex -= ( pNode->Size / sizeof(struct syment) ); + } + + // File Header + ci->FileHeader.f_magic = MAGIC_NUMBER_AVR; + ci->FileHeader.f_nscns = 2; + ci->FileHeader.f_timdat = time( (time_t *)&ci->FileHeader.f_timdat); + ci->FileHeader.f_symptr = SymbolsOffset; + ci->FileHeader.f_nsyms = NumberOfSymbols; + ci->FileHeader.f_opthdr = 0; + ci->FileHeader.f_flags = 0xff; /*F_RELFLG;*/ /* No relocation information available */ + + /* write it out */ + if ( fwrite(&ci->FileHeader, 1, sizeof(struct external_filehdr), pi->coff_file ) != sizeof(struct external_filehdr) ) { + fprintf(stderr,"\nFile error writing header ...(disk full?)"); + return; + } + + // Optional Information + + // Section 1 Header + pSectionHdr = (struct external_scnhdr *)FindFirstListObject(&ci->ListOfSectionHeaders); + if ( !pSectionHdr ) { + fprintf(stderr, "\nInternal Coff error - cannot find section header .text!"); + return; + } + memset( &pSectionHdr->s_name[0], 0, sizeof(struct external_scnhdr) ); + strcpy( &pSectionHdr->s_name[0], ".text"); + pSectionHdr->s_paddr = 0; + pSectionHdr->s_vaddr = 0; + pSectionHdr->s_size = ci->MaxRomAddress + 2; /* remember the last instruction */ + pSectionHdr->s_scnptr = RawOffset; + pSectionHdr->s_relptr = 0; + pSectionHdr->s_lnnoptr = LinesOffset; + pSectionHdr->s_nreloc = 0; + pSectionHdr->s_nlnno = ci->ListOfLineNumbers.TotalBytes/sizeof(struct lineno); + pSectionHdr->s_flags = STYP_TEXT; + + /* write it out */ + if ( fwrite(&pSectionHdr->s_name[0], 1, sizeof(struct external_scnhdr), pi->coff_file ) != sizeof(struct external_scnhdr) ) { + fprintf(stderr,"\nFile error writing section header ...(disk full?)"); + return; + } + + // Section 2 Header + pSectionHdr = (struct external_scnhdr *)FindNextListObject(&ci->ListOfSectionHeaders); + if ( !pSectionHdr ) { + fprintf(stderr, "\nInternal Coff error - cannot find section header .bss!"); + return; + } + memset( &pSectionHdr->s_name[0], 0, sizeof(struct external_scnhdr) ); + strcpy( &pSectionHdr->s_name[0], ".bss"); + /* later expansion */ + pSectionHdr->s_paddr = ci->GlobalStartAddress; + pSectionHdr->s_vaddr = ci->GlobalStartAddress; + pSectionHdr->s_flags = STYP_DATA; /* seems it should be STYP_BSS */ + + /* write it out */ + if ( fwrite(&pSectionHdr->s_name[0], 1, sizeof(struct external_scnhdr), pi->coff_file ) != sizeof(struct external_scnhdr) ) { + fprintf(stderr,"\nFile error writing section header ...(disk full?)"); + return; + } + + /* Section N Header - .data or eeprom */ + + // Raw Data for Section 1 + if ( (p = (unsigned char *)FindFirstListObject(&ci->ListOfRawData) ) == 0 ) { + fprintf(stderr,"\nInternal error - unable to find binary data!"); + return; + } + + /* write it out */ + if ( fwrite( p, 1, ci->MaxRomAddress + 2, pi->coff_file ) != (size_t)(ci->MaxRomAddress + 2) ) { + fprintf(stderr,"\nFile error writing raw .text data ...(disk full?)"); + return; + } + // Raw data for section n + + // Relocation Info for section 1 + + // Relocation info for section n + + // Line numbers for section 1 + for ( pLine = (struct lineno *)FindFirstListObject( &ci->ListOfLineNumbers ); + pLine != 0; + pLine = (struct lineno *)FindNextListObject( &ci->ListOfLineNumbers ) ) { + + pNode = GetCurrentNode( &ci->ListOfLineNumbers ); + + /* write it out */ + if ( fwrite( pLine, 1, pNode->Size, pi->coff_file ) != pNode->Size ) { + fprintf(stderr,"\nFile error writing line numbers ...(disk full?)"); + return; + } + } + + + // Line numbers for section n + + // Symbol table + for ( pEntry = (struct syment *)FindFirstListObject( &ci->ListOfSymbols ); + pEntry != 0; + pEntry = (struct syment *)FindNextListObject( &ci->ListOfSymbols ) ) { + + pNode = GetCurrentNode( &ci->ListOfSymbols ); + + /* write it out */ + if ( fwrite( pEntry, 1, pNode->Size, pi->coff_file ) != pNode->Size ) { + fprintf(stderr,"\nFile error writing symbol table ...(disk full?)"); + return; + } + } + + // Symbol table of Globals + for ( pEntry = (struct syment *)FindFirstListObject( &ci->ListOfGlobals ); + pEntry != 0; + pEntry = (struct syment *)FindNextListObject( &ci->ListOfGlobals ) ) { + + pNode = GetCurrentNode( &ci->ListOfGlobals ); + + /* write it out */ + if ( fwrite( pEntry, 1, pNode->Size, pi->coff_file ) != pNode->Size ) { + fprintf(stderr,"\nFile error writing global symbols ...(disk full?)"); + return; + } + } + + /* Specials .text, .bss, .data */ + + for ( pEntry = (struct syment *)FindFirstListObject( &ci->ListOfSpecials ); + pEntry != 0; + pEntry = (struct syment *)FindNextListObject( &ci->ListOfSpecials ) ) { + + pNode = GetCurrentNode( &ci->ListOfSpecials ); + + /* write it out */ + if ( fwrite( pEntry, 1, pNode->Size, pi->coff_file ) != pNode->Size ) { + fprintf(stderr,"\nFile error writing special symbols ...(disk full?)"); + return; + } + } + + // String Table + for ( p = (char *)FindFirstListObject( &ci->ListOfStrings ); + p != 0; + p = (char *)FindNextListObject( &ci->ListOfStrings ) ) { + + pNode = GetCurrentNode( &ci->ListOfStrings ); + + /* write it out */ + if ( fwrite( p, 1, pNode->Size, pi->coff_file ) != pNode->Size ) { + fprintf(stderr,"\nFile error writing strings data ...(disk full?)"); + return; + } + } + + return; +} + +/****************************************************************************************/ + +void write_coff_eeprom( struct prog_info *pi, int address, unsigned char data){ + + if ( !GET_ARG(pi->args, ARG_COFF) ) + return; + + /* Coff output keeps track of binary data in memory buffers */ + if ( ci->pEEPRomMemory ) { + if ( address <= pi->device->eeprom_size ) { + *(ci->pEEPRomMemory + address) = data; + if ( address >= ci->MaxEepromAddress ) + ci->MaxEepromAddress = address; /* keep high water mark */ + } else { + pi->error_count++; + fprintf(stderr, "Error: EEPROM address %d exceeds max range %d", address, pi->device->eeprom_size ); + } + } +} +/****************************************************************************************/ + +void write_coff_program( struct prog_info *pi, int address, unsigned int data){ + + unsigned char *pByte; + + if ( !GET_ARG(pi->args, ARG_COFF) ) + return; + + /* Coff output keeps track of binary data in memory buffers, address is in bytes not words */ + if ( ci->pRomMemory ) { + if ( address <= pi->device->flash_size ) { + pByte = (unsigned char *)(ci->pRomMemory + address); /* point to low byte in memory */ + *pByte++ = (data & 0xff); /* low byte */ + *pByte = ((data >> 8) & 0xff); /* high byte */ + + if ( address >= ci->MaxRomAddress ) + ci->MaxRomAddress = address; /* keep high water mark */ + } else { + pi->error_count++; + fprintf(stderr, "Error: FLASH address %d exceeds max range %d\n", address, pi->device->flash_size ); + /* Nick added \n above */ + } + } +} + +/****************************************************************************************/ + +void close_coff_file(struct prog_info *pi, FILE *fp){ + + /* close the output file */ + fclose( fp ); + pi->coff_file = 0; + + /* free all the internal memory buffers used by ci */ + + FreeList( &ci->ListOfSectionHeaders ); + FreeList( &ci->ListOfRawData ); + FreeList( &ci->ListOfRelocations ); + FreeList( &ci->ListOfLineNumbers ); + FreeList( &ci->ListOfSymbols ); + FreeList( &ci->ListOfGlobals ); + FreeList( &ci->ListOfUndefined ); + FreeList( &ci->ListOfStrings ); + FreeList( &ci->ListOfTypes ); + FreeList( &ci->ListOfSplitLines ); + + /* now free ci */ + free( ci ); + ci = 0; +} + +/****************************************************************************************/ + +int parse_stabs( struct prog_info *pi, char *p, int pass ){ + + int ok = True; + int TypeCode, n; + char *pString, *p2, *p3, *p4, *p5, *pType, *pEnd, *pp, *pJoined; + + + if ( !GET_ARG(pi->args, ARG_COFF) || ( pass == PASS_1 ) ) + return(True); + + /* stabs debugging information is in the form: + .stabs "symbolic info string", HexorDecimalTypecode, parm3, parm4, parm5 + parm1, parm2, parm3 depend on typecode + + N_LSYM 0x80 local sym: name,,0,type,offset + N_OPT 0x3c compiler options + N_SO 0x64 source file name: name,,0,0,address + N_SOL 0x84 #included file name: name,,0,0,address + N_FUN 0x24 procedure: name,,0,linenumber,address + N_GSYM 0x20 global symbol: name,,0,type,0 + N_LCSYM 0x28 .lcomm symbol: name,,0,type,address + N_STSYM 0x26 static symbol: name,,0,type,address + N_RSYM 0x40 register sym: name,,0,type,register + N_PSYM 0xa0 parameter: name,,0,type,offset + + */ + + /* Look for multiple commands per line */ + + /* .stabs "linktag:T19=s46next:20=*19,0,16;last:20,16,16;a:21=ar1;0;2;22=ar1;0;3;1,32,96;\\",128,0,0,0 */ + /* .stabs "b:23=ar1;0;4;24=ar1;0;5;2,128,240;;",128,0,0,0 */ + + + /* Look for continuation lines per line */ + + /* Get String information as a token */ + /* Parse the tokens in the stabn line buffer */ + pString = get_next_token(p, TERM_DOUBLEQUOTE ); /* zap first doublequote */ + p2 = get_next_token(pString, TERM_DOUBLEQUOTE ); /* zap last doublequote */ + p2 = get_next_token(p2, TERM_COMMA ); /* zap comma */ + p3 = get_next_token(p2, TERM_COMMA ); + p4 = get_next_token(p3, TERM_COMMA ); + p5 = get_next_token(p4, TERM_COMMA ); + pEnd = get_next_token(p5, TERM_END ); /* zap CR LF, make ASCIIZ */ + + if ( !pString || !p2 || !p3 || !p4 || !p5 ) + return( False ); + + /* Check for split lines */ + n = strlen( pString ); + if ( ( pString[n - 1] == '\\' ) && (pString[n - 2] == '\\') ) { + /* We have a continuation string here */ + pString[n - 2] = 0; + n -= 2; + if ( !(pp = (char *)AllocateListObject( &ci->ListOfSplitLines, n + 1 )) ) { + fprintf(stderr, "\nOut of memory allocating continuation line!"); + return( False ); + } + strcpy( pp, pString ); /* loose the continuation characters */ + return(True); + } + if ( ci->ListOfSplitLines.TotalItems > 0 ) { + /* Join lines together and process */ + if ( !(pJoined = calloc( 1, n + ci->ListOfSplitLines.TotalBytes ) ) ) { + fprintf(stderr, "\nOut of memory joining continuation lines!"); + return( False ); + } + for ( pp = (char *)FindFirstListObject( &ci->ListOfSplitLines ); + pp != 0; + pp = (char *)FindNextListObject( &ci->ListOfSplitLines ) ) { + + strcat( pJoined, pp ); /* connect the lines */ + } + strcat( pJoined, pString ); + FreeList( &ci->ListOfSplitLines ); + if ( !AddListObject( &ci->ListOfSplitLines, pJoined, n + ci->ListOfSplitLines.TotalBytes ) ) { + fprintf(stderr, "\nUnable to add joined continuation line"); + return( False ); + } + pString = pJoined; + } + + + if ( *p2 == '0' ) + TypeCode = atox(p2); /* presume to be hex 0x */ + else + TypeCode = atoi(p2); + + switch ( TypeCode ) { + + case N_OPT: /* compiler options */ + break; /* nothing used here */ + + case N_SO: /* source file name: name,,0,0,address */ + ok = stab_add_filename( pString, p5 ); + break; + + case N_GSYM: /* global symbol: name,,0,type,0 */ + pType = get_next_token(pString, TERM_COLON ); /* separate at colon */ + ok = stab_add_global( pi, pString, pType ); + break; + + case N_FUN: /* procedure: name,,0,linenumber,address */ + ok = stab_add_function( pi, pString, p5 ); + break; + + case N_LSYM: /* local sym: name,,0,type,offset */ + /* pString, p2 = TypeCode, p3 = 0, p4 = 0, p5 = offset */ + pType = get_next_token(pString, TERM_COLON ); /* pType = symbol descriptor (character after the colon) */ + if ( *pType == 't') + ok = stab_add_local_type( pString, ++pType ); + else if (*pType == 'T') + ok = stab_add_tag_type( pString, ++pType ); + else + ok = stab_add_local( pi, pString, pType, p5 ); + break; + + case N_RSYM: /* Symbol:[P|r]type,0,size,register */ + pType = get_next_token(pString, TERM_COLON ); /* separate at colon */ + ok = stab_add_local_register( pi, pString, pType, p5 ); + break; + + case N_LCSYM: /* .lcomm symbol: name,,0,type,address */ + ok = True; + break; /* ignore constants */ + + case N_STSYM: /* static symbol: name,,0,type,address */ + pType = get_next_token(pString, TERM_COLON ); /* separate at colon */ + ok = stab_add_static_symbol( pi, pString, pType, p5 ); + break; + + case N_PSYM: /* parameter: name,,0,type,offset */ + pType = get_next_token(pString, TERM_COLON ); /* separate at colon */ + ok = stab_add_parameter_symbol( pi, pString, pType, p5 ); + break; + + case N_SOL: /* #included file name: name,,0,0,address */ + ok = True; + break; /* ignore include files */ + + default: + ok = False; + } + + if ( ci->ListOfSplitLines.TotalItems > 0 ) + FreeList( &ci->ListOfSplitLines ); + + return( ok ); +} +/****************************************************************************************/ + +int parse_stabn( struct prog_info *pi, char *p, int pass ){ + + int ok = True; + int TypeCode /* , LineNumber */, Level; + char *p1, *p2, *p3, *p4, *pLabel, *pFunction, *pEnd; + + /* stabn debugging information is in the form: + .stabn TypeCode, 0, parm1, parm2 + parm1 is level + parm2 is Label-Function + + compiler currently produces the following TypeCodes: + N_LBRAC 0xc0 left bracket: 0,,0,nesting level,address + N_RBRAC 0xe0 right bracket: 0,,0,nesting level,address + N_SLINE 0x44 src line: 0,,0,linenumber,address + */ + + if ( !GET_ARG(pi->args, ARG_COFF) || ( pass == PASS_1 ) ) + return(True); + + /* Parse the tokens in the stabn line buffer */ + p1 = get_next_token(p, TERM_SPACE ); + p2 = get_next_token(p1, TERM_COMMA ); + p3 = get_next_token(p2, TERM_COMMA ); + p4 = get_next_token(p3, TERM_COMMA ); + pEnd = get_next_token(p4, TERM_END ); /* zap CR LF, make ASCIIZ */ + + if ( !p1 || !p2 || !p3 || !p4 ) + return( False ); + + /* first convert TypeCode to binary */ + if ( *p1 == '0' ) + TypeCode = atox(p1); /* presume to be hex 0x */ + else + TypeCode = atoi(p1); + + Level = atoi(p3); /* line number or level */ + pLabel = p4; /* Assembly label */ + pFunction = get_next_token( pLabel, TERM_DASH ); /* Function */ + + switch ( TypeCode ) { + case N_SLINE: /* src line: 0,,0,linenumber,address */ + ok = stab_add_lineno( pi, Level, pLabel, pFunction ); + break; + + case N_LBRAC: /* left bracket: 0,,0,nesting level,address */ + ok = stab_add_lbracket( pi, Level, pLabel, pFunction ); + break; + + case N_RBRAC: /* right bracket: 0,,0,nesting level,address */ + ok = stab_add_rbracket( pi, Level, pLabel, pFunction ); + break; + + default: + fprintf(stderr, "\nUnknown .stabn TypeCode = 0x%x", TypeCode ); + ok = False; + } + return( ok ); +} + +/****************************************************************************************/ +int stab_add_lineno( struct prog_info *pi, int LineNumber, char *pLabel, char *pFunction ){ + + int Address; + struct lineno *pln; + struct syment *pEntry; + union auxent *pAux; + + /* Allocate LineNumber Table entry and fill it in */ + pln = (struct lineno *)AllocateListObject(&ci->ListOfLineNumbers, sizeof(struct lineno) ); + if ( !pln ) { + fprintf(stderr, "\nOut of memory allocating lineno table for function %s", pFunction ); + return( False ); + } + /* set value field to be address of label in bytes */ + if ( !get_symbol(pi, pLabel, &Address) ) { + fprintf(stderr, "\nUnable to locate label %s", pLabel ); + return( False ); + } + pln->l_addr.l_paddr = Address * 2; /* need byte quanities */ + + /* Line number is relative to beginning of function, starts at 1 */ + if ( ci->FunctionStartLine == 0 ) { + /* This line number is that same as the function start */ + ci->FunctionStartLine = LineNumber; + } + pln->l_lnno = LineNumber - ci->FunctionStartLine + 1; + ci->CurrentSourceLine = LineNumber; /* keep track of source line for .eb .ef arrays */ + if ( ci->NeedLineNumberFixup ) { + /* need to go into symbol table and fix last NeedLineNumberFixup entries */ + for ( pEntry = (struct syment *)FindLastListObject(&ci->ListOfSymbols); + (pEntry != 0) && ( ci->NeedLineNumberFixup != 0); + pEntry = (struct syment *)FindNextLastListObject(&ci->ListOfSymbols) ) { + + /* Fix up line number entries */ + if ( (pEntry->n_sclass == C_FCN ) || ( pEntry->n_sclass == C_BLOCK ) || ( pEntry->n_sclass == C_EXT) ) { + pEntry++; + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_lnsz.x_lnno = LineNumber; + ci->NeedLineNumberFixup--; + } + } + } + + return(True); +} +/****************************************************************************************/ + +int stab_add_lbracket( struct prog_info *pi, int Level, char *pLabel, char *pFunction ){ + + int Address; + struct syment *pEntry; + union auxent *pAux; + //char *p; + //struct lineno *pln; + + if ( !get_symbol(pi, pLabel, &Address) ) { + fprintf(stderr, "\nUnable to locate label %s", pLabel ); + return( False ); + } + + /* Now create a .bb symbol table entry and aux entry too */ + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfSymbols, sizeof(struct syment) * 2 ); + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry for .bb %s", pLabel ); + return( False ); + } + /* n_name */ + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".bb" ); + + pEntry->n_value = Address * 2; /* bytes not words */ + pEntry->n_scnum = 1; /* .text */ + pEntry->n_type = 0; + pEntry->n_sclass = C_BLOCK; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_lnsz.x_lnno = 0; /* UNKNOWN - post process */ + pAux->x_sym.x_misc.x_lnsz.x_size = 0; /* UNKNOWN - post process */ + ci->NeedLineNumberFixup++; /* once for .bb block */ + return(True); +} + +/****************************************************************************************/ +int stab_add_rbracket( struct prog_info *pi, int Level, char *pLabel, char *pFunction ){ + + int Address; + struct syment *pEntry; + union auxent *pAux; + //char *p; + //struct lineno *pln; + + if ( !get_symbol(pi, pLabel, &Address) ) { + fprintf(stderr, "\nUnable to locate label %s", pLabel ); + return( False ); + } + + /* Now create a .eb symbol table entry */ + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfSymbols, sizeof(struct syment) * 2 ); + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry for .eb %s", pLabel ); + return( False ); + } + /* n_name */ + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".eb" ); + pEntry->n_sclass = C_BLOCK; + pEntry->n_value = Address * 2; /* bytes not words */ + pEntry->n_scnum = 1; /* .text */ + pEntry->n_type = 0; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_lnsz.x_lnno = ci->CurrentSourceLine; + + /* create an .ef if at level 0 */ + if ( Level == 0 ) { + + /* Now create a .ef symbol table entry */ + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfSymbols, sizeof(struct syment) * 2 ); + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry for .ef %s", pLabel ); + return( False ); + } + /* n_name */ + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".ef" ); + pEntry->n_sclass = C_FCN; + pEntry->n_value = Address * 2; /* bytes not words */ + pEntry->n_scnum = 1; /* .text */ + pEntry->n_type = 0; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_lnsz.x_lnno = ci->CurrentSourceLine; + } + return(True); +} + +/****************************************************************************************/ +int stab_add_filename( char *pName, char *pLabel ){ + + int ok, n; + struct syment *pEntry; + union auxent *pAux; + char *p; + + /* if( pLabel == "Ltext0" ) then beginning of .text, pName = cwd, next pName = file */ + + /* if( pLabel == "Letext" ) then end of .text , pName == NULL */ + + /* we only need the one not ending in Slash */ + ok = True; + n = strlen(pName); + if ( n > 0 ) { + if ( ( pName[ n - 1] == '\\') || (pName[ n - 1] == '/') ) + return(True); /* ignore */ + } else + return(True); + + + /* allocate entry in symbol table list */ + pEntry = (struct syment *)AllocateTwoListObjects( + &ci->ListOfSymbols, sizeof(struct syment) * 2 ); /* aux entry too */ + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry for global %s", pName ); + return( False ); + } + /* n_name */ + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".file" ); + /* n_value is determined after processing done UNKNOWN - post process */ + /* The value of that symbol equals the symbol table entry index of the next .file symbol or .global */ + /* post process */ + pEntry->n_scnum = N_DEBUG; + pEntry->n_sclass = C_FILE; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + + /* Add Label name to symbol table */ + if ( n <= FILNMLEN ) { + /* inline filename */ + memset( pAux->x_file.x_fname, 0, FILNMLEN ); + strncpy( pAux->x_file.x_fname, pName, n ); /* might not be zero terminated */ + } else { + pAux->x_file.x_n.x_zeroes = 0; /* symbol name is in string table */ + pAux->x_file.x_n.x_offset = ci->ListOfStrings.TotalBytes; + + /* add to string table */ + p = (char *)AllocateListObject( &ci->ListOfStrings, n + 1 ); + if ( !p ) { + fprintf(stderr, "\nOut of memory allocating string table space!"); + return( False ); + } + strcpy( p, pName ); + } + return( ok ); +} + +/****************************************************************************************/ +int stab_add_function( struct prog_info *pi, char *pName, char *pLabel ){ + + int n, Address; + unsigned short CoffType, Type; + struct syment *pEntry; + char *pType; + struct lineno *pln; + union auxent *pAux; + int SymbolIndex; + + pType = get_next_token(pName, TERM_COLON ); /* pType = symbol descriptor (character after the colon) */ + Type = atoi(pType + 1); /* skip past F, predefined variable type */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized return type found for function %s = %d", pName, Type ); + return(False); + } + /* Get Current Symbol Index, Allocate Symbol Table entry and fill it in */ + SymbolIndex = ci->ListOfSymbols.TotalItems; + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfSymbols, sizeof(struct syment) * 2 ); + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry for function %s", pName ); + return( False ); + } + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + } + if ( !get_symbol(pi, pLabel, &Address) ) { + fprintf(stderr, "\nUnable to locate function %s", pName ); + return( False ); + } + pEntry->n_value = Address * 2; /* convert words to bytes */ + pEntry->n_scnum = 2; /* .bss */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for function %s = %d", pName, Type ); + return(False); + } + pEntry->n_type = (unsigned short)(CoffType | (DT_FCN << 4)); + pEntry->n_sclass = C_EXT; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_tagndx = SymbolIndex + 1; /* point to the .bf entry index */ + // wrong! + // pAux->x_sym.x_misc.x_lnsz.x_lnno = ci->ListOfLineNumbers.TotalBytes; /* Relative Fixup point to where line numbers start */ + // pAux->x_sym.x_misc.x_lnsz.x_size = 0; /* UNKNOWN till next function called */ + pAux->x_sym.x_misc.x_fsize = 0; /* unknown till end */ + pAux->x_sym.x_fcnary.x_fcn.x_lnnoptr = ci->ListOfLineNumbers.TotalBytes; /* relative offset to line number entry */ + pAux->x_sym.x_fcnary.x_fcn.x_endndx = 0; /* index to next entry */ + + /* Now add function entry into the line number table */ + /* Allocate Symbol Table entry and fill it in */ + pln = (struct lineno *)AllocateListObject(&ci->ListOfLineNumbers, sizeof(struct lineno) ); + if ( !pln ) { + fprintf(stderr, "\nOut of memory allocating lineno table for function %s", pName ); + return( False ); + } + pln->l_lnno = 0; + pln->l_addr.l_symndx = SymbolIndex; + + /* Initialize the FunctionStartLine from the beginning of the function */ + ci->FunctionStartLine = 0; + + /* Allocate Symbol Table entry and fill it in */ + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfSymbols, sizeof(struct syment) * 2 ); + if ( !pEntry ) { + fprintf(stderr, "\nOut of memory allocating symbol table entry .bf for function %s", pName ); + return( False ); + } + memset( pEntry->n_name, 0, 8 ); + strcpy( pEntry->n_name, ".bf" ); + pEntry->n_value = Address * 2; /* bytes not words */ + pEntry->n_scnum = 1; /* .text */ + pEntry->n_type = 0; + pEntry->n_sclass = C_FCN; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_misc.x_lnsz.x_lnno = 0; /* UNKNOWN - post process */ + pAux->x_sym.x_misc.x_lnsz.x_size = 0; /* UNKNOWN - post process */ + + ci->NeedLineNumberFixup++; /* once for function C_EXT symbol */ + ci->NeedLineNumberFixup++; /* once for .bf block */ + return( True ); +} +/****************************************************************************************/ + +int stab_add_global( struct prog_info *pi, char *pName, char *pType ){ + + int n, Address, IsArray, SymbolIndex; + unsigned short CoffType, Type; + struct syment *pEntry; + char *p; + STABCOFFMAP *pMap; + + + n = strlen( pName ); /* see if it's 8 bytes or less */ + Type = atoi(pType + 1); /* skip past G, predefined variable type */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for global %s = %d", pName, Type ); + return(False); + } + pMap = (STABCOFFMAP *)GetCurrentListObject( &ci->ListOfTypes ); + + SymbolIndex = ci->ListOfSymbols.TotalItems; + /* Allocate Symbol Table entry and fill it in, Auxiliary table if its an array */ + if ( IsTypeArray( CoffType ) == True ) { + IsArray = True; + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfGlobals, sizeof(struct syment) * 2 ); + } else { + IsArray = False; + pEntry = (struct syment *)AllocateListObject( &ci->ListOfGlobals, sizeof(struct syment) ); + } + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + } + /* set value field to be address of label in bytes */ + /* add underscore to lookup label */ + if ( (p = calloc( 1, n + 2)) == 0 ) { + fprintf(stderr,"\nOut of memory adding global %s", pName ); + return(False); + } + *p = '_'; + strcpy( p + 1, pName ); + if ( !get_symbol(pi, p, &Address) ) { + fprintf(stderr, "\nUnable to locate global %s", p ); + free( p ); + return( False ); + } + free( p ); + pEntry->n_value = Address; /* already in bytes */ + if ( ci->GlobalStartAddress == -1 ) { + ci->GlobalStartAddress = Address; + } + if ( Address < ci->GlobalStartAddress ) + ci->GlobalStartAddress = Address; + if ( Address > ci->GlobalEndAddress ) + ci->GlobalEndAddress = Address; + + pEntry->n_scnum = 2; /* .bss */ + pEntry->n_type = CoffType; + pEntry->n_sclass = C_STAT; + if ( IsArray == False ) + pEntry->n_numaux = 0; + else { + pEntry->n_numaux = 1; + pEntry++; + AddArrayAuxInfo( (union auxent *)pEntry, (unsigned short)SymbolIndex, pMap ); + } + return( True ); +} + +/****************************************************************************************/ +int stab_add_local( struct prog_info *pi, char *pName, char *pType, char *pOffset ){ + + int n, Offset, IsArray; + unsigned short CoffType, Type, SymbolIndex; + struct syment *pEntry; + STABCOFFMAP *pMap; + + n = strlen( pName ); /* see if it's 8 bytes or less */ + Type = atoi(pType); /* predefined variable type */ + Offset = atoi(pOffset); /* offset in stack frame */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for local %s = %d", pName, Type ); + return(False); + } + pMap = (STABCOFFMAP *)GetCurrentListObject( &ci->ListOfTypes ); + SymbolIndex = ci->ListOfSymbols.TotalItems; + /* Allocate Symbol Table entry and fill it in, Auxiliary table if its an array */ + if ( IsTypeArray( CoffType ) == True ) { + IsArray = True; + pEntry = (struct syment *)AllocateTwoListObjects( &ci->ListOfGlobals, sizeof(struct syment) * 2 ); + } else { + IsArray = False; + pEntry = (struct syment *)AllocateListObject( &ci->ListOfSymbols, sizeof(struct syment) ); + } + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + } + pEntry->n_type = CoffType; + pEntry->n_sclass = C_AUTO; + pEntry->n_scnum = N_ABS; + pEntry->n_value = Offset + 1; /* Silly avr studio is set in its ways */ + if ( IsArray == False ) + pEntry->n_numaux = 0; + else { + pEntry->n_numaux = 1; + pEntry++; + AddArrayAuxInfo( (union auxent *)pEntry, SymbolIndex, pMap ); + } + return( True ); +} + +/****************************************************************************************/ +int stab_add_parameter_symbol( struct prog_info *pi, char *pName, char *pType, char *pOffset ){ + + int n, Offset; + unsigned short CoffType, Type; + struct syment *pEntry; + + n = strlen( pName ); /* see if it's 8 bytes or less */ + Type = atoi(pType); /* predefined variable type */ + Offset = atoi(pOffset); /* offset in stack frame */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for %s = %d", pName, Type ); + return(False); + } + /* Allocate Symbol Table entry and fill it in */ + pEntry = (struct syment *)AllocateListObject( &ci->ListOfSymbols, sizeof(struct syment) ); + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + } + pEntry->n_type = CoffType; + pEntry->n_sclass = C_ARG; + pEntry->n_scnum = N_ABS; + pEntry->n_value = Offset; + pEntry->n_numaux = 0; + return( True ); +} +/****************************************************************************************/ +int stab_add_static_symbol( struct prog_info *pi, char *pName, char *pType, char *pLabel ){ + + int n, Address; + unsigned short CoffType, Type; + struct syment *pEntry; + + n = strlen( pName ); /* see if it's 8 bytes or less */ + Type = atoi(pType + 1); /* skip past S, predefined variable type */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for %s = %d", pName, Type ); + return(False); + } + /* Allocate Symbol Table entry and fill it in */ + pEntry = (struct syment *)AllocateListObject( &ci->ListOfSymbols, sizeof(struct syment) ); + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + } + pEntry->n_type = CoffType; + pEntry->n_sclass = C_STAT; + pEntry->n_scnum = N_ABS; + if ( !get_symbol(pi, pLabel, &Address) ) { + fprintf(stderr, "\nUnable to locate label %s", pLabel ); + return( False ); + } + pEntry->n_value = Address * 2; /* find address of variable in bytes */ + pEntry->n_numaux = 0; + return( True ); +} +/****************************************************************************************/ + +int stab_add_local_register( struct prog_info *pi, char *pName, char *pType, char *pRegister ){ + + int n, Register, Size; + unsigned short CoffType, Type; + struct syment *pEntry; + + n = strlen( pName ); /* see if it's 8 bytes or less */ + Type = (unsigned short)atoi(pType + 1); /* skip past P, predefined variable type */ + Register = atoi(pRegister); /* offset in stack frame */ + if ( (CoffType = GetCoffType( Type )) == 0 ) { + fprintf(stderr, "\nUnrecognized type found for %s = %d", pName, Type ); + return(False); + } + Size = GetCoffTypeSize( Type ); /* Silly requirement for avr studio */ + /* Allocate Symbol Table entry and fill it in */ + pEntry = (struct syment *)AllocateListObject( &ci->ListOfSymbols, sizeof(struct syment) ); + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pName ); + return(False); + } + pEntry->n_type = CoffType; + // if( (*pType == 'r') || (*pType == 'R') ) + // pEntry->n_sclass = C_REG; + // else if( (*pType == 'p') || (*pType == 'P') ) + pEntry->n_sclass = C_REGPARM; /* Silly avr studio only accepts this for registers */ + // else{ + // fprintf(stderr,"\nUnknown register type -> %s", pType ); + // return(False); + // } + pEntry->n_scnum = N_ABS; + pEntry->n_numaux = 0; + if ( Size == 1 ) + pEntry->n_value = 0xffffff00 | Register; /* Silly requirement for avr studio */ + else if ( Size == 2 ) + pEntry->n_value = 0xffff0000 | ((Register + 1) << 8) | Register; /* Silly requirement for avr studio */ + else if ( Size == 4 ) + pEntry->n_value = ((Register + 3) << 24) | ((Register + 3) << 16) | ((Register + 1) << 8) | Register; /* Silly requirement for avr studio */ + else { + fprintf(stderr,"\nUnknown register size (%d) and coff type (%d)", Size, CoffType ); + return(False); + } + return( True ); +} + +/****************************************************************************************/ + +int stab_add_local_type( char *pName, char *pType ){ + + char *p; + unsigned short StabType; + + /* .stabs "int:t1=r1;-128;127;",128,0,0,0 */ + /* .stabs ":t20=ar1;0;1;21=ar1;0;1;2",128,0,0,0 */ + /* pType-----^ */ + /* Stab Type - convert to Coff type at end (after inline assignments */ + if ( GetStabType( pType, &StabType, &p ) != True ) { + fprintf(stderr,"\nInvalid tag type found in structure item -> %s", p); + return(False); + } + + return(True); +} + +/****************************************************************************************/ + +int GetStructUnionTagItem( char *p, char **pEnd, char **pName, unsigned short *pType, unsigned short *pBitOffset, unsigned short *pBitSize) { + + unsigned short StabType; + /* Structure or Union Tag Item consists of -> name:type,bitoffset,bitsize; */ + + /* name */ + *pName = p; + while ( *p && (*p != ':') ) p++; // locate colon + if ( *p != ':' ) { + fprintf(stderr,"\nNo colon found in structure item ->", p); + return(False); + } + *p++ = 0; // Asciiz + /* Stab Type - convert to Coff type at end (after inline assignments */ + if ( GetStabType( p, &StabType, &p ) != True ) { + fprintf(stderr,"\nInvalid tag type found in structure item -> %s", p); + return(False); + } + + /* BitSize */ + if ( *p != ',' ) { + fprintf(stderr,"\nNo Bit size found in structure item -> %s", p ); + return(False); + } + *pBitOffset = (unsigned short)atoi( ++p ); + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + + /* BitOffset */ + if ( *p != ',' ) { + fprintf(stderr,"\nNo Bit offset found in structure item -> %s", p ); + return(False); + } + *pBitSize = (unsigned short)atoi( ++p ); + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + + /* Now convert stab type to COFF */ + if ( (*pType = GetCoffType( (unsigned short)StabType)) == 0 ) { + fprintf(stderr,"\nNo COFF type found for stab type %d", StabType ); + return( False); + } + if ( *++p == ';' ) /* Now eat last semicolon(s) */ + p++; + *pEnd = p; + + return( True ); +} +/****************************************************************************************/ + +int GetEnumTagItem( char *p, char **pEnd, char **pEnumName, int *pEnumValue ) { + + /* Enum Tag Item consists of -> member1:value,member2:value2,; */ + *pEnumName = p; + while ( *p && (*p != ':') ) p++; // locate colon + if ( *p != ':' ) { + fprintf(stderr,"\nNo colon found in enum item ->", p); + return(False); + } + *p++ = 0; // Asciiz + *pEnumValue = atoi(p); + + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + if ( *p != ',' ) { + fprintf(stderr,"\nNo comma found after enum value -> %s", p ); + return(False); + } + if ( *++p ==';' ) + p++; /* eat last semicolon */ + *pEnd = p; + return( True ); +} + +/****************************************************************************************/ +int GetArrayType( char *p, char **pEnd, STABCOFFMAP *pMap, unsigned short *DerivedBits, int ExtraLevels ){ + + int MinIndex, MaxIndex, Result, Size, i; + char *pMinIndex, *pMaxIndex, *pType; + unsigned short Type; + + Result = True; + + pMinIndex = pMaxIndex = pType = 0; + while ( *p && (*p != ';') ) p++; /* find min index */ + pMinIndex = ++p; + while ( *p && (*p != ';') ) p++; /* find max index */ + pMaxIndex = ++p; + while ( *p && (*p != ';') ) p++; /* find type index */ + pType = ++p; + + /* bump the pointers to the digits */ + if ( !isdigit(*pMinIndex) ) + Result = False; + if ( !isdigit(*pMaxIndex) ) + Result = False; + if ( !isdigit(*pType) ) + Result = False; + /* Is syntax ok ? */ + if ( Result != True ) { + fprintf(stderr,"\nSyntax error on array parameters %s%s%s", pMinIndex, pMaxIndex, pType ); + return(False); + } + MinIndex = atoi(pMinIndex); + MaxIndex = atoi(pMaxIndex); + + if ( GetStabType( p, &Type, &p ) != True ) + return(False); + + if ( !SetupDefinedType( Type, pMap, DerivedBits, ExtraLevels ) ) + return( False ); + + /* Now update the size based on the indicies */ + Size = (MaxIndex - MinIndex) + 1; + pMap->ByteSize *= Size; + pMap->Line = ci->CurrentSourceLine; + /* add the dimension information */ + for ( i = 5; i >= 0; i-- ) { + if ( pMap->Dimensions[i] != 0 ) { + i++; + pMap->Dimensions[i] = Size; + break; + } + } + + *pEnd = p; + return(True); +} + +/****************************************************************************************/ +int GetStabType( char *p, unsigned short *pType, char **pEnd ) { + + STABCOFFMAP *pMap; + int extra, ok; + unsigned short derivedbits[6]; + unsigned short LStabType, RStabType; + char *pHigh, *pLow; + + + LStabType = atoi( p ); + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + + *pType = LStabType; + + if ( GetCoffType( LStabType ) != 0 ) { + *pEnd = p; + return(True); + } + if ( *p != '=' ) { + fprintf(stderr, "\nSyntax error in type assignment -> %s", p ); + return(False); + } + p++; + + /* Allocate space for new internal type */ + if ( !(pMap = (STABCOFFMAP *)AllocateListObject(&ci->ListOfTypes, sizeof(STABCOFFMAP)) ) ) { + fprintf(stderr, "\nOut of memory allocating type info!"); + return(False); + } + pMap->StabType = LStabType; + + /* process items to right of equals */ + for ( extra = 0; extra < 6; extra++ ) { + + if ( isdigit( *p ) ) { + /* Finally found base type, try to terminate loop */ + GetStabType( p, &RStabType, &p ); + // RStabType = atoi( p ); + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + if ( SetupDefinedType( RStabType, pMap, &derivedbits[0], extra ) != True ) + return( False ); + break; + } else if ( *p == 'a' ) { + derivedbits[extra] = DT_ARY; + p++; + /* Calculate size */ + /* Since type assignment will be made we need to set extra bits here */ + extra++; + /* =ar1;MinIndex;MaxIndex;BaseType */ + if ( GetArrayType( p, &p, pMap, &derivedbits[0], extra ) != True ) + return(False); + break; + + } else if ( *p == 'f' ) { + derivedbits[extra] = DT_FCN; + p++; + } else if ( *p == '*' ) { + derivedbits[extra] = DT_PTR; + p++; + } else if ( *p == 'r' ) { + // if( LStabType < 15 ) + // ok = GetInternalType( pString, pMap ); /* internal types not yet installed */ + // else + while ( *p && (*p != ';' ) ) p++; + pLow = p++; + while ( *p && (*p != ';' ) ) p++; + pHigh = p++; + ok = GetSubRangeType( LStabType, pMap, pLow, pHigh ); + if ( ok != True ) + return(False); + while ( *p && (*p != ';' ) ) p++; /* find end of range */ + p++; + break; + } else { + fprintf(stderr, "\nUnrecognized Type modifier %c!", *p ); + return(False); + } + } + *pEnd = p; /* Update return pointer */ + + return(True); +} + + +/****************************************************************************************/ +int stab_add_tag_type( char *pName, char *pString ){ + + int SymbolIndex, StabType, TotalSize, n, EnumValue; + unsigned short TagType, ItemType, BitOffset, BitSize; + char *p; + struct syment* pEntry; + union auxent *pAux; + STABCOFFMAP *pMap; + + /* We arrived here due to :T defining either a structure, union or enumeration */ + /* store the basic type as for internals and emit coff structures for debugging */ + /* .stabs "stag:T17=s2i:1,0,8;c:2,8,8;;",128,0,0,0 */ + /* .stabs "2:T18=u2a:2,0,8;b:1,0,8;c:6,0,16;;",128,0,0,0 */ + /* .stabs "1:T19=eenum1:1,enum2:2,enum3:3,;",128,0,0,0 */ + /* we don't care about the name */ + + + /* check for bogus errors */ + if ( !pName || !pString ) { + fprintf(stderr,"\nInvalid .stabs type format - no information!"); + return(False); + } + + p = pString; + /* Stab Type - convert to Coff type at end (after inline assignments */ + if ( (StabType = (unsigned short)atoi(p)) == 0 ) { + fprintf(stderr,"\nInvalid .stabs type format - no information! - > %s", p ); + return(False); + } + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + if ( *p != '=' ) { + fprintf(stderr,"\nInvalid .stabs type format - no equals - > %s", p ); + return(False); + } + SymbolIndex = ci->ListOfSymbols.TotalItems; + if ( ( pEntry = (struct syment*)AllocateTwoListObjects( &ci->ListOfGlobals, sizeof(struct syment) * 2 ) ) == 0 ) { + fprintf(stderr, "\nOut of memory allocating symbol tag entries"); + return(False); + } + /* Prepare Tag Header */ + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pString ); + return(False); + } + if ( !(pMap = (STABCOFFMAP *)AllocateListObject(&ci->ListOfTypes, sizeof(STABCOFFMAP)) ) ) { + fprintf(stderr, "\nOut of memory allocating type info!"); + return(False); + } + pMap->StabType = StabType; + pEntry->n_value = 0; + pEntry->n_scnum = N_DEBUG; + pEntry->n_numaux = 1; + if ( *++p == 's' ) { + TagType = pEntry->n_type = pMap->CoffType = T_STRUCT; + pEntry->n_sclass = C_STRTAG; + TotalSize = (unsigned short)atoi(++p); + } else if ( *p == 'u' ) { + TagType = pEntry->n_type = pMap->CoffType = T_UNION; + pEntry->n_sclass = C_UNTAG; + TotalSize = (unsigned short)atoi(++p); + } else if ( *p == 'e' ) { + TagType = pEntry->n_type = pMap->CoffType = T_ENUM; + pEntry->n_sclass = C_ENTAG; + TotalSize = FundamentalTypes[T_INT].Size; /* use size of int for enums */ + } else { + fprintf(stderr,"\nUnknown tag type -> %s", p ); + return(False); + } + while ( *p && (*p >= '0') && (*p <= '9') ) p++; // locate end of digits + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_tagndx = SymbolIndex; + pAux->x_sym.x_misc.x_lnsz.x_size = TotalSize; + + /* update our local knowledge of tag type */ + pMap->CoffType = TagType; + pMap->ByteSize = TotalSize; + pMap->Line = ci->CurrentSourceLine; + + /* Process the items until the end of the line */ + while ( *pName ) { + + if ( ( pEntry = (struct syment*)AllocateTwoListObjects( &ci->ListOfGlobals, sizeof(struct syment) * 2 ) ) == 0 ) { + fprintf(stderr, "\nOut of memory allocating symbol tag member entries"); + return(False); + } + + if ( TagType == T_STRUCT ) { + if ( GetStructUnionTagItem( p, &p, &pName, &ItemType, &BitOffset, &BitSize) != True ) { + return(False); + } + pEntry->n_value = BitOffset/8; + pEntry->n_type = ItemType; + pEntry->n_sclass = C_MOS; + } else if ( TagType == T_UNION ) { + if ( GetStructUnionTagItem( p, &p, &pName, &ItemType, &BitOffset, &BitSize) != True ) { + return(False); + } + pEntry->n_value = BitOffset/8; + pEntry->n_type = ItemType; + pEntry->n_sclass = C_MOU; + } else { /* T_ENUM */ + if ( GetEnumTagItem( p, &p, &pName, &EnumValue ) != True ) { + return(False); + } + pEntry->n_value = EnumValue; + pEntry->n_type = TotalSize; + pEntry->n_sclass = C_MOE; + } + + /* Prepare Common Tag Header items */ + if ( (n = AddNameToEntry( pName, pEntry )) == 0 ) { + fprintf(stderr,"\nOut of memory adding local %s to string table", pString ); + return(False); + } + pEntry->n_scnum = N_ABS; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_tagndx = SymbolIndex; + pAux->x_sym.x_misc.x_lnsz.x_size = TotalSize; + pName = p; + } + + /* End of Structures/Unions/Enumberations */ + if ( ( pEntry = (struct syment*)AllocateTwoListObjects( &ci->ListOfGlobals, sizeof(struct syment) * 2 ) ) == 0 ) { + fprintf(stderr, "\nOut of memory allocating special headers for structure!"); + return(False); + } + strcpy( pEntry->n_name, ".eos" ); + pEntry->n_value = TotalSize; + pEntry->n_scnum = N_ABS; + pEntry->n_type = 0; + pEntry->n_sclass = C_EOS; + pEntry->n_numaux = 1; + pEntry++; /* point to aux entry */ + pAux = (union auxent *)pEntry; + pAux->x_sym.x_tagndx = SymbolIndex; /* point to the .bf entry index */ + pAux->x_sym.x_misc.x_lnsz.x_size = TotalSize; + + return(True); +} + +/****************************************************************************************/ +int SetupDefinedType( unsigned short Type, STABCOFFMAP *pMap, unsigned short *DerivedBits, int ExtraLevels ){ + + int i, Dlimit, Dstart; + unsigned short StabType; + + StabType = pMap->StabType; /* save the new type we found earlier */ + if ( CopyStabCoffMap( Type, pMap ) != True ) { + fprintf(stderr, "\nCould not find defined type %d", Type ); + return(False); + } + pMap->StabType = StabType; /* save the new type we found earlier */ + + /* Determine existing derived types for base class */ + for ( i = 0; i < 6; i++ ) { + if ( (pMap->CoffType & ( 3 << (4 + i + i))) == 0 ) + break; + } + Dstart = i; + Dlimit = i + ExtraLevels; + if ( (Dlimit) >= 6 ) { + fprintf(stderr, "\nStab Type %d has too many derived (%d) types!", pMap->StabType, Dlimit ); + return(False); + } + /* Add the new derived levels */ + for ( ; i < Dlimit; i++ ) { + pMap->CoffType |= ( ( DerivedBits[i - Dstart] & 3) << (4 + i + i) ); /* add in the derived bits */ + } + return(True); +} + +/****************************************************************************************/ +int GetArrayDefinitions( STABCOFFMAP *pMap , char *pMinIndex, char *pMaxIndex, char *pType, unsigned short *DerivedBits, int ExtraLevels ){ + + int MinIndex, MaxIndex, Result, Size, i; + unsigned short Type; + + Result = True; + if ( (*pMinIndex != ';') || (*pMaxIndex != ';') || (*pType != ';') ) + Result = False; + /* bump the pointers to the digits */ + pMinIndex++; + if ( !isdigit(*pMinIndex) ) + Result = False; + pMaxIndex++; + if ( !isdigit(*pMaxIndex) ) + Result = False; + pType++; + if ( !isdigit(*pType) ) + Result = False; + /* Is syntax ok ? */ + if ( Result != True ) { + fprintf(stderr,"\nSyntax error on array parameters %s%s%s", pMinIndex, pMaxIndex, pType ); + return(False); + } + MinIndex = atoi(pMinIndex); + MaxIndex = atoi(pMaxIndex); + Type = (unsigned short)atoi(pType); + if ( SetupDefinedType( Type, pMap, DerivedBits, ExtraLevels ) != True ) + return( False ); + /* Now update the size based on the indicies */ + Size = (MaxIndex - MinIndex) + 1; + pMap->ByteSize *= Size; + pMap->Line = ci->CurrentSourceLine; + /* add the dimension information */ + for ( i = 5; i >= 0; i-- ) { + if ( pMap->Dimensions[i] != 0 ) { + i++; + pMap->Dimensions[i] = Size; + break; + } + } + return(True); +} + +/****************************************************************************************/ + +int GetInternalType( char *pName, STABCOFFMAP *pMap ){ + + int n, found, i; + + if ( !pName ) { + return(False); + } + + found = False; + n = strlen(pName); + /* Find out if it is a local type */ + for (i = 0; FundamentalTypes[i].pString != 0; i++) { + if ( !strncmp(pName, FundamentalTypes[i].pString, n) ) { + /* found an internal type */ + pMap->CoffType = FundamentalTypes[i].Type; + pMap->ByteSize = FundamentalTypes[i].Size; + found = True; + } + } + return(found); +} + +/****************************************************************************************/ +int GetSubRangeType( unsigned short Type, STABCOFFMAP *pMap , char *pLow, char *pHigh ){ + + int Result, i; + long High, Low; + unsigned long Test; + + Result = True; + if ( (*pLow != ';') || (*pHigh != ';') || (Type <= 0) ) + Result = False; + + /* Is syntax ok ? */ + if ( Result != True ) { + fprintf(stderr,"\nSyntax error on sub range parameters!" ); + return(False); + } + Low = atol(++pLow); + High = atol(++pHigh); + + /* Special handling of type void */ + if ( (Low == 0) && (High == 0) ) { + /* Declare type void */ + pMap->ByteSize =0; + pMap->CoffType = T_VOID; + pMap->Line = ci->CurrentSourceLine; + return(True); + } + + if ( (pMap->CoffType = GetCoffType( Type )) != 0 ) { + pMap->ByteSize = GetCoffTypeSize( Type ); + } else { + /* Try to base everything off integer */ + pMap->ByteSize = FundamentalTypes[T_INT].Size; + } + + /* Now calculate the byte size */ + if ( High == 0 ) { + pMap->ByteSize = (unsigned short)Low; /* floating point */ + } else { + if ( Low == 0 ) { + /* Unsigned */ + Test = (unsigned long)High; + } else if ( Low < 0 ) { + /* signed */ + Test = (unsigned long)High << 1; + } else { + if ( Low <= High ) + Test = (unsigned long)High; + else + Test = (unsigned long)Low; + } + if ( pMap->ByteSize == 0 ) { + fprintf(stderr,"\nType Range Error 1, need previous type %d size!", pMap->CoffType ); + return(False); + } + for ( i = 0; i < sizeof(unsigned long); i++ ) { + if ( !(Test & (0xff << (i * 8))) ) + break; + } + pMap->ByteSize = i; + } + /* Now determine the best fit based on byte size, compare against IAR Compiler */ + if ( pMap->ByteSize == 1 ) { + if ( Low < 0 ) + pMap->CoffType = T_CHAR; + else + pMap->CoffType = T_UCHAR; + } else if ( pMap->ByteSize == 2 ) { + if ( Low < 0 ) + pMap->CoffType = T_INT; + else + pMap->CoffType = T_UINT; + } else if ( pMap->ByteSize == 4 ) { + if ( Low == 0 ) + pMap->CoffType = T_FLOAT; + if ( Low < 0 ) + pMap->CoffType = T_LONG; + else + pMap->CoffType = T_ULONG; + } else { + fprintf(stderr,"\nGetSubRangeType failure - byte size %d", pMap->ByteSize ); + return(False); + } + return(True); +} + +/****************************************************************************************/ +int CopyStabCoffMap( unsigned short StabType, STABCOFFMAP *pMap ){ + + STABCOFFMAP *p; + + for ( p = FindFirstListObject( &ci->ListOfTypes ); p != 0; p = FindNextListObject( &ci->ListOfTypes) ) { + if ( p->StabType == StabType ) { + memcpy( pMap, p, sizeof(STABCOFFMAP) ); + return(True); + } + } + return( False ); /* Nothing found */ +} + +/****************************************************************************************/ +unsigned short GetCoffType( unsigned short StabType ){ + + STABCOFFMAP *p; + + for ( p = FindFirstListObject( &ci->ListOfTypes ); p != 0; p = FindNextListObject( &ci->ListOfTypes) ) { + if ( p->StabType == StabType ) + return( p->CoffType ); + } + return( 0 ); /* Nothing found */ +} + +/****************************************************************************************/ +unsigned short GetCoffTypeSize( unsigned short StabType ){ + + STABCOFFMAP *p; + + for ( p = FindFirstListObject( &ci->ListOfTypes ); p != 0; p = FindNextListObject( &ci->ListOfTypes) ) { + if ( p->StabType == StabType ) + return( p->ByteSize ); + } + return( 0 ); /* Nothing found */ +} + + +/****************************************************************************************/ +int GetDigitLength( char *p ){ + + int i; + + if ( p == 0 ) + return(0); + + for ( i = 0; (*p != 0) && ( *p >= '0' ) && ( *p <= '9' ); i++ ); + + return( i ); + +} + +/****************************************************************************************/ +int GetStringDelimiters( char *pString, char **pTokens, int MaxTokens ){ + + int i; + char *p; + + p = pString; + + if ( !p ) + return( 0 ); + + for ( i = 0; i < MaxTokens; i++ ) { + while ( True ) { + if ( (*p == ':') || (*p == ';') || (*p == '=') || (*p == ',') || (*p == '"') || (*p == 0 ) ) { + *(pTokens + i) = p; /* Remember this location */ + p++; + if ( *p == 0 ) + return( i ); + break; + } + p++; + } + } + return( i ); +} + +/****************************************************************************************/ +int IsTypeArray( unsigned short CoffType ){ + + int Result; + + Result = False; + + if ( (CoffType & (DT_ARY << 4 )) == (DT_ARY << 4 ) ) + Result = True; + if ( (CoffType & (DT_ARY << 6 )) == (DT_ARY << 6 ) ) + Result = True; + if ( (CoffType & (DT_ARY << 8 )) == (DT_ARY << 8 ) ) + Result = True; + if ( (CoffType & (DT_ARY << 10 )) == (DT_ARY << 10 ) ) + Result = True; + if ( (CoffType & (DT_ARY << 12 )) == (DT_ARY << 12 ) ) + Result = True; + if ( (CoffType & (DT_ARY << 14 )) == (DT_ARY << 14 ) ) + Result = True; + + return(Result); +} + +/****************************************************************************************/ +void AddArrayAuxInfo( union auxent *pAux, unsigned short SymbolIndex, STABCOFFMAP *pMap ){ + + int i; + + pAux->x_sym.x_tagndx = SymbolIndex; /* point to the .bf entry index */ + pAux->x_sym.x_misc.x_lnsz.x_lnno = pMap->Line; + pAux->x_sym.x_misc.x_lnsz.x_size = pMap->ByteSize; + for ( i = 0; i < 4; i++ ) + pAux->x_sym.x_fcnary.x_ary.x_dimen[i] = pMap->Dimensions[i]; +} + +/****************************************************************************************/ +int AddNameToEntry( char *pName, struct syment *pEntry ) { + + int n; + char *p; + + n = strlen( pName ); /* see if it's 8 bytes or less */ + if ( n <= 8 ) { + strncpy( pEntry->n_name, pName, 8 ); + } else { + /* point to current offset in string table */ + pEntry->n_offset = ci->ListOfStrings.TotalBytes; + /* Allocate string table entry */ + if ( (p = (char *)AllocateListObject( &ci->ListOfStrings, n + 1 )) == 0 ) { + return(0); + } + strcpy( p, pName ); + } + return(n); /* return size of string */ +} + +/****************************************************************************************/ + +char *SkipPastDigits( char *p ){ + + if ( !p ) + return(p); + if ( *p == 0 ); + return(p); + for ( p--; (*p >= '0') && (*p <= '9') && (*p != 0); p-- ); + return(p); +} + +/****************************************************************************************/ + +/****************************************************************************************/ +/****************************************************************************************/ +/* List management routines */ +/****************************************************************************************/ +/****************************************************************************************/ + +/****************************************************************************************/ + +/****************************************************************************************/ +void InitializeList( LISTNODEHEAD *pHead ){ + + pHead->Node.Next = &pHead->Node; + pHead->Node.Last = &pHead->Node; + pHead->TotalBytes = 0; + pHead->TotalItems = 0; + pHead->current = &pHead->Node; + return; +} + +/****************************************************************************************/ + +void *AllocateTwoListObjects( LISTNODEHEAD *pHead, int size ){ + + void *p; + + if ( (p = AllocateListObject( pHead, size ) ) ) + pHead->TotalItems++; /* already incremented once in addtolist */ + return( p ); +} + +/****************************************************************************************/ +void *AllocateListObject( LISTNODEHEAD *pHead, int size ){ + + void *pObject; + + LISTNODE *pNode; + + if ( (pObject = calloc( 1, size )) != 0 ) { + if ( !(pNode = AddListObject( pHead, pObject, size )) ) { + free( pObject ); + pObject = 0; + } + } + return( pObject ); +} + +/****************************************************************************************/ +LISTNODE *AddListObject(LISTNODEHEAD *pHead, void *pObject, int size ){ + + LISTNODE *pNode; + + if ( (pNode = calloc( 1, sizeof(LISTNODE) )) != 0 ) { + pNode->pObject = pObject; + pNode->Size = size; + pNode->FileNumber = ci->CurrentFileNumber; + AddNodeToList( pHead, pNode ); + } + return( pNode ); +} + +/****************************************************************************************/ +LISTNODE *AllocateListNode( void *pObject, int size ){ + + LISTNODE *pNew; + + if ( (pNew = calloc( 1, sizeof( LISTNODE ) ) ) != 0 ) { + /* Then we initialize the node */ + pNew->pObject = pObject; + pNew->Size = size; + pNew->FileNumber = ci->CurrentFileNumber; + } + return(pNew); +} + +/****************************************************************************************/ +void AddNodeToList( LISTNODEHEAD *pHead, LISTNODE *pNode ){ + + LISTNODE *p; + + p = &pHead->Node; + + pNode->Next = p->Last->Next; + p->Last->Next = pNode; + pNode->Last = p->Last; + p->Last = pNode; + + /* and update current size of data contained in the list */ + pHead->TotalBytes += pNode->Size; + pHead->TotalItems++; +} + +/****************************************************************************************/ +void RemoveNodeFromList( LISTNODEHEAD *pHead, LISTNODE *pNode ){ + + pNode->Last->Next = pNode->Next; + pNode->Next->Last = pNode->Last; + + pHead->TotalBytes -= pNode->Size; + pHead->TotalItems--; +} + + +/****************************************************************************************/ +void *FindFirstListObject( LISTNODEHEAD *pHead ){ + + if ( pHead->Node.Next == &pHead->Node ) + return(0); /* Nothing in list */ + + pHead->current = pHead->Node.Next; + return( pHead->current->pObject ); +} +/****************************************************************************************/ +void *FindNextListObject( LISTNODEHEAD *pHead ){ + + if ( pHead->current->Next == &pHead->Node ) + return( 0 ); + + pHead->current = pHead->current->Next; + + return( pHead->current->pObject ); +} +/****************************************************************************************/ + +LISTNODE *GetCurrentNode( LISTNODEHEAD *pHead ){ + + return( pHead->current ); +} + +/****************************************************************************************/ +void *GetCurrentListObject( LISTNODEHEAD *pHead ){ + + return( pHead->current->pObject ); +} + + +/****************************************************************************************/ +void *FindLastListObject( LISTNODEHEAD *pHead ){ + + if ( pHead->Node.Last == &pHead->Node ) + return(0); /* Nothing in list */ + + pHead->current = pHead->Node.Last; + return( pHead->current->pObject ); +} +/****************************************************************************************/ +void *FindNextLastListObject( LISTNODEHEAD *pHead ){ + + if ( pHead->current->Last == &pHead->Node ) + return( 0 ); + + pHead->current = pHead->current->Last; + + return( pHead->current->pObject ); +} + +/****************************************************************************************/ + +void FreeList( LISTNODEHEAD *pHead ){ + + LISTNODE *pNode; + + for ( pNode = pHead->Node.Last; pNode->Next != &pHead->Node; pNode = pHead->Node.Last ) { + + RemoveNodeFromList( pHead, pNode ); + free( pNode->pObject ); + free( pNode ); + } + pHead->TotalBytes = 0; + pHead->TotalItems = 0; + pHead->current = &pHead->Node; +} +/****************************************************************************************/ + + diff --git a/src/mkutil/avra-0.8/SOURCE/coff.h b/src/mkutil/avra-0.8/SOURCE/coff.h new file mode 100644 index 00000000..a397be81 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/coff.h @@ -0,0 +1,403 @@ +// +// coff.h - Common Object File Format (COFF) support +// +// This file was developed for the avra assembler in order to produce COFF output files +// for use with the Atmel AVR Studio. The Lean C Compiler (LCC) debugging stabs +// output was used as input to the assembler. +// +// This software has absolutely no warrantee! The money you paid for this will be +// promptly refunded if not fully satisfied. +// +// Beta release 1/20/2000 by Bob Harris +// +// This software has not been fully tested and probably has a few software deficiencies. +// Some software support may be possible by sending a problem description report to +// rth@mclean.sparta.com + +#define MAGIC_NUMBER_AVR 0xa12 + +#define N_GSYM 0x20 /* global symbol: name,,0,type,0 */ +#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */ +#define N_FUN 0x24 /* procedure: name,,0,linenumber,address */ +#define N_STSYM 0x26 /* static symbol: name,,0,type,address */ +#define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */ +#define N_MAIN 0x2a /* name of main routine : name,,0,0,0 */ +#define N_ROSYM 0x2c /* ro_data objects */ +#define N_OBJ 0x38 /* object file path or name */ +#define N_OPT 0x3c /* compiler options */ +#define N_RSYM 0x40 /* register sym: name,,0,type,register */ +#define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */ +#define N_FLINE 0x4c /* function start.end */ +#define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */ +#define N_ENDM 0x62 /* last stab emitted for module */ +#define N_SO 0x64 /* source file name: name,,0,0,address */ +#define N_LSYM 0x80 /* local sym: name,,0,type,offset */ +#define N_BINCL 0x82 /* header file: name,,0,0,0 */ +#define N_SOL 0x84 /* #included file name: name,,0,0,address */ +#define N_PSYM 0xa0 /* parameter: name,,0,type,offset */ +#define N_EINCL 0xa2 /* end of include file */ +#define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */ +#define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */ +#define N_EXCL 0xc2 /* excluded include file */ +#define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */ +#define N_BCOMM 0xe2 /* begin common: name,, */ +#define N_ECOMM 0xe4 /* end common: name,, */ +#define N_ECOML 0xe8 /* end common (local name): ,,address */ +#define N_LENG 0xfe /* second stab entry with length information */ + + +/* + * Type of a symbol, in low N bits of the word + */ +#define T_NULL 0 +#define T_VOID 1 /* function argument (only used by compiler) */ +#define T_CHAR 2 /* character */ +#define T_SHORT 3 /* short integer */ +#define T_INT 4 /* integer */ +#define T_LONG 5 /* long integer */ +#define T_FLOAT 6 /* floating point */ +#define T_DOUBLE 7 /* double word */ +#define T_STRUCT 8 /* structure */ +#define T_UNION 9 /* union */ +#define T_ENUM 10 /* enumeration */ +#define T_MOE 11 /* member of enumeration*/ +#define T_UCHAR 12 /* unsigned character */ +#define T_USHORT 13 /* unsigned short */ +#define T_UINT 14 /* unsigned integer */ +#define T_ULONG 15 /* unsigned long */ +#define T_LNGDBL 16 /* long double */ + +/* + * derived types, in n_type +*/ +#define DT_NON (0) /* no derived type */ +#define DT_PTR (1) /* pointer */ +#define DT_FCN (2) /* function */ +#define DT_ARY (3) /* array */ + +struct external_filehdr { + unsigned short f_magic; /* magic number */ + unsigned short f_nscns; /* number of sections */ + unsigned long f_timdat; /* time & date stamp */ + unsigned long f_symptr; /* file pointer to symtab */ + unsigned long f_nsyms; /* number of symtab entries */ + unsigned short f_opthdr; /* sizeof(optional hdr) */ + unsigned short f_flags; /* flags */ +}; + +/* Bits for f_flags: + * F_RELFLG relocation info stripped from file + * F_EXEC file is executable (no unresolved external references) + * F_LNNO line numbers stripped from file + * F_LSYMS local symbols stripped from file + * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) + */ + +#define F_RELFLG (0x0001) +#define F_EXEC (0x0002) +#define F_LNNO (0x0004) +#define F_LSYMS (0x0008) + +/*********************************************************************/ +struct external_scnhdr { + char s_name[8]; /* section name */ + unsigned long s_paddr; /* physical address, aliased s_nlib */ + unsigned long s_vaddr; /* virtual address */ + unsigned long s_size; /* section size */ + unsigned long s_scnptr; /* file ptr to raw data for section */ + unsigned long s_relptr; /* file ptr to relocation */ + unsigned long s_lnnoptr; /* file ptr to line numbers */ + unsigned short s_nreloc; /* number of relocation entries */ + unsigned short s_nlnno; /* number of line number entries*/ + unsigned long s_flags; /* flags */ +}; + +#define SCNHDR struct external_scnhdr +#define SCNHSZ sizeof(SCNHDR) + +/* + * names of "special" sections + */ +#define _TEXT ".text" +#define _DATA ".data" +#define _BSS ".bss" +#define _COMMENT ".comment" +#define _LIB ".lib" + +/* + * s_flags "type" + */ +#define STYP_TEXT (0x0020) /* section contains text only */ +#define STYP_DATA (0x0040) /* section contains data only */ +#define STYP_BSS (0x0080) /* section contains bss only */ + + +/*********************************************************************/ + +struct lineno +{ + union + { + long l_symndx; /* symtbl index of func name */ + long l_paddr; /* paddr of line number */ + } l_addr; + unsigned short l_lnno; /* line number */ +}; + +#define LINENO struct lineno +#define LINESZ 6 + + + +#define N_UNDEF ((short)0) /* undefined symbol */ +#define N_ABS ((short)-1) /* value of symbol is absolute */ +#define N_DEBUG ((short)-2) /* debugging symbol -- value is meaningless */ + +/********************** STORAGE CLASSES **********************/ + +/* This used to be defined as -1, but now n_sclass is unsigned. */ +#define C_EFCN 0xff /* physical end of function */ +#define C_NULL 0 +#define C_AUTO 1 /* automatic variable */ +#define C_EXT 2 /* external symbol */ +#define C_STAT 3 /* static */ +#define C_REG 4 /* register variable */ +#define C_EXTDEF 5 /* external definition */ +#define C_LABEL 6 /* label */ +#define C_ULABEL 7 /* undefined label */ +#define C_MOS 8 /* member of structure */ +#define C_ARG 9 /* function argument */ +#define C_STRTAG 10 /* structure tag */ +#define C_MOU 11 /* member of union */ +#define C_UNTAG 12 /* union tag */ +#define C_TPDEF 13 /* type definition */ +#define C_USTATIC 14 /* undefined static */ +#define C_ENTAG 15 /* enumeration tag */ +#define C_MOE 16 /* member of enumeration */ +#define C_REGPARM 17 /* register parameter */ +#define C_FIELD 18 /* bit field */ +#define C_AUTOARG 19 /* auto argument */ +#define C_LASTENT 20 /* dummy entry (end of block) */ +#define C_BLOCK 100 /* ".bb" or ".eb" */ +#define C_FCN 101 /* ".bf" or ".ef" */ +#define C_EOS 102 /* end of structure */ +#define C_FILE 103 /* file name */ +#define C_LINE 104 /* line # reformatted as symbol table entry */ +#define C_ALIAS 105 /* duplicate tag */ +#define C_HIDDEN 106 /* ext symbol in dmert public lib */ + +#define E_SYMNMLEN 8 /* # characters in a symbol name */ +#define E_FILNMLEN 14 /* # characters in a file name */ +#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ + +struct syment +{ + union + { + char _n_name[E_SYMNMLEN]; /* symbol name*/ + struct + { + long _n_zeroes; /* symbol name */ + + long _n_offset; /* location in string table */ + } _n_n; + char *_n_nptr[2]; /* allows overlaying */ + } _n; + unsigned long n_value; /* value of symbol */ + + short n_scnum; /* section number */ + + unsigned short n_type; /* type and derived */ + + char n_sclass; /* storage class */ + + char n_numaux; /* number of aux entries */ +}; + +#define n_name _n._n_name +#define n_zeroes _n._n_n._n_zeroes +#define n_offset _n._n_n._n_offset +#define n_nptr _n._n_nptr[1] + +#define SYMNMLEN 8 +#define SYMESZ 18 /* size of a symbol table entry */ + +union auxent +{ + struct + { + long x_tagndx; + union + { + struct + { + unsigned short x_lnno; + unsigned short x_size; + } x_lnsz; + long x_fsize; + } x_misc; + union + { + struct + { + long x_lnnoptr; + long x_endndx; + } x_fcn; + struct + { + unsigned short x_dimen[E_DIMNUM]; + } x_ary; + } x_fcnary; + unsigned short x_tvndx; + } x_sym; + union + { + char x_fname[E_FILNMLEN]; + struct { + unsigned long x_zeroes; + unsigned long x_offset; + } x_n; + } x_file; + struct + { + long x_scnlen; + unsigned short x_nreloc; + unsigned short x_nlinno; + } x_scn; + struct + { + long x_tvfill; + unsigned short x_tvlen; + unsigned short x_tvran[2]; + } x_tv; +}; + +#define FILNMLEN 14 +#define DIMNUM 4 +#define AUXENT union auxent +#define AUXESZ 18 + + +/* Coff additions */ +typedef struct ListNodeTag{ + struct ListNodeTag *Next; /* Double Linked List */ + struct ListNodeTag *Last; /* Double Linked List */ + void *pObject; /* points to list object */ + unsigned long Size; + int FileNumber; /* corresponds to individual file(s) */ +} LISTNODE; + +//#define LISTNODE struct ListNodeTag; + +typedef struct ListNodeHeadTag { + LISTNODE Node; +// struct ListNodeTag *Next; /* Double Linked List */ +// struct ListNodeTag *Last; /* Double Linked List */ + int TotalBytes; /* size of allocated object(s) */ + int TotalItems; /* number of allocated objects */ + LISTNODE *current; /* pointer for FindFirst/FindNext */ +} LISTNODEHEAD ; + + +typedef struct { + unsigned short StabType; + unsigned short CoffType; + unsigned short ByteSize; + unsigned short Line; /* used by arrays */ + unsigned short Dimensions[6]; /* used by arrays */ +} STABCOFFMAP; + +struct coff_info { + + int CurrentFileNumber; + int FunctionStartLine; /* used in Line number table */ + int CurrentSourceLine; + + /* Internal */ + unsigned char *pRomMemory; /* 16 bit wide words/addresses */ + unsigned char *pEEPRomMemory; /* 8 bit wide words/addresses */ + int MaxRomAddress; + int MaxEepromAddress; + int NeedLineNumberFixup; + int GlobalStartAddress; + int GlobalEndAddress; + LISTNODEHEAD ListOfSplitLines; + + /* External */ + struct external_filehdr FileHeader; /* Only one of these per output file */ + LISTNODEHEAD ListOfSectionHeaders; /* .text, .bss */ + LISTNODEHEAD ListOfRawData; /* Program, EEPROM */ + LISTNODEHEAD ListOfRelocations; /* Not used now */ + LISTNODEHEAD ListOfLineNumbers; + LISTNODEHEAD ListOfSymbols; + LISTNODEHEAD ListOfGlobals; + LISTNODEHEAD ListOfSpecials; + LISTNODEHEAD ListOfUndefined; + LISTNODEHEAD ListOfStrings; + LISTNODEHEAD ListOfTypes; +}; + +#if 0 /* defined in avra.h */ + +FILE *open_coff_file(struct prog_info *pi, char *filename); +void write_coff_file(struct prog_info *pi); +void write_coff_eeprom( struct prog_info *pi, int address, unsigned char data); +void write_coff_program( struct prog_info *pi, int address, unsigned char data); +void close_coff_file(struct prog_info *pi, FILE *fp); +int parse_stabs( struct prog_info *pi, char *p, int pass ); +int parse_stabn( struct prog_info *pi, char *p, int pass ); + +#endif + +/**************************************************************/ +/*********** Internal Routines ********************************/ +/**************************************************************/ +int stab_add_lineno( struct prog_info *pi, int LineNumber, char *pLabel, char *pFunction ); +int stab_add_lbracket( struct prog_info *pi, int Level, char *pLabel, char *pFunction ); +int stab_add_rbracket( struct prog_info *pi, int Level, char *pLabel, char *pFunction ); +int stab_add_filename( char *pName, char *pLabel ); +int stab_add_function( struct prog_info *pi, char *pName, char *pLabel ); +int stab_add_global( struct prog_info *pi, char *pName, char *pType ); +int stab_add_local( struct prog_info *pi, char *pName, char *pType, char *pOffset ); +int stab_add_parameter_symbol( struct prog_info *pi, char *pName, char *pType, char *pOffset ); +int stab_add_static_symbol( struct prog_info *pi, char *pName, char *pType, char *pLabel ); +int stab_add_local_register( struct prog_info *pi, char *pName, char *pType, char *pRegister ); +int stab_add_local_type( char *pString, char *pType ); +int stab_add_tag_type( char *pName, char *pDesciptor ); + +int GetStabType( char *p, unsigned short *pType, char **pEnd ); +int AddNameToEntry( char *pName, struct syment *pEntry ); +int GetArrayType( char *p, char **pEnd, STABCOFFMAP *pMap, unsigned short *DerivedBits, int ExtraLevels ); +int GetEnumTagItem( char *p, char **pEnd, char **pEnumName, int *pEnumValue ); +int GetStructUnionTagItem( char *p, char **pEnd, char **pName, unsigned short *pType, unsigned short *pBitOffset, unsigned short *pBitSize); +int GetStringDelimiters( char *pString, char **pTokens, int MaxTokens ); +int SetupDefinedType( unsigned short Type, STABCOFFMAP *pMap, unsigned short *DerivedBits, int ExtraLevels ); +int GetArrayDefinitions( STABCOFFMAP *pMap , char *pMinIndex, char *pMaxIndex, char *pType, unsigned short *DerivedBits, int ExtraLevels ); +int GetInternalType( char *pName, STABCOFFMAP *pMap ); +unsigned short GetCoffType( unsigned short StabType ); +unsigned short GetCoffTypeSize( unsigned short StabType ); +int CopyStabCoffMap( unsigned short StabType, STABCOFFMAP *pMap ); +int IsTypeArray( unsigned short CoffType ); +void AddArrayAuxInfo( union auxent *pAux, unsigned short SymbolIndex, STABCOFFMAP *pMap ); +int GetSubRangeType( unsigned short Type, STABCOFFMAP *pMap , char *pLow, char *pHigh ); +char *SkipPastDigits( char *p ); +int GetDigitLength( char *p ); + +/****************************************************************************************/ +/* List management routines */ +/****************************************************************************************/ + +void InitializeList( LISTNODEHEAD *pNode ); +void *AllocateTwoListObjects( LISTNODEHEAD *pHead, int size ); +void *AllocateListObject( LISTNODEHEAD *pHead, int size ); +LISTNODE *AllocateListNode( void *pObject, int size ); +void AddNodeToList( LISTNODEHEAD *pHead, LISTNODE *pNode ); +void *FindFirstListObject( LISTNODEHEAD *pHead ); +void *FindNextListObject( LISTNODEHEAD *pHead ); +LISTNODE *GetCurrentNode( LISTNODEHEAD *pHead ); +void *GetCurrentListObject( LISTNODEHEAD *pHead ); +void *FindLastListObject( LISTNODEHEAD *pHead ); +void *FindNextLastListObject( LISTNODEHEAD *pHead ); +void FreeList( LISTNODEHEAD *pHead ); +LISTNODE *AddListObject(LISTNODEHEAD *pHead, void *pObject, int size ); + diff --git a/src/mkutil/avra-0.8/SOURCE/device.c b/src/mkutil/avra-0.8/SOURCE/device.c new file mode 100644 index 00000000..206e6b9a --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/device.c @@ -0,0 +1,206 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include + +#include "misc.h" +#include "avra.h" +#include "device.h" + +#define DEV_VAR "__DEVICE__" // Device var name +#define FLASH_VAR "__FLASH_SIZE__" // Flash size var name +#define EEPROM_VAR "__EEPROM_SIZE__" // EEPROM size var name +#define RAM_VAR "__RAM_SIZE__" // RAM size var name +#define DEV_PREFIX "__" // Device name prefix +#define DEV_SUFFIX "__" // Device name suffix +#define DEF_DEV_NAME "DEFAULT" // Default device name (without prefix/suffix) +#define MAX_DEV_NAME 32 // Max device name length + +// Name, Flash, RAM, EEPROM, flags +struct device device_list[] = +{ + { NULL, 4194304, 8388608, 65536, 0}, // Total instructions: 137 + {"AT90S1200", 512+32, 0, 64, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, // 137 - MUL(6) - JMP(2) - TINY(10) + {"ATtiny10", 1024+32, 0, 0, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATtiny11", 1024+32, 0, 0, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATtiny12", 1024+32, 0, 64, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATtiny15", 1024+32, 0, 64, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATtiny28", 2048+32, 0, 0, DF_NO_MUL|DF_NO_JMP|DF_TINY1X|DF_NO_XREG|DF_NO_YREG|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATtiny22", 2048+32, 128, 128, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S2313", 1024+32, 128, 128, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S2323", 1024+32, 128, 128, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S2333", 1024+32, 128, 128, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S2343", 1024+32, 128, 128, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S4414", 2048+32, 256, 256, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S4433", 2048+32, 128, 256, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S4434", 2048+32, 256, 256, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S8515", 4096+32, 512, 512, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90C8534", 4096+32, 256, 512, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"AT90S8535", 4096+4096+32, 512, 512, DF_NO_MUL|DF_NO_JMP|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_MOVW|DF_NO_BREAK|DF_NO_EICALL|DF_NO_EIJMP}, + {"ATmega8", 4096+32, 1024, 512, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega161", 8192+32, 1024, 512, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega162", 8192+32, 1024, 512, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega163", 8192+32, 1024, 512, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega16", 8192+32, 1024, 512, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega323", 16384+32, 2048, 1024, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, // 137 - EICALL - EIJMP - ELPM(3) - ESPM = 131 (Data sheet says 130 but it's wrong) + {"ATmega32", 16384+32, 2048, 1024, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_ESPM}, + {"ATmega603", 32768+32, 4096, 2048, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_MUL|DF_NO_MOVW|DF_NO_LPM_X|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_BREAK}, + {"ATmega103", 65536+32, 4096, 4096, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_MUL|DF_NO_MOVW|DF_NO_LPM_X|DF_NO_ELPM_X|DF_NO_SPM|DF_NO_ESPM|DF_NO_BREAK}, // 137 - EICALL - EIJMP - MUL(6) - MOVW - LPM_X(2) - ELPM_X(2) - SPM - ESPM - BREAK = 121 + {"ATmega104", 65536+32, 4096, 4096, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ESPM}, // Old name for mega128 + {"ATmega128", 65536+32, 4096, 4096, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ESPM}, // 137 - EICALL - EIJMP - ESPM = 134 (Data sheet says 133 but it's wrong) + {"AT94K", 8192+32, 16384, 0, DF_NO_EICALL|DF_NO_EIJMP|DF_NO_ELPM|DF_NO_SPM|DF_NO_ESPM|DF_NO_BREAK}, // 137 - EICALL - EIJMP - ELPM(3) - SPM - ESPM - BREAK = 129 + {NULL, 0, 0, 0, 0} +}; + +static int LastDevice=0; + +static int def_var(struct prog_info *pi, char *name, int value) + { + struct label *label; + + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, name)) + { + label->value = value; + return(True); + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_variable) + pi->last_variable->next = label; + else + pi->first_variable = label; + pi->last_variable = label; + label->name = malloc(strlen(name) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, name); + label->value = value; + return(True); + } + +// Define vars for device in LastDevice +static void def_dev(struct prog_info *pi) { + def_var(pi,DEV_VAR,LastDevice); + def_var(pi,FLASH_VAR,device_list[LastDevice].flash_size); + def_var(pi,EEPROM_VAR,device_list[LastDevice].eeprom_size); + def_var(pi,RAM_VAR,device_list[LastDevice].ram_size); + } +struct device *get_device(struct prog_info *pi, char *name) + { + int i = 1; + + LastDevice=0; + if(name == NULL) + { + def_dev(pi); + return(&device_list[0]); + } + while(device_list[i].name) + { + if(!nocase_strcmp(name, device_list[i].name)) + { + LastDevice=i; + def_dev(pi); + return(&device_list[i]); + } + i++; + } + def_dev(pi); + return(NULL); + } + +static int def_const(struct prog_info *pi, const char *name, int value) + { + struct label *label; + + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_constant) + pi->last_constant->next = label; + else + pi->first_constant = label; + pi->last_constant = label; + label->name = malloc(strlen(name) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, name); + label->value = value; + return(True); + } + +// Pre-define devices +void predef_dev(struct prog_info *pi) + { + int i; + char temp[MAX_DEV_NAME+1]; + + + def_dev(pi); + for (i=0;(!i)||(device_list[i].name);i++) + { + strncpy(temp,DEV_PREFIX,MAX_DEV_NAME); + if (!i) strncat(temp,DEF_DEV_NAME,MAX_DEV_NAME); + else strncat(temp,device_list[i].name,MAX_DEV_NAME); + strncat(temp,DEV_SUFFIX,MAX_DEV_NAME); + def_const(pi,temp,i); + } + } + +void list_devices() +{ + int i = 1; + printf("Device name | Flash size | RAM size | EEPROM size | Supported\n" + " | (words) | (bytes) | (bytes) | instructions\n" + "------------+------------+----------+-------------+--------------\n" + " (default) | %7d | %7d | %5d | %3d\n", + device_list[0].flash_size, device_list[0].ram_size, device_list[0].eeprom_size, + count_supported_instructions(device_list[0].flag)); + while(device_list[i].name) + { + printf(" %-10s | %7d | %7d | %5d | %3d\n", device_list[i].name, + device_list[i].flash_size, device_list[i].ram_size, + device_list[i].eeprom_size, count_supported_instructions(device_list[i].flag)); + i++; + } +} diff --git a/src/mkutil/avra-0.8/SOURCE/device.h b/src/mkutil/avra-0.8/SOURCE/device.h new file mode 100644 index 00000000..1d627bf5 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/device.h @@ -0,0 +1,32 @@ + +/* Device flags */ +#define DF_NO_MUL 0x00000001 +#define DF_NO_JMP 0x00000002 // No JMP, CALL +#define DF_NO_XREG 0x00000004 // No X register +#define DF_NO_YREG 0x00000008 // No Y register +#define DF_TINY1X 0x00000010 /* AT90S1200, ATtiny10-12 set: No ADIW, SBIW, + IJMP, ICALL, LDD, STD, LDS, STS, PUSH, POP */ +#define DF_NO_LPM 0x00000020 // No LPM instruction +#define DF_NO_LPM_X 0x00000040 // No LPM Rd,Z or LPM Rd,Z+ instruction +#define DF_NO_ELPM 0x00000080 // No ELPM instruction +#define DF_NO_ELPM_X 0x00000100 // No ELPM Rd,Z or LPM Rd,Z+ instruction +#define DF_NO_SPM 0x00000200 // No SPM instruction +#define DF_NO_ESPM 0x00000400 // No ESPM instruction +#define DF_NO_MOVW 0x00000800 // No MOVW instruction +#define DF_NO_BREAK 0x00001000 // No BREAK instruction +#define DF_NO_EICALL 0x00002000 // No EICALL instruction +#define DF_NO_EIJMP 0x00004000 // No EIJMP instruction + +struct device + { + char *name; + int flash_size; + int ram_size; + int eeprom_size; + int flag; + }; + +/* device.c */ +struct device *get_device(struct prog_info *pi,char *name); +void predef_dev(struct prog_info *pi); +void list_devices(); diff --git a/src/mkutil/avra-0.8/SOURCE/directiv.c b/src/mkutil/avra-0.8/SOURCE/directiv.c new file mode 100644 index 00000000..5f27dd4f --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/directiv.c @@ -0,0 +1,824 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "args.h" +#include "avra.h" +#include "device.h" + +enum + { + DIRECTIVE_BYTE = 0, + DIRECTIVE_CSEG, + DIRECTIVE_CSEGSIZE, + DIRECTIVE_DB, + DIRECTIVE_DEF, + DIRECTIVE_DEVICE, + DIRECTIVE_DSEG, + DIRECTIVE_DW, + DIRECTIVE_ENDM, + DIRECTIVE_ENDMACRO, + DIRECTIVE_EQU, + DIRECTIVE_ESEG, + DIRECTIVE_EXIT, + DIRECTIVE_INCLUDE, + DIRECTIVE_LIST, + DIRECTIVE_LISTMAC, + DIRECTIVE_MACRO, + DIRECTIVE_NOLIST, + DIRECTIVE_ORG, + DIRECTIVE_SET, + DIRECTIVE_DEFINE, + DIRECTIVE_UNDEF, + DIRECTIVE_IFDEF, + DIRECTIVE_IFNDEF, + DIRECTIVE_IF, + DIRECTIVE_ELSE, + DIRECTIVE_ELIF, + DIRECTIVE_ENDIF, + DIRECTIVE_MESSAGE, + DIRECTIVE_WARNING, + DIRECTIVE_ERROR, + DIRECTIVE_COUNT + }; + +char *directive_list[] = + { + "BYTE", + "CSEG", + "CSEGSIZE", + "DB", + "DEF", + "DEVICE", + "DSEG", + "DW", + "ENDM", + "ENDMACRO", + "EQU", + "ESEG", + "EXIT", + "INCLUDE", + "LIST", + "LISTMAC", + "MACRO", + "NOLIST", + "ORG", + "SET", + "DEFINE", + "UNDEF", + "IFDEF", + "IFNDEF", + "IF", + "ELSE", + "ELIF", + "ENDIF", + "MESSAGE", + "WARNING", + "ERROR" + }; + + +int parse_directive(struct prog_info *pi, int pass) + { + int directive, ok = True, i; + char *next, *data; + struct file_info *fi_bak; + struct label *label; + struct def *def; + struct data_list *includedir; + + next = get_next_token(pi->fi->scratch, TERM_SPACE); + for(i = 0; pi->fi->scratch[i] != '\0'; i++) + pi->fi->scratch[i] = toupper(pi->fi->scratch[i]); + directive = get_directive_type(pi->fi->scratch + 1); + if(directive == -1) + { + print_msg(pi, MSGTYPE_ERROR, "Unknown directive: %s", pi->fi->scratch); + return(True); + } + switch(directive) + { + case DIRECTIVE_BYTE: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".BYTE needs an operand"); + return(True); + } + if(pi->segment != SEGMENT_DATA) + print_msg(pi, MSGTYPE_ERROR, ".BYTE directive can only be used in data segment (.DSEG)"); + get_next_token(next, TERM_END); + if(!get_expr(pi, next, &i)) + return(False); + if((pass == PASS_2) && pi->list_line && pi->list_on) + { + fprintf(pi->list_file, "%06x %s", pi->dseg_addr, pi->list_line); + pi->list_line = NULL; + } + pi->dseg_addr += i; + if(pass == PASS_1) + pi->dseg_count += i; + break; + case DIRECTIVE_CSEG: + pi->segment = SEGMENT_CODE; + break; + case DIRECTIVE_CSEGSIZE: + break; + case DIRECTIVE_DB: + return(parse_db(pi, next, pass)); + break; + case DIRECTIVE_DEF: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".DEF needs an operand"); + return(True); + } + data = get_next_token(next, TERM_EQUAL); + if(!(data && (tolower(data[0]) == 'r') && isdigit(data[1]))) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs a register (e.g. .def BZZZT = r16)", next); + return(True); + } + i = atoi(&data[1]); + if(i > 31) + print_msg(pi, MSGTYPE_ERROR, "R%d is not a valid register", i); + for(def = pi->first_def; def; def = def->next) + if(!nocase_strcmp(def->name, next)) + { + def->reg = i; + return(True); + } + def = malloc(sizeof(struct def)); + if(!def) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + def->next = NULL; + if(pi->last_def) + pi->last_def->next = def; + else + pi->first_def = def; + pi->last_def = def; + def->name = malloc(strlen(next) + 1); + if(!def->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(def->name, next); + def->reg = i; + break; + case DIRECTIVE_DEVICE: + if(pass == PASS_2) + return(True); + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".DEVICE needs an operand"); + return(True); + } + get_next_token(next, TERM_END); + pi->device = get_device(pi,next); + if(!pi->device) + print_msg(pi, MSGTYPE_ERROR, "Unknown device: %s", next); + break; + case DIRECTIVE_DSEG: + pi->segment = SEGMENT_DATA; + break; + case DIRECTIVE_DW: + if(pi->segment == SEGMENT_DATA) + { + print_msg(pi, MSGTYPE_ERROR, "Can't use .DW directive in data segment (.DSEG)"); + return(True); + } + while(next) + { + data = get_next_token(next, TERM_COMMA); + if(pass == PASS_2) + { + if(!get_expr(pi, next, &i)) + return(False); + if((i < -32768) || (i > 65535)) + print_msg(pi, MSGTYPE_WARNING, "Value %d is out of range (-32768 <= k <= 65535). Will be masked", i); + } + if(pi->segment == SEGMENT_EEPROM) + { + if(pass == PASS_2) + { + write_ee_byte(pi, pi->eseg_addr, (unsigned char)i); + write_ee_byte(pi, pi->eseg_addr + 1, (unsigned char)(i >> 8)); + } + pi->eseg_addr += 2; + if(pass == PASS_1) + pi->eseg_count += 2; + } + else + { + if((pass == PASS_2) && pi->hfi) + write_prog_word(pi, pi->cseg_addr, i); + pi->cseg_addr++; + if(pass == PASS_1) + pi->cseg_count++; + } + next = data; + } + break; + case DIRECTIVE_ENDM: + case DIRECTIVE_ENDMACRO: + print_msg(pi, MSGTYPE_ERROR, "No .MACRO found before .ENDMACRO"); + break; + case DIRECTIVE_EQU: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".EQU needs an operand"); + return(True); + } + data = get_next_token(next, TERM_EQUAL); + if(!data) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs an expression (e.g. .EQU BZZZT = 0x2a)", next); + return(True); + } + get_next_token(data, TERM_END); + if(!get_expr(pi, data, &i)) + return(False); + for(label = pi->first_label; label; label = label->next) + { + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a label", next); + return(True); + } + } + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a .SET variable", next); + return(True); + } + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "Can't redefine constant %s, use .SET instead", next); + return(True); + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_constant) + pi->last_constant->next = label; + else + pi->first_constant = label; + pi->last_constant = label; + label->name = malloc(strlen(next) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, next); + label->value = i; + break; + case DIRECTIVE_ESEG: + pi->segment = SEGMENT_EEPROM; + break; + case DIRECTIVE_EXIT: + pi->fi->exit_file = True; + break; + case DIRECTIVE_INCLUDE: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, "Nothing to include"); + return(True); + } + next = term_string(pi, next); + if((pass == PASS_2) && pi->list_line && pi->list_on) + { + fprintf(pi->list_file, " %s", pi->list_line); + pi->list_line = NULL; + } + // Test if include is in local directory + ok = test_include(next); + data = NULL; + if(!ok) + for(includedir = GET_ARG(pi->args, ARG_INCLUDEDIR); includedir && !ok; includedir = includedir->next) + { + i = strlen(includedir->data); + if(data) + free(data); + data = malloc(i + strlen(next) + 2); + if(!data) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(data, includedir->data); + if((data[i - 1] != '\\') && (data[i - 1] != '/')) + data[i++] = '/'; + strcpy(&data[i], next); + ok = test_include(data); + } + if(ok) + { + fi_bak = pi->fi; + ok = parse_file(pi, data ? data : next, pass); + pi->fi = fi_bak; + } + else + print_msg(pi, MSGTYPE_ERROR, "cannot find include file"); + if(data) + free(data); + break; + case DIRECTIVE_LIST: + if(pass == PASS_2) + pi->list_on = True; + break; + case DIRECTIVE_LISTMAC: + if(pass == PASS_2) + SET_ARG(pi->args, ARG_LISTMAC, True); + break; + case DIRECTIVE_MACRO: + return(read_macro(pi, next, pass)); + break; + case DIRECTIVE_NOLIST: + if(pass == PASS_2) + pi->list_on = False; + break; + case DIRECTIVE_ORG: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".ORG needs an operand"); + return(True); + } + get_next_token(next, TERM_END); + if(!get_expr(pi, next, &i)) + return(False); + switch(pi->segment) + { + case SEGMENT_CODE: + pi->cseg_addr = i; + break; + case SEGMENT_DATA: + pi->dseg_addr = i; + break; + case SEGMENT_EEPROM: + pi->eseg_addr = i; + } + if(pi->fi->label) + pi->fi->label->value = i; + break; + case DIRECTIVE_SET: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".SET needs an operand"); + return(True); + } + data = get_next_token(next, TERM_EQUAL); + if(!data) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs an expression (e.g. .SET BZZZT = 0x2a)", next); + return(True); + } + get_next_token(data, TERM_END); + if(!get_expr(pi, data, &i)) + return(False); + for(label = pi->first_label; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a label", next); + return(True); + } + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a .EQU constant", next); + return(True); + } + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + label->value = i; + return(True); + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_variable) + pi->last_variable->next = label; + else + pi->first_variable = label; + pi->last_variable = label; + label->name = malloc(strlen(next) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, next); + label->value = i; + break; + case DIRECTIVE_DEFINE: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".DEFINE needs an operand"); + return(True); + } + data = get_next_token(next, TERM_SPACE); + if(data) + { + get_next_token(data, TERM_END); + if(!get_expr(pi, data, &i)) + return(False); + } + else + i = 1; + for(label = pi->first_label; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a label", next); + return(True); + } + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "%s have already been defined as a .SET variable", next); + return(True); + } + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, next)) + { + print_msg(pi, MSGTYPE_ERROR, "Can't redefine constant %s, use .SET instead", next); + return(True); + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + if(pi->last_constant) + pi->last_constant->next = label; + else + pi->first_constant = label; + pi->last_constant = label; + label->name = malloc(strlen(next) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, next); + label->value = i; + break; + case DIRECTIVE_UNDEF: // TODO + break; + case DIRECTIVE_IFDEF: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".IFDEF needs an operand"); + return(True); + } + get_next_token(next, TERM_END); + if(get_symbol(pi, next, NULL)) + pi->conditional_depth++; + else + { + if(!spool_conditional(pi, False)) + return(False); + } + break; + case DIRECTIVE_IFNDEF: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".IFNDEF needs an operand"); + return(True); + } + get_next_token(next, TERM_END); + if(get_symbol(pi, next, NULL)) + { + if(!spool_conditional(pi, False)) + return(False); + } + else + pi->conditional_depth++; + break; + case DIRECTIVE_IF: + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".IF needs an expression"); + return(True); + } + get_next_token(next, TERM_END); + if(!get_expr(pi, next, &i)) + return(False); + if(i) + pi->conditional_depth++; + else + { + if(!spool_conditional(pi, False)) + return(False); + } + break; + case DIRECTIVE_ELSE: + case DIRECTIVE_ELIF: + if(!spool_conditional(pi, True)) + return(False); + break; + case DIRECTIVE_ENDIF: + if(pi->conditional_depth == 0) + print_msg(pi, MSGTYPE_ERROR, "Too many .ENDIF"); + else + pi->conditional_depth--; + break; + case DIRECTIVE_MESSAGE: + if(pass == PASS_1) + return(True); + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, "No message string supplied"); + return(True); + } + next = term_string(pi, next); + print_msg(pi, MSGTYPE_MESSAGE, next); + break; + case DIRECTIVE_WARNING: + if(pass == PASS_1) + return(True); + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, "No warning string supplied"); + return(True); + } + next = term_string(pi, next); + print_msg(pi, MSGTYPE_WARNING, next); + break; + case DIRECTIVE_ERROR: + if(pass == PASS_1) + return(True); + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, "No error string supplied"); + return(True); + } + next = term_string(pi, next); + print_msg(pi, MSGTYPE_ERROR, next); + break; + } + return(ok); + } + + +int get_directive_type(char *directive) + { + int i; + + for(i = 0; i < DIRECTIVE_COUNT; i++) + if(!strcmp(directive, directive_list[i])) return(i); + return(-1); + } + + +char *term_string(struct prog_info *pi, char *string) + { + int i; + + if(string[0] != '\"') + print_msg(pi, MSGTYPE_ERROR, "String must be enclosed in \"-signs"); + else + string++; + for(i = 0; (string[i] != '\"') && !((string[i] == 10) || (string[i] == 13) || (string[i] == '\0')); i++); + if((string[i] == 10) || (string[i] == 13) || (string[i] == '\0')) + print_msg(pi, MSGTYPE_ERROR, "String is missing a closing \"-sign"); + string[i] = '\0'; + return(string); + } + + +int parse_db(struct prog_info *pi, char *next, int pass) + { + int i, count; + char *data, prev; + + if(pi->segment == SEGMENT_DATA) + { + print_msg(pi, MSGTYPE_ERROR, "Can't use .DB directive in data segment (.DSEG)"); + return(True); + } + count = 0; + while(next) + { + data = get_next_token(next, TERM_COMMA); + if(next[0] == '\"') + { + next = term_string(pi, next); + while(*next != '\0') + { + count++; + write_db(pi, *next, &prev, count, pass); + next++; + } + } + else + { + if(pass == PASS_2) + { + if(!get_expr(pi, next, &i)) + return(False); + if((i < -128) || (i > 255)) + print_msg(pi, MSGTYPE_WARNING, "Value %d is out of range (-128 <= k <= 255). Will be masked", i); + } + count++; + write_db(pi, (char)i, &prev, count, pass); + } + next = data; + } + if(pi->segment == SEGMENT_CODE) + { + if((count % 2) == 1) + { + if(pass == PASS_2) + { + write_prog_word(pi, pi->cseg_addr, prev & 0xff); + print_msg(pi, MSGTYPE_WARNING, "A .DB segment with an odd number of bytes is detected. A zero byte is added."); + } + pi->cseg_addr++; + if(pass == PASS_1) + pi->cseg_count++; + } + } + return(True); + } + + +void write_db(struct prog_info *pi, char byte, char *prev, int count, int pass) + { + if(pi->segment == SEGMENT_EEPROM) + { + if(pass == PASS_2) + write_ee_byte(pi, pi->eseg_addr, byte); + pi->eseg_addr++; + if(pass == PASS_1) + pi->eseg_count++; + } + else /* pi->segment == SEGMENT_CODE */ + { + if((count % 2) == 0) + { + if(pass == PASS_2) + write_prog_word(pi, pi->cseg_addr, (byte << 8) | (*prev & 0xff)); + pi->cseg_addr++; + if(pass == PASS_1) + pi->cseg_count++; + } + else + *prev = byte; + } + } + + +int spool_conditional(struct prog_info *pi, int only_endif) + { + int current_depth = 0, do_next; + + if(pi->macro_line) + { + while((pi->macro_line = pi->macro_line->next)) + { + pi->macro_call->line_index++; + if(check_conditional(pi, pi->macro_line->line, ¤t_depth, &do_next, only_endif)) + { + if(!do_next) + return(True); + } + else + return(False); + } + print_msg(pi, MSGTYPE_ERROR, "Found no closing .ENDIF in macro"); + } + else + { + while(fgets(pi->fi->buff, LINEBUFFER_LENGTH, pi->fi->fp)) + { + pi->fi->line_number++; + if(check_conditional(pi, pi->fi->buff, ¤t_depth, &do_next, only_endif)) + { + if(!do_next) + return(True); + } + else + return(False); + } + if(feof(pi->fi->fp)) + { + print_msg(pi, MSGTYPE_ERROR, "Found no closing .ENDIF"); + return(True); + } + else + { + perror(pi->fi->include_file->name); + return(False); + } + } + return(True); + } + + +int check_conditional(struct prog_info *pi, char *buff, int *current_depth, int *do_next, int only_endif) + { + int i = 0; + char *next; + + *do_next = False; + while(IS_HOR_SPACE(buff[i]) && !IS_END(buff[i])) i++; + if(buff[i] == '.') + { + i++; + if(!nocase_strncmp(&buff[i], "if", 2)) + (*current_depth)++; + else if(!nocase_strncmp(&buff[i], "endif", 5)) + { + if(*current_depth == 0) + return(True); + (*current_depth)--; + } + else if(!only_endif && (*current_depth == 0)) + { + if(!nocase_strncmp(&buff[i], "else", 4)) + { + pi->conditional_depth++; + return(True); + } + else if(!nocase_strncmp(&buff[i], "elif", 4)) + { + next = get_next_token(&buff[i], TERM_SPACE); + if(!next) + { + print_msg(pi, MSGTYPE_ERROR, ".ELIF needs an operand"); + return(True); + } + get_next_token(next, TERM_END); + if(!get_expr(pi, next, &i)) + return(False); + if(i) + pi->conditional_depth++; + else + { + if(!spool_conditional(pi, False)) + return(False); + } + return(True); + } + } + } + *do_next = True; + return(True); + } + +int test_include(const char *filename) +{ + FILE *fp; + fp = fopen(filename, "r"); + if(fp) + { + fclose(fp); + return(True); + } + else + return(False); +} diff --git a/src/mkutil/avra-0.8/SOURCE/expr.c b/src/mkutil/avra-0.8/SOURCE/expr.c new file mode 100644 index 00000000..67a75a32 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/expr.c @@ -0,0 +1,608 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "avra.h" +#include "device.h" + +#define IS_UNARY(x) ((x == '!') || (x == '-') || (x == '~')) +#define IS_OPERATOR(x) ((x == '+') || (x == '-') || (x == '*') || (x == '/') || (x == '%') || (x == '<') || (x == '>') || (x == '=') || (x == '!') || (x == '&') || (x == '^') || (x == '|')) +#define IS_2ND_OPERATOR(x) ((x == '<') || (x == '>') || (x == '=') || (x == '&') || (x == '|')) + +enum + { + OPERATOR_ERROR = 0, + OPERATOR_MUL, + OPERATOR_DIV, + OPERATOR_MOD, + OPERATOR_ADD, + OPERATOR_SUB, + OPERATOR_SHIFT_LEFT, + OPERATOR_SHIFT_RIGHT, + OPERATOR_LESS_THAN, + OPERATOR_LESS_OR_EQUAL, + OPERATOR_GREATER_THAN, + OPERATOR_GREATER_OR_EQUAL, + OPERATOR_EQUAL, + OPERATOR_NOT_EQUAL, + OPERATOR_BITWISE_AND, + OPERATOR_BITWISE_XOR, + OPERATOR_BITWISE_OR, + OPERATOR_LOGICAL_AND, + OPERATOR_LOGICAL_OR + }; + +enum + { + FUNCTION_LOW = 0, + FUNCTION_HIGH, + FUNCTION_BYTE2, + FUNCTION_BYTE3, + FUNCTION_BYTE4, + FUNCTION_LWRD, + FUNCTION_HWRD, + FUNCTION_PAGE, + FUNCTION_EXP2, + FUNCTION_LOG2, + FUNCTION_COUNT + }; + +struct element + { + struct element *next; + int data; + }; + +char *function_list[] = + { + "low(", + "high(", + "byte2(", + "byte3(", + "byte4(", + "lwrd(", + "hwrd(", + "page(", + "exp2(", + "log2(" + }; + +int get_expr(struct prog_info *pi, char *data, int *value) + { + int ok = True, end = False, i, count, first_flag, length, function; + char unary, *label; + struct element *element, *first_element = NULL, *temp_element; + struct element **last_element = &first_element; + + for(i = 0, count = 0, first_flag = True, unary = 0; ; i++) + { + if(IS_HOR_SPACE(data[i])); + else if(IS_END(data[i])) + { + if((count % 2) != 1) + print_msg(pi, MSGTYPE_ERROR, "Missing value in expression"); + else + end = True; + break; + } + else if(first_flag && IS_UNARY(data[i])) + { + unary = data[i]; + first_flag = False; + } + else if((count % 2) == 1) + { + if(!IS_OPERATOR(data[i])) + { + print_msg(pi, MSGTYPE_ERROR, "Illegal operator '%c'", data[i]); + break; + } + element = malloc(sizeof(struct element)); + if(!element) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + ok = False; + break; + } + element->next = NULL; + element->data = get_operator(&data[i]); + if(element->data == OPERATOR_ERROR) + { + if(IS_2ND_OPERATOR(data[i + 1])) + print_msg(pi, MSGTYPE_ERROR, "Unknown operator %c%c", data[i], data[i + 1]); + else + print_msg(pi, MSGTYPE_ERROR, "Unknown operator %c", data[i]); + break; + } + *last_element = element; + last_element = &element->next; + if(IS_2ND_OPERATOR(data[i + 1])) + i++; + count++; + first_flag = True; + unary = 0; + } + else + { + element = malloc(sizeof(struct element)); + if(!element) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + ok = False; + break; + } + element->next = NULL; + length = 0; + if(isdigit(data[i])) + { + if(tolower(data[i + 1]) == 'x') + { + i += 2; + while(isxdigit(data[i + length])) length++; // TODO: Sjekk overflow + element->data = atox_n(&data[i], length); + } + else if(tolower(data[i + 1]) == 'b') + { + i += 2; + element->data = 0; + while((data[i + length] == '1') || (data[i + length] == '0')) + { + element->data <<= 1; + element->data |= data[i + length++] - '0'; // TODO: Sjekk overflow + } + } + else + { + while(isdigit(data[i + length])) length++; + element->data = atoi_n(&data[i], length); // TODO: Sjekk overflow + } + } + else if(data[i] == '$') + { + i++; + while(isxdigit(data[i + length])) length++; + element->data = atox_n(&data[i], length); // TODO: Sjekk overflow + } + else if(data[i] == '\'') + { + i++; + element->data = data[i]; // TODO: Sjekk for siste ' + length = 2; + } + else if(data[i] == '(') + { + i++; + length = par_length(&data[i]); + if(length == -1) + { + print_msg(pi, MSGTYPE_ERROR, "Missing ')'"); + break; + } + data[i + length++] = '\0'; + ok = get_expr(pi, &data[i], &element->data); + if(!ok) + break; + } + else if(-1 != (function = get_function(&data[i]))) + { + while(data[i] != '(') i++; + i++; + length = par_length(&data[i]); + if(length == -1) + { + print_msg(pi, MSGTYPE_ERROR, "Missing ')'"); + break; + } + data[i + length++] = '\0'; + ok = get_expr(pi, &data[i], &element->data); + if(!ok) + break; + element->data = do_function(function, element->data); + } + else if(!nocase_strncmp(&data[i], "defined(", 8)) + { + i += 8; + length = par_length(&data[i]); + if(length == -1) + { + print_msg(pi, MSGTYPE_ERROR, "Missing ')'"); + break; + } + data[i + length++] = '\0'; + if(get_symbol(pi, &data[i], NULL)) + element->data = 1; + else + element->data = 0; + } + else if(!nocase_strncmp(&data[i], "supported(", 10)) + { + i += 10; + length = par_length(&data[i]); + if(length == -1) + { + print_msg(pi, MSGTYPE_ERROR, "Missing ')'"); + break; + } + data[i + length++] = '\0'; + element->data=is_supported(pi, &data[i]); + if (element->data<0) + { + if (toupper(data[i])=='X') + { + if (pi->device->flag&DF_NO_XREG) element->data = 0; + else element->data = 1; + } + else if (toupper(data[i])=='Y') + { + if (pi->device->flag&DF_NO_YREG) element->data = 0; + else element->data = 1; + } + else if (toupper(data[i])=='Z') + element->data = 1; + else + { + print_msg(pi, MSGTYPE_ERROR, "Unknown mnemonic: %s",&data[i]); + element->data = 0; + } + } + } + else + { + while(IS_LABEL(data[i + length])) length++; + if((length == 2) && !nocase_strncmp(&data[i], "PC", 2)) + element->data = pi->cseg_addr; + else + { + label = malloc(length + 1); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + ok = False; + break; + } + strncpy(label, &data[i], length); + label[length] = '\0'; + if(get_symbol(pi, label, &element->data)) + free(label); + else + { + print_msg(pi, MSGTYPE_ERROR, "Found no label/variable/constant named %s", label); + free(label); + break; + } + } + } + i += length - 1; + switch(unary) // TODO: Få den til å takle flere unary på rad. + { + case '-': + element->data = -element->data; + break; + case '!': + element->data = !element->data; + break; + case '~': + element->data = ~element->data; + } + *last_element = element; + last_element = &element->next; + count++; + first_flag = False; + } + } + if(end) + { + for(i = 13; (i >= 4) && (count != 1); i--) + { + for(element = first_element; element->next;) + { + if(test_operator_at_precedence(element->next->data, i)) // TODO: Vurder en hi_i for kjapphet + { + element->data = calc(pi, element->data, element->next->data, element->next->next->data); + temp_element = element->next->next->next; + free(element->next->next); + free(element->next); + count -= 2; + element->next = temp_element; + } + else + element = element->next->next; + } + } + *value = first_element->data; + } + for(element = first_element; element;) + { + temp_element = element; + element = element->next; + free(temp_element); + } + return(ok); + } + + +int get_operator(char *op) + { + switch(op[0]) + { + case '*': + return(OPERATOR_MUL); + case '/': + return(OPERATOR_DIV); + case '%': + return(OPERATOR_MOD); + case '+': + return(OPERATOR_ADD); + case '-': + return(OPERATOR_SUB); + case '<': + switch(op[1]) + { + case '<': + return(OPERATOR_SHIFT_LEFT); + case '=': + return(OPERATOR_LESS_OR_EQUAL); + default: + return(OPERATOR_LESS_THAN); + } + case '>': + switch(op[1]) + { + case '>': + return(OPERATOR_SHIFT_RIGHT); + case '=': + return(OPERATOR_GREATER_OR_EQUAL); + default: + return(OPERATOR_GREATER_THAN); + } + case '=': + if(op[1] == '=') + return(OPERATOR_EQUAL); + case '!': + if(op[1] == '=') + return(OPERATOR_NOT_EQUAL); + case '&': + if(op[1] == '&') + return(OPERATOR_LOGICAL_AND); + else + return(OPERATOR_BITWISE_AND); + case '^': + return(OPERATOR_BITWISE_XOR); + case '|': + if(op[1] == '|') + return(OPERATOR_LOGICAL_OR); + else + return(OPERATOR_BITWISE_OR); + } + return(OPERATOR_ERROR); + } + + +int test_operator_at_precedence(int operator, int precedence) + { + switch(precedence) + { + case 13: + return((operator == OPERATOR_MUL) || (operator == OPERATOR_DIV) + || (operator == OPERATOR_MOD)); + case 12: + return((operator == OPERATOR_ADD) || (operator == OPERATOR_SUB)); + case 11: + return((operator == OPERATOR_SHIFT_LEFT) || (operator == OPERATOR_SHIFT_RIGHT)); + case 10: + return((operator == OPERATOR_LESS_THAN) || (operator == OPERATOR_LESS_OR_EQUAL) + || (operator == OPERATOR_GREATER_THAN) || (operator == OPERATOR_GREATER_OR_EQUAL)); + case 9: + return((operator == OPERATOR_EQUAL) || (operator == OPERATOR_NOT_EQUAL)); + case 8: + return(operator == OPERATOR_BITWISE_AND); + case 7: + return(operator == OPERATOR_BITWISE_XOR); + case 6: + return(operator == OPERATOR_BITWISE_OR); + case 5: + return(operator == OPERATOR_LOGICAL_AND); + default: /* Makes the compiler shut up */ + case 4: + return(operator == OPERATOR_LOGICAL_OR); + } + } + + +int calc(struct prog_info *pi, int left, int operator, int right) // TODO: Sjekk litt resultater + { + switch(operator) + { + case OPERATOR_MUL: + return(left * right); + case OPERATOR_DIV: + if(right == 0) + { + print_msg(pi, MSGTYPE_ERROR, "Division by zero"); + return(0); + } + return(left / right); + case OPERATOR_MOD: + if(right == 0) + { + print_msg(pi, MSGTYPE_ERROR, "Division by zero (modulus operator)"); + return(0); + } + return(left % right); + case OPERATOR_ADD: + return(left + right); + case OPERATOR_SUB: + return(left - right); + case OPERATOR_SHIFT_LEFT: + return(left << right); + case OPERATOR_SHIFT_RIGHT: + return(left >> right); + case OPERATOR_LESS_THAN: + return(left < right); + case OPERATOR_LESS_OR_EQUAL: + return(left <= right); + case OPERATOR_GREATER_THAN: + return(left > right); + case OPERATOR_GREATER_OR_EQUAL: + return(left >= right); + case OPERATOR_EQUAL: + return(left == right); + case OPERATOR_NOT_EQUAL: + return(left != right); + case OPERATOR_BITWISE_AND: + return(left & right); + case OPERATOR_BITWISE_XOR: + return(left ^ right); + case OPERATOR_BITWISE_OR: + return(left | right); + case OPERATOR_LOGICAL_AND: + return(left && right); + default: /* Make the compiler shut up */ + case OPERATOR_LOGICAL_OR: + return(left || right); + } + } + + +int get_function(char *function) + { + int i; + + for(i = 0; i < FUNCTION_COUNT; i++) + if(!nocase_strncmp(function, function_list[i], strlen(function_list[i]))) return(i); + return(-1); + } + + +int do_function(int function, int value) + { + switch(function) + { + case FUNCTION_LOW: + return(value & 0xff); + case FUNCTION_HIGH: + case FUNCTION_BYTE2: + return((value >> 8) & 0xff); + case FUNCTION_BYTE3: + return((value >> 16) & 0xff); + case FUNCTION_BYTE4: + return((value >> 24) & 0xff); + case FUNCTION_LWRD: + return(value & 0xffff); + case FUNCTION_HWRD: + return((value >> 16) & 0xffff); + case FUNCTION_PAGE: + return((value >> 16) & 0xff); + case FUNCTION_EXP2: + return(1 << value); + case FUNCTION_LOG2: + return(log2(value)); + default: + return(0); + } + } + + +int log2(int value) + { + int i = 0; + + while(value >>= 1) i++; + return(i); + } + + +int get_symbol(struct prog_info *pi, char *label_name, int *data) + { + struct label *label; + struct macro_call *macro_call; + + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, label_name)) + { + if(data) + *data = label->value; + return(True); + } + + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, label_name)) + { + if(data) + *data = label->value; + return(True); + } + + for(macro_call = pi->macro_call; macro_call; macro_call = macro_call->prev_on_stack) + { + for(label = pi->macro_call->first_label; label; label = label->next) + if(!nocase_strcmp(label->name, label_name)) + { + if(data) + *data = label->value; + return(True); + } + } + + for(label = pi->first_label; label; label = label->next) + if(!nocase_strcmp(label->name, label_name)) + { + if(data) + *data = label->value; + return(True); + } + + return(False); + } + + +int par_length(char *data) + { + int i = 0, b_count = 1; + + for(;;) + { + if(data[i] == ')') + { + b_count--; + if(!b_count) + return(i); + } + else if(data[i] == '(') + b_count++; + else if(data[i] == '\0') + return(-1); + i++; + } + } + + + diff --git a/src/mkutil/avra-0.8/SOURCE/file.c b/src/mkutil/avra-0.8/SOURCE/file.c new file mode 100644 index 00000000..a14654d2 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/file.c @@ -0,0 +1,272 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "avra.h" +#include "args.h" + + +int open_out_files(struct prog_info *pi, char *filename) + { + int length; + char *buff; + time_t tp; + int ok; /* flag for coff results */ + + length = strlen(filename); + buff = malloc(length + 9); + if(buff) + { + strcpy(buff, filename); + if(length >= 4) + if(!nocase_strcmp(&buff[length - 4], ".asm")) + { + length -= 4; + buff[length] = '\0'; + } + strcpy(&buff[length], ".list"); + pi->list_file = fopen(buff, "w"); + if(pi->cseg_count) + { + strcpy(&buff[length], ".hex"); + pi->hfi = open_hex_file(buff); + strcpy(&buff[length], ".obj"); + pi->obj_file = open_obj_file(pi, buff); + } + if(pi->eseg_count) + { + strcpy(&buff[length], ".eep.hex"); + pi->eep_hfi = open_hex_file(buff); + } + + if(GET_ARG(pi->args, ARG_COFF)){ + strcpy(&buff[length], ".cof"); + pi->coff_file = open_coff_file(pi, buff); + if( pi->coff_file ) + ok = True; + else + ok = False; + } + else{ + pi->coff_file = 0; + ok = True; + } + + free(buff); + + if(pi->list_file && pi->obj_file && (!pi->cseg_count || pi->hfi) && (!pi->eseg_count || pi->eep_hfi) && ok) + { + if(time(&tp) != -1) + fprintf(pi->list_file, "\navra ver. %d.%d %s %s\n\n", VERSION, REVISION, filename, ctime(&tp)); + return(True); + } + else + close_out_files(pi); + } + else + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + + +void close_out_files(struct prog_info *pi) + { + if(pi->error_count == 0) + { + printf("Segment usage:\n" + " Code : %7d words (%d bytes)\n" + " Data : %7d bytes\n" + " EEPROM : %7d bytes\n", + pi->cseg_count, pi->cseg_count * 2, pi->dseg_count, pi->eseg_count); + } + if(pi->hfi) close_hex_file(pi->hfi); + if(pi->eep_hfi) close_hex_file(pi->eep_hfi); + if(pi->list_file) + { + if(pi->error_count == 0) + fprintf(pi->list_file, "\nAssembly completed with no errors.\n"); + fclose(pi->list_file); + } + if(pi->obj_file) close_obj_file(pi, pi->obj_file); + if(pi->coff_file) close_coff_file(pi, pi->coff_file); + } + + +struct hex_file_info *open_hex_file(char *filename) + { + struct hex_file_info *hfi; + + hfi = calloc(1, sizeof(struct hex_file_info)); + if(hfi) + { + hfi->segment = -1; + hfi->fp = fopen(filename, "wb"); + if(!hfi->fp) + { + close_hex_file(hfi); + hfi = NULL; + } + } + return(hfi); + } + + +void close_hex_file(struct hex_file_info *hfi) + { + if(hfi->fp) + { + if(hfi->count != 0) + do_hex_line(hfi); + fprintf(hfi->fp, ":00000001FF\x0d\x0a"); + fclose(hfi->fp); + } + free(hfi); + } + + +void write_ee_byte(struct prog_info *pi, int address, unsigned char data) + { + if((pi->eep_hfi->count == 16) || ((address != (pi->eep_hfi->linestart_addr + pi->eep_hfi->count)) && (pi->eep_hfi->count != 0))) + do_hex_line(pi->eep_hfi); + if(pi->eep_hfi->count == 0) + pi->eep_hfi->linestart_addr = address; + pi->eep_hfi->hex_line[pi->eep_hfi->count++] = data; + + if(pi->coff_file) + write_coff_eeprom(pi, address, data); + } + + +void write_prog_word(struct prog_info *pi, int address, int data) + { + write_obj_record(pi, address, data); + address *= 2; + if(pi->hfi->segment != (address >> 16)) + { + if(pi->hfi->count != 0) + do_hex_line(pi->hfi); + pi->hfi->segment = address >> 16; + if(pi->hfi->segment >= 16) // Use 04 record for addresses above 1 meg since 02 can support max 1 meg + fprintf(pi->hfi->fp, ":02000004%04X%02X\x0d\x0a", pi->hfi->segment & 0xffff, + (0 - 2 - 4 - ((pi->hfi->segment >> 8) & 0xff) - (pi->hfi->segment & 0xff)) & 0xff); + else // Use 02 record for addresses below 1 meg since more programmers know about the 02 instead of the 04 + fprintf(pi->hfi->fp, ":02000002%04X%02X\x0d\x0a", (pi->hfi->segment << 12) & 0xffff, + (0 - 2 - 2 - ((pi->hfi->segment << 4) & 0xf0)) & 0xff); + } + if((pi->hfi->count == 16) || ((address != (pi->hfi->linestart_addr + pi->hfi->count)) && (pi->hfi->count != 0))) + do_hex_line(pi->hfi); + if(pi->hfi->count == 0) + pi->hfi->linestart_addr = address; + pi->hfi->hex_line[pi->hfi->count++] = data & 0xff; + pi->hfi->hex_line[pi->hfi->count++] = (data >> 8) & 0xff; + + if(pi->coff_file != 0) + write_coff_program(pi, address, data); + } + + +void do_hex_line(struct hex_file_info *hfi) + { + int i; + unsigned char checksum = 0; + + fprintf(hfi->fp, ":%02X%04X00", hfi->count, hfi->linestart_addr & 0xffff); + checksum -= hfi->count + ((hfi->linestart_addr >> 8) & 0xff) + (hfi->linestart_addr & 0xff); + for(i = 0; i < hfi->count; i++) + { + fprintf(hfi->fp, "%02X", hfi->hex_line[i]); + checksum -= hfi->hex_line[i]; + } + fprintf(hfi->fp, "%02X\x0d\x0a", checksum); + hfi->count = 0; + } + + +FILE *open_obj_file(struct prog_info *pi, char *filename) + { + int i; + FILE *fp; + struct include_file *include_file; + + fp = fopen(filename, "wb"); + if(fp) + { + i = pi->cseg_count * 9 + 26; + fputc((i >> 24) & 0xff, fp); + fputc((i >> 16) & 0xff, fp); + fputc((i >> 8) & 0xff, fp); + fputc(i & 0xff, fp); + i = 26; + fputc((i >> 24) & 0xff, fp); + fputc((i >> 16) & 0xff, fp); + fputc((i >> 8) & 0xff, fp); + fputc(i & 0xff, fp); + fputc(9, fp); + i = 0; + for(include_file = pi->first_include_file; include_file; include_file = include_file->next) + i++; + fputc(i, fp); + fprintf(fp, "AVR Object File"); + fputc('\0', fp); + } + return(fp); + } + + +void close_obj_file(struct prog_info *pi, FILE *fp) + { + struct include_file *include_file; + + for(include_file = pi->first_include_file; include_file; include_file = include_file->next) + { + fprintf(fp, "%s", include_file->name); + fputc('\0', fp); + } + fputc('\0', fp); + fclose(fp); + } + + +void write_obj_record(struct prog_info *pi, int address, int data) + { + fputc((address >> 16) & 0xff, pi->obj_file); + fputc((address >> 8) & 0xff, pi->obj_file); + fputc(address & 0xff, pi->obj_file); + fputc((data >> 8) & 0xff, pi->obj_file); + fputc(data & 0xff, pi->obj_file); + fputc(pi->fi->include_file->num & 0xff, pi->obj_file); + fputc((pi->fi->line_number >> 8) & 0xff, pi->obj_file); + fputc(pi->fi->line_number & 0xff, pi->obj_file); + if(pi->macro_call) + fputc(1, pi->obj_file); + else + fputc(0, pi->obj_file); + } diff --git a/src/mkutil/avra-0.8/SOURCE/macro.c b/src/mkutil/avra-0.8/SOURCE/macro.c new file mode 100644 index 00000000..14b38af7 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/macro.c @@ -0,0 +1,427 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "args.h" +#include "avra.h" +#include "device.h" + +int read_macro(struct prog_info *pi, char *name, int pass) + { + int loopok, i; + struct macro *macro; + struct macro_line *macro_line, **last_macro_line; + + if(pass == PASS_1) + { + if(!name) + { + print_msg(pi, MSGTYPE_ERROR, "Missing macro name"); + return(True); + } + get_next_token(name, TERM_END); + // TODO: Sjekk om navnet er gyldig. Bare isalnum() og '_' + macro = calloc(1, sizeof(struct macro)); + if(!macro) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + if(pi->last_macro) + pi->last_macro->next = macro; + else + pi->first_macro = macro; + pi->last_macro = macro; + macro->name = malloc(strlen(name) + 1); + if(!macro->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(macro->name, name); + macro->include_file = pi->fi->include_file; + macro->first_line_number = pi->fi->line_number; + last_macro_line = ¯o->first_macro_line; + } + else if(pi->list_line && pi->list_on) /* pass == PASS_2 */ + { + fprintf(pi->list_file, " %s", pi->list_line); + pi->list_line = NULL; + } + loopok = True; + while(loopok) + { + if(fgets(pi->fi->buff, LINEBUFFER_LENGTH, pi->fi->fp)) + { + pi->fi->line_number++; + i = 0; + while(IS_HOR_SPACE(pi->fi->buff[i]) && !IS_END(pi->fi->buff[i])) i++; + if(pi->fi->buff[i] == '.') + { + i++; + if(!nocase_strncmp(&pi->fi->buff[i], "endm", 4)) // TODO: Vurder å sjekke navnet bedre + loopok = False; + } + if(pass == PASS_1) + { + if(loopok) + { + macro_line = calloc(1, sizeof(struct macro_line)); + if(!macro_line) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + *last_macro_line = macro_line; + last_macro_line = ¯o_line->next; + macro_line->line = malloc(strlen(pi->fi->buff) + 1); + if(!macro_line->line) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(macro_line->line, pi->fi->buff); + } + } + else if(pi->fi->buff && pi->list_file) + { + if(pi->fi->buff[i] == ';') + fprintf(pi->list_file, " %s", pi->fi->buff); + else + fprintf(pi->list_file, " %s", pi->fi->buff); + } + } + else + { + if(feof(pi->fi->fp)) + { + print_msg(pi, MSGTYPE_ERROR, "Found no closing .ENDMACRO"); + return(True); + } + else + { + perror(pi->fi->include_file->name); + return(False); + } + } + } + return(True); + } + + +struct macro *get_macro(struct prog_info *pi, char *name) + { + struct macro *macro; + + for(macro = pi->first_macro; macro; macro = macro->next) + if(!nocase_strcmp(macro->name, name)) + return(macro); + return(NULL); + } +/* +append_arg(char * argfield, char * arg) +{ + argfield = arg; +} +*/ + +void append_type(struct prog_info *pi, char *name, int c, char *value) +{ + int p; + struct def *def; + + p = strlen(name); + name[p++] = '_'; + + if(c == 0) + { + name[p++] = 'v'; + name[p] = '\0'; + return; + } + + for(def = pi->first_def; def; def = def->next) + if(!nocase_strcmp(def->name, value)) + { + itoa((c*8),&name[p],10); + return; + } + + name[p++] = 'i'; + name[p] = '\0'; +} + +/* + * This routine replaces the macro call with mnemonics + */ + +int expand_macro(struct prog_info *pi, struct macro *macro, char *rest_line, int pass) +{ + int ok = True, macro_arg_count = 0, i, j; + char *line, *temp, *macro_args[MAX_MACRO_ARGS]; + char buff[LINEBUFFER_LENGTH]; + struct macro_line *old_macro_line; + struct macro_call *macro_call; + + // added by TW + int off,a,c ; + char arg,ec = False; // extended code switch + char macro_argtype[MAX_MACRO_ARGS][4]; // 3D array for argument types and name translation + char *nmn; //string buffer for new macro name + char buffer[LINEBUFFER_LENGTH]; + int p; + + if(rest_line) + { + line = malloc(strlen(rest_line) + 1); + if(!line) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(line, rest_line); + temp = line; + + /* here we split up the macro arguments into "macro_args" + * Extended macro code interpreter added by TW 2002 + */ + + if( temp[0] == '[' ) // there must be "[" "," "]", else it is garbage + { + if(!strchr(temp, ']')) + { + print_msg(pi, MSGTYPE_ERROR, "found no ']'"); + return(False); + } + temp = &temp[1]; // skip the first bracket + nmn = malloc(LINEBUFFER_LENGTH); + if(!nmn) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(nmn,macro->name); // create a new macro name buffer + c = 1; // byte counter + //ec = True; // switch to ext. code + arg = True; // loop flag + + while(arg) + { + while(IS_HOR_SPACE(temp[0])) //skip leading spaces + { temp = &temp[1]; } + + off = 0; // pointer offset + + do + { + switch(temp[off]) //test current character code + { + case ':': + temp[off] = '\0'; + if(off > 0) + { + c++; + macro_args[macro_arg_count++] = temp; + } + else + { + print_msg(pi, MSGTYPE_ERROR, "missig register before ':'",nmn); + return(False); + } + break; + + case ']': + arg = False; + case ',': + a = off; + do temp[a--] = '\0'; while( IS_HOR_SPACE(temp[a]) ); + if(off > 0) + { + macro_args[macro_arg_count++] = temp; + append_type(pi, nmn, c, temp); + c = 1; + } + else + { + append_type(pi, nmn, 0, temp); + c = 1; + } + break; + + default: + off++; + } + } + while(temp[off] != '\0'); + + if(arg) temp = &temp[off+1]; + else break; + } + + macro = get_macro(pi,nmn); + if(macro == NULL) + { + print_msg(pi, MSGTYPE_ERROR, "Macro %s not defined !",nmn); + return(False); + } + } + else + { + line = malloc(strlen(rest_line) + 1); + if(!line) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(line, rest_line); + temp = line; + while(temp) + { + macro_args[macro_arg_count++] = temp; + temp = get_next_token(temp, TERM_COMMA); + } + } + + + +/* + if(IS_END(temp[i])) + { + temp[i--] = '\0'; + while(IS_HOR_SPACE(temp[i])) temp[i--] = '\0'; + return(0); + } + + * former code from orginial + while(temp) // as long as there valid data in "temp" + { + macro_args[macro_arg_count++] = temp; + temp = get_next_token(temp, TERM_COMMA); + } + */ + } + + if(pass == PASS_1) + { + macro_call = calloc(1, sizeof(struct macro_call)); + if(!macro_call) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + if(pi->last_macro_call) + pi->last_macro_call->next = macro_call; + else + pi->first_macro_call = macro_call; + pi->last_macro_call = macro_call; + macro_call->line_number = pi->fi->line_number; + macro_call->include_file = pi->fi->include_file; + macro_call->macro = macro; + macro_call->prev_on_stack = pi->macro_call; + if(macro_call->prev_on_stack) + { + macro_call->nest_level = macro_call->prev_on_stack->nest_level + 1; + macro_call->prev_line_index = macro_call->prev_on_stack->line_index; + } + } + else + { + for(macro_call = pi->first_macro_call; macro_call; macro_call = macro_call->next) + { + if((macro_call->include_file->num == pi->fi->include_file->num) + && (macro_call->line_number == pi->fi->line_number)) + { + if(pi->macro_call) + { + /* Find correct macro_call when using recursion and nesting */ + if(macro_call->prev_on_stack == pi->macro_call) + if((macro_call->nest_level == (pi->macro_call->nest_level + 1)) + && (macro_call->prev_line_index == pi->macro_call->line_index)) + break; + } + else + break; + } + } + if(pi->list_line && pi->list_on) + { + fprintf(pi->list_file, "%06x + %s", pi->cseg_addr, pi->list_line); + pi->list_line = NULL; + } + } + macro_call->line_index = 0; + pi->macro_call = macro_call; + old_macro_line = pi->macro_line; + for(pi->macro_line = macro->first_macro_line; pi->macro_line && ok; pi->macro_line = pi->macro_line->next) + { + macro_call->line_index++; + if(GET_ARG(pi->args, ARG_LISTMAC)) + pi->list_line = buff; + else + pi->list_line = NULL; + for(i = 0, j = 0; pi->macro_line->line[i] != '\0'; i++) + { + if(pi->macro_line->line[i] == '@') + { + i++; + if(!isdigit(pi->macro_line->line[i])) + print_msg(pi, MSGTYPE_ERROR, "@ must be followed by a number"); + else if((pi->macro_line->line[i] - '0') >= macro_arg_count) + print_msg(pi, MSGTYPE_ERROR, "Missing macro argument (for @%c)", pi->macro_line->line[i]); + else + { + strcpy(&buff[j], macro_args[pi->macro_line->line[i] - '0']); + j += strlen(macro_args[pi->macro_line->line[i] - '0']); + } + } + else + buff[j++] = pi->macro_line->line[i]; + } + buff[j] = '\0'; + ok = parse_line(pi, buff, pass); + if(ok) + { + if((pass == PASS_2) && pi->list_line && pi->list_on) + fprintf(pi->list_file, " %s", pi->list_line); + if(pi->error_count >= pi->max_errors) + { + print_msg(pi, MSGTYPE_MESSAGE, "Maximum error count reached. Exiting..."); + break; + } + } + } + pi->macro_line = old_macro_line; + pi->macro_call = macro_call->prev_on_stack; + if(rest_line) + free(line); + return(ok); + } + diff --git a/src/mkutil/avra-0.8/SOURCE/map.c b/src/mkutil/avra-0.8/SOURCE/map.c new file mode 100644 index 00000000..04ce83c0 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/map.c @@ -0,0 +1,70 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include "avra.h" +#include +#include +#include "args.h" + +char *Space(char *n); + +void write_map_file(struct prog_info *pi) + { + FILE *fp; + struct label *label; + char File[200],*P; + + strcpy(File,(char *)pi->args->first_data->data); + P = strrchr(File,'.'); + if( P ) *P = 0; + strcat(File,".map"); + fp = fopen(File,"w"); + if( fp == NULL ) { + fprintf(stderr,"Error: cannot write map file\n"); + return; + } + for(label = pi->first_constant; label; label = label->next) + fprintf(fp,"%s%sC\t%04x\t%d\n",label->name,Space(label->name),label->value,label->value); + + for(label = pi->first_variable; label; label = label->next) + fprintf(fp,"%s%sV\t%04x\t%d\n",label->name,Space(label->name),label->value,label->value); + + for(label = pi->first_label; label; label = label->next) + fprintf(fp,"%s%sL\t%04x\t%d\n",label->name,Space(label->name),label->value,label->value); + + fprintf(fp,"\n"); + fclose(fp); + return; + } + +char *Space(char *n) { + int i; + + i = strlen(n); + if( i < 1) return "\t\t\t"; + if( i < 8 ) return "\t\t"; + return "\t"; +} diff --git a/src/mkutil/avra-0.8/SOURCE/misc.h b/src/mkutil/avra-0.8/SOURCE/misc.h new file mode 100644 index 00000000..b0a68bea --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/misc.h @@ -0,0 +1,14 @@ +/* + * Misc stuff + */ + +enum boolean {False = 0, True}; + +enum filetype + { + AVRSTUDIO = 0, + GENERIC, + INTEL, + MOTOROLA + }; + diff --git a/src/mkutil/avra-0.8/SOURCE/mnemonic.c b/src/mkutil/avra-0.8/SOURCE/mnemonic.c new file mode 100644 index 00000000..3b0f1f55 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/mnemonic.c @@ -0,0 +1,871 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "avra.h" +#include "device.h" + +#define MAX_MNEMONIC_LEN 8 // Maximum mnemonic length + +enum + { + MNEMONIC_NOP = 0, // 0000 0000 0000 0000 + MNEMONIC_SEC, // 1001 0100 0000 1000 + MNEMONIC_CLC, // 1001 0100 1000 1000 + MNEMONIC_SEN, // 1001 0100 0010 1000 + MNEMONIC_CLN, // 1001 0100 1010 1000 + MNEMONIC_SEZ, // 1001 0100 0001 1000 + MNEMONIC_CLZ, // 1001 0100 1001 1000 + MNEMONIC_SEI, // 1001 0100 0111 1000 + MNEMONIC_CLI, // 1001 0100 1111 1000 + MNEMONIC_SES, // 1001 0100 0100 1000 + MNEMONIC_CLS, // 1001 0100 1100 1000 + MNEMONIC_SEV, // 1001 0100 0011 1000 + MNEMONIC_CLV, // 1001 0100 1011 1000 + MNEMONIC_SET, // 1001 0100 0110 1000 + MNEMONIC_CLT, // 1001 0100 1110 1000 + MNEMONIC_SEH, // 1001 0100 0101 1000 + MNEMONIC_CLH, // 1001 0100 1101 1000 + MNEMONIC_SLEEP, // 1001 0101 1000 1000 + MNEMONIC_WDR, // 1001 0101 1010 1000 + MNEMONIC_IJMP, // 1001 0100 0000 1001 + MNEMONIC_EIJMP, // 1001 0100 0001 1001 + MNEMONIC_ICALL, // 1001 0101 0000 1001 + MNEMONIC_EICALL, // 1001 0101 0001 1001 + MNEMONIC_RET, // 1001 0101 0000 1000 + MNEMONIC_RETI, // 1001 0101 0001 1000 + MNEMONIC_SPM, // 1001 0101 1110 1000 + MNEMONIC_ESPM, // 1001 0101 1111 1000 + MNEMONIC_BREAK, // 1001 0101 1001 1000 + MNEMONIC_LPM, // 1001 0101 1100 1000 + MNEMONIC_ELPM, // 1001 0101 1101 1000 + MNEMONIC_BSET, // s 1001 0100 0sss 1000 + MNEMONIC_BCLR, // s 1001 0100 1sss 1000 + MNEMONIC_SER, // Rd 1110 1111 dddd 1111 + MNEMONIC_COM, // Rd 1001 010d dddd 0000 + MNEMONIC_NEG, // Rd 1001 010d dddd 0001 + MNEMONIC_INC, // Rd 1001 010d dddd 0011 + MNEMONIC_DEC, // Rd 1001 010d dddd 1010 + MNEMONIC_LSR, // Rd 1001 010d dddd 0110 + MNEMONIC_ROR, // Rd 1001 010d dddd 0111 + MNEMONIC_ASR, // Rd 1001 010d dddd 0101 + MNEMONIC_SWAP, // Rd 1001 010d dddd 0010 + MNEMONIC_PUSH, // Rr 1001 001r rrrr 1111 + MNEMONIC_POP, // Rd 1001 000d dddd 1111 + MNEMONIC_TST, // Rd 0010 00dd dddd dddd + MNEMONIC_CLR, // Rd 0010 01dd dddd dddd + MNEMONIC_LSL, // Rd 0000 11dd dddd dddd + MNEMONIC_ROL, // Rd 0001 11dd dddd dddd + MNEMONIC_BREQ, // k 1111 00kk kkkk k001 + MNEMONIC_BRNE, // k 1111 01kk kkkk k001 + MNEMONIC_BRCS, // k 1111 00kk kkkk k000 + MNEMONIC_BRCC, // k 1111 01kk kkkk k000 + MNEMONIC_BRSH, // k 1111 01kk kkkk k000 + MNEMONIC_BRLO, // k 1111 00kk kkkk k000 + MNEMONIC_BRMI, // k 1111 00kk kkkk k010 + MNEMONIC_BRPL, // k 1111 01kk kkkk k010 + MNEMONIC_BRGE, // k 1111 01kk kkkk k100 + MNEMONIC_BRLT, // k 1111 00kk kkkk k100 + MNEMONIC_BRHS, // k 1111 00kk kkkk k101 + MNEMONIC_BRHC, // k 1111 01kk kkkk k101 + MNEMONIC_BRTS, // k 1111 00kk kkkk k110 + MNEMONIC_BRTC, // k 1111 01kk kkkk k110 + MNEMONIC_BRVS, // k 1111 00kk kkkk k011 + MNEMONIC_BRVC, // k 1111 01kk kkkk k011 + MNEMONIC_BRIE, // k 1111 00kk kkkk k111 + MNEMONIC_BRID, // k 1111 01kk kkkk k111 + MNEMONIC_RJMP, // k 1100 kkkk kkkk kkkk + MNEMONIC_RCALL, // k 1101 kkkk kkkk kkkk + MNEMONIC_JMP, // k 1001 010k kkkk 110k + 16k + MNEMONIC_CALL, // k 1001 010k kkkk 111k + 16k + MNEMONIC_BRBS, // s, k 1111 00kk kkkk ksss + MNEMONIC_BRBC, // s, k 1111 01kk kkkk ksss + MNEMONIC_ADD, // Rd, Rr 0000 11rd dddd rrrr + MNEMONIC_ADC, // Rd, Rr 0001 11rd dddd rrrr + MNEMONIC_SUB, // Rd, Rr 0001 10rd dddd rrrr + MNEMONIC_SBC, // Rd, Rr 0000 10rd dddd rrrr + MNEMONIC_AND, // Rd, Rr 0010 00rd dddd rrrr + MNEMONIC_OR, // Rd, Rr 0010 10rd dddd rrrr + MNEMONIC_EOR, // Rd, Rr 0010 01rd dddd rrrr + MNEMONIC_CP, // Rd, Rr 0001 01rd dddd rrrr + MNEMONIC_CPC, // Rd, Rr 0000 01rd dddd rrrr + MNEMONIC_CPSE, // Rd, Rr 0001 00rd dddd rrrr + MNEMONIC_MOV, // Rd, Rr 0010 11rd dddd rrrr + MNEMONIC_MUL, // Rd, Rr 1001 11rd dddd rrrr + MNEMONIC_MOVW, // Rd, Rr 0000 0001 dddd rrrr + MNEMONIC_MULS, // Rd, Rr 0000 0010 dddd rrrr + MNEMONIC_MULSU, // Rd, Rr 0000 0011 0ddd 0rrr + MNEMONIC_FMUL, // Rd, Rr 0000 0011 0ddd 1rrr + MNEMONIC_FMULS, // Rd, Rr 0000 0011 1ddd 0rrr + MNEMONIC_FMULSU, // Rd, Rr 0000 0011 1ddd 1rrr + MNEMONIC_ADIW, // Rd, K 1001 0110 KKdd KKKK + MNEMONIC_SBIW, // Rd, K 1001 0111 KKdd KKKK + MNEMONIC_SUBI, // Rd, K 0101 KKKK dddd KKKK + MNEMONIC_SBCI, // Rd, K 0100 KKKK dddd KKKK + MNEMONIC_ANDI, // Rd, K 0111 KKKK dddd KKKK + MNEMONIC_ORI, // Rd, K 0110 KKKK dddd KKKK + MNEMONIC_SBR, // Rd, K 0110 KKKK dddd KKKK + MNEMONIC_CPI, // Rd, K 0011 KKKK dddd KKKK + MNEMONIC_LDI, // Rd, K 1110 KKKK dddd KKKK + MNEMONIC_CBR, // Rd, K 0111 KKKK dddd KKKK ~K + MNEMONIC_SBRC, // Rr, b 1111 110r rrrr 0bbb + MNEMONIC_SBRS, // Rr, b 1111 111r rrrr 0bbb + MNEMONIC_BST, // Rr, b 1111 101d dddd 0bbb + MNEMONIC_BLD, // Rd, b 1111 100d dddd 0bbb + MNEMONIC_IN, // Rd, P 1011 0PPd dddd PPPP + MNEMONIC_OUT, // P, Rr 1011 1PPr rrrr PPPP + MNEMONIC_SBIC, // P, b 1001 1001 PPPP Pbbb + MNEMONIC_SBIS, // P, b 1001 1011 PPPP Pbbb + MNEMONIC_SBI, // P, b 1001 1010 PPPP Pbbb + MNEMONIC_CBI, // P, b 1001 1000 PPPP Pbbb + MNEMONIC_LDS, // Rd, k 1001 000d dddd 0000 + 16k + MNEMONIC_STS, // k, Rr 1001 001d dddd 0000 + 16k + MNEMONIC_LD, // Rd, __ dummy + MNEMONIC_ST, // __, Rr dummy + MNEMONIC_LDD, // Rd, _+q dummy + MNEMONIC_STD, // _+q, Rr dummy + MNEMONIC_COUNT, + MNEMONIC_LPM_Z, // Rd, Z 1001 000d dddd 0100 + MNEMONIC_LPM_ZP, // Rd, Z+ 1001 000d dddd 0101 + MNEMONIC_ELPM_Z, // Rd, Z 1001 000d dddd 0110 + MNEMONIC_ELPM_ZP, // Rd, Z+ 1001 000d dddd 0111 + MNEMONIC_LD_X, // Rd, X 1001 000d dddd 1100 + MNEMONIC_LD_XP, // Rd, X+ 1001 000d dddd 1101 + MNEMONIC_LD_MX, // Rd, -X 1001 000d dddd 1110 + MNEMONIC_LD_Y, // Rd, Y 1000 000d dddd 1000 + MNEMONIC_LD_YP, // Rd, Y+ 1001 000d dddd 1001 + MNEMONIC_LD_MY, // Rd, -Y 1001 000d dddd 1010 + MNEMONIC_LD_Z, // Rd, Z 1000 000d dddd 0000 + MNEMONIC_LD_ZP, // Rd, Z+ 1001 000d dddd 0001 + MNEMONIC_LD_MZ, // Rd, -Z 1001 000d dddd 0010 + MNEMONIC_ST_X, // X, Rr 1001 001d dddd 1100 + MNEMONIC_ST_XP, // X+, Rr 1001 001d dddd 1101 + MNEMONIC_ST_MX, // -X, Rr 1001 001d dddd 1110 + MNEMONIC_ST_Y, // Y, Rr 1000 001d dddd 1000 + MNEMONIC_ST_YP, // Y+, Rr 1001 001d dddd 1001 + MNEMONIC_ST_MY, // -Y, Rr 1001 001d dddd 1010 + MNEMONIC_ST_Z, // Z, Rr 1000 001d dddd 0000 + MNEMONIC_ST_ZP, // Z+, Rr 1001 001d dddd 0001 + MNEMONIC_ST_MZ, // -Z, Rr 1001 001d dddd 0010 + MNEMONIC_LDD_Y, // Rd, Y+q 10q0 qq0d dddd 1qqq + MNEMONIC_LDD_Z, // Rd, Z+q 10q0 qq0d dddd 0qqq + MNEMONIC_STD_Y, // Y+q, Rr 10q0 qq1r rrrr 1qqq + MNEMONIC_STD_Z, // Z+q, Rr 10q0 qq1r rrrr 0qqq + MNEMONIC_END + }; + +struct instruction + { + char *mnemonic; + int opcode; + int flag; /* Device flags meaning the instruction is not + supported */ + }; + +struct instruction instruction_list[] = + { + {"nop", 0x0000, 0}, + {"sec", 0x9408, 0}, + {"clc", 0x9488, 0}, + {"sen", 0x9428, 0}, + {"cln", 0x94a8, 0}, + {"sez", 0x9418, 0}, + {"clz", 0x9498, 0}, + {"sei", 0x9478, 0}, + {"cli", 0x94f8, 0}, + {"ses", 0x9448, 0}, + {"cls", 0x94c8, 0}, + {"sev", 0x9438, 0}, + {"clv", 0x94b8, 0}, + {"set", 0x9468, 0}, + {"clt", 0x94e8, 0}, + {"seh", 0x9458, 0}, + {"clh", 0x94d8, 0}, + {"sleep", 0x9588, 0}, + {"wdr", 0x95a8, 0}, + {"ijmp", 0x9409, DF_TINY1X}, + {"eijmp", 0x9419, DF_NO_EIJMP}, + {"icall", 0x9509, DF_TINY1X}, + {"eicall",0x9519, DF_NO_EICALL}, + {"ret", 0x9508, 0}, + {"reti", 0x9518, 0}, + {"spm", 0x95e8, DF_NO_SPM}, + {"espm", 0x95f8, DF_NO_ESPM}, + {"break", 0x9598, DF_NO_BREAK}, + {"lpm", 0x95c8, DF_NO_LPM}, + {"elpm", 0x95d8, DF_NO_ELPM}, + {"bset", 0x9408, 0}, + {"bclr", 0x9488, 0}, + {"ser", 0xef0f, 0}, + {"com", 0x9400, 0}, + {"neg", 0x9401, 0}, + {"inc", 0x9403, 0}, + {"dec", 0x940a, 0}, + {"lsr", 0x9406, 0}, + {"ror", 0x9407, 0}, + {"asr", 0x9405, 0}, + {"swap", 0x9402, 0}, + {"push", 0x920f, DF_TINY1X}, + {"pop", 0x900f, DF_TINY1X}, + {"tst", 0x2000, 0}, + {"clr", 0x2400, 0}, + {"lsl", 0x0c00, 0}, + {"rol", 0x1c00, 0}, + {"breq", 0xf001, 0}, + {"brne", 0xf401, 0}, + {"brcs", 0xf000, 0}, + {"brcc", 0xf400, 0}, + {"brsh", 0xf400, 0}, + {"brlo", 0xf000, 0}, + {"brmi", 0xf002, 0}, + {"brpl", 0xf402, 0}, + {"brge", 0xf404, 0}, + {"brlt", 0xf004, 0}, + {"brhs", 0xf005, 0}, + {"brhc", 0xf405, 0}, + {"brts", 0xf006, 0}, + {"brtc", 0xf406, 0}, + {"brvs", 0xf003, 0}, + {"brvc", 0xf403, 0}, + {"brie", 0xf007, 0}, + {"brid", 0xf407, 0}, + {"rjmp", 0xc000, 0}, + {"rcall", 0xd000, 0}, + {"jmp", 0x940c, DF_NO_JMP}, + {"call", 0x940e, DF_NO_JMP}, + {"brbs", 0xf000, 0}, + {"brbc", 0xf400, 0}, + {"add", 0x0c00, 0}, + {"adc", 0x1c00, 0}, + {"sub", 0x1800, 0}, + {"sbc", 0x0800, 0}, + {"and", 0x2000, 0}, + {"or", 0x2800, 0}, + {"eor", 0x2400, 0}, + {"cp", 0x1400, 0}, + {"cpc", 0x0400, 0}, + {"cpse", 0x1000, 0}, + {"mov", 0x2c00, 0}, + {"mul", 0x9c00, DF_NO_MUL}, + {"movw", 0x0100, DF_NO_MOVW}, + {"muls", 0x0200, DF_NO_MUL}, + {"mulsu", 0x0300, DF_NO_MUL}, + {"fmul", 0x0308, DF_NO_MUL}, + {"fmuls", 0x0380, DF_NO_MUL}, + {"fmulsu",0x0388, DF_NO_MUL}, + {"adiw", 0x9600, DF_TINY1X}, + {"sbiw", 0x9700, DF_TINY1X}, + {"subi", 0x5000, 0}, + {"sbci", 0x4000, 0}, + {"andi", 0x7000, 0}, + {"ori", 0x6000, 0}, + {"sbr", 0x6000, 0}, + {"cpi", 0x3000, 0}, + {"ldi", 0xe000, 0}, + {"cbr", 0x7000, 0}, + {"sbrc", 0xfc00, 0}, + {"sbrs", 0xfe00, 0}, + {"bst", 0xfa00, 0}, + {"bld", 0xf800, 0}, + {"in", 0xb000, 0}, + {"out", 0xb800, 0}, + {"sbic", 0x9900, 0}, + {"sbis", 0x9b00, 0}, + {"sbi", 0x9a00, 0}, + {"cbi", 0x9800, 0}, + {"lds", 0x9000, DF_TINY1X}, + {"sts", 0x9200, DF_TINY1X}, + {"ld", 0, 0}, + {"st", 0, 0}, + {"ldd", 0, DF_TINY1X}, + {"std", 0, DF_TINY1X}, + {"count", 0, 0}, + {"lpm", 0x9004, DF_NO_LPM|DF_NO_LPM_X}, + {"lpm", 0x9005, DF_NO_LPM|DF_NO_LPM_X}, + {"elpm", 0x9006, DF_NO_ELPM|DF_NO_ELPM_X}, + {"elpm", 0x9007, DF_NO_ELPM|DF_NO_ELPM_X}, + {"ld", 0x900c, DF_NO_XREG}, + {"ld", 0x900d, DF_NO_XREG}, + {"ld", 0x900e, DF_NO_XREG}, + {"ld", 0x8008, DF_NO_YREG}, + {"ld", 0x9009, DF_NO_YREG}, + {"ld", 0x900a, DF_NO_YREG}, + {"ld", 0x8000, 0}, + {"ld", 0x9001, DF_TINY1X}, + {"ld", 0x9002, DF_TINY1X}, + {"st", 0x920c, DF_NO_XREG}, + {"st", 0x920d, DF_NO_XREG}, + {"st", 0x920e, DF_NO_XREG}, + {"st", 0x8208, DF_NO_YREG}, + {"st", 0x9209, DF_NO_YREG}, + {"st", 0x920a, DF_NO_YREG}, + {"st", 0x8200, 0}, + {"st", 0x9201, DF_TINY1X}, + {"st", 0x9202, DF_TINY1X}, + {"ldd", 0x8008, DF_TINY1X}, + {"ldd", 0x8000, DF_TINY1X}, + {"std", 0x8208, DF_TINY1X}, + {"std", 0x8200, DF_TINY1X}, + {"end", 0, 0} + }; + + +/* We try to parse the command name. Is it a assembler mnemonic or anything else ? + * If so, it may be a macro. + */ + +int parse_mnemonic(struct prog_info *pi, int pass) + { + int mnemonic, i, opcode, opcode2, instruction_long = False; + char *operand1, *operand2; + struct macro *macro; + char temp[MAX_MNEMONIC_LEN+1]; + + operand1 = get_next_token(pi->fi->scratch, TERM_SPACE); // we get the first word on line + mnemonic = get_mnemonic_type(my_strlwr(pi->fi->scratch)); + if(mnemonic == -1) // if -1 this must be a macro name + { + macro = get_macro(pi, pi->fi->scratch); // and so, we try to get the corresponding macro struct. + if(macro) + { + return(expand_macro(pi, macro, operand1, pass)); //we expand the macro + } + else // if we cant find a name, this is a unknown word. + { + print_msg(pi, MSGTYPE_ERROR, "Unknown mnemonic/macro: %s", pi->fi->scratch); + return(True); + } + } + if(pass == PASS_2) + { + if(mnemonic <= MNEMONIC_BREAK) + { + if(operand1) + print_msg(pi, MSGTYPE_WARNING, "Garbage after instruction %s: %s", instruction_list[mnemonic].mnemonic, operand1); + // No operand + opcode = 0; + } + else if(mnemonic <= MNEMONIC_ELPM) + { + if(operand1) + { + operand2 = get_next_token(operand1, TERM_COMMA); + if(!operand2) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs a second operand", instruction_list[mnemonic].mnemonic); + return(True); + } + get_next_token(operand2, TERM_END); + i = get_register(pi, operand1); + opcode = i << 4; + i = get_indirect(pi, operand2); + if(i == 6) // Means Z + { + if(mnemonic == MNEMONIC_LPM) + mnemonic = MNEMONIC_LPM_Z; + else if(mnemonic == MNEMONIC_ELPM) + mnemonic = MNEMONIC_ELPM_Z; + } + else if(i == 7) // Means Z+ + { + if(mnemonic == MNEMONIC_LPM) + mnemonic = MNEMONIC_LPM_ZP; + else if(mnemonic == MNEMONIC_ELPM) + mnemonic = MNEMONIC_ELPM_ZP; + } + else + { + print_msg(pi, MSGTYPE_ERROR, "Unsupported operand: %s", operand2); + return(True); + } + } + else + opcode = 0; + } + else + { + if(!operand1) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs an operand", instruction_list[mnemonic].mnemonic); + return(True); + } + operand2 = get_next_token(operand1, TERM_COMMA); + if(mnemonic >= MNEMONIC_BRBS) + { + if(!operand2) + { + print_msg(pi, MSGTYPE_ERROR, "%s needs a second operand", instruction_list[mnemonic].mnemonic); + return(True); + } + get_next_token(operand2, TERM_END); + } + if(mnemonic <= MNEMONIC_BCLR) + { + if(!get_bitnum(pi, operand1, &i)) + return(False); + opcode = i << 4; + } + else if(mnemonic <= MNEMONIC_ROL) + { + i = get_register(pi, operand1); + if((mnemonic == MNEMONIC_SER) && (i < 16)) + { + print_msg(pi, MSGTYPE_ERROR, "%s can only use a high register (r16 - r31)", instruction_list[mnemonic].mnemonic); + i &= 0x0f; + } + opcode = i << 4; + if(mnemonic >= MNEMONIC_TST) + opcode |= ((i & 0x10) << 5) | (i & 0x0f); + } + else if(mnemonic <= MNEMONIC_RCALL) + { + if(!get_expr(pi, operand1, &i)) + return(False); + i -= pi->cseg_addr + 1; + if(mnemonic <= MNEMONIC_BRID) + { + if((i < -64) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "Branch out of range (-64 <= k <= 63)"); + opcode = (i & 0x7f) << 3; + } + else + { + if(((i < -2048) || (i > 2047)) && (pi->device->flash_size != 4096)) + print_msg(pi, MSGTYPE_ERROR, "Relative address out of range (-2048 <= k <= 2047)"); + opcode = i & 0x0fff; + } + } + else if(mnemonic <= MNEMONIC_CALL) + { + if(!get_expr(pi, operand1, &i)) + return(False); + if((i < 0) || (i > 4194303)) + print_msg(pi, MSGTYPE_ERROR, "Address out of range (0 <= k <= 4194303)"); + opcode = ((i & 0x3e0000) >> 13) | ((i & 0x01000) >> 16); + opcode2 = i & 0xffff; + instruction_long = True; + } + else if(mnemonic <= MNEMONIC_BRBC) + { + if(!get_bitnum(pi, operand1, &i)) + return(False); + opcode = i; + if(!get_expr(pi, operand2, &i)) + return(False); + i -= pi->cseg_addr + 1; + if((i < -64) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "Branch out of range (-64 <= k <= 63)"); + opcode |= (i & 0x7f) << 3; + } + else if(mnemonic <= MNEMONIC_MUL) + { + i = get_register(pi, operand1); + opcode = i << 4; + i = get_register(pi, operand2); + opcode |= ((i & 0x10) << 5) | (i & 0x0f); + } + else if(mnemonic <= MNEMONIC_MOVW) + { + i = get_register(pi, operand1); + if((i % 2) == 1) + print_msg(pi, MSGTYPE_ERROR, "%s must use a even numbered register for Rd", instruction_list[mnemonic].mnemonic); + opcode = (i / 2) << 4; + i = get_register(pi, operand2); + if((i % 2) == 1) + print_msg(pi, MSGTYPE_ERROR, "%s must use a even numbered register for Rr", instruction_list[mnemonic].mnemonic); + opcode |= i / 2; + } + else if(mnemonic <= MNEMONIC_MULS) + { + i = get_register(pi, operand1); + if(i < 16) + print_msg(pi, MSGTYPE_ERROR, "%s can only use a high register (r16 - r31)", instruction_list[mnemonic].mnemonic); + opcode = (i & 0x0f) << 4; + i = get_register(pi, operand2); + if(i < 16) + print_msg(pi, MSGTYPE_ERROR, "%s can only use a high register (r16 - r31)", instruction_list[mnemonic].mnemonic); + opcode |= (i & 0x0f); + } + else if(mnemonic <= MNEMONIC_FMULSU) + { + i = get_register(pi, operand1); + if((i < 16) || (i >= 24)) + print_msg(pi, MSGTYPE_ERROR, "%s can only use registers (r16 - r23)", instruction_list[mnemonic].mnemonic); + opcode = (i & 0x07) << 4; + i = get_register(pi, operand2); + if((i < 16) || (i >= 24)) + print_msg(pi, MSGTYPE_ERROR, "%s can only use registers (r16 - r23)", instruction_list[mnemonic].mnemonic); + opcode |= (i & 0x07); + } + else if(mnemonic <= MNEMONIC_SBIW) + { + i = get_register(pi, operand1); + if(!((i == 24) || (i == 26) || (i == 28) || (i == 30))) + print_msg(pi, MSGTYPE_ERROR, "%s can only use registers R24, R26, R28 or R30", instruction_list[mnemonic].mnemonic); + opcode = ((i - 24) / 2) << 4; + if(!get_expr(pi, operand2, &i)) + return(False); + if((i < 0) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "Constant out of range (0 <= k <= 63)"); + opcode |= ((i & 0x30) << 2) | (i & 0x0f); + } + else if(mnemonic <= MNEMONIC_CBR) + { + i = get_register(pi, operand1); + if(i < 16) + print_msg(pi, MSGTYPE_ERROR, "%s can only use a high register (r16 - r31)", instruction_list[mnemonic].mnemonic); + opcode = (i & 0x0f) << 4; + if(!get_expr(pi, operand2, &i)) + return(False); + if((i < -128) || (i > 255)) + print_msg(pi, MSGTYPE_WARNING, "Constant out of range (-128 <= k <= 255). Will be masked"); + if(mnemonic == MNEMONIC_CBR) + i = ~i; + opcode |= ((i & 0xf0) << 4) | (i & 0x0f); + } + else if(mnemonic <= MNEMONIC_BLD) + { + i = get_register(pi, operand1); + opcode = i << 4; + if(!get_bitnum(pi, operand2, &i)) + return(False); + opcode |= i; + } + else if(mnemonic == MNEMONIC_IN) + { + i = get_register(pi, operand1); + opcode = i << 4; + if(!get_expr(pi, operand2, &i)) + return(False); + if((i < 0) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "I/O out of range (0 <= P <= 63)"); + opcode |= ((i & 0x30) << 5) | (i & 0x0f); + } + else if(mnemonic == MNEMONIC_OUT) + { + if(!get_expr(pi, operand1, &i)) + return(False); + if((i < 0) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "I/O out of range (0 <= P <= 63)"); + opcode = ((i & 0x30) << 5) | (i & 0x0f); + i = get_register(pi, operand2); + opcode |= i << 4; + } + else if(mnemonic <= MNEMONIC_CBI) + { + if(!get_expr(pi, operand1, &i)) + return(False); + if((i < 0) || (i > 31)) + print_msg(pi, MSGTYPE_ERROR, "I/O out of range (0 <= P <= 31)"); + opcode = i << 3; + if(!get_bitnum(pi, operand2, &i)) + return(False); + opcode |= i; + } + else if(mnemonic == MNEMONIC_LDS) + { + i = get_register(pi, operand1); + opcode = i << 4; + if(!get_expr(pi, operand2, &i)) + return(False); + if((i < 0) || (i > 65535)) + print_msg(pi, MSGTYPE_ERROR, "SRAM out of range (0 <= k <= 65535)"); + opcode2 = i; + instruction_long = True; + } + else if(mnemonic == MNEMONIC_STS) + { + if(!get_expr(pi, operand1, &i)) + return(False); + if((i < 0) || (i > 65535)) + print_msg(pi, MSGTYPE_ERROR, "SRAM out of range (0 <= k <= 65535)"); + opcode2 = i; + i = get_register(pi, operand2); + opcode = i << 4; + instruction_long = True; + } + else if(mnemonic == MNEMONIC_LD) + { + i = get_register(pi, operand1); + opcode = i << 4; + mnemonic = MNEMONIC_LD_X + get_indirect(pi, operand2); + } + else if(mnemonic == MNEMONIC_ST) + { + mnemonic = MNEMONIC_ST_X + get_indirect(pi, operand1); + i = get_register(pi, operand2); + opcode = i << 4; + } + else if(mnemonic == MNEMONIC_LDD) + { + i = get_register(pi, operand1); + opcode = i << 4; + if(tolower(operand2[0]) == 'z') + mnemonic = MNEMONIC_LDD_Z; + else if(tolower(operand2[0]) == 'y') + mnemonic = MNEMONIC_LDD_Y; + else + print_msg(pi, MSGTYPE_ERROR, "Garbage in second operand (%s)", operand2); + i = 1; + while((operand2[i] != '\0') && (operand2[i] != '+')) i++; + if(operand2[i] == '\0') + { + print_msg(pi, MSGTYPE_ERROR, "Garbage in second operand (%s)", operand2); + return(False); + } + if(!get_expr(pi, &operand2[i + 1], &i)) + return(False); + if((i < 0) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "Displacement out of range (0 <= q <= 63)"); + opcode |= ((i & 0x20) << 8) | ((i & 0x18) << 7) | (i & 0x07); + } + else if(mnemonic == MNEMONIC_STD) + { + if(tolower(operand1[0]) == 'z') + mnemonic = MNEMONIC_STD_Z; + else if(tolower(operand1[0]) == 'y') + mnemonic = MNEMONIC_STD_Y; + else + print_msg(pi, MSGTYPE_ERROR, "Garbage in first operand (%s)", operand1); + i = 1; + while((operand1[i] != '\0') && (operand1[i] != '+')) i++; + if(operand1[i] == '\0') + { + print_msg(pi, MSGTYPE_ERROR, "Garbage in first operand (%s)", operand1); + return(False); + } + if(!get_expr(pi, &operand1[i + 1], &i)) + return(False); + if((i < 0) || (i > 63)) + print_msg(pi, MSGTYPE_ERROR, "Displacement out of range (0 <= q <= 63)"); + opcode = ((i & 0x20) << 8) | ((i & 0x18) << 7) | (i & 0x07); + i = get_register(pi, operand2); + opcode |= i << 4; + } + else + print_msg(pi, MSGTYPE_ERROR, "Shit! Missing opcode check [%d]...", mnemonic); + } + if (pi->device->flag & instruction_list[mnemonic].flag) + { + strncpy(temp, instruction_list[mnemonic].mnemonic, MAX_MNEMONIC_LEN); + print_msg(pi, MSGTYPE_ERROR, "%s instruction is not supported on %s", + my_strupr(temp), pi->device->name); + } + opcode |= instruction_list[mnemonic].opcode; + if(pi->list_on && pi->list_line) + { + if(instruction_long) + fprintf(pi->list_file, "%06x %04x %04x %s", pi->cseg_addr, opcode, opcode2, pi->list_line); + else + fprintf(pi->list_file, "%06x %04x %s", pi->cseg_addr, opcode, pi->list_line); + pi->list_line = NULL; + } + if(pi->hfi) + { + write_prog_word(pi, pi->cseg_addr, opcode); + if(instruction_long) + write_prog_word(pi, pi->cseg_addr + 1, opcode2); + } + if(instruction_long) + pi->cseg_addr += 2; + else + pi->cseg_addr++; + } + else + { + if((mnemonic == MNEMONIC_JMP) || (mnemonic == MNEMONIC_CALL) || (mnemonic == MNEMONIC_LDS) || (mnemonic == MNEMONIC_STS)) + { + pi->cseg_addr += 2; + pi->cseg_count += 2; + } + else + { + pi->cseg_addr++; + pi->cseg_count++; + } + } + return(True); + } + + +int get_mnemonic_type(char *mnemonic) + { + int i; + + for(i = 0; i < MNEMONIC_COUNT; i++) + if(!strcmp(mnemonic, instruction_list[i].mnemonic)) + return(i); + return(-1); + } + + +int get_register(struct prog_info *pi, char *data) + { + char *second_reg; + int reg = 0; + struct def *def; + + // Check for any occurence of r1:r0 pairs, and if so skip to second register + second_reg = strchr(data, ':'); + if(second_reg != NULL) + data = second_reg + 1; + + for(def = pi->first_def; def; def = def->next) + if(!nocase_strcmp(def->name, data)) + { + reg = def->reg; + return(reg); + } + if((tolower(data[0]) == 'r') && isdigit(data[1])) + { + reg = atoi(&data[1]); + if(reg > 31) + print_msg(pi, MSGTYPE_ERROR, "R%d is not a valid register", reg); + } + else + print_msg(pi, MSGTYPE_ERROR, "No register associated with %s", data); + return(reg); + } + + +int get_bitnum(struct prog_info *pi, char *data, int *ret) +{ + if(!get_expr(pi, data, ret)) + return(False); + if((*ret < 0) || (*ret > 7)) + { + print_msg(pi, MSGTYPE_ERROR, "Operand out of range (0 <= s <= 7)"); + return(False); + } + return(True); + } + + +int get_indirect(struct prog_info *pi, char *operand) + { + int i = 1; + + switch(tolower(operand[0])) + { + case '-': + while(IS_HOR_SPACE(operand[i])) i++; + if(operand[i + 1] != '\0') + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + switch(tolower(operand[i])) + { + case 'x': + if (pi->device->flag & DF_NO_XREG) + print_msg(pi, MSGTYPE_ERROR, "X register is not supported on %s", pi->device->name); + return(2); + case 'y': + if (pi->device->flag & DF_NO_YREG) + print_msg(pi, MSGTYPE_ERROR, "Y register is not supported on %s", pi->device->name); + return(5); + case 'z': + return(8); + default: + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + return(0); + } + case 'x': + if (pi->device->flag & DF_NO_XREG) + print_msg(pi, MSGTYPE_ERROR, "X register is not supported on %s", pi->device->name); + while(IS_HOR_SPACE(operand[i])) i++; + if(operand[i] == '+') + { + if(operand[i + 1] != '\0') + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + return(1); + } + else if(operand[i] == '\0') + return(0); + else + print_msg(pi, MSGTYPE_ERROR, "Garbage after operand (%s)", operand); + return(0); + case 'y': + if (pi->device->flag & DF_NO_YREG) + print_msg(pi, MSGTYPE_ERROR, "Y register is not supported on %s", pi->device->name); + while(IS_HOR_SPACE(operand[i])) i++; + if(operand[i] == '+') + { + if(operand[i + 1] != '\0') + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + return(4); + } + else if(operand[i] == '\0') + return(3); + else + print_msg(pi, MSGTYPE_ERROR, "Garbage after operand (%s)", operand); + return(0); + case 'z': + while(IS_HOR_SPACE(operand[i])) i++; + if(operand[i] == '+') + { + if(operand[i + 1] != '\0') + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + return(7); + } + else if(operand[i] == '\0') + return(6); + else + print_msg(pi, MSGTYPE_ERROR, "Garbage after operand (%s)", operand); + return(0); + default: + print_msg(pi, MSGTYPE_ERROR, "Garbage in operand (%s)", operand); + } + return(0); + } + +/* Return 1 if instruction name is supported by the current device, + 0 if unsupported, -1 if it is invalid */ +int is_supported(struct prog_info *pi, char *name) { + char temp[MAX_MNEMONIC_LEN+1]; + int mnemonic; + + strncpy(temp,name,MAX_MNEMONIC_LEN); + mnemonic = get_mnemonic_type(my_strlwr(temp)); + if (mnemonic == -1) return -1; + if (pi->device->flag & instruction_list[mnemonic].flag) return 0; + return 1; + } + +int count_supported_instructions(int flags) +{ + int i = 0, count = 0; + while(i < MNEMONIC_END) + { + if((i < MNEMONIC_LD) || (i > MNEMONIC_COUNT)) + if(!(flags & instruction_list[i].flag)) + count++; + i++; + } + return(count); +} diff --git a/src/mkutil/avra-0.8/SOURCE/n.bat b/src/mkutil/avra-0.8/SOURCE/n.bat new file mode 100644 index 00000000..38f21fef --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/n.bat @@ -0,0 +1,2 @@ +NMake /f Makefile.win32.mvc install +del *.obj diff --git a/src/mkutil/avra-0.8/SOURCE/parser.c b/src/mkutil/avra-0.8/SOURCE/parser.c new file mode 100644 index 00000000..fe1604d2 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/parser.c @@ -0,0 +1,397 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +#include +#include +#include +#include + +#include "misc.h" +#include "avra.h" +#include "args.h" + +/* + * Parses given assembler file + */ + +int parse_file(struct prog_info *pi, char *filename, int pass) + { + int ok = True, loopok; + struct file_info *fi; + struct include_file *include_file; + + fi = malloc(sizeof(struct file_info)); + if(fi) + { + pi->fi = fi; + if(pass == PASS_1) + { + include_file = malloc(sizeof(struct include_file)); + if(!include_file) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + free(fi); + return(False); + } + include_file->next = NULL; + if(pi->last_include_file) + { + pi->last_include_file->next = include_file; + include_file->num = pi->last_include_file->num + 1; + } + else + { + pi->first_include_file = include_file; + include_file->num = 0; + } + pi->last_include_file = include_file; + include_file->name = malloc(strlen(filename) + 1); + if(!include_file->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + free(fi); + return(False); + } + strcpy(include_file->name, filename); + } + else + { + for(include_file = pi->first_include_file; include_file; include_file = include_file->next) + if(!strcmp(include_file->name, filename)) + break; + } + if(!include_file) + { + print_msg(pi, MSGTYPE_ERROR, "Internal assembler error"); + free(fi); + return(False); + } + fi->include_file = include_file; + fi->line_number = 0; + fi->exit_file = False; + //printf("Opening %s\n",filename); + fi->fp = fopen(filename, "r"); + if(fi->fp != NULL) + { + + loopok = True; + while(loopok && !fi->exit_file) + { + if(fgets(fi->buff, LINEBUFFER_LENGTH, fi->fp)) + { + fi->line_number++; + pi->list_line = fi->buff; + ok = parse_line(pi, fi->buff, pass); + + if(ok) + { + if((pass == PASS_2) && pi->list_line && pi->list_on) + fprintf(pi->list_file, " %s", pi->list_line); + if(pi->error_count >= pi->max_errors) + { + print_msg(pi, MSGTYPE_MESSAGE, "Maximum error count reached. Exiting..."); + loopok = False; + } + } + else + { + loopok = False; + } + } + else + { + loopok = False; + if(!feof(fi->fp)) + { + ok = False; + perror(filename); + } + } + } + fclose(fi->fp); + } + else + { + ok = False; + perror(filename); + } + free(fi); + } + else + { + ok = False; + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + } + return(ok); + } + + +/* + * Parses one line + */ + +int parse_line(struct prog_info *pi, char *line, int pass) + { + int ok, i, j, k, global_label = False, textarea; + char temp[LINEBUFFER_LENGTH]; + struct label *label = NULL; + struct macro_call *macro_call; + + /* Find out if there is any relevant code on the line. If not? return */ + i = 0; + while(IS_HOR_SPACE(line[i]) && !IS_END(line[i])) i++; + if(IS_END(line[i])) + return(True); + + strcpy(temp, &line[i]); + + /* filter out .stab debugging information before it screws up the previous processing */ + /* .stabs sometimes contains colon : symbol - might be interpreted as label */ + if( *temp == '.' ){ /* minimal slowdown of existing code */ + /* compiler output is always lower case */ + if( strncmp( temp, ".stabs ", 7) == 0 ){ + ok = parse_stabs( pi, temp, pass ); + return( ok ); + } + + if( strncmp( temp, ".stabn ", 7) == 0 ){ + ok = parse_stabn( pi, temp, pass ); + return( ok ); + } + } + + /* Calculate any expression inside a pair of {} */ + for(i = 0, j = 0, textarea = False; temp[j] != '\0'; i++, j++) + { + if((temp[j] == '\'') || (temp[j] == '"')) + textarea = textarea ? False : True; + else if(!textarea && (temp[j] == ';')) + break; + if(temp[j] == '{') + { + k = ++j; + while((temp[j] != '\0') && (temp[j] != '}')) j++; + if(IS_END(temp[j])) + { + print_msg(pi, MSGTYPE_ERROR, "Found no matching }"); + break; + } + else + { + temp[j] = '\0'; + if(!get_expr(pi, &temp[k], &k)) + return(False); + sprintf(&pi->fi->scratch[i], "%d", k); + i = strlen(pi->fi->scratch) - 1; + } + } + else + pi->fi->scratch[i] = temp[j]; + } + pi->fi->scratch[i] = '\0'; + + /* Detect the global keyword for global labels */ + if(!nocase_strncmp(pi->fi->scratch, "global", 6) && IS_HOR_SPACE(pi->fi->scratch[6])) + { + global_label = True; + i = 7; + while(IS_HOR_SPACE(pi->fi->scratch[i]) && !IS_END(pi->fi->scratch[i])) i++; + if(IS_END(pi->fi->scratch[i])) + { + print_msg(pi, MSGTYPE_ERROR, "Found no label after global keyword"); + return(True); + } + strcpy(pi->fi->scratch, &pi->fi->scratch[i]); + } + + for(i = 0; IS_LABEL(pi->fi->scratch[i]) || (pi->fi->scratch[i] == ':'); i++) + if(pi->fi->scratch[i] == ':') + { + pi->fi->scratch[i] = '\0'; + if(pass == PASS_1) + { + for(macro_call = pi->macro_call; macro_call; macro_call = macro_call->prev_on_stack) + { + for(label = pi->macro_call->first_label; label; label = label->next) + { + if(!nocase_strcmp(label->name, &pi->fi->scratch[0])) + { + print_msg(pi, MSGTYPE_ERROR, "Can't redefine local label %s", &pi->fi->scratch[0]); + break; + } + } + } + for(label = pi->first_label; label; label = label->next) + { + if(!nocase_strcmp(label->name, &pi->fi->scratch[0])) + { + print_msg(pi, MSGTYPE_ERROR, "Can't redefine label %s", &pi->fi->scratch[0]); + break; + } + } + for(label = pi->first_variable; label; label = label->next) + if(!nocase_strcmp(label->name, &pi->fi->scratch[0])) + { + print_msg(pi, MSGTYPE_ERROR, "%s has already been defined as a .SET variable", &pi->fi->scratch[0]); + break; + } + for(label = pi->first_constant; label; label = label->next) + if(!nocase_strcmp(label->name, &pi->fi->scratch[0])) + { + print_msg(pi, MSGTYPE_ERROR, "%s has already been defined as a .EQU constant", &pi->fi->scratch[0]); + break; + } + label = malloc(sizeof(struct label)); + if(!label) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + label->next = NULL; + label->name = malloc(strlen(&pi->fi->scratch[0]) + 1); + if(!label->name) + { + print_msg(pi, MSGTYPE_OUT_OF_MEM, NULL); + return(False); + } + strcpy(label->name, &pi->fi->scratch[0]); + switch(pi->segment) + { + case SEGMENT_CODE: + label->value = pi->cseg_addr; + break; + case SEGMENT_DATA: + label->value = pi->dseg_addr; + break; + case SEGMENT_EEPROM: + label->value = pi->eseg_addr; + break; + } + if(pi->macro_call && !global_label) + { + if(pi->macro_call->last_label) + pi->macro_call->last_label->next = label; + else + pi->macro_call->first_label = label; + pi->macro_call->last_label = label; + } + else + { + if(pi->last_label) + pi->last_label->next = label; + else + pi->first_label = label; + pi->last_label = label; + } + } + i++; + while(IS_HOR_SPACE(pi->fi->scratch[i]) && !IS_END(pi->fi->scratch[i])) i++; + if(IS_END(pi->fi->scratch[i])) + { + if((pass == PASS_2) && pi->list_on) // Diff tilpassing + { + fprintf(pi->list_file, " %s", pi->list_line); + pi->list_line = NULL; + } + return(True); + } + strcpy(pi->fi->scratch, &pi->fi->scratch[i]); + break; + } + + if(pi->fi->scratch[0] == '.') + { + pi->fi->label = label; + ok = parse_directive(pi, pass); + if((pass == PASS_2) && pi->list_on && pi->list_line) // Diff tilpassing + { + fprintf(pi->list_file, " %s", pi->list_line); + pi->list_line = NULL; + } + return(ok); + } + else + { + ok = parse_mnemonic(pi, pass); + return(ok); + } + } + + +/* + * Get the next token, and terminate the last one. + * Termination identifier is specified. + */ + +char *get_next_token(char *data, int term) + { + int i = 0, j, anti_comma = False; + + switch(term) + { + case TERM_END: + while(!IS_END(data[i])) i++; + break; + case TERM_SPACE: + while(!IS_HOR_SPACE(data[i]) && !IS_END(data[i])) i++; + break; + case TERM_DASH: + while((data[i] != '-') && !IS_END(data[i])) i++; + break; + case TERM_COLON: + while((data[i] != ':') && !IS_ENDLINE(data[i])) i++; + break; + case TERM_DOUBLEQUOTE: + while((data[i] != '"') && !IS_ENDLINE(data[i])) i++; + break; + case TERM_COMMA: + while(((data[i] != ',') || anti_comma) + && !(((data[i] == ';') && !anti_comma) || (data[i] == 10) || (data[i] == 13)|| (data[i] == '\0'))) + { + if((data[i] == '\'') || (data[i] == '"')) + anti_comma = anti_comma ? False : True; + i++; + } + break; + case TERM_EQUAL: + while((data[i] != '=') && !IS_END(data[i])) i++; + break; + } + if(IS_END(data[i])) + { + data[i--] = '\0'; + while(IS_HOR_SPACE(data[i])) data[i--] = '\0'; + return(0); + } + j = i - 1; + while(IS_HOR_SPACE(data[j])) data[j--] = '\0'; + data[i++] = '\0'; + while(IS_HOR_SPACE(data[i]) && !IS_END(data[i])) i++; + if(IS_END(data[i])) + return(0); + return(&data[i]); + } + diff --git a/src/mkutil/avra-0.8/SOURCE/stdextra.c b/src/mkutil/avra-0.8/SOURCE/stdextra.c new file mode 100644 index 00000000..45704953 --- /dev/null +++ b/src/mkutil/avra-0.8/SOURCE/stdextra.c @@ -0,0 +1,197 @@ +/*********************************************************************** + * avra - Assembler for the Atmel AVR microcontroller series + * Copyright (C) 1998-2001 Jon Anders Haugum + * Copyright (C) 2002-2003 Tobias Weber + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Authors of avra can be reached at: + * email: jonah@omegav.ntnu.no, tobiw@suprafluid.com + * www: http://sourceforge.net/projects/avra + */ + +/******************************************************************** + * Extra standard functions + */ + +#include +#include + +#include "misc.h" + + +/******************************************************************** + * Case insensetive strcmp() + */ + +int nocase_strcmp(char *s, char *t) + { + int i; + + for(i = 0; tolower(s[i]) == tolower(t[i]); i++) + if(s[i] == '\0') + return(0); + return(tolower(s[i]) - tolower(t[i])); + } + + +/******************************************************************** + * Case insensetive strncmp() + */ + +int nocase_strncmp(char *s, char *t, int n) + { + int i; + + for(i = 0; (tolower(s[i]) == tolower(t[i])); i++, n--) + if((s[i] == '\0') || (n == 1)) + return(0); + return(tolower(s[i]) - tolower(t[i])); + } + + +/******************************************************************** + * Case insensetive strstr() + */ + +char *nocase_strstr(char *s, char *t) + { + int i = 0, j, found = False; + + while((s[i] != '\0') && !found) + { + j = 0; + while(tolower(t[j]) == tolower(s[i + j])) + { + j++; + if(t[j] == '\0') + { + found = True; + break; + } + else if(s[i + j] == '\0') + break; + } + i++; + } + i--; + if(found) + return(&s[i]); + return(NULL); + } + + +/******************************************************************** + * ascii to hex + * ignores "0x" + */ + +int atox(char *s) + { + int i = 0, ret = 0; + + while(s[i] != '\0') + { + ret <<= 4; + if((s[i] <= 'F') && (s[i] >= 'A')) + ret |= s[i] - 'A' + 10; + else if((s[i] <= 'f') && (s[i] >= 'a')) + ret |= s[i] - 'a' + 10; + else if((s[i] <= '9') && (s[i] >= '0')) + ret |= s[i] - '0'; + i++; + } + return(ret); + } + + +/******************************************************************** + * n ascii chars to int + */ + +int atoi_n(char *s, int n) + { + int i = 0, ret = 0; + + while((s[i] != '\0') && n) + { + ret = 10 * ret + (s[i] - '0'); + i++; + n--; + } + return(ret); + } + + +/******************************************************************** + * n ascii chars to hex + * 0 < n <= 8 + * ignores "0x" + */ + +int atox_n(char *s, int n) + { + int i = 0, ret = 0; + + while((s[i] != '\0') && n) + { + ret <<= 4; + if((s[i] <= 'F') && (s[i] >= 'A')) + ret |= s[i] - 'A' + 10; + else if((s[i] <= 'f') && (s[i] >= 'a')) + ret |= s[i] - 'a' + 10; + else if((s[i] <= '9') && (s[i] >= '0')) + ret |= s[i] - '0'; + i++; + n--; + } + return(ret); + } + + +/* + * My own strlwr function since this one only exists in win + */ + +char *my_strlwr(char *in) +{ + int i; + + for(i = 0; in[i] != '\0'; i++) + in[i] = tolower(in[i]); + + return(in); +} + + +/* + * My own strupr function since this one only exists in win + */ + +char *my_strupr(char *in) +{ + int i; + + for(i = 0; in[i] != '\0'; i++) + in[i] = toupper(in[i]); + + return(in); +} + + + + diff --git a/src/mkutil/avra-0.8/TODO b/src/mkutil/avra-0.8/TODO new file mode 100644 index 00000000..6be6fe18 --- /dev/null +++ b/src/mkutil/avra-0.8/TODO @@ -0,0 +1,10 @@ +- Hindre bruk av instrusjoner etter .dseg +- Støtt intel hex 32 istedet, da hex8m bare går opp til 64KB +- listfil generering +- Test instruksjoner i henhold til hvilken prosessor som er valgt. +- Støtt atmel generic +- Sjekk ut det med tom fil. +- Legg inn støtte for .def og macroer i get_symbol +- while +- AVRASM32 compatible parameter interpretation +- general bug fixing diff --git a/src/mkutil/avra-0.8/avra.dev b/src/mkutil/avra-0.8/avra.dev new file mode 100644 index 00000000..2643b7b9 --- /dev/null +++ b/src/mkutil/avra-0.8/avra.dev @@ -0,0 +1,179 @@ +[Project] +FileName=avra.dev +Name=Console App +UnitCount=15 +Type=1 +Ver=1 +ObjFiles= +Includes= +Libs= +PrivateResource= +ResourceIncludes= +MakeIncludes= +Resources= +Compiler= +Linker= +IsCpp=0 +Icon= +ExeOutput= +ObjectOutput= +OverrideOutput=0 +OverrideOutputName=AVRASM32.exe +Folders= +CommandLine= +Focused=0 +Order=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 + +[Unit1] +FileName=avra.c +Open=1 +Folder= +Top=1 +CursorCol=10 +CursorRow=82 +TopLine=43 +LeftChar=1 + +[Views] +ProjectView=1 + +[Unit2] +FileName=args.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit3] +FileName=stdextra.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit4] +FileName=device.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit5] +FileName=directiv.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit6] +FileName=expr.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit7] +FileName=file.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit9] +FileName=mnemonic.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit10] +FileName=parser.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit11] +FileName=coff.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit12] +FileName=macro.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit13] +FileName=misc.h +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit8] +FileName=map.c +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit14] +FileName=args.h +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + +[Unit15] +FileName=avra.h +Open=1 +Folder= +Top=0 +CursorCol=1 +CursorRow=1 +TopLine=1 +LeftChar=1 + diff --git a/src/mkutil/bin2avr.c b/src/mkutil/bin2avr.c new file mode 100644 index 00000000..ec646300 --- /dev/null +++ b/src/mkutil/bin2avr.c @@ -0,0 +1,162 @@ +/* bin2avr.c by Nick for UZI180 */ + +#include +#include +#include + +#define PATHLEN 512 + +void main(int argc, char **argv) + { + int i, count, fdin; + FILE *fileout; + char *infile = NULL; + char *outfile = NULL; + char line[PATHLEN]; + char name[PATHLEN]; + char buffer[16]; + + if (argc > 1) + { + infile = argv[1]; + } + + if (argc > 2) + { + outfile = argv[2]; + } + + if (infile == NULL) + { + printf("usage: bin2avr infile.bin [outfile.inc]\n"); + + fflush(stdout); + exit(1); + } + + if (outfile == NULL) + { + outfile = name; + strcpy(outfile, infile); + + i = strlen(outfile); + while (i--) + { + if (outfile[i] == '\\') + { + break; /* no extension, so don't strip it */ + } + if (outfile[i] == '.') + { + outfile[i] = 0; /* strip dot and extension */ + break; /* ready to concatenate our extension */ + } + } + + strcat(outfile, ".inc"); + } + + if (!strcmp(infile, outfile)) + { + fprintf(stderr, "input and output filenames identical\n"); + + fflush(stderr); + exit(1); + } + + fdin = open(infile, O_RDONLY | O_BINARY); + if (fdin < 0) + { + fprintf(stderr, "can't open: "); + perror(infile); + + fflush(stderr); + exit(1); + } + + fileout = fopen(outfile, "w"); + if (fileout == NULL) + { + fprintf(stderr, "can't create: "); + perror(outfile); + + fflush(stderr); + exit(1); + } + + strcpy(line, "; "); + strcat(line, outfile); + strcat(line, " generated from "); + strcat(line, infile); + strcat(line, ", do not edit!\n"); +#ifdef DEBUG + printf("%s", line); + fflush(stdout); +#endif + fputs(line, fileout); + + *line = 0; /* causes a blank line to be written after title */ + + count = read(fdin, buffer, 16); + while (count > 0) + { + if (*line) + { + line[strlen(line)-1] = 0; /* kill trailing comma */ + } + strcat(line, "\n"); +#ifdef DEBUG + printf("%s", line); + fflush(stdout); +#endif + fputs(line, fileout); + + strcpy(line, "\t.db\t"); + for (i = 0; i < count; i++) + { + sprintf(&line[5 + i*4], "$%02x,", buffer[i] & 0xff); + } + +#if 1 /* hack for AVR assembler bug */ + if (count < 16) + { + if (count & 1) + { + strcpy(&line[5 + i*4], "$00,"); + } + break; + } +#endif + + count = read(fdin, buffer, 16); + } + + if (*line) + { + line[strlen(line)-1] = 0; /* kill trailing comma */ + strcat(line, "\n"); +#ifdef DEBUG + printf("%s", line); + fflush(stdout); +#endif + fputs(line, fileout); + + *line = 0; /* causes a blank line to be written at end */ + } + + strcat(line, "\n"); +#ifdef DEBUG + printf("%s", line); + fflush(stdout); +#endif + fputs(line, fileout); + + fclose(fileout); + close(fdin); + + printf("converted %s to %s\n", infile, outfile); + + fflush(stdout); + exit(0); + } + diff --git a/src/mkutil/bin2avr.exe b/src/mkutil/bin2avr.exe new file mode 100644 index 00000000..3ea5d513 Binary files /dev/null and b/src/mkutil/bin2avr.exe differ diff --git a/src/mkutil/bin2c.exe b/src/mkutil/bin2c.exe index e9139f48..ec59276a 100644 Binary files a/src/mkutil/bin2c.exe and b/src/mkutil/bin2c.exe differ diff --git a/src/mkutil/crc.exe b/src/mkutil/crc.exe index ecd79d0c..e257bdf6 100644 Binary files a/src/mkutil/crc.exe and b/src/mkutil/crc.exe differ diff --git a/src/mkutil/ihex2bin.exe b/src/mkutil/ihex2bin.exe index 0f3885e0..c29e1e58 100644 Binary files a/src/mkutil/ihex2bin.exe and b/src/mkutil/ihex2bin.exe differ diff --git a/src/link-z80/aslink.h b/src/mkutil/link-z80/aslink.h similarity index 100% rename from src/link-z80/aslink.h rename to src/mkutil/link-z80/aslink.h diff --git a/src/mkutil/link-z80/link-z80.exe b/src/mkutil/link-z80/link-z80.exe new file mode 100644 index 00000000..1462ae12 Binary files /dev/null and b/src/mkutil/link-z80/link-z80.exe differ diff --git a/src/link-z80/link-z80.lnk b/src/mkutil/link-z80/link-z80.lnk similarity index 100% rename from src/link-z80/link-z80.lnk rename to src/mkutil/link-z80/link-z80.lnk diff --git a/src/mkutil/link-z80/link-z80.map b/src/mkutil/link-z80/link-z80.map new file mode 100644 index 00000000..5d352670 --- /dev/null +++ b/src/mkutil/link-z80/link-z80.map @@ -0,0 +1,550 @@ + link-z80 + + Timestamp is 3ebb8be9 (Fri May 09 21:07:21 2003) + + Preferred load address is 00400000 + + Start Length Name Class + 0001:00000000 0001260dH .text CODE + 0002:00000000 00000606H .rdata DATA + 0002:00000606 00000000H .edata DATA + 0003:00000000 00000104H .CRT$XCA DATA + 0003:00000104 00000104H .CRT$XCZ DATA + 0003:00000208 00000104H .CRT$XIA DATA + 0003:0000030c 00000109H .CRT$XIC DATA + 0003:00000418 00000104H .CRT$XIZ DATA + 0003:0000051c 00000104H .CRT$XPA DATA + 0003:00000620 00000104H .CRT$XPX DATA + 0003:00000724 00000104H .CRT$XPZ DATA + 0003:00000828 00000104H .CRT$XTA DATA + 0003:0000092c 00000104H .CRT$XTZ DATA + 0003:00000a30 00004a7dH .data DATA + 0003:000054b0 00001f54H .bss DATA + 0004:00000000 00000014H .idata$2 DATA + 0004:00000014 00000014H .idata$3 DATA + 0004:00000028 0000010cH .idata$4 DATA + 0004:00000134 0000010cH .idata$5 DATA + 0004:00000240 00000488H .idata$6 DATA + + Address Publics by Value Rva+Base Lib:Object + + 0001:00000350 _newarea 00401350 f lkarea.obj + 0001:00000466 _lkparea 00401466 f lkarea.obj + 0001:00000593 _lnkarea 00401593 f lkarea.obj + 0001:000007b5 _lnksect 004017b5 f lkarea.obj + 0001:00000ce0 _eval 00401ce0 f lkeval.obj + 0001:00000d68 _expr 00401d68 f lkeval.obj + 0001:00000faa _term 00401faa f lkeval.obj + 0001:0000131a _digit 0040231a f lkeval.obj + 0001:000013cf _oprio 004023cf f lkeval.obj + 0001:00001620 _newhead 00402620 f lkhead.obj + 0001:00001720 _module 00402720 f lkhead.obj + 0001:000017d0 _getid 004027d0 f lklex.obj + 0001:0000183c _getfid 0040283c f lklex.obj + 0001:0000188f _getnb 0040288f f lklex.obj + 0001:000018b0 _skip 004028b0 f lklex.obj + 0001:000018ea _get 004028ea f lklex.obj + 0001:00001918 _unget 00402918 f lklex.obj + 0001:00001930 _getmap 00402930 f lklex.obj + 0001:00001a80 _getline 00402a80 f lklex.obj + 0001:00001cc0 _more 00402cc0 f lklex.obj + 0001:00001cfd _endline 00402cfd f lklex.obj + 0001:00001e90 _addpath 00402e90 f lklibr.obj + 0001:00001f21 _addlib 00402f21 f lklibr.obj + 0001:00001f83 _addfile 00402f83 f lklibr.obj + 0001:000021a7 _search 004031a7 f lklibr.obj + 0001:00002228 _fndsym 00403228 f lklibr.obj + 0001:000026df _library 004036df f lklibr.obj + 0001:0000271c _loadfile 0040371c f lklibr.obj + 0001:00002a20 _newpag 00403a20 f lklist.obj + 0001:00002a62 _dgt 00403a62 f lklist.obj + 0001:00002aaf _slew 00403aaf f lklist.obj + 0001:000030cb _lstarea 004040cb f lklist.obj + 0001:0000361a _lkulist 0040461a f lklist.obj + 0001:0000374f _lkalist 0040474f f lklist.obj + 0001:00003a53 _lkglist 00404a53 f lklist.obj + 0001:00004430 _main 00405430 f lkmain.obj + 0001:000047a1 _lkexit 004057a1 f lkmain.obj + 0001:00004831 _link 00405831 f lkmain.obj + 0001:00004aea _map 00405aea f lkmain.obj + 0001:00004df3 _parse 00405df3 f lkmain.obj + 0001:000053bc _doparse 004063bc f lkmain.obj + 0001:0000546b _bassav 0040646b f lkmain.obj + 0001:000054fd _setbas 004064fd f lkmain.obj + 0001:00005828 _gblsav 00406828 f lkmain.obj + 0001:000058ba _setgbl 004068ba f lkmain.obj + 0001:000059d8 _afile 004069d8 f lkmain.obj + 0001:00005bbc _fndidx 00406bbc f lkmain.obj + 0001:00005c32 _usage 00406c32 f lkmain.obj + 0001:000062b0 _lkout 004072b0 f lkout.obj + 0001:000062f2 _ixx 004072f2 f lkout.obj + 0001:000064a2 _iflush 004074a2 f lkout.obj + 0001:00006617 _sxx 00407617 f lkout.obj + 0001:000067e1 _sflush 004077e1 f lkout.obj + 0001:00006ac0 _reloc 00407ac0 f lkrloc.obj + 0001:00006b50 _relt 00407b50 f lkrloc.obj + 0001:00006ba3 _relr 00407ba3 f lkrloc.obj + 0001:000071d1 _relp 004081d1 f lkrloc.obj + 0001:000073d5 _rele 004083d5 f lkrloc.obj + 0001:00007400 _evword 00408400 f lkrloc.obj + 0001:00007446 _adb_1b 00408446 f lkrloc.obj + 0001:0000746c _adb_2b 0040846c f lkrloc.obj + 0001:00007522 _adb_3b 00408522 f lkrloc.obj + 0001:00007632 _adb_4b 00408632 f lkrloc.obj + 0001:0000779b _adb_xb 0040879b f lkrloc.obj + 0001:000078d2 _adb_lo 004088d2 f lkrloc.obj + 0001:0000794e _adb_hi 0040894e f lkrloc.obj + 0001:000079ca _adb_byte3 004089ca f lkrloc.obj + 0001:00007a46 _adb_byte4 00408a46 f lkrloc.obj + 0001:00007ac2 _adw_xb 00408ac2 f lkrloc.obj + 0001:00007b31 _relerr 00408b31 f lkrloc.obj + 0001:00007b63 _errdmp 00408b63 f lkrloc.obj + 0001:00007ce8 _prntval 00408ce8 f lkrloc.obj + 0001:00007da7 _relerp 00408da7 f lkrloc.obj + 0001:00007dd9 _erpdmp 00408dd9 f lkrloc.obj + 0001:00008360 _syminit 00409360 f lksym.obj + 0001:0000838c _newsym 0040938c f lksym.obj + 0001:0000855a _lkpsym 0040955a f lksym.obj + 0001:00008601 _symval 00409601 f lksym.obj + 0001:0000862d _symdef 0040962d f lksym.obj + 0001:000086a4 _symmod 004096a4 f lksym.obj + 0001:00008760 _symeq 00409760 f lksym.obj + 0001:00008805 _hash 00409805 f lksym.obj + 0001:00008866 _strsto 00409866 f lksym.obj + 0001:000088e5 _new 004098e5 f lksym.obj + 0001:00008ad1 _fprintf 00409ad1 f LIBC:fprintf.obj + 0001:00008b03 ___initstdio 00409b03 f LIBC:_file.obj + 0001:00008ba8 ___endstdio 00409ba8 f LIBC:_file.obj + 0001:00008bc0 _strcpy 00409bc0 f LIBC:strcat.obj + 0001:00008bd0 _strcat 00409bd0 f LIBC:strcat.obj + 0001:00008cb0 _strlen 00409cb0 f LIBC:strlen.obj + 0001:00008d2b _fclose 00409d2b f LIBC:fclose.obj + 0001:00008d81 _fgets 00409d81 f LIBC:fgets.obj + 0001:00008dd8 _free 00409dd8 f LIBC:free.obj + 0001:00008e41 __fsopen 00409e41 f LIBC:fopen.obj + 0001:00008e61 _fopen 00409e61 f LIBC:fopen.obj + 0001:00008e74 _sprintf 00409e74 f LIBC:sprintf.obj + 0001:00008ec6 _malloc 00409ec6 f LIBC:malloc.obj + 0001:00008ed8 __nh_malloc 00409ed8 f LIBC:malloc.obj + 0001:00008f04 __heap_alloc 00409f04 f LIBC:malloc.obj + 0001:00008f90 _strchr 00409f90 f LIBC:strchr.obj + 0001:00008f96 ___from_strstr_to_strchr 00409f96 f LIBC:strchr.obj + 0001:00009050 _strncmp 0040a050 f LIBC:strncmp.obj + 0001:00009088 _sscanf 0040a088 f LIBC:sscanf.obj + 0001:000090c0 _strcmp 0040a0c0 f LIBC:strcmp.obj + 0001:00009144 __flsbuf 0040a144 f LIBC:_flsbuf.obj + 0001:00009260 _strncpy 0040a260 f LIBC:strncpy.obj + 0001:0000935e __cinit 0040a35e f LIBC:crt0dat.obj + 0001:0000938b _exit 0040a38b f LIBC:crt0dat.obj + 0001:0000939c __exit 0040a39c f LIBC:crt0dat.obj + 0001:000093ad __cexit 0040a3ad f LIBC:crt0dat.obj + 0001:000093bc __c_exit 0040a3bc f LIBC:crt0dat.obj + 0001:00009480 _strrchr 0040a480 f LIBC:strrchr.obj + 0001:000094a7 _mainCRTStartup 0040a4a7 f LIBC:crt0.obj + 0001:00009586 __amsg_exit 0040a586 f LIBC:crt0.obj + 0001:000095cf __stbuf 0040a5cf f LIBC:_sftbuf.obj + 0001:0000965c __ftbuf 0040a65c f LIBC:_sftbuf.obj + 0001:00009699 __output 0040a699 f LIBC:output.obj + 0001:00009ea3 __ioinit 0040aea3 f LIBC:ioinit.obj + 0001:0000a04e __ioterm 0040b04e f LIBC:ioinit.obj + 0001:0000a071 _calloc 0040b071 f LIBC:calloc.obj + 0001:0000a122 __fcloseall 0040b122 f LIBC:closeall.obj + 0001:0000a17a _fflush 0040b17a f LIBC:fflush.obj + 0001:0000a1b5 __flush 0040b1b5 f LIBC:fflush.obj + 0001:0000a211 __flushall 0040b211 f LIBC:fflush.obj + 0001:0000a287 __close 0040b287 f LIBC:close.obj + 0001:0000a33a __freebuf 0040b33a f LIBC:_freebuf.obj + 0001:0000a365 __filbuf 0040b365 f LIBC:_filbuf.obj + 0001:0000a43e __GetLinkerVersion 0040b43e f LIBC:heapinit.obj + 0001:0000a46b ___heap_select 0040b46b f LIBC:heapinit.obj + 0001:0000a5b3 __heap_init 0040b5b3 f LIBC:heapinit.obj + 0001:0000a610 __heap_term 0040b610 f LIBC:heapinit.obj + 0001:0000a6b8 __get_sbh_threshold 0040b6b8 f LIBC:sbheap.obj + 0001:0000a6d7 __set_sbh_threshold 0040b6d7 f LIBC:sbheap.obj + 0001:0000a78a ___sbh_heap_init 0040b78a f LIBC:sbheap.obj + 0001:0000a7d2 ___sbh_find_block 0040b7d2 f LIBC:sbheap.obj + 0001:0000a7fd ___sbh_free_block 0040b7fd f LIBC:sbheap.obj + 0001:0000ab26 ___sbh_alloc_block 0040bb26 f LIBC:sbheap.obj + 0001:0000ae2f ___sbh_alloc_new_region 0040be2f f LIBC:sbheap.obj + 0001:0000aee0 ___sbh_alloc_new_group 0040bee0 f LIBC:sbheap.obj + 0001:0000afdb ___sbh_resize_block 0040bfdb f LIBC:sbheap.obj + 0001:0000b2d1 ___sbh_heapmin 0040c2d1 f LIBC:sbheap.obj + 0001:0000b3a2 ___sbh_heap_check 0040c3a2 f LIBC:sbheap.obj + 0001:0000b6d1 __get_old_sbh_threshold 0040c6d1 f LIBC:sbheap.obj + 0001:0000b6d7 __set_old_sbh_threshold 0040c6d7 f LIBC:sbheap.obj + 0001:0000b6f3 ___old_sbh_new_region 0040c6f3 f LIBC:sbheap.obj + 0001:0000b837 ___old_sbh_release_region 0040c837 f LIBC:sbheap.obj + 0001:0000b88d ___old_sbh_decommit_pages 0040c88d f LIBC:sbheap.obj + 0001:0000b94f ___old_sbh_find_block 0040c94f f LIBC:sbheap.obj + 0001:0000b9a6 ___old_sbh_free_block 0040c9a6 f LIBC:sbheap.obj + 0001:0000b9eb ___old_sbh_alloc_block 0040c9eb f LIBC:sbheap.obj + 0001:0000bbf3 ___old_sbh_alloc_block_from_page 0040cbf3 f LIBC:sbheap.obj + 0001:0000bd17 ___old_sbh_resize_block 0040cd17 f LIBC:sbheap.obj + 0001:0000bdc0 ___old_sbh_heap_check 0040cdc0 f LIBC:sbheap.obj + 0001:0000bf1e __openfile 0040cf1e f LIBC:_open.obj + 0001:0000c08e __getstream 0040d08e f LIBC:stream.obj + 0001:0000c106 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z 0040d106 f LIBC:handler.obj + 0001:0000c116 ?_query_new_handler@@YAP6AHI@ZXZ 0040d116 f LIBC:handler.obj + 0001:0000c11c __callnewh 0040d11c f LIBC:handler.obj + 0001:0000c137 __input 0040d137 f LIBC:input.obj + 0001:0000cbe8 __lseek 0040dbe8 f LIBC:lseek.obj + 0001:0000cc82 __write 0040dc82 f LIBC:write.obj + 0001:0000ce2f __getbuf 0040de2f f LIBC:_getbuf.obj + 0001:0000ce73 __isatty 0040de73 f LIBC:isatty.obj + 0001:0000ce99 __XcptFilter 0040de99 f LIBC:winxfltr.obj + 0001:0000d01d __setenvp 0040e01d f LIBC:stdenvp.obj + 0001:0000d0d6 __setargv 0040e0d6 f LIBC:stdargv.obj + 0001:0000d323 ___crtGetEnvironmentStringsA 0040e323 f LIBC:a_env.obj + 0001:0000d458 __global_unwind2 0040e458 f LIBC:exsup.obj + 0001:0000d49a __local_unwind2 0040e49a f LIBC:exsup.obj + 0001:0000d4f2 __NLG_Return2 0040e4f2 f LIBC:exsup.obj + 0001:0000d502 __abnormal_termination 0040e502 f LIBC:exsup.obj + 0001:0000d525 __NLG_Notify1 0040e525 f LIBC:exsup.obj + 0001:0000d52e __NLG_Notify 0040e52e f LIBC:exsup.obj + 0001:0000d541 __NLG_Dispatch 0040e541 f LIBC:exsup.obj + 0001:0000d550 __except_handler3 0040e550 f LIBC:exsup3.obj + 0001:0000d60d __seh_longjmp_unwind@4 0040e60d f LIBC:exsup3.obj + 0001:0000d628 __FF_MSGBANNER 0040e628 f LIBC:crt0msg.obj + 0001:0000d661 __NMSG_WRITE 0040e661 f LIBC:crt0msg.obj + 0001:0000d7b4 __GET_RTERRMSG 0040e7b4 f LIBC:crt0msg.obj + 0001:0000d7e5 _wctomb 0040e7e5 f LIBC:wctomb.obj + 0001:0000d850 __aulldiv 0040e850 f LIBC:ulldiv.obj + 0001:0000d8c0 __aullrem 0040e8c0 f LIBC:ullrem.obj + 0001:0000d940 _memset 0040e940 f LIBC:memset.obj + 0001:0000d998 __commit 0040e998 f LIBC:commit.obj + 0001:0000d9ef __dosmaperr 0040e9ef f LIBC:dosmap.obj + 0001:0000da56 __alloc_osfhnd 0040ea56 f LIBC:osfinfo.obj + 0001:0000daeb __set_osfhnd 0040eaeb f LIBC:osfinfo.obj + 0001:0000db62 __free_osfhnd 0040eb62 f LIBC:osfinfo.obj + 0001:0000dbdc __get_osfhandle 0040ebdc f LIBC:osfinfo.obj + 0001:0000dc19 __open_osfhandle 0040ec19 f LIBC:osfinfo.obj + 0001:0000dcb6 __read 0040ecb6 f LIBC:read.obj + 0001:0000deac _strtol 0040eeac f LIBC:strtol.obj + 0001:0000e0cb _strtoul 0040f0cb f LIBC:strtol.obj + 0001:0000e0f0 _strstr 0040f0f0 f LIBC:strstr.obj + 0001:0000e170 __chkstk 0040f170 f LIBC:chkstk.obj + 0001:0000e170 __alloca_probe 0040f170 f LIBC:chkstk.obj + 0001:0000e1a0 _memmove 0040f1a0 f LIBC:memmove.obj + 0001:0000e4d5 __open 0040f4d5 f LIBC:open.obj + 0001:0000e4ec __sopen 0040f4ec f LIBC:open.obj + 0001:0000e7a5 _mbtowc 0040f7a5 f LIBC:mbtowc.obj + 0001:0000e86d _isalpha 0040f86d f LIBC:_ctype.obj + 0001:0000e89b _isupper 0040f89b f LIBC:_ctype.obj + 0001:0000e8c3 _islower 0040f8c3 f LIBC:_ctype.obj + 0001:0000e8eb _isdigit 0040f8eb f LIBC:_ctype.obj + 0001:0000e913 _isxdigit 0040f913 f LIBC:_ctype.obj + 0001:0000e940 _isspace 0040f940 f LIBC:_ctype.obj + 0001:0000e968 _ispunct 0040f968 f LIBC:_ctype.obj + 0001:0000e990 _isalnum 0040f990 f LIBC:_ctype.obj + 0001:0000e9be _isprint 0040f9be f LIBC:_ctype.obj + 0001:0000e9ec _isgraph 0040f9ec f LIBC:_ctype.obj + 0001:0000ea1a _iscntrl 0040fa1a f LIBC:_ctype.obj + 0001:0000ea42 ___isascii 0040fa42 f LIBC:_ctype.obj + 0001:0000ea4f ___toascii 0040fa4f f LIBC:_ctype.obj + 0001:0000ea57 ___iscsymf 0040fa57 f LIBC:_ctype.obj + 0001:0000ea94 ___iscsym 0040fa94 f LIBC:_ctype.obj + 0001:0000ead1 __isctype 0040fad1 f LIBC:isctype.obj + 0001:0000eb50 __allmul 0040fb50 f LIBC:llmul.obj + 0001:0000eb90 __allshl 0040fb90 f LIBC:llshl.obj + 0001:0000ebaf _ungetc 0040fbaf f LIBC:ungetc.obj + 0001:0000ec1d __setmbcp 0040fc1d f LIBC:mbctype.obj + 0001:0000efe1 __getmbcp 0040ffe1 f LIBC:mbctype.obj + 0001:0000eff1 ___initmbctable 0040fff1 f LIBC:mbctype.obj + 0001:0000f010 _memcpy 00410010 f LIBC:memcpy.obj + 0001:0000f345 ___crtMessageBoxA 00410345 f LIBC:crtmbox.obj + 0001:0000f3ce __fptrap 004103ce f LIBC:crt0fp.obj + 0001:0000f3d7 __toupper 004103d7 f LIBC:toupper.obj + 0001:0000f3df _toupper 004103df f LIBC:toupper.obj + 0001:0000f4ab __chsize 004104ab f LIBC:chsize.obj + 0001:0000f5f1 ___crtGetStringTypeA 004105f1 f LIBC:a_str.obj + 0001:0000f73a ___crtLCMapStringA 0041073a f LIBC:a_map.obj + 0001:0000f989 __setmode 00410989 f LIBC:setmode.obj + 0001:0000fa00 _HeapFree@12 00410a00 f kernel32:KERNEL32.dll + 0001:0000fa06 _HeapAlloc@12 00410a06 f kernel32:KERNEL32.dll + 0001:0000fa0c _ExitProcess@4 00410a0c f kernel32:KERNEL32.dll + 0001:0000fa12 _TerminateProcess@8 00410a12 f kernel32:KERNEL32.dll + 0001:0000fa18 _GetCurrentProcess@0 00410a18 f kernel32:KERNEL32.dll + 0001:0000fa1e _GetCommandLineA@0 00410a1e f kernel32:KERNEL32.dll + 0001:0000fa24 _GetVersion@0 00410a24 f kernel32:KERNEL32.dll + 0001:0000fa2a _SetHandleCount@4 00410a2a f kernel32:KERNEL32.dll + 0001:0000fa30 _GetStdHandle@4 00410a30 f kernel32:KERNEL32.dll + 0001:0000fa36 _GetFileType@4 00410a36 f kernel32:KERNEL32.dll + 0001:0000fa3c _GetStartupInfoA@4 00410a3c f kernel32:KERNEL32.dll + 0001:0000fa42 _GetLastError@0 00410a42 f kernel32:KERNEL32.dll + 0001:0000fa48 _CloseHandle@4 00410a48 f kernel32:KERNEL32.dll + 0001:0000fa4e _GetModuleHandleA@4 00410a4e f kernel32:KERNEL32.dll + 0001:0000fa54 _GetModuleFileNameA@12 00410a54 f kernel32:KERNEL32.dll + 0001:0000fa5a _GetEnvironmentVariableA@12 00410a5a f kernel32:KERNEL32.dll + 0001:0000fa60 _GetVersionExA@4 00410a60 f kernel32:KERNEL32.dll + 0001:0000fa66 _HeapDestroy@4 00410a66 f kernel32:KERNEL32.dll + 0001:0000fa6c _HeapCreate@12 00410a6c f kernel32:KERNEL32.dll + 0001:0000fa72 _VirtualFree@12 00410a72 f kernel32:KERNEL32.dll + 0001:0000fa78 _VirtualAlloc@16 00410a78 f kernel32:KERNEL32.dll + 0001:0000fa7e _HeapReAlloc@16 00410a7e f kernel32:KERNEL32.dll + 0001:0000fa84 _IsBadWritePtr@8 00410a84 f kernel32:KERNEL32.dll + 0001:0000fa8a _SetFilePointer@16 00410a8a f kernel32:KERNEL32.dll + 0001:0000fa90 _WriteFile@20 00410a90 f kernel32:KERNEL32.dll + 0001:0000fa96 _UnhandledExceptionFilter@4 00410a96 f kernel32:KERNEL32.dll + 0001:0000fa9c _FreeEnvironmentStringsA@4 00410a9c f kernel32:KERNEL32.dll + 0001:0000faa2 _FreeEnvironmentStringsW@4 00410aa2 f kernel32:KERNEL32.dll + 0001:0000faa8 _WideCharToMultiByte@32 00410aa8 f kernel32:KERNEL32.dll + 0001:0000faae _GetEnvironmentStrings@0 00410aae f kernel32:KERNEL32.dll + 0001:0000fab4 _GetEnvironmentStringsW@0 00410ab4 f kernel32:KERNEL32.dll + 0001:0000faba _RtlUnwind@16 00410aba f kernel32:KERNEL32.dll + 0001:0000fac0 _FlushFileBuffers@4 00410ac0 f kernel32:KERNEL32.dll + 0001:0000fac6 _SetStdHandle@8 00410ac6 f kernel32:KERNEL32.dll + 0001:0000facc _ReadFile@20 00410acc f kernel32:KERNEL32.dll + 0001:0000fad2 _CreateFileA@28 00410ad2 f kernel32:KERNEL32.dll + 0001:0000fad8 _MultiByteToWideChar@24 00410ad8 f kernel32:KERNEL32.dll + 0001:0000fade _GetCPInfo@8 00410ade f kernel32:KERNEL32.dll + 0001:0000fae4 _GetACP@0 00410ae4 f kernel32:KERNEL32.dll + 0001:0000faea _GetOEMCP@0 00410aea f kernel32:KERNEL32.dll + 0001:0000faf0 _GetProcAddress@8 00410af0 f kernel32:KERNEL32.dll + 0001:0000faf6 _LoadLibraryA@4 00410af6 f kernel32:KERNEL32.dll + 0001:0000fafc _SetEndOfFile@4 00410afc f kernel32:KERNEL32.dll + 0001:0000fb02 _GetStringTypeA@20 00410b02 f kernel32:KERNEL32.dll + 0001:0000fb08 _GetStringTypeW@16 00410b08 f kernel32:KERNEL32.dll + 0001:0000fb0e _LCMapStringA@24 00410b0e f kernel32:KERNEL32.dll + 0001:0000fb14 _LCMapStringW@24 00410b14 f kernel32:KERNEL32.dll + 0002:0000002c ___lookuptable 0041402c LIBC:output.obj + 0002:00000088 ??_C@_1O@POHA@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 00414088 LIBC:output.obj + 0002:00000098 ??_C@_06ONKE@?$CInull?$CJ?$AA@ 00414098 LIBC:output.obj + 0002:000000a0 ??_C@_0BH@PHHF@__GLOBAL_HEAP_SELECTED?$AA@ 004140a0 LIBC:heapinit.obj + 0002:000000b8 ??_C@_0BF@BBGL@__MSVCRT_HEAP_SELECT?$AA@ 004140b8 LIBC:heapinit.obj + 0002:000000d0 ??_C@_0P@GGKG@runtime?5error?5?$AA@ 004140d0 LIBC:crt0msg.obj + 0002:000000e0 ??_C@_02PIMC@?$AN?6?$AA@ 004140e0 LIBC:crt0msg.obj + 0002:000000e4 ??_C@_0O@DELO@TLOSS?5error?$AN?6?$AA@ 004140e4 LIBC:crt0msg.obj + 0002:000000f4 ??_C@_0N@OMLL@SING?5error?$AN?6?$AA@ 004140f4 LIBC:crt0msg.obj + 0002:00000104 ??_C@_0P@OJAK@DOMAIN?5error?$AN?6?$AA@ 00414104 LIBC:crt0msg.obj + 0002:00000114 ??_C@_0CF@EANP@R6028?$AN?6?9?5unable?5to?5initialize?5he@ 00414114 LIBC:crt0msg.obj + 0002:0000013c ??_C@_0DF@ECGN@R6027?$AN?6?9?5not?5enough?5space?5for?5lo@ 0041413c LIBC:crt0msg.obj + 0002:00000174 ??_C@_0DF@FKAC@R6026?$AN?6?9?5not?5enough?5space?5for?5st@ 00414174 LIBC:crt0msg.obj + 0002:000001ac ??_C@_0CG@DPMN@R6025?$AN?6?9?5pure?5virtual?5function?5c@ 004141ac LIBC:crt0msg.obj + 0002:000001d4 ??_C@_0DF@CKIP@R6024?$AN?6?9?5not?5enough?5space?5for?5_o@ 004141d4 LIBC:crt0msg.obj + 0002:0000020c ??_C@_0CJ@GGOE@R6019?$AN?6?9?5unable?5to?5open?5console?5@ 0041420c LIBC:crt0msg.obj + 0002:00000238 ??_C@_0CB@LBOB@R6018?$AN?6?9?5unexpected?5heap?5error?$AN?6@ 00414238 LIBC:crt0msg.obj + 0002:0000025c ??_C@_0CN@FPEG@R6017?$AN?6?9?5unexpected?5multithread?5@ 0041425c LIBC:crt0msg.obj + 0002:0000028c ??_C@_0CM@OBIC@R6016?$AN?6?9?5not?5enough?5space?5for?5th@ 0041428c LIBC:crt0msg.obj + 0002:000002b8 ??_C@_0CB@HPAL@?$AN?6abnormal?5program?5termination?$AN?6@ 004142b8 LIBC:crt0msg.obj + 0002:000002dc ??_C@_0CM@JOOB@R6009?$AN?6?9?5not?5enough?5space?5for?5en@ 004142dc LIBC:crt0msg.obj + 0002:00000308 ??_C@_0CK@OIBL@R6008?$AN?6?9?5not?5enough?5space?5for?5ar@ 00414308 LIBC:crt0msg.obj + 0002:00000334 ??_C@_0CF@LKPB@R6002?$AN?6?9?5floating?5point?5not?5load@ 00414334 LIBC:crt0msg.obj + 0002:0000035c ??_C@_0CF@JPDF@Microsoft?5Visual?5C?$CL?$CL?5Runtime?5Lib@ 0041435c LIBC:crt0msg.obj + 0002:00000384 ??_C@_02JJJH@?6?6?$AA@ 00414384 LIBC:crt0msg.obj + 0002:00000388 ??_C@_0BK@DEOK@Runtime?5Error?$CB?6?6Program?3?5?$AA@ 00414388 LIBC:crt0msg.obj + 0002:000003a4 ??_C@_03NAME@?4?4?4?$AA@ 004143a4 LIBC:crt0msg.obj + 0002:000003a8 ??_C@_0BH@NNCD@?$DMprogram?5name?5unknown?$DO?$AA@ 004143a8 LIBC:crt0msg.obj + 0002:000003c0 ??_C@_0BD@NJFP@GetLastActivePopup?$AA@ 004143c0 LIBC:crtmbox.obj + 0002:000003d4 ??_C@_0BA@GILI@GetActiveWindow?$AA@ 004143d4 LIBC:crtmbox.obj + 0002:000003e4 ??_C@_0M@PKCK@MessageBoxA?$AA@ 004143e4 LIBC:crtmbox.obj + 0002:000003f0 ??_C@_0L@HKL@user32?4dll?$AA@ 004143f0 LIBC:crtmbox.obj + 0002:000003fc ??_C@_01A@?$AA?$AA@ 004143fc LIBC:a_str.obj + 0002:00000400 ??_C@_13A@?$AA?$AA?$AA?$AA@ 00414400 LIBC:a_str.obj + 0003:00000000 ___xc_a 00415000 LIBC:crt0init.obj + 0003:00000104 ___xc_z 00415104 LIBC:crt0init.obj + 0003:00000208 ___xi_a 00415208 LIBC:crt0init.obj + 0003:00000418 ___xi_z 00415418 LIBC:crt0init.obj + 0003:0000051c ___xp_a 0041551c LIBC:crt0init.obj + 0003:00000724 ___xp_z 00415724 LIBC:crt0init.obj + 0003:00000828 ___xt_a 00415828 LIBC:crt0init.obj + 0003:0000092c ___xt_z 0041592c LIBC:crt0init.obj + 0003:00000b14 __abs_ 00415b14 lkdata.obj + 0003:00000b18 _rtaflg 00415b18 lkdata.obj + 0003:00000b1c _ctype 00415b1c lkdata.obj + 0003:00000b9c _ccase 00415b9c lkdata.obj + 0003:00001370 _usetxt 00416370 lkmain.obj + 0003:00001d7c _errmsg 00416d7c lkrloc.obj + 0003:000022d0 __iob 004172d0 LIBC:_file.obj + 0003:00002550 __aexit_rtn 00417550 LIBC:crt0.obj + 0003:00002554 ___app_type 00417554 LIBC:crt0.obj + 0003:00002558 ___nullstring 00417558 LIBC:output.obj + 0003:0000255c ___wnullstring 0041755c LIBC:output.obj + 0003:00002560 ___badioinfo 00417560 LIBC:ioinit.obj + 0003:00002568 __amblksiz 00417568 LIBC:heapinit.obj + 0003:00002570 ___old_small_block_heap 00417570 LIBC:sbheap.obj + 0003:00004594 ___old_sbh_threshold 00419594 LIBC:sbheap.obj + 0003:000045a8 __XcptActTab 004195a8 LIBC:winxfltr.obj + 0003:00004620 __First_FPE_Indx 00419620 LIBC:winxfltr.obj + 0003:00004624 __Num_FPE 00419624 LIBC:winxfltr.obj + 0003:00004628 __XcptActTabCount 00419628 LIBC:winxfltr.obj + 0003:0000462c __fpecode 0041962c LIBC:winxfltr.obj + 0003:00004630 __NLG_Destination 00419630 LIBC:exsup.obj + 0003:000046d0 __cfltcvt_tab 004196d0 LIBC:cmiscdat.obj + 0003:000046e8 __pctype 004196e8 LIBC:ctype.obj + 0003:000046ec __pwctype 004196ec LIBC:ctype.obj + 0003:000046f0 __ctype 004196f0 LIBC:ctype.obj + 0003:00004a70 ___mb_cur_max 00419a70 LIBC:nlsdata1.obj + 0003:00004a74 ___decimal_point 00419a74 LIBC:nlsdata1.obj + 0003:00004a78 ___decimal_point_length 00419a78 LIBC:nlsdata1.obj + 0003:000054b0 _rtadr0 0041a4b0 lkdata.obj + 0003:000054b4 _rtadr1 0041a4b4 lkdata.obj + 0003:000054b8 _rtadr2 0041a4b8 lkdata.obj + 0003:000054bc _obj_flag 0041a4bc lkdata.obj + 0003:000054e8 __cflush 0041a4e8 LIBC:_file.obj + 0003:000054ec _errno 0041a4ec LIBC:crt0dat.obj + 0003:000054f0 __doserrno 0041a4f0 LIBC:crt0dat.obj + 0003:000054f4 __umaskval 0041a4f4 LIBC:crt0dat.obj + 0003:000054f8 __osver 0041a4f8 LIBC:crt0dat.obj + 0003:000054fc __winver 0041a4fc LIBC:crt0dat.obj + 0003:00005500 __winmajor 0041a500 LIBC:crt0dat.obj + 0003:00005504 __winminor 0041a504 LIBC:crt0dat.obj + 0003:00005508 ___argc 0041a508 LIBC:crt0dat.obj + 0003:0000550c ___argv 0041a50c LIBC:crt0dat.obj + 0003:00005510 ___wargv 0041a510 LIBC:crt0dat.obj + 0003:00005514 __environ 0041a514 LIBC:crt0dat.obj + 0003:00005518 ___initenv 0041a518 LIBC:crt0dat.obj + 0003:0000551c __wenviron 0041a51c LIBC:crt0dat.obj + 0003:00005520 ___winitenv 0041a520 LIBC:crt0dat.obj + 0003:00005524 __pgmptr 0041a524 LIBC:crt0dat.obj + 0003:00005528 __wpgmptr 0041a528 LIBC:crt0dat.obj + 0003:0000552c __exitflag 0041a52c LIBC:crt0dat.obj + 0003:00005530 __C_Termination_Done 0041a530 LIBC:crt0dat.obj + 0003:00005534 __C_Exit_Done 0041a534 LIBC:crt0dat.obj + 0003:00005538 __aenvptr 0041a538 LIBC:crt0.obj + 0003:0000553c __wenvptr 0041a53c LIBC:crt0.obj + 0003:00005540 ___error_mode 0041a540 LIBC:crt0.obj + 0003:00005544 __stdbuf 0041a544 LIBC:_sftbuf.obj + 0003:00005550 __newmode 0041a550 LIBC:_newmode.obj + 0003:00005554 ?_pnhHeap@@3P6AHI@ZA 0041a554 LIBC:handler.obj + 0003:00005558 __pxcptinfoptrs 0041a558 LIBC:winxfltr.obj + 0003:00005664 __adbgmsg 0041a664 LIBC:crt0msg.obj + 0003:00005668 __commode 0041a668 LIBC:ncommode.obj + 0003:0000567c ___lc_handle 0041a67c LIBC:nlsdata2.obj + 0003:00005694 ___lc_codepage 0041a694 LIBC:nlsdata2.obj + 0003:00005698 ___lc_collate_cp 0041a698 LIBC:nlsdata2.obj + 0003:0000569c __fmode 0041a69c LIBC:txtmode.obj + 0003:000056a8 _uflag 0041a6a8 + 0003:0000578c _hilo 0041a78c + 0003:000057a0 _rtbuf 0041a7a0 + 0003:000057f0 _rtcnt 0041a7f0 + 0003:00005800 _rtflg 0041a800 + 0003:00005840 _lbfhead 0041a840 + 0003:00005860 _symhash 0041a860 + 0003:00005960 _cfp 0041a960 + 0003:00005964 _bsp 0041a964 + 0003:00005968 _axp 0041a968 + 0003:0000596c _lbnhead 0041a96c + 0003:00005970 _gcntr 0041a970 + 0003:00005974 _filep 0041a974 + 0003:00005978 _gsp 0041a978 + 0003:0000597c _globlp 0041a97c + 0003:00005980 _lfp 0041a980 + 0003:00005984 _mfp 0041a984 + 0003:00005988 _a_mask 0041a988 + 0003:0000598c _line 0041a98c + 0003:00005990 _lop 0041a990 + 0003:000059a0 _rtval 0041a9a0 + 0003:000059e0 _ofp 0041a9e0 + 0003:000059e4 _headp 0041a9e4 + 0003:000059e8 _zflag 0041a9e8 + 0003:000059ec _rfp 0041a9ec + 0003:000059f0 _oflag 0041a9f0 + 0003:00005a00 _sdp 0041aa00 + 0003:00005a0c _sfp 0041aa0c + 0003:00005a10 _areap 0041aa10 + 0003:00005a14 _tfp 0041aa14 + 0003:00005a18 _page 0041aa18 + 0003:00005a1c _pass 0041aa1c + 0003:00005a20 _ap 0041aa20 + 0003:00005a24 _outfp 0041aa24 + 0003:00005a40 _ib 0041aa40 + 0003:00005b08 _wflag 0041ab08 + 0003:00005b0c _hp 0041ab0c + 0003:00005b10 _ip 0041ab10 + 0003:00005b20 _rb 0041ab20 + 0003:00005be8 _rp 0041abe8 + 0003:00005bec _a_bytes 0041abec + 0003:00005bf0 _gline 0041abf0 + 0003:00005c00 _rerr 0041ac00 + 0003:00005c14 _pflag 0041ac14 + 0003:00005c18 _s_mask 0041ac18 + 0003:00005c1c _basep 0041ac1c + 0003:00005c20 _lbphead 0041ac20 + 0003:00005c24 _xflag 0041ac24 + 0003:00005c28 _startp 0041ac28 + 0003:00005c2c _radix 0041ac2c + 0003:00005c30 _mflag 0041ac30 + 0003:00005c34 _linkp 0041ac34 + 0003:00005c38 _objflg 0041ac38 + 0003:00005c3c _lkerr 0041ac3c + 0003:00005c40 _v_mask 0041ac40 + 0003:00005c44 ___mbcodepage 0041ac44 + 0003:00005cc0 ___mbulinfo 0041acc0 + 0003:00005ccc ___ismbcodepage 0041accc + 0003:00005ce0 __mbcasemap 0041ace0 + 0003:00005de0 __mbctype 0041ade0 + 0003:00005ee4 ___mblcid 0041aee4 + 0003:00005ee8 ___sbh_sizeHeaderList 0041aee8 + 0003:00005efc ___sbh_indGroupDefer 0041aefc + 0003:00005f00 ___sbh_pHeaderScan 0041af00 + 0003:00005f04 ___sbh_initialized 0041af04 + 0003:00005f08 ___sbh_pHeaderDefer 0041af08 + 0003:00005f0c ___sbh_cntHeaderList 0041af0c + 0003:00005f10 ___sbh_pHeaderList 0041af10 + 0003:00005f14 ___sbh_threshold 0041af14 + 0003:00005f18 __crtheap 0041af18 + 0003:00005f28 ___active_heap 0041af28 + 0003:00005f40 ___pioinfo 0041af40 + 0003:0000607c __nhandle 0041b07c + 0003:00006080 __acmdln 0041b080 + 0003:0000608c ___env_initialized 0041b08c + 0003:0000609c ___mbctype_initialized 0041b09c + 0003:000060a0 ___onexitend 0041b0a0 + 0003:000060a4 ___onexitbegin 0041b0a4 + 0003:000060a8 __FPinit 0041b0a8 + 0003:000060ac ___piob 0041b0ac + 0003:00006400 __bufin 0041b400 + 0003:00007400 __nstream 0041c400 + 0004:00000000 __IMPORT_DESCRIPTOR_KERNEL32 0041d000 kernel32:KERNEL32.dll + 0004:00000014 __NULL_IMPORT_DESCRIPTOR 0041d014 kernel32:KERNEL32.dll + 0004:00000134 __imp__WriteFile@20 0041d134 kernel32:KERNEL32.dll + 0004:00000138 __imp__HeapAlloc@12 0041d138 kernel32:KERNEL32.dll + 0004:0000013c __imp__ExitProcess@4 0041d13c kernel32:KERNEL32.dll + 0004:00000140 __imp__TerminateProcess@8 0041d140 kernel32:KERNEL32.dll + 0004:00000144 __imp__GetCurrentProcess@0 0041d144 kernel32:KERNEL32.dll + 0004:00000148 __imp__GetCommandLineA@0 0041d148 kernel32:KERNEL32.dll + 0004:0000014c __imp__GetVersion@0 0041d14c kernel32:KERNEL32.dll + 0004:00000150 __imp__SetHandleCount@4 0041d150 kernel32:KERNEL32.dll + 0004:00000154 __imp__GetStdHandle@4 0041d154 kernel32:KERNEL32.dll + 0004:00000158 __imp__GetFileType@4 0041d158 kernel32:KERNEL32.dll + 0004:0000015c __imp__GetStartupInfoA@4 0041d15c kernel32:KERNEL32.dll + 0004:00000160 __imp__GetLastError@0 0041d160 kernel32:KERNEL32.dll + 0004:00000164 __imp__CloseHandle@4 0041d164 kernel32:KERNEL32.dll + 0004:00000168 __imp__GetModuleHandleA@4 0041d168 kernel32:KERNEL32.dll + 0004:0000016c __imp__GetModuleFileNameA@12 0041d16c kernel32:KERNEL32.dll + 0004:00000170 __imp__GetEnvironmentVariableA@12 0041d170 kernel32:KERNEL32.dll + 0004:00000174 __imp__GetVersionExA@4 0041d174 kernel32:KERNEL32.dll + 0004:00000178 __imp__HeapDestroy@4 0041d178 kernel32:KERNEL32.dll + 0004:0000017c __imp__HeapCreate@12 0041d17c kernel32:KERNEL32.dll + 0004:00000180 __imp__VirtualFree@12 0041d180 kernel32:KERNEL32.dll + 0004:00000184 __imp__VirtualAlloc@16 0041d184 kernel32:KERNEL32.dll + 0004:00000188 __imp__HeapReAlloc@16 0041d188 kernel32:KERNEL32.dll + 0004:0000018c __imp__IsBadWritePtr@8 0041d18c kernel32:KERNEL32.dll + 0004:00000190 __imp__SetFilePointer@16 0041d190 kernel32:KERNEL32.dll + 0004:00000194 __imp__HeapFree@12 0041d194 kernel32:KERNEL32.dll + 0004:00000198 __imp__UnhandledExceptionFilter@4 0041d198 kernel32:KERNEL32.dll + 0004:0000019c __imp__FreeEnvironmentStringsA@4 0041d19c kernel32:KERNEL32.dll + 0004:000001a0 __imp__FreeEnvironmentStringsW@4 0041d1a0 kernel32:KERNEL32.dll + 0004:000001a4 __imp__WideCharToMultiByte@32 0041d1a4 kernel32:KERNEL32.dll + 0004:000001a8 __imp__GetEnvironmentStrings@0 0041d1a8 kernel32:KERNEL32.dll + 0004:000001ac __imp__GetEnvironmentStringsW@0 0041d1ac kernel32:KERNEL32.dll + 0004:000001b0 __imp__RtlUnwind@16 0041d1b0 kernel32:KERNEL32.dll + 0004:000001b4 __imp__FlushFileBuffers@4 0041d1b4 kernel32:KERNEL32.dll + 0004:000001b8 __imp__SetStdHandle@8 0041d1b8 kernel32:KERNEL32.dll + 0004:000001bc __imp__ReadFile@20 0041d1bc kernel32:KERNEL32.dll + 0004:000001c0 __imp__CreateFileA@28 0041d1c0 kernel32:KERNEL32.dll + 0004:000001c4 __imp__MultiByteToWideChar@24 0041d1c4 kernel32:KERNEL32.dll + 0004:000001c8 __imp__GetCPInfo@8 0041d1c8 kernel32:KERNEL32.dll + 0004:000001cc __imp__GetACP@0 0041d1cc kernel32:KERNEL32.dll + 0004:000001d0 __imp__GetOEMCP@0 0041d1d0 kernel32:KERNEL32.dll + 0004:000001d4 __imp__GetProcAddress@8 0041d1d4 kernel32:KERNEL32.dll + 0004:000001d8 __imp__LoadLibraryA@4 0041d1d8 kernel32:KERNEL32.dll + 0004:000001dc __imp__SetEndOfFile@4 0041d1dc kernel32:KERNEL32.dll + 0004:000001e0 __imp__GetStringTypeA@20 0041d1e0 kernel32:KERNEL32.dll + 0004:000001e4 __imp__GetStringTypeW@16 0041d1e4 kernel32:KERNEL32.dll + 0004:000001e8 __imp__LCMapStringA@24 0041d1e8 kernel32:KERNEL32.dll + 0004:000001ec __imp__LCMapStringW@24 0041d1ec kernel32:KERNEL32.dll + 0004:000001f0 \177KERNEL32_NULL_THUNK_DATA 0041d1f0 kernel32:KERNEL32.dll + + entry point at 0001:000094a7 + diff --git a/src/link-z80/lkarea.c b/src/mkutil/link-z80/lkarea.c similarity index 100% rename from src/link-z80/lkarea.c rename to src/mkutil/link-z80/lkarea.c diff --git a/src/link-z80/lkdata.c b/src/mkutil/link-z80/lkdata.c similarity index 100% rename from src/link-z80/lkdata.c rename to src/mkutil/link-z80/lkdata.c diff --git a/src/link-z80/lkeval.c b/src/mkutil/link-z80/lkeval.c similarity index 100% rename from src/link-z80/lkeval.c rename to src/mkutil/link-z80/lkeval.c diff --git a/src/link-z80/lkhead.c b/src/mkutil/link-z80/lkhead.c similarity index 100% rename from src/link-z80/lkhead.c rename to src/mkutil/link-z80/lkhead.c diff --git a/src/link-z80/lklex.c b/src/mkutil/link-z80/lklex.c similarity index 100% rename from src/link-z80/lklex.c rename to src/mkutil/link-z80/lklex.c diff --git a/src/link-z80/lklibr.c b/src/mkutil/link-z80/lklibr.c similarity index 100% rename from src/link-z80/lklibr.c rename to src/mkutil/link-z80/lklibr.c diff --git a/src/link-z80/lklist.c b/src/mkutil/link-z80/lklist.c similarity index 100% rename from src/link-z80/lklist.c rename to src/mkutil/link-z80/lklist.c diff --git a/src/link-z80/lkmain.c b/src/mkutil/link-z80/lkmain.c similarity index 100% rename from src/link-z80/lkmain.c rename to src/mkutil/link-z80/lkmain.c diff --git a/src/link-z80/lkout.c b/src/mkutil/link-z80/lkout.c similarity index 100% rename from src/link-z80/lkout.c rename to src/mkutil/link-z80/lkout.c diff --git a/src/link-z80/lkrloc.c b/src/mkutil/link-z80/lkrloc.c similarity index 100% rename from src/link-z80/lkrloc.c rename to src/mkutil/link-z80/lkrloc.c diff --git a/src/link-z80/lksym.c b/src/mkutil/link-z80/lksym.c similarity index 100% rename from src/link-z80/lksym.c rename to src/mkutil/link-z80/lksym.c diff --git a/src/link-z80/n.bat b/src/mkutil/link-z80/n.bat similarity index 93% rename from src/link-z80/n.bat rename to src/mkutil/link-z80/n.bat index 527a821c..58d1058b 100644 --- a/src/link-z80/n.bat +++ b/src/mkutil/link-z80/n.bat @@ -22,7 +22,7 @@ cl -Zi -I. -DWIN32 -DINDEXLIB -c lksym.c @if errorlevel 1 goto failure link @link-z80.lnk @if errorlevel 1 goto failure -copy link-z80.exe ..\bin +copy link-z80.exe ..\..\bin @echo SUCCESS @goto done diff --git a/src/link-z80/x.bat b/src/mkutil/link-z80/x.bat similarity index 100% rename from src/link-z80/x.bat rename to src/mkutil/link-z80/x.bat diff --git a/src/mkutil/n.bat b/src/mkutil/n.bat index 53a42a21..a3013c96 100644 --- a/src/mkutil/n.bat +++ b/src/mkutil/n.bat @@ -10,6 +10,10 @@ cl -Zi -I. bin2c.c @if errorlevel 1 goto failure copy bin2c.exe ..\bin +cl -Zi -I. bin2avr.c +@if errorlevel 1 goto failure +copy bin2avr.exe ..\bin + cl -Zi -I. -DVAX cr.c @if errorlevel 1 goto failure copy cr.exe ..\bin diff --git a/src/mkutil/tavrasm.118/README b/src/mkutil/tavrasm.118/README new file mode 100644 index 00000000..22b0b461 --- /dev/null +++ b/src/mkutil/tavrasm.118/README @@ -0,0 +1,320 @@ + + Toms AVR macro assembler - tavrasm 1.18 + ============================================================================= + + tavrasm - A GNU/Linux assembler for the Atmel AVR series of + micro-controllers. Copyright (C) 1999-2003 Tom Mortensen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. + + Introduction + ============================================================================= + + tavrasm is an assembler for the Atmel AVR family of micro-controllers. + It uses a syntax similar to the one found in the Atmel AVR DOS assembler. + Some of the features includes: + + - Super-set of Atmel AVR assembler. + - Macros in macros. + - Save Intel HEX, Motorola S-record, Generic and binary output. + - More than 100 warning/error messages. + - Atmel object files compatible with Atmel's AVR Studio. + - C escape characters in char/string literals. + - Runs on (win)DOS, Linux, OS/2, Solaris, ... + - Free software released under GPL. + + Installation + ============================================================================= + + Copy the tavrasm executable (tavrasm.exe for OS/2 and DOS) to a + directory in your path. + + Running + ============================================================================= + + Just type 'tavrasm file.asm'. This will generate an Intel HEX output file + ('file.hex'). To get help, type 'tavrasm' with no arguments. + + Compiling + ============================================================================= + + tavrasm should compile on most systems that are supported by gcc. + I haven't check for endianes, so this might be a problem if + anybody wants to compile it on non-i386 systems (mail me, and I will + fix this). + + Check the makefile for additional information. + + Systems supported + ============================================================================= + + Linux/x86: I wrote parts of tavrasm on a Linux/x86. + + Linux/PPC: Andreas Bogk reports that he has successfully compiled + tavrasm on a LinuxPPC machine. + + Linux/Alpha: Now works (after a little bug fix). + + FreeBSD: Lots of people runs tavrasm on FreeBSD. + + Sparc: I have received reports from serveral people running + tavrasm on a Sparc station. + + OS/2: I wrote the initial version of tavrasm on OS/2 (using emx) + + Note: On non-x86 machines remove -m486 from the makefile :) + + Bugs/Suggestions/Patches + ============================================================================= + + Please send any bug-reports/suggestions/patches to me (tom@tavrasm.org). + + History + ============================================================================= + + 1.18 - Added support for specifying unsigned integer values [0; 2^32-1] + + Thanks to Richard Gerrits for pointing out the problem. + + Added support for specifying Z/Y/Z for adiw, sbiw and movw. + + Thanks to Richard Barrington for suggesting this. + + Added support for a bunch of Mega devices. + + Thanks to Andreas Schwarz for supplying a patch with these. + + Fixed problems compiling with GCC 3.2 + + Several people supplied patches, but I was just too busy + integrating them. + + Thanks to Patrick Dreker for supplying the final patch. + + 1.17 - Added support for the BYTE1 (same as LOW) function. + + Thanks to Timothy Lee for supplying this patch. + + Fixed path delimiter problem in include path. I used + DOS style '\' causing problems on *NIX. + + Thanks to Timothy Lee for reporting this. + + 1.16 - Fixed problem with long macro names. + + Thanks to Richard Gerrits for reporting this. + + Increased maximum identifier length to 64 (and no, this was + not the fix to the problem above :). + + Added support for using DOS (\13\10) files on *NIX systems. + + Change URL to www.tavrasm.org in help/README/... + + 1.15 - Added support for multiple include path. Use '-I' to specify + additional include paths. + + Thanks to Brian Rhodefer for adding this. + + Added option to omit address extension record in Intel HEX files. + Use '-h' to omit address extension record. + + Released November 2000 + + 1.14 - Added support for forward .org statements. Use '-f' to supress + warnings. + + Thanks to Brian Rhodefer for suggesting this. + + Not released + + 1.13 - Some overall clean up and german translations. + + Added support for local labels. Use _ as the first charcter of a + label to give it local scope between two non-local labels. + + Specify -x to enable local labels. + + Changed range checking code to allow negative numbers in some cases. + + Thanks to Kurt Stege for implementing local labels and cleaning up + the code. + + Not released + + 1.12 - Added the 'spm' instruction (forgot the first time around) + + Thanks to Jochen Pernsteiner for pointing this out. + + Released December 1999 + + 1.11 - Now the Alpha problem is fixed (I forgot to move fix from test to + release source). + + Fixed promlem with detecting supported instructions (Introduced in + 1.10) - Thanks to Mark V. Vaysman for reporting this. + + Removed carriage returns from source, so it will compile under + *NIX without problems. Thanks to Todd M. Squires for reporting this. + + Released December 1999 + + 1.10 - Added the new instructions: 'eijmp', 'eicall', 'espm', 'mulsu', + 'fmul', 'fmuls', 'fmulsu', 'muls', 'movw', 'elpm'. + + Changed behaviour of 'lpm' according to Atmel specs. + + Added spanish translation - Thanks to Lluis Ballester for supplying + the Spanish translation. + + Fixed .endm problem (it had to be lower case) - It was reported + on comp.arch.embedded by Ben Cantrick. + + Released December 1999 + + 1.09 - Fixed problem with BRBC/BRBS (they did not work). I used the status + bit number for both source and destination operand (word of advise - + don't use variable names like 'values' and 'valued' in the same + context :) + + Fixed problem when compiling on Alpha's + + Thanks to Todd M. Squires for reporting these (and supplying a patch + for the Alpha problem). + + Released December 1999 + + + 1.08 - Fixed problem with SBR (Set Bits in Register). This is the same + as ORI, but the SBR version had a bug (one of those that generates + faulty code), bit 0 was always set. + + Thanks to Dean Huxley for reporting this (and supplying a patch). + + Added support for AT90S4433 (similar to 4414/4434). + + Released July 1999 + + + 1.07 - Added support for using PC as program counter (i.e. rjmp PC+4), + EC as eeprom counter and DC as data counter. + + Thanks to Adam Dybkowski for suggesting this. + + Released May 1999 + + + 1.06 - Added support for wrapping branches and relative call/jumps + Use the '-a' switch to enable this feature. + + Thanks to Jochen Pernsteiner for suggesting this. + + Restored the generic hex format. The generic hex format + disappeared in version 1.03 (when the default file format was + changed to Intel Hex). Use the '-g' switch to generate + generic hex (files that looks like this: "000021:f7f0"). + + Released May 1999 + + + 1.05 - Fixed problem with detection of binary numbers like '0b010101'. + This was bug was introduced by the new hex detection feature in + V. 1.04 :( + + Thanks to Randy Ott for reporting this. + + Fixed problem with memset of context stack that caused the winDOS + version to crash on some systems (strange that Linux/NT did not + detect this obvious memory violation). + + Thanks to Steve Maddigan for reporting this, and to my friend + Henning for finding the bug. + + Released May 1999 + + + 1.04 - Fixed problem with tabs after include filename, thanks to + Andreas Bogk for reporting this. + + Added support for specifying hex values like 1AB without '$' or '0x' + thanks to Andreas Bogk for suggesting this. + + Changed distribution format, so source i now located in a + sub-directory. + + Released April 1999 + + + 1.03 - Modified to support Intel hex as the default. + + Now automatically determines the output file name. + + Exits with a count of the number of errors (for make). + + Thanks to Jim Dowling for supplying these patches. + + Released March 1999 + + + 1.02 - Added support for German - Thanks to Uwe Bonnes for supplying + the German translation. + + Released February 1999 + + + 1.01 - Fixed alignment problem with forward references to .db in CSEG + ,thanks to Rob Penny for reporting this. + + Added a -d option to list supported devices. + + Updated the device information. + + Released January 1999 + + + 1.00 - Initial release September 1998 + + + TODO - None of these are critical, but would be nice :-) + ============================================================================= + + - Write some documentation !!! + + - Change source to new {} style (they finally convinced me :-) + + - Change handling of code/ROM buffers. + + - Make more language versions (French/Italian) (find someone to help me) + + - 0m01010101 Set mask + + - .def PowerStatus = Autoreg high = reset, monitor + + - opcode aliases med SBCI / SUBI = 255-ADCI/ADBI + + - Sinw / Cosw / Sinb / Cosb + + - define macros + + ============================================================================= + + Copenhagen, March 2003 + Tom Mortensen + + E-mail : tom@tavrasm.org + WWW : http://www.tavrasm.org + + ============================================================================= diff --git a/src/mkutil/tavrasm.118/gpl.txt b/src/mkutil/tavrasm.118/gpl.txt new file mode 100644 index 00000000..3cd95613 --- /dev/null +++ b/src/mkutil/tavrasm.118/gpl.txt @@ -0,0 +1,285 @@ +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, +we want its recipients to know that what they have is not the +original, so that any problems introduced by others will not reflect +on the original authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at +all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the Program +(independent of having been made by running the Program). Whether +that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice +and disclaimer of warranty; keep intact all the notices that refer to +this License and to the absence of any warranty; and give any other +recipients of the Program a copy of this License along with the +Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a +fee. + +2. You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute +such modifications or work under the terms of Section 1 above, +provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to all + third parties under the terms of this License. + + c) If the modified program normally reads commands + interactively when run, you must cause it, when started running + for such interactive use in the most ordinary way, to print or + display an announcement including an appropriate copyright + notice and a notice that there is no warranty (or else, saying + that you provide a warranty) and that users may redistribute + the program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program itself + is interactive but does not normally print such an + announcement, your work based on the Program is not required to + print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding + machine-readable source code, which must be distributed under + the terms of Sections 1 and 2 above on a medium customarily + used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the + offer to distribute corresponding source code. (This + alternative is allowed only for noncommercial distribution and + only if you received the program in object code or executable + form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise +to copy, modify, sublicense or distribute the Program is void, and +will automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted +herein. You are not responsible for enforcing compliance by third +parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new +versions of the General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a +version number of this License, you may choose any version ever +published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the +author to ask for permission. For software which is copyrighted by the +Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the +two goals of preserving the free status of all derivatives of our free +software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE +LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS +AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF +ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. diff --git a/src/mkutil/tavrasm.118/src/8535def.inc b/src/mkutil/tavrasm.118/src/8535def.inc new file mode 100644 index 00000000..56dbae59 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/8535def.inc @@ -0,0 +1,366 @@ +;*************************************************************************** +;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y +;* +;* Number :AVR000 +;* File Name :"8535def.inc" +;* Title :Register/Bit Definitions for the AT90S8535 +;* Date :98.05.22 +;* Version :1.22 +;* Support telephone :+47 72 88 43 88 (ATMEL Norway) +;* Support fax :+47 72 88 43 99 (ATMEL Norway) +;* Support E-mail :avr@atmel.com +;* Target MCU :AT90S8535 +;* +;* DESCRIPTION +;* When including this file in the assembly program file, all I/O register +;* names and I/O register bit names appearing in the data book can be used. +;* In addition, the six registers forming the three data pointers X, Y and +;* Z have been assigned names XL - ZH. Highest RAM address for Internal +;* SRAM is also defined +;* +;* The Register names are represented by their hexadecimal address. +;* +;* The Register Bit names are represented by their bit number (0-7). +;* +;* Please observe the difference in using the bit names with instructions +;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" +;* (skip if bit in register set/cleared). The following example illustrates +;* this: +;* +;* in r16,PORTB ;read PORTB latch +;* sbr r16,(1< +#include +#include +#include "avrasm.hh" +#include "symbol.hh" +#include "semantic.hh" +#include "utils.hh" +#include "devices.hh" + +/// Globals ////////////////////////////////////////////////////////////////// + +GLOBALS(;); + +/// Externals //////////////////////////////////////////////////////////////// + +extern int yyparse(void); +extern FILE *yyin; +extern char messages[MESSAGE_COUNT][MESSAGES_LEN]; + +/// Functions //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Main + // + +int main(int argc, char **args) +{ + int parseresult; + int c; + int unusedcode = 0; + int unusederom = 0; + + /// Process arguments ////////////////////////////////////////////////////// + + yyIncPathCount = 0; + + if(!getargs(argc, args)) + return 0; + + /// Print header /////////////////////////////////////////////////////////// + + if(yycfg -> info) + printf(INFOSTR); + + /// Open input file //////////////////////////////////////////////////////// + + if(! (yyin= fopen(yyfilename,"r")) ) + errorexit(X_UNABLE_TO_OPEN_FILE, yyfilename); + if(! (yyin2= fopen(yyfilename,"r")) ) + errorexit(X_UNABLE_TO_OPEN_FILE, yyfilename); + + if(yylogfilename[0]) + { + if(! (yylogfile = fopen(yylogfilename,"w")) ) + errorexit(X_UNABLE_TO_OPEN_LOGFILE, yylogfilename); + } + else + yylogfile = NULL; + + /// Setup global symbols /////////////////////////////////////////////////// + + INITEXTERN; + yyparseno = 0; + yyfilecount = 1; + + if( !(yyfilelist[0] = new char[MAX_FILENAME_LENGTH]) ) + errorexit(X_OUT_OF_MEMORY); + + strcpy(yyfilelist[0], yyfilename); + + /// Allocate buffers /////////////////////////////////////////////////////// + + if( !(symtab = new symbolTable) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yycodebuf = new unsigned char[MAX_CODE_SIZE]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yyerombuf = new unsigned char[MAX_EROM_SIZE]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yycodeusage = new unsigned char[MAX_CODE_SIZE]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yyeromusage = new unsigned char[MAX_EROM_SIZE]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yycodeline = new unsigned short[MAX_CODE_SIZE]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yylinetxt = new char[MAX_LINE_LENGTH+1]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yyinline = new char[MAX_LINE_LENGTH+1]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yyinlinenew = new char[MAX_LINE_LENGTH+1]) ) + errorexit(X_OUT_OF_MEMORY); + if( !(yyinlineold = new char[MAX_LINE_LENGTH+1]) ) + errorexit(X_OUT_OF_MEMORY); + + for(c=0; cfilename, yyfilename); + + /// Setup device info ////////////////////////////////////////////////////// + + for(c=0; c init(yycfg->casesensitive); + yysymbolstack[0] = symtab; + + /// Start assembler //////////////////////////////////////////////////////// + + if(yylogfile) + { + fputs(INFOSTR, yylogfile); + fputs("\n+------------------+--------------------", yylogfile); + fputs("---------------------------------------+\n", yylogfile); + fputs("| Value | Text ", yylogfile); + fputs(" |\n", yylogfile); + fputs("|------------------|--------------------", yylogfile); + fputs("---------------------------------------|\n", yylogfile); + } + + parseresult = yyparse(); + + yycodepos = (yycodepos>yycodeposhigh) ? yycodepos : yycodeposhigh; + yydatapos = (yydatapos>yydataposhigh) ? yydatapos : yydataposhigh; + yyerompos = (yyerompos>yyeromposhigh) ? yyerompos : yyeromposhigh; + + for(c=0;cinfo) + { + printf("\n"); + message(M_ERRORS , yyerrorcount); + message(M_WARNINGS , yywarningcount); + message(M_CODE , yycodepos/2); + message(M_ROM , yyerompos); + message(M_DATA , yydatapos-DEVINF.datastart); + message(M_UNUSED_CODE , unusedcode); + message(M_UNUSED_ROM , unusederom); + } + + /// Save results /////////////////////////////////////////////////////////// + + if(!yyerrorcount) + { + if(yycfg -> intel) + saveIHF(); + else if(yycfg -> motorola) + saveMotorola(); + else if(yycfg -> obj) + saveObj(); + else if(yycfg -> bin) + saveBin(); + else + saveGeneric(); + } + + exit(yyerrorcount); + +} + + //////////////////////////////////////////////////////////////////////////// + // + // Get commandline arguments. + // + //////////////////////////////////////////////////////////////////////////// + // + // -o = output file + // -r = rom file + // -e = list file + // -v = verbose + // -w = no warnings + // -c = case sensitive labels/defines + // -l = limit log width to 80 characters + // -x = allow local labels + // -a = do not align .db in CSEG + // -m = output Motorola S-record format + // -i = output Intel HEX format + // -j = output ATMEL .obj format + // -g = output ATMEL generic format + // + +int getargs(int argc, char **args) +{ + int c; + int ok = TRUE; + + if(argc==1) + { + printf(INFOSTR); + printf("\n"); + printf(HELPSTR); + return FALSE; + } + + // List devices //////////////////////////////////////////////////////////// + + else if( (argc==2) && !strcmp(args[1],"-d")) { + + int devno = 0; + printf("+---------------------------------------------------" + "-----------------+\n"); + message(M_DEVICE_HEADER); + printf("|------------------+-----------+------------+-------" + "---+-------------|\n"); + while(devices[devno].name[0]) { + printf("| %-16s | %8d | %10d | %8d | %11d |\n", devices[devno].name, + devices[devno].datastart, + devices[devno].flashsize, + devices[devno].ramsize, + devices[devno].eepromsize); + devno++; + } + printf("+---------------------------------------------------" + "-----------------+\n"); + return FALSE; /* Nick false; */ + } + + /// Allocate filename strings ////////////////////////////////////////////// + + if(!(yyfilename = new char[MAX_FILENAME_LENGTH+1])) + errorexit(X_OUT_OF_MEMORY); + if(!(yyromfilename = new char[MAX_FILENAME_LENGTH+1])) + errorexit(X_OUT_OF_MEMORY); + if(!(yylogfilename = new char[MAX_FILENAME_LENGTH+1])) + errorexit(X_OUT_OF_MEMORY); + if(!(yyoutfilename = new char[MAX_FILENAME_LENGTH+1])) + errorexit(X_OUT_OF_MEMORY); + + yyfilename[0]=yyromfilename[0]=yylogfilename[0]=yyoutfilename[0] = '\0'; + + /// Setup default configuration //////////////////////////////////////////// + + if( !(yycfg = new configuration) ) + errorexit(X_OUT_OF_MEMORY); + + memset(yycfg, 0, sizeof(configuration)); + + yycfg -> info = FALSE; // -v + yycfg -> warnings = TRUE; // -w + yycfg -> casesensitive = FALSE; // -c + yycfg -> cutlog = FALSE; // -l + yycfg -> aligndb = TRUE; // no command line option anymore + yycfg -> motorola = FALSE; // -m + yycfg -> intel = FALSE; // -i + yycfg -> hex = FALSE; // -g + yycfg -> obj = FALSE; // -j + yycfg -> bin = FALSE; // -b + yycfg -> wrap = FALSE; // -a + yycfg -> local_labels = FALSE; // -x + yycfg -> forwardorg = FALSE; // -f + yycfg -> addressext = TRUE; // -h + + /// Get command line options /////////////////////////////////////////////// + + for(c=1;cMAX_FILENAME_LENGTH) + message(M_INPUT_FILENAME_TOO_LONG); + else if(!checkfilename(args[c])) + message(M_ILLEGAL_INPUT_FILENAME); + else if(yyfilename[0]) + message(M_MULTIPLE_INPUT); + else + { + ok = TRUE; + strcpy(yyfilename, args[c]); + } + } + else + { + if(strlen(args[c])>2) + { + message(M_UNKNOWN_OPTION ,args[c]); + ok = FALSE; + } + else + { + switch(args[c][1]) + { + + /// Include path //////////////////////////////////////////////////// + // + case 'I' : + { + ok = FALSE; + if (c == argc-1) + message (M_NO_INCLUDEPATH); + + else if(strlen(args[c+1]) > MAX_INCPATH_LENGTH) + message(M_INCPATH_TOO_LONG); + + else if (MAX_INCPATH_QTY == yyIncPathCount) + message(M_TOO_MANY_INCPATHS); + + else + { + yyIncludePaths[yyIncPathCount++] = args[++c]; + ok = TRUE; + } + } break; + + + /// output file //////////////////////////////////////////////////// + + case 'o' : + { + ok = FALSE; + + if(c==argc-1) + message(M_NO_OUTPUT_FILENAME); + else if(strlen(args[c+1])>MAX_FILENAME_LENGTH) + message(M_OUTPUT_FILENAME_TOO_LONG); + else if(!checkfilename(args[c+1])) + message(M_ILLEGAL_OUTPUT_FILENAME); + else if(yyoutfilename[0]) + message(M_MULTIPLE_OUTPUT); + else + { + strcpy(yyoutfilename, args[c+1]); + c++; + ok = TRUE; + } + } break; + + /// rom file /////////////////////////////////////////////////////// + + case 'e' : + { + ok = FALSE; + + if(c==argc-1) + message(M_NO_LIST_FILENAME); + else if(strlen(args[c+1])>MAX_FILENAME_LENGTH) + message(M_LIST_FILENAME_TOO_LONG); + else if(!checkfilename(args[c+1])) + message(M_ILLEGAL_LIST_FILENAME); + else + { + strcpy(yylogfilename, args[c+1]); + c++; + ok = TRUE; + } + } break; + + /// list file ////////////////////////////////////////////////////// + + case 'r' : + { + ok = FALSE; + + if(c==argc-1) + message(M_NO_ROM_FILENAME); + else if(strlen(args[c+1])>MAX_FILENAME_LENGTH) + message(M_ROM_FILENAME_TOO_LONG); + else if(!checkfilename(args[c+1])) + message(M_ILLEGAL_ROM_FILENAME); + else + { + strcpy(yyromfilename, args[c+1]); + c++; + ok = TRUE; + } + } break; + + /// verbose //////////////////////////////////////////////////////// + + case 'v' : yycfg -> info = TRUE; break; + + /// no warnings //////////////////////////////////////////////////// + + case 'w' : yycfg -> warnings = FALSE; break; + + /// case sensitive labels/defines ////////////////////////////////// + + case 'c' : yycfg -> casesensitive = TRUE; break; + + /// limit log width to 80 characters /////////////////////////////// + + case 'l' : yycfg -> cutlog = TRUE; break; + + /// Wrap relative jumps/branches /////////////////////////////////// + + case 'a' : yycfg -> wrap = TRUE; break; + + /// allow local labels ///////////////////////////////////////////// + + case 'x' : yycfg -> local_labels = TRUE; break; + + /// do not align .db in CSEG /////////////////////////////////////// + + // case 'a' : yycfg -> aligndb = FALSE; break; + + /// output Motorola S-record format //////////////////////////////// + + case 'm' : + { + if(yycfg->intel || yycfg->obj || yycfg->bin || yycfg->hex ) + { + message(M_MORE_MIJBH); + ok = FALSE; + } + else + yycfg -> motorola = TRUE; + } + break; + + /// output Intel HEX format //////////////////////////////////////// + + case 'i' : + { + if(yycfg->motorola || yycfg->obj || yycfg->bin || yycfg->hex) + { + message(M_MORE_MIJBH); + ok = FALSE; + } + else + yycfg -> intel = TRUE; + + + } + break; + + /// output .obj format ///////////////////////////////////////////// + + case 'j' : + { + if(yycfg->motorola || yycfg->intel || yycfg->bin || yycfg->hex) + { + message(M_MORE_MIJBH); + ok = FALSE; + } + else + yycfg -> obj = TRUE; + } + break; + + /// output .bin format ///////////////////////////////////////////// + + case 'b' : + { + if(yycfg->motorola || yycfg->intel || yycfg->obj || yycfg->hex) + { + message(M_MORE_MIJBH); + ok = FALSE; + } + else + yycfg -> bin = TRUE; + } + break; + + /// Supress .org warnings ////////////////////////////////////////// + + case 'f' : + { + yycfg -> forwardorg = TRUE; + } + break; + + /// output .obj format ///////////////////////////////////////////// + + case 'g' : + { + if(yycfg->motorola || yycfg->intel || yycfg->obj || yycfg->bin) + { + message(M_MORE_MIJBH); + ok = FALSE; + } + else + yycfg -> hex = TRUE; + } + break; + + /// No address entension record in Intel HEX output //////////////// + + case 'h' : yycfg -> addressext = FALSE; break; + + /// ignore -d flag ///////////////////////////////////////////////// + + case 'd' : break; + + /// Unknown option ///////////////////////////////////////////////// + + default : message(M_UNKNOWN_OPTION , args[c]); ok=FALSE; + } + } + } + } + + if(!yyfilename[0]) + { + ok = FALSE; /* Nick false; */ + message(M_NO_INPUT_FILENAME); + } + + if(!yycfg->motorola&&!yycfg->hex&&!yycfg->intel&&!yycfg->bin&&!yycfg->obj) + yycfg->intel = TRUE; + + if(!yyoutfilename[0]) + { + char *type_start; + + strcpy(yyoutfilename, yyfilename); + type_start = strrchr(yyoutfilename, '.'); + if (type_start == NULL) + type_start = yyoutfilename + strlen(yyoutfilename); + + if (yycfg->intel) + strcpy(type_start, ".hex"); + else if (yycfg->motorola) + strcpy(type_start, ".s"); + else if (yycfg->bin) + strcpy(type_start, ".bin"); + else if (yycfg->obj) + strcpy(type_start, ".obj"); + else if (yycfg->hex) + strcpy(type_start, ".gen"); + else + strcpy(type_start,"."); + } + + return ok; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Save Intel Hex Format (IHF) + // + //////////////////////////////////////////////////////////////////////////// + // + // :LLAAAATTDD.......DDSS + // ^^ ^ ^ ^ ^ + // 12 4 8 10 end-2 (field positions) + // + // FIELD 1 (COLUMN 1) + // + // a : symbol, each record uses a colon as a start delimiter. + // + // FIELD 2 (COLUMN 2) + // + // length byte, a two digit ASCII hex representation of the number + // of data bytes to be transmitted in this record. + // + // FIELD 3 (COLUMN 4) + // + // address word, a four digit ASCII hex representation of the target + // load address of the first byte of the following packet. This field + // is always 4 digits long, hence addresses are limited to 16 bits. See + // note later for more information. + // + // FIELD 4 (COLUMN 8) + // + // record type, a two digit ASCII hex representation of an integer which + // in turn denotes the record type. + // There are three record types 0,1 and 2 + // + // Record Type 0 - Normal Data packet + // Record Type 1 - End of file record. The last record in the file has + // a type of 1. + // Record Type 2 - Address Extension Record. A special record type used + // to extend addresses beyond 16 bits. + // + // FIELD 5 (COLUMN 10) + // + // start of data bytes. Data bytes in two digit ASCII form. Variable + // length field, usually a small power of 2 e.g. 16. + // + // + // FIELD 6 (LAST 2 COLUMNS) + // + // checksum. A two digit ascii representation of a special checksum for + // the record. The checksum is the 2's complement of the true sum of all + // the bytes in the record, starting with the record length and ending + // with the last data byte. This allows limited error detection facilites + // for the data packet. + // + // Sample file : + // + // :020000020000FC + // :0600220018950895F89402 + // :1000440000000000000000000000000000000000AC + // :0E00540000000000000000000000000000F7A7 + // :00000001FF + // + +int saveIHF(void) +{ + int c, i; + FILE *out; + int count; + int line[16]; + int sum; + int last; + + /// Save code output file ////////////////////////////////////////////////// + + if(!yyoutfilename[0]) + return TRUE; + + if(! (out= fopen(yyoutfilename,"w")) ) + errorexit(X_UNABLE_TO_OPEN_OUTFILE, yyoutfilename); + + /// Address extension record, offset 0x0000 //////////////////////////////// + + if(yycfg -> addressext) + fprintf(out, ":020000020000FC\n"); + + /// Save data ////////////////////////////////////////////////////////////// + + if(!yycodepos) + message(M_EMPTY_CODE); + + c = 0; + + while(c>8); +#else + sum = count + (c&0x00FFL) + ((c&0xFF00L)>>8); +#endif + + fprintf(out, ":%02X%04X00",count,c); + + for(i=0;i addressext) + fprintf(out, ":020000020000FC\n"); + + /// Save data ////////////////////////////////////////////////////////////// + + c = 0; + + while(c>8); +#else + sum = count + (c&0x00FFL) + ((c&0xFF00L)>>8); +#endif + + fprintf(out, ":%02X%04X00",count,c); + + for(i=0;i>24, out); + fputc( (offset & 0x00FF0000)>>16, out); + fputc( (offset & 0x0000FF00)>> 8, out); + fputc( (offset & 0x000000FF)>> 0, out); + + fputc( ( 0x1A & 0xFF000000)>>24, out); + fputc( ( 0x1A & 0x00FF0000)>>16, out); + fputc( ( 0x1A & 0x0000FF00)>> 8, out); + fputc( ( 0x1A & 0x000000FF)>> 0, out); +#else + fputc( (offset & 0xFF000000L)>>24, out); + fputc( (offset & 0x00FF0000L)>>16, out); + fputc( (offset & 0x0000FF00L)>> 8, out); + fputc( (offset & 0x000000FFL)>> 0, out); + + fputc( ( 0x1A & 0xFF000000L)>>24, out); + fputc( ( 0x1A & 0x00FF0000L)>>16, out); + fputc( ( 0x1A & 0x0000FF00L)>> 8, out); + fputc( ( 0x1A & 0x000000FFL)>> 0, out); +#endif + + fputc( 0x09, out); + fputc( yyfilecount, out); + fputs( "AVR Object File", out); + fputc(0, out); + + for(c=0;c>16, out); + fputc( (c/2 & 0x0000FF00)>> 8, out); + fputc( (c/2 & 0x000000FF)>> 0, out); + fputc( (yycodebuf[c+1] & 0x00FF) >> 0, out); + fputc( (yycodebuf[c] & 0x00FF) >> 0, out); + fputc( (yycodeusage[c]-1 & 0x007F) >> 0, out); + fputc( (yycodeline[c] & 0xFF00) >> 8, out); + fputc( (yycodeline[c] & 0x00FF) >> 0, out); + fputc( (yycodeusage[c] & 0x0080) != 0, out); +#else + fputc( (c/2 & 0x00FF0000L)>>16, out); + fputc( (c/2 & 0x0000FF00L)>> 8, out); + fputc( (c/2 & 0x000000FFL)>> 0, out); + fputc( (yycodebuf[c+1] & 0x00FFL) >> 0, out); + fputc( (yycodebuf[c] & 0x00FFL) >> 0, out); + fputc( (yycodeusage[c]-1 & 0x007FL) >> 0, out); + fputc( (yycodeline[c] & 0xFF00L) >> 8, out); + fputc( (yycodeline[c] & 0x00FFL) >> 0, out); + fputc( (yycodeusage[c] & 0x0080L) != 0, out); +#endif + } + } + + for(c=0;c>8) + 3; +#else + sum = count + (c&0x00FFL) + ((c&0xFF00L)>>8) + 3; +#endif + + fprintf(out, "S1%02X%04X",count+3,c); + + for(i=0;i>8) + 3; +#else + sum = count + (c&0x00FFL) + ((c&0xFF00L)>>8) + 3; +#endif + + fprintf(out, "S1%02X%04X",count+3,c); + + for(i=0;i increased MAX_DEVICES from 13 to 23 +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _AVRASM_HH_ +#define _AVRASM_HH_ + +#ifndef _MSC_VER /* Nick */ +typedef int bool; +#endif + +/// Defines ////////////////////////////////////////////////////////////////// + +#define FALSE 0 // No +#define TRUE (!0) // Yes + +#ifdef _MSC_VER /* Nick original definition: */ +#define MAX_CODE_SIZE 0x100000 // Code size in bytes +#define MAX_EROM_SIZE 0x10000 // Erom size in bytes +#define MAX_LINE_LENGTH (255+3) // Maximum length of input lines +#define MAX_ID_LENGTH 64 // name defined as MAX_ID_LEN+1 +#define MAX_DEVICE_NAME_LENGTH 16 // Like "90S1200" +#define MAX_DEVICES 23 // Update with "devices.hh" +#define MAX_FILENAME_LENGTH 512 // Should be changed to platform +#else /* Nick reduced for 16-bit version: */ +#define MAX_CODE_SIZE 0x4000 // Code size in bytes +#define MAX_EROM_SIZE 0x400 // Erom size in bytes +#define MAX_LINE_LENGTH (255+3) // Maximum length of input lines +#define MAX_ID_LENGTH 32 // name defined as MAX_ID_LEN+1 +#define MAX_DEVICE_NAME_LENGTH 16 // Like "90S1200" +#define MAX_DEVICES 23 // Update with "devices.hh" +#define MAX_FILENAME_LENGTH 16 // Should be changed to platform +#endif +#define MAX_INCPATH_LENGTH 512 // Should be changed to platform +#define MAX_CONTEXT_DEPTH 32 // Depth of macros/include files +#define MAX_FILES 127 // Files/includes (don't change) +#define MAX_INCPATH_QTY 8 // Max number of include search dirs + +#define VERSIONSTR "1.18" // Version + +#define SEGMENT_CODE 1 // CSEG +#define SEGMENT_DATA 2 // DSEG +#define SEGMENT_EEPROM 3 // ESEG +#define SEGMENT_DEFINE_BYTE 1 // '.byte' in ESEG + +#define LIST_NO 1 // .nolist +#define LIST_NO_MACRO 2 // .nolistmac +#define LIST_YES_MACRO 3 // .listmac +#define LIST_YES 4 // .list + + /// Command line info ////////////////////////////////////////////////////// + +#define INFOSTR "Toms AVR macro assembler version "VERSIONSTR" ("__DATE__ \ + ")\nCopyright (C) 2000 - Tom Mortensen\n" \ + "E-mail: tom@tavrasm.org WWW: http://www.tavrasm.org\n" + +/// Supported instructions /////////////////////////////////////////////////// + +#define S_ADIW (1<< 0) +#define S_ICALL (1<< 1) +#define S_CALL (1<< 2) +#define S_IJMP (1<< 3) +#define S_JMP (1<< 4) +#define S_LD (1<< 5) +#define S_LDD (1<< 6) +#define S_LDS (1<< 7) +#define S_LPM (1<< 8) +#define S_MUL (1<< 9) +#define S_PUSH (1<<10) +#define S_POP (1<<11) +#define S_SBIW (1<<12) +#define S_ST (1<<13) +#define S_STD (1<<14) +#define S_STS (1<<15) +#define S_EIJMP (1<<16) +#define S_EICALL (1<<17) +#define S_ESPM (1<<18) +#define S_MULSU (1<<19) +#define S_FMUL (1<<20) +#define S_FMULS (1<<21) +#define S_FMULSU (1<<22) +#define S_MULS (1<<23) +#define S_MOVW (1<<24) +#define S_ELPM (1<<25) +#define S_SPM (1<<26) + +#define S_EXTENDED (0xFFFF0000) + +/// Macros /////////////////////////////////////////////////////////////////// + +#define STRIPNR(s) {char* pos;if((pos=strpbrk(s,"\r\n"))&&(*pos='\0'));} +#define STRIPWS(s) {char* pos;if((pos=strpbrk(s,"\v\t \r\n")))*pos='\0';} +#define DEVINF yydevices[yydeviceno] +#define ISUSED(s) (s->macro||s->isvar||s->valid||s->isdefine) +#define MSG(m) messages[MESSAGE_OFFSET_MESSAGES+m] +#define CONTEXT yycontextstack[yycontext] +#define ISMACRO (yycontextstack[yycontext]->ismacro) +#define CHECKREG(r,d) { if(r<0) r = d; else if(r>31) internalerror("REG"); } + +/// Globals ////////////////////////////////////////////////////////////////// + +#define GLOBALS(asextern) \ +asextern int yyline; \ +asextern int yyoffset; \ +asextern int yyeromoffset; \ +asextern int yydataoffset; \ +asextern int yycodepos; \ +asextern int yyerompos; \ +asextern int yydatapos; \ +asextern int yycodeposhigh; \ +asextern int yyeromposhigh; \ +asextern int yydataposhigh; \ +asextern int yyparseno; \ +asextern int yyerrorcount; \ +asextern int yyerrorline; \ +asextern int yywarningline; \ +asextern int yywarningcount; \ +asextern int yysegment; \ +asextern int yydefinestart; \ +asextern int yyinmacro; \ +asextern int yycontext; \ +asextern int yydeviceno; \ +asextern int yydefinetype; \ +asextern int yylist; \ +asextern int yylistmacro; \ +asextern int yyfirstmacroline; \ +asextern int yyinmacrodef; \ +asextern int yyfileno; \ +asextern int yyfilecount; \ +asextern int yyeol; \ +asextern int yyIncPathCount; \ +asextern char *yylinetxt; \ +asextern char *yyinline; \ +asextern char *yyinlinenew; \ +asextern char *yyinlineold; \ +asextern char *yyfilename; \ +asextern char *yyromfilename; \ +asextern char *yylogfilename; \ +asextern char *yyoutfilename; \ +asextern char *yyfilelist[MAX_FILES]; \ +asextern char *yyIncludePaths[MAX_INCPATH_QTY]; \ +asextern unsigned char *yycodebuf; \ +asextern unsigned char *yyerombuf; \ +asextern unsigned char *yycodeusage; \ +asextern unsigned char *yyeromusage; \ +asextern unsigned short *yycodeline; \ +asextern configuration *yycfg; \ +asextern symbolTable* symtab; \ +asextern context *yycontextstack[MAX_CONTEXT_DEPTH]; \ +asextern symbolTable *yysymbolstack[MAX_CONTEXT_DEPTH]; \ +asextern deviceinfo yydevices[MAX_DEVICES]; \ +asextern FILE* yyin2; \ +asextern FILE* yylogfile; \ +asextern char yylast_used_label[MAX_ID_LENGTH+1]; + +/// Init Globals ///////////////////////////////////////////////////////////// + +#define INITEXTERN \ +{ \ + yyline = 1; \ + yyoffset = 0; \ + yyeromoffset = 0; \ + yydataoffset = 0; \ + yycodepos = 0; \ + yyerompos = 0; \ + yydatapos = 96; \ + yycodeposhigh = 0; \ + yyeromposhigh = 0; \ + yydataposhigh = 0; \ + yyerrorcount = 0; \ + yywarningcount = 0; \ + yydefinestart = -1; \ + yysegment = SEGMENT_CODE; \ + yyinmacro = FALSE; \ + yycontext = 0; \ + yyerrorline =-1; \ + yywarningline = -1; \ + yydeviceno = 0; \ + yydefinetype = 0; \ + yylist = TRUE; \ + yylistmacro = FALSE; \ + yyfirstmacroline = FALSE; \ + yyinmacrodef = FALSE; \ + yyfileno = 1; \ + yyeol = FALSE; \ + yylast_used_label[0] = '\0'; \ +} + +/// Configuration //////////////////////////////////////////////////////////// + +struct configuration +{ + char aligndb; // Allow byte alignment + char casesensitive; // Case sensitive labels/vars + char cutlog; // Limit logfile width to 80 chars + char info; // Show info after compilation + char warnings; // Print warnings + char local_labels; // Allow local loabels + char motorola; // Output Motorola S-record format + char intel; // Output Intel HEX format + char obj; // Output ATMEL .obj format + bool hex; // Output generic hex + char bin; // Output binary format + bool wrap; // Wrap in relative jumps/branches + bool forwardorg; // Allow .org to jump around + bool addressext; // Include address extension record +}; + +/// Device info ////////////////////////////////////////////////////////////// + +struct deviceinfo { + char name[MAX_DEVICE_NAME_LENGTH+1]; // Device name + int datastart; // Registers + I/O ports + int ramsize; // Size of ram + int eepromsize; // Size of EEPROM + int flashsize; // Size of flash (in words) + int supported; // Unsupported instructions +}; + +/// Types //////////////////////////////////////////////////////////////////// + +struct context +{ + // Regular file + + char filename[MAX_FILENAME_LENGTH]; + int line; + FILE *file; + FILE *file2; + + // Macro + + int ismacro; + char *macstr; + int offset; + int eromoffset; + int dataoffset; + int stringpos; + + // Line buffers + + char yyinline[MAX_LINE_LENGTH+1]; + char yyinlinenew[MAX_LINE_LENGTH+1]; + char yyinlineold[MAX_LINE_LENGTH+1]; +}; + +/// Prototypes /////////////////////////////////////////////////////////////// + +void yyerror(char *s); +int getargs(int argc, char **args); +int saveIHF(void); +int saveGeneric(void); +int saveObj(void); +int saveMotorola(void); +int saveBin(void); + +#endif /* _AVRASM_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/avrlex.cc b/src/mkutil/tavrasm.118/src/avrlex.cc new file mode 100644 index 00000000..b4f3abc9 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrlex.cc @@ -0,0 +1,3202 @@ +/* #line 2 "avrlex.cc" */ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#ifdef _MSC_VER /* Nick */ +#include +/* #else */ +/* #include */ +#endif + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +/* Nick static */ void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +/* Nick static */ void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 198 +#define YY_END_OF_BUFFER 199 +static yyconst short /* Nick short int */ yy_accept[397] = + { 0, + 0, 0, 199, 197, 193, 192, 26, 197, 196, 197, + 3, 15, 197, 17, 18, 1, 22, 20, 23, 21, + 2, 180, 180, 19, 194, 8, 24, 9, 16, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 162, 163, + 164, 14, 25, 193, 197, 21, 193, 11, 0, 178, + 0, 196, 183, 13, 0, 0, 0, 0, 0, 0, + 0, 0, 195, 180, 184, 184, 0, 194, 4, 6, + 10, 7, 5, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 51, 168, 191, 169, + + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 155, 191, 158, 191, 191, 191, 191, 191, 191, 191, + 191, 59, 191, 191, 167, 191, 191, 179, 191, 191, + 191, 191, 191, 191, 191, 191, 159, 191, 191, 191, + 191, 12, 193, 0, 0, 0, 0, 0, 0, 0, + 178, 190, 0, 190, 0, 0, 0, 0, 30, 0, + 0, 31, 0, 29, 0, 0, 0, 195, 182, 181, + 55, 54, 191, 57, 99, 191, 152, 191, 191, 191, + 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, + 191, 153, 191, 191, 143, 154, 116, 121, 123, 118, + + 104, 120, 122, 119, 117, 106, 50, 70, 191, 101, + 191, 191, 191, 58, 191, 191, 191, 191, 191, 191, + 191, 98, 139, 160, 75, 76, 191, 39, 165, 151, + 100, 191, 60, 62, 96, 124, 73, 147, 191, 102, + 191, 191, 128, 191, 149, 107, 52, 144, 77, 108, + 113, 115, 110, 150, 112, 114, 111, 109, 191, 133, + 161, 148, 53, 191, 105, 130, 0, 0, 0, 0, + 0, 0, 189, 187, 0, 0, 0, 0, 27, 0, + 0, 0, 28, 0, 32, 34, 68, 74, 135, 141, + 142, 78, 79, 81, 86, 88, 89, 92, 93, 95, + + 87, 83, 80, 82, 94, 90, 91, 84, 85, 136, + 191, 140, 56, 191, 191, 166, 134, 48, 65, 40, + 46, 191, 126, 49, 45, 61, 63, 47, 103, 191, + 127, 138, 71, 145, 146, 69, 156, 157, 191, 72, + 97, 0, 0, 0, 0, 0, 187, 0, 185, 0, + 33, 36, 0, 37, 177, 38, 41, 42, 43, 44, + 191, 131, 66, 125, 64, 137, 129, 174, 0, 173, + 0, 0, 0, 0, 0, 132, 67, 0, 0, 176, + 0, 188, 0, 186, 0, 35, 0, 0, 171, 175, + 172, 0, 175, 0, 170, 0 + + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 4, 1, 5, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 27, 27, 28, 28, 29, 30, 31, + 32, 33, 1, 1, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 36, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 1, 34, 1, 35, 36, 1, 37, 38, 39, 40, + + 41, 42, 43, 44, 45, 46, 36, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 1, 62, 1, 63, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[64] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 1, 1, 1, 5, 4, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 1, 1 + } ; + +static yyconst short /* Nick short int */ yy_base[412] = + { 0, + 0, 62, 536, 537, 65, 537, 503, 57, 0, 0, + 537, 522, 499, 537, 537, 537, 537, 537, 537, 34, + 511, 70, 31, 537, 0, 45, 499, 46, 537, 0, + 64, 67, 85, 42, 92, 482, 41, 94, 481, 94, + 69, 39, 47, 91, 131, 124, 474, 487, 0, 0, + 0, 464, 537, 181, 172, 164, 158, 537, 116, 537, + 159, 0, 0, 537, 512, 197, 464, 469, 187, 142, + 469, 480, 0, 67, 0, 79, 0, 0, 537, 537, + 537, 537, 537, 0, 150, 480, 466, 471, 477, 219, + 143, 461, 468, 116, 193, 466, 161, 0, 474, 0, + + 127, 461, 458, 459, 458, 452, 464, 453, 468, 456, + 464, 451, 186, 186, 453, 180, 447, 442, 451, 454, + 445, 450, 439, 450, 0, 441, 437, 236, 453, 434, + 440, 183, 216, 239, 446, 438, 195, 447, 447, 428, + 429, 537, 285, 293, 261, 262, 432, 435, 442, 428, + 200, 537, 464, 463, 302, 462, 419, 432, 537, 223, + 431, 537, 431, 414, 428, 425, 412, 0, 93, 0, + 0, 0, 408, 420, 0, 411, 0, 264, 265, 411, + 421, 268, 176, 262, 416, 419, 412, 414, 281, 284, + 402, 0, 415, 408, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 413, 0, + 416, 404, 403, 0, 402, 425, 401, 403, 406, 398, + 393, 0, 0, 0, 0, 0, 419, 0, 0, 0, + 0, 402, 383, 383, 0, 0, 0, 0, 383, 0, + 375, 365, 362, 351, 0, 0, 352, 291, 292, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 348, 0, + 0, 0, 343, 336, 0, 0, 327, 340, 345, 329, + 343, 321, 537, 537, 328, 354, 324, 321, 537, 318, + 319, 313, 537, 305, 537, 537, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 333, 0, 0, 300, 293, 0, 0, 0, 289, 0, + 0, 295, 0, 0, 0, 0, 284, 0, 0, 292, + 0, 0, 0, 0, 0, 0, 0, 0, 286, 0, + 0, 281, 287, 278, 279, 256, 537, 347, 537, 285, + 537, 537, 246, 537, 537, 537, 0, 0, 0, 0, + 234, 0, 223, 0, 0, 0, 0, 537, 216, 223, + 209, 199, 353, 239, 210, 0, 0, 203, 202, 537, + 152, 537, 368, 537, 186, 537, 156, 149, 120, 0, + 537, 112, 0, 99, 537, 537, 395, 400, 113, 405, + + 410, 412, 417, 422, 83, 81, 425, 427, 429, 431, + 435 + } ; + +static yyconst short /* Nick short int */ yy_def[412] = + { 0, + 396, 1, 396, 396, 396, 396, 396, 397, 398, 399, + 396, 396, 400, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 22, 396, 401, 396, 396, 396, 396, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 396, 396, 396, 396, 396, 396, 396, 397, 396, + 397, 398, 399, 396, 396, 403, 396, 396, 396, 396, + 396, 396, 404, 22, 405, 405, 406, 401, 396, 396, + 396, 396, 396, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 45, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 397, 396, 396, 396, 396, 407, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 404, 405, 406, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 408, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, + 402, 396, 396, 396, 396, 396, 396, 396, 396, 409, + 396, 396, 396, 396, 396, 396, 402, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 396, 396, 396, + 396, 396, 396, 410, 396, 402, 402, 396, 396, 396, + 396, 396, 396, 396, 410, 396, 396, 396, 396, 411, + 396, 396, 411, 396, 396, 0, 396, 396, 396, 396, + + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396 + } ; + +static yyconst short /* Nick short int */ yy_nxt[601] = + { 0, + 4, 5, 6, 4, 5, 5, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 23, 23, 23, 23, 23, 24, 25, + 26, 27, 28, 4, 29, 30, 31, 32, 33, 34, + 35, 36, 30, 37, 38, 39, 40, 41, 42, 43, + 44, 30, 45, 46, 47, 30, 30, 48, 49, 50, + 51, 52, 53, 54, 60, 55, 57, 54, 75, 57, + 57, 67, 68, 69, 70, 79, 80, 82, 83, 120, + 98, 56, 99, 71, 170, 107, 75, 72, 121, 396, + 61, 74, 74, 74, 74, 74, 74, 74, 108, 122, + + 169, 169, 123, 85, 75, 88, 75, 76, 75, 75, + 75, 75, 86, 89, 169, 169, 63, 87, 118, 90, + 91, 93, 94, 60, 119, 396, 92, 124, 77, 125, + 100, 95, 109, 113, 96, 97, 101, 395, 102, 110, + 126, 103, 111, 114, 115, 104, 127, 116, 394, 61, + 105, 117, 128, 128, 128, 128, 128, 128, 128, 57, + 195, 133, 57, 57, 134, 211, 151, 392, 196, 129, + 135, 130, 212, 144, 136, 144, 131, 144, 137, 138, + 132, 139, 143, 191, 144, 57, 143, 391, 171, 172, + 163, 145, 61, 164, 173, 165, 390, 192, 384, 207, + + 145, 67, 68, 69, 146, 208, 389, 60, 147, 154, + 148, 149, 150, 71, 209, 298, 299, 72, 155, 155, + 155, 155, 155, 155, 159, 224, 230, 160, 227, 245, + 225, 197, 231, 61, 261, 246, 198, 199, 388, 226, + 161, 200, 387, 228, 162, 201, 202, 203, 262, 204, + 386, 384, 381, 205, 247, 156, 178, 179, 380, 180, + 248, 181, 182, 183, 279, 184, 185, 186, 249, 187, + 379, 378, 188, 189, 84, 190, 84, 250, 377, 280, + 376, 84, 251, 252, 375, 84, 143, 253, 144, 57, + 143, 254, 255, 256, 144, 257, 144, 349, 144, 258, + + 372, 267, 290, 292, 145, 147, 296, 148, 149, 150, + 163, 300, 145, 164, 274, 165, 301, 291, 293, 306, + 268, 297, 308, 275, 275, 275, 275, 275, 275, 334, + 337, 371, 370, 369, 307, 368, 367, 309, 366, 365, + 347, 364, 363, 362, 335, 338, 361, 356, 336, 348, + 348, 348, 348, 348, 348, 357, 358, 359, 360, 347, + 355, 354, 353, 352, 351, 382, 349, 346, 373, 373, + 373, 373, 373, 373, 383, 383, 383, 383, 383, 383, + 382, 345, 344, 343, 342, 268, 341, 340, 339, 383, + 383, 383, 383, 383, 383, 59, 333, 59, 59, 59, + + 62, 332, 62, 62, 62, 65, 331, 65, 65, 65, + 78, 330, 78, 78, 78, 84, 84, 153, 329, 153, + 153, 153, 168, 328, 168, 168, 168, 276, 276, 350, + 350, 374, 374, 385, 385, 393, 327, 393, 393, 393, + 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, + 316, 315, 314, 313, 312, 311, 310, 305, 304, 303, + 302, 295, 294, 289, 288, 287, 286, 285, 284, 283, + 282, 281, 278, 277, 273, 273, 273, 272, 271, 270, + 269, 266, 265, 264, 263, 260, 259, 244, 243, 242, + 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, + + 229, 223, 222, 221, 220, 219, 218, 217, 216, 215, + 214, 213, 210, 206, 194, 193, 177, 176, 175, 174, + 167, 166, 158, 157, 152, 142, 141, 140, 112, 106, + 81, 73, 66, 64, 58, 396, 3, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396 + + } ; + +static yyconst short /* Nick short int */ yy_chk[601] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 8, 2, 5, 2, 23, 5, + 5, 20, 20, 20, 20, 26, 26, 28, 28, 42, + 34, 2, 34, 20, 406, 37, 405, 20, 42, 23, + 8, 22, 22, 22, 22, 22, 22, 22, 37, 43, + + 76, 76, 43, 31, 74, 32, 22, 22, 22, 22, + 22, 22, 31, 32, 169, 169, 399, 31, 41, 32, + 32, 33, 33, 59, 41, 74, 32, 44, 22, 44, + 35, 33, 38, 40, 33, 33, 35, 394, 35, 38, + 44, 35, 38, 40, 40, 35, 44, 40, 392, 59, + 35, 40, 45, 45, 45, 45, 45, 45, 45, 57, + 94, 46, 57, 57, 46, 101, 61, 389, 94, 45, + 46, 45, 101, 55, 46, 55, 45, 55, 46, 46, + 45, 46, 54, 91, 54, 54, 54, 388, 85, 85, + 70, 55, 61, 70, 85, 70, 387, 91, 385, 97, + + 54, 56, 56, 56, 56, 97, 381, 151, 56, 66, + 56, 56, 56, 56, 97, 183, 183, 56, 66, 66, + 66, 66, 66, 66, 69, 113, 116, 69, 114, 132, + 113, 95, 116, 151, 137, 132, 95, 95, 379, 113, + 69, 95, 378, 114, 69, 95, 95, 95, 137, 95, + 375, 374, 372, 95, 133, 66, 90, 90, 371, 90, + 133, 90, 90, 90, 160, 90, 90, 90, 133, 90, + 370, 369, 90, 90, 128, 90, 128, 134, 363, 160, + 361, 128, 134, 134, 353, 128, 143, 134, 143, 143, + 143, 134, 134, 134, 144, 134, 144, 350, 144, 134, + + 346, 145, 178, 179, 143, 145, 182, 145, 145, 145, + 146, 184, 144, 146, 155, 146, 184, 178, 179, 189, + 146, 182, 190, 155, 155, 155, 155, 155, 155, 248, + 249, 345, 344, 343, 189, 342, 339, 190, 330, 327, + 275, 322, 319, 315, 248, 249, 314, 284, 248, 275, + 275, 275, 275, 275, 275, 311, 311, 311, 311, 348, + 282, 281, 280, 278, 277, 373, 276, 272, 348, 348, + 348, 348, 348, 348, 373, 373, 373, 373, 373, 373, + 383, 271, 270, 269, 268, 267, 264, 263, 259, 383, + 383, 383, 383, 383, 383, 397, 247, 397, 397, 397, + + 398, 244, 398, 398, 398, 400, 243, 400, 400, 400, + 401, 242, 401, 401, 401, 402, 402, 403, 241, 403, + 403, 403, 404, 239, 404, 404, 404, 407, 407, 408, + 408, 409, 409, 410, 410, 411, 234, 411, 411, 411, + 233, 232, 227, 221, 220, 219, 218, 217, 216, 215, + 213, 212, 211, 209, 194, 193, 191, 188, 187, 186, + 185, 181, 180, 176, 174, 173, 167, 166, 165, 164, + 163, 161, 158, 157, 156, 154, 153, 150, 149, 148, + 147, 141, 140, 139, 138, 136, 135, 131, 130, 129, + 127, 126, 124, 123, 122, 121, 120, 119, 118, 117, + + 115, 112, 111, 110, 109, 108, 107, 106, 105, 104, + 103, 102, 99, 96, 93, 92, 89, 88, 87, 86, + 72, 71, 68, 67, 65, 52, 48, 47, 39, 36, + 27, 21, 13, 12, 7, 3, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, + 396, 396, 396, 396, 396, 396, 396, 396, 396, 396 + + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +/* #line 1 "avrlex.l" */ +#define INITIAL 0 +/* #line 2 "avrlex.l" */ +////////////////////////////////////////////////////////////////////////////// +// +// File : avrlex.l +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Scanner file for AVR assembler +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 990329 : Tom - Added support for hex values like 1AB without $ or 0x +// 990512 : Tom - Fixed detection on binary numbers. +// 990522 : Tom - Added support for PC/DC/EC. +// 991211 : Tom - Fixed .endm problem (it had to be lower case) +// 991217 : Kurt- Added # and support for local labels +// 001101 : Brian - Added support for multiple include search paths +// 010319 : Timothy Lee - Added byte1 function (sames as low()) +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include "symbol.hh" +#include "semantic.hh" +#include "avrparse.hh" +#include "avrasm.hh" +#include "utils.hh" + +/// Extern /////////////////////////////////////////////////////////////////// + +GLOBALS(extern); + +/// Global /////////////////////////////////////////////////////////////////// + +symbolTableEntry *sym; +YY_BUFFER_STATE statestack[MAX_CONTEXT_DEPTH]; +int restartcount = 0; +int ret; + +/// Defines ////////////////////////////////////////////////////////////////// + +#ifdef _MSC_VER /* Nick */ +#define SKIPRESTART 0x02BABE // Any value that is not a token +#else +#define SKIPRESTART -2 // Any value that is not a token +#endif + +/// Prototypes for support function ////////////////////////////////////////// + +int restart(void); +int endofline(void); +int identifier(void); +int registers(void); +int integers(void); +int macrodef(void); +int includefile(void); +int string(void); +int character(void); +int doexit(void); +int macro(symbolSA symb); +void list(int listtype); +void illegal(void); + +/// Scanner definition /////////////////////////////////////////////////////// + +#define YY_NEVER_INTERACTIVE 1 +/* #line 730 "avrlex.cc" */ + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( /* 1 || */ yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ +/* buf[n] = 0; */ \ +/* printf("%s", buf); */ \ +/* fflush(stdout); */ \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +#ifndef _MSC_VER /* Nick */ +#undef YY_BREAK +#define YY_BREAK return -1; + +int yy_function_nick_0(/*yy_state_type yy_current_state, + char *yy_cp, char *yy_bp,*/ int yy_act) + { + switch (yy_act) + { +#include "avrlex0.inc" + } + return -1; /* should never happen but keeps the compiler happy */ + } + +int yy_function_nick_1(/*yy_state_type yy_current_state, + char *yy_cp, char *yy_bp,*/ int yy_act) + { + switch (yy_act) + { +#include "avrlex1.inc" + } + return -1; /* should never happen but keeps the compiler happy */ + } + +#undef YY_BREAK +#define YY_BREAK break; +#endif + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; +#if 1 /* Nick */ + register int yy_return_code; + void *silly; +#endif + + silly = malloc(0x1000); + if (silly) + { + free(silly); + } + +#ifdef DEBUG /* Nick */ + printf("yylex() @ %08lx\n", silly); + fflush(stdout); +#endif + +/* #line 114 "avrlex.l" */ + + +/* #line 887 "avrlex.cc" */ + + if ( yy_init ) + { +#ifdef DEBUG /* Nick */ + printf("init\n"); + fflush(stdout); +#endif + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { +#ifdef DEBUG /* Nick */ + printf("loop\n"); + fflush(stdout); +#endif + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 397 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 537 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + +#ifndef _MSC_VER /* Nick */ + if (yy_act >= 1 && yy_act <= 99) + { + yy_return_code = yy_function_nick_0(/*yy_current_state, + yy_cp, yy_bp,*/ + yy_act); + + if (yy_return_code == -1) + { +#ifdef DEBUG /* Nick */ + printf("break\n"); + fflush(stdout); +#endif + goto yy_return_break; + } + +#ifdef DEBUG /* Nick */ + printf("token %d\n", yy_return_code); + fflush(stdout); +#endif + return yy_return_code; + } + + if (yy_act >= 100 && yy_act <= 198) + { + yy_return_code = yy_function_nick_1(/*yy_current_state, + yy_cp, yy_bp,*/ + yy_act); + + if (yy_return_code == -1) + { +#ifdef DEBUG /* Nick */ + printf("break\n"); + fflush(stdout); +#endif + goto yy_return_break; + } + +#ifdef DEBUG /* Nick */ + printf("token %d\n", yy_return_code); + fflush(stdout); +#endif + return yy_return_code; + } + +/* #ifdef DEBUG */ /* Nick */ +/* printf("action %d\n", yy_act); */ +/* fflush(stdout); */ +/* #endif */ +#endif + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +#ifdef _MSC_VER /* Nick */ +#include "avrlex0.inc" +#include "avrlex1.inc" +#endif + +case YY_STATE_EOF(INITIAL): +/* #line 312 "avrlex.l" */ + yyeol=TRUE; + if ((ret=restart()) != SKIPRESTART) + { +#ifdef DEBUG /* Nick */ + printf("eof %d\n", ret); + fflush(stdout); +#endif + return ret; + } + YY_BREAK + +/* #line 1965 "avrlex.cc" */ + + case YY_END_OF_BUFFER: + { +#ifdef DEBUG /* Nick */ + printf("YY_END_OF_BUFFER\n"); + fflush(stdout); +#endif + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: +#ifdef DEBUG /* Nick */ + printf("yy_act = %d\n", yy_act); + fflush(stdout); +#endif + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ +#ifndef _MSC_VER /* Nick */ +yy_return_break: + ; +#endif + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer(void) /* Nick void */ + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 397 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 397 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 396); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +/* Nick static */ void *yy_flex_alloc( yy_size_t size ) +#else +/* Nick static */ void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { +#ifdef DEBUG /* Nick */ + printf("yy_flex_alloc(%d) starting\n", size); + fflush(stdout); +#endif + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +/* Nick static */ void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +/* Nick static */ void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ +#ifdef DEBUG /* Nick */ + printf("yy_flex_realloc(%08lx, %d) starting\n", ptr, size); + fflush(stdout); +#endif + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { +#ifdef DEBUG /* Nick */ + printf("yy_flex_free(%08lx) starting\n", ptr); + fflush(stdout); +#endif + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +/* #line 320 "avrlex.l" */ + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +/// /// +/// Scanner support functions /// +/// /// +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Identifiers + // + +int character(void) +{ + yylval.val.value = 0; + yylval.val.valid = FALSE; + + if(yytext[1]=='\\') + { + switch (yytext[2]) + { + case 'n' : yylval.val.value = '\n' ; yylval.val.valid = TRUE; break; + case 't' : yylval.val.value = '\t' ; yylval.val.valid = TRUE; break; + case 'v' : yylval.val.value = '\v' ; yylval.val.valid = TRUE; break; + case 'b' : yylval.val.value = '\b' ; yylval.val.valid = TRUE; break; + case 'r' : yylval.val.value = '\r' ; yylval.val.valid = TRUE; break; + case 'f' : yylval.val.value = '\f' ; yylval.val.valid = TRUE; break; + case 'a' : yylval.val.value = '\a' ; yylval.val.valid = TRUE; break; + case '\\' : yylval.val.value = '\\' ; yylval.val.valid = TRUE; break; + case '\'' : yylval.val.value = '\'' ; yylval.val.valid = TRUE; break; + case '\"' : yylval.val.value = '\"' ; yylval.val.valid = TRUE; break; + case '\?' : yylval.val.value = '\?' ; yylval.val.valid = TRUE; break; + case 'x' : + case 'X' : + { + if(isdigit(yytext[3])) + yylval.val.value = yytext[3] - '0'; + else if(isxdigit(yytext[3])) + yylval.val.value = tolower(yytext[3]) - 'a' + 10; + + if(isxdigit(yytext[3]) && isxdigit(yytext[4])) + { + if(isdigit(yytext[4])) + yylval.val.value = 16*yylval.val.value + yytext[4] - '0'; + else + yylval.val.value = 16*yylval.val.value+tolower(yytext[4])-'a'+10; + } + yylval.val.valid = TRUE; + + } break; + + case '0' : + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + { + yylval.val.value = yytext[2] - '0'; + if(isdigit(yytext[3])) + { + yylval.val.value = 8*yylval.val.value + yytext[3] - '0'; + if(isdigit(yytext[4])) + yylval.val.value = 8*yylval.val.value + yytext[4] - '0'; + } + if(yylval.val.value > 0xFF) + { + yylval.val.value = 0; + warningin(W_OCT_OUT_OF_RANGE); + } + yylval.val.valid = TRUE; + + } break; + + default : errorin(E_UNDEF_ESCAPE,yytext); + } + } + else + { + yylval.val.value = yytext[1]; + yylval.val.valid = TRUE; + } + return INTEGER; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Identifiers + // + +int identifier(void) +{ + char name[MAX_ID_LENGTH+1]; + + if(yytext[0] == '_' && yycfg->local_labels) + { + if(strlen(yytext)+strlen(yylast_used_label)+2>MAX_ID_LENGTH) + { + size_t len; + + warningin(W_IDENTIFIER_TOO_LONG); + name[0]='@'; + memcpy(name+1, yylast_used_label, MAX_ID_LENGTH-1); + name[MAX_ID_LENGTH] = '\0'; + len = strlen(name); + if(len>MAX_ID_LENGTH-9) + len = MAX_ID_LENGTH-9; // truncate the last_used_label to leave at least 8 characters for the local label + name[len++] = '@'; + memcpy(name+len, yytext, MAX_ID_LENGTH-len); + name[MAX_ID_LENGTH] = '\0'; + } + else + { + sprintf(name, "@%s@%s", yylast_used_label, yytext); + } + } + else + { + if(strlen(yytext)>MAX_ID_LENGTH) + { + warningin(W_IDENTIFIER_TOO_LONG); + memcpy(name, yytext, MAX_ID_LENGTH); + name[MAX_ID_LENGTH] = '\0'; + } + else + strcpy(name, yytext); + } + + yylval.symb = getsym(name); + + if(yylval.symb -> macro) + return macro(yylval.symb); + + return SYMBOL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Registers : r0 - r31 + // + +int registers(void) +{ + int registerno; + + if(strlen(yytext)==2) + { + if(isdigit(yytext[1])) + registerno= yytext[1] - '0'; + else + return identifier(); + } + else if(strlen(yytext)==3) + { + if(isdigit(yytext[1]) && isdigit(yytext[2]) ) + registerno= 10 * (yytext[1] - '0') + yytext[2] - '0'; + else + return identifier(); + } + else + return identifier(); + + if(registerno <= 31) + { + yylval.regid = registerno; + return REGISTER; + } + return identifier(); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Strings + // + +int string(void) +{ + if( !(yylval.string = new char[strlen(yytext)+1]) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 2\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + strcpy(yylval.string, yytext); + + return STRING; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Integer constants : Decimal=10 Hex=0xA Hex=$A Octal=012 Binaray=0b1010 + // + +int integers(void) +{ +#ifdef _MSC_VER /* Nick */ + int val; +#else + long val; +#endif + int pos; + char temp[12]; + + bool foundhex = (strpbrk(yytext,"ABCDEFabcdef")!=NULL); + bool foundbin = !(strpbrk(yytext,"ACDEFacdef23456789")!=NULL); + + // Hex : $BABE + + if(yytext[0] == '$' ) + { + val = 0; + pos = 1; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + } + if(pos>9) + warningin(W_CONSTANT_TO_BIG); + } + + // Hex : 0xBABE or 0XBABE + + else if( (yytext[0] == '0' ) && (tolower(yytext[1]) == 'x' )) + { + val = 0; + pos = 2; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + + } + if(pos>10) + warningin(W_CONSTANT_TO_BIG); + } + + // Bin : 0b01010 or 0B01010 + + else if( (yytext[0] == '0' ) && (tolower(yytext[1]) == 'b' ) && foundbin) + { + val = 0; + pos = 2; + while( yytext[pos] ) + val = 2*val + yytext[pos++] - '0'; + if(pos>34) + warningin(W_CONSTANT_TO_BIG); + } + + // Hex : 1BABE (Hex that starts with a decimal) + + else if(isdigit(yytext[0]) && foundhex ) + { + val = 0; + pos = 0; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + } + if(pos>8) + warningin(W_CONSTANT_TO_BIG); + } + + + // Integer 47806 + + else + { +#ifdef _MSC_VER /* Nick */ + val = atoi(yytext); + sprintf(temp, "%i", val); +#else + val = atol(yytext); + sprintf(temp, "%ld", val); +#endif + if(strcmp(temp,yytext)) + warningin(W_CONSTANT_TO_BIG); + } + + yylval.val.value = val; + yylval.val.valid = TRUE; + return INTEGER; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Illegal character + // + +void illegal(void) +{ + if(isprint(yytext[0])) + warningin(W_INVALID_CHAR,yytext[0]); + else + warningin(W_INVALID_ASCII,(unsigned char)yytext[0]); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Include file + // + +int includefile(void) +{ + char name[MAX_LINE_LENGTH+2]; + char filename[MAX_FILENAME_LENGTH+1]; + int c; + FILE *f1,*f2; + + if(strlen(yytext)==strlen(".include")) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + /// Check filename //////////////////////////////////////////////////////// + + if(strlen(yytext) >= MAX_LINE_LENGTH) + errorexit(X_LINE_TOO_LONG, yyfilename); + + strcpy(name,yytext+8+strspn(yytext,"\t\v ") + +strspn(yytext+8+strspn(yytext,"\t\v "),"\t\v ")); + + if(!strlen(name)) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + striprem(name); + + if(!strlen(name)) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + /// Read NL (or EOF) ////////////////////////////////////////////////////// + + yyinput(); + endofline(); + + if( !getfilename(name, filename) ) + { + error(E_INVALID_FILENAME); + return EOL; + } + + /// Check context depth /////////////////////////////////////////////////// + + if( yycontext == (MAX_CONTEXT_DEPTH-1) ) + { + errorin(E_INCLUDE_DEPTH, name); + return EOL; + } + + if( !(f1 = fopenInIncpath(filename,"r")) ) + { + error(E_OPEN_FILE, filename); + return EOL; + } + else if( !(f2 = fopenInIncpath(filename,"r")) ) + { + fclose(f1); + error(E_OPEN_FILE, filename); + return EOL; + } + + /// Setup context stack /////////////////////////////////////////////////// + + CONTEXT->file = yyin; + CONTEXT->file2 = yyin2; + CONTEXT->line = yyline; + CONTEXT->offset = yyoffset; + CONTEXT->dataoffset = yydataoffset; + CONTEXT->eromoffset = yyeromoffset; + + strcpy(CONTEXT->yyinlineold, yyinlineold); + strcpy(CONTEXT->yyinline, yyinline); + strcpy(CONTEXT->yyinlinenew, yyinlinenew); + + statestack[yycontext++] = YY_CURRENT_BUFFER; + + /// Open input file /////////////////////////////////////////////////////// + + if(yyfilecount==MAX_FILES) + errorexit(X_TOO_MANY_FILES); + + yyfileno = -1; + + for(c=0;cfile = f1; + yyin2 = CONTEXT->file2 = f2; + + strcpy(CONTEXT->filename, filename); + strcpy(yyfilename, filename); + + /// Add .include line to log ////////////////////////////////////////////// + + tolog(); + + if(!yyinmacro) + yyline = 1; + else + yyline =0; + + yyline = 1; // XXX + + /// Read new lines into log buffers /////////////////////////////////////// + + if(!fgets(yyinline, MAX_LINE_LENGTH, yyin2)) + yyinline[0] = 0; + if(!fgets(yyinlinenew, MAX_LINE_LENGTH, yyin2)) + yyinlinenew[0] = 0; + + if(strlen(yyinline) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + if(strlen(yyinlinenew) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + + STRIPNR(yyinlinenew); + STRIPNR(yyinline); + + /// Setup scanner to read from new file /////////////////////////////////// + + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); + + return TRUE; +} + + //////////////////////////////////////////////////////////////////////////// + // + // End of line + // + +int endofline(void) +{ + int pos; + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + + if(!ISMACRO) + { + if(!fgets(yyinlinenew,MAX_LINE_LENGTH,yyin2)) + yyinlinenew[0] = '\0'; + if(strlen(yyinlinenew)==MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + //if(yyinmacro) + yyline++; + } + else + { + if( (int)strlen(CONTEXT->macstr) > CONTEXT->stringpos) + { + pos = strcspn(CONTEXT->macstr+CONTEXT->stringpos,"\n"); + if(posmacstr+CONTEXT->stringpos, pos); + else + errorexit(X_MACRO_LINE_TOO_LONG, yyline, yyfilename); + + yyinlinenew[pos] = 0; + CONTEXT->stringpos += pos+1; + } + else + yyinlinenew[0] = 0; + } + + STRIPNR(yyinlinenew); + return EOL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Restart scanner after first parse, and handle macro/include context + // + +int restart(void) +{ + int c; + +#ifdef DEBUG /* Nick */ + printf("restart() starting\n"); + fflush(stdout); +#endif + + if(!restartcount++ && !ISMACRO) + { + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + strcpy(yyinlinenew, "This should never show up"); + yyline++; +#ifdef DEBUG /* Nick */ + printf("restart() returning EOL 0\n"); + fflush(stdout); +#endif + return EOL; + } + + restartcount = 0; + + if(yycontext) + { + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(statestack[--yycontext]); + + if( yycontextstack[yycontext+1]->ismacro ) + { + yyinmacro--; + strcpy(yyinlineold, CONTEXT->yyinlineold); + strcpy(yyinline, CONTEXT->yyinline); + strcpy(yyinlinenew, CONTEXT->yyinlinenew); + delete yycontextstack[yycontext+1]->macstr; + + yysymbolstack[yycontext+1] = NULL; + yyoffset = CONTEXT->offset; + yydataoffset = CONTEXT->dataoffset; + yyeromoffset = CONTEXT->eromoffset; + yyline = CONTEXT->line + 1; + if(ISMACRO) + endofline(); + else + { + if(!fgets(yyinlinenew, MAX_LINE_LENGTH, yyin2)) + yyinlinenew[0] = 0; + } + + if(strlen(yyinlinenew) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + memset(yycontextstack[yycontext+1],0,sizeof(context)); +#ifdef DEBUG /* Nick */ + printf("restart() returning SKIPRESTART 0\n"); + fflush(stdout); +#endif + return SKIPRESTART; + } + else + { + if(ISMACRO) + { + for(c=yycontext;c>=0;c--) + { + if(!yycontextstack[c]->ismacro) + { + strcpy(yyfilename, yycontextstack[c]->filename); + c = -1; + } + } + } + else + strcpy(yyfilename, CONTEXT->filename); + + yyline = CONTEXT->line; + + fclose(yycontextstack[yycontext+1]->file); + fclose(yycontextstack[yycontext+1]->file2); + + yyin = CONTEXT->file; + yyin2 = CONTEXT->file2; + yyoffset = CONTEXT->offset; + yydataoffset = CONTEXT->dataoffset; + yyeromoffset = CONTEXT->eromoffset; + + strcpy(yyinline, CONTEXT->yyinline); + strcpy(yyinlinenew, CONTEXT->yyinlinenew); + memset(yycontextstack[yycontext+1],0,sizeof(context)); + + yyfileno = -1; + for(c=0;cismacro) + { + while( ((ch=yyinput())!='\r') && (ch!='\n') && (ch!=EOF) ); + errorin(E_MACRO_IN_MACRO); + endofline(); + return EOL; + } + + /// Allocate buffer /////////////////////////////////////////////////////// + + if( !(buf1 = new char[bufsize]) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 4\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + /// Get macro string from input /////////////////////////////////////////// + + while(!found) + { + ch = yyinput(); + + if(tolower(ch)==endmacro[founddot]) + founddot++; + else + founddot=0; + + if(founddot==4) + { + found = TRUE; + buf1[pos-3] = '\0'; + sprintf(yyinlinenew,".endm"); + } + else if(ch=='\n') + { + comment = FALSE; + temp[temppos] = 0; + temppos = 0; + if(temptime++) + { + STRIPNR(temp); + strcpy(yyinlinenew, temp); + endofline(); + tolog(); + } + } + else if(ch==EOF) + found = TRUE; + else if(ch==';') + comment = TRUE; + + buf1[pos++] = ch; + + if(ch!='\n') + temp[temppos++] = ch; + + if(pos==bufsize) + { + buf2 = new char[2*bufsize]; + memcpy(buf2, buf1, bufsize); + delete buf1; + buf1 = buf2; + bufsize *=2; + } + } + + /// Read until end of .endmacro line ////////////////////////////////////// + + while( ((ch=yyinput()) != EOF) && (ch!='\n') && (ch!='\r')) + yyinlinenew[temppos++] = ch; + + yyinlinenew[temppos] = 0; + + strcpy(temp, yyinlinenew); + + endofline(); + tolog(); + + if((ch==EOF)&&(founddot<4)) + { + delete buf1; + if(strlen(yyinlineold)) + yyinlineold[strlen(yyinlineold)-1] = '\0'; + STRIPWS(yyinlineold); + error(E_EOF_IN_MACRO); + return restart(); + } + + /// Process string //////////////////////////////////////////////////////// + + pos = strlen(buf1); + + if( pos && !(buf1[pos-1]=='\n') ) + strcat(buf1, "\n"); + + /// Get macro name //////////////////////////////////////////////////////// + + namestart = strspn(buf1,"\t\v "); + nameend = strcspn(buf1+namestart,"\t\v \r\n;")+namestart; + memcpy(name, buf1+namestart, nameend-namestart); + name[nameend-namestart] = '\0'; + + /// Setup macro /////////////////////////////////////////////////////////// + + for(i=yycontext; !yysymbolstack[i]; i--); + + if(!yyparseno) + { + if(strlen(name)>MAX_ID_LENGTH) { + warningin(W_MAC_IDENTIFIER_TOO_LONG); + name[MAX_ID_LENGTH] = '\0'; + } + + if( (symb=yysymbolstack[i]->get(name)) ) + { + error(E_MACRO_REDEF,name); + return EOL; + } + symb = yysymbolstack[i]->add(name); + } + else { + if(strlen(name)>MAX_ID_LENGTH) { + warningin(W_MAC_IDENTIFIER_TOO_LONG); + name[MAX_ID_LENGTH] = '\0'; + } + symb=yysymbolstack[i]->get(name); + } + + if(!symb) + internalerror("DM"); + + if( ISUSED(symb) && ((symb->macdefline != yyline) + ||(strcmp(symb->macfilename, yyfilename)) )) + { + strcpy(yyinlineold,".endmacro"); + error(E_MACRO_REDEF,name); + } + else + { + // If first parse - allocate space in symbol table for macro + + if(!yyparseno) + { + symb -> macro = TRUE; + symb -> macsize = strlen(buf1)-nameend; + symb -> macdefline = yyline; + + if( !(symb -> macstr = new char[symb->macsize+2])) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 5\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + strcpy(symb->macstr, buf1+nameend); + strcpy(symb->macfilename,yyfilename); + } + + // In second parse - check argument usage + + else if( yyline == symb->macdefline ) + { + l = symb->macsize; + symb -> macrodone = TRUE; + + while(l) + { + if( isdigit(symb->macstr[l]) && (symb->macstr[l-1] == '@' ) ) + symb->macparmlist[(symb->macstr[l]) -'0'] = 1; + l--; + } + lastparm = -1; + for(l=0;l<10;l++) + if(symb->macparmlist[l]) + lastparm = l; + + inmacro=yyinmacro; + yyinmacro=1; + + for(l=0;l<=lastparm;l++) + if(!symb->macparmlist[l]) + warningin(W_MACRO_UNUSES_PARM, l, name); + + yyinmacro=inmacro; + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + } + } + + strcpy(yyinline, temp); + endofline(); + delete buf1; + + if(!strlen(name)) + error(E_NO_MACRO_NAME); + + return MACRODEF; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert macro in input stream + // + +int macro(symbolSA symb) +{ + char **parmlist; + int c; + char line[MAX_LINE_LENGTH+2]; + int pos = 0; + int parm; + int inputparms = 0; + int parmpos; + int rem; + int next; + int l; + int len; + char *str; + int res; + int ch; + char orginline[MAX_LINE_LENGTH+2]; + + if( (!symb -> macrodone) && (yyparseno) ) + { + errorin(E_DEF_USE); + while(((ch=yyinput())!='\n') && (ch!=EOF) ); + endofline(); + + return EOL; + } + + strcpy(orginline, yyinline); + + /// Allocate space for parameters ///////////////////////////////////////// + + if( !(parmlist = new char*[10]) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 6\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + for(c=0;c<10;c++) + { + if(!(parmlist[c]= new char [MAX_LINE_LENGTH+1])) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 7\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + else + memset(parmlist[c], 0, MAX_LINE_LENGTH+1); + } + + /// Get parameters from input ///////////////////////////////////////////// + + while( ((line[pos]=yyinput())!='\n') && (line[pos++]!=EOF) ); + + if(pos && (line[pos-1]==EOF) ) + line[--pos] = 0; + + line[pos]=0; + line[pos+1]=0; + + /// Local strtok() that inserts parameters into parameter list //////////// + + if(pos) + { + pos = 0; + parm = 0; + rem = FALSE; + + striprem(line); + + while(line[pos] && (parm<10)) + { + next = FALSE; + parmpos = 0; + + while( (!next) && (line[pos]) ) + { + if( (line[pos]=='"') || (line[pos]=='\'') ) + rem ? rem = FALSE : rem = TRUE; + else if( line[pos]=='\\' ) + parmlist[parm][parmpos++] = line[pos++]; + else if ( (line[pos]==',') && !rem) + { + parmlist[parm][parmpos] = '\0'; + next = TRUE; + } + parmlist[parm][parmpos++] = line[pos++]; + } + parm++; + } + + inputparms = parm; + + /// Clean up parametes (remove leading/trailing whitespaces and ',' //////// + + for(c=0;c<10;c++) + { + pos = strlen(parmlist[c]); + if(pos) + pos--; + while( ((parmlist[c][pos]==',')||(isspace(parmlist[c][pos])))&&(pos>=0)) + parmlist[c][pos--] = '\0'; + + if(pos) + { + l = strspn(parmlist[c], "\t\v "); + len = strlen(parmlist[c])-l; + if(l) + memmove(parmlist[c], parmlist[c]+l,len); + parmlist[c][len] = '\0'; + } + } + } + + /// Check that number of parameters specified, equals the ones used //////// + + for(c=0;c<10;c++) + { + if( parmlist[c][0] && !symb->macparmlist[c]) + warningin(W_ARG_SPEC, c); + else if( !parmlist[c][0] && symb->macparmlist[c]) + warningin(W_ARG_USED, c); + } + + /// Insert parameters in macro string ////////////////////////////////////// + + if(! (str = new char[symb-> macsize + MAX_LINE_LENGTH +5] ) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 8\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + memset(str,0, symb-> macsize + MAX_LINE_LENGTH +5); + + pos = 0; + parm = 0; + res = 0; + + while( symb->macstr[pos] ) + { + if( (symb->macstr[pos]=='@') && (isdigit(symb->macstr[pos+1])) ) + { + parm = symb->macstr[pos+1] - '0'; + pos += 2; + parmpos = 0; + + while(parmlist[parm][parmpos]) + str[res++] = parmlist[parm][parmpos++]; + } + else + str[res++] = symb->macstr[pos++]; + } + + /// Setup new scanner context ////////////////////////////////////////////// + + if( yycontext == (MAX_CONTEXT_DEPTH-1) ) + { + errorexit(X_MACRO_DEPTH); + + for(c=0;c<10;c++) + delete parmlist[c]; + delete parmlist; + + return EOL; + } + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + + strcpy(CONTEXT->yyinlineold, yyinlineold); + strcpy(CONTEXT->yyinline, yyinline); + strcpy(CONTEXT->yyinlinenew, yyinlinenew); + + CONTEXT->line = yyline; + CONTEXT->offset = yyoffset; + CONTEXT->dataoffset = yydataoffset; + CONTEXT->eromoffset = yyeromoffset; + + statestack[yycontext++] = YY_CURRENT_BUFFER; + CONTEXT->ismacro = TRUE; + CONTEXT->macstr = str; + yyoffset = yycodepos/2; + yyeromoffset = yyerompos; + yydataoffset = yydatapos; + + memset(yyinlinenew, 0, MAX_LINE_LENGTH); + memset(yyinline, 0, MAX_LINE_LENGTH); + + pos = strcspn(str,"\n") + 1; + + strcpy(yyinline, symb->name); + + for(l=0;l= MAX_LINE_LENGTH-1 ) + errorexit(X_MACRO_LINE_TOO_LONG, yyline, yyfilename); + + memcpy(yyinline+strlen(yyinline), str ,pos); + + CONTEXT->stringpos = strcspn(str+pos,"\n") + 1; + + memcpy(yyinlinenew, str + pos, CONTEXT->stringpos); + + CONTEXT->stringpos += pos; + + strcpy(yyinline, orginline); + + yyinmacro++; + yyfirstmacroline = TRUE; + + yy_scan_string(str); + + /// Delete parameter list ////////////////////////////////////////////////// + + for(c=0;c<10;c++) + delete parmlist[c]; + delete parmlist; + + /// Allocate new symbol table ////////////////////////////////////////////// + + if(!yyparseno) + { + if(symb -> macsym) + yysymbolstack[yycontext] = symb -> macsym; + else + { + if( !(yysymbolstack[yycontext] = symb -> macsym = new symbolTable()) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 9\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + if( !symb -> macsym->init(yycfg->casesensitive, 16) ) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 10\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + } + } + else + yysymbolstack[yycontext] = symb -> macsym; + + if(!yysymbolstack[yycontext]) + internalerror("MA %i", yycontext); + +// yyline++; + + return SKIPRESTART; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Turn listing on/off + // + +void list(int listtype) +{ + switch(listtype) + { + case LIST_NO : yylist = FALSE; break; + case LIST_YES : yylist = TRUE ; break; + case LIST_NO_MACRO : yylistmacro = FALSE; break; + case LIST_YES_MACRO : yylistmacro = TRUE ; break; + default : internalerror("LU %04X",listtype); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Read to end of current context + // + +int doexit(void) +{ + while(yyinput()!=EOF); + yyeol=TRUE; + return restart(); +} + + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/avrlex.l b/src/mkutil/tavrasm.118/src/avrlex.l new file mode 100644 index 00000000..5750de24 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrlex.l @@ -0,0 +1,1428 @@ +%{ // -*- C -*- +////////////////////////////////////////////////////////////////////////////// +// +// File : avrlex.l +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Scanner file for AVR assembler +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 990329 : Tom - Added support for hex values like 1AB without $ or 0x +// 990512 : Tom - Fixed detection on binary numbers. +// 990522 : Tom - Added support for PC/DC/EC. +// 991211 : Tom - Fixed .endm problem (it had to be lower case) +// 991217 : Kurt- Added # and support for local labels +// 001101 : Brian - Added support for multiple include search paths +// 010319 : Timothy Lee - Added byte1 function (sames as low()) +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include "symbol.hh" +#include "semantic.hh" +#include "avrparse.hh" +#include "avrasm.hh" +#include "utils.hh" + +/// Extern /////////////////////////////////////////////////////////////////// + +GLOBALS(extern); + +/// Global /////////////////////////////////////////////////////////////////// + +symbolTableEntry *sym; +YY_BUFFER_STATE statestack[MAX_CONTEXT_DEPTH]; +int restartcount = 0; +int ret; + +/// Defines ////////////////////////////////////////////////////////////////// + +#define SKIPRESTART 0x02BABE // Any value that is not a token + +/// Prototypes for support function ////////////////////////////////////////// + +int restart(void); +int endofline(void); +int identifier(void); +int registers(void); +int integers(void); +int macrodef(void); +int includefile(void); +int string(void); +int character(void); +int doexit(void); +int macro(symbolSA symb); +void list(int listtype); +void illegal(void); + +/// Scanner definition /////////////////////////////////////////////////////// + +%} + +%option noyywrap +%option never-interactive +%option caseless + +DECDIGIT [0-9] +HEXDIGIT [0-9a-fA-F] +OCTDIGIT [0-7] +BINDIGIT [01] +LETTER [a-zA-Z_] +CHAR [a-zA-Z0-9_] +HTAB [\011] +NL [\012] +VTAB [\013] +FORMFEED [\014] +CR [\015] +SPACE [\040] +WHITE {HTAB}|{VTAB}|{SPACE} + +%% + +"*" return STAR; +"/" return DIV; +"%" return MOD; +"<<" return LS; +">>" return RS; +"<=" return LE; +">=" return GE; +"<" return LESS; +">" return GREAT; +"==" return EQ; +"!=" return NE; +"||" return OROR; +"&&" return ANDAND; +"|" return OR; +"&" return AND; +"^" return XOR; +"(" return LPAR; +")" return RPAR; +":" return COLON; +"," return COMMA; +"." return DOT; +"+" return PLUS; +"-" return MINUS; +"=" return EQUAL; +"~" return WAVE; +"!" return NOT; + +".def" return DEF; +".equ" return EQU; +".eq" return EQU; +".db" return DB; +".dw" return DW; +".org" return ORG; +".byte" return BYTE; +".set" return SET; +".device" return DEVICE; + +".cseg" { yysegment = SEGMENT_CODE; return CSEG; } +".dseg" { yysegment = SEGMENT_DATA; return ESEG; } +".eseg" { yysegment = SEGMENT_EEPROM; return DSEG; } + +"low" { yylval.func = OP_LOW; return FUNCTION;} +"high" { yylval.func = OP_HIGH; return FUNCTION;} +"byte1" { yylval.func = OP_LOW; return FUNCTION;} +"byte2" { yylval.func = OP_BYTE2; return FUNCTION;} +"byte3" { yylval.func = OP_BYTE3; return FUNCTION;} +"byte4" { yylval.func = OP_BYTE4; return FUNCTION;} +"lwrd" { yylval.func = OP_LWRD; return FUNCTION;} +"hwrd" { yylval.func = OP_HWRD; return FUNCTION;} +"page" { yylval.func = OP_PAGE; return FUNCTION;} +"exp2" { yylval.func = OP_EXP2; return FUNCTION;} +"log2" { yylval.func = OP_LOG2; return FUNCTION;} +"cpc" { yylval.opcode = O_CPC; return IREGREG; } /* Register */ +"cp" { yylval.opcode = O_CP; return IREGREG; } +"sbc" { yylval.opcode = O_SBC; return IREGREG; } +"sub" { yylval.opcode = O_SUB; return IREGREG; } +"add" { yylval.opcode = O_ADD; return IREGREG; } +"adc" { yylval.opcode = O_ADC; return IREGREG; } +"cpse" { yylval.opcode = O_CPSE; return IREGREG; } +"and" { yylval.opcode = O_AND; return IREGREG; } +"eor" { yylval.opcode = O_EOR; return IREGREG; } +"or" { yylval.opcode = O_OR; return IREGREG; } +"mov" { yylval.opcode = O_MOV; return IREGREG; } +"movw" { yylval.opcode = O_MOVW; return IREGREG; } +"mul" { yylval.opcode = O_MUL; return IREGREG; } +"muls" { yylval.opcode = O_MULS; return IREGREG; } +"mulsu" { yylval.opcode = O_MULSU; return IREGREG; } +"fmul" { yylval.opcode = O_FMUL; return IREGREG; } +"fmuls" { yylval.opcode = O_FMULS; return IREGREG; } +"fmulsu" { yylval.opcode = O_FMULSU; return IREGREG; } +"adiw" { yylval.opcode = O_ADIW; return IREGIMM; } /* Reg/Imm */ +"sbiw" { yylval.opcode = O_SBIW; return IREGIMM; } +"cpi" { yylval.opcode = O_CPI; return IREGIMM; } +"sbci" { yylval.opcode = O_SBCI; return IREGIMM; } +"subi" { yylval.opcode = O_SUBI; return IREGIMM; } +"ori" { yylval.opcode = O_ORI; return IREGIMM; } +"andi" { yylval.opcode = O_ANDI; return IREGIMM; } +"ldi" { yylval.opcode = O_LDI; return IREGIMM; } +"lds" { yylval.opcode = O_LDS; return IREGIMM; } +"sbr" { yylval.opcode = O_SBR; return IREGIMM; } +"brcc" { yylval.opcode = O_BRCC; return IIMM; } /* Immediate */ +"brcs" { yylval.opcode = O_BRCS; return IIMM; } +"brne" { yylval.opcode = O_BRNE; return IIMM; } +"breq" { yylval.opcode = O_BREQ; return IIMM; } +"brpl" { yylval.opcode = O_BRPL; return IIMM; } +"brmi" { yylval.opcode = O_BRMI; return IIMM; } +"brvc" { yylval.opcode = O_BRVC; return IIMM; } +"brvs" { yylval.opcode = O_BRVS; return IIMM; } +"brge" { yylval.opcode = O_BRGE; return IIMM; } +"brlt" { yylval.opcode = O_BRLT; return IIMM; } +"brhc" { yylval.opcode = O_BRHC; return IIMM; } +"brhs" { yylval.opcode = O_BRHS; return IIMM; } +"brtc" { yylval.opcode = O_BRTC; return IIMM; } +"brts" { yylval.opcode = O_BRTS; return IIMM; } +"brid" { yylval.opcode = O_BRID; return IIMM; } +"brie" { yylval.opcode = O_BRIE; return IIMM; } +"brsh" { yylval.opcode = O_BRSH; return IIMM; } +"brlo" { yylval.opcode = O_BRLO; return IIMM; } +"neg" { yylval.opcode = O_NEG; return IREG; } /* Register */ +"swap" { yylval.opcode = O_SWAP; return IREG; } +"inc" { yylval.opcode = O_INC; return IREG; } +"asr" { yylval.opcode = O_ASR; return IREG; } +"lsr" { yylval.opcode = O_LSR; return IREG; } +"dec" { yylval.opcode = O_DEC; return IREG; } +"pop" { yylval.opcode = O_POP; return IREG; } +"push" { yylval.opcode = O_PUSH; return IREG; } +"clr" { yylval.opcode = O_CLR; return IREG; } +"tst" { yylval.opcode = O_TST; return IREG; } +"com" { yylval.opcode = O_COM; return IREG; } +"ror" { yylval.opcode = O_ROR; return IREG; } +"sec" { yylval.opcode = O_SEC; return INOARGS; } /* No arguments */ +"sez" { yylval.opcode = O_SEZ; return INOARGS; } +"sen" { yylval.opcode = O_SEN; return INOARGS; } +"sev" { yylval.opcode = O_SEV; return INOARGS; } +"ses" { yylval.opcode = O_SES; return INOARGS; } +"seh" { yylval.opcode = O_SEH; return INOARGS; } +"set" { yylval.opcode = O_SET; return INOARGS; } +"sei" { yylval.opcode = O_SEI; return INOARGS; } +"clc" { yylval.opcode = O_CLC; return INOARGS; } +"clz" { yylval.opcode = O_CLZ; return INOARGS; } +"cln" { yylval.opcode = O_CLN; return INOARGS; } +"clv" { yylval.opcode = O_CLV; return INOARGS; } +"cls" { yylval.opcode = O_CLS; return INOARGS; } +"clh" { yylval.opcode = O_CLH; return INOARGS; } +"clt" { yylval.opcode = O_CLT; return INOARGS; } +"cli" { yylval.opcode = O_CLI; return INOARGS; } +"nop" { yylval.opcode = O_NOP; return INOARGS; } +"icall" { yylval.opcode = O_ICALL; return INOARGS; } /* Misc. */ +"ijmp" { yylval.opcode = O_IJMP; return INOARGS; } +"reti" { yylval.opcode = O_RETI; return INOARGS; } +"ret" { yylval.opcode = O_RET; return INOARGS; } +"sleep" { yylval.opcode = O_SLEEP; return INOARGS; } +"wdr" { yylval.opcode = O_WDR; return INOARGS; } +"eijmp" { yylval.opcode = O_EIJMP; return INOARGS; } +"eicall" { yylval.opcode = O_EICALL; return INOARGS; } +"spm" { yylval.opcode = O_SPM; return INOARGS; } +"espm" { yylval.opcode = O_ESPM; return INOARGS; } +"bclr" { yylval.opcode = O_BCLR; return IIMM; } +"bset" { yylval.opcode = O_BSET; return IIMM; } +"rcall" { yylval.opcode = O_RCALL; return IIMM; } +"rjmp" { yylval.opcode = O_RJMP; return IIMM; } +"jmp" { yylval.opcode = O_JMP; return IIMM; } +"call" { yylval.opcode = O_CALL; return IIMM; } +"brbc" { yylval.opcode = O_BRBC; return IIMMIMM; } +"brbs" { yylval.opcode = O_BRBS; return IIMMIMM; } +"cbi" { yylval.opcode = O_CBI; return IIMMIMM; } +"sbi" { yylval.opcode = O_SBI; return IIMMIMM; } +"sbic" { yylval.opcode = O_SBIC; return IIMMIMM; } +"sbis" { yylval.opcode = O_SBIS; return IIMMIMM; } +"out" { yylval.opcode = O_OUT; return IIMMREG; } +"sts" { yylval.opcode = O_STS; return IIMMREG; } +"rol" { yylval.opcode = O_ROL; return IREG; } +"ser" { yylval.opcode = O_SER; return IREG; } +"lsl" { yylval.opcode = O_LSL; return IREG; } +"bld" { yylval.opcode = O_BLD; return IREGIMM; } +"bst" { yylval.opcode = O_BST; return IREGIMM; } +"cbr" { yylval.opcode = O_CBR; return IREGIMM; } +"in" { yylval.opcode = O_IN; return IREGIMM; } +"sbrc" { yylval.opcode = O_SBRC; return IREGIMM; } +"sbrs" { yylval.opcode = O_SBRS; return IREGIMM; } +"ld" { yylval.opcode = O_LD; return IINDIRC; } +"st" { yylval.opcode = O_ST; return IINDIRC; } +"ldd" { yylval.opcode = O_LDD; return IINDIRC; } +"std" { yylval.opcode = O_STD; return IINDIRC; } +"X" { yylval.regid = 26; return REGXYZ; } +"Y" { yylval.regid = 28; return REGXYZ; } +"Z" { yylval.regid = 30; return REGXYZ; } +"lpm" { yylval.opcode = O_LPM; return ILPM; } +"elpm" { yylval.opcode = O_ELPM; return ILPM; } + +"PC" { yylval.val.value=yycodepos/2;yylval.val.valid=TRUE; return COUNTER;} +"DC" { yylval.val.value=yydatapos; yylval.val.valid=TRUE; return COUNTER;} +"EC" { yylval.val.value=yyerompos; yylval.val.valid=TRUE; return COUNTER;} + +^{WHITE}*".nolistmac" list(LIST_NO_MACRO); +^{WHITE}*".nolist" list(LIST_NO); +^{WHITE}*".listmac" list(LIST_YES_MACRO); +^{WHITE}*".list" list(LIST_YES); +^{WHITE}*".exit" yyeol=TRUE; if((ret=doexit() )!=SKIPRESTART) return ret; +^{WHITE}*".include"[^\n]* if(includefile()==EOL) return EOL; +^{WHITE}*".macro" return macrodef(); +".endm" errorin(E_ENDM); +"\""("\\\""|[^\n\"])*"\"" return string(); +[r]{DECDIGIT}+ return registers(); +{DECDIGIT}+ return integers(); +"0x"{HEXDIGIT}+ return integers(); +"0b"{BINDIGIT}+ return integers(); +"$"{HEXDIGIT}+ return integers(); +{DECDIGIT}{HEXDIGIT}* return integers(); +"'\\x"{HEXDIGIT}{1,2}"'" return character(); +"'\\x"{HEXDIGIT}{3,}"'" warningin(W_HEX_ESCAPE_INVALID);yylval.val.valid = TRUE;yylval.val.value = 0; return INTEGER; +"'\\"{OCTDIGIT}{1,3}"'" return character(); +"'\\"{OCTDIGIT}{4,}"'" warningin(W_OCT_ESCAPE_INVALID);yylval.val.valid = TRUE;yylval.val.value = 0; return INTEGER; +"'\\"."'" return character(); +"'"."'" return character(); +{LETTER}{CHAR}* if((ret=identifier())!=SKIPRESTART)return ret; +<> yyeol=TRUE; if((ret=restart() )!=SKIPRESTART)return ret; +[\n] yyeol=TRUE; return endofline(); +[ \t\r]+ ; +";".* ; +"//".* ; +"#".* ; +. illegal(); + +%% + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +/// /// +/// Scanner support functions /// +/// /// +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Identifiers + // + +int character(void) +{ + yylval.val.value = 0; + yylval.val.valid = FALSE; + + if(yytext[1]=='\\') + { + switch (yytext[2]) + { + case 'n' : yylval.val.value = '\n' ; yylval.val.valid = TRUE; break; + case 't' : yylval.val.value = '\t' ; yylval.val.valid = TRUE; break; + case 'v' : yylval.val.value = '\v' ; yylval.val.valid = TRUE; break; + case 'b' : yylval.val.value = '\b' ; yylval.val.valid = TRUE; break; + case 'r' : yylval.val.value = '\r' ; yylval.val.valid = TRUE; break; + case 'f' : yylval.val.value = '\f' ; yylval.val.valid = TRUE; break; + case 'a' : yylval.val.value = '\a' ; yylval.val.valid = TRUE; break; + case '\\' : yylval.val.value = '\\' ; yylval.val.valid = TRUE; break; + case '\'' : yylval.val.value = '\'' ; yylval.val.valid = TRUE; break; + case '\"' : yylval.val.value = '\"' ; yylval.val.valid = TRUE; break; + case '\?' : yylval.val.value = '\?' ; yylval.val.valid = TRUE; break; + case 'x' : + case 'X' : + { + if(isdigit(yytext[3])) + yylval.val.value = yytext[3] - '0'; + else if(isxdigit(yytext[3])) + yylval.val.value = tolower(yytext[3]) - 'a' + 10; + + if(isxdigit(yytext[3]) && isxdigit(yytext[4])) + { + if(isdigit(yytext[4])) + yylval.val.value = 16*yylval.val.value + yytext[4] - '0'; + else + yylval.val.value = 16*yylval.val.value+tolower(yytext[4])-'a'+10; + } + yylval.val.valid = TRUE; + + } break; + + case '0' : + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + { + yylval.val.value = yytext[2] - '0'; + if(isdigit(yytext[3])) + { + yylval.val.value = 8*yylval.val.value + yytext[3] - '0'; + if(isdigit(yytext[4])) + yylval.val.value = 8*yylval.val.value + yytext[4] - '0'; + } + if(yylval.val.value > 0xFF) + { + yylval.val.value = 0; + warningin(W_OCT_OUT_OF_RANGE); + } + yylval.val.valid = TRUE; + + } break; + + default : errorin(E_UNDEF_ESCAPE,yytext); + } + } + else + { + yylval.val.value = yytext[1]; + yylval.val.valid = TRUE; + } + return INTEGER; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Identifiers + // + +int identifier(void) +{ + char name[MAX_ID_LENGTH+1]; + + if(yytext[0] == '_' && yycfg->local_labels) + { + if(strlen(yytext)+strlen(yylast_used_label)+2>MAX_ID_LENGTH) + { + size_t len; + + warningin(W_IDENTIFIER_TOO_LONG); + name[0]='@'; + memcpy(name+1, yylast_used_label, MAX_ID_LENGTH-1); + name[MAX_ID_LENGTH] = '\0'; + len = strlen(name); + if(len>MAX_ID_LENGTH-9) + len = MAX_ID_LENGTH-9; // truncate the last_used_label to leave at least 8 characters for the local label + name[len++] = '@'; + memcpy(name+len, yytext, MAX_ID_LENGTH-len); + name[MAX_ID_LENGTH] = '\0'; + } + else + { + sprintf(name, "@%s@%s", yylast_used_label, yytext); + } + } + else + { + if(strlen(yytext)>MAX_ID_LENGTH) + { + warningin(W_IDENTIFIER_TOO_LONG); + memcpy(name, yytext, MAX_ID_LENGTH); + name[MAX_ID_LENGTH] = '\0'; + } + else + strcpy(name, yytext); + } + + yylval.symb = getsym(name); + + if(yylval.symb -> macro) + return macro(yylval.symb); + + return SYMBOL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Registers : r0 - r31 + // + +int registers(void) +{ + int registerno; + + if(strlen(yytext)==2) + { + if(isdigit(yytext[1])) + registerno= yytext[1] - '0'; + else + return identifier(); + } + else if(strlen(yytext)==3) + { + if(isdigit(yytext[1]) && isdigit(yytext[2]) ) + registerno= 10 * (yytext[1] - '0') + yytext[2] - '0'; + else + return identifier(); + } + else + return identifier(); + + if(registerno <= 31) + { + yylval.regid = registerno; + return REGISTER; + } + return identifier(); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Strings + // + +int string(void) +{ + if( !(yylval.string = new char[strlen(yytext)+1]) ) + errorexit(X_OUT_OF_MEMORY); + + strcpy(yylval.string, yytext); + + return STRING; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Integer constants : Decimal=10 Hex=0xA Hex=$A Octal=012 Binaray=0b1010 + // + +int integers(void) +{ + int val; + int pos; + char temp[12]; + + bool foundhex = (strpbrk(yytext,"ABCDEFabcdef")!=NULL); + bool foundbin = !(strpbrk(yytext,"ACDEFacdef23456789")!=NULL); + + // Hex : $BABE + + if(yytext[0] == '$' ) + { + val = 0; + pos = 1; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + } + if(pos>9) + warningin(W_CONSTANT_TO_BIG); + } + + // Hex : 0xBABE or 0XBABE + + else if( (yytext[0] == '0' ) && (tolower(yytext[1]) == 'x' )) + { + val = 0; + pos = 2; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + + } + if(pos>10) + warningin(W_CONSTANT_TO_BIG); + } + + // Bin : 0b01010 or 0B01010 + + else if( (yytext[0] == '0' ) && (tolower(yytext[1]) == 'b' ) && foundbin) + { + val = 0; + pos = 2; + while( yytext[pos] ) + val = 2*val + yytext[pos++] - '0'; + if(pos>34) + warningin(W_CONSTANT_TO_BIG); + } + + // Hex : 1BABE (Hex that starts with a decimal) + + else if(isdigit(yytext[0]) && foundhex ) + { + val = 0; + pos = 0; + while( yytext[pos] ) + { + if(isdigit(yytext[pos])) + val = 16*val + yytext[pos] - '0'; + else + val = 16*val + tolower(yytext[pos]) - 'a' + 10; + pos++; + } + if(pos>8) + warningin(W_CONSTANT_TO_BIG); + } + + + // Integer 47806 + + else + { + val = atoi(yytext); + sprintf(temp, "%i", val); + if(strcmp(temp,yytext)) + warningin(W_CONSTANT_TO_BIG); + } + + yylval.val.value = val; + yylval.val.valid = TRUE; + return INTEGER; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Illegal character + // + +void illegal(void) +{ + if(isprint(yytext[0])) + warningin(W_INVALID_CHAR,yytext[0]); + else + warningin(W_INVALID_ASCII,(unsigned char)yytext[0]); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Include file + // + +int includefile(void) +{ + char name[MAX_LINE_LENGTH+2]; + char filename[MAX_FILENAME_LENGTH+1]; + int c; + FILE *f1,*f2; + + if(strlen(yytext)==strlen(".include")) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + /// Check filename //////////////////////////////////////////////////////// + + if(strlen(yytext) >= MAX_LINE_LENGTH) + errorexit(X_LINE_TOO_LONG, yyfilename); + + strcpy(name,yytext+8+strspn(yytext,"\t\v ") + +strspn(yytext+8+strspn(yytext,"\t\v "),"\t\v ")); + + if(!strlen(name)) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + striprem(name); + + if(!strlen(name)) + { + yyinput(); + endofline(); + error(E_NO_FILENAME); + return EOL; + } + + /// Read NL (or EOF) ////////////////////////////////////////////////////// + + yyinput(); + endofline(); + + if( !getfilename(name, filename) ) + { + error(E_INVALID_FILENAME); + return EOL; + } + + /// Check context depth /////////////////////////////////////////////////// + + if( yycontext == (MAX_CONTEXT_DEPTH-1) ) + { + errorin(E_INCLUDE_DEPTH, name); + return EOL; + } + + if( !(f1 = fopenInIncpath(filename,"r")) ) + { + error(E_OPEN_FILE, filename); + return EOL; + } + else if( !(f2 = fopenInIncpath(filename,"r")) ) + { + fclose(f1); + error(E_OPEN_FILE, filename); + return EOL; + } + + /// Setup context stack /////////////////////////////////////////////////// + + CONTEXT->file = yyin; + CONTEXT->file2 = yyin2; + CONTEXT->line = yyline; + CONTEXT->offset = yyoffset; + CONTEXT->dataoffset = yydataoffset; + CONTEXT->eromoffset = yyeromoffset; + + strcpy(CONTEXT->yyinlineold, yyinlineold); + strcpy(CONTEXT->yyinline, yyinline); + strcpy(CONTEXT->yyinlinenew, yyinlinenew); + + statestack[yycontext++] = YY_CURRENT_BUFFER; + + /// Open input file /////////////////////////////////////////////////////// + + if(yyfilecount==MAX_FILES) + errorexit(X_TOO_MANY_FILES); + + yyfileno = -1; + + for(c=0;cfile = f1; + yyin2 = CONTEXT->file2 = f2; + + strcpy(CONTEXT->filename, filename); + strcpy(yyfilename, filename); + + /// Add .include line to log ////////////////////////////////////////////// + + tolog(); + + if(!yyinmacro) + yyline = 1; + else + yyline =0; + + yyline = 1; // XXX + + /// Read new lines into log buffers /////////////////////////////////////// + + if(!fgets(yyinline, MAX_LINE_LENGTH, yyin2)) + yyinline[0] = 0; + if(!fgets(yyinlinenew, MAX_LINE_LENGTH, yyin2)) + yyinlinenew[0] = 0; + + if(strlen(yyinline) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + if(strlen(yyinlinenew) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + + STRIPNR(yyinlinenew); + STRIPNR(yyinline); + + /// Setup scanner to read from new file /////////////////////////////////// + + yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); + + return TRUE; +} + + //////////////////////////////////////////////////////////////////////////// + // + // End of line + // + +int endofline(void) +{ + int pos; + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + + if(!ISMACRO) + { + if(!fgets(yyinlinenew,MAX_LINE_LENGTH,yyin2)) + yyinlinenew[0] = '\0'; + if(strlen(yyinlinenew)==MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + //if(yyinmacro) + yyline++; + } + else + { + if( (int)strlen(CONTEXT->macstr) > CONTEXT->stringpos) + { + pos = strcspn(CONTEXT->macstr+CONTEXT->stringpos,"\n"); + if(posmacstr+CONTEXT->stringpos, pos); + else + errorexit(X_MACRO_LINE_TOO_LONG, yyline, yyfilename); + + yyinlinenew[pos] = 0; + CONTEXT->stringpos += pos+1; + } + else + yyinlinenew[0] = 0; + } + + STRIPNR(yyinlinenew); + return EOL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Restart scanner after first parse, and handle macro/include context + // + +int restart(void) +{ + int c; + + if(!restartcount++ && !ISMACRO) + { + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + strcpy(yyinlinenew, "This should never show up"); + yyline++; + return EOL; + } + + restartcount = 0; + + if(yycontext) + { + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(statestack[--yycontext]); + + if( yycontextstack[yycontext+1]->ismacro ) + { + yyinmacro--; + strcpy(yyinlineold, CONTEXT->yyinlineold); + strcpy(yyinline, CONTEXT->yyinline); + strcpy(yyinlinenew, CONTEXT->yyinlinenew); + delete yycontextstack[yycontext+1]->macstr; + + yysymbolstack[yycontext+1] = NULL; + yyoffset = CONTEXT->offset; + yydataoffset = CONTEXT->dataoffset; + yyeromoffset = CONTEXT->eromoffset; + yyline = CONTEXT->line + 1; + if(ISMACRO) + endofline(); + else + { + if(!fgets(yyinlinenew, MAX_LINE_LENGTH, yyin2)) + yyinlinenew[0] = 0; + } + + if(strlen(yyinlinenew) == MAX_LINE_LENGTH-1) + errorexit(X_LINE_TOO_LONG, yyfilename); + memset(yycontextstack[yycontext+1],0,sizeof(context)); + return SKIPRESTART; + } + else + { + if(ISMACRO) + { + for(c=yycontext;c>=0;c--) + { + if(!yycontextstack[c]->ismacro) + { + strcpy(yyfilename, yycontextstack[c]->filename); + c = -1; + } + } + } + else + strcpy(yyfilename, CONTEXT->filename); + + yyline = CONTEXT->line; + + fclose(yycontextstack[yycontext+1]->file); + fclose(yycontextstack[yycontext+1]->file2); + + yyin = CONTEXT->file; + yyin2 = CONTEXT->file2; + yyoffset = CONTEXT->offset; + yydataoffset = CONTEXT->dataoffset; + yyeromoffset = CONTEXT->eromoffset; + + strcpy(yyinline, CONTEXT->yyinline); + strcpy(yyinlinenew, CONTEXT->yyinlinenew); + memset(yycontextstack[yycontext+1],0,sizeof(context)); + + yyfileno = -1; + for(c=0;cismacro) + { + while( ((ch=yyinput())!='\r') && (ch!='\n') && (ch!=EOF) ); + errorin(E_MACRO_IN_MACRO); + endofline(); + return EOL; + } + + /// Allocate buffer /////////////////////////////////////////////////////// + + if( !(buf1 = new char[bufsize]) ) + errorexit(X_OUT_OF_MEMORY); + + /// Get macro string from input /////////////////////////////////////////// + + while(!found) + { + ch = yyinput(); + + if(tolower(ch)==endmacro[founddot]) + founddot++; + else + founddot=0; + + if(founddot==4) + { + found = TRUE; + buf1[pos-3] = '\0'; + sprintf(yyinlinenew,".endm"); + } + else if(ch=='\n') + { + comment = FALSE; + temp[temppos] = 0; + temppos = 0; + if(temptime++) + { + STRIPNR(temp); + strcpy(yyinlinenew, temp); + endofline(); + tolog(); + } + } + else if(ch==EOF) + found = TRUE; + else if(ch==';') + comment = TRUE; + + buf1[pos++] = ch; + + if(ch!='\n') + temp[temppos++] = ch; + + if(pos==bufsize) + { + buf2 = new char[2*bufsize]; + memcpy(buf2, buf1, bufsize); + delete buf1; + buf1 = buf2; + bufsize *=2; + } + } + + /// Read until end of .endmacro line ////////////////////////////////////// + + while( ((ch=yyinput()) != EOF) && (ch!='\n') && (ch!='\r')) + yyinlinenew[temppos++] = ch; + + yyinlinenew[temppos] = 0; + + strcpy(temp, yyinlinenew); + + endofline(); + tolog(); + + if((ch==EOF)&&(founddot<4)) + { + delete buf1; + if(strlen(yyinlineold)) + yyinlineold[strlen(yyinlineold)-1] = '\0'; + STRIPWS(yyinlineold); + error(E_EOF_IN_MACRO); + return restart(); + } + + /// Process string //////////////////////////////////////////////////////// + + pos = strlen(buf1); + + if( pos && !(buf1[pos-1]=='\n') ) + strcat(buf1, "\n"); + + /// Get macro name //////////////////////////////////////////////////////// + + namestart = strspn(buf1,"\t\v "); + nameend = strcspn(buf1+namestart,"\t\v \r\n;")+namestart; + memcpy(name, buf1+namestart, nameend-namestart); + name[nameend-namestart] = '\0'; + + /// Setup macro /////////////////////////////////////////////////////////// + + for(i=yycontext; !yysymbolstack[i]; i--); + + if(!yyparseno) + { + if(strlen(name)>MAX_ID_LENGTH) { + warningin(W_MAC_IDENTIFIER_TOO_LONG); + name[MAX_ID_LENGTH] = '\0'; + } + + if( (symb=yysymbolstack[i]->get(name)) ) + { + error(E_MACRO_REDEF,name); + return EOL; + } + symb = yysymbolstack[i]->add(name); + } + else { + if(strlen(name)>MAX_ID_LENGTH) { + warningin(W_MAC_IDENTIFIER_TOO_LONG); + name[MAX_ID_LENGTH] = '\0'; + } + symb=yysymbolstack[i]->get(name); + } + + if(!symb) + internalerror("DM"); + + if( ISUSED(symb) && ((symb->macdefline != yyline) + ||(strcmp(symb->macfilename, yyfilename)) )) + { + strcpy(yyinlineold,".endmacro"); + error(E_MACRO_REDEF,name); + } + else + { + // If first parse - allocate space in symbol table for macro + + if(!yyparseno) + { + symb -> macro = TRUE; + symb -> macsize = strlen(buf1)-nameend; + symb -> macdefline = yyline; + + if( !(symb -> macstr = new char[symb->macsize+2])) + errorexit(X_OUT_OF_MEMORY); + + strcpy(symb->macstr, buf1+nameend); + strcpy(symb->macfilename,yyfilename); + } + + // In second parse - check argument usage + + else if( yyline == symb->macdefline ) + { + l = symb->macsize; + symb -> macrodone = TRUE; + + while(l) + { + if( isdigit(symb->macstr[l]) && (symb->macstr[l-1] == '@' ) ) + symb->macparmlist[(symb->macstr[l]) -'0'] = 1; + l--; + } + lastparm = -1; + for(l=0;l<10;l++) + if(symb->macparmlist[l]) + lastparm = l; + + inmacro=yyinmacro; + yyinmacro=1; + + for(l=0;l<=lastparm;l++) + if(!symb->macparmlist[l]) + warningin(W_MACRO_UNUSES_PARM, l, name); + + yyinmacro=inmacro; + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + } + } + + strcpy(yyinline, temp); + endofline(); + delete buf1; + + if(!strlen(name)) + error(E_NO_MACRO_NAME); + + return MACRODEF; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert macro in input stream + // + +int macro(symbolSA symb) +{ + char **parmlist; + int c; + char line[MAX_LINE_LENGTH+2]; + int pos = 0; + int parm; + int inputparms = 0; + int parmpos; + int rem; + int next; + int l; + int len; + char *str; + int res; + int ch; + char orginline[MAX_LINE_LENGTH+2]; + + if( (!symb -> macrodone) && (yyparseno) ) + { + errorin(E_DEF_USE); + while(((ch=yyinput())!='\n') && (ch!=EOF) ); + endofline(); + + return EOL; + } + + strcpy(orginline, yyinline); + + /// Allocate space for parameters ///////////////////////////////////////// + + if( !(parmlist = new char*[10]) ) + errorexit(X_OUT_OF_MEMORY); + + for(c=0;c<10;c++) + { + if(!(parmlist[c]= new char [MAX_LINE_LENGTH+1])) + errorexit(X_OUT_OF_MEMORY); + else + memset(parmlist[c], 0, MAX_LINE_LENGTH+1); + } + + /// Get parameters from input ///////////////////////////////////////////// + + while( ((line[pos]=yyinput())!='\n') && (line[pos++]!=EOF) ); + + if(pos && (line[pos-1]==EOF) ) + line[--pos] = 0; + + line[pos]=0; + line[pos+1]=0; + + /// Local strtok() that inserts parameters into parameter list //////////// + + if(pos) + { + pos = 0; + parm = 0; + rem = FALSE; + + striprem(line); + + while(line[pos] && (parm<10)) + { + next = FALSE; + parmpos = 0; + + while( (!next) && (line[pos]) ) + { + if( (line[pos]=='"') || (line[pos]=='\'') ) + rem ? rem = FALSE : rem = TRUE; + else if( line[pos]=='\\' ) + parmlist[parm][parmpos++] = line[pos++]; + else if ( (line[pos]==',') && !rem) + { + parmlist[parm][parmpos] = '\0'; + next = TRUE; + } + parmlist[parm][parmpos++] = line[pos++]; + } + parm++; + } + + inputparms = parm; + + /// Clean up parametes (remove leading/trailing whitespaces and ',' //////// + + for(c=0;c<10;c++) + { + pos = strlen(parmlist[c]); + if(pos) + pos--; + while( ((parmlist[c][pos]==',')||(isspace(parmlist[c][pos])))&&(pos>=0)) + parmlist[c][pos--] = '\0'; + + if(pos) + { + l = strspn(parmlist[c], "\t\v "); + len = strlen(parmlist[c])-l; + if(l) + memmove(parmlist[c], parmlist[c]+l,len); + parmlist[c][len] = '\0'; + } + } + } + + /// Check that number of parameters specified, equals the ones used //////// + + for(c=0;c<10;c++) + { + if( parmlist[c][0] && !symb->macparmlist[c]) + warningin(W_ARG_SPEC, c); + else if( !parmlist[c][0] && symb->macparmlist[c]) + warningin(W_ARG_USED, c); + } + + /// Insert parameters in macro string ////////////////////////////////////// + + if(! (str = new char[symb-> macsize + MAX_LINE_LENGTH +5] ) ) + errorexit(X_OUT_OF_MEMORY); + + memset(str,0, symb-> macsize + MAX_LINE_LENGTH +5); + + pos = 0; + parm = 0; + res = 0; + + while( symb->macstr[pos] ) + { + if( (symb->macstr[pos]=='@') && (isdigit(symb->macstr[pos+1])) ) + { + parm = symb->macstr[pos+1] - '0'; + pos += 2; + parmpos = 0; + + while(parmlist[parm][parmpos]) + str[res++] = parmlist[parm][parmpos++]; + } + else + str[res++] = symb->macstr[pos++]; + } + + /// Setup new scanner context ////////////////////////////////////////////// + + if( yycontext == (MAX_CONTEXT_DEPTH-1) ) + { + errorexit(X_MACRO_DEPTH); + + for(c=0;c<10;c++) + delete parmlist[c]; + delete parmlist; + + return EOL; + } + + strcpy(yyinlineold, yyinline); + strcpy(yyinline, yyinlinenew); + + strcpy(CONTEXT->yyinlineold, yyinlineold); + strcpy(CONTEXT->yyinline, yyinline); + strcpy(CONTEXT->yyinlinenew, yyinlinenew); + + CONTEXT->line = yyline; + CONTEXT->offset = yyoffset; + CONTEXT->dataoffset = yydataoffset; + CONTEXT->eromoffset = yyeromoffset; + + statestack[yycontext++] = YY_CURRENT_BUFFER; + CONTEXT->ismacro = TRUE; + CONTEXT->macstr = str; + yyoffset = yycodepos/2; + yyeromoffset = yyerompos; + yydataoffset = yydatapos; + + memset(yyinlinenew, 0, MAX_LINE_LENGTH); + memset(yyinline, 0, MAX_LINE_LENGTH); + + pos = strcspn(str,"\n") + 1; + + strcpy(yyinline, symb->name); + + for(l=0;l= MAX_LINE_LENGTH-1 ) + errorexit(X_MACRO_LINE_TOO_LONG, yyline, yyfilename); + + memcpy(yyinline+strlen(yyinline), str ,pos); + + CONTEXT->stringpos = strcspn(str+pos,"\n") + 1; + + memcpy(yyinlinenew, str + pos, CONTEXT->stringpos); + + CONTEXT->stringpos += pos; + + strcpy(yyinline, orginline); + + yyinmacro++; + yyfirstmacroline = TRUE; + + yy_scan_string(str); + + /// Delete parameter list ////////////////////////////////////////////////// + + for(c=0;c<10;c++) + delete parmlist[c]; + delete parmlist; + + /// Allocate new symbol table ////////////////////////////////////////////// + + if(!yyparseno) + { + if(symb -> macsym) + yysymbolstack[yycontext] = symb -> macsym; + else + { + if( !(yysymbolstack[yycontext] = symb -> macsym = new symbolTable()) ) + errorexit(X_OUT_OF_MEMORY); + + if( !symb -> macsym->init(yycfg->casesensitive, 16) ) + errorexit(X_OUT_OF_MEMORY); + } + } + else + yysymbolstack[yycontext] = symb -> macsym; + + if(!yysymbolstack[yycontext]) + internalerror("MA %i", yycontext); + +// yyline++; + + return SKIPRESTART; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Turn listing on/off + // + +void list(int listtype) +{ + switch(listtype) + { + case LIST_NO : yylist = FALSE; break; + case LIST_YES : yylist = TRUE ; break; + case LIST_NO_MACRO : yylistmacro = FALSE; break; + case LIST_YES_MACRO : yylistmacro = TRUE ; break; + default : internalerror("LU %04X",listtype); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Read to end of current context + // + +int doexit(void) +{ + while(yyinput()!=EOF); + yyeol=TRUE; + return restart(); +} + + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/avrlex0.inc b/src/mkutil/tavrasm.118/src/avrlex0.inc new file mode 100644 index 00000000..cea70320 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrlex0.inc @@ -0,0 +1,495 @@ +case 1: +YY_RULE_SETUP +/* #line 116 "avrlex.l" */ +return STAR; + YY_BREAK +case 2: +YY_RULE_SETUP +/* #line 117 "avrlex.l" */ +return DIV; + YY_BREAK +case 3: +YY_RULE_SETUP +/* #line 118 "avrlex.l" */ +return MOD; + YY_BREAK +case 4: +YY_RULE_SETUP +/* #line 119 "avrlex.l" */ +return LS; + YY_BREAK +case 5: +YY_RULE_SETUP +/* #line 120 "avrlex.l" */ +return RS; + YY_BREAK +case 6: +YY_RULE_SETUP +/* #line 121 "avrlex.l" */ +return LE; + YY_BREAK +case 7: +YY_RULE_SETUP +/* #line 122 "avrlex.l" */ +return GE; + YY_BREAK +case 8: +YY_RULE_SETUP +/* #line 123 "avrlex.l" */ +return LESS; + YY_BREAK +case 9: +YY_RULE_SETUP +/* #line 124 "avrlex.l" */ +return GREAT; + YY_BREAK +case 10: +YY_RULE_SETUP +/* #line 125 "avrlex.l" */ +return EQ; + YY_BREAK +case 11: +YY_RULE_SETUP +/* #line 126 "avrlex.l" */ +return NE; + YY_BREAK +case 12: +YY_RULE_SETUP +/* #line 127 "avrlex.l" */ +return OROR; + YY_BREAK +case 13: +YY_RULE_SETUP +/* #line 128 "avrlex.l" */ +return ANDAND; + YY_BREAK +case 14: +YY_RULE_SETUP +/* #line 129 "avrlex.l" */ +return OR; + YY_BREAK +case 15: +YY_RULE_SETUP +/* #line 130 "avrlex.l" */ +return AND; + YY_BREAK +case 16: +YY_RULE_SETUP +/* #line 131 "avrlex.l" */ +return XOR; + YY_BREAK +case 17: +YY_RULE_SETUP +/* #line 132 "avrlex.l" */ +return LPAR; + YY_BREAK +case 18: +YY_RULE_SETUP +/* #line 133 "avrlex.l" */ +return RPAR; + YY_BREAK +case 19: +YY_RULE_SETUP +/* #line 134 "avrlex.l" */ +return COLON; + YY_BREAK +case 20: +YY_RULE_SETUP +/* #line 135 "avrlex.l" */ +return COMMA; + YY_BREAK +case 21: +YY_RULE_SETUP +/* #line 136 "avrlex.l" */ +return DOT; + YY_BREAK +case 22: +YY_RULE_SETUP +/* #line 137 "avrlex.l" */ +return PLUS; + YY_BREAK +case 23: +YY_RULE_SETUP +/* #line 138 "avrlex.l" */ +return MINUS; + YY_BREAK +case 24: +YY_RULE_SETUP +/* #line 139 "avrlex.l" */ +return EQUAL; + YY_BREAK +case 25: +YY_RULE_SETUP +/* #line 140 "avrlex.l" */ +return WAVE; + YY_BREAK +case 26: +YY_RULE_SETUP +/* #line 141 "avrlex.l" */ +return NOT; + YY_BREAK +case 27: +YY_RULE_SETUP +/* #line 143 "avrlex.l" */ +return DEF; + YY_BREAK +case 28: +YY_RULE_SETUP +/* #line 144 "avrlex.l" */ +return EQU; + YY_BREAK +case 29: +YY_RULE_SETUP +/* #line 145 "avrlex.l" */ +return EQU; + YY_BREAK +case 30: +YY_RULE_SETUP +/* #line 146 "avrlex.l" */ +return DB; + YY_BREAK +case 31: +YY_RULE_SETUP +/* #line 147 "avrlex.l" */ +return DW; + YY_BREAK +case 32: +YY_RULE_SETUP +/* #line 148 "avrlex.l" */ +return ORG; + YY_BREAK +case 33: +YY_RULE_SETUP +/* #line 149 "avrlex.l" */ +return BYTE; + YY_BREAK +case 34: +YY_RULE_SETUP +/* #line 150 "avrlex.l" */ +return SET; + YY_BREAK +case 35: +YY_RULE_SETUP +/* #line 151 "avrlex.l" */ +return DEVICE; + YY_BREAK +case 36: +YY_RULE_SETUP +/* #line 153 "avrlex.l" */ +{ yysegment = SEGMENT_CODE; return CSEG; } + YY_BREAK +case 37: +YY_RULE_SETUP +/* #line 154 "avrlex.l" */ +{ yysegment = SEGMENT_DATA; return ESEG; } + YY_BREAK +case 38: +YY_RULE_SETUP +/* #line 155 "avrlex.l" */ +{ yysegment = SEGMENT_EEPROM; return DSEG; } + YY_BREAK +case 39: +YY_RULE_SETUP +/* #line 157 "avrlex.l" */ +{ yylval.func = OP_LOW; return FUNCTION;} + YY_BREAK +case 40: +YY_RULE_SETUP +/* #line 158 "avrlex.l" */ +{ yylval.func = OP_HIGH; return FUNCTION;} + YY_BREAK +case 41: +YY_RULE_SETUP +/* #line 159 "avrlex.l" */ +{ yylval.func = OP_LOW; return FUNCTION;} + YY_BREAK +case 42: +YY_RULE_SETUP +/* #line 160 "avrlex.l" */ +{ yylval.func = OP_BYTE2; return FUNCTION;} + YY_BREAK +case 43: +YY_RULE_SETUP +/* #line 161 "avrlex.l" */ +{ yylval.func = OP_BYTE3; return FUNCTION;} + YY_BREAK +case 44: +YY_RULE_SETUP +/* #line 162 "avrlex.l" */ +{ yylval.func = OP_BYTE4; return FUNCTION;} + YY_BREAK +case 45: +YY_RULE_SETUP +/* #line 163 "avrlex.l" */ +{ yylval.func = OP_LWRD; return FUNCTION;} + YY_BREAK +case 46: +YY_RULE_SETUP +/* #line 164 "avrlex.l" */ +{ yylval.func = OP_HWRD; return FUNCTION;} + YY_BREAK +case 47: +YY_RULE_SETUP +/* #line 165 "avrlex.l" */ +{ yylval.func = OP_PAGE; return FUNCTION;} + YY_BREAK +case 48: +YY_RULE_SETUP +/* #line 166 "avrlex.l" */ +{ yylval.func = OP_EXP2; return FUNCTION;} + YY_BREAK +case 49: +YY_RULE_SETUP +/* #line 167 "avrlex.l" */ +{ yylval.func = OP_LOG2; return FUNCTION;} + YY_BREAK +case 50: +YY_RULE_SETUP +/* #line 168 "avrlex.l" */ +{ yylval.opcode = O_CPC; return IREGREG; } /* Register */ + YY_BREAK +case 51: +YY_RULE_SETUP +/* #line 169 "avrlex.l" */ +{ yylval.opcode = O_CP; return IREGREG; } + YY_BREAK +case 52: +YY_RULE_SETUP +/* #line 170 "avrlex.l" */ +{ yylval.opcode = O_SBC; return IREGREG; } + YY_BREAK +case 53: +YY_RULE_SETUP +/* #line 171 "avrlex.l" */ +{ yylval.opcode = O_SUB; return IREGREG; } + YY_BREAK +case 54: +YY_RULE_SETUP +/* #line 172 "avrlex.l" */ +{ yylval.opcode = O_ADD; return IREGREG; } + YY_BREAK +case 55: +YY_RULE_SETUP +/* #line 173 "avrlex.l" */ +{ yylval.opcode = O_ADC; return IREGREG; } + YY_BREAK +case 56: +YY_RULE_SETUP +/* #line 174 "avrlex.l" */ +{ yylval.opcode = O_CPSE; return IREGREG; } + YY_BREAK +case 57: +YY_RULE_SETUP +/* #line 175 "avrlex.l" */ +{ yylval.opcode = O_AND; return IREGREG; } + YY_BREAK +case 58: +YY_RULE_SETUP +/* #line 176 "avrlex.l" */ +{ yylval.opcode = O_EOR; return IREGREG; } + YY_BREAK +case 59: +YY_RULE_SETUP +/* #line 177 "avrlex.l" */ +{ yylval.opcode = O_OR; return IREGREG; } + YY_BREAK +case 60: +YY_RULE_SETUP +/* #line 178 "avrlex.l" */ +{ yylval.opcode = O_MOV; return IREGREG; } + YY_BREAK +case 61: +YY_RULE_SETUP +/* #line 179 "avrlex.l" */ +{ yylval.opcode = O_MOVW; return IREGREG; } + YY_BREAK +case 62: +YY_RULE_SETUP +/* #line 180 "avrlex.l" */ +{ yylval.opcode = O_MUL; return IREGREG; } + YY_BREAK +case 63: +YY_RULE_SETUP +/* #line 181 "avrlex.l" */ +{ yylval.opcode = O_MULS; return IREGREG; } + YY_BREAK +case 64: +YY_RULE_SETUP +/* #line 182 "avrlex.l" */ +{ yylval.opcode = O_MULSU; return IREGREG; } + YY_BREAK +case 65: +YY_RULE_SETUP +/* #line 183 "avrlex.l" */ +{ yylval.opcode = O_FMUL; return IREGREG; } + YY_BREAK +case 66: +YY_RULE_SETUP +/* #line 184 "avrlex.l" */ +{ yylval.opcode = O_FMULS; return IREGREG; } + YY_BREAK +case 67: +YY_RULE_SETUP +/* #line 185 "avrlex.l" */ +{ yylval.opcode = O_FMULSU; return IREGREG; } + YY_BREAK +case 68: +YY_RULE_SETUP +/* #line 186 "avrlex.l" */ +{ yylval.opcode = O_ADIW; return IREGIMM; } /* Reg/Imm */ + YY_BREAK +case 69: +YY_RULE_SETUP +/* #line 187 "avrlex.l" */ +{ yylval.opcode = O_SBIW; return IREGIMM; } + YY_BREAK +case 70: +YY_RULE_SETUP +/* #line 188 "avrlex.l" */ +{ yylval.opcode = O_CPI; return IREGIMM; } + YY_BREAK +case 71: +YY_RULE_SETUP +/* #line 189 "avrlex.l" */ +{ yylval.opcode = O_SBCI; return IREGIMM; } + YY_BREAK +case 72: +YY_RULE_SETUP +/* #line 190 "avrlex.l" */ +{ yylval.opcode = O_SUBI; return IREGIMM; } + YY_BREAK +case 73: +YY_RULE_SETUP +/* #line 191 "avrlex.l" */ +{ yylval.opcode = O_ORI; return IREGIMM; } + YY_BREAK +case 74: +YY_RULE_SETUP +/* #line 192 "avrlex.l" */ +{ yylval.opcode = O_ANDI; return IREGIMM; } + YY_BREAK +case 75: +YY_RULE_SETUP +/* #line 193 "avrlex.l" */ +{ yylval.opcode = O_LDI; return IREGIMM; } + YY_BREAK +case 76: +YY_RULE_SETUP +/* #line 194 "avrlex.l" */ +{ yylval.opcode = O_LDS; return IREGIMM; } + YY_BREAK +case 77: +YY_RULE_SETUP +/* #line 195 "avrlex.l" */ +{ yylval.opcode = O_SBR; return IREGIMM; } + YY_BREAK +case 78: +YY_RULE_SETUP +/* #line 196 "avrlex.l" */ +{ yylval.opcode = O_BRCC; return IIMM; } /* Immediate */ + YY_BREAK +case 79: +YY_RULE_SETUP +/* #line 197 "avrlex.l" */ +{ yylval.opcode = O_BRCS; return IIMM; } + YY_BREAK +case 80: +YY_RULE_SETUP +/* #line 198 "avrlex.l" */ +{ yylval.opcode = O_BRNE; return IIMM; } + YY_BREAK +case 81: +YY_RULE_SETUP +/* #line 199 "avrlex.l" */ +{ yylval.opcode = O_BREQ; return IIMM; } + YY_BREAK +case 82: +YY_RULE_SETUP +/* #line 200 "avrlex.l" */ +{ yylval.opcode = O_BRPL; return IIMM; } + YY_BREAK +case 83: +YY_RULE_SETUP +/* #line 201 "avrlex.l" */ +{ yylval.opcode = O_BRMI; return IIMM; } + YY_BREAK +case 84: +YY_RULE_SETUP +/* #line 202 "avrlex.l" */ +{ yylval.opcode = O_BRVC; return IIMM; } + YY_BREAK +case 85: +YY_RULE_SETUP +/* #line 203 "avrlex.l" */ +{ yylval.opcode = O_BRVS; return IIMM; } + YY_BREAK +case 86: +YY_RULE_SETUP +/* #line 204 "avrlex.l" */ +{ yylval.opcode = O_BRGE; return IIMM; } + YY_BREAK +case 87: +YY_RULE_SETUP +/* #line 205 "avrlex.l" */ +{ yylval.opcode = O_BRLT; return IIMM; } + YY_BREAK +case 88: +YY_RULE_SETUP +/* #line 206 "avrlex.l" */ +{ yylval.opcode = O_BRHC; return IIMM; } + YY_BREAK +case 89: +YY_RULE_SETUP +/* #line 207 "avrlex.l" */ +{ yylval.opcode = O_BRHS; return IIMM; } + YY_BREAK +case 90: +YY_RULE_SETUP +/* #line 208 "avrlex.l" */ +{ yylval.opcode = O_BRTC; return IIMM; } + YY_BREAK +case 91: +YY_RULE_SETUP +/* #line 209 "avrlex.l" */ +{ yylval.opcode = O_BRTS; return IIMM; } + YY_BREAK +case 92: +YY_RULE_SETUP +/* #line 210 "avrlex.l" */ +{ yylval.opcode = O_BRID; return IIMM; } + YY_BREAK +case 93: +YY_RULE_SETUP +/* #line 211 "avrlex.l" */ +{ yylval.opcode = O_BRIE; return IIMM; } + YY_BREAK +case 94: +YY_RULE_SETUP +/* #line 212 "avrlex.l" */ +{ yylval.opcode = O_BRSH; return IIMM; } + YY_BREAK +case 95: +YY_RULE_SETUP +/* #line 213 "avrlex.l" */ +{ yylval.opcode = O_BRLO; return IIMM; } + YY_BREAK +case 96: +YY_RULE_SETUP +/* #line 214 "avrlex.l" */ +{ yylval.opcode = O_NEG; return IREG; } /* Register */ + YY_BREAK +case 97: +YY_RULE_SETUP +/* #line 215 "avrlex.l" */ +{ yylval.opcode = O_SWAP; return IREG; } + YY_BREAK +case 98: +YY_RULE_SETUP +/* #line 216 "avrlex.l" */ +{ yylval.opcode = O_INC; return IREG; } + YY_BREAK +case 99: +YY_RULE_SETUP +/* #line 217 "avrlex.l" */ +{ yylval.opcode = O_ASR; return IREG; } + YY_BREAK diff --git a/src/mkutil/tavrasm.118/src/avrlex1.inc b/src/mkutil/tavrasm.118/src/avrlex1.inc new file mode 100644 index 00000000..665f2cb0 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrlex1.inc @@ -0,0 +1,495 @@ +case 100: +YY_RULE_SETUP +/* #line 218 "avrlex.l" */ +{ yylval.opcode = O_LSR; return IREG; } + YY_BREAK +case 101: +YY_RULE_SETUP +/* #line 219 "avrlex.l" */ +{ yylval.opcode = O_DEC; return IREG; } + YY_BREAK +case 102: +YY_RULE_SETUP +/* #line 220 "avrlex.l" */ +{ yylval.opcode = O_POP; return IREG; } + YY_BREAK +case 103: +YY_RULE_SETUP +/* #line 221 "avrlex.l" */ +{ yylval.opcode = O_PUSH; return IREG; } + YY_BREAK +case 104: +YY_RULE_SETUP +/* #line 222 "avrlex.l" */ +{ yylval.opcode = O_CLR; return IREG; } + YY_BREAK +case 105: +YY_RULE_SETUP +/* #line 223 "avrlex.l" */ +{ yylval.opcode = O_TST; return IREG; } + YY_BREAK +case 106: +YY_RULE_SETUP +/* #line 224 "avrlex.l" */ +{ yylval.opcode = O_COM; return IREG; } + YY_BREAK +case 107: +YY_RULE_SETUP +/* #line 225 "avrlex.l" */ +{ yylval.opcode = O_ROR; return IREG; } + YY_BREAK +case 108: +YY_RULE_SETUP +/* #line 226 "avrlex.l" */ +{ yylval.opcode = O_SEC; return INOARGS; } /* No arguments */ + YY_BREAK +case 109: +YY_RULE_SETUP +/* #line 227 "avrlex.l" */ +{ yylval.opcode = O_SEZ; return INOARGS; } + YY_BREAK +case 110: +YY_RULE_SETUP +/* #line 228 "avrlex.l" */ +{ yylval.opcode = O_SEN; return INOARGS; } + YY_BREAK +case 111: +YY_RULE_SETUP +/* #line 229 "avrlex.l" */ +{ yylval.opcode = O_SEV; return INOARGS; } + YY_BREAK +case 112: +YY_RULE_SETUP +/* #line 230 "avrlex.l" */ +{ yylval.opcode = O_SES; return INOARGS; } + YY_BREAK +case 113: +YY_RULE_SETUP +/* #line 231 "avrlex.l" */ +{ yylval.opcode = O_SEH; return INOARGS; } + YY_BREAK +case 114: +YY_RULE_SETUP +/* #line 232 "avrlex.l" */ +{ yylval.opcode = O_SET; return INOARGS; } + YY_BREAK +case 115: +YY_RULE_SETUP +/* #line 233 "avrlex.l" */ +{ yylval.opcode = O_SEI; return INOARGS; } + YY_BREAK +case 116: +YY_RULE_SETUP +/* #line 234 "avrlex.l" */ +{ yylval.opcode = O_CLC; return INOARGS; } + YY_BREAK +case 117: +YY_RULE_SETUP +/* #line 235 "avrlex.l" */ +{ yylval.opcode = O_CLZ; return INOARGS; } + YY_BREAK +case 118: +YY_RULE_SETUP +/* #line 236 "avrlex.l" */ +{ yylval.opcode = O_CLN; return INOARGS; } + YY_BREAK +case 119: +YY_RULE_SETUP +/* #line 237 "avrlex.l" */ +{ yylval.opcode = O_CLV; return INOARGS; } + YY_BREAK +case 120: +YY_RULE_SETUP +/* #line 238 "avrlex.l" */ +{ yylval.opcode = O_CLS; return INOARGS; } + YY_BREAK +case 121: +YY_RULE_SETUP +/* #line 239 "avrlex.l" */ +{ yylval.opcode = O_CLH; return INOARGS; } + YY_BREAK +case 122: +YY_RULE_SETUP +/* #line 240 "avrlex.l" */ +{ yylval.opcode = O_CLT; return INOARGS; } + YY_BREAK +case 123: +YY_RULE_SETUP +/* #line 241 "avrlex.l" */ +{ yylval.opcode = O_CLI; return INOARGS; } + YY_BREAK +case 124: +YY_RULE_SETUP +/* #line 242 "avrlex.l" */ +{ yylval.opcode = O_NOP; return INOARGS; } + YY_BREAK +case 125: +YY_RULE_SETUP +/* #line 243 "avrlex.l" */ +{ yylval.opcode = O_ICALL; return INOARGS; } /* Misc. */ + YY_BREAK +case 126: +YY_RULE_SETUP +/* #line 244 "avrlex.l" */ +{ yylval.opcode = O_IJMP; return INOARGS; } + YY_BREAK +case 127: +YY_RULE_SETUP +/* #line 245 "avrlex.l" */ +{ yylval.opcode = O_RETI; return INOARGS; } + YY_BREAK +case 128: +YY_RULE_SETUP +/* #line 246 "avrlex.l" */ +{ yylval.opcode = O_RET; return INOARGS; } + YY_BREAK +case 129: +YY_RULE_SETUP +/* #line 247 "avrlex.l" */ +{ yylval.opcode = O_SLEEP; return INOARGS; } + YY_BREAK +case 130: +YY_RULE_SETUP +/* #line 248 "avrlex.l" */ +{ yylval.opcode = O_WDR; return INOARGS; } + YY_BREAK +case 131: +YY_RULE_SETUP +/* #line 249 "avrlex.l" */ +{ yylval.opcode = O_EIJMP; return INOARGS; } + YY_BREAK +case 132: +YY_RULE_SETUP +/* #line 250 "avrlex.l" */ +{ yylval.opcode = O_EICALL; return INOARGS; } + YY_BREAK +case 133: +YY_RULE_SETUP +/* #line 251 "avrlex.l" */ +{ yylval.opcode = O_SPM; return INOARGS; } + YY_BREAK +case 134: +YY_RULE_SETUP +/* #line 252 "avrlex.l" */ +{ yylval.opcode = O_ESPM; return INOARGS; } + YY_BREAK +case 135: +YY_RULE_SETUP +/* #line 253 "avrlex.l" */ +{ yylval.opcode = O_BCLR; return IIMM; } + YY_BREAK +case 136: +YY_RULE_SETUP +/* #line 254 "avrlex.l" */ +{ yylval.opcode = O_BSET; return IIMM; } + YY_BREAK +case 137: +YY_RULE_SETUP +/* #line 255 "avrlex.l" */ +{ yylval.opcode = O_RCALL; return IIMM; } + YY_BREAK +case 138: +YY_RULE_SETUP +/* #line 256 "avrlex.l" */ +{ yylval.opcode = O_RJMP; return IIMM; } + YY_BREAK +case 139: +YY_RULE_SETUP +/* #line 257 "avrlex.l" */ +{ yylval.opcode = O_JMP; return IIMM; } + YY_BREAK +case 140: +YY_RULE_SETUP +/* #line 258 "avrlex.l" */ +{ yylval.opcode = O_CALL; return IIMM; } + YY_BREAK +case 141: +YY_RULE_SETUP +/* #line 259 "avrlex.l" */ +{ yylval.opcode = O_BRBC; return IIMMIMM; } + YY_BREAK +case 142: +YY_RULE_SETUP +/* #line 260 "avrlex.l" */ +{ yylval.opcode = O_BRBS; return IIMMIMM; } + YY_BREAK +case 143: +YY_RULE_SETUP +/* #line 261 "avrlex.l" */ +{ yylval.opcode = O_CBI; return IIMMIMM; } + YY_BREAK +case 144: +YY_RULE_SETUP +/* #line 262 "avrlex.l" */ +{ yylval.opcode = O_SBI; return IIMMIMM; } + YY_BREAK +case 145: +YY_RULE_SETUP +/* #line 263 "avrlex.l" */ +{ yylval.opcode = O_SBIC; return IIMMIMM; } + YY_BREAK +case 146: +YY_RULE_SETUP +/* #line 264 "avrlex.l" */ +{ yylval.opcode = O_SBIS; return IIMMIMM; } + YY_BREAK +case 147: +YY_RULE_SETUP +/* #line 265 "avrlex.l" */ +{ yylval.opcode = O_OUT; return IIMMREG; } + YY_BREAK +case 148: +YY_RULE_SETUP +/* #line 266 "avrlex.l" */ +{ yylval.opcode = O_STS; return IIMMREG; } + YY_BREAK +case 149: +YY_RULE_SETUP +/* #line 267 "avrlex.l" */ +{ yylval.opcode = O_ROL; return IREG; } + YY_BREAK +case 150: +YY_RULE_SETUP +/* #line 268 "avrlex.l" */ +{ yylval.opcode = O_SER; return IREG; } + YY_BREAK +case 151: +YY_RULE_SETUP +/* #line 269 "avrlex.l" */ +{ yylval.opcode = O_LSL; return IREG; } + YY_BREAK +case 152: +YY_RULE_SETUP +/* #line 270 "avrlex.l" */ +{ yylval.opcode = O_BLD; return IREGIMM; } + YY_BREAK +case 153: +YY_RULE_SETUP +/* #line 271 "avrlex.l" */ +{ yylval.opcode = O_BST; return IREGIMM; } + YY_BREAK +case 154: +YY_RULE_SETUP +/* #line 272 "avrlex.l" */ +{ yylval.opcode = O_CBR; return IREGIMM; } + YY_BREAK +case 155: +YY_RULE_SETUP +/* #line 273 "avrlex.l" */ +{ yylval.opcode = O_IN; return IREGIMM; } + YY_BREAK +case 156: +YY_RULE_SETUP +/* #line 274 "avrlex.l" */ +{ yylval.opcode = O_SBRC; return IREGIMM; } + YY_BREAK +case 157: +YY_RULE_SETUP +/* #line 275 "avrlex.l" */ +{ yylval.opcode = O_SBRS; return IREGIMM; } + YY_BREAK +case 158: +YY_RULE_SETUP +/* #line 276 "avrlex.l" */ +{ yylval.opcode = O_LD; return IINDIRC; } + YY_BREAK +case 159: +YY_RULE_SETUP +/* #line 277 "avrlex.l" */ +{ yylval.opcode = O_ST; return IINDIRC; } + YY_BREAK +case 160: +YY_RULE_SETUP +/* #line 278 "avrlex.l" */ +{ yylval.opcode = O_LDD; return IINDIRC; } + YY_BREAK +case 161: +YY_RULE_SETUP +/* #line 279 "avrlex.l" */ +{ yylval.opcode = O_STD; return IINDIRC; } + YY_BREAK +case 162: +YY_RULE_SETUP +/* #line 280 "avrlex.l" */ +{ yylval.regid = 26; return REGXYZ; } + YY_BREAK +case 163: +YY_RULE_SETUP +/* #line 281 "avrlex.l" */ +{ yylval.regid = 28; return REGXYZ; } + YY_BREAK +case 164: +YY_RULE_SETUP +/* #line 282 "avrlex.l" */ +{ yylval.regid = 30; return REGXYZ; } + YY_BREAK +case 165: +YY_RULE_SETUP +/* #line 283 "avrlex.l" */ +{ yylval.opcode = O_LPM; return ILPM; } + YY_BREAK +case 166: +YY_RULE_SETUP +/* #line 284 "avrlex.l" */ +{ yylval.opcode = O_ELPM; return ILPM; } + YY_BREAK +case 167: +YY_RULE_SETUP +/* #line 286 "avrlex.l" */ +{ yylval.val.value=yycodepos/2;yylval.val.valid=TRUE; return COUNTER;} + YY_BREAK +case 168: +YY_RULE_SETUP +/* #line 287 "avrlex.l" */ +{ yylval.val.value=yydatapos; yylval.val.valid=TRUE; return COUNTER;} + YY_BREAK +case 169: +YY_RULE_SETUP +/* #line 288 "avrlex.l" */ +{ yylval.val.value=yyerompos; yylval.val.valid=TRUE; return COUNTER;} + YY_BREAK +case 170: +YY_RULE_SETUP +/* #line 290 "avrlex.l" */ +list(LIST_NO_MACRO); + YY_BREAK +case 171: +YY_RULE_SETUP +/* #line 291 "avrlex.l" */ +list(LIST_NO); + YY_BREAK +case 172: +YY_RULE_SETUP +/* #line 292 "avrlex.l" */ +list(LIST_YES_MACRO); + YY_BREAK +case 173: +YY_RULE_SETUP +/* #line 293 "avrlex.l" */ +list(LIST_YES); + YY_BREAK +case 174: +YY_RULE_SETUP +/* #line 294 "avrlex.l" */ +yyeol=TRUE; if((ret=doexit() )!=SKIPRESTART) return ret; + YY_BREAK +case 175: +YY_RULE_SETUP +/* #line 295 "avrlex.l" */ +if(includefile()==EOL) return EOL; + YY_BREAK +case 176: +YY_RULE_SETUP +/* #line 296 "avrlex.l" */ +return macrodef(); + YY_BREAK +case 177: +YY_RULE_SETUP +/* #line 297 "avrlex.l" */ +errorin(E_ENDM); + YY_BREAK +case 178: +YY_RULE_SETUP +/* #line 298 "avrlex.l" */ +return string(); + YY_BREAK +case 179: +YY_RULE_SETUP +/* #line 299 "avrlex.l" */ +return registers(); + YY_BREAK +case 180: +YY_RULE_SETUP +/* #line 300 "avrlex.l" */ +return integers(); + YY_BREAK +case 181: +YY_RULE_SETUP +/* #line 301 "avrlex.l" */ +return integers(); + YY_BREAK +case 182: +YY_RULE_SETUP +/* #line 302 "avrlex.l" */ +return integers(); + YY_BREAK +case 183: +YY_RULE_SETUP +/* #line 303 "avrlex.l" */ +return integers(); + YY_BREAK +case 184: +YY_RULE_SETUP +/* #line 304 "avrlex.l" */ +return integers(); + YY_BREAK +case 185: +YY_RULE_SETUP +/* #line 305 "avrlex.l" */ +return character(); + YY_BREAK +case 186: +YY_RULE_SETUP +/* #line 306 "avrlex.l" */ +warningin(W_HEX_ESCAPE_INVALID);yylval.val.valid = TRUE;yylval.val.value = 0; return INTEGER; + YY_BREAK +case 187: +YY_RULE_SETUP +/* #line 307 "avrlex.l" */ +return character(); + YY_BREAK +case 188: +YY_RULE_SETUP +/* #line 308 "avrlex.l" */ +warningin(W_OCT_ESCAPE_INVALID);yylval.val.valid = TRUE;yylval.val.value = 0; return INTEGER; + YY_BREAK +case 189: +YY_RULE_SETUP +/* #line 309 "avrlex.l" */ +return character(); + YY_BREAK +case 190: +YY_RULE_SETUP +/* #line 310 "avrlex.l" */ +return character(); + YY_BREAK +case 191: +YY_RULE_SETUP +/* #line 311 "avrlex.l" */ +if((ret=identifier())!=SKIPRESTART)return ret; + YY_BREAK +case 192: +YY_RULE_SETUP +/* #line 313 "avrlex.l" */ +yyeol=TRUE; return endofline(); + YY_BREAK +case 193: +YY_RULE_SETUP +/* #line 314 "avrlex.l" */ +; + YY_BREAK +case 194: +YY_RULE_SETUP +/* #line 315 "avrlex.l" */ +; + YY_BREAK +case 195: +YY_RULE_SETUP +/* #line 316 "avrlex.l" */ +; + YY_BREAK +case 196: +YY_RULE_SETUP +/* #line 317 "avrlex.l" */ +; + YY_BREAK +case 197: +YY_RULE_SETUP +/* #line 318 "avrlex.l" */ +illegal(); + YY_BREAK +case 198: +YY_RULE_SETUP +/* #line 320 "avrlex.l" */ +ECHO; + YY_BREAK diff --git a/src/mkutil/tavrasm.118/src/avrparse.cc b/src/mkutil/tavrasm.118/src/avrparse.cc new file mode 100644 index 00000000..4328041a --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrparse.cc @@ -0,0 +1,1753 @@ +/* A Bison parser, made from avrparse.y + by GNU bison 1.35. */ + +#define YYBISON 1 /* Identify Bison output. */ + +# define STAR 257 +# define DIV 258 +# define MOD 259 +# define LS 260 +# define RS 261 +# define LE 262 +# define GE 263 +# define LESS 264 +# define GREAT 265 +# define EQ 266 +# define NE 267 +# define OR 268 +# define XOR 269 +# define AND 270 +# define OROR 271 +# define ANDAND 272 +# define LPAR 273 +# define RPAR 274 +# define COLON 275 +# define COMMA 276 +# define DOT 277 +# define EQUAL 278 +# define PLUS 279 +# define MINUS 280 +# define WAVE 281 +# define NOT 282 +# define EOL 283 +# define RESTART 284 +# define ENDOFFILE 285 +# define DEF 286 +# define EQU 287 +# define DB 288 +# define DW 289 +# define ORG 290 +# define CSEG 291 +# define DSEG 292 +# define ESEG 293 +# define BYTE 294 +# define SET 295 +# define DEVICE 296 +# define STRING 297 +# define MACRODEF 298 +# define REGISTER 299 +# define REGXYZ 300 +# define SYMBOL 301 +# define INTEGER 302 +# define COUNTER 303 +# define FUNCTION 304 +# define IREGREG 305 +# define IIMMIMM 306 +# define IREGIMM 307 +# define IIMMREG 308 +# define IREG 309 +# define IIMM 310 +# define INOARGS 311 +# define IINDIRC 312 +# define ILPM 313 + +/* #line 43 "avrparse.y" */ + + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#ifdef _MSC_VER /* Nick */ +#include +#else +#include +#endif +#include "avrasm.hh" +#include "symbol.hh" +#include "semantic.hh" +#include "utils.hh" + +/// Extern /////////////////////////////////////////////////////////////////// + +GLOBALS(extern); +extern char *yytext; + +/// Prototypes /////////////////////////////////////////////////////////////// + +int yylex(); + +/// yyerror ////////////////////////////////////////////////////////////////// + +void yyerror(char *s) +{ + s = s; // Used for debugging purposes +} + +/// Start of grammar ///////////////////////////////////////////////////////// + + +/* #line 77 "avrparse.y" */ +#ifndef YYSTYPE +typedef union +{ + regSA regid; + instSA inst; + opcodeSA opcode; + valueSA val; + nameSA name; + symbolSA symb; + indirectSA indi; + functionSA func; + stringSA string; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + + + +#define YYFINAL 223 +#define YYFLAG -32768 +#define YYNTBASE 60 + +/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ +#define YYTRANSLATE(x) ((unsigned)(x) <= 313 ? yytranslate[x] : 89) + +/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ +static const char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59 +}; + +#if YYDEBUG +static const short yyprhs[] = +{ + 0, 0, 4, 5, 8, 10, 13, 16, 19, 21, + 24, 30, 36, 42, 48, 52, 56, 59, 65, 71, + 73, 77, 81, 85, 89, 93, 97, 101, 105, 108, + 114, 118, 120, 122, 125, 127, 133, 139, 145, 146, + 151, 152, 157, 161, 164, 167, 170, 174, 180, 182, + 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, + 226, 230, 233, 235, 238, 242, 246, 248, 250, 252, + 256, 258, 260, 262, 264, 266, 270, 275, 278, 281, + 284, 286, 288, 292, 296, 300, 302, 306, 310, 312, + 316, 320, 322, 326, 330, 334, 338, 340, 344, 348, + 350, 354, 356, 360, 362, 366, 368, 372, 374, 378 +}; +static const short yyrhs[] = +{ + 62, 30, 62, 0, 0, 62, 63, 0, 63, 0, + 67, 64, 0, 67, 29, 0, 67, 68, 0, 29, + 0, 1, 29, 0, 51, 66, 22, 66, 29, 0, + 53, 66, 22, 75, 29, 0, 54, 75, 22, 66, + 29, 0, 52, 75, 22, 75, 29, 0, 56, 75, + 29, 0, 55, 66, 29, 0, 57, 29, 0, 58, + 66, 22, 71, 29, 0, 58, 71, 22, 66, 29, + 0, 65, 0, 51, 1, 29, 0, 53, 1, 29, + 0, 54, 1, 29, 0, 52, 1, 29, 0, 56, + 1, 29, 0, 55, 1, 29, 0, 57, 1, 29, + 0, 58, 1, 29, 0, 59, 29, 0, 59, 66, + 22, 71, 29, 0, 59, 1, 29, 0, 45, 0, + 47, 0, 47, 21, 0, 61, 0, 32, 47, 24, + 45, 29, 0, 32, 47, 24, 47, 29, 0, 33, + 47, 24, 75, 29, 0, 0, 34, 69, 72, 29, + 0, 0, 35, 70, 74, 29, 0, 36, 75, 29, + 0, 37, 29, 0, 38, 29, 0, 39, 29, 0, + 40, 75, 29, 0, 41, 47, 24, 75, 29, 0, + 44, 0, 42, 47, 29, 0, 32, 1, 29, 0, + 33, 1, 29, 0, 34, 1, 29, 0, 35, 1, + 29, 0, 36, 1, 29, 0, 37, 1, 29, 0, + 38, 1, 29, 0, 39, 1, 29, 0, 40, 1, + 29, 0, 41, 1, 29, 0, 42, 1, 29, 0, + 26, 46, 0, 46, 0, 46, 25, 0, 46, 25, + 75, 0, 72, 22, 73, 0, 73, 0, 43, 0, + 75, 0, 74, 22, 75, 0, 75, 0, 88, 0, + 48, 0, 49, 0, 47, 0, 19, 75, 20, 0, + 50, 19, 75, 20, 0, 26, 77, 0, 27, 77, + 0, 28, 77, 0, 76, 0, 77, 0, 78, 3, + 77, 0, 78, 4, 77, 0, 78, 5, 77, 0, + 78, 0, 79, 25, 78, 0, 79, 26, 78, 0, + 79, 0, 80, 6, 79, 0, 80, 7, 79, 0, + 80, 0, 81, 10, 80, 0, 81, 11, 80, 0, + 81, 8, 80, 0, 81, 9, 80, 0, 81, 0, + 82, 12, 81, 0, 82, 13, 81, 0, 82, 0, + 83, 16, 82, 0, 83, 0, 84, 15, 83, 0, + 84, 0, 85, 14, 84, 0, 85, 0, 86, 18, + 85, 0, 86, 0, 87, 17, 86, 0, 87, 0 +}; + +#endif + +#if YYDEBUG +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const short yyrline[] = +{ + 0, 173, 176, 190, 191, 204, 205, 206, 207, 211, + 245, 247, 249, 251, 253, 255, 257, 259, 261, 264, + 268, 269, 270, 271, 272, 273, 274, 275, 288, 290, + 295, 308, 309, 331, 332, 357, 358, 359, 360, 360, + 361, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 401, 403, 405, 407, 426, 427, 430, 431, 434, + 435, 448, 451, 452, 453, 462, 464, 468, 469, 470, + 471, 474, 475, 477, 479, 483, 484, 486, 490, 491, + 493, 497, 498, 500, 502, 504, 508, 509, 511, 515, + 516, 520, 521, 525, 526, 530, 531, 535, 536, 540 +}; +#endif + + +#if (YYDEBUG) || defined YYERROR_VERBOSE + +/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ +static const char *const yytname[] = +{ + "$", "error", "$undefined.", "STAR", "DIV", "MOD", "LS", "RS", "LE", "GE", + "LESS", "GREAT", "EQ", "NE", "OR", "XOR", "AND", "OROR", "ANDAND", + "LPAR", "RPAR", "COLON", "COMMA", "DOT", "EQUAL", "PLUS", "MINUS", + "WAVE", "NOT", "EOL", "RESTART", "ENDOFFILE", "DEF", "EQU", "DB", "DW", + "ORG", "CSEG", "DSEG", "ESEG", "BYTE", "SET", "DEVICE", "STRING", + "MACRODEF", "REGISTER", "REGXYZ", "SYMBOL", "INTEGER", "COUNTER", + "FUNCTION", "IREGREG", "IIMMIMM", "IREGIMM", "IIMMREG", "IREG", "IIMM", + "INOARGS", "IINDIRC", "ILPM", "program", "e", "programlist", + "programelement", "instruction", "lpminst", "registername", "label", + "directive", "@1", "@2", "indirectaddr", "byteexprlist", "byteelement", + "wordexprlist", "expr", "primary_expr", "unary_expr", "mult_expr", + "additive_expr", "shift_expr", "relational_expr", "equality_expr", + "AND_expression", "exclusive_OR", "inclusive_OR", "logical_AND", + "logical_OR", "composite_expr", 0 +}; +#endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const short yyr1[] = +{ + 0, 60, 61, 62, 62, 63, 63, 63, 63, 63, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, + 65, 66, 66, 67, 67, 68, 68, 68, 69, 68, + 70, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 71, 71, 71, 71, 72, 72, 73, 73, 74, + 74, 75, 76, 76, 76, 76, 76, 77, 77, 77, + 77, 78, 78, 78, 78, 79, 79, 79, 80, 80, + 80, 81, 81, 81, 81, 81, 82, 82, 82, 83, + 83, 84, 84, 85, 85, 86, 86, 87, 87, 88 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const short yyr2[] = +{ + 0, 3, 0, 2, 1, 2, 2, 2, 1, 2, + 5, 5, 5, 5, 3, 3, 2, 5, 5, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, + 3, 1, 1, 2, 1, 5, 5, 5, 0, 4, + 0, 4, 3, 2, 2, 2, 3, 5, 1, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 1, 2, 3, 3, 1, 1, 1, 3, + 1, 1, 1, 1, 1, 3, 4, 2, 2, 2, + 1, 1, 3, 3, 3, 1, 3, 3, 1, 3, + 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1 +}; + +/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ +static const short yydefact[] = +{ + 0, 0, 8, 0, 34, 0, 4, 0, 9, 33, + 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 19, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 74, 72, 73, 0, 0, 80, 81, 85, 88, + 91, 96, 99, 101, 103, 105, 107, 109, 71, 0, + 43, 0, 44, 0, 45, 0, 0, 0, 0, 0, + 0, 0, 31, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 16, 0, 0, 62, + 0, 0, 0, 28, 0, 50, 0, 51, 0, 52, + 67, 0, 66, 68, 53, 0, 70, 54, 0, 77, + 78, 79, 0, 42, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 55, 56, 57, 58, 46, 59, 0, 60, + 49, 20, 0, 23, 0, 21, 0, 22, 0, 25, + 15, 24, 14, 26, 27, 61, 63, 0, 0, 30, + 0, 0, 0, 0, 0, 39, 0, 41, 75, 0, + 82, 83, 84, 86, 87, 89, 90, 94, 95, 92, + 93, 97, 98, 100, 102, 104, 106, 108, 0, 0, + 0, 0, 0, 64, 0, 0, 0, 35, 36, 37, + 65, 69, 76, 47, 10, 13, 11, 12, 17, 18, + 29, 0, 0, 0 +}; + +static const short yydefgoto[] = +{ + 221, 4, 5, 6, 34, 35, 84, 7, 36, 43, + 45, 101, 111, 112, 115, 113, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68 +}; + +static const short yypact[] = +{ + 170, -19,-32768, -16,-32768, 128,-32768, 289,-32768,-32768, + 170,-32768,-32768, 32, 33, 59, 96, 212, 34, 75, + 88, 217, 37, 63,-32768, 43, 229, 56, 262, 73, + 267, 98, 36, 30,-32768,-32768,-32768, 14, -8, 12, + 13, 21, 66, 256, 71, 223, 87, 223, 223, 223, + 223,-32768,-32768,-32768, 100, 92,-32768,-32768, 130, 115, + 141, 15, 138, 109, 113, 116, 118, 121,-32768, 125, + -32768, 147,-32768, 148,-32768, 149, 159, 160, 166, 162, + 163, 164,-32768,-32768, 172, 167, 173, 168, 176, 171, + 179, 186, 187, 190, 191, 203,-32768, 204, 188, 210, + 215, 219, 218,-32768, 224,-32768, -6,-32768, 223,-32768, + -32768, -10,-32768,-32768,-32768, -2,-32768,-32768, 232,-32768, + -32768,-32768, 223,-32768, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223,-32768,-32768,-32768,-32768,-32768,-32768, 223,-32768, + -32768,-32768, 51,-32768, 223,-32768, 223,-32768, 51,-32768, + -32768,-32768,-32768,-32768,-32768,-32768, 223, -24, 51,-32768, + -24, 225, 240, 245, 256,-32768, 223,-32768,-32768, 233, + -32768,-32768,-32768, 130, 130, 115, 115, 141, 141, 141, + 141, 15, 15, 138, 109, 113, 116, 118, 251, 258, + 263, 268, 269,-32768, 271, 272, 273,-32768,-32768,-32768, + -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + -32768, 285, 291,-32768 +}; + +static const short yypgoto[] = +{ + -32768,-32768, 248, 3,-32768,-32768, -26,-32768,-32768,-32768, + -32768, -138,-32768, 122,-32768, -17,-32768, -32, 25, 26, + -20, 38, 182, 169, 174, 180, 193,-32768,-32768 +}; + + +#define YYLAST 348 + + +static const short yytable[] = +{ + 55, 88, 98, 92, 76, 9, 100, 104, 11, 86, + 8, 90, 174, 94, -1, 1, 119, 120, 121, 175, + 176, 105, 99, 131, 132, 133, 134, 177, 116, 204, + 118, 102, 206, 38, 40, 69, 106, 97, 77, 171, + 11, 172, 107, 2, 81, 108, -2, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -2, 87, -2, 103, + 42, 3, 98, 70, 79, -2, -2, -2, -2, -2, + -2, -2, -2, -2, 91, 82, 71, 83, -38, 39, + 41, 82, 99, 83, 78, -38, -38, -38, 82, 73, + 83, 173, 180, 181, 182, 109, 82, 44, 83, 95, + 114, 82, -38, 83, 72, 179, -38, -38, -38, -38, + 80, 187, 188, 189, 190, -40, 117, 74, 82, 122, + 83, 123, -40, -40, -40, 137, 199, 96, 138, 1, + 139, 198, 202, 124, 125, 126, 140, 200, 141, 201, + 127, 128, 205, -40, -40, -40, -40, 129, 130, 203, + 135, 136, 183, 184, 142, 185, 186, 2, 10, 211, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, + -2, 1, -2, 191, 192, 3, 143, 144, 145, -2, + -2, -2, -2, -2, -2, -2, -2, -2, 146, 147, + 148, 149, 150, 151, 152, 154, 153, 155, 156, 2, + 157, 158, -2, -2, -2, -2, -2, -2, -2, -2, + -2, -2, -2, 46, -2, 159, 160, 3, 75, 161, + 162, -2, -2, -2, -2, -2, -2, -2, -2, -2, + 85, 47, 163, 164, 165, 166, 47, 167, 48, 49, + 50, 168, 47, 48, 49, 50, 170, 169, 47, 48, + 49, 50, 178, 212, 207, 48, 49, 50, 37, 51, + 52, 53, 54, 89, 51, 52, 53, 54, 93, 208, + 51, 52, 53, 54, 209, 47, 51, 52, 53, 54, + 213, 47, 48, 49, 50, 222, 47, 214, 48, 49, + 50, 223, 215, 48, 49, 50, 210, 216, 217, 110, + 218, 219, 220, 51, 52, 53, 54, 194, 0, 51, + 52, 53, 54, 195, 51, 52, 53, 54, 12, 193, + 196, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 0, 24, 197, 0, 0, 0, 0, 0, + 25, 26, 27, 28, 29, 30, 31, 32, 33 +}; + +static const short yycheck[] = +{ + 17, 27, 26, 29, 21, 21, 32, 33, 5, 26, + 29, 28, 22, 30, 0, 1, 48, 49, 50, 29, + 22, 29, 46, 8, 9, 10, 11, 29, 45, 167, + 47, 1, 170, 1, 1, 1, 24, 1, 1, 45, + 37, 47, 29, 29, 1, 24, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 1, 44, 29, + 1, 47, 26, 29, 1, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 1, 45, 1, 47, 19, 47, + 47, 45, 46, 47, 47, 26, 27, 28, 45, 1, + 47, 108, 124, 125, 126, 29, 45, 1, 47, 1, + 29, 45, 43, 47, 29, 122, 47, 48, 49, 50, + 47, 131, 132, 133, 134, 19, 29, 29, 45, 19, + 47, 29, 26, 27, 28, 16, 152, 29, 15, 1, + 14, 148, 158, 3, 4, 5, 18, 154, 17, 156, + 25, 26, 168, 47, 48, 49, 50, 6, 7, 166, + 12, 13, 127, 128, 29, 129, 130, 29, 30, 176, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 1, 44, 135, 136, 47, 29, 29, 29, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 29, 29, + 24, 29, 29, 29, 22, 22, 29, 29, 22, 29, + 29, 22, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 1, 44, 29, 29, 47, 1, 29, + 29, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 1, 19, 29, 29, 46, 25, 19, 22, 26, 27, + 28, 22, 19, 26, 27, 28, 22, 29, 19, 26, + 27, 28, 20, 20, 29, 26, 27, 28, 10, 47, + 48, 49, 50, 1, 47, 48, 49, 50, 1, 29, + 47, 48, 49, 50, 29, 19, 47, 48, 49, 50, + 29, 19, 26, 27, 28, 0, 19, 29, 26, 27, + 28, 0, 29, 26, 27, 28, 174, 29, 29, 43, + 29, 29, 29, 47, 48, 49, 50, 138, -1, 47, + 48, 49, 50, 139, 47, 48, 49, 50, 29, 137, + 140, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, -1, 44, 141, -1, -1, -1, -1, -1, + 51, 52, 53, 54, 55, 56, 57, 58, 59 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +/* #line 3 "/usr/share/bison/bison.simple" */ + +/* Skeleton output parser for bison, + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser when + the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#if 1 /* Nick */ +void *yy_flex_alloc( unsigned long size ); +void yy_flex_free( void *ptr ); +#define YYSTACK_ALLOC yy_flex_alloc +#define YYSTACK_FREE yy_flex_free +#else +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +#endif +# endif +#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; +# if YYLSP_NEEDED + YYLTYPE yyls; +# endif +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# if YYLSP_NEEDED +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) +# else +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) +# endif + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up"); \ + YYERROR; \ + } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). + + When YYLLOC_DEFAULT is run, CURRENT is set the location of the + first token. By default, to implement support for ranges, extend + its range to the last symbol. */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#if YYPURE +# if YYLSP_NEEDED +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval, &yylloc) +# endif +# else /* !YYLSP_NEEDED */ +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval) +# endif +# endif /* !YYLSP_NEEDED */ +#else /* !YYPURE */ +# define YYLEX yylex () +#endif /* !YYPURE */ + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#if YYMAXDEPTH == 0 +# undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + +#ifdef YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif +#endif + +/* #line 315 "/usr/share/bison/bison.simple" */ + + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +# define YYPARSE_PARAM_DECL +# else +# define YYPARSE_PARAM_ARG YYPARSE_PARAM +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +# endif +#else /* !YYPARSE_PARAM */ +# define YYPARSE_PARAM_ARG +# define YYPARSE_PARAM_DECL +#endif /* !YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +# ifdef YYPARSE_PARAM +int yyparse (void *); +# else +int yyparse (void); +# endif +#endif + +/* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + +#define YY_DECL_NON_LSP_VARIABLES \ +/* The lookahead symbol. */ \ +int yychar; \ + \ +/* The semantic value of the lookahead symbol. */ \ +YYSTYPE yylval; \ + \ +/* Number of parse errors so far. */ \ +int yynerrs; + +#if YYLSP_NEEDED +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES \ + \ +/* Location data for the lookahead symbol. */ \ +YYLTYPE yylloc; +#else +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES +#endif + + +/* If nonreentrant, generate the variables here. */ + +#if !YYPURE +YY_DECL_VARIABLES +#endif /* !YYPURE */ + +int +yyparse (YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + /* If reentrant, generate the variables here. */ +#if YYPURE + YY_DECL_VARIABLES +#endif /* !YYPURE */ + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yychar1 = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; + register short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + +#if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; +#endif + +#if YYLSP_NEEDED +# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +# define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + YYSIZE_T yystacksize = YYINITDEPTH; + + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; +#if YYLSP_NEEDED + YYLTYPE yyloc; +#endif + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; +#if YYLSP_NEEDED + yylsp = yyls; +#endif + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. */ +# if YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; +# else + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); +# endif + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + goto yyoverflowlab; + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); +# if YYLSP_NEEDED + YYSTACK_RELOCATE (yyls); +# endif +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; +#if YYLSP_NEEDED + yylsp = yyls + yysize - 1; +#endif + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yychar1 = YYTRANSLATE (yychar); + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables + which are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + YYFPRINTF (stderr, "Next token is %d (%s", + yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise + meaning of a token, for further debugging info. */ +# ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +# endif + YYFPRINTF (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %d (%s), ", + yychar, yytname[yychar1])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#if YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to the semantic value of + the lookahead token. This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + +#if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); +#endif + +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables which + are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + switch (yyn) { + +case 5: +/* #line 204 "avrparse.y" */ +{ tolog(); ; + break;} +case 6: +/* #line 205 "avrparse.y" */ +{ tolog(); ; + break;} +case 7: +/* #line 206 "avrparse.y" */ +{ tolog(); ; + break;} +case 8: +/* #line 207 "avrparse.y" */ +{ tolog(); ; + break;} +case 9: +/* #line 211 "avrparse.y" */ +{ error(E_UNKNOWN_OPCODE); tolog(); ; + break;} +case 10: +/* #line 246 "avrparse.y" */ +{genRegReg(yyvsp[-4].opcode, yyvsp[-3].regid, yyvsp[-1].regid);; + break;} +case 11: +/* #line 248 "avrparse.y" */ +{genRegImm(yyvsp[-4].opcode, yyvsp[-3].regid, &yyvsp[-1].val);; + break;} +case 12: +/* #line 250 "avrparse.y" */ +{genImmReg(yyvsp[-4].opcode, &yyvsp[-3].val, yyvsp[-1].regid);; + break;} +case 13: +/* #line 252 "avrparse.y" */ +{genImmImm(yyvsp[-4].opcode, &yyvsp[-3].val, &yyvsp[-1].val);; + break;} +case 14: +/* #line 254 "avrparse.y" */ +{genImmedi(yyvsp[-2].opcode, &yyvsp[-1].val);; + break;} +case 15: +/* #line 256 "avrparse.y" */ +{genRegist(yyvsp[-2].opcode, yyvsp[-1].regid);; + break;} +case 16: +/* #line 258 "avrparse.y" */ +{genNoargs(yyvsp[-1].opcode);; + break;} +case 17: +/* #line 260 "avrparse.y" */ +{genIndirc(yyvsp[-4].opcode, &yyvsp[-1].indi, yyvsp[-3].regid,TRUE);; + break;} +case 18: +/* #line 262 "avrparse.y" */ +{genIndirc(yyvsp[-4].opcode, &yyvsp[-3].indi, yyvsp[-1].regid);; + break;} +case 20: +/* #line 268 "avrparse.y" */ +{ error(E_REGISTER_EXPECTED); ; + break;} +case 21: +/* #line 269 "avrparse.y" */ +{ error(E_INVALID_REGIMM_SPEC); ; + break;} +case 22: +/* #line 270 "avrparse.y" */ +{ error(E_INVALID_REGIMM_SPEC); ; + break;} +case 23: +/* #line 271 "avrparse.y" */ +{ error(E_INVALID_IMMEDIATE_SPEC); ; + break;} +case 24: +/* #line 272 "avrparse.y" */ +{ error(E_INVALID_IMMEDIATE_SPEC); ; + break;} +case 25: +/* #line 273 "avrparse.y" */ +{ error(E_INVALID_REGISTER_SPEC); ; + break;} +case 26: +/* #line 274 "avrparse.y" */ +{ error(E_NOARGS_EXPECTED_SPEC); ; + break;} +case 27: +/* #line 275 "avrparse.y" */ +{ error(E_INVALID_REGISTER_SPEC); ; + break;} +case 28: +/* #line 289 "avrparse.y" */ +{ genLpm(yyvsp[-1].opcode, 0, NULL, FALSE); ; + break;} +case 29: +/* #line 291 "avrparse.y" */ +{ genLpm(yyvsp[-4].opcode, yyvsp[-3].regid, &yyvsp[-1].indi, TRUE); ; + break;} +case 30: +/* #line 295 "avrparse.y" */ +{ error(E_INVALID_REGISTER_SPEC); ; + break;} +case 32: +/* #line 310 "avrparse.y" */ +{ if(yyvsp[0].symb->isdefine) + yyval.regid=yyvsp[0].symb->reg; + else + { + yyval.regid=-1; + errorin(E_INVALID_REGISTER_SPEC); + } + ; + break;} +case 33: +/* #line 331 "avrparse.y" */ +{ doLab(yyvsp[-1].symb); ; + break;} +case 35: +/* #line 357 "avrparse.y" */ +{doDef(yyvsp[-3].symb,yyvsp[-1].regid);; + break;} +case 36: +/* #line 358 "avrparse.y" */ +{doDef(yyvsp[-3].symb,yyvsp[-1].symb); ; + break;} +case 37: +/* #line 359 "avrparse.y" */ +{doEqu(yyvsp[-3].symb,&yyvsp[-1].val); ; + break;} +case 38: +/* #line 360 "avrparse.y" */ +{doAdb();; + break;} +case 39: +/* #line 360 "avrparse.y" */ +{/*XXX*/ ; + break;} +case 40: +/* #line 361 "avrparse.y" */ +{doAdw();; + break;} +case 41: +/* #line 361 "avrparse.y" */ +{ ; + break;} +case 42: +/* #line 362 "avrparse.y" */ +{doOrg(&yyvsp[-1].val); ; + break;} +case 43: +/* #line 363 "avrparse.y" */ +{ ; + break;} +case 44: +/* #line 364 "avrparse.y" */ +{ ; + break;} +case 45: +/* #line 365 "avrparse.y" */ +{ ; + break;} +case 46: +/* #line 366 "avrparse.y" */ +{doByt(&yyvsp[-1].val); ; + break;} +case 47: +/* #line 367 "avrparse.y" */ +{doSet(yyvsp[-3].symb,&yyvsp[-1].val); ; + break;} +case 48: +/* #line 368 "avrparse.y" */ +{ ; + break;} +case 49: +/* #line 369 "avrparse.y" */ +{doDev(yyvsp[-1].symb); ; + break;} +case 50: +/* #line 373 "avrparse.y" */ +{ error(E_EXPECTED_ID_REG); ; + break;} +case 51: +/* #line 374 "avrparse.y" */ +{ error(E_EXPECTED_ID_EXPR); ; + break;} +case 52: +/* #line 375 "avrparse.y" */ +{ error(E_EXPECTED_VALLIST); ; + break;} +case 53: +/* #line 376 "avrparse.y" */ +{ error(E_EXPECTED_VALLIST); ; + break;} +case 54: +/* #line 377 "avrparse.y" */ +{ error(E_EXPECTED_VAL_LABEL); ; + break;} +case 55: +/* #line 378 "avrparse.y" */ +{ error(E_EXPECTED_NOARGS); ; + break;} +case 56: +/* #line 379 "avrparse.y" */ +{ error(E_EXPECTED_NOARGS); ; + break;} +case 57: +/* #line 380 "avrparse.y" */ +{ error(E_EXPECTED_NOARGS); ; + break;} +case 58: +/* #line 381 "avrparse.y" */ +{ error(E_EXPECTED_VAL_LABEL); ; + break;} +case 59: +/* #line 382 "avrparse.y" */ +{ error(E_EXPECTED_ID_EXPR); ; + break;} +case 60: +/* #line 383 "avrparse.y" */ +{ error(E_EXPECTED_DEVICE); ; + break;} +case 61: +/* #line 402 "avrparse.y" */ +{yyval.indi.regno=yyvsp[0].regid;yyval.indi.plus=2;yyval.indi.disp=0;; + break;} +case 62: +/* #line 404 "avrparse.y" */ +{yyval.indi.regno=yyvsp[0].regid;yyval.indi.plus=0;yyval.indi.disp=0;; + break;} +case 63: +/* #line 406 "avrparse.y" */ +{yyval.indi.regno=yyvsp[-1].regid;yyval.indi.plus=1;yyval.indi.disp=0;; + break;} +case 64: +/* #line 408 "avrparse.y" */ +{ yyval.indi.regno = yyvsp[-2].regid; + yyval.indi.plus=1;yyval.indi.disp=1;yyval.indi.offset=yyvsp[0].val;; + break;} +case 67: +/* #line 430 "avrparse.y" */ +{doAdb(yyvsp[0].string); ; + break;} +case 68: +/* #line 431 "avrparse.y" */ +{doAdb(&yyvsp[0].val);; + break;} +case 69: +/* #line 434 "avrparse.y" */ +{doAdw(&yyvsp[0].val);; + break;} +case 70: +/* #line 435 "avrparse.y" */ +{doAdw(&yyvsp[0].val);; + break;} +case 74: +/* #line 454 "avrparse.y" */ +{yyval.val.valid=yyvsp[0].symb->valid; + yyval.val.value=yyvsp[0].symb->value + +yyvsp[0].symb->islabel*yyvsp[0].symb->macrolabel* + (yyoffset *(yyvsp[0].symb->segment==SEGMENT_CODE)) + +yyvsp[0].symb->islabel*yyvsp[0].symb->macrolabel* + (yydataoffset*(yyvsp[0].symb->segment==SEGMENT_DATA)) + +yyvsp[0].symb->islabel*yyvsp[0].symb->macrolabel* + (yyeromoffset*(yyvsp[0].symb->segment==SEGMENT_EEPROM));; + break;} +case 75: +/* #line 463 "avrparse.y" */ +{ yyval.val=yyvsp[-1].val; ; + break;} +case 76: +/* #line 465 "avrparse.y" */ +{ genFun(yyvsp[-3].func, &yyvsp[-1].val, &yyval.val); ; + break;} +case 77: +/* #line 468 "avrparse.y" */ +{ oprUna(OP_MINUS, &yyvsp[0].val, &yyval.val); ; + break;} +case 78: +/* #line 469 "avrparse.y" */ +{ oprUna(OP_WAVE , &yyvsp[0].val, &yyval.val); ; + break;} +case 79: +/* #line 470 "avrparse.y" */ +{ oprUna(OP_NOT , &yyvsp[0].val, &yyval.val); ; + break;} +case 82: +/* #line 476 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_STAR , &yyvsp[0].val, &yyval.val); ; + break;} +case 83: +/* #line 478 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_DIV , &yyvsp[0].val, &yyval.val); ; + break;} +case 84: +/* #line 480 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_MOD , &yyvsp[0].val, &yyval.val); ; + break;} +case 86: +/* #line 485 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_PLUS , &yyvsp[0].val, &yyval.val); ; + break;} +case 87: +/* #line 487 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_MINUS , &yyvsp[0].val, &yyval.val); ; + break;} +case 89: +/* #line 492 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_LS , &yyvsp[0].val, &yyval.val); ; + break;} +case 90: +/* #line 494 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_RS , &yyvsp[0].val, &yyval.val); ; + break;} +case 92: +/* #line 499 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_LESS , &yyvsp[0].val, &yyval.val); ; + break;} +case 93: +/* #line 501 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_GREAT , &yyvsp[0].val, &yyval.val); ; + break;} +case 94: +/* #line 503 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_LE , &yyvsp[0].val, &yyval.val); ; + break;} +case 95: +/* #line 505 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_GE , &yyvsp[0].val, &yyval.val); ; + break;} +case 97: +/* #line 510 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_EQ , &yyvsp[0].val, &yyval.val); ; + break;} +case 98: +/* #line 512 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_NE , &yyvsp[0].val, &yyval.val); ; + break;} +case 100: +/* #line 517 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_AND , &yyvsp[0].val, &yyval.val); ; + break;} +case 102: +/* #line 522 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_XOR , &yyvsp[0].val, &yyval.val); ; + break;} +case 104: +/* #line 527 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_OR , &yyvsp[0].val, &yyval.val); ; + break;} +case 106: +/* #line 532 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_ANDAND, &yyvsp[0].val, &yyval.val); ; + break;} +case 108: +/* #line 537 "avrparse.y" */ +{ oprBin(&yyvsp[-2].val,OP_OROR , &yyvsp[0].val, &yyval.val); ; + break;} +} + +/* #line 705 "/usr/share/bison/bison.simple" */ + + + yyvsp -= yylen; + yyssp -= yylen; +#if YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; +#if YYLSP_NEEDED + *++yylsp = yyloc; +#endif + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + char *yymsg; + int yyx, yycount; + + yycount = 0; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) + if (yycheck[yyx + yyn] == yyx) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); + + if (yycount < 5) + { + yycount = 0; + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); + yyx++) + if (yycheck[yyx + yyn] == yyx) + { + const char *yyq = ! yycount ? ", expecting " : " or "; + yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yytname[yyx]); + yycount++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("parse error; also virtual memory exhausted"); + } + else +#endif /* defined (YYERROR_VERBOSE) */ + yyerror ("parse error"); + } + goto yyerrlab1; + + +/*--------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action | +`--------------------------------------------------*/ +yyerrlab1: + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", + yychar, yytname[yychar1])); + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + + +/*-------------------------------------------------------------------. +| yyerrdefault -- current state does not do anything special for the | +| error token. | +`-------------------------------------------------------------------*/ +yyerrdefault: +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + + /* If its default is to accept any token, ok. Otherwise pop it. */ + yyn = yydefact[yystate]; + if (yyn) + goto yydefault; +#endif + + +/*---------------------------------------------------------------. +| yyerrpop -- pop the current state because it cannot handle the | +| error token | +`---------------------------------------------------------------*/ +yyerrpop: + if (yyssp == yyss) + YYABORT; + yyvsp--; + yystate = *--yyssp; +#if YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG + if (yydebug) + { + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); + } +#endif + +/*--------------. +| yyerrhandle. | +`--------------*/ +yyerrhandle: + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; +#if YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +/*---------------------------------------------. +| yyoverflowab -- parser overflow comes here. | +`---------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} +/* #line 544 "avrparse.y" */ diff --git a/src/mkutil/tavrasm.118/src/avrparse.hh b/src/mkutil/tavrasm.118/src/avrparse.hh new file mode 100644 index 00000000..16e371e8 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrparse.hh @@ -0,0 +1,81 @@ +#ifndef BISON_AVRPARSE_H +# define BISON_AVRPARSE_H + +#ifndef YYSTYPE +typedef union +{ + regSA regid; + instSA inst; + opcodeSA opcode; + valueSA val; + nameSA name; + symbolSA symb; + indirectSA indi; + functionSA func; + stringSA string; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif +# define STAR 257 +# define DIV 258 +# define MOD 259 +# define LS 260 +# define RS 261 +# define LE 262 +# define GE 263 +# define LESS 264 +# define GREAT 265 +# define EQ 266 +# define NE 267 +# define OR 268 +# define XOR 269 +# define AND 270 +# define OROR 271 +# define ANDAND 272 +# define LPAR 273 +# define RPAR 274 +# define COLON 275 +# define COMMA 276 +# define DOT 277 +# define EQUAL 278 +# define PLUS 279 +# define MINUS 280 +# define WAVE 281 +# define NOT 282 +# define EOL 283 +# define RESTART 284 +# define ENDOFFILE 285 +# define DEF 286 +# define EQU 287 +# define DB 288 +# define DW 289 +# define ORG 290 +# define CSEG 291 +# define DSEG 292 +# define ESEG 293 +# define BYTE 294 +# define SET 295 +# define DEVICE 296 +# define STRING 297 +# define MACRODEF 298 +# define REGISTER 299 +# define REGXYZ 300 +# define SYMBOL 301 +# define INTEGER 302 +# define COUNTER 303 +# define FUNCTION 304 +# define IREGREG 305 +# define IIMMIMM 306 +# define IREGIMM 307 +# define IIMMREG 308 +# define IREG 309 +# define IIMM 310 +# define INOARGS 311 +# define IINDIRC 312 +# define ILPM 313 + + +extern YYSTYPE yylval; + +#endif /* not BISON_AVRPARSE_H */ diff --git a/src/mkutil/tavrasm.118/src/avrparse.y b/src/mkutil/tavrasm.118/src/avrparse.y new file mode 100644 index 00000000..613377e9 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/avrparse.y @@ -0,0 +1,543 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : avrparse.y +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : This module implements the grammar file for AVRASM +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +%{ + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "avrasm.hh" +#include "symbol.hh" +#include "semantic.hh" +#include "utils.hh" + +/// Extern /////////////////////////////////////////////////////////////////// + +GLOBALS(extern); +extern char *yytext; + +/// Prototypes /////////////////////////////////////////////////////////////// + +int yylex(); + +/// yyerror ////////////////////////////////////////////////////////////////// + +void yyerror(char *s) +{ + s = s; // Used for debugging purposes +} + +/// Start of grammar ///////////////////////////////////////////////////////// + +%} + +/// Attribute union ////////////////////////////////////////////////////////// + +%union +{ + regSA regid; + instSA inst; + opcodeSA opcode; + valueSA val; + nameSA name; + symbolSA symb; + indirectSA indi; + functionSA func; + stringSA string; +} + +/// Terminal symbols that synthesizes default value ////////////////////////// + +%token STAR DIV MOD +%token LS RS +%token LE GE LESS GREAT EQ NE +%token OR XOR AND +%token OROR ANDAND +%token LPAR RPAR +%token COLON COMMA DOT EQUAL PLUS MINUS WAVE NOT +%token EOL RESTART ENDOFFILE +%token DEF EQU DB DW ORG CSEG DSEG ESEG +%token BYTE SET DEVICE STRING MACRODEF + +/// Attributes for terminal symbols ////////////////////////////////////////// + +%token REGISTER +%token REGXYZ +%token SYMBOL +%token INTEGER +%token COUNTER +%token FUNCTION +%token IREGREG +%token IIMMIMM +%token IREGIMM +%token IIMMREG +%token IREG +%token IIMM +%token INOARGS +%token IINDIRC +%token ILPM +%token STRING + +/// Attributes for non-terminal symbols ////////////////////////////////////// + +%type instruction +%type lpminst +%type expr +%type indirectaddr +%type registername +%type unary_expr +%type primary_expr +%type mult_expr +%type additive_expr +%type shift_expr +%type relational_expr +%type equality_expr +%type AND_expression +%type exclusive_OR +%type inclusive_OR +%type logical_AND +%type logical_OR +%type composite_expr + +/// Expect 4 shift/reduce conflicts ////////////////////////////////////////// + +%expect 4 + +/// The goal symbol ////////////////////////////////////////////////////////// + +%start program + +%% // Start of grammar /////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // program : programlist RESTART programlist + // + // e : + // + //////////////////////////////////////////////////////////////////////////// + // + // We start by defining the goal symbol 'program'. There is only one + // production that can reduce the input to 'program': + // + // - 'programlist' RESTART 'programlist' + // + // with one 'programlist' for each pass. + // + // The symbol 'e' (or epsilon) is also defined. It should be considered + // a terminal symbol, and is only used to increase readability. + // + //////////////////////////////////////////////////////////////////////////// + +program : programlist RESTART programlist + ; + +e : + ; + + //////////////////////////////////////////////////////////////////////////// + // + // programlist := programlist programelement | programelement + // + //////////////////////////////////////////////////////////////////////////// + // + // 'programlist' is a left recursive list production, that parses one or + // more 'programelement's. + // + //////////////////////////////////////////////////////////////////////////// + +programlist : programlist programelement + | programelement + ; + + //////////////////////////////////////////////////////////////////////////// + // + // programelement := label instruction | label EOL | label directive | EOL + // + //////////////////////////////////////////////////////////////////////////// + // + // All instructions / defines are limited to a single line + // + //////////////////////////////////////////////////////////////////////////// + +programelement : label instruction { tolog(); } + | label EOL { tolog(); } + | label directive { tolog(); } + | EOL { tolog(); } + + /// Error recovery ////////////////////////////////////////// + + | error EOL { error(E_UNKNOWN_OPCODE); tolog(); } + ; + + //////////////////////////////////////////////////////////////////////////// + // + // instruction := IREGREG registername COMMA registername EOL + // | IREGIMM registername COMMA expr EOL + // | IIMMREG expr COMMA registername EOL + // | IIMMIMM expr COMMA expr EOL + // | IIMM expr EOL + // | IREG registername EOL + // | INOARGS EOL + // | IINDIRC registername COMMA indirectaddr EOL + // | IINDIRC indirectaddr COMMA registername EOL + // + //////////////////////////////////////////////////////////////////////////// + // + // There are nine different forms of 'instruction' : + // + // MOV r1, r1 ; Register / Register + // MOV r1, 0x10 ; Register / expr + // OUT 0x10, r1 ; expr / Register + // BRBS 6, bitfound ; expr / expr + // JMP 0x1000 ; expr + // CLR r29 ; Register + // CLI ; Noargs + // LD r2, -Y ; Indirect + // ST Y+, r2 ; Indirect + // + // Notice: LPM/ELPM are special, since they can be specified with or + // without arguments (arrgh). + // + //////////////////////////////////////////////////////////////////////////// + +instruction : IREGREG registername COMMA registername EOL + {genRegReg($1, $2, $4);} + | IREGIMM registername COMMA expr EOL + {genRegImm($1, $2, &$4);} + | IIMMREG expr COMMA registername EOL + {genImmReg($1, &$2, $4);} + | IIMMIMM expr COMMA expr EOL + {genImmImm($1, &$2, &$4);} + | IIMM expr EOL + {genImmedi($1, &$2);} + | IREG registername EOL + {genRegist($1, $2);} + | INOARGS EOL + {genNoargs($1);} + | IINDIRC registername COMMA indirectaddr EOL + {genIndirc($1, &$4, $2,TRUE);} + | IINDIRC indirectaddr COMMA registername EOL + {genIndirc($1, &$2, $4);} + + | lpminst + + /// Error recovery ////////////////////////////////////////// + + | IREGREG error EOL { error(E_REGISTER_EXPECTED); } + | IREGIMM error EOL { error(E_INVALID_REGIMM_SPEC); } + | IIMMREG error EOL { error(E_INVALID_REGIMM_SPEC); } + | IIMMIMM error EOL { error(E_INVALID_IMMEDIATE_SPEC); } + | IIMM error EOL { error(E_INVALID_IMMEDIATE_SPEC); } + | IREG error EOL { error(E_INVALID_REGISTER_SPEC); } + | INOARGS error EOL { error(E_NOARGS_EXPECTED_SPEC); } + | IINDIRC error EOL { error(E_INVALID_REGISTER_SPEC); } + ; + + //////////////////////////////////////////////////////////////////////////// + // + // lpminst := ILPM EOL | ILPM registername COMMA indirectaddr + // + //////////////////////////////////////////////////////////////////////////// + // + // Handles LPM and ELPM instructions + // + //////////////////////////////////////////////////////////////////////////// + +lpminst : ILPM EOL + { genLpm($1, 0, NULL, FALSE); } + | ILPM registername COMMA indirectaddr EOL + { genLpm($1, $2, &$4, TRUE); } + + /// Error recovery ////////////////////////////////////////// + + | ILPM error EOL { error(E_INVALID_REGISTER_SPEC); } + ; + + //////////////////////////////////////////////////////////////////////////// + // + // registername := REGISTER | SYMBOL + // + //////////////////////////////////////////////////////////////////////////// + // + // Handle registers: r0 - r31 + // + //////////////////////////////////////////////////////////////////////////// + +registername : REGISTER + | SYMBOL + { if($1->isdefine) + $$=$1->reg; + else + { + $$=-1; + errorin(E_INVALID_REGISTER_SPEC); + } + } + ; + + //////////////////////////////////////////////////////////////////////////// + // + // lable := SYMBOL COLON + // | e + // + //////////////////////////////////////////////////////////////////////////// + // + // SYMBOL COLON = Create new label + // + //////////////////////////////////////////////////////////////////////////// + +label : SYMBOL COLON { doLab($1); } + | e + ; + + //////////////////////////////////////////////////////////////////////////// + // + // directive := DEF SYMBOL EQUAL REGISTER EOL + // | DEF SYMBOL EQUAL SYMBOL EOL + // | EQU SYMBOL EQUAL expr EOL + // | DB {doAdb();} byteexprlist EOL + // | DW {doAdw();} wordexprlist EOL + // | ORG expr EOL + // | CSEG EOL + // | DSEG EOL + // | ESEG EOL + // | BYTE expr EOL + // | SET SYMBOL EQUAL expr EOL + // | MACRODEF + // | DEVICE SYMBOL EOL + // + //////////////////////////////////////////////////////////////////////////// + // + // 'directive' insert assembler directives + // + //////////////////////////////////////////////////////////////////////////// + +directive : DEF SYMBOL EQUAL REGISTER EOL {doDef($2,$4);} + | DEF SYMBOL EQUAL SYMBOL EOL {doDef($2,$4); } + | EQU SYMBOL EQUAL expr EOL {doEqu($2,&$4); } + | DB {doAdb();} byteexprlist EOL {/*XXX*/ } + | DW {doAdw();} wordexprlist EOL { } + | ORG expr EOL {doOrg(&$2); } + | CSEG EOL { } + | DSEG EOL { } + | ESEG EOL { } + | BYTE expr EOL {doByt(&$2); } + | SET SYMBOL EQUAL expr EOL {doSet($2,&$4); } + | MACRODEF { } + | DEVICE SYMBOL EOL {doDev($2); } + + /// Error recovery ////////////////////////////////////////// + + | DEF error EOL { error(E_EXPECTED_ID_REG); } + | EQU error EOL { error(E_EXPECTED_ID_EXPR); } + | DB error EOL { error(E_EXPECTED_VALLIST); } + | DW error EOL { error(E_EXPECTED_VALLIST); } + | ORG error EOL { error(E_EXPECTED_VAL_LABEL); } + | CSEG error EOL { error(E_EXPECTED_NOARGS); } + | DSEG error EOL { error(E_EXPECTED_NOARGS); } + | ESEG error EOL { error(E_EXPECTED_NOARGS); } + | BYTE error EOL { error(E_EXPECTED_VAL_LABEL); } + | SET error EOL { error(E_EXPECTED_ID_EXPR); } + | DEVICE error EOL { error(E_EXPECTED_DEVICE); } + ; + + //////////////////////////////////////////////////////////////////////////// + // + // indirectaddr := MINUS REGXYZ + // | REGXYZ + // | REGXYZ PLUS + // | REGXYZ PLUS expr + // + //////////////////////////////////////////////////////////////////////////// + // + // There are 4 different forms of indirect addressing: + // + // "-Z", "Z", "Z+" and "Z+offset" + // + //////////////////////////////////////////////////////////////////////////// + +indirectaddr : MINUS REGXYZ + {$$.regno=$2;$$.plus=2;$$.disp=0;} + | REGXYZ + {$$.regno=$1;$$.plus=0;$$.disp=0;} + | REGXYZ PLUS + {$$.regno=$1;$$.plus=1;$$.disp=0;} + | REGXYZ PLUS expr + { $$.regno = $1; + $$.plus=1;$$.disp=1;$$.offset=$3;} + ; + + //////////////////////////////////////////////////////////////////////////// + // + // byteexprlist := byteexprlist COMMA expr + // | expr + // + // wordexprlist := wordexprlist COMMA expr + // | expr + // + //////////////////////////////////////////////////////////////////////////// + // + // List of bytes and words for .db and .dw respectively + // + //////////////////////////////////////////////////////////////////////////// + +byteexprlist : byteexprlist COMMA byteelement + | byteelement + ; + +byteelement : STRING {doAdb($1); } + | expr {doAdb(&$1);} + ; + +wordexprlist : wordexprlist COMMA expr {doAdw(&$3);} + | expr {doAdw(&$1);} + ; + + //////////////////////////////////////////////////////////////////////////// + // + // expr := ... + // + //////////////////////////////////////////////////////////////////////////// + // + // Constant expressions with 'C' precedence + // + //////////////////////////////////////////////////////////////////////////// + +expr : composite_expr + ; + +primary_expr : INTEGER + | COUNTER + | SYMBOL + {$$.valid=$1->valid; + $$.value=$1->value + +$1->islabel*$1->macrolabel* + (yyoffset *($1->segment==SEGMENT_CODE)) + +$1->islabel*$1->macrolabel* + (yydataoffset*($1->segment==SEGMENT_DATA)) + +$1->islabel*$1->macrolabel* + (yyeromoffset*($1->segment==SEGMENT_EEPROM));} + | LPAR expr RPAR + { $$=$2; } + | FUNCTION LPAR expr RPAR + { genFun($1, &$3, &$$); } + ; + +unary_expr : MINUS unary_expr { oprUna(OP_MINUS, &$2, &$$); } + | WAVE unary_expr { oprUna(OP_WAVE , &$2, &$$); } + | NOT unary_expr { oprUna(OP_NOT , &$2, &$$); } + | primary_expr + ; + +mult_expr : unary_expr + | mult_expr STAR unary_expr + { oprBin(&$1,OP_STAR , &$3, &$$); } + | mult_expr DIV unary_expr + { oprBin(&$1,OP_DIV , &$3, &$$); } + | mult_expr MOD unary_expr + { oprBin(&$1,OP_MOD , &$3, &$$); } + ; + +additive_expr : mult_expr + | additive_expr PLUS mult_expr + { oprBin(&$1,OP_PLUS , &$3, &$$); } + | additive_expr MINUS mult_expr + { oprBin(&$1,OP_MINUS , &$3, &$$); } + ; + +shift_expr : additive_expr + | shift_expr LS additive_expr + { oprBin(&$1,OP_LS , &$3, &$$); } + | shift_expr RS additive_expr + { oprBin(&$1,OP_RS , &$3, &$$); } + ; + +relational_expr : shift_expr + | relational_expr LESS shift_expr + { oprBin(&$1,OP_LESS , &$3, &$$); } + | relational_expr GREAT shift_expr + { oprBin(&$1,OP_GREAT , &$3, &$$); } + | relational_expr LE shift_expr + { oprBin(&$1,OP_LE , &$3, &$$); } + | relational_expr GE shift_expr + { oprBin(&$1,OP_GE , &$3, &$$); } + ; + +equality_expr : relational_expr + | equality_expr EQ relational_expr + { oprBin(&$1,OP_EQ , &$3, &$$); } + | equality_expr NE relational_expr + { oprBin(&$1,OP_NE , &$3, &$$); } + ; + +AND_expression : equality_expr + | AND_expression AND equality_expr + { oprBin(&$1,OP_AND , &$3, &$$); } + ; + +exclusive_OR : AND_expression + | exclusive_OR XOR AND_expression + { oprBin(&$1,OP_XOR , &$3, &$$); } + ; + +inclusive_OR : exclusive_OR + | inclusive_OR OR exclusive_OR + { oprBin(&$1,OP_OR , &$3, &$$); } + ; + +logical_AND : inclusive_OR + | logical_AND ANDAND inclusive_OR + { oprBin(&$1,OP_ANDAND, &$3, &$$); } + ; + +logical_OR : logical_AND + | logical_OR OROR logical_AND + { oprBin(&$1,OP_OROR , &$3, &$$); } + ; + +composite_expr : logical_OR + ; + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/devices.hh b/src/mkutil/tavrasm.118/src/devices.hh new file mode 100644 index 00000000..1a9694dd --- /dev/null +++ b/src/mkutil/tavrasm.118/src/devices.hh @@ -0,0 +1,110 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : devices.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : AVR Controller descriptions +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 990721 : Tom - Added AT90S4433 +// 021218 : Andreas Schwarz added AT90S2333, ATmegaXX +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _DEVICES_HH_ +#define _DEVICES_HH_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include "avrasm.hh" + +/// Device descriptions ////////////////////////////////////////////////////// +// +// struct deviceinfo { +// char name[MAX_DEVICE_NAME_LENGTH+1]; // Device name +// int datastart; // Registers + I/O ports +// int ramsize; // Size of ram +// int eepromsize; // Size of EEPROM +// int flashsize; // Size of flash (in words) +// int supported; // Unsupported instructions +// }; +// + +deviceinfo devices[MAX_DEVICES] = { + + // ----------------------------------------------------------------------- + // Name |Reg| Ram | EEPROM |Flash Size | Unsupported instuctions | + // ----------------------------------------------------------------------- + // | | | | | | + { "GENERIC" , 96, 65536, 0x10000, 0x1000000 , 0 }, + { "AT90S1200" , 96, 0, 64, 512 , S_JMP |S_CALL |S_MUL | + S_ADIW |S_CALL |S_ICALL| + S_IJMP |S_LD |S_ST | + S_LDS |S_LPM |S_PUSH | + S_POP |S_SBIW |S_LDD | + S_STD |S_STS |S_EXTENDED }, + { "AT90S2313" , 96, 128, 128, 1024 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S2323" , 96, 128, 128, 1024 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S2343" , 96, 128, 128, 1024 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S4414" , 96, 256, 256, 2048 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S4433" , 96, 256, 256, 2048 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S4434" , 96, 256, 256, 2048 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S8515" , 96, 512, 512, 4096 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "AT90S8535" , 96, 512, 512, 4096 , S_JMP |S_CALL |S_MUL| S_EXTENDED }, + { "ATMega103" , 96, 4096, 4096, 65536 , S_MUL | S_EXTENDED }, + { "ATMega8" , 96, 1024, 512, 4096 , 0 }, + { "ATMega161" , 96, 1024, 512, 8192 , 0 }, + { "ATMega162" , 96, 1024, 512, 8192 , 0 }, + { "ATMega163" , 96, 1024, 512, 8192 , 0 }, + { "ATMega16" , 96, 1024, 512, 8192 , 0 }, + { "ATMega323" , 96, 2048, 1024, 16384 , 0 }, + { "ATMega32" , 96, 2048, 1024, 16384 , 0 }, + { "ATmega8515", 96, 512, 512, 4096 , 0 }, + { "ATmega8535", 96, 512, 512, 4096 , 0 }, + // | | | | | | + // ----------------------------------------------------------------------- + + // Test device + + { "" , 96, 2 , 5 , 10 , 0 }, + + // NULL - terminating device. + + { "" , 0 , 0, 0x000, 0x1000000 , 0 } + +}; + +#endif /* _DEVICES_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/mac.inc b/src/mkutil/tavrasm.118/src/mac.inc new file mode 100644 index 00000000..f2f9930a --- /dev/null +++ b/src/mkutil/tavrasm.118/src/mac.inc @@ -0,0 +1,195 @@ +; MAC.INC +; MACROS FOR THE AVR PROCESSOR + +.MACRO RJEQ + BRNE LOCAL + RJMP @0 +LOCAL: +.ENDMACRO + +.MACRO RJNE + BREQ LOCAL + RJMP @0 +LOCAL: +.ENDMACRO + +.MACRO OUTI @0,@1 + LDI A,@1 ; OUT IMMEDIATE TO PORT + OUT @0,A +.ENDMACRO + +.MACRO ADDI @0,@1 + SUBI @0,-@1 ; ADD IMMEDIATE +.ENDMACRO + +.MACRO EORI @0,@1 + LDI A,@1 ; EOR IMMEDIATE + EOR @0,A +.ENDMACRO + +.MACRO STI @0,@1 + LDI A,@1 ; STORE IMMEDIATE + ST @0,A +.ENDMACRO + +.MACRO ADDIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + ADD @0,A +.ENDMACRO + +.MACRO SUBIL @0,@1 + LDI A,@1 ; ADD IMMEDIATE LOWER REGISTER SET + SUB @0,A +.ENDMACRO + +.MACRO ANDIL @0,@1 + LDI A,@1 ; AND IMMEDIATE LOWER REGISTER SET + AND @0,A +.ENDMACRO + +.MACRO LDIL @0,@1 + LDI A,@1 ; LOAD IMMEDIATE LOWER REGISTER SET + MOV @0,A +.ENDMACRO + +.MACRO LDIX @0 ; LOAD IMMEDIATE XL, XH WITH FLASH ADDRESS + LDI XL,LOW((@0)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((@0)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION +.ENDMACRO + +.MACRO LDIZ @0 ; LOAD IMMEDIATE ZL, ZH WITH FLASH ADDRESS + LDI ZL,LOW((@0)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((@0)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION +.ENDMACRO + +.MACRO LDE @0,@1 ; LOAD REGISTER FROM EEPROM + RCALL LDE1 + LDI @0,LOW(@1*2) ; POINT TO EEPROM CONSTANT + OUT EEAR,@0 ; SET UP ADDRESS + SBI EECR,EERE ; ASSERT READ STROBE + IN @0,EEDR +.ENDMACRO + +.MACRO LDFL @0,@1 ; LOAD REGISTER FROM FLASH LOW BYTE + LDI ZL,LOW(@1*2) + LDI ZH,HIGH(@1*2) + LPM + MOV @0,R0 +.ENDMACRO + +.MACRO LDFH @0,@1 ; LOAD REGISTER FROM FLASH HIGH BYTE + LDI ZL,LOW(@1*2+1) + LDI ZH,HIGH(@1*2+1) + LPM + MOV @0,R0 +.ENDMACRO + +;.MACRO LDF @0,@1 ; LOAD REGISTER FROM FLASH +; LDI ZL,@1 ; POINT TO FLASH CONSTANT +; LPM +; MOV @0,R0 +;.ENDMACRO + +;------------------------------------------------------------------------------ + +.MACRO FLD @0 ; LOAD FA REGISTER FROM SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL LDS_FA +.ENDMACRO + +.MACRO FLDF @0 ; LOAD FA REGISTER FROM FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL LDF_FA +.ENDMACRO + +.MACRO FLDE @0 ; LOAD FA REGISTER FROM EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL LDE_FA +.ENDMACRO + +.MACRO FLD3 @0 ; LOAD FA REGISTER WITH 3 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS3_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FLD2 @0 ; LOAD FA REGISTER WITH 2 BYTE SRAM INTEGER + LDI YL,LOW(@0) ; POINT TO SOURCE + RCALL LDS2_FA ; CONVERT TO INTERNAL FP FORMAT +.ENDMACRO + +.MACRO FST @0 ; STORE FP REGISTER TO FP ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL STS_FA +.ENDMACRO + +.MACRO FCHS @0 ; CHANGE SIGN OF SRAM ARGUMENT + LDI YL,LOW(@0) + RCALL CHSS +.ENDMACRO + +.MACRO FAD @0 ; ADD SRAM ARGUMENT TO FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL ADD_FA +.ENDMACRO + +.MACRO FADF @0 ; ADD FLASH CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL ADDF_FA +.ENDMACRO + +.MACRO FADE @0 ; ADD EEPROM CONSTANT TO FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO EEPROM CONSTANT + RCALL ADDE_FA +.ENDMACRO + +.MACRO FSB @0 ; SUBTRACT SRAM ARGUMENT FROM FA REGISTER + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL SUB_FA +.ENDMACRO + +.MACRO FSBF @0 ; SUBTRACT FLASH CONSTANT FROM FA REGISTER + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL SUBF_FA +.ENDMACRO + +.MACRO FML @0 ; MULTIPLY FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL MUL_FA +.ENDMACRO + +.MACRO FMLF @0 ; MULTIPLY FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL MULF_FA +.ENDMACRO + +.MACRO FDV @0 ; DIVIDE FA REGISTER BY SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL DIV_FA +.ENDMACRO + +.MACRO FDVF @0 ; DIVIDE FA REGISTER BY FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL DIVF_FA +.ENDMACRO + +.MACRO FCP @0 ; COMPARE FA REGISTER WITH SRAM ARGUMENT + LDI YL,LOW(@0) ; POINT TO SRAM ARGUMENT + RCALL CP_FA +.ENDMACRO + +.MACRO FCPF @0 ; COMPARE FA REGISTER WITH FLASH CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + LDI ZH,HIGH(@0*2) + RCALL CPF_FA +.ENDMACRO + +.MACRO FCPE @0 ; COMPARE FA REGISTER WITH EEPROM CONSTANT + LDI ZL,LOW(@0*2) ; POINT TO FLASH CONSTANT + RCALL CPE_FA +.ENDMACRO + diff --git a/src/mkutil/tavrasm.118/src/makefile b/src/mkutil/tavrasm.118/src/makefile new file mode 100644 index 00000000..c61830cd --- /dev/null +++ b/src/mkutil/tavrasm.118/src/makefile @@ -0,0 +1,117 @@ +############################################################################# +# +# Title : TAVRASM Makefile +# +# Author : Tom Mortensen - (C) 1998 +# +# Create : 980902 +# +# Notice : Select compiler as appropriate (egcs or gcc) +# +# rm/mv : Versions of rm (remove/delete) and mv (move) that supports +# "Unix" style parameters must be available. +# +############################################################################# + +### Program name ############################################################ + +EXENAME = tavrasm + +### Language : US, DE ####################################################### + +LANGUAGE = US +VERSION = 117 + +### Compiler options ######################################################### + +CC = gcc +CFLAGS = -O2 -Wall -DAVRLANG=LANGUAGE_$(LANGUAGE) +CPPFLAGS = +CCFLAGS = $(CFLAGS) $(CPPFLAGS) +LINK = -lm -lstdc++ +OBJS = avrparse.o avrlex.o avrasm.o symbol.o semantic.o utils.o + +### Defaul CC files ######################################################### + +.cc.o: + $(CC) -c $(CCFLAGS) $< + +### Executable ############################################################## + +$(EXENAME): $(OBJS) + $(CC) $(CCFLAGS) $(OBJS) $(LINK) -o $@ + +### Parser file ############################################################# + +avrparse.cc: avrparse.y avrasm.hh symbol.hh semantic.hh opcodes.hh + bison -d -o avrparse avrparse.y + mv avrparse avrparse.cc + mv avrparse.h avrparse.hh + +### Scanner file ############################################################ + +avrlex.cc: avrparse.cc avrlex.l symbol.hh semantic.hh avrparse.hh \ + opcodes.hh avrasm.hh messages.hh + flex -o$@ avrlex.l + +### Dependencies ############################################################ + +avrlex.o: avrlex.l +avrparse.o: avrparse.y +avrasm.o: avrasm.cc avrasm.hh symbol.hh devices.hh messages.hh +symbol.o: symbol.cc symbol.hh avrasm.hh +utils.o: utils.cc utils.hh avrasm.hh messages.hh msg_us.hh msg_de.hh msg_sp.hh +semantic.o: semantic.cc semantic.hh symbol.hh opcodes.hh avrasm.hh \ + messages.hh + +### Clean ################################################################### + +clean: + rm -rf *.o + rm -rf *.O + rm -rf avrparse.cc + rm -rf avrparse.hh + rm -rf avrlex.cc + rm -rf core *~ + rm -rf *.output + rm -rf $(EXENAME) + rm -rf $(EXENAME).EXE + rm -rf *.obj + rm -rf *.out + +### Distribution ############################################################ + +dist: + rm -rf tavrasm$(VERSION) + mkdir tavrasm$(VERSION) + mkdir tavrasm$(VERSION)/src + cp *.cc tavrasm$(VERSION)/src/. + cp *.hh tavrasm$(VERSION)/src/. + cp *.l tavrasm$(VERSION)/src/. + cp *.y tavrasm$(VERSION)/src/. + cp makefile tavrasm$(VERSION)/src/. + cp gpl.txt tavrasm$(VERSION)/. + cp README tavrasm$(VERSION)/. + +dist2: clean dist $(EXENAME) + cp $(EXENAME) tavrasm$(VERSION)/. + tar cvfz tavrasm.tar.gz tavrasm$(VERSION) + +distribution: dist2 + rm -rf *.o + rm -rf avrparse.cc + rm -rf avrparse.hh + rm -rf avrlex.cc + rm -rf core *~ + rm -rf *.output + rm -rf $(EXENAME) + rm -rf $(EXENAME).EXE + rm -rf *.obj + rm -rf *.out + rm -rf tavrasm$(VERSION) + +### END OF FILE ############################################################# + + + + diff --git a/src/mkutil/tavrasm.118/src/messages.hh b/src/mkutil/tavrasm.118/src/messages.hh new file mode 100644 index 00000000..4d6f194f --- /dev/null +++ b/src/mkutil/tavrasm.118/src/messages.hh @@ -0,0 +1,258 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : messages.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : AVR Macro assembler messages +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 990127 : Tom - Messages moved to 'msg_us.hh', multi language added +// 000111 : Brian Rhodefer - added message for too many include paths +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _MESSAGES_HH_ +#define _MESSAGES_HH_ + +/// Defines ////////////////////////////////////////////////////////////////// + +#define MESSAGES_LEN 77 + +/// Warnings ///////////////////////////////////////////////////////////////// + +#define W_INVALID_CHAR 1 +#define W_INVALID_ASCII 2 +#define W_ARG_SPEC 3 +#define W_ARG_USED 4 +#define W_REGLABEL 5 +#define W_REGREDEF 6 +#define W_INTEGERRESULT_EXP2_IS_ZERO 7 +#define W_INTEGERRESULT_LOG2_IS_ZERO 8 +#define W_BIT_OUT_OF_RANGE 9 +#define W_PORT_OUT_OF_RANGE_1F 10 +#define W_PORT_OUT_OF_RANGE_3F 11 +#define W_BITMASK_OUT_OF_RANGE 12 +#define W_CONST_OUT_OF_RANGE_3F 13 +#define W_CONST_OUT_OF_RANGE_FF 14 +#define W_CONST_OUT_OF_RANGE_FFFF 15 +#define W_ADDR_OUT_OF_RANGE_FFFF 16 +#define W_DISPLACEMENT_OUT_OF_RANGE 17 +#define W_ILLEGAL_DEST_ADDR 18 +#define W_DB_OUT_OF_RANGE 19 +#define W_DW_OUT_OF_RANGE 20 +#define W_ORG_OUT_OF_RANGE 21 +#define W_ORG_OUT_OF_RANGE_ESEG 22 +#define W_ORG_OUT_OF_RANGE_DSEG 23 +#define W_ORG_OVER_REG 24 +#define W_SRAM_EXCEED 25 +#define W_MACRO_UNUSES_PARM 26 +#define W_LISTMACRO_NOT_SUP 27 +#define W_LIST_NOT_SUP 28 +#define W_NOLIST_NOT_SUP 29 +#define W_UNSUP 30 +#define W_UNKNOWN_DEV 31 +#define W_CONSTANT_TO_BIG 32 +#define W_IDENTIFIER_TOO_LONG 33 +#define W_EROM_EXCEED 34 +#define W_OCT_ESCAPE_INVALID 35 +#define W_HEX_ESCAPE_INVALID 36 +#define W_OCT_OUT_OF_RANGE 37 +#define W_CHAR_INVALID 38 +#define W_FLASH_EXCEEDED 39 +#define W_MAC_IDENTIFIER_TOO_LONG 40 +#define MESSAGE_WARNING_LAST 40 + +/// Errors /////////////////////////////////////////////////////////////////// + +#define E_UNKNOWN 1 +#define E_UNKNOWN_BIT 2 +#define E_UNKNOWN_PORT 3 +#define E_UNKNOWN_BRANCH 4 +#define E_UNKNOWN_BITMASK 5 +#define E_UNKNOWN_CONSTANT 6 +#define E_UNKNOWN_ADDRESS 7 +#define E_UNKNOWN_DISP 8 +#define E_UNKNOWN_RCALL_DEST 9 +#define E_UNKNOWN_RJUMP_DEST 10 +#define E_UNKNOWN_JUMP_CALL_DEST 11 +#define E_UNKNOWN_DB 12 +#define E_UNKNOWN_DW 13 +#define E_UNKNOWN_ORG 14 +#define E_UNKNOWN_BYTE 15 +#define E_DIVISION_BY_ZERO 16 +#define E_INVALID_REGISTER_R16_R31 17 +#define E_INVALID_REGISTER 18 +#define E_BRANCH_OUT_OF_RANGE_B 19 +#define E_BRANCH_OUT_OF_RANGE_F 20 +#define E_INVALID_REG_R24_R30 21 +#define E_INVALID_SOURCE_REG_XYZ 22 +#define E_INVALID_DEST_REG_XYZ 23 +#define E_RCALL_OUT_OF_RANGE_B 24 +#define E_RCALL_OUT_OF_RANGE_F 25 +#define E_RJUMP_OUT_OF_RANGE_B 26 +#define E_RJUMP_OUT_OF_RANGE_F 27 +#define E_EQU_REDEF 28 +#define E_LABEL_REDEF 29 +#define E_LABEL_VAR 30 +#define E_DW_IN_DSEG 31 +#define E_DB_IN_DSEG 32 +#define E_MACRO_REDEF 33 +#define E_PROGRAM_IN_DSEG 34 +#define E_PROGRAM_IN_ESEG 35 +#define E_INCLUDE_DEPTH 36 +#define E_INVALID_INCLUDE_NAME 37 +#define E_OPEN_FILE 38 +#define E_MACRO_DEPTH 39 +#define E_EOF_IN_MACRO 40 +#define E_FILENAME_TOO_LONG 41 +#define E_INVALID_FILENAME 42 +#define E_REGISTER_EXPECTED 43 +#define E_INVALID_REGISTER_SPEC 44 +#define E_INVALID_REGIMM_SPEC 45 +#define E_INVALID_IMMEDIATE_SPEC 46 +#define E_NOARGS_EXPECTED_SPEC 47 +#define E_UNKNOWN_OPCODE 48 +#define E_EXPECTED_ID_REG 49 +#define E_EXPECTED_VALLIST 50 +#define E_EXPECTED_NOARGS 51 +#define E_EXPECTED_VAL_LABEL 52 +#define E_EXPECTED_ID_EXPR 53 +#define E_EXPECTED_DEVICE 54 +#define E_VAR_IN_CSEG 55 +#define E_NO_MACRO_NAME 56 +#define E_UNDEF_ESCAPE 57 +#define E_NO_FILENAME 58 +#define E_DEF_USE 59 +#define E_UNDEF_ESCAPE_C 60 +#define E_ENDM 61 +#define E_MACRO_IN_MACRO 62 +#define E_REG_DISP 63 +#define E_DISP_REG 64 + +#define E_NO_DISP 65 +#define E_INVALID_REGISTER_R23_R31 66 +#define E_DISP_ILLEGAL 67 +#define E_INVALID_REG_Z_EXPECTED 68 +#define E_INVALID_PREINCREMENT 69 +#define E_INVALID_REG_EXPECTED 70 +#define E_INVALID_REG_EXPECTED_0_2_4 71 +#define MESSAGE_ERROR_LAST 71 + +#define X_OUT_OF_MEMORY 1 +#define X_LINE_TOO_LONG 2 +#define X_MACRO_LINE_TOO_LONG 3 +#define X_UNABLE_TO_OPEN_FILE 4 +#define X_UNABLE_TO_OPEN_LOGFILE 5 +#define X_UNABLE_TO_OPEN_OUTFILE 6 +#define X_UNABLE_TO_OPEN_ROMFILE 7 +#define X_TOO_MANY_FILES 8 +#define X_TOO_MUCH_CODE 9 +#define X_TOO_MUCH_DATA 10 +#define X_MACRO_DEPTH 11 +#define MESSAGE_FATAL_LAST 11 + +#define M_EMPTY_ROM_FILE 1 +#define M_NOT_SAVE_EROM_OBJ 2 +#define M_NO_INPUT_FILENAME 3 +#define M_UNKNOWN_OPTION 4 +#define M_MORE_MIJBH 5 +#define M_NO_ROM_FILENAME 6 +#define M_ROM_FILENAME_TOO_LONG 7 +#define M_ILLEGAL_ROM_FILENAME 8 +#define M_NO_LIST_FILENAME 9 +#define M_LIST_FILENAME_TOO_LONG 10 +#define M_ILLEGAL_LIST_FILENAME 11 +#define M_NO_OUTPUT_FILENAME 12 +#define M_OUTPUT_FILENAME_TOO_LONG 13 +#define M_ILLEGAL_OUTPUT_FILENAME 14 +#define M_MULTIPLE_OUTPUT 15 +#define M_INPUT_FILENAME_TOO_LONG 16 +#define M_ILLEGAL_INPUT_FILENAME 17 +#define M_MULTIPLE_INPUT 18 +#define M_ERRORS 19 +#define M_WARNINGS 20 +#define M_CODE 21 +#define M_ROM 22 +#define M_DATA 23 +#define M_UNUSED_CODE 24 +#define M_UNUSED_ROM 25 +#define M_EMPTY_CODE 26 +#define M_DEVICE_HEADER 27 +#define M_NO_INCLUDEPATH 28 +#define M_TOO_MANY_INCPATHS 29 +#define M_INCPATH_TOO_LONG 30 +#define MESSAGE_MESSAGES_LAST 30 + +/// Message count //////////////////////////////////////////////////////////// + +#define MESSAGES_WARNING MESSAGE_WARNING_LAST +#define MESSAGES_ERROR MESSAGE_ERROR_LAST +#define MESSAGES_FATAL MESSAGE_FATAL_LAST +#define MESSAGES_MESSAGES MESSAGE_MESSAGES_LAST + +#define MESSAGE_OFFSET_WARNING 0 +#define MESSAGE_OFFSET_ERROR MESSAGES_WARNING +#define MESSAGE_OFFSET_FATAL (MESSAGES_WARNING + MESSAGES_ERROR + 1) +#define MESSAGE_OFFSET_MESSAGES (MESSAGE_OFFSET_FATAL+MESSAGES_FATAL+1) + + +#define MESSAGE_COUNT (4+MESSAGES_WARNING+MESSAGES_ERROR+\ + MESSAGES_FATAL+MESSAGES_MESSAGES) + +/// Languages //////////////////////////////////////////////////////////////// + +#define LANGUAGE_US 1 // US English +#define LANGUAGE_DE 2 // German +#define LANGUAGE_SP 3 // Spanish + +/// Message strings ////////////////////////////////////////////////////////// + +#ifdef AVRLANG +#if AVRLANG == LANGUAGE_DE +#include "msg_de.hh" +#elif AVRLANG == LANGUAGE_US +#include "msg_us.hh" +#elif AVRLANG == LANGUAGE_SP +#include "msg_sp.hh" +#else +#error "Invalid language selected" +#endif /* AVRLANG */ +#else +#error "No language selected" +#endif + +#endif /* _MESSAGES_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/tavrasm.118/src/msg_de.hh b/src/mkutil/tavrasm.118/src/msg_de.hh new file mode 100644 index 00000000..658431d9 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/msg_de.hh @@ -0,0 +1,243 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : msg_de.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : German assembler messages +// +// History +// ======================================================================== +// +// 980127 : Tom - File created - Messages received from Uwe Bonnes. +// 991222 : Kurt- New command line option -x +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSG_DE_HH_ +#define _MSG_DE_HH_ + +// Command line info ///////////////////////////////////////////////////////// + +#define HELPSTR \ +"usage: tavrasm [-vwclxmihjgbafd] " \ +" [-I ]... [-o ] [-r ] [-e ]\n" \ +" -v verbose\n" \ +" -w no warnings\n" \ +" -c case sensitive labels/defines\n" \ +" -l limit log width to 80 characters\n" \ +" -x allow local labels\n" \ +" -m output Motorola S-record format\n" \ +" -i output Intel HEX format (default)\n" \ +" -h omit address extension record from Intel HEX files\n" \ +" -j output .obj format\n" \ +" -g output generic hex\n" \ +" -b output binary format\n" \ +" -a wrap relative jumps\n" \ +" -f allow forward org's\n" \ +" -d list supported devices\n" + +/// Message strings ////////////////////////////////////////////////////////// + +#ifdef _UTILS_CC_ + +char messages[MESSAGE_COUNT][MESSAGES_LEN]= +{ + "Keine Warnung", + "Ungültiger Character \'%c\' im Quelltext", + "Ungültiger Character 0x%02X im Quelltext", + "Argument @%i angegeben, aber nicht im Makro benutzt", + "Argument @%i nicht angegeben, aber im Makro benutzt", + "\'%s\' wurde schon in Zeile %i in Routine \'%s als Label definiert\'", + "\'%s\' wurde schon in Zeile %i in Routine \'%s definiert\'", + "Ganzzahlergebnis von EXP2(%i) wurde Null gesetzt", + "Ganzzahlergebnis von LOG2(%i) wurde Null gesetzt", + "Bit Nummer '\%i\' ist außerhalb des Bereichs (0-7)", + "I/O Port 0x%X ist außerhalb des Bereichs (0x00-0x1F)", + "I/O Port 0x%X ist außerhalb des Bereichs (0x00-0x3F)", + "Bit mask 0x%X ist außerhalb des Bereichs (0x00-0xFF)", + "Konstante 0x%X ist außerhalb des Bereichs (0x00-0x3F)", + "Konstante 0x%X ist außerhalb des Bereichs (0x00-0xFF)", + "Konstante 0x%X ist außerhalb des Bereichs (0x00-0xFFFF)", + "Adresse 0x%X ist außerhalb des Bereichs (0x0-0xFFFF)", + "Versatz \'%X\' ist außerhalb des Bereichs (0x00 - 0x3F)", + "ZielAdresse \'0x%X\' ist außerhalb des Bereichs (0x0-0x3FFFFF)", + "Wert %i ist außerhalb des Bereichs .db (-128 to 255)", + "Wert %i ist außerhalb des Bereichs .dw (-32768 to 65535)", + "Wert %i setzt PC (um %i Worte) im Kode zurück", + "Wert %i überschreibt EEPROM Daten (um %i Byte(s))", + "Wert %i überschreibt Daten (um %i Byte(s))", + "Wert %i überschreibt Register oder I/O Bereich (um %i Byte(s))", + "SRAM Größe um %i byte(s) überschritten", + "Unbenutzter Parameter @%i in Makro Definition", + "Directive '.listmac' nicht unterstützt (ignoriert)", + "Directive '.list' nicht unterstützt (ignoriert)", + "Directive '.nolist' nicht unterstützt (ignoriert)", + "\'%s\' für diesen Baustein nicht unterstützt", + "Unbekannter Baustein \'%s\'", + "Konstante zu groß", + "Bezeichner zu lang", + "EEPROM Größe um %i byte(s) überschritten", + "Illegaler oktaler Escapewert", + "Illegaler hex Escapewert", + "Oktaler Escapewert außerhalb des Bereichs", + "Illegale Character Konstante", + "Flash Speichergröße um %i word(s) überschritten", + "Macro name too long", + + /// Error messages ///////////////////////////////////////////////////////// + + "Kein Fehler" + "Undefinierte Variable referenziert", + "Undefinierte Variable referenziert in Bit Nummer", + "Undefinierte Variable referenziert in I/O Port Adresse", + "Undefinierte Variable referenziert in Sprung", + "Undefinierte Variable referenziert in Bitmaske", + "Undefinierte Variable referenziert in Konstante", + "Undefinierte Variable referenziert in Adresse", + "Undefinierte Variable referenziert in Versatz", + "Undefinierte Variable referenziert in relativen Aufruf", + "Undefinierte Variable referenziert in relativen Sprung", + "Undefinierte Variable referenziert in Sprung/Aufruf", + "Undefinierte Variable referenziert in Konstante in .db", + "Undefinierte Variable referenziert in Konstante in .dw", + "Undefinierte Variable referenziert in Offset", + "Undefinierte Variable referenziert in Konstante in .byte", + "Division durch Null", + "Ungültiges register (r16-r31)", + "Ungültiges register %s", + "Verzweigung (rückwärts) überschreitet Bereich um %i Worte", + "Verzweigung (vorwärts) überschreitet Bereich um %i Worte", + "Ungültiges Register (r24/r26/r28/r30)", + "Ungültiges Quellregister r%i (X/Y/Z)", + "Ungültiges Zielregister r%i (X/Y/Z)", + "Aufruf (rückwärts) überschreitet Bereich um %i Worte", + "Aufruf (vorwärts) überschreitet Bereich um %i Worte", + "Sprung (rückwärts) überschreitet Bereich um %i Worte", + "Sprung (vorwärts) überschreitet Bereich um %i Worte", + "Label \'%s\' bereits in Zeile %i in \'%s\' definiert", + "Label \'%s\' bereits in Zeile %i in \'%s\' definiert", + "Variable \'%s\' bereits in Zeile %i in \'%s\' als Label definiert", + ".dw in DSEG (nur in CSEG and ESEG zulässig)", + ".db in DSEG (nur in CSEG and ESEG zulässig)", + "Makro \'%s\' bereits definiert (oder Label doppelt verwendet)", + "Programkode in DSEG (nur in CSEG erlaubt)", + "Programkode in ESEG (nur in CSEG erlaubt)", + "Include \'%s\' kann nicht verarbeitet werden - zu viele Includedateien", /*FIXME*/ + "Ungültiger Name für Includedatei", + "Datei \'%s\' kann nicht geöffnet werden", + "Makro kann nicht aufgelöst werden - zu viele Makroebenen",/*FIXME*/ + "Dateiende in Makrodefinition erreicht", + "Dateiname zu lang in Zeile %i in \'%s\'", + "Ungültiger Dateiname", + "Register erwartet", + "Ungültiges Register verwendet", + "Ungültiges Register oder immediate",/*FIXME*/ + "Ungültige immediate Konstante",/*FIXME*/ + "Unerwartetes Argument", + "Unbekannter Opcode", + "ID = register erwartet", + "Wert (,Wert ,...) erwartet", + "Argumente dürfen nicht angegeben werden", + "Wert/Label erwartet", + "ID = Ausdruck erwartet", + "Bausteinname erwartet", + "Variablen Deklaration in CSEG", + "Macro ohne Name", + "Undefinierte Escapesequence %s", + "Kein Dateiname angegeben", + "Macro vor Definition benutzt", + "Undefinierte Escapesequence \'\\%c\'", + ".endmacro Directive nicht erwartet", + "Macro Definition innerhalb Makro nicht erlaubt", + "Register, Versatz erwartet", + "Versatz, Register erwartet", + "Für X kann kein Versatz angegeben werden ( nur für Y/Z)", + "Invalid register r%d (expected r23-r31)", + "Displacement can not be specified here", + "Invalid register specified, expected 'Z'", + "Pre-increment is invalid here (use 'Z' or 'Z+')", + "Invalid register r%d (expected r%d-r%d)", + "Invalid register r%d (expected r0, r2, ...)", + + /// Fatal errors /////////////////////////////////////////////////////////// + + "Kein fataler Fehler", + "Speicherbedarf zu groß", + "Zeile zu kang in \'%s\'", + "Makro mit zu langer Zeile in %i in \'%s\'", + "Eingabedatei kann nicht geöffnet werden \'%s\'", + "Listdatei kann nicht geöffnet werden \'%s\'", + "Ausgabedatei kann nicht geöffnet werden\'%s\'", + "ROM Datei kann nicht geöffnet werden \'%s\'", + "Zu viele Includedateinen", + "Kodegröße überschritten", + "EEPROM Größe überschritten", + "Makroschachtelung zu tief", + + /// Messages /////////////////////////////////////////////////////////////// + + "Keine Mitteilung", + "Leere ROM Datei", + "ROM Datei kann nicht im .obj Formay gespeichert werden", + "Keine Eingabedatei angegeben", + "Unbekannte Option '%s'", + "Mehr Optionen als m/i/j/b/h angegeben", + "Keine ROM Datei angegeben", + "Rom Dateiname zu lang", + "Ungültiger Name für ROM Datei", + "Keine Listdatei angegeben", + "Name für Listdatei zu lang", + "Ungültiger Name für Listdatei", + "Name für Ausgabedatei fehlt", + "Name für Ausgabedatei zu lang", + "Ungültiger Name für Ausgabedatei", + "Mehrere Namen für Ausgabedatei angegeben", + "Name für Eingabedatei zu lang", + "Ungültiger Name für Eingabedatei", + "Mehrere Namen für Eingabedatei angegeben", + "Fehler : %i", + "Warnungen : %i", + "Kode : %i", + "Rom : %i", + "Data : %i", + "Freier Kode : %i", + "Freies Rom : %i", + "Kein Kode erzeugt", + "| Bausteintype | Ram Start |Flash Größe |Ram Größe |EEPROM Größe |", + "No include path found after '-I' flag", + "Too many include paths specified", + "Include pathname too long" +}; + +#endif /* _UTILS_CC_ */ + +#endif /* _MSG_DE_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/msg_sp.hh b/src/mkutil/tavrasm.118/src/msg_sp.hh new file mode 100644 index 00000000..848df9a8 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/msg_sp.hh @@ -0,0 +1,245 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Archivo : msg_sp.hh +// +// Autor : Lluis Ballester - Copyright (C) 1999 +// +// Descripcion : Spanish assembler messages +// +// Historia +// ======================================================================== +// +// 980127 : Tom - Archivo creado - Mensajes trasladados desde 'message.hh'. +// 991222 : Kurt- New command line option -x +// +//////////////////////////////////////////////////////// Tom hizo esto /////// +// +// Nota Copyright : +// +// tavrasm - Un ensamblador GNU/Linux para las series Atmel AVR +// de microcontroladoras. Copyright (C) 1999 Tom Mortensen +// +// Este programa es software gratuito; puedes redistribuirlo y/o modificarlo +// bajo los terminos de la licencia publica general GNU +// como fue publicado por la Free Software Foindation (findacion de Software gratuito); desde la +// version 2 de la Licencia, o (a tu eleccion) cualquier version posterior. +// +// Este programa es distribuido con la esperanza de que sea totalmente funcional, +// pero SIN NINGuN TIPO DE GARANTiA; sin igualmente la garantia incluida de +// MERCHANTABILITY(mercantibilidad) o FITNESS (propiedad) PARA PROPOSITO +// PERSONAL.Ver la GNU General Public License( Licencia Publica General ) para mas detalles. +// +// Deberias haber recibido una copia de la GNU ( Licencia Publica General ) +// con este programa ; si no lo has recibido, escribe a la: Free Software +// Fundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + + +#ifndef _MSG_US_HH_ +#define _MSG_US_HH_ + +// info linea comandos /////////////////////////////////////////////////////// + +#define HELPSTR \ +"uso: tavrasm [-vwclxmihjgbafd] \n" \ +" [-I ]... [-o ] [-r ] [-e ]\n" \ +" -v verbose\n" \ +" -w no advertencias\n" \ +" -c etiquetas case sensitive /defenes\n" \ +" -l limite ancho log a 80 caracters\n" \ +" -x allow local labels\n" \ +" -m Formato de salida Motorola S-record \n" \ +" -i Formato de salida Intel HEX (default)\n" \ +" -h omit address extension record from Intel HEX files\n" \ +" -j Formato de salida .obj \n" \ +" -g Salida generica hex\n" \ +" -b Formato de salida binaria\n" \ +" -a wrap relativa jumps\n" \ +" -f allow forward org's\n" \ +" -d Lista de los dispositivos soportados\n" + +// Cadenas de mensajes ////////////////////////////////////////////////////// + +#ifdef _UTILS_CC_ + +char messages[MESSAGE_COUNT][MESSAGES_LEN]= +{ + "No advertencias", + "Caracter invalido \'%c\' en codigo", + "Caracter invalido 0x%02X en codigo", + "Argumento @%i especificados, pero no usado en macro", + "Argumento @%i no especificado, pero usado en macro", + "\'%s\' ya definida como etiqueta en linea %i en \'%s\'", + "\'%s\' ya definida en linea %i en \'%s\'", + "Resultado Integer de EXP2(%i) esta fijado a cero", + "Resultado Integer de LOG2(%i) esta fijado a cero", + "Numero bit '\%i\' fuera de rango (0-7)", + "I/O Pot 0x%X fuera de rango (0x00-0x1F)", + "I/O Pot 0x%X fuera de rango (0x00-0x3F)", + "Bit mask 0x%X fuera de rango (0x00-0xFF)", + "Constante 0x%X fuera de rango (0x00-0x3F)", + "Constante 0x%X fuera de rango (0x00-0xFF)", + "Constante 0x%X fuera de rango (0x00-0xFFFF)", + "Direccion 0x%X fuera de rango (0x0-0xFFFF)", + "Desplazamiento \'%X\' esta fuera de rango (0x00 - 0x3F)", + "Direccion de destino \'0x%X\' fuera de rango (0x0-0x3FFFFF)", + "Valor %i fuera de rango en .db (-128 to 255)", + "Valor %i fuera de rango en .dw (-32768 to 65535)", + "Valor %i mueve PC atras sobre codigo (by %i wods)", + "Valor %i sobreescribe informacion EEPROM (by %i byte(s))", + "Valor %i sobreescribe informacion (by %i byte(s))", + "Valor %i sobreescribe Registro o I/O area (by %i byte(s))", + "SRAM tamanyo excedido por %i byte(s)", + " Parametro no usado @%i en definicion de macro", + "La directiva '.listmac' no es soportada (ignorada)", + "La directiva '.list' no es soportada (ignorada)", + "La directiva '.nolist' is nosuppoted (ignorada)", + "\'%s\' no soportado por este dispositivo", + "Dispositivo desconocido \'%s\'", + "Constante demasiada grande", + "Identificador demasiado largo", + "Tamanyo EEPROM excedido por %i byte(s)", + "Valor de escape octal ilegal" + "Valor de escape hexadecimal ilegal", + "Valor Octal de escape fuera de rango", + " Caracter de constante ilegal", + "Tamanyo flash excedido por %i word(s)", + "Macro name too long", + + /// Mensajes de error ////////////////////////////////////////////////////// + + "No error" + "Variable referenciada indefinida " + "Variable referenciada indefinida en numero bit ", + "Variable referenciada indefinida en I/O puerto direccion", + "Variable referenciada indefinida en rama", + "Variable referenciada indefinida en bit mask", + "Variable referenciada indefinida en constante", + "Variable referenciada indefinida en direccion", + "Variable referenciada indefinida en desplazamiento", + "Variable referenciada indefinida en relative call", + "Variable referenciada indefinida en relative jump", + "Variable referenciada indefinida en jump/call", + "Variable referenciada indefinida en constante en .db", + "Variable referenciada indefinida en constante en .dw", + "Variable referenciada indefinida en offset", + "Variable referenciada indefinida en constante en .byte", + "Division por cero", + "Registro invalido (r16-r31)", + "Registro invalido %s", + "Rama fuera de rango por %i words (por detras)", + "Rama fuera de rango por %i words (por delante)", + "Registro invalido (r24/r26/r28/r30)", + "Registro de codigo invalido r%i (X/Y/Z)", + "Registro de destino invalido r%i (X/Y/Z)", + "Llamada(call) fuera de rango por %i words (por detras)", + "Llamada(call) fuera de rango por%i words (por delante)", + "Jump fuera de rango por %i words (por detras)", + "Jump fuera de rango por %i words (por delante)", + "Etiqueta \'%s\' ya definida en linea %i en \'%s\'", + "Etiqueta \'%s\' ya definida en linea %i en \'%s\'", + "Variable \'%s\' ya definida como etiqueta en linea %i en \'%s\'", + ".dw en DSEG (solo permitido en CSEG y ESEG)", + ".db en DSEG (solo permitido en CSEG y ESEG)", + "Macro \'%s\' ya definida (o etiqueta duplicada)", + "Codigo de programa en DSEG (solo permitido en CSEG)", + "Codigo de programa en ESEG (solo permitido en CSEG)", + "Imposible incluir archivo \'%s\' - incluir profundidad(depth) excedida", + "Nombre de archivo incluido invalido especificado", + "Imposible abrir archivo \'%s\'", + "Imposible expandir macro - profundidad contextual (context depth) excedida", + "Final de archivo alcanzado en definicion de macro", + "Nombre de archivo demasiado largo en linea %i en \'%s\'", + "Invalido nombre de archivo", + "Registro esperado", + "Registro invalido especificado", + "Registro invalido o inmediato", + "Constante inmediata invalida", + "No argumento esperado", + "Desconocido opcodigo", + "Esperado ID = registro", + "Esperado valor (,valor ,...) ", + "No argumentos deben ser especificados", + "Esperado valor/etiqueta", + "Esperado ID = expresion", + "Esperado nombre de dispositivo", + "Declaracion de variable en CSEG", + "Macro sin nombre", + "Secuencia de escape indefinida %s", + "No nombre de archivo especificado", + "Macro usada antes definida", + "Secuencia de escape indefinida \'\\%c\'", + "Inesperada directiva .finalmacro ", + "Definicion de macro dentro de macro no permitida", + "Registro esperado, desplazamiento", + "Desplazamiento esperado, registro", + "No desplazamiento pueden ser especificados para X (usar Y/Z)", + "Invalid register r%d (expected r23-r31)", + "Displacement can not be specified here", + "Invalid register specified, expected 'Z'", + "Pre-increment is invalid here (use 'Z' or 'Z+')", + "Invalid register r%d (expected r%d-r%d)", + "Invalid register r%d (expected r0, r2, ...)", + + /// Errores fatales //////////////////////////////////////////////////////// + + "No error fatal", + "Fuera de memoria", + "Linea demasiada larga en \'%s\'", + "Linea de macro demasiado larga en linea %i en \'%s\'", + "Imposible abrir archivo de entrada \'%s\'", + "Imposible abrir archivo list\'%s\'", + "Imposible abrir archivo de salida \'%s\'", + "Imposible abrir archivo rom\'%s\'", + "Demasiados archivos incluidos", + "Tamanyo de codigo excedido", + "Tamanyo EEPROM excedido", + "Profundidad maxima de macro excedida", + + /// Mensajes /////////////////////////////////////////////////////////////// + + "No mensaje", + "Archivo rom vacio", + "No se puede salvar archivo rom con formato .obj", + "No nombre de archivo de entrada especificado", + "Opcion desconocida '%s'", + "Mas de uno de m/i/j/b/h especificados", + "No nombre de archivo rom especificados", + "Nombre de archivo rom demasiado largo", + "Nombre de Archivo rom ilegal", + "No nombre de archivo rom especificado", + "Lista de nombre de archivos demasiada larga", + "Lista de nombres de archivos ilegal", + "No nombre de archivo de salida especificado", + "Nombre de archivo de salida demasiado largo", + "Nombre de archivo de salida ilegal", + "Multiples archivos de salida especificados", + "Nombre de entrada demasiado largo ", + "Nombre de entrada ilegal", + "Multitud de archivos de entrada especificados", + "Errores : %i", + "Advertencias : %i", + "Codigo : %i", + "Rom : %i", + "Informacion(data) : %i", + "Codigo sin usar : %i", + "Rom sin usar : %i", + "No codigo generado", + "| Dispositivo | Ram start | Flash | Ram | EEPROM |", + "No include path found after '-I' flag", + "Too many include paths specified", + "Include pathname too long" + +}; + +#endif /* _UTILS_CC_ */ + +#endif /* _MESSAGES_HH_ */ + +/// FINAL DE ARCHIVO ///////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/msg_us.hh b/src/mkutil/tavrasm.118/src/msg_us.hh new file mode 100644 index 00000000..3678da2b --- /dev/null +++ b/src/mkutil/tavrasm.118/src/msg_us.hh @@ -0,0 +1,243 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : msg_us.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : US assembler messages +// +// History +// ======================================================================== +// +// 980127 : Tom - File created - Messages moved from 'message.hh'. +// 991222 : Kurt- New command line option -x +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _MSG_US_HH_ +#define _MSG_US_HH_ + +// Command line info ///////////////////////////////////////////////////////// + +#define HELPSTR \ +"usage: tavrasm [-vwclxmihjgbafd] \n" \ +" [-I ]... [-o ] [-r ] [-e ]\n" \ +" -v verbose\n" \ +" -w no warnings\n" \ +" -c case sensitive labels/defines\n" \ +" -l limit log width to 80 characters\n" \ +" -x allow local labels\n" \ +" -m output Motorola S-record format\n" \ +" -i output Intel HEX format (default)\n" \ +" -h omit address extension record from Intel HEX files\n"\ +" -j output .obj format\n" \ +" -g output generic hex\n" \ +" -b output binary format\n" \ +" -a wrap relative jumps\n" \ +" -f allow forward org's\n" \ +" -d list supported devices\n" + +// Message strings /////////////////////////////////////////////////////////// + +#ifdef _UTILS_CC_ + +char messages[MESSAGE_COUNT][MESSAGES_LEN]= +{ + "No warning", + "Invalid character \'%c\' in source", + "Invalid character 0x%02X in source", + "Argument @%i specified, but not used in macro", + "Argument @%i not specified, but used in macro", + "\'%s\' already defined as label at line %i in \'%s\'", + "\'%s\' already defined at line %i in \'%s\'", + "Integer result of EXP2(%i) is set to zero", + "Integer result of LOG2(%i) is set to zero", + "Bit number '%i' out of range (0-7)", /* Nick */ + "I/O Port 0x%X out of range (0x00-0x1F)", + "I/O Port 0x%X out of range (0x00-0x3F)", + "Bit mask 0x%X out of range (0x00-0xFF)", + "Constant 0x%X out of range (0x00-0x3F)", + "Constant 0x%X out of range (0x00-0xFF)", + "Constant 0x%X out of range (0x00-0xFFFF)", + "Address 0x%X out of range (0x0-0xFFFF)", + "Displacement \'%X\' is out of range (0x00 - 0x3F)", + "Destination address \'0x%X\' out of range (0x0-0x3FFFFF)", + "Value %i out of range in .db (-128 to 255)", + "Value %i out of range in .dw (-32768 to 65535)", + "Value %i moves PC back over code (by %i words)", + "Value %i overwrites EEPROM data (by %i byte(s))", + "Value %i overwrites data (by %i byte(s))", + "Value %i overwrites Register or I/O area (by %i byte(s))", + "SRAM size exceeded by %i byte(s)", + "Unused parameter @%i in macro definition", + "The directive '.listmac' is not supported (ignored)", + "The directive '.list' is not supported (ignored)", + "The directive '.nolist' is not supported (ignored)", + "\'%s\' not supported on this device", + "Unknown device \'%s\'", + "Constant too big", + "Identifier too long", + "EEPROM size exceeded by %i byte(s)", + "Illegal octal escape value", + "Illegal hex escape value", + "Octal escape value out of range", + "Illegal character constant", + "Flash size exceeded by %i word(s)", + "Macro name too long", + + /// Error messages ///////////////////////////////////////////////////////// + + "No error" + "Undefined variable referenced", + "Undefined variable referenced in bit number", + "Undefined variable referenced in I/O port address", + "Undefined variable referenced in branch", + "Undefined variable referenced in bit mask", + "Undefined variable referenced in constant", + "Undefined variable referenced in address", + "Undefined variable referenced in displacement", + "Undefined variable referenced in relative call", + "Undefined variable referenced in relative jump", + "Undefined variable referenced in jump/call", + "Undefined variable referenced in constant in .db", + "Undefined variable referenced in constant in .dw", + "Undefined variable referenced in offset", + "Undefined variable referenced in constant in .byte", + "Division by zero", + "Invalid register (r16-r31)", + "Invalid register %s", + "Branch out of range by %i words (backwards)", + "Branch out of range by %i words (forward)", + "Invalid register (r24/r26/r28/r30)", + "Invalid source register r%i (X/Y/Z)", + "Invalid destination register r%i (X/Y/Z)", + "Call out of range by %i words (backwards)", + "Call out of range by %i words (forward)", + "Jump out of range by %i words (backwards)", + "Jump out of range by %i words (forward)", + "Label \'%s\' already defined at line %i in \'%s\'", + "Label \'%s\' already defined at line %i in \'%s\'", + "Variable \'%s\' already defined as label at line %i in \'%s\'", + ".dw in DSEG (only allowed in CSEG and ESEG)", + ".db in DSEG (only allowed in CSEG and ESEG)", + "Macro \'%s\' already defined (or duplicates label)", + "Program code in DSEG (only allowed in CSEG)", + "Program code in ESEG (only allowed in CSEG)", + "Unable to include file \'%s\' - include depth exceeded", + "Invalid include filename specified", + "Unable to open file \'%s\'", + "Unable to expand macro - context depth exceeded", + "End of file reached in macro definition", + "Filename too long at line %i in \'%s\'", + "Invalid filename", + "Register expected", + "Invalid register specified", + "Invalid register or immediate", + "Invalid immediate constant", + "No argument expected", + "Unknown opcode", + "Expected ID = register", + "Expected value (,value ,...) ", + "No arguments should be specified", + "Expected value/label", + "Expected ID = expression", + "Expected device name", + "Variable declaration in CSEG", + "Macro with no name", + "Undefined escape sequence %s", + "No filename specified", + "Macro used before it is defined", + "Undefined escape sequence \'\\%c\'", + "Unexpected .endmacro directive", + "Macro definition within macro not allowed", + "Expected register, displacement", + "Expected displacement, register", + "No displacement can be specified for X (use Y/Z)", + "Invalid register r%d (expected r23-r31)", + "Displacement can not be specified here", + "Invalid register specified, expected 'Z'", + "Pre-increment is invalid here (use 'Z' or 'Z+')", + "Invalid register r%d (expected r%d-r%d)", + "Invalid register r%d (expected r0, r2, ...)", + + /// Fatal errors /////////////////////////////////////////////////////////// + + "No fatal error", + "Out of memory", + "Line too long in \'%s\'", + "Macro line too long at line %i in \'%s\'", + "Unable to open input file \'%s\'", + "Unable to open list file \'%s\'", + "Unable to open output file \'%s\'", + "Unable to open rom file \'%s\'", + "Too many files included", + "Code size exceeded", + "EEPROM size exceeded", + "Max macro depth exceeded", + + /// Messages /////////////////////////////////////////////////////////////// + + "No message", + "Empty rom file", + "Can not save rom file with .obj format", + "No input filename specified", + "Unknown option '%s'", + "More than one of m/i/j/b/h specified", + "No rom filename specified", + "Rom filename too long", + "Illegal rom filename", + "No list filename specified", + "List filename too long", + "Illegal list filename", + "No output filename specified", + "Output filename too long", + "Illegal output filename", + "Multiple output files specified", + "Input filename too long", + "Illegal input filename", + "Multiple input files specified", + "Errors : %i", + "Warnings : %i", + "Code : %i", + "Rom : %i", + "Data : %i", + "Unused Code : %i", + "Unused Rom : %i", + "No code generated", + "| Device name | Ram start | Flash Size | Ram size | EEPROM Size |", + "No include path found after '-I' flag", + "Too many include paths specified", + "Include pathname too long" +}; + +#endif /* _UTILS_CC_ */ + +#endif /* _MESSAGES_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/n.bat b/src/mkutil/tavrasm.118/src/n.bat new file mode 100644 index 00000000..14eb1182 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/n.bat @@ -0,0 +1,6 @@ +del tavrasm.exe +cl -Zi -I. -DAVRLANG=LANGUAGE_US -otavrasm.exe -Tpavrasm.cc -Tpsemantic.cc -Tpsymbol.cc -Tputils.cc -Tpavrparse.cc -Tpavrlex.cc +del *.obj +del *.pdb +del *.ilk +copy tavrasm.exe ..\..\..\bin diff --git a/src/mkutil/tavrasm.118/src/opcodes.hh b/src/mkutil/tavrasm.118/src/opcodes.hh new file mode 100644 index 00000000..35235b04 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/opcodes.hh @@ -0,0 +1,227 @@ +///////////////////////////////////////////////////////////////////////////// +// +// File : opcodes.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : ATMEL AVR opcodes +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _OPCODES_HH_ +#define _OPCODES_HH_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include "avrasm.hh" + +////////////////////////////////////////////////////////////////////////////// +// +// Branch instructions - [1111 0#-- ---- -###] +// + +#define O_BRCC 0xF400 // i Branch if Carry Cleared +#define O_BRCS 0xF000 // i Branch if Carry Set +#define O_BRNE 0xF401 // i Branch if Not Equal +#define O_BREQ 0xF001 // i Branch if Equal +#define O_BRPL 0xF402 // i Branch if Plus +#define O_BRMI 0xF002 // i Branch if Minus +#define O_BRVC 0xF403 // i Branch if Overflow Cleared +#define O_BRVS 0xF003 // i Branch if Overflow Set +#define O_BRGE 0xF404 // i Branch if Greater or Equal (Signed) +#define O_BRLT 0xF004 // i Branch if Less Than (Signed) +#define O_BRHC 0xF405 // i Branch if Half Carry Flag is Cleared +#define O_BRHS 0xF005 // i Branch if Half Carry Flag is Set +#define O_BRTC 0xF406 // i Branch if the T Flag is Cleared +#define O_BRTS 0xF006 // i Branch if the T Flag is Set +#define O_BRID 0xF407 // i Branch if Global Interrupt is Disabled +#define O_BRIE 0xF007 // i Branch if Global Interrupt is Enabled +#define O_BRSH (8+0xF400) // i Branch if Same or Higher (Unsigned)(BRCC) +#define O_BRLO (8+0xF000) // i Branch if Lower (BRCS) + +////////////////////////////////////////////////////////////////////////////// +// +// Noarg instructions - [1001 0100 #### 0100] +// + +#define O_SEC 0x9408 // Set Carry Flag +#define O_SEZ 0x9418 // Set Zero Flag +#define O_SEN 0x9428 // Set Negative Flag +#define O_SEV 0x9438 // Set Overflow Flag +#define O_SES 0x9448 // Set Signed Flag +#define O_SEH 0x9458 // Set Half Carry Flag +#define O_SET 0x9468 // Set T Flag +#define O_SEI 0x9478 // Set Global Interrupt Flag + +#define O_CLC 0x9488 // Clear Carry Flag +#define O_CLZ 0x9498 // Clear Zero Flag +#define O_CLN 0x94A8 // Clear Negative Flag +#define O_CLV 0x94B8 // Clear Overflow Flag +#define O_CLS 0x94C8 // Clear Signed Flag +#define O_CLH 0x94D8 // Clear Half Carry Flag +#define O_CLT 0x94E8 // Clear T Flag +#define O_CLI 0x94F8 // Clear Global Interrupt Flag + +#define O_NOP 0x0000 // No Operation +#define O_ICALL 0x9509 // Indirect Call to Subroutine +#define O_IJMP 0x9409 // Indirect Jump + +#define O_RETI 0x9518 // Return from Interrupt +#define O_RET 0x9508 // Return from Subroutine +#define O_SLEEP 0x9588 // Sleep +#define O_WDR 0x95A8 // Wathcdog Reset + +#define O_EIJMP 0x9419 // Extended indirect jump (1) +#define O_EICALL 0x9519 // Extended indirect call to subroutine (1) +#define O_ESPM 0x95F8 // Extended store program memory (1) +#define O_SPM 0x95E8 // Store program memory (1) + +////////////////////////////////////////////////////////////////////////////// +// +// Reg/Reg instructions - [#-## ##-- ---- ----] +// + +#define O_CPC 0x0400 // rr Compare with Carry +#define O_CP 0x1400 // rr Compare +#define O_SBC 0x0800 // rr Subtract with Carry +#define O_SUB 0x1800 // rr Subtract without Carry +#define O_ADD 0x0C00 // rr Add without Carry +#define O_ADC 0x1C00 // rr Add with Carry +#define O_CPSE 0x1000 // rr Compares Skip if Equal +#define O_AND 0x2000 // rr Logical AND +#define O_EOR 0x2400 // rr Exclusive OR +#define O_OR 0x2800 // rr Logical OR +#define O_MOV 0x2C00 // rr Copy Register +#define O_MUL 0x9C00 // rr Multiply +#define O_MOVW 0x0100 // rr Copy register word (1) +#define O_MULS 0x0200 // rr Multiply Signed (1) +#define O_MULSU 0x0300 // rr Multiply Signed with Unsiged (1) +#define O_FMUL 0x0308 // rr Fractional Multiply (1) +#define O_FMULS 0x0380 // rr Fractional Multiply Signed (1) +#define O_FMULSU 0x0388 // rr Fractional Multiply Signed with Unsiged (1) + +////////////////////////////////////////////////////////////////////////////// +// +// Reg/Imm instructions - [#-## ##-- ---- ----] +// + + // Reg/Imm word + +#define O_ADIW 0x9600 // rw Add Immediate to Word +#define O_SBIW 0x9700 // rw Subtract Immediate to Word + + // Reg/imm - [#### ---- ---- ----] + +#define O_CPI 0x3000 // ri Compare with Immediate +#define O_SBCI 0x4000 // ri Subtract Immediate with Carry +#define O_SUBI 0x5000 // ri Subtract Immediate +#define O_ORI 0x6000 // ri Logical OR with Immediate +#define O_ANDI 0x7000 // ri Logical AND with Immediate +#define O_LDI 0xE000 // ri Load Immediate +#define O_SBR (1+0x6000) // ri Set Bits in register (Same as ORI) + +////////////////////////////////////////////////////////////////////////////// +// +// Register instructions - [---- ---- ---- ----] +// + +#define O_COM 0x9400 // r One's Complement +#define O_NEG 0x9401 // r Two's Complement +#define O_SWAP 0x9402 // r Swap Nibbles +#define O_INC 0x9403 // r Increment +#define O_ASR 0x9405 // r Arithmetic Shift Right +#define O_LSR 0x9406 // r Logical Shift Right +#define O_ROR 0x9407 // r Rotate Right Trough Carry +#define O_DEC 0x940A // r Decrement +#define O_POP 0x900F // r Pop Register from Stack +#define O_PUSH 0x920F // r Push Register on Stack +#define O_CLR (1+0x2400) // r Clear Regiser (Same as EOR Rd, Rd) +#define O_TST 0x2000 // r Test for Zero or Minus + +////////////////////////////////////////////////////////////////////////////// +// +// immediate instructions - [---- ---- ---- ----] +// + +#define O_BCLR 0x9488 // i Bit Clear in SREG +#define O_BSET 0x9408 // i Bit Set in SREG +#define O_RCALL 0xD000 // i Relative Call To Subroutine +#define O_RJMP 0xC000 // i Relative Jump +#define O_BRBC 0xF400 // ii Branch if Bit in SREG is Cleared +#define O_BRBS 0xF000 // ii Branch if Bit in SREG is Set +#define O_CBI 0x9800 // ii Clear Bit in I/O Register +#define O_SBI 0x9A00 // ii Set Bit in I/O Register +#define O_SBIC 0x9900 // ii Skip if Bit in I/O Register is Cleared +#define O_SBIS 0x9B00 // ii Skip if Bit in I/O Register is Set +#define O_OUT 0xB800 // ir Store Register to I/O Port +#define O_BLD 0xF800 // ri Bit Load from T in Sreg to bit in Register +#define O_BST 0xFA00 // ri Bit store from Bit in Register to T in SREG +#define O_CBR (1+0x7000) // ri Clear Bits in Register (Same as ANDI) +#define O_IN 0xB000 // ri Load an I/O Port to register +#define O_SBRC 0xFC00 // ri Skip if Bit in Register is Cleared +#define O_SBRS 0xFE00 // ri Skip if Bit in Register is Set +#define O_ROL (1+0x1C00) // r Rotate Left trough Carry (Same as ADC Rd,Rd) +#define O_SER 0xEF0F // r Set all bits in Register +#define O_LSL (1+0x0C00) // r Logical Shift Left (Same as ADD Rd,Rd) +#define O_JMP 0x940C // i Jump +#define O_CALL 0x940E // i Long Call to a Subroutine +#define O_LDS 0x9000 // rl Load direct from SRAM +#define O_STS 0x9200 // lr Store direct to SRAM + +#define O_LD 0x8000 // rX Load indirect from SRAM using index X/Y/Z +#define O_ST 0x8200 // Xr Store Indirect to SRAM using index X/Y/Z +#define O_LDD (8+0x8000) // rD Load indirect from SRAM using displacement +#define O_STD (8+0x8200) // Dr Store Indirect to SRAM using displacement + +#define O_STD (8+0x8200) // Dr Store Indirect to SRAM using displacement + +////////////////////////////////////////////////////////////////////////////// +// +// (E)LPM instructions - [---- ---- ---- ----] +// + +#define O_LPM 0x95C8 // Load Program Memory +#define O_ELPM 0x95D8 // __ Extended load program memory (1) + + + + + + + +#endif /* _OPCODES_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/tavrasm.118/src/semantic.cc b/src/mkutil/tavrasm.118/src/semantic.cc new file mode 100644 index 00000000..9e8dc3fe --- /dev/null +++ b/src/mkutil/tavrasm.118/src/semantic.cc @@ -0,0 +1,1659 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : semantic.cc +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Implements code generation functions +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 990516 : Tom - Added support for wrapping in branch/rcall/rjmp +// 990721 : Tom - Fixed SBR (bit 0 was always set) +// 991209 : Tom - Fixed problem with BRBC/BRBS (they did not work :( +// 991211 : Tom - Added the new instructions: 'eijmp', 'eicall', 'espm', +// 'mulsu', 'fmul', 'fmuls', 'fmulsu', 'muls', 'movw', +// 'elpm'. And changed behaviour of 'lpm' according to +// Atmel specs. +// 991217 : Kurt- Valid range for W_CONST_OUT_OF_RANGE_FF expanded to +// -255...255. TODO: Change the error messages. +// 991217 : Kurt- Support of local labels. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include "avrasm.hh" +#include "semantic.hh" +#include "symbol.hh" +#include "utils.hh" + +/// Externals //////////////////////////////////////////////////////////////// + +GLOBALS(extern); + +/// Functions //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Handle '.device' directive + // + +void doDev(symbolSA devicename) +{ + int devfound = -1; + + for(int devno=0; (devfound==-1) && yydevices[devno].name[0]; devno++) + { + // this is just a stricmp/strcasecmp + + int c; + + for(c=0; devicename->name[c] && + (tolower(yydevices[devno].name[c]) == + tolower(devicename->name[c])); c++); + + if(!yydevices[devno].name[c] && !devicename->name[c]) + devfound = devno; + } + + if(devfound == -1) + warning(W_UNKNOWN_DEV, devicename -> name); + else + yydeviceno = devfound; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle directive '.byte' + // + +void doByt(valueSA *value) +{ + if(! (value->valid)) + error(E_UNKNOWN_BYTE); + else if(yysegment == SEGMENT_CODE) + error(E_VAR_IN_CSEG); + else if(yysegment == SEGMENT_DATA) + { + yydefinestart = yydatapos; + yydatapos+=value->value; + } + else if(yysegment == SEGMENT_EEPROM) + { + yydefinestart = yyerompos; + yydefinetype = SEGMENT_DEFINE_BYTE; + + for(int c=0;cvalue;c++) + insertdata(0); + + if(yyerompos > DEVINF.eepromsize) + warning(W_EROM_EXCEED,yyerompos-DEVINF.eepromsize); + } + else + internalerror("BY %04X", yysegment); + +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle directive '.org' + // + +void doOrg(valueSA *value) +{ + if( !value->valid ) + { + error(E_UNKNOWN_ORG); + return; + } + + if(yysegment == SEGMENT_CODE) + { + if(!yycfg->forwardorg && (value->value < (yycodepos+1)/2)) + warning(W_ORG_OUT_OF_RANGE,value->value,(yycodepos+1)/2-value->value); + if(yycodeposhigh < yycodepos) + yycodeposhigh = yycodepos; + yycodepos = 2*value->value; + } + else if(yysegment == SEGMENT_EEPROM) + { + if(!yycfg->forwardorg && (value->value < yyerompos)) + warning(W_ORG_OUT_OF_RANGE_ESEG,value->value, yyerompos - value->value); + if(yyeromposhighvalue; + } + else if(yysegment == SEGMENT_DATA) + { + if(value->value < DEVINF.datastart) + warning(W_ORG_OVER_REG,value->value,DEVINF.datastart-value->value); + else if(!yycfg->forwardorg && (value->value < yydatapos)) + warning(W_ORG_OUT_OF_RANGE_DSEG,value->value, yydatapos - value->value); + if(yydataposhigh < yydatapos) + yydataposhigh = yydatapos; + yydatapos = value->value; + } + else + internalerror("US %08X", yysegment); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Initialize '.db' directive + // + +void doAdb(void) +{ + if(yysegment == SEGMENT_CODE) + yydefinestart = yycodepos; + else if(yysegment == SEGMENT_EEPROM) + yydefinestart = yyerompos; + else + errorin(E_DB_IN_DSEG); + + yyeol = FALSE; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add '.db' arguments + // + +void doAdb(valueSA *value) +{ + if( value->valid) + { + if( yyeol && ((value->value < -128) || (value->value > 255)) ) + warning(W_DB_OUT_OF_RANGE, value->value); + else if( (value->value < -128) || (value->value > 255) ) + warningin(W_DB_OUT_OF_RANGE, value->value); + if(yysegment == SEGMENT_CODE) + insertdbdw(value->value & 0xFF); + else if(yysegment == SEGMENT_EEPROM) + insertdata(value->value & 0xFF); + } + else if(yyparseno && !(value->valid) ) + error(E_UNKNOWN_DB); + else + { + if(yysegment == SEGMENT_CODE) + insertdbdw(0); + else if(yysegment == SEGMENT_EEPROM) + insertdata(value->value); + } +} + +void doAdb(stringSA str) +{ + int c; + int val; + + str++; + + for(c=0;c<(int)strlen(str)-1; c++) + { + if(str[c]=='\\') + { + switch (str[c+1]) + { + case 'n' : val = '\n'; break; + case 't' : val = '\t'; break; + case 'v' : val = '\v'; break; + case 'b' : val = '\b'; break; + case 'r' : val = '\r'; break; + case 'f' : val = '\f'; break; + case 'a' : val = '\a'; break; + case '\\' : val = '\\'; break; + case '\'' : val = '\''; break; + case '\"' : val = '\"'; break; + case '\?' : val = '\?'; break; + case 'X' : + case 'x' : + { + val = 0; + + if( isxdigit(str[c+2] ) ) + { + if(isdigit(str[c+2])) + val = str[c+2] - '0'; + else + val = tolower(str[c+2]) - 'a' + 10; + c++; + + if( isxdigit(str[c+2] ) ) + { + if(isdigit(str[c+2])) + val = val*16 + str[c+2] - '0'; + else + val = val*16 + tolower(str[c+2]) - 'a' + 10; + c++; + } + } + } break; + + case '0' : + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + { + val = str[c+1] - '0'; + if( (str[c+2]>='0') && (str[c+2]<='7')) + { + val = val * 8 + str[++c+1] - '0'; + if( (str[c+2]>='0') && (str[c+2]<='7')) + val = val * 8 + str[++c+1] - '0'; + } + + if(val > 0xFF) + { + val = 0; + warningin(W_OCT_OUT_OF_RANGE); + } + } break; + + default : val = 0 ; errorin(E_UNDEF_ESCAPE_C,str[c+1]); + } + c++; + } + else + val = str[c]; + + if(yysegment == SEGMENT_CODE) + insertdbdw(val); + else if(yysegment == SEGMENT_EEPROM) + insertdata(val); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Initialize '.dw' directive + // + +void doAdw(void) +{ + if(yysegment == SEGMENT_CODE) + yydefinestart = yycodepos; + else if(yysegment == SEGMENT_EEPROM) + yydefinestart = yyerompos; + else + errorin(E_DW_IN_DSEG); + + yyeol = FALSE; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add '.dw' arguments + // + +void doAdw(valueSA *value) +{ + if( value-> valid ) + { + if(yyeol && ((value->value < -32768) || (value->value > 65535) ) ) + warning(W_DW_OUT_OF_RANGE, value->value); + else if( (value->value < -32768) || (value->value > 65535) ) + warningin(W_DW_OUT_OF_RANGE, value->value); + + if(yysegment == SEGMENT_CODE) + { +#ifdef _MSC_VER /* Nick */ + insertdbdw( (value->value & 0x000000FF) >> 0); + insertdbdw( (value->value & 0x0000FF00) >> 8); +#else + insertdbdw( (value->value & 0x000000FFL) >> 0); + insertdbdw( (value->value & 0x0000FF00L) >> 8); +#endif + } + else if(yysegment == SEGMENT_EEPROM) + { +#ifdef _MSC_VER /* Nick */ + insertdata( (value->value & 0x000000FF) >> 0); + insertdata( (value->value & 0x0000FF00) >> 8); +#else + insertdata( (value->value & 0x000000FFL) >> 0); + insertdata( (value->value & 0x0000FF00L) >> 8); +#endif + } + } + else if(yyparseno) + error(E_UNKNOWN_DW); + else + { + if(yysegment == SEGMENT_CODE) + { + insertdbdw(0); + insertdbdw(0); + } + else if(yysegment == SEGMENT_EEPROM) + { + insertdata(0); + insertdata(0); + } + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle directive '.equ' + // + +void doEqu(symbolSA symb, valueSA *value) +{ + if( symb->valid && (symb->valdefline != yyline-1) ) + error(E_EQU_REDEF, symb->name, symb->valdefline,symb->valfilename); + else + { + symb -> valid = value -> valid; + symb -> value = value -> value; + symb -> valdefline = yyline - 1; + symb -> segment = yysegment; + strcpy(symb->valfilename, yyfilename); + if( !value -> valid ) + error(E_UNKNOWN); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle directive '.set' + // + +void doSet(symbolSA symb, valueSA *value) +{ + if( (symb->valid) && (!symb->isvar)) + error(E_LABEL_VAR, symb->name, symb->valdefline, symb->valfilename); + else + { + symb -> isvar = TRUE; + symb -> valid = value -> valid; + symb -> value = value -> value; + symb -> valdefline = yyline; + symb -> segment = yysegment; + strcpy(symb->valfilename, yyfilename); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Defines like ".def REG0 = r0" + // + +void doDef(symbolSA symb, regSA reg) +{ + if( symb->isdefine ) + { + if( (symb->reg != reg) && yyparseno ) + { + warning(W_REGREDEF ,symb->name,symb->regdefline,symb->regfilename); + symb -> regdefline = yyline - 1; + symb -> reg = reg; + strcpy(symb->regfilename, yyfilename); + } + if(symb->valid) + warning(W_REGLABEL ,symb->name,symb->valdefline,symb->valfilename); + } + else + { + symb -> isdefine = TRUE; + symb -> regdefline = yyline - 1; + symb -> reg = reg; + strcpy(symb->regfilename, yyfilename); + if(symb->valid) + warning(W_REGLABEL ,symb->name,symb->valdefline,symb->valfilename); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Defines like ".def REG0 = IR0" - Notice: Not supported by ATMEL Assembler + // + +void doDef(symbolSA symbl, symbolSA symbr) +{ + if(!yyparseno) + return; + + if( symbr->isdefine ) + { + if( symbl->isdefine && (symbl->reg != symbr->reg) ) + warning(W_REGREDEF,symbl->name,symbl->regdefline,symbl->regfilename); + symbl -> isdefine = TRUE; + symbl -> regdefline = yyline - 1; + symbl -> reg = symbr -> reg; + strcpy(symbl->regfilename, yyfilename); + } + else + error(E_INVALID_REGISTER, symbr->name); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add label + // + +void doLab(symbolSA symb) +{ + if(yyinmacro) + { + // Check if it is a redef + + if(symb->valid && ( + ((yyoffset ==symb->offset)&&(symb->segment==SEGMENT_CODE )) || + ((yyeromoffset==symb->offset)&&(symb->segment==SEGMENT_EEPROM)) || + ((yydataoffset==symb->offset)&&(symb->segment==SEGMENT_DATA )) ) ) + { + if( (yysegment == SEGMENT_CODE) + && (symb -> value != yycodepos/2 - yyoffset) ) + errorin(E_LABEL_REDEF,symb->name,symb->valdefline,symb->valfilename); + else if( (yysegment == SEGMENT_EEPROM) + && (symb -> value != yyerompos - yyeromoffset) ) + errorin(E_LABEL_REDEF,symb->name,symb->valdefline,symb->valfilename); + else if( (yysegment == SEGMENT_DATA) + && (symb -> value != yydatapos - yydataoffset) ) + errorin(E_LABEL_REDEF,symb->name,symb->valdefline,symb->valfilename); + } + + // No it is not, so we set value if this is first occurence of macro + + else if( !symb->valid ) + { + symb -> valid = TRUE; + symb -> valdefline = yyline; + symb -> segment = yysegment; + symb -> islabel = 1; + symb -> macrolabel = 1; + + strcpy(symb->valfilename, yyfilename); + + if(yysegment == SEGMENT_CODE) + { + symb -> value = yycodepos/2 - yyoffset; + symb -> offset = yyoffset; + } + else if(yysegment == SEGMENT_EEPROM) + { + symb -> value = yyerompos - yyeromoffset; + symb -> offset = yyeromoffset; + } + else + { + symb -> value = yydatapos - yydataoffset; + symb -> offset = yydataoffset; + } + } + } + else + { + if(symb->valid && ((symb->valdefline !=yyline) + || strcmp(symb->valfilename, yyfilename))) + errorin(E_LABEL_REDEF,symb->name,symb->valdefline,symb->valfilename); + else + { + symb -> valid = TRUE; + symb -> valdefline = yyline; + symb -> segment = yysegment; + symb -> islabel = 1; + + strcpy(symb->valfilename, yyfilename); + + if(yysegment == SEGMENT_CODE) + { + symb -> value = yycodepos/2 - yyoffset; + symb -> offset = yyoffset; + } + else if(yysegment == SEGMENT_EEPROM) + { + symb -> value = yyerompos - yyeromoffset; + symb -> offset = yyeromoffset; + } + else + { + symb -> value = yydatapos - yydataoffset; + symb -> offset = yydataoffset; + } + + if (symb->name[0] != '@') + { + strcpy(yylast_used_label, symb->name); + } + } + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Register / Register opcodes + // + +void genRegReg(int opcode, regSA dest, regSA src) +{ +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + + checkSupported(opcode); + + CHECKREG(src ,0); + CHECKREG(dest ,0); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_MULSU : // Multiply Signed with Unsiged + case O_FMUL : // Fractional Multiply + case O_FMULS : // Fractional Multiply Signed + case O_FMULSU : // Fractional Multiply Signed with Unsiged + { + CHECKREG(src, 16); + CHECKREG(dest, 16); + + if( (src<16) || (src>23) ) + error(E_INVALID_REG_EXPECTED, src, 16,23); + if( (dest<16) || (dest>23) ) + error(E_INVALID_REG_EXPECTED, dest, 16,23); + + inst |= (((src-16) & 0x0007) << 0) | (((dest-16) & 0x0007) << 4); + + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_MOVW : // Copy register word + { + CHECKREG(src, 0); + CHECKREG(dest, 0); + + if( src & 1 ) + error(E_INVALID_REG_EXPECTED_0_2_4, src); + if( dest & 1 ) + error(E_INVALID_REG_EXPECTED_0_2_4, dest); + + inst |= (((src>>1) & 0x000F) << 0) | (((dest>>1) & 0x000F) << 4); + + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_MULS : // Multiply Signed + { + CHECKREG(src, 16); + CHECKREG(dest, 16); + + if( (src<16) || (src>31) ) + error(E_INVALID_REG_EXPECTED, dest, 16,31); + if( (dest<16) || (dest>31) ) + error(E_INVALID_REG_EXPECTED, dest, 16,31); + + inst |= (((src-16) & 0x000F) << 0) | (((dest-16) & 0x000F) << 4); + + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_CPC : // Compare with Carry + case O_CP : // Compare + case O_SBC : // Subtract with Carry + case O_SUB : // Subtract without Carry + case O_ADD : // without Carry + case O_ADC : // with Carry + case O_CPSE : // Compares Skip if Equal + case O_AND : // Logical AND + case O_EOR : // Exclusive OR + case O_OR : // Logical OR + case O_MOV : // Copy Register + case O_MUL : // Multiply + { + inst |= (src & 0x0010) << 5; + inst |= (src & 0x000F) << 0; + inst |= (dest & 0x0010) << 4; + inst |= (dest & 0x000F) << 4; + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("RR %04X",opcode); + } + insertInst(inst, 2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Immediate opcodes + // + +void genImmedi(int opcode, valueSA *value) +{ + int size = 2; +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + int tmp; + + checkSupported(opcode); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_BRCC : // Branch if Carry Cleared + case O_BRCS : // Branch if Carry Set + case O_BRNE : // Branch if Not Equal + case O_BREQ : // Branch if Equal + case O_BRPL : // Branch if Plus + case O_BRMI : // Branch if Minus + case O_BRVC : // Branch if Overflow Cleared + case O_BRVS : // Branch if Overflow Set + case O_BRGE : // Branch if Greater or Equal (Signed) + case O_BRLT : // Branch if Less Than (Signed) + case O_BRHC : // Branch if Half C Flag is Cleared + case O_BRHS : // Branch if Half C Flag is Set + case O_BRTC : // Branch if the T Flag is Cleared + case O_BRTS : // Branch if the T Flag is Set + case O_BRID : // Branch if Global Int is Disabled + case O_BRIE : // Branch if Global Int is Enabled + case O_BRSH : // Branch if Same or Higher (BRCC) + case O_BRLO : // Branch if Lower (BRCS) + { + inst = opcode & 0xFC07; + if(value->valid) + { + tmp = value -> value - yycodepos/2 - 1; + + if(tmp < -64 ) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + // We might reach it by jumping forward + + int dist = DEVINF.flashsize - ( yycodepos/2 + 1) + value->value; + + if( (dist>63) || (dist<0) ) + error(E_BRANCH_OUT_OF_RANGE_B,-1*(tmp+64)); + else + inst |= ((dist & 0x7F ) << 3); + } + + // No wrapping + + else + error(E_BRANCH_OUT_OF_RANGE_B,-1*(tmp+64)); + } + else if(tmp > 63) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + int dist = -1*(DEVINF.flashsize - value->value + yycodepos/2 + 1); + + if( (dist < -64) || (dist >= 0) ) + error(E_BRANCH_OUT_OF_RANGE_F,tmp-63); + else + inst |= ((dist & 0x7F ) << 3); + } + + // No wrapping + + else + error(E_BRANCH_OUT_OF_RANGE_F,tmp-63); + } + else + inst |= ( tmp & 0x7F ) << 3; + } + else + error(E_UNKNOWN_BRANCH); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_BCLR : // Bit Clear in SREG + case O_BSET : // Bit Set in SREG + { + if( value->valid ) + { + if( (value->value < 0) || (value->value > 7) ) + warning(W_BIT_OUT_OF_RANGE, value->value); + inst |= (value->value & 7) << 4; + } + else + error(E_UNKNOWN_BIT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_RCALL: // Relative Call To Subroutine + { + if(value->valid) + { + tmp = value -> value - yycodepos/2 -1; + if(tmp < -2048 ) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + // We might reach it by jumping forward + + int dist = DEVINF.flashsize - ( yycodepos/2 + 1) + value->value; + + if( (dist>2047) || (dist<0) ) + error(E_RCALL_OUT_OF_RANGE_B, -1*(tmp+2048)); + else + inst |= (dist & 0xFFF); + } + + // No wrapping + + else + error(E_RCALL_OUT_OF_RANGE_B, -1*(tmp+2048)); + } + else if(tmp > 2047) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + int dist = -1*(DEVINF.flashsize - value->value + yycodepos/2 + 1); + + if( (dist < -2048) || (dist >= 0) ) + error(E_RCALL_OUT_OF_RANGE_F, tmp-2047); + else + inst |= (dist & 0xFFF); + } + + // No wrapping + + else + error(E_RCALL_OUT_OF_RANGE_F, tmp-2047); + } + + else + inst |= tmp & 0xFFF ; + } + else + error(E_UNKNOWN_RCALL_DEST); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_RJMP : // Relative Jump + { + if(value->valid) + { + tmp = value -> value - yycodepos/2 -1; + if(tmp < -2048 ) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + // We might reach it by jumping forward + + int dist = DEVINF.flashsize - ( yycodepos/2 + 1) + value->value; + + if( (dist>2047) || (dist<0) ) + error(E_RJUMP_OUT_OF_RANGE_B, -1*(tmp+2048)); + else + inst |= (dist & 0xFFF); + } + + // No wrapping + + else + error(E_RJUMP_OUT_OF_RANGE_B, -1*(tmp+2048)); + } + else if(tmp > 2047) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + int dist = -1*(DEVINF.flashsize - value->value + yycodepos/2 + 1); + + if( (dist < -2048) || (dist >= 0) ) + error(E_RJUMP_OUT_OF_RANGE_F, tmp-2047); + else + inst |= (dist & 0xFFF); + } + + // No wrapping + + else + error(E_RJUMP_OUT_OF_RANGE_F, tmp-2047); + } + else + inst |= tmp & 0xFFF ; + + } + else + error(E_UNKNOWN_RJUMP_DEST); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_JMP : // Jump + case O_CALL : // Long Call to a Subroutine + { + size = 4; + if(value->valid) + { + if( (value -> value <0) || (value -> value > 0x3FFFFF) ) + warning(W_ILLEGAL_DEST_ADDR, value->value); + + inst |= ( (value -> value & 0x3FFFFF) >> 16) & 0x0001; + inst |= (( (value -> value & 0x3F0000) >> 16) & 0x003E) << 3; + inst |= ( (value -> value & 0x00FFFF) << 16); + } + else + error(E_UNKNOWN_JUMP_CALL_DEST); + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("IM %04X",opcode); + } + insertInst(inst, size); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Load / Store opcods - Notice : 'ld' = 'ldd' and 'ld' = 'ldd' + // + +void genIndirc(int opcode, indirectSA *indi, regSA reg, int right) +{ +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + int store = 0x0000; + + checkSupported(opcode); + + CHECKREG(reg, 0); + CHECKREG(indi->regno, 28); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_ST : // Store Indirect SRAM index X/Y/Z + case O_STD : // Store Indirect SRAM displacement + { + store = 0x0200; + } + case O_LD : // Load indirect SRAM index X/Y/Z + case O_LDD : // Load indirect SRAM displacement + { + if( ((opcode==O_LD) || (opcode==O_LDD)) && !right ) + error(E_REG_DISP); + if( indi->disp && (indi->regno==26) ) + error(E_NO_DISP); + else if( ((opcode==O_ST) || (opcode==O_STD)) && right ) + error(E_DISP_REG); + else + { + if( indi -> regno == 26 ) + inst = 0x900C | (reg << 4) | indi->plus; + else if( (indi -> regno == 28) || (indi -> regno == 30 ) ) + { + if(indi -> disp) + { + inst = 0x8000 | (reg<<4) | (8*(indi -> regno == 28)); + if(indi->offset.valid) + { + if( (indi->offset.value<0) || (indi->offset.value>63) ) + warning(W_DISPLACEMENT_OUT_OF_RANGE, indi->offset.value); + inst |= (indi->offset.value & 0x20) << 8; + inst |= (indi->offset.value & 0x18) << 7; + inst |= (indi->offset.value & 0x07) << 0; + } + else + error(E_UNKNOWN_DISP); + } + else + { + inst = 0x8000|(reg<<4)|indi->plus|(0x1000*(indi->plus!=0)); + inst |= 8*(indi -> regno == 28) ; + } + } + else + { + if(store) + error(E_INVALID_SOURCE_REG_XYZ, indi->regno); + else + error(E_INVALID_DEST_REG_XYZ, indi->regno); + } + inst |= store; + } + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("LS %04X", opcode); + + } + insertInst(inst, 2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Immediate / Register opcodes + // + +void genImmReg(int opcode, valueSA *value, regSA reg) +{ + int size = 2; +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + + checkSupported(opcode); + + CHECKREG(reg, 0); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_OUT : // Store Register to I/O Port + { + inst |= reg << 4; + + if(value->valid) + { + if( (value->value<0) || (value->value>63) ) + warning(W_PORT_OUT_OF_RANGE_3F, value->value); + inst |= (value->value & 0x30) << 5; + inst |= value->value & 0x0F; + } + else + error(E_UNKNOWN_PORT); + + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_STS : // Store direct to SRAM + { + size = 4; + inst |= reg << 4; + + if(value->valid) + { + if( (value->value<0) || (value->value>0xFFFF) ) + warning(W_ADDR_OUT_OF_RANGE_FFFF, value->value); + inst |= (value -> value & 0xFFFF) << 16; + } + else + error(E_UNKNOWN_ADDRESS); + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("IR %04X",opcode); + } + insertInst(inst, size); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Register / Immediate opcodes + // + +void genRegImm(int opcode, regSA reg, valueSA *value) +{ + int size = 2; +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + + checkSupported(opcode); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_SBRC : // Skip if Bit in Register is Cleared + case O_SBRS : // Skip if Bit in Register is Set + { + CHECKREG(reg, 0); + + inst |= reg << 4; + + if(value->valid) + { + if( (value->value < 0) || (value->value > 7) ) + warning(W_BIT_OUT_OF_RANGE, value->value); + inst |= value->value & 7; + } + else + error(E_UNKNOWN_BIT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_IN : // Load an I/O Port to register + { + CHECKREG(reg, 0); + + inst |= reg << 4; + + if(value->valid) + { + if( (value->value < 0) || (value->value > 0x3F) ) + warning(W_PORT_OUT_OF_RANGE_3F, value->value); + inst |= (value->value & 0x30) << 5; + inst |= (value->value & 0x0F); + } + else + error(E_UNKNOWN_PORT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_CBR : // Clear Bits in Reg. (Same as 'andi') + { + CHECKREG(reg, 16); + + inst = 0x7000; + + if( (reg<16) || (reg>31) ) + error(E_INVALID_REGISTER_R16_R31); + else + { + inst |= (reg-16) << 4; + + if(value->valid) + { + if( (value->value < 0) || (value->value > 0xFF) ) + warning(W_BITMASK_OUT_OF_RANGE, value->value); + inst |= ((0xFF - (value->value & 0xFF)) & 0xF0) << 4; + inst |= ((0xFF - (value->value & 0xFF)) & 0x0F); + } + else + error(E_UNKNOWN_BITMASK); + } + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_BLD : // Bit Load from T to Register bit + case O_BST : // Bit store from Register to T + { + CHECKREG(reg, 0); + + inst |= reg << 4; + + if(value->valid) + { + if( (value->value < 0) || (value->value > 7) ) + warning(W_BIT_OUT_OF_RANGE, value->value); + inst |= value->value & 7; + } + else + error(E_UNKNOWN_BIT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_ADIW : // Add Immediate to Word + case O_SBIW : // Subtract Immediate from Word + { + CHECKREG(reg, 24); + + if( (reg!=24) && (reg!=26) && (reg!=28) && (reg!=30) ) + error(E_INVALID_REG_R24_R30); + else + { + inst |= (reg-24) << 3; + + if(value->valid) + { + if( (value->value < 0) || (value->value >= 0x40) ) + warning(W_CONST_OUT_OF_RANGE_3F, value->value); + inst |= (value->value & 0x30) << 2; + inst |= (value->value & 0x0F); + } + else + error(E_UNKNOWN_CONSTANT); + } + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_SBR : // Set Bits in register (Same as ORI) + { inst = O_ORI; } + case O_CPI : // Compare with Immediate + case O_SBCI : // Subtract Immediate with Carry + case O_SUBI : // Subtract Immediate + case O_ORI : // Logical OR with Immediate + case O_ANDI : // Logical AND with Immediate + case O_LDI : // Load Immediate + { + CHECKREG(reg, 16); + + if( (reg<16) || (reg>31) ) + error(E_INVALID_REGISTER_R16_R31); + else + { + inst |= (reg-16) << 4; + + if(value->valid) + { + if( (value->value < -0xFF) || (value->value > 0xFF) ) + warning(W_CONST_OUT_OF_RANGE_FF, value->value); + inst |= (value->value & 0xF0) << 4; + inst |= (value->value & 0x0F); + } + else + error(E_UNKNOWN_CONSTANT); + } + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_LDS : // Load direct from SRAM + { + CHECKREG(reg, 0); + + size = 4; + inst |= reg << 4; + if(value->valid) + { + if( (value->value < 0) || (value->value > 0xFFFF) ) + warning(W_CONST_OUT_OF_RANGE_FFFF, value->value); + inst |= ((value -> value)&0xFFFF) << 16; + } + else + error(E_UNKNOWN_CONSTANT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("RI %04X",opcode); + } + insertInst(inst, size); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Immediate / Immediate opcodes + // + +void genImmImm(int opcode, valueSA *valued, valueSA *values) +{ +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + int tmp; + + checkSupported(opcode); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_BRBC : // Branch if Bit in SREG is Cleared + case O_BRBS : // Branch if Bit in SREG is Set + { + + if( valued->valid ) + { + if( (valued->value < 0) || (valued->value > 7) ) + warning(W_BIT_OUT_OF_RANGE ,valued->value); + inst |= valued->value & 7; + } + else + error(E_UNKNOWN_BIT); + + if(values->valid) + { + + tmp = values -> value - yycodepos/2 - 1; + + if(tmp < -64 ) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + // We might reach it by jumping forward + + int dist = DEVINF.flashsize - ( yycodepos/2 + 1) + values->value; + + if( (dist>63) || (dist<0) ) + error(E_BRANCH_OUT_OF_RANGE_B,-1*(tmp+64)); + else + inst |= ((dist & 0x7F ) << 3); + } + + // No wrapping + + else + error(E_BRANCH_OUT_OF_RANGE_B,-1*(tmp+64)); + } + else if(tmp > 63) { + + // Maybe we can do a wrap + + if(yycfg->wrap) { + + int dist = -1*(DEVINF.flashsize - values->value + yycodepos/2 + 1); + + if( (dist < -64) || (dist >= 0) ) + error(E_BRANCH_OUT_OF_RANGE_F,tmp-63); + else + inst |= ((dist & 0x7F ) << 3); + } + + // No wrapping + + else + error(E_BRANCH_OUT_OF_RANGE_F,tmp-63); + } + else + inst |= ( tmp & 0x7F ) << 3; + + } + else + error(E_UNKNOWN_BRANCH); + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_CBI : // Clear Bit in I/O Register + case O_SBI : // Set Bit in I/O Register + case O_SBIC : // Skip if Bit in I/O is Cleared + case O_SBIS : // Skip if Bit in I/O is Set + { + if( valued->valid ) + { + if( (valued->value < 0) || (valued->value > 31) ) + warning(W_PORT_OUT_OF_RANGE_1F, valued->value); + inst |= ((valued->value)&0x1F) << 3; + } + else + error(E_UNKNOWN_PORT); + + if( values->valid ) + { + if( (values->value < 0) || (values->value > 7) ) + warning(W_BIT_OUT_OF_RANGE,values->value); + inst |= values->value & 7; + } + else + error(E_UNKNOWN_BIT); + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("II %04X",opcode); + } + insertInst(inst, 2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate no argument opcodes + // + +void genNoargs(int opcode) +{ +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + + checkSupported(opcode); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_SEC : // Set Carry Flag + case O_SEZ : // Set Zero Flag + case O_SEN : // Set Negative Flag + case O_SEV : // Set Overflow Flag + case O_SES : // Set Signed Flag + case O_SEH : // Set Half Carry Flag + case O_SET : // Set T Flag + case O_SEI : // Set Global Interrupt Flag + case O_CLC : // Clear Carry Flag + case O_CLZ : // Clear Zero Flag + case O_CLN : // Clear Negative Flag + case O_CLV : // Clear Overflow Flag + case O_CLS : // Clear Signed Flag + case O_CLH : // Clear Half Carry Flag + case O_CLT : // Clear T Flag + case O_CLI : // Clear Global Interrupt Flag + case O_NOP : // No Operation + case O_ICALL : // Indirect Call to Subroutine + case O_IJMP : // Indirect Jump + case O_RETI : // Return from Interrupt + case O_RET : // Return from Subroutine + case O_SLEEP : // Sleep + case O_WDR : // Wathcdog Reset + case O_EIJMP : // Extended indirect jump + case O_EICALL : // Extended indirect call to subroutine + case O_ESPM : // Extended store program memory + case O_SPM : // Store program memory + { + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("NA %04X",opcode); + } + insertInst(inst, 2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Generate Register only opcodes + // + +void genRegist(int opcode, regSA reg) +{ +#ifdef _MSC_VER /* Nick */ + int inst = opcode; +#else + long inst = (unsigned)opcode; +#endif + + checkSupported(opcode); + + switch ((unsigned int)opcode) /* Nick cast */ + { + ////////////////////////////////////////////////////////////////////////// + + case O_ROR : // Rotate Right Trough Carry + case O_COM : // One's Complement + case O_NEG : // Two's Complement + case O_SWAP : // Swap Nibbles + case O_INC : // Increment + case O_ASR : // Arithmetic Shift Right + case O_LSR : // Logical Shift Right + case O_DEC : // Decrement + case O_POP : // Pop Register from Stack + case O_PUSH : // Push Register on Stack + { + CHECKREG(reg, 0); + inst |= reg << 4; + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_TST : // Test for Zero or Minus + case O_CLR : // Logical Shift Left (ADD Rd,Rd) + { + CHECKREG(reg, 0); + inst = opcode & 0x2400; + inst |= (reg & 0x10) << 5; + inst |= (reg & 0x0F) << 0; + inst |= (reg & 0x10) << 4; + inst |= (reg & 0x0F) << 4; + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_ROL : // Rotate Left trough C (ADC Rd,Rd) + case O_LSL : // Logical Shift Left (ADD Rd,Rd) + { + CHECKREG(reg, 0); + inst = opcode & 0x1C00; + inst |= (reg & 0x10) << 5; + inst |= (reg & 0x0F) << 0; + inst |= (reg & 0x10) << 4; + inst |= (reg & 0x0F) << 4; + } break; + + ////////////////////////////////////////////////////////////////////////// + + case O_SER : // Set all bits in Register + { + CHECKREG(reg, 16); + if( (reg<16) || (reg>31) ) + error(E_INVALID_REGISTER_R16_R31); + else + inst |= reg << 4; + + } break; + + ////////////////////////////////////////////////////////////////////////// + + default : internalerror("RO %04X",opcode); + } + insertInst(inst, 2); +} + + + //////////////////////////////////////////////////////////////////////////// + // + // Generate 'Load Program Memory' instructions + // + +void genLpm(int opcode, regSA reg, indirectSA *indi, int useregs) +{ + int inst = opcode; + + // Generate: (E)LPM rX, Z(+) + + if(useregs) { + + // Check that no displacement is specified + + if(indi->disp) + error(E_DISP_ILLEGAL); + + // Check that Z is specified + + CHECKREG(indi->regno, 30); + + if(indi->regno != 30) + error(E_INVALID_REG_Z_EXPECTED); + + // Check that pre-increment is not used + + if( indi->plus == 2) + error(E_INVALID_PREINCREMENT); + + if(opcode==O_LPM) + inst = 0x9004 + (indi->plus==1 ? 1 : 0) + ((reg&0x1f)<<4); + else + inst = 0x9006 + (indi->plus==1 ? 1 : 0) + ((reg&0x1f)<<4); + } + + insertInst(inst, 2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle functions + // + +void genFun(functionSA func, valueSA *value, valueSA *res) +{ + if( !value->valid ) + { + res -> valid = FALSE; + res -> value = 0; + } + else + { + res -> valid = TRUE; + res -> value = 0; + switch(func) + { +#ifdef _MSC_VER /* Nick */ + case OP_LOW : res->value = (value->value & 0x000000FF)>> 0; break; + case OP_HIGH : res->value = (value->value & 0x0000FF00)>> 8; break; + case OP_BYTE2 : res->value = (value->value & 0x0000FF00)>> 8; break; + case OP_BYTE3 : res->value = (value->value & 0x00FF0000)>>16; break; + case OP_BYTE4 : res->value = (value->value & 0xFF000000)>>24; break; + case OP_LWRD : res->value = (value->value & 0x0000FFFF)>> 0; break; + case OP_HWRD : res->value = (value->value & 0xFFFF0000)>>16; break; + case OP_PAGE : res->value = (value->value & 0x003F0000)>>16; break; +#else + case OP_LOW : res->value = (value->value & 0x000000FFL)>> 0; break; + case OP_HIGH : res->value = (value->value & 0x0000FF00L)>> 8; break; + case OP_BYTE2 : res->value = (value->value & 0x0000FF00L)>> 8; break; + case OP_BYTE3 : res->value = (value->value & 0x00FF0000L)>>16; break; + case OP_BYTE4 : res->value = (value->value & 0xFF000000L)>>24; break; + case OP_LWRD : res->value = (value->value & 0x0000FFFFL)>> 0; break; + case OP_HWRD : res->value = (value->value & 0xFFFF0000L)>>16; break; + case OP_PAGE : res->value = (value->value & 0x003F0000L)>>16; break; +#endif + case OP_LOG2 : + { + if( value->value < 0 ) + warningin(W_INTEGERRESULT_LOG2_IS_ZERO, value->value); + else + res->value = (int) (0.5+log10(value->value)/log10(2)); + } break; + case OP_EXP2 : + { + if( (value->value > 31) || (value->value < 0) ) + warningin(W_INTEGERRESULT_EXP2_IS_ZERO, value->value); + else + res->value = 1<< value->value; + } break; + default : internalerror("FU %08X",func); + } + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle unary operators + // + +void oprUna(int opr, valueSA *value, valueSA *res) +{ + if( !value->valid ) + { + res -> valid = FALSE; + res -> value = 0; + } + else + { + res -> valid = TRUE; + res -> value = 0; + switch(opr) + { + case OP_MINUS : ; res->value = -1*value->value; break; + case OP_WAVE : ; res->value = ~value->value; break; + case OP_NOT : ; res->value = !value->value; break; + default : internalerror("UO %08X", opr); + } + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Handle binary operators + // + +void oprBin(valueSA *vl, int opr, valueSA *vr, valueSA *res) +{ + if( !vl->valid || !vr->valid ) + { + res -> valid = FALSE; + res -> value = 0; + } + else + { + res -> valid = TRUE; + res -> value = 0; + + switch(opr) + { + case OP_STAR : res->value = ( vl->value * vr->value ); break; + case OP_MOD : res->value = ( vl->value % vr->value ); break; + case OP_PLUS : res->value = ( vl->value + vr->value ); break; + case OP_MINUS : res->value = ( vl->value - vr->value ); break; + case OP_LS : res->value = ( vl->value << vr->value ); break; + case OP_RS : res->value = ( vl->value >> vr->value ); break; + case OP_LESS : res->value = ( vl->value < vr->value ); break; + case OP_GREAT : res->value = ( vl->value > vr->value ); break; + case OP_LE : res->value = ( vl->value <= vr->value ); break; + case OP_GE : res->value = ( vl->value >= vr->value ); break; + case OP_EQ : res->value = ( vl->value == vr->value ); break; + case OP_NE : res->value = ( vl->value != vr->value ); break; + case OP_AND : res->value = ( vl->value & vr->value ); break; + case OP_XOR : res->value = ( vl->value ^ vr->value ); break; + case OP_OR : res->value = ( vl->value | vr->value ); break; + case OP_ANDAND : res->value = ( vl->value && vr->value ); break; + case OP_OROR : res->value = ( vl->value || vr->value ); break; + case OP_DIV : + { + if(vr->value) + res->value = ( vl->value / vr->value ); + else + { + errorin(E_DIVISION_BY_ZERO); + res->valid = FALSE; + } + } break; + default : internalerror("BO %08X",opr); + } + } +} + +/// END OF FILE ////////////////////////////////////////////////////////////// diff --git a/src/mkutil/tavrasm.118/src/semantic.hh b/src/mkutil/tavrasm.118/src/semantic.hh new file mode 100644 index 00000000..57f7d1d0 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/semantic.hh @@ -0,0 +1,175 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : semantic.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Code generation header +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _SEMANTIC_HH_ +#define _SEMANTIC_HH_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include "opcodes.hh" +#include "avrasm.hh" +#include "symbol.hh" +#include "messages.hh" + +/// Defines ////////////////////////////////////////////////////////////////// + +#define OP_AND 1 +#define OP_STAR 2 +#define OP_PLUS 3 +#define OP_MINUS 4 +#define OP_WAVE 5 +#define OP_NOT 6 + +#define OP_DIV 7 +#define OP_MOD 8 +#define OP_LS 9 +#define OP_RS 10 +#define OP_LESS 11 +#define OP_GREAT 12 +#define OP_LE 13 +#define OP_GE 14 +#define OP_EQ 15 +#define OP_NE 16 +#define OP_XOR 17 +#define OP_OR 18 +#define OP_ANDAND 19 +#define OP_OROR 20 + +#define OP_LOW 21 +#define OP_HIGH 22 +#define OP_BYTE2 23 +#define OP_BYTE3 24 +#define OP_BYTE4 25 +#define OP_LWRD 26 +#define OP_HWRD 27 +#define OP_PAGE 28 +#define OP_EXP2 29 +#define OP_LOG2 30 + +/// Types //////////////////////////////////////////////////////////////////// + + /// Attribute structs (also typedef'ed below) //////////////////////////// + +struct instructionstruct + { +#ifdef _MSC_VER /* Nick */ + int value; +#else + long value; +#endif + int size; + int opcode; + }; + +struct valuestruct + { +#ifdef _MSC_VER /* Nick */ + int value; +#else + long value; +#endif + int valid; + }; + +struct indirectstruct + { + int regno; + int plus; + int disp; + valuestruct offset; + }; + + /// Synthesized attributes /////////////////////////////////////////////// + +typedef int regSA; +typedef instructionstruct instSA; +typedef int opcodeSA; +typedef valuestruct valueSA; +typedef char nameSA[MAX_ID_LENGTH+1]; +typedef symbolTableEntry* symbolSA; +typedef indirectstruct indirectSA; +typedef int functionSA; +typedef char* stringSA; + +/// Prototypes /////////////////////////////////////////////////////////////// + + /// Generate functions /////////////////////////////////////////////////// + +void genRegReg(int opcode, regSA dest, regSA src); +void genRegImm(int opcode, regSA reg, valueSA *value); +void genImmReg(int opcode, valueSA *value, regSA reg); +void genImmImm(int opcode, valueSA *valued, valueSA *values); +void genImmedi(int opcode, valueSA *value); +void genNoargs(int opcode); +void genRegist(int opcode, regSA reg); +void genIndirc(int opcode, indirectSA *indi, regSA reg, int right = FALSE); +void genLpm(int opcode, regSA reg, indirectSA *indi, int useregs); + + /// Handle directives //////////////////////////////////////////////////// + +void doDef(symbolSA symb, regSA reg); // Handle '.def' +void doDef(symbolSA symbl, symbolSA symbr); // Handle '.def' +void doEqu(symbolSA symb, valueSA *value); // Handle '.eq' +void doAdb(void); // Init '.db' +void doAdb(valueSA *value); // Handle '.db' +void doAdb(stringSA str); // Handle '.db' +void doAdw(void); // Init '.dw' +void doAdw(valueSA *value); // Handle '.dw' +void doOrg(valueSA *value); // Handle '.org' +void doByt(valueSA *value); // Handle '.byte' +void doSet(symbolSA symb, valueSA *value); // Handle '.set' +void doDev(symbolSA devicename); // Handle '.device' + + /// Add label //////////////////////////////////////////////////////////// + +void doLab(symbolSA symb); // Add a label + + /// Operators //////////////////////////////////////////////////////////// + +void oprUna(int opr, valueSA *value, valueSA *res); +void oprBin(valueSA *vl, int opr, valueSA *vr, valueSA *res); +void genFun(functionSA func, valueSA *value, valueSA *res); + +#endif /* _SEMANTIC_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/tavrasm.118/src/symbol.cc b/src/mkutil/tavrasm.118/src/symbol.cc new file mode 100644 index 00000000..212279c6 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/symbol.cc @@ -0,0 +1,474 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : symbol.cc +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Symbol table (see additional info below). +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// +// +// Description : +// +// This module implements the symbol-table, and the functions needed to +// manipulate it. The symbol-table supports scopes, scope import/export +// and arbitrary types. +// +// The size of the hash vector is set using 'init', and can't be changed +// after initialization. The default size of the hash-table is 1024. +// The size must be 2^N, N=1, 2, ... +// +// To get a case in-sensitive symbol table, initialize with : init(TRUE); +// +// 'symbol.hh' defines the class interface and the structure of a +// symbol-table entry. +// +// Functions : +// +// init - Initialize symbol-table +// add - Add symbol to symbol-table, no check is made to see +// if symbol already exist. +// get - Return pointer to symbol. +// scopeDown - Add new scope +// scopeUp - Delete scope +// printTable - Print symbol table. +// +////////////////////////////////////////////////////////////////////////////// + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "symbol.hh" +#include "utils.hh" + +/// Macros /////////////////////////////////////////////////////////////////// + +#define LOWERCOMP(c1, c2) (tolower(c1)==tolower(c2)) + +/// Functions //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Constructor + // + +symbolTable::symbolTable(void) +{ + + hashSize = 0; + symtab = NULL; + scope = 0; + scopeTop = NULL; + currentScope = NULL; + currentSymbol = NULL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Destructor + // + +symbolTable::~symbolTable(void) +{ + if(symtab) + delete symtab; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Allocate and initialize a new symbol table. + // + +int symbolTable::init(int cs, unsigned int hashsize) +{ + unsigned int size = 1; + symbolScopeStack *newscope; + + // Return if already initialized + + if(symtab) + return 0;; + + // Align hashsize to 2^N + + while(hashsize>>=1) + size<<=1; + + if(size>HASH_MAX_SIZE) + size = HASH_MAX_SIZE; + + // Check case sensitive + + if(cs) + casesensitive = TRUE; + else + casesensitive = FALSE; + + // Allocate mew symbol-table + + if(size && (symtab = new symbolTableEntry*[size])) /* Nick removed paren */ + { + // Clear hash-table + + memset(symtab,0,size*sizeof(symbolTableEntry*)); + hashSize = size - 1; + + // Allocate first element on scope stack + + if(! (newscope = new symbolScopeStack)) + { + delete symtab; + symtab = NULL; + return 0; + } + + currentScope = newscope; + scopeTop = newscope; + + currentScope -> down = NULL; + currentScope -> up = NULL; + currentScope -> last = NULL; + currentScope -> first = NULL; + + // scope is set to 1 + + currentScope -> level = ++scope; + + return size; + } + + return 0; +} + + //////////////////////////////////////////////////////////////////////////// + // + // The hash function does three things to create the hash value : + // + // 1 : Adding the ASCII value of all characters + // + // This works fine for small hash tables, but hash values tends to pile + // up in large tables, since ASCII values for alpha numeric characters + // are "small", ie. adding 1 to 8 values in the interval 48 to 123 + // result in a hash value between 48 and 984, so there would be no point + // in using a hash table larger than 1024 (since we assume that the + // table is 2^N, where N = 1, 2, ... + // + // 2 : Shifting value right + // + // To improve the hash functions we shift the previous hash value right + // 4 times, this creates much larger values, thus solving the 'add' + // problem. + // + // 3 : XOR'ing value + // + // The solution to the 'add' problem creates another problem when using + // small hash tables, since the shifting has the effect that the hash + // value tends to forget the previous character values, because they are + // shifted to the right, and the eventually lost when the hash value + // is AND'ed with the size of the hash table. This problem is fixed + // by XOR'ing the previous value with the shifted value. + // + // An alternate solution that does not change the name pointer : + // + // for(h=i=0; name[i]; h^= ( h << 4 ) + name[i++]); + // h&=hashsize; + // + +inline int symbolTable::hash(char *name) +{ + int h = 0; + + if(!casesensitive) + while(*name) + h^= ( h << 4 ) + tolower(*name++); + else + while(*name) + h^= ( h << 4 ) + *name++; + + return h &= hashSize; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Get a pointer to a symbol. + // + +symbolTableEntry* symbolTable::get(char *name, int inscope) +{ + int notfound; + int p; + + // Get a pointer to the first element in the hash chain + + symbolTableEntry *next = symtab[hash(name)]; + + // If 'next' == NULL then the symbol is not in the table and we return. + + if(!next) + return NULL; + + // Set scope + + if(inscope<0) + inscope = scope; + + notfound = TRUE; /* Nick true; */ + + // If 'next' != NULL the chain is not empty, and we have have to + // scan all symbols at the current scope level. Since new symbols are + // added at the front of the chain, we can end the scan, when the first + // identifier with a higher scope level (lower 'scope') is found. + + if(casesensitive) + { + while(next && (inscope<=next->scope)&&(notfound=strcmp(name, next->name))) + next = next -> next; + } + else + { + while(next && (inscope<=next->scope) && notfound) + { + p = 0; + while( name[p] && next->name[p] && LOWERCOMP(name[p],next->name[p]) ) + p++; + if( name[p] || next->name[p] ) + next = next -> next; + else + notfound = FALSE; + } + } + + if(!notfound) + return next; + + return NULL; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add a symbol to symbol-table. + // + +symbolTableEntry* symbolTable::add(char *name) +{ + int h; + + // Get a pointer to the first element in the hash chain + + symbolTableEntry *next = symtab[h=hash(name)]; + + // Allocate new symbol + + symtab[h] = new symbolTableEntry; + + if(!(symtab[h])) + return NULL; + + // Clear symbol + + memset(symtab[h], 0, sizeof(symbolTableEntry)); + + // Link with next symbol in chain. + + symtab[h] -> next = next; + + if(next) + next -> prev = symtab[h]; + + // Add to scope chain + + if(currentSymbol) + { + currentSymbol -> down = symtab[h]; + symtab[h] -> up = currentSymbol; + } + else + currentScope -> first = symtab[h]; + + currentSymbol = symtab[h]; + + currentScope -> last = symtab[h]; + + // Setup new symbol + + if(strlen(name) > MAX_ID_LENGTH) + internalerror("ID TOO LONG"); + + strcpy(symtab[h]->name, name); + + symtab[h] -> scope = scope; + + next = symtab[h]; + + // return pointer to new symbol + + return symtab[h]; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add new scope + // + +int symbolTable::scopeDown(void) +{ + symbolScopeStack *newscope; + + // Allocate new element on top of the scope stack. + + if(! (newscope = new symbolScopeStack)) + return -1; + + // Setup new element + + currentScope -> down = newscope; + newscope -> up = currentScope; + currentScope = newscope; + currentScope -> down = NULL; + currentScope -> first = NULL; + currentScope -> last = NULL; + currentScope -> level = ++scope; + currentSymbol = NULL; + + return scope; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Delete scope + // + +int symbolTable::scopeUp(void) +{ + symbolTableEntry *next, *current; + int h; + + current = currentScope -> first; + + // Kill current scope + + while(current) + { + if(current->prev) + current -> prev -> next = current -> next; + else + symtab[h=hash(current -> name)]= current -> next; + + if(current->next) + current -> next -> prev = current -> prev; + + next = current -> down; + delete current; + current = next; + } + + // Decrement scope + + if(currentScope -> up) + { + currentScope = currentScope -> up; + delete currentScope -> down; + currentScope -> down = NULL; + currentSymbol = currentScope -> last; + } + else + { + currentScope -> up = NULL; + currentScope -> down = NULL; + currentScope -> first = NULL; + currentScope -> last = NULL; + } + + return --scope; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Print symbol-table to stdout. + // + +int symbolTable::printTable(int fromscope, int toscope, int format) +{ + symbolScopeStack *thescope = scopeTop; + symbolTableEntry *next; + int count =0; + + if(toscope == -1) + toscope = scope; + if(fromscope == -1) + fromscope = scope; + + if(!thescope) + printf("Symbol table is empty\n"); + else + { + while(thescope) + { + if( (thescope -> level >= fromscope ) && (thescope -> level <= toscope ) ) + { + printf("\n+---------------------------------------------------+\n"); + printf("| S:%5i I V S M |\n",thescope -> level); + printf("|---------------------------------------------------|\n"); + next = thescope -> first; + while(next) + { + // Print detailed information + + if(format) + { + } + + // Print just the symbol names + else + printf("| %08X %i %i %X %i %-32s |\n",next->value,next->isvar,next->valid,next->segment,next->macro,next->name); + + next = next -> down; + count++; + } + printf("+---------------------------------------------------+\n"); + + } + thescope = thescope -> down; + } + } + + return count; + +} + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/tavrasm.118/src/symbol.hh b/src/mkutil/tavrasm.118/src/symbol.hh new file mode 100644 index 00000000..e11f9c96 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/symbol.hh @@ -0,0 +1,183 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : symbol.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Symbol table header +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _SYMBOL_HH_ +#define _SYMBOL_HH_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include "avrasm.hh" + +/// Defines ////////////////////////////////////////////////////////////////// + +#ifdef _MSC_VER /* Nick original definition: */ +#define HASH_DEFAULT_SIZE 1024 // Could be any 2^N +#define HASH_MAX_SIZE 0x10000 // Could be any 2^N +#else /* Nick reduced for 16-bit version: */ +#define HASH_DEFAULT_SIZE 0x100 // Could be any 2^N +#define HASH_MAX_SIZE 0x1000 // Could be any 2^N +#endif + +/// Type/Class definitions /////////////////////////////////////////////////// + +class symbolTable; + + //////////////////////////////////////////////////////////////////////////// + // + // Symbol-table entry + // + +struct symbolTableEntry +{ + // Identifier + + char name[MAX_ID_LENGTH+1]; + + // House keeping + + int scope; + symbolTableEntry *prev; + symbolTableEntry *next; + symbolTableEntry *up; + symbolTableEntry *down; + + // Symbol defines a macro + + int macro; + char macfilename[MAX_FILENAME_LENGTH+1]; + int macdefline; + int macsize; + char *macstr; + int macparms; + char macparmlist[10]; + symbolTable *macsym; + int macrodone; + + // Symbol defines a variable + + int isvar; + + // Symbol defines a label + + int islabel; + int offset; + int macrolabel; + + // Symbol defines a value + + int valid; + int valdefline; +#ifdef _MSC_VER /* Nick */ + int value; +#else + long value; +#endif + char valfilename[MAX_FILENAME_LENGTH+1]; + int segment; + int mask; + + // Symbol defines a register + + int isdefine; + int regdefline; + int reg; + char regfilename[MAX_FILENAME_LENGTH+1]; +}; + + //////////////////////////////////////////////////////////////////////////// + // + // Symbol-table class + // + +class symbolTable +{ + +public: + + // Constructor/destructor + + symbolTable(); + ~symbolTable(); + + // Public member functions + + int init(int cs=0, unsigned int hashsize=HASH_DEFAULT_SIZE); + symbolTableEntry* add(char *name); + symbolTableEntry* get(char *name, int inscope = -1); + int scopeDown(void); + int scopeUp(void); + int printTable(int fromscope=-1,int toscope=-1,int format=0); + +private: + + // Private member functions + + inline int hash(char *name); + + // Private data members + + // Scope stack entry + + struct symbolScopeStack + { + symbolScopeStack *up; + symbolScopeStack *down; + symbolTableEntry *first; + symbolTableEntry *last; + int level; + }; + + int hashSize; + int scope; + symbolTableEntry **symtab; + symbolScopeStack *scopeTop; + symbolScopeStack *currentScope; + symbolTableEntry *currentSymbol; + int casesensitive; + +}; + +#endif /* _SYMBOL_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// + + diff --git a/src/mkutil/tavrasm.118/src/t.bat b/src/mkutil/tavrasm.118/src/t.bat new file mode 100644 index 00000000..5c03e466 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/t.bat @@ -0,0 +1,11 @@ +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c avrasm.cc +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c semantic.cc +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c symbol.cc +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c utils.cc +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c avrparse.cc +c:\tc\bin\tcc -ml -P -I. -DAVRLANG=LANGUAGE_US -c avrlex.cc +del tavrasm.exe +c:\tc\bin\tlink @t.lnk +del *.obj +del *.map +copy tavrasm.exe \hytech\src\avr diff --git a/src/mkutil/tavrasm.118/src/t.lnk b/src/mkutil/tavrasm.118/src/t.lnk new file mode 100644 index 00000000..14f2be57 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/t.lnk @@ -0,0 +1,4 @@ +/m c:\tc\lib\c0l avrasm semantic symbol utils avrparse avrlex +tavrasm +tavrasm +c:\tc\lib\cl c:\tc\lib\oldstrml c:\tc\lib\mathl c:\tc\lib\emu diff --git a/src/mkutil/tavrasm.118/src/tavrasm.exe b/src/mkutil/tavrasm.118/src/tavrasm.exe new file mode 100644 index 00000000..fa3f52cd Binary files /dev/null and b/src/mkutil/tavrasm.118/src/tavrasm.exe differ diff --git a/src/mkutil/tavrasm.118/src/tsv4.asm b/src/mkutil/tavrasm.118/src/tsv4.asm new file mode 100644 index 00000000..c27643ed --- /dev/null +++ b/src/mkutil/tavrasm.118/src/tsv4.asm @@ -0,0 +1,3616 @@ +; TSV4.ASM + +; 19FEB02 REVISE FOR GREATER CONTRAST VOLTAGE FOR ALBERT'S 2ND BATCH -15V +; 01FEB02 REVISE FOR 7.3728MHz XTAL (SEE !!!) + +; 22JUN01 REVISE -VE VOLTAGE GENERATION +; TO WORK WITH REV E PARTS +; ;!! INDICATES CHANGES + +;** INDICATES CHANGES FOR LOW VCC AVR MOD + +.INCLUDE "8535DEF.INC" +.INCLUDE "MAC.INC" +.INCLUDE "APITS.INC" ; NOT API.INC BECAUSE APITS.INC ALSO HAS TURNON COMMAND +;.INCLUDE "TERTS.INC" ; NOT TER.INC BECAUSE FLAGS IN LOWER HALF OF REGISTER SET + +.LISTMAC +.MACRO LDIYADR ; POINT Y TO DSPRAM ADDR + LDI YH,HIGH(@0>>6) + STS XPAGE,YH + RCALL ADRYP ; AND SET XPAGE + LDI YH,HIGH(@0<<2) + LDI YL,(LOW(@0) & $3F) | (HIGH(@0) & $C0) +.ENDMACRO + +.MACRO ADRL + OUT PORTC,@0 ; SET L ADDRESS FOR DSPRAM +.ENDMACRO + +.MACRO ADRH + OUT PORTA,@0 ; SET H ADDRESS FOR DSPRAM + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@0 ; IS THIS NEEDED? +.ENDMACRO + +;.MACRO ADRINC +; INC @0 ; INC LOW ORDER DSPRAM ADDRESS +; SBRC @0,6 ; ROLLS OVER IF BIT 6 SET +;; RCALL INCADRY ; INC HIGH ORDER DSPRAM ADDRESS +;.ENDMACRO ; (RCALL IS IN MAINLINE CODE) + +.MACRO A0_A13 + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + CLI + SBI PORTB,3 + CBI PORTB,3 + SEI + STS LATCH11_SAV,R19 +.ENDMACRO + +.MACRO A14_A18 + CLI + LDS R19,LATCH10_SAV ; AND THIS + EOR R19,@0 + ANDI R19,$E0 + EOR R19,@0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + SEI + STS LATCH10_SAV,R19 ; MUST BE ATOMIC DUE TO TOGGLING M +.ENDMACRO + +.MACRO A0_A15 + PUSH R19 + + MOV R19,@0 + ANDI R19,$3F + OUT PORTC,R19 + + MOV R19,@1 + LSL R19 + LSL R19 + BST @0,7 ; A7 + BLD R19,1 + BST @0,6 ; A6 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,@1 + + LDS R19,LATCH10_SAV ; AND THIS + BST @1,7 ; A15 + BLD R19,1 + BST @1,6 ; A14 + BLD R19,0 + OUT PORTA,R19 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,R19 + + POP R19 +.ENDMACRO + +.MACRO RAMWR + OUT PORTA,@0 + CLI + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMWRX + OUT PORTA,@0 + CBI PORTB,1 + CBI PORTB,0 + NOP + SBI PORTB,0 + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRXW + CLR @1 + OUT DDRA,@1 + CLI + CBI PORTB,0 + NOP + CBI PORTB,1 + IN @1,PINA + EOR @0,@1 + SBRC FLAGS,0 + OR @0,@1 + LDI @1,$FF + OUT DDRA,@1 + OUT PORTA,@0 + NOP + SBI PORTB,0 + SEI + SBI PORTB,1 +.ENDMACRO + +.MACRO RAMRD + CLR F + OUT DDRA,F ; PORTA INPUT + CLI + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + SEI + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO RAMRDX + CLR F + OUT DDRA,F ; PORTA INPUT + CBI PORTB,0 ; CS_ON + NOP + SBI PORTB,0 ; CS_OFF + IN @0,PINA ; READ DATA + LDI F,$FF + OUT DDRA,F ; PORTA OUTPUT +.ENDMACRO + +.MACRO PHOTO + OUT PORTA,@0 ; SELECT PHOTODIODE CHANNEL + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,0 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LED + OUT PORTA,@0 ; MAIN LED DRIVE PORT + LDS @0,LATCH12_SAV + OUT PORTC,@0 + SBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 + CBI PORTC,1 + SBI PORTB,2 ; THIS WILL PROVIDE LE=1 + CBI PORTB,2 ; THIS WILL PROVIDE G=0 +.ENDMACRO + +.MACRO LEDLO + LDS D,LATCH12_SAV ; DRIVE LED COMMON LO + CBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO LEDHI + LDS D,LATCH12_SAV ; DRIVE LED COMMON HI + SBR D,1<<4 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKHI + LDS D,LATCH12_SAV ; DRIVE SPEAKER HI + SBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKLO + LDS D,LATCH12_SAV ; DRIVE SPEAKER LO + CBR D,1<<3 + SBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.MACRO SPKOFF + LDS D,LATCH12_SAV ; DRIVE SPEAKER OFF + CBR D,1<<3 + CBR D,1<<2 + OUT PORTC,D + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,D +.ENDMACRO + +.EQU T1_INIT =-818 ;$FB35 +.EQU T1_FULL_SCALE =-716 ;50.0HZ ; SETS LCD FRAME RATE TEMPORARY TO STOP FLIKER +;.EQU T1_FULL_SCALE =-651 ;53.5HZ ; SETS LCD FRAME RATE +;.EQU T1_FULL_SCALE =-600 ;54.8HZ ; SETS LCD FRAME RATE + +.EQU CONTRAST_LONG =-340 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +;.EQU CONTRAST_LONG =-250 ; ALL LONG PULSES IS FULLY DARK (DON'T SATURATE) +.EQU CONTRAST_MID =-200 +.EQU CONTRAST_SHORT = -43 ; ALL SHORT PULSES IS FULLY LIGHT + +.EQU VCC_NOMINAL =-552 ;$FCC4 + +.EQU VEE_MIN =-710 ; MIN IS FULLY DARK +.EQU VEE_INIT =-340 +.EQU VEE_MAX = -43 ; MAX IS FULLY LIGHT + +; WHEN VCC = $FCC4 FOR 6.0V: +.EQU CONTRAST_MIN =-710 ; MIN IS FULLY DARK +.EQU CONTRAST_INIT =-640 +.EQU CONTRAST_MAX =-580 ; MAX IS FULLY LIGHT + +; GENEROUS LIMITS FOR EXPERIMENTATION: +;.EQU CONTRAST_MIN =$FC80 ; MIN IS FULLY DARK +;.EQU CONTRAST_MAX =$FF80 ; MAX IS FULLY LIGHT +;.EQU CONTRAST_INIT =$FE10 + +.EQU CONTRAST_STEP =4 + +.EQU DISP_DSPRAM =$60000 ; DISPLAY BUFFER +.EQU DRAW_DSPRAM =$62000 ; DRAWING BUFFER +.EQU CHSET_DSPRAM =$64000 ; START OF CHARACTER SETS +.EQU RTN_DSPRAM =$6E000 ; KEYBOARD RETURN CODE TABLE +.EQU DISPLAY_LINES =$80 +.EQU CHARACTER_SETS =10 +.EQU RAM =$60 ; START OF SRAM +.EQU TX_SIZE =$20 +.EQU RX_SIZE =$80 + +.EQU TK_LED_PULSE =14 ; 18US ?? CLOCKS OF /8 +.EQU TK_DELAY_0 =19 ; ??US DELAY TILL START OF LED PULSE (/8) +;.EQU TK_DELAY_0 =$20 ;$38 ; ??US DELAY TILL START OF LED PULSE +;.EQU TK_DELAY_0 =$25 ;$38 ; 54US ?? CLOCKS OF /8 +.EQU TK_DELAY_1 =$10 ;$28 ; CLOCKS OF /64, CHANNEL SELECT DELAY +.EQU TK_DELAY_2 =$00 ; CLOCKS OF /1024, VDD POWER ON DELAY + ; $D0 IS TOO SHORT, $E0 SEEMS TO WORK + +.EQU API_ADDRESS =$02 ; TOUCHSCREEN ADDRESS +.EQU API_TIMEOUT =33 ;50 ; 50 * 100 uSEC = APPROX 5mSEC +.EQU API_RATE_SLOW =$17 ;$5F ; DIVISOR FOR 19200 BPS +.EQU API_RATE_FAST =$00 ;$03 ; DIVISOR FOR 460800 BPS +.EQU EEWR_ENABLE =5 ; SET BY FG WHILE OK TO WRITE EEPROM +.EQU APISIZE =6 ; SET IF EXPECTING API DATA SIZE CMD +.EQU APIDATA =7 ; SET IF TRANSFERRING API DATA TX/RX + +.DEF PATTERN =R0 ; FOR HALFTONE_RECT ROUTINE +.DEF SR =R1 +.DEF RX_PTR =R2 +.DEF RX_COUNT =R3 +.DEF TX_PTR =R4 +.DEF TX_COUNT =R5 +.DEF API_REMAIN =R6 +.DEF API_WATCHDOG =R12 + +.DEF Y_SIZE =R7 +.DEF X_SIZE =R8 +.DEF LINE_CNT =R9 +.DEF XBYTE =R10 +.DEF FLAGS =R11 +; FLAGS BIT 0 0=XOR MODE 1=OR MODE +; BIT 1 0=FILL RECT 1=CLEAR RECT +; BIT 2 0=OPEN ZEROS 1=CROSSED ZEROS +; BIT 3 0=TEXT MODE 1=GRAPHICS MODE +; BIT 4 0=FIXED 1=PROPORTIONAL +; BIT 5 0=DISPLAY DISABLED 1=DISPLAY ENABLED +; BIT 6 0=TURNED OFF VIA TRANSIT SW 1=TURNED OFF VIA COMMAND +; BIT 7 USED TO CONTROL LED PULSING FOR TOUCHSCREEN EVERY 2ND CYCLE +.DEF SCAN =R13 +.DEF API_STATE =R14 + +.DEF W =R15 +.DEF F =R16 ; FG +.DEF A =R17 ; FG +.DEF B =R18 ; FG +.DEF C =R20 ; INT +.DEF D =R21 ; INT +.DEF E =R25 ; INT +;.DEF ? =R19 ; INT + +.DEF XPIXEL =R22 +.DEF CURSORX =R23 +.DEF CURSORY =R24 + +; for AVRA / TAVRASM: +;.def XL =R26 +;.def XH =R27 +;.def YL =R28 +;.def YH =R29 +;.def ZL =R30 +;.def ZH =R31 + +.DSEG +.ORG RAM + +TX_BUF: .BYTE TX_SIZE +RX_BUF: .BYTE RX_SIZE + +XBYTE_SAV: .BYTE 1 ; 063 +X_SIZE_SAV: .BYTE 1 ; 066 +XPIXEL_SAV: .BYTE 1 ; 067 +PTR: .BYTE 3 ; 068 +PORT_STATE: .BYTE 1 ; 0FA +ACTIVE_ZONE: .BYTE 1 ; 0FB + +TMPL: .BYTE 1 ; 0FE +TMPH: .BYTE 1 ; 0FF +VCCL: .BYTE 1 ; 100 +VCCH: .BYTE 1 ; 101 +VEEL: .BYTE 1 ; 102 +VEEH: .BYTE 1 ; 103 +CONTRASTL: .BYTE 1 ; 104 +CONTRASTH: .BYTE 1 ; 105 + +BUZZ_TIME: .BYTE 1 ; 10B +BUZZ_PERIOD: .BYTE 1 +TEMP: .BYTE 1 ; 10C + +DEBOUNCE: .BYTE 1 +ROW_INDEX: .BYTE 1 +ROW_BITMAP: .BYTE 2 +LATCH10_SAV: .BYTE 1 +LATCH11_SAV: .BYTE 1 +LATCH12_SAV: .BYTE 1 +XPAGE: .BYTE 1 +ROWBUF: .BYTE 32 ; BUFFER FOR DSPRAM BLOCK READ/WRITE + +LINE_COUNT: .BYTE 1 ; CURRENT POSITION TO TEST LINE_FLAGS +LINE_FLAGS: .BYTE 16 ; BUFFER 1 BIT PER LINE FOR COPY REQUIRED + +CLOCKING_PTR: .BYTE 2 + +CHAR_X: .BYTE 1 +CHAR_Y: .BYTE 1 +CHAR_PTR: .BYTE 2 + +RECT_X: .BYTE 1 +RECT_Y: .BYTE 1 +RECT_XX: .BYTE 1 +RECT_YY: .BYTE 1 + +RECTNC_X: .BYTE 1 +RECTNC_Y: .BYTE 1 +RECTNC_XX: .BYTE 1 +RECTNC_YY: .BYTE 1 + +TOUCH_KEY: .BYTE 1 +TOUCH_X: .BYTE 1 +TOUCH_Y: .BYTE 1 +TOUCH_XX: .BYTE 1 +TOUCH_YY: .BYTE 1 + +TIME_HSEC_64K: .BYTE 1 +TIME_HSEC_256: .BYTE 1 +TIME_HSEC: .BYTE 1 +TIME_SECOND: .BYTE 1 +TIME_MINUTE: .BYTE 1 +TIME_HOUR: .BYTE 1 +DATE_DAY: .BYTE 1 +DATE_MONTH: .BYTE 1 +DATE_YEAR: .BYTE 1 + +SCAN_STATE: .BYTE 1 +LATCH5_SAV: .BYTE 1 +TURNON_COUNT: .BYTE 1 +BREAK_COUNT: .BYTE 1 + +CURSORX_SAVE: .BYTE 1 +CURSORY_SAVE: .BYTE 1 +FLAGS_SAVE: .BYTE 1 +PTR_SAVE: .BYTE 3 + +SCROLL_COUNT: .BYTE 1 +SCROLL_X: .BYTE 1 +SCROLL_Y: .BYTE 1 +SCROLL_XX: .BYTE 1 +SCROLL_YY: .BYTE 1 + +.ESEG +.ORG $000 + + .DB $00,$00 ; DON'T USE ADDR $000 +EE_CONTRAST: .DB $00,$00 ; RELY ON CONTRAST_INIT TO INITIALISE + +.CSEG +.ORG $0000 + + RJMP RESET_ENTRY + RJMP GO_EXT_INT0 + RJMP GO_EXT_INT1 + RETI ; TIM2_CMP + RJMP GO_TIM2_OVF ; TIM2_OVF + RETI ; TIM1_CAPT + RETI ; TIM1_COMPA + RETI ; TIM1_COMPB + RJMP GO_T1_OVERFLOW + RJMP GO_T0_OVERFLOW + RETI ; SPI_STC + INT_HANDLERS ; API BUS + +RESET_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + LDI A,$80 + OUT ACSR,A ; POWER DOWN ANALOG COMPARATOR + + WDR ; RESET WATCHDOG + LDI A,$0F ; ENABLE WATCHDOG WITH 3 SEC TIMEOUT + OUT WDTCR,A + + LDI F,0 + STS TIME_HSEC_64K,F + STS TIME_HSEC_256,F + STS TIME_HSEC,F + STS TIME_SECOND,F + STS TIME_MINUTE,F + STS TIME_HOUR,F + LDI F,1 + STS DATE_DAY,F + STS DATE_MONTH,F + LDI F,20 + STS DATE_YEAR,F + +RESTART_ENTRY: +;**: + LDI F,8 ; TIMER 2 CLOCKED BY 32 KHZ +;** LDI F,0 ; TIMER 2 CLOCKED BY 11 MHZ + OUT ASSR,F +;**: + ; MUST MATCH SET_TIME ROUTINE % + LDI F,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;!! LDI F,$11 ; DIVIDE BY 2, TOGGLE OC2 (PIN 21) + ; (RTC DIAGNOSTIC) +;** LDI F,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,F + ; % + LDI F,$40 + OUT TIMSK,F ; TIMER 2 OVERFLOW INTERRUPTS ENABLED + LDI F,$00 + OUT GIMSK,F + + LDI F,$B8 ; INIT_PORTS + OUT DDRD,F + OUT PORTD,F ; D2 = TRI-STATE, VSWT ON + LDI F,$1F + OUT DDRB,F + LDI F,$FF + OUT DDRA,F + OUT DDRC,F + + CLR F + OUT PORTA,F + + LDI F,$03 ; CS, WE HI, LEs ALL LO + OUT PORTB,F + + LDI F,$10 ; LED COMMON OFF, SPEAKER OFF + OUT PORTC,F + SBI PORTB,2 + CBI PORTB,2 + STS LATCH12_SAV,F + + LDI F,$20 + MOV FLAGS,F ; START WITH DISPLAY ENABLED + + INIT_API_BUS + + LDI D,$18 ; A18|A17|A16|A15|A14=11000 + OUT PORTA,D ; CL1=M=FLM=0 + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + CLR D + STS LATCH11_SAV,D + STS LINE_COUNT,D ; START UPDATE AT TOP OF SCREEN + STS TURNON_COUNT,D ; REDUNDANTLY REQUEST TURNON + STS BREAK_COUNT,D ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BUZZ_TIME,D ; NOT BUZZING (SHORT BEEP COMES LATER) + + CLR SCAN + STS ROW_INDEX,SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + + LDI D,$F4 ; BIT 6 = 1 VDD ON, BIT 7 = 1 LCD ON + STS LATCH5_SAV,D + PHOTO D + + ; NEED THIS FOR RTC + SEI ; ALLOW TIMER 2 INTERRUPTS ONLY + + ; INITIALISE ACTIVE KEYS +RTNCDE: ;LDIZ RTN_CODE ; POINT Z TO FLASH + LDI ZL,LOW((RTN_CODE)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX RTN_CODE_END-RTN_CODE ; BYTE COUNTER + LDI XL,LOW((RTN_CODE_END-RTN_CODE)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((RTN_CODE_END-RTN_CODE)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR RTN_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CDE0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CDE1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + CLR R0 ; TEMPORARY CLEAR KB + RAMWRX R0 ; WRITE DATA TO DSPRAM + DEC XL + BREQ RTNCDE_END ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CDE1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CDE0 +RTNCDE_END: + + ; INITIALISE DEFAULT CHARACTER SET + LDI A,'0' + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + PUSH YL + PUSH YH + RCALL CHARACTER_SET_CRC ; Y = CALCULATED CRC WORD + POP XH + POP XL + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YH + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + SWAP A + RCALL HEX_NIBBLE + CP A,B + BRNE CHARACTER_SET_INIT + ADIW XL,1 + + RCALL GO_READ_BYTE + MOV B,A + MOV A,YL + RCALL HEX_NIBBLE + CP A,B + BREQ CHARACTER_SET_INIT_DONE + +CHARACTER_SET_INIT: + ;LDIZ CHSET00 ; POINT Z TO FLASH + LDI ZL,LOW((CHSET00)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ;LDIX CHSET00_END-CHSET00 ; BYTE COUNTER + LDI XL,LOW((CHSET00_END-CHSET00)*2) ; USE AS BYTE COUNTER + LDI XH,HIGH((CHSET00_END-CHSET00)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + LDIYADR CHSET_DSPRAM ; POINT Y TO DSPRAM & SET XPAGE +CHST0: ADRH YH ; SET ADDRESS H FOR DSPRAM +CHST1: ADRL YL ; SET ADDRESS L FOR DSPRAM + LPM ; GET DATA FROM FLASH + RAMWRX R0 ; WRITE DATA TO DSPRAM + SBIW XL,1 + BREQ CHARACTER_SET_INIT_DONE ; CHECK IF ALL DONE + ADIW ZL,$01 ; INC FLASH ADDRESS + INC YL ; INC ADDRESS L FOR DSPRAM + MOV A,YL ; + ANDI A,$3F ;YL,$3F + BRNE CHST1 + SUBI YL,$40 ; + INC YH ; INC ADDRESS H (ON L ROLLOVER) + RJMP CHST0 + +CHARACTER_SET_INIT_DONE: + LDI B,LOW(CHSET_DSPRAM+$10) ; SET POINTER TO HEADER + STS PTR,B + LDI B,HIGH(CHSET_DSPRAM+$10) ;<<2 + STS PTR+1,B + LDI B,HIGH((CHSET_DSPRAM+$10)>>6) + STS PTR+2,B + + ; CLEAR REFRESH BUFFER TO AVOID A BRIEF FLICKER + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL GO_SELECT_XPAGE + + LDI B,DISPLAY_LINES ; B = LINES TO CLEAR + +CLEAR_REFRESH: + PUSH B + PUSH YL + PUSH YH + + LDI B,32 + RCALL GO_CLEAR_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + ADIW YL,6 + LDI B,2 + RCALL GO_CLEAR_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP YH + POP YL + POP B + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE CLEAR_REFRESH + + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + + LDI A,0 + STS BUZZ_PERIOD,A ; HIGHEST FREQUENCY + LDI A,54 ;$40 + STS BUZZ_TIME,A ; SHORT BEEP ON STARTUP + + LDI A,0 + STS SCAN_STATE,A ; START ON FIRST LED / PHOTODIODE PAIR + + LDI A,0 + STS CLOCKING_PTR,A + STS CLOCKING_PTR+1,A ; INITIALISE CURRENT LINE FOR CLOCKING + + LDI A,HIGH(VEE_INIT) + STS VEEH,A + LDI A,LOW(VEE_INIT) + STS VEEL,A ; INIT MEASURED VEE + + LDI B,EE_CONTRAST*2 + RCALL EE_READ + ANDI A,~(CONTRAST_STEP-1) + STS CONTRASTL,A + LDI B,EE_CONTRAST*2+1 + RCALL EE_READ + STS CONTRASTH,A + + LDS A,CONTRASTL + LDS B,CONTRASTH + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_RESET + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRLO CONTRAST_PRESERVE + +CONTRAST_RESET: + LDI A,HIGH(CONTRAST_INIT) + STS CONTRASTH,A + LDI A,LOW(CONTRAST_INIT) + STS CONTRASTL,A ; INIT REQUESTED CONTRAST + +CONTRAST_PRESERVE: + LDI A,HIGH(CONTRAST_MID) + OUT OCR1BH,A + LDI A,LOW(CONTRAST_MID) + OUT OCR1BL,A ; INIT GENERATOR PULSE WIDTH + + LDI A,HIGH(T1_INIT) + OUT TCNT1H,A + LDI A,LOW(T1_INIT) + OUT TCNT1L,A + + LDI A,$50 + OUT TCCR1A,A ; TIMER 1 TOGGLE ON COMPARE MATCH + LDI A,$01 + OUT TCCR1B,A ; TIMER 1 RUNNING + + LDI F,$00 + OUT TCCR0,F ; TIMER 0 NOT RUNNING YET + + LDI F,$05 + OUT TIFR,F ; RESET TIMER 0, 1 INTERRUPT FLAGS + LDI F,$45 + OUT TIMSK,F ; TURN ON TIMER 0, 1, 2 INTERRUPTS + + LDI F,$0A + OUT MCUCR,F ; SET EXTERNAL INTERRUPT 0, 1 SENSE + LDI F,$C0 + OUT GIFR,F ; RESET EXTERNAL INTERRUPT 0, 1 FLAGS + OUT GIMSK,F ; TURN ON EXTERNAL INTERRUPT 0, 1 + + ;RCALL HELLO_DISPLAY ; SHOW EXAMPLE DISPLAY + + ;RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP SAVE_ENTRY ; IN CASE STATE INADVERTENTLY RESTORED + +; ----------------------------------------------------------------------------- + +SLEEP_ENTRY: + LDI F,HIGH(RAMEND) ; INIT STACK POINTER + OUT SPH,F + LDI F,LOW(RAMEND) + OUT SPL,F + + LDI D,$00 + OUT TCCR1A,D ; DISCONNECT PWM FROM OC1A, OC1B + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + OUT TCCR1B,D ; STOP TIMER 1 ALTOGETHER + + SBI PORTD,4 ; TURN TRANSISTOR OFF + CBI PORTD,5 ; DROP CL2 + + LDS D,LATCH10_SAV + ANDI D,$BF ; DROP M + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + + LDI D,$74 ; BIT 6 = 1 VDD ON, BIT 7 = 0 LCD OFF + SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + LDI D,$34 ; BIT 6 = 0 VDD OFF, BIT 7 = 0 LCD OFF + STS LATCH5_SAV,D + PHOTO D + + LDI D,$41 + OUT TIMSK,D ; DISABLE TIMER 1 INTERRUPTS + + LDI D,0 + OUT TCCR0,D ; DISABLE TIMER 0 TEMPORARILY ONLY + OUT GIMSK,D ; DISABLE THERMISTOR INTERRUPTS + + LDI F,4 + STS TURNON_COUNT,F ; .25 SEC TO BREAK, .75 SEC TO MAKE + + INIT_API_BUS ; RESET UART TO RECEIVE TURNON COMMAND + +SLEEP_LOOP: + CLI + IN F,TCCR0 + TST F + LDI F,$4A ; SE=1 SM1:SM0=00 FOR IDLE MODE + BRNE SLEEP_SETUP ; TIMER 0 RUNNING, STAY IN IDLE MODE + SBIS PIND,0 ; BREAK OFF, UART ACTIVE, STAY IN IDLE + LDI F,$7A ; SE=1 SM1:SM0=11 FOR POWER SAVE MODE +SLEEP_SETUP: + OUT MCUCR,F + SEI + SLEEP + + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDS F,TURNON_COUNT + TST F ; HAD TOUCHSCREEN ACTIVITY FOR TIMEOUT? + ;SBRS FLAGS,6 ; IF WE TURNED OFF VIA BREAK DETECT, + ;SBIS PIND,0 ; AND BREAK HAS DISAPPEARED, WAKE UP + BRNE SLEEP_LOOP ; NO, GO BACK TO SLEEP + + CLI + RJMP RESTART_ENTRY ; GO AND CLEAR DISPLAY ETC + +; ----------------------------------------------------------------------------- + +ADRYP: LDS YH,XPAGE ; SET XPAGE ADDRESS FOR DSPRAM + LDS YL,LATCH10_SAV + ANDI YL,$E0 + OR YH,YL + OUT PORTA,YH + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,YH + RET + +;INCADRY: +; CLR YL +; INC YH +; BRNE INCRET +; LDS YH,XPAGE +; INC YH +; ANDI YH,$1F +; STS XPAGE,YH +; CLR YH +;INCRET: RET + +; ----------------------------------------------------------------------------- + +;HELLO_DISPLAY: +; LDI A,0 +; STS RECTNC_X,A +; STS RECTNC_Y,A +; STS RECTNC_XX,A +; LDI A,$80 +; STS RECTNC_YY,A +; RCALL DRAW_RECTNC +; +; LDI A,16 +; STS CHAR_X,A +; STS CHAR_Y,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; RCALL STRING_DRAW +; +; LDI A,240 +; STS CHAR_X,A +; LDI B,5 +; LDI ZL,LOW(HELLO_MESSAGE*2) +; LDI ZH,HIGH(HELLO_MESSAGE*2) +; +;STRING_RIGHT_JUST: +; PUSH B +; PUSH ZL +; PUSH ZH +; RCALL STRING_WIDTH +; POP ZH +; POP ZL +; POP B +; LDS A,CHAR_X +; SUB A,R0 +; STS CHAR_X,A +; +;STRING_DRAW: +; PUSH B +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; PUSH R0 +; RCALL DRAW_CHAR +; POP R0 +; POP ZH +; POP ZL +; LDS A,CHAR_X +; ADD A,R0 +; STS CHAR_X,A +; POP B +; DEC B +; BRNE STRING_DRAW +; RET +; +;STRING_WIDTH: +; CLR R0 +;STRING_WIDTH_LOOP: +; PUSH B +; PUSH R0 +; LPM +; MOV A,R0 +; ADIW ZL,1 +; PUSH ZL +; PUSH ZH +; RCALL FIND_CHAR +; RCALL CHAR_WIDTH +; POP ZH +; POP ZL +; POP A +; ADD R0,A +; POP B +; DEC B +; BRNE STRING_WIDTH_LOOP +; RET +; +;HELLO_MESSAGE: .DB 'H','E','L','L','O',0 + +; ----------------------------------------------------------------------------- + +MAIN_LOOP: + SEI ; SHOULD BE BEFORE MAIN_LOOP + + LDI A,~(1< CHARACTER SET + LDI YL,$10 + STS PTR,YL + STS PTR+1,YH + STS PTR+2,B + RJMP MAIN_LOOP + +SET_TIME: + LDI A,0 + OUT TCCR2,A ; STOP COUNTING WHILE SETTING CLOCK + STS TIME_HSEC_64K,A + STS TIME_HSEC_256,A + STS TIME_HSEC,A + RCALL RX_WAIT + STS TIME_HOUR,A + RCALL RX_WAIT + STS TIME_MINUTE,A + RCALL RX_WAIT + STS TIME_SECOND,A + RCALL RX_WAIT + STS DATE_MONTH,A + RCALL RX_WAIT + STS DATE_DAY,A + RCALL RX_WAIT + STS DATE_YEAR,A + LDI A,3 ; TIMER 2 DIVIDE BY 32 (4 HZ) +;** LDI A,6 ; TIMER 2 DIVIDE BY 256 + OUT TCCR2,A + RJMP MAIN_LOOP + +LF: RCALL LINE_FEED + RJMP MAIN_LOOP + +LINE_FEED: + PUSH R0 + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + INC YL + A14_A18 B + RCALL LPMS + MOV A,CURSORY + ADD A,R0 + ADD A,R0 + DEC A + CPI A,DISPLAY_LINES + BRLO INC_CURSORY + RCALL GO_SCROLL + POP R0 + RET + +INC_CURSORY: + ADD CURSORY,R0 + POP R0 + RET + +CLR_DISP: + RCALL CLEAR_DISPLAY ; CLEARS DISPLAY AND HOMES CURSOR + RJMP MAIN_LOOP + +INTERPRET_MODE: + RCALL RX_WAIT + CPI A,$30 + BRNE TEXT_MODE + RJMP L01A4 +TEXT_MODE: + CPI A,$31 + RJEQ GRAPHICS_MODE +;L01A3: + RJMP MAIN_LOOP + +L01A4: LDI F,$F7 + AND FLAGS,F + RJMP MAIN_LOOP + +GRAPHICS_MODE: + LDI F,$08 + OR FLAGS,F + RJMP MAIN_LOOP + +PROP_FIXED_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ FIXED +;L01AE: + CPI A,$31 + RJEQ PROPORTIONAL +L01B1: +; RJMP MAIN_LOOP + +FIXED: LDI F,$EF + AND FLAGS,F + RJMP MAIN_LOOP + +PROPORTIONAL: + LDI F,$10 + OR FLAGS,F + RJMP MAIN_LOOP + +BACK_SPACE: + LDS YL,PTR + LDS YH,PTR+1 + LDS B,PTR+2 + SUBI YH,$FE + A14_A18 B + RCALL LPMS + SUB CURSORX,R0 + IN A,SREG + SBRS A,2 + RJMP MAIN_LOOP + +CR: CLR CURSORX + RJMP MAIN_LOOP + +ENABLE_CNTRL: + RCALL RX_WAIT + SBRC A,1 + RJMP ENABLE_UPDATE + SBRC A,0 + RJMP ENABLE_ON +;ENABLE_OFF: + LDI F,$DF + AND FLAGS,F + RJMP MAIN_LOOP +ENABLE_ON: + LDI F,$20 + OR FLAGS,F +ENABLE_UPDATE: + CLR F + STS LINE_COUNT,F ; START UPDATE AT TOP OF SCREEN +ENABLE_LOOP: + RCALL NICK_SUB2 ; IMMEDIATE UPDATE OF ENTIRE SCREEN + BRNE ENABLE_LOOP + RJMP MAIN_LOOP + +DRAW_MODE: + RCALL RX_WAIT + CPI A,$30 + RJEQ XOR_MODE +;L01D3: + CPI A,$31 + RJEQ OR_MODE +;L01D6: + RJMP MAIN_LOOP + +XOR_MODE: + LDI F,$FE + AND FLAGS,F + RJMP MAIN_LOOP + +OR_MODE: + LDI F,$01 + OR FLAGS,F + RJMP MAIN_LOOP + +SET_CURSOR: + RCALL RX_WAIT + MOV CURSORX,A +GET_Y: RCALL RX_WAIT + MOV CURSORY,A + RJMP MAIN_LOOP + +CLEAR_RECTANGLE: + LDI F,$02 + OR FLAGS,F + +GET_RECT_SIZE: + STS RECT_X,CURSORX + STS RECT_Y,CURSORY + RCALL RX_WAIT + STS RECT_XX,A + RCALL RX_WAIT + STS RECT_YY,A + RCALL DRAW_RECT + LDI F,$FD + AND FLAGS,F + RJMP MAIN_LOOP + +GET_FILLED_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL FILLED_RECTNC + RJMP MAIN_LOOP + +GET_RECTNC_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL RX_WAIT + STS RECTNC_XX,A + RCALL RX_WAIT + STS RECTNC_YY,A + RCALL DRAW_RECTNC + RJMP MAIN_LOOP + +CONTRAST_CONTROL: + RCALL RX_WAIT + + SBRS A,0 + RJMP CONTRAST_DARKER + +;CONTRAST_LIGHTER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(-CONTRAST_STEP) + SBCI B,HIGH(-CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MAX) + LDI F,HIGH(CONTRAST_MAX) + CPC B,F + BRSH CONTRAST_DONE + RJMP CONTRAST_WRITE + +CONTRAST_DARKER: + LDS A,CONTRASTL + LDS B,CONTRASTH + SUBI A,LOW(CONTRAST_STEP) + SBCI B,HIGH(CONTRAST_STEP) + + CPI A,LOW(CONTRAST_MIN) + LDI F,HIGH(CONTRAST_MIN) + CPC B,F + BRLO CONTRAST_DONE + +CONTRAST_WRITE: + STS CONTRASTL,A + STS CONTRASTH,B + + LDI B,EE_CONTRAST*2 + RCALL EE_WRITE + LDS A,CONTRASTH + LDI B,EE_CONTRAST*2+1 + RCALL EE_WRITE + +CONTRAST_DONE: + RJMP MAIN_LOOP + +EE_READ: + SBIC EECR,EEWE + RJMP EE_READ ; WAIT UNTIL EEPROM BECOMES READY + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + SBI EECR,EERE ; READ DATA BYTE + IN A,EEDR ; GET LATCHED DATA BYTE + RET + +EE_WRITE: + SBIC EECR,EEWE + RJMP EE_WRITE ; WAIT FOR EEPROM TO BECOME READY + + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT0: + RJMP EE_WRITE_HALT0 ; HALT PROCESSOR IF EE WRITING DISABLED + + OUT EEARL,B + CLR B + OUT EEARH,B ; ASSUME EEPROM ADDRESSES < $100 + OUT EEDR,A ; LATCH NEW VALUE + + CLI + SBRS API_STATE,EEWR_ENABLE +EE_WRITE_HALT1: + RJMP EE_WRITE_HALT1 ; HALT PROCESSOR IF EE WRITING DISABLED + + SBI EECR,EEMWE ; MASTER WRITE ENABLE + SBI EECR,EEWE ; START WRITING NEW VALUE + RETI + +GO_SCROLL: + RJMP SCROLL + +CHARACTER_SET_DOWNLOAD: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + RCALL RX_WAIT + MOV XL,A + RCALL RX_WAIT + MOV XH,A + +CHARACTER_SET_DOWNLOAD_LOOP: + RCALL RX_WAIT + + A14_A18 B + RCALL GO_WRITE_BYTE + + ADIW YL,1 + SBIW XL,1 + MOV A,XL + OR A,XH + RJNE CHARACTER_SET_DOWNLOAD_LOOP ; BRNE ?? + RJMP MAIN_LOOP + +CHARACTER_SET_QUERY: + RCALL RX_WAIT + RCALL CHARACTER_SET_FIND ; B:Y -> CHARACTER SET + + PUSH A + RCALL CHARACTER_SET_CRC + + LDI A,$1B + RCALL TX_WAIT + LDI A,'?' + RCALL TX_WAIT + POP A + SUBI A,-'0' + RCALL TX_WAIT + + MOV A,YH + RCALL TX_HEX_BYTE + MOV A,YL + RCALL TX_HEX_BYTE + RJMP MAIN_LOOP + +CHARACTER_SET_FIND: + LDI YL,LOW(CHSET_DSPRAM) + LDI YH,HIGH(CHSET_DSPRAM)<<4 + LDI B,HIGH(CHSET_DSPRAM>>4) + + ANDI A,$0F + CPI A,CHARACTER_SETS + BRSH CHARACTER_SET_FIND_DONE ; DEFAULT TO SET 0 + + ADD B,A + +CHARACTER_SET_FIND_DONE: + LSR B + ROR YH + LSR B + ROR YH + LSR YH + LSR YH + RET + +CHARACTER_SET_CRC: + LDI XL,LOW($216) + LDI XH,HIGH($216) ; PAST CRC, INDEX, CELL SIZES + ADD XL,YL + ADC XH,YH ; B:X -> LENGTH WORD IN CHARACTER SET + A14_A18 B + RCALL GO_READ_BYTE + MOV ZL,A + ADIW XL,1 + RCALL GO_READ_BYTE + MOV ZH,A ; Z = LENGTH OF DATA INCLUDING CRC + + MOV XL,YL + MOV XH,YH + ADIW XL,4 ; B:X -> DATA BLOCK EXCLUDING CRC + + LDI YL,$FF + LDI YH,$FF ; Y = SEED FOR CRC CALCULATION + + SBIW ZL,1 + ANDI ZH,$0F + SBIW ZL,4 ; Z = LENGTH OF DATA-1 EXCLUDING CRC + BRLO CHARACTER_SET_CRC_DONE + ADIW ZL,1 + +CHARACTER_SET_CRC_BYTE: + RCALL GO_READ_BYTE + ADIW XL,1 + + LDI F,$21 + LDI B,$10 ; B:F = CRC POLYNOMIAL + EOR YH,A ; Y = CRC REGISTER WITH NEW DATA BYTE + + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT0 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT0: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT1 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT1: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT2 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT2: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT3 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT3: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT4 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT4: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT5 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT5: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT6 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT6: + LSL YL + ROL YH + BRCC CHARACTER_SET_CRC_BIT7 + EOR YL,F + EOR YH,B +CHARACTER_SET_CRC_BIT7: + + SBIW ZL,1 + BRNE CHARACTER_SET_CRC_BYTE + +CHARACTER_SET_CRC_DONE: + RET + +TX_HEX_BYTE: + PUSH A + SWAP A + RCALL HEX_NIBBLE + RCALL TX_WAIT + POP A + RCALL HEX_NIBBLE + RJMP TX_WAIT + +HEX_NIBBLE: + ANDI A,$0F + ORI A,$30 + CPI A,$3A + BRLO HEX_NIBBLE_DONE + SUBI A,-7 +HEX_NIBBLE_DONE: + RET + +SAVE_STATE: + RCALL RX_WAIT + SBRC A,0 + RJMP RESTORE_STATE + +SAVE_ENTRY: + STS CURSORX_SAVE,CURSORX + STS CURSORY_SAVE,CURSORY + STS FLAGS_SAVE,FLAGS + LDS A,PTR + STS PTR_SAVE,A + LDS A,PTR+1 + STS PTR_SAVE+1,A + LDS A,PTR+2 + STS PTR_SAVE+2,A + RJMP MAIN_LOOP + +RESTORE_STATE: + LDS CURSORX,CURSORX_SAVE + LDS CURSORY,CURSORY_SAVE + LDI A,$C0 + AND FLAGS,A + LDS A,FLAGS_SAVE + ANDI A,$3F + OR FLAGS,A + LDS A,PTR_SAVE + STS PTR,A + LDS A,PTR_SAVE+1 + STS PTR+1,A + LDS A,PTR_SAVE+2 + STS PTR+2,A + RJMP MAIN_LOOP + +TOUCH_ZONE: + RCALL RX_WAIT + STS TOUCH_KEY,A + + RCALL RX_WAIT + MOV YL,A + SUBI A,-9 + RCALL DIVIDE_10 + STS TOUCH_X,B + + RCALL RX_WAIT + MOV YH,A + SUBI A,-4 + RCALL DIVIDE_13 + STS TOUCH_Y,B + + RCALL RX_WAIT + ADD A,YL + SUBI A,15 + RCALL DIVIDE_10 + STS TOUCH_XX,B + + RCALL RX_WAIT + ADD A,YH + SUBI A,17 + RCALL DIVIDE_13 + STS TOUCH_YY,B + + LDS YH,TOUCH_Y +TOUCH_ZONE_Y: + LDS A,TOUCH_YY + SUB A,YH + BRSH TOUCH_ZONE_Y_CONT + RJMP TOUCH_ZONE_Y_END +TOUCH_ZONE_Y_CONT: + + LDS YL,TOUCH_X + MOV A,YL + ADD A,YH + MOV B,YH + LSL B + LSL B + LSL B + ADD A,B + LSL B + ADD A,B + + LDI XL,LOW(RTN_DSPRAM) + LDI XH,HIGH(RTN_DSPRAM) ;<<2 + LDI B,0 + ADD XL,A + ADC XH,B + + LDI B,HIGH(RTN_DSPRAM>>6) ; B:X -> RETURN CODE TABLE + A14_A18 B + +TOUCH_ZONE_X: + LDS A,TOUCH_XX + SUB A,YL + BRLO TOUCH_ZONE_X_END + + A0_A13 XL,XH + LDS A,TOUCH_KEY + RAMWR A ; WRITE DATA TO DSPRAM + + ADIW XL,1 + INC YL + RJMP TOUCH_ZONE_X + +TOUCH_ZONE_X_END: + INC YH + RJMP TOUCH_ZONE_Y + +TOUCH_ZONE_Y_END: + RJMP MAIN_LOOP + +DIVIDE_10: + LDI B,-1 +DIVIDE_10_LOOP: + INC B + SUBI A,10 + BRCC DIVIDE_10_LOOP + RET + +DIVIDE_13: + LDI B,-1 +DIVIDE_13_LOOP: + INC B + SUBI A,13 + BRCC DIVIDE_13_LOOP + RET + +NULLSUB2: + RCALL RX_WAIT + +NULLSUB: + RCALL RX_WAIT + RJMP MAIN_LOOP + +RX_WAIT: + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +RX_WAIT_LOOP: + ; FORMERLY DONE IN TIMER 2 OVERFLOW INTERRUPT + WDR + + LDI A,0 + OUT EEARL,A ; RESET EEPROM ADDRESS REG WHILE IDLE + OUT EEARH,A + + LDI A,-$40 + SBIC PIND,0 ; RXD HIGH? + STS BREAK_COUNT,A ; YES, TOP UP VERY SHORT BREAK TIMEOUT + + SBRC FLAGS,5 ; DISPLAY ENABLED? + RCALL NICK_SUB2 ; IF SO, COPY 1 LINE ACCORDING TO FLAGS + + TST RX_COUNT + BREQ RX_WAIT_LOOP + + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE PROCESSING CHARACTER + +RX_CHAR: + MRX_CHAR +TX_WAIT: + MTX_WAIT +TX_CHAR: + MTX_CHAR + +DRAW_CHAR_TTY: + RCALL FIND_CHAR ; SET UP CHAR_PTR FROM A = CHAR + RCALL CHAR_WIDTH ; SET UP R0 = PROP WIDTH FROM CHAR PTR + + CLR F + STS TEMP,F ; NUDGE FOR FIXED SPACING MODE + + SBRC FLAGS,4 + RJMP PROP_MODE ; FORCED TO FIXED SPACING MODE? + + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + MOV W,R0 + RCALL LPMS ; GET R0 = CELL WIDTH FOR CHARACTER SET + PUSH R0 + SUB R0,W + BRCC NUDGE_OK + CLR R0 ; NO NEGATIVE CENTRING +NUDGE_OK: + LSR R0 + STS TEMP,R0 + POP R0 ; RESTORE R0 = FIXED CELL WIDTH + +PROP_MODE: + SBRC FLAGS,3 + RJMP OK_LINE ; FORCED TO GRAPHICS MODE? + + MOV F,CURSORX + ADD F,R0 ; CHECK IF CHAR WILL FIT ON THIS LINE + BRCC OK_LINE + + CLR CURSORX + RCALL LINE_FEED ; NO, WRAP CURSOR PRIOR TO DRAWING CHAR + + LDS A,PTR+2 + RCALL SELECT_XPAGE ; IN CASE WE SCROLLED THE DISPLAY + +OK_LINE: + LDS F,TEMP + ADD F,CURSORX + STS CHAR_X,F + STS CHAR_Y,CURSORY ; SET UP TOP LEFT COORDINATES + + ADD CURSORX,R0 ; ADVANCE CURSOR + +DRAW_CHAR: + LDS XPIXEL,CHAR_X + LDS LINE_CNT,CHAR_Y + + SBRS X_SIZE,6 + RJMP Y_OFFSET_DONE ; Y OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$02 + RCALL LPMS + ADD LINE_CNT,R0 + +Y_OFFSET_DONE: + SBRS X_SIZE,7 + RJMP X_OFFSET_DONE ; X OFFSET FOUND? + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + SBIW YL,$03 + RCALL LPMS + ADD XPIXEL,R0 + +X_OFFSET_DONE: + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + ADIW YL,$01 + RCALL LPMS ; GET R0 = Y LINES FOR CHARACTER + MOV Y_SIZE,R0 + + LDI F,$FF + OUT DDRA,F + SBI PORTB,0 ; REMOVE_CS + LDI F,$1F + AND X_SIZE,F + STS X_SIZE_SAV,X_SIZE + CLR F + CPSE X_SIZE,F + RJMP DRAW_IT + RJMP DONE + +DRAW_IT: + CLR XL + MOV XH,LINE_CNT + LSR XH + ROR XL + LSR XH + ROR XL + SUBI XH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + RJMP FIRSTT + +MORE_Y: INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + + LDS X_SIZE,X_SIZE_SAV + LDS XBYTE,XBYTE_SAV + +FIRSTT: OR XBYTE,XL + CLR B ; RESIDUAL + +MORE_X: ADIW YL,$01 + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + + CLR A + LDS XPIXEL,XPIXEL_SAV + TST XPIXEL + BREQ OUT_DATA + + CLC +SHIFT_AGAIN: + ROR R0 + ROR A + DEC XPIXEL + BRNE SHIFT_AGAIN + + OR R0,B + MOV B,A + +OUT_DATA: + LDI F,HIGH(DRAW_DSPRAM>>6) + A14_A18 F + A0_A13 XBYTE,XH + RAMRXW R0,F + + INC XBYTE + DEC X_SIZE + RJNE MORE_X + + TST B + BREQ SKIP_FINAL + A0_A13 XBYTE,XH + RAMRXW B,F + +SKIP_FINAL: + RCALL NICK_SUB1 + DEC Y_SIZE + RJNE MORE_Y + +DONE: RET + +FIND_CHAR: + MOV YL,A + CLR YH + LSL YL + ROL YH + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + LDS A,PTR+2 + RCALL SELECT_XPAGE + RCALL LPMS + ADIW YL,$01 + MOV W,R0 + RCALL LPMS + MOV YL,W + MOV YH,R0 + LDS A,PTR + ADD YL,A + LDS A,PTR+1 + ADC YH,A + STS CHAR_PTR,YL + STS CHAR_PTR+1,YH + RET + +CHAR_WIDTH: + LDS YL,CHAR_PTR + LDS YH,CHAR_PTR+1 + RCALL LPMS + MOV X_SIZE,R0 + SBIW YL,$01 + SBRC X_SIZE,5 + RJMP LPMS ; PROPORTIONAL WIDTH IS PRESENT + LDS YL,PTR + LDS YH,PTR+1 + SUBI YH,$FE + RJMP LPMS ; NO PROPORTIONAL WIDTH, USE CELL WIDTH + +NICK_SUB1: ; SET FLAG FOR COPY, LINE_CNT + PUSH YL + PUSH YH + + MOV A,LINE_CNT + RCALL FIND_BIT + LD A,Y + OR A,B + ST Y,A + + POP YH + POP YL + RET + +NICK_SUB2: ; TEST FLAG AND COPY, LINE_COUNT + PUSH B + PUSH YL + PUSH YH + + LDS A,LINE_COUNT + RCALL FIND_BIT + LD A,Y + AND A,B + RJEQ NICK_SUB2_DONE + + LD B,Y + EOR B,A + ST Y,B + + ; LET'S BE SAFE + LDI A,0 ; SET LONGEST POSSIBLE BREAK TIMEOUT + STS BREAK_COUNT,A ; WHILE COPYING TO DISPLAY BUFFER + + PUSH XL + PUSH XH + + CLR YL + LDS YH,LINE_COUNT + LSR YH + ROR YL + LSR YH + ROR YL ; Y -> DISPLAY BUFFER + + MOV XL,YL + MOV XH,YH + SUBI XH,HIGH(-DRAW_DSPRAM) ; X -> DRAWING BUFFER + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + LDI B,32 + RCALL COPY_BYTES ; 240 PIXELS, PLUS 16 FOR SAMSUNG + + SBIW XL,2 + ADIW YL,6 + LDI B,2 + RCALL COPY_BYTES ; REPEAT FINAL 16 PIXELS FOR HYUNDAI + + POP XH + POP XL + + LDI A,-$40 + STS BREAK_COUNT,A ; SET VERY SHORT BREAK TIMEOUT + +NICK_SUB2_DONE: + LDS A,LINE_COUNT + INC A + ANDI A,DISPLAY_LINES-1 + STS LINE_COUNT,A + + POP YH + POP YL + POP B + RET + +; NEW CODE: (NOT WORKING YET) +; WE HAVE JUST DRAWN INTO THE DRAWING BUFFER AT $62000, +; AND NOW WANT TO COPY THE DOT ROW CONCERNED +; TO THE THE DISPLAY BUFFER AT $60000 +; CLI +; +; PUSH YL +; PUSH XL +; PUSH XH +; +; A0_A13 YL,YH +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; CLR A +; OUT DDRA,A ; PORTA INPUT +; CBI PORTB,0 ; CS ON +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +;NSUB0: OUT PORTC,YL ; SET ADDRESS +; INC YL ; NEED SOME DELAY HERE +; DEC B +; IN A,PINA ; READ DATA +; ST X+,A ; SAVE IN ROW BUFFER +; BRNE NSUB0 +; SBI PORTB,0 ; CS OFF +; SER A +; OUT DDRA,A ; PORTA OUTPUT +; +; LDI XL,LOW(ROWBUF) ; SRAM BUFFER FOR BLOCK READ +; LDI XH,HIGH(ROWBUF) +; +; LDI A,LATCH11_SAV +; ANDI A,$7F ; POINT TO $2000 LOWER +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; IN YL,PORTC +; ANDI YL,$C0 ; POINT TO START OF ROW +; LDI B,$20 ; COPYING 32 BYTES +; CBI PORTB,1 ; WE ON +;NSUB1: OUT PORTC,YL ; SET ADDRESS +; LD A,X+ ; GET DATA FROM ROW BUFFER +; OUT PORTA,A +; INC YL ; MAY AS WELL DELAY HERE +; DEC B +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; BRNE NSUB1 +; +; ADDI YL,7 ; SHIFT LAST 2 BYTES FOR HYUNDAI +; OUT PORTC,YL ; SET ADDRESS +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; DEC YL +; OUT PORTC,YL ; SET ADDRESS +; SBIW XL,2 +; LD A,X +; OUT PORTA,A +; CBI PORTB,0 ; CS ON +; SBI PORTB,0 ; CS OFF +; +; SBI PORTB,1 ; WE OFF +; LDI A,LATCH11_SAV ; RESTORE H ADDRESS +; OUT PORTA,A +; SBI PORTB,3 +; CBI PORTB,3 +; +; POP XH +; POP XL +; POP YL +; SEI +; RET + +FIND_BIT: + LDI YL,LOW(LINE_FLAGS) + LDI YH,HIGH(LINE_FLAGS) + ; LET'S BE SAFE + ANDI A,$7F + MOV B,A + LSR B + LSR B + LSR B + ADD YL,B + LDI B,0 + ADC YH,B + LDI B,1 + ANDI A,7 + BREQ FIND_BIT_RET +FIND_BIT_LOOP: + LSL B + DEC A + BRNE FIND_BIT_LOOP +FIND_BIT_RET: + RET + +GO_READ_BYTE: + RJMP READ_BYTE + +GO_WRITE_BYTE: + RJMP WRITE_BYTE + +GO_CLEAR_BYTES: + RJMP CLEAR_BYTES + +GO_SELECT_XPAGE: + RJMP SELECT_XPAGE + +GO_SCROLL_REGION: + RJMP SCROLL_REGION + +;GO_MAIN_LOOP: +; RJMP MAIN_LOOP + +GO_EXT_INT0: + RJMP EXT_INT0 + +GO_EXT_INT1: + RJMP EXT_INT1 + +GO_TIM2_OVF: + RJMP TIM2_OVF + +GO_T1_OVERFLOW: + RJMP T1_OVERFLOW + +GO_T0_OVERFLOW: + RJMP T0_OVERFLOW + +DRAW_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP L03A3 +L039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +L03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ L03B0 + LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + TST XPIXEL + BREQ L03B0 +L03AD: LSR A + DEC XPIXEL + BRNE L03AD +L03B0: RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +L03B8: LDI F,$08 + CP X_SIZE,F + BRLO L03C2 + BREQ L03D2 + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP L03B8 +L03C2: TST X_SIZE + BREQ L03D3 +L03C4: LSR A + DEC X_SIZE + BRNE L03C4 + COM A + TST XPIXEL + BREQ L03D2 + CLR B +L03CB: LSR A + ROR B + DEC XPIXEL + BRNE L03CB + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +L03D2: RCALL WR_DISP_MEM +L03D3: RCALL NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP L039A +NO_GO: RET + +FILLED_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + STS RECT_XX,X_SIZE + RJMP FILLED_RECTNC_ENTRY + +DRAW_RECTNC: + LDS F,RECTNC_XX + DEC F + CPI F,2 + BRLO NO_GO + LDS F,RECTNC_YY + CPI F,3 + BRLO NO_GO + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS F,RECTNC_Y + STS RECT_Y,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDI F,$01 + STS RECT_YY,F + RCALL DRAW_RECT + + LDS F,RECTNC_X + STS RECT_X,F + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + LDI F,$01 + STS RECT_XX,F + RCALL DRAW_RECT + + LDS X_SIZE,RECTNC_XX + LDS F,RECTNC_X + ADD F,X_SIZE + DEC F + STS RECT_X,F + LDI F,$01 + STS RECT_XX,F +FILLED_RECTNC_ENTRY: + LDS F,RECTNC_Y + INC F + STS RECT_Y,F + LDS Y_SIZE,RECTNC_YY + DEC Y_SIZE + DEC Y_SIZE + STS RECT_YY,Y_SIZE + RCALL DRAW_RECT + + LDS F,RECTNC_X + INC F + STS RECT_X,F + LDS X_SIZE,RECTNC_XX + DEC X_SIZE + DEC X_SIZE + STS RECT_XX,X_SIZE + LDS Y_SIZE,RECTNC_YY + LDS F,RECTNC_Y + ADD F,Y_SIZE + DEC F + STS RECT_Y,F + LDI F,$01 + STS RECT_YY,F + RJMP DRAW_RECT + +; ----------------------------------------------------------------------------- + +TX_EMPTY: + MTX_EMPTY +RX_COMPLETE: + MRX_COMPLETE +;FEED_WDOG: +; MFEED_WDOG +TX_COMPLETE: + MTX_COMPLETE +API_TIMEOUT_ERROR: + MAPI_TIMEOUT_ERROR +API_FRAMING_ERROR: +API_RESET_ERROR: + MAPI_FRAMING_ERROR +API_REINIT: + MAPI_REINIT +API_REVERT: + MAPI_REVERT +API_DONE: + MAPI_DONE + +; ----------------------------------------------------------------------------- + +CALCULATE_XBYTE: + CLR XBYTE + LDI F,$F0 + SUB XBYTE,F + SBRS XPIXEL,7 + CLR XBYTE + ANDI XPIXEL,$7F +L0415: SUBI XPIXEL,$08 + BRLT L0419 + INC XBYTE + RJMP L0415 +L0419: SUBI XPIXEL,$F8 + RET + +LPMS: A0_A13 YL,YH + RAMRD R0 + RET ;RETI + +WR_DISP_MEM: + A0_A13 XBYTE,YH + RAMRD W + SBRS FLAGS,1 + RJMP L043E + COM A + AND W,A + RJMP L0441 +L043E: EOR W,A + SBRC FLAGS,0 + OR W,A +L0441: A0_A13 XBYTE,YH + RAMWR W + RET ;RETI + +CLEAR_DISPLAY: + CLR CURSORX ; HOME CURSOR + CLR CURSORY + CLR LINE_CNT + LDI YL,LOW(DRAW_DSPRAM) + LDI YH,HIGH(DRAW_DSPRAM) + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE +CLEAR_DISPLAY_LOOP: + CLR XBYTE + STS XBYTE_SAV,XBYTE +L065C: LDS A,XBYTE_SAV + OR A,YL + A0_A13 A,YH + LDI F,$00 + RAMWR F + INC XBYTE + LDI F,$20 + CP XBYTE,F + BREQ L0674 + STS XBYTE_SAV,XBYTE + RJMP L065C +L0674: RCALL NICK_SUB1 + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + CPI YH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE CLEAR_DISPLAY_LOOP + RET + +; ----------------------------------------------------------------------------- + +EXT_INT0: +;**: +RETI +;** IN SR,SREG ; MEASURE VCC +;** SBI DDRD,2 +;** IN C,TCNT1L +;** IN D,TCNT1H +;** STS VCCH,D +;** STS VCCL,C +;** RJMP EXT_INT_RET + +EXT_INT1: + IN SR,SREG ; MEASURE TEMPERATURE + SBI DDRD,3 + IN C,TCNT1L + IN D,TCNT1H + STS TMPH,D + STS TMPL,C + RJMP EXT_INT_RET + +T1_OVERFLOW: + IN SR,SREG + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDI D,$70 ; FORCE DUMMY COMPARE MATCH + OUT TCCR1A,D ; TO SET OC1B, TOGGLE OC1A + IN C,TCNT1L ; (FOR REV E PARTS) + IN D,TCNT1H ; READ CURRENT COUNT + SUBI C,LOW(-8) ; ADD JUST ENOUGH TIME + SBCI D,HIGH(-8) ; FOR THESE INSTRUCTIONS + OUT OCR1AH,D ; AND WRITE TO COMPARE REGISTERS + OUT OCR1AL,C + OUT OCR1BH,D + OUT OCR1BL,C + + LDS C,CLOCKING_PTR + TST C ; START OF 4 LINE BLOCK? (1 BASED) + BRNE BREAK0 ; NO, BREAK COUNTER IS OK FOR NOW + + LDS D,BREAK_COUNT + INC D ; HAD BREAK SOLIDLY FOR TIMEOUT? + STS BREAK_COUNT,D + BRNE BREAK1 ; NO, CLOCK OUT TO DISPLAY AS NORMAL + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION +GO_SLEEP_ENTRY: + RJMP SLEEP_ENTRY + +BREAK0: NOP + NOP + NOP + NOP + NOP + NOP + NOP +BREAK1: SBI DDRD,3 ; PRECHARGE TEMPERATURE MEASUREMENT + SBI PORTD,3 + + CLR D + OUT TCCR1B,D ; STOP TIMER1 + OUT TCNT1H,D ; AND CLEAR COUNT + OUT TCNT1L,D + + LDS D,CLOCKING_PTR+1 + OR D,C ; START OF FRAME? (REALLY LINE 1) + BREQ L04E6 ; YES, GO AND TOGGLE M ETC + + LDS D,LATCH10_SAV + OUT PORTA,D + SBI PORTB,4 + SBI PORTA,5 ; PULSE CL1 + CBI PORTA,5 + CBI PORTB,4 + NOP ; EQUALIZE DELAY + NOP + NOP + NOP + NOP + NOP + RJMP L04F9 + +GO_NICK_SUB1: + RJMP NICK_SUB1 + +GO_RX_WAIT: + RJMP RX_WAIT + +GO_MAIN_LOOP: + RJMP MAIN_LOOP + +GO_GET_HALFTONE_RECT_SIZE: + RJMP GET_HALFTONE_RECT_SIZE + +L04E6: LDS D,LATCH10_SAV + ORI D,$80 ; RAISE FLM + ORI D,$20 ; RAISE CL1 + OUT PORTA,D + + SBI PORTB,4 + LDI C,$60 ; TOGGLE M AND CL1 + EOR D,C + OUT PORTA,D + ANDI D,$7F ; DROP FLM + OUT PORTA,D + CBI PORTB,4 + STS LATCH10_SAV,D + +L04F9: LDS D,LATCH10_SAV ; SAVE STATE + PUSH D + + PUSH ZL + PUSH ZH + LDS ZL,CLOCKING_PTR + LDS ZH,CLOCKING_PTR+1 + + SUBI ZL,LOW(-$40) + SBCI ZH,HIGH(-$40) + ANDI ZH,HIGH(DISPLAY_LINES*$40-1) + + A0_A15 ZL,ZH + + CBI PORTB,1 ; CLR HC590 + SBI PORTB,1 + CBI PORTD,7 ; DROP OE FOR HC590 + CLR C + OUT DDRA,C ; PORTA HI Z + LDI C,$C0 + OUT DDRC,C ; PORTC HI Z + CBI PORTB,0 ; DROP CS FOR DSPRAM + + CLR D + OUT OCR1AH,D + +; LDI D,1 ; TO CLOCK AT 5.5/2 MHZ + OUT OCR1AL,D ; TO CLOCK AT 7.3/2 MHZ + LDI D,$09 + OUT TCCR1B,D ; START CL2 CLOCKING WITH CLR ON MATCH + + STS CLOCKING_PTR,ZL + STS CLOCKING_PTR+1,ZH + POP ZH + POP ZL + +;!!! LDI D,$7A ; WAIT FOR 32uSEC +; LDI D,58 ;$7A ; WAIT FOR 32uSEC GOOD + LDI D,60 ; WAIT FOR 32uSEC +; LDI D,61 ;$7A ; WAIT FOR 32uSEC +; LDI D,62 ;$7A ; WAIT FOR 32uSEC GOOD + +L050E: DEC D + BRNE L050E + + SBI PORTB,0 ; RAISE CS FOR DSPRAM + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + SBI PORTD,7 ; RAISE OE FOR HC590 + OUT DDRC,D ; PORTC OUTPUT + + CBI DDRD,5 ; CL2 INPUT TO MEASURE VEE + CBI PORTD,5 ; REMOVE PULL UP + + LDI D,$01 ; KILL CLR ON COMPARE MATCH + NOP ; !WITH OC1A LEFT IN LOW STATE + OUT TCCR1B,D + + LDI D,$0B ; WAIT FOR 3uSEC +SETTLE_CL2: + DEC D + BRNE SETTLE_CL2 + + LDS D,VEEH + LDS C,VEEL + SBI DDRD,5 ; CL2 LOW OUTPUT + SBIC PIND,5 ; SAMPLE CL2 JUST BEFORE CHANGE + RJMP L052F + + CPI C,LOW(VEE_MIN) + LDI E,HIGH(VEE_MIN) + CPC D,E + BRMI L0535 + + SUBI C,$01 + SBCI D,$00 + RJMP L0536 + +L052F: CPI C,LOW(VEE_MAX) + LDI E,HIGH(VEE_MAX) + CPC D,E + BRPL L0535 + + SUBI C,$FF + SBCI D,$FF + RJMP L0536 + +L0535: NOP ; EQUALIZE DELAYS + NOP + NOP + NOP +L0536: STS VEEH,D + STS VEEL,C + OUT OCR1AH,D ; SET SWITCHING TIME FOR VEE MEASURE + OUT OCR1AL,C + + LDS C,VEEL + LDS D,VEEH + LDS E,CONTRASTL + SUB C,E + LDS E,CONTRASTH + SBC D,E + BRPL L0545 + + LDI C,LOW(CONTRAST_SHORT) + LDI D,HIGH(CONTRAST_SHORT) + RJMP L0547 + +L0545: LDI C,LOW(CONTRAST_LONG) + LDI D,HIGH(CONTRAST_LONG) + NOP + NOP + +L0547: OUT OCR1BH,D ; SET SWITCHING TIME FOR VEE GENERATOR + OUT OCR1BL,C + + LDI D,2 ; SET TIME FOR START OF LED PULSE + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_DELAY_0 ; 54uSEC + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI D,HIGH(T1_FULL_SCALE) + OUT TCNT1H,D + LDI D,LOW(T1_FULL_SCALE) + OUT TCNT1L,D + + CBI DDRD,3 ; START TEMPERATURE MEASUREMENT + CBI PORTD,3 + + LDI D,$E0 ; NEXT COMPARE MATCH MUST SET OC1A + OUT TCCR1A,D ; AND CLR OC1B (FOR REV E PARTS) + + RJMP T1_OVERFLOW_RET + +T0_OVERFLOW: + IN SR,SREG ; LED/PHOTODIODE SCANNING + IN D,DDRA ; SAVE STATE OF THE WORLD + PUSH D + IN D,PORTA + PUSH D + IN D,PORTC + PUSH D + LDS D,LATCH11_SAV + PUSH D + LDS D,LATCH10_SAV + PUSH D + + PUSH ZH + PUSH ZL + PUSH R0 + + LDI D,$FF + OUT DDRA,D ; PORTA OUTPUT + + LDS D,SCAN_STATE + INC D + STS SCAN_STATE,D + DEC D + BREQ SCAN_START ; IF SCAN_STATE WAS = 0 + DEC D + BREQ SCAN_BEEPER ; IF SCAN_STATE WAS = 1 + ; IMPLEMENT ENTRY POINT FOR SCAN_PULSE_LED HERE + DEC D + RJEQ SCAN_PHOTO ; IF SCAN_STATE WAS = 2 + +T0_OVERFLOW_RET: + POP R0 + POP ZL + POP ZH + +T1_OVERFLOW_RET: + POP D ; RESTORE STATE OF THE WORLD + OUT PORTA,D + SBI PORTB,4 + CBI PORTB,4 + STS LATCH10_SAV,D + POP D + OUT PORTA,D + SBI PORTB,3 + CBI PORTB,3 + STS LATCH11_SAV,D + POP D + OUT PORTC,D + POP D + OUT PORTA,D + POP D + OUT DDRA,D + ;MFEED_WDOG +EXT_INT_RET: + OUT SREG,SR + RETI + +SCAN_START: + LDI D,3 ;5 + OUT TCCR0,D ; PRESCALE=CK/1024 + LDI D,-TK_DELAY_1 ;TK_DELAY_2 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + RJMP L0617_RESET + +SCAN_BEEPER: + LDS D,BUZZ_TIME + TST D + BREQ SCAN_PULSE_LED + LDS D,BUZZ_PERIOD + SUBI D,$10 + BRLO BUZZ_TOGGLE + STS BUZZ_PERIOD,D + RJMP SCAN_PULSE_LED +BUZZ_TOGGLE: ; ASSUME D = $F0 + PERIOD-1 + MOV C,D ; EG. C = $F3 FOR PERIOD = 4 + SWAP C ; EG. C = $3F FOR PERIOD = 4 + AND D,C ; EG. D = $33 FOR PERIOD = 4 + STS BUZZ_PERIOD,D + LDS C,LATCH12_SAV + SBRS C,3 ; TEST PREVIOUS SPEAKER STATE + RJMP BEEPER_SPKHI + LDS D,BUZZ_TIME + DEC D + STS BUZZ_TIME,D + BREQ BEEPER_SPKOFF +;BEEPER_SPKLO: + SPKLO + RJMP SCAN_PULSE_LED +BEEPER_SPKHI: + SPKHI + RJMP SCAN_PULSE_LED +BEEPER_SPKOFF: + SPKOFF + +SCAN_PULSE_LED: + LDS D,LATCH5_SAV +;**: + SBRS D,7 ; ARE WE INSIDE SLEEP_LOOP? +;** SBRC D,7 + RJMP SCAN_PULSE_LED_OK ; YES, KEEP TIMER 0 TO RETAIN CONTROL + + LDI D,1<<7 + EOR FLAGS,D + BRPL SCAN_PULSE_LED_OK ; PULSE LED EVERY 2ND CYCLE + + CLR D + OUT TCCR0,D ; STOP TIMER + RJMP T0_OVERFLOW_RET ; AND WASTE EVERY REMAINING CYCLE + +SCAN_PULSE_LED_OK: + LDI D,2 + OUT TCCR0,D ; PRESCALE=CK/8 + LDI D,-TK_LED_PULSE ; 22uSEC + OUT TCNT0,D + + ;LDIZ SCAN_TBL ; POINT TO FIRST LED CHANNEL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM ; R0 = LED DRIVE VALUE + LDI D,13*4 + CP SCAN,D + BRSH L0570 + LEDLO ; ENABLE HORIZ LED DRIVE + RJMP L0574 +L0570: LEDHI ; DISABLE HORIZ LED DRIVE +L0574: LED R0 + RJMP T0_OVERFLOW_RET + +SCAN_PHOTO: + IN D,PIND ; PHOTODIODE STATUS IN BIT 6,D + LDI C,$E0 + LED C ; TURN OFF LED ?? + + CLC + SBRC D,6 + RJMP L0593 ; ROW/COLUMN IS INACTIVE + + ; ROW/COLUMN IS ACTIVE + LDS D,DEBOUNCE + TST D + BREQ L0591 + LDI D,$04 + STS DEBOUNCE,D +L0591: SEC + +L0593: ; WE HAVE A ROW/COLUMN STATUS IN CF + IN C,SREG + + LDI D,13*4 + CP SCAN,D + BRSH L05A8 + + ; WE HAVE A ROW STATUS + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + LDS ZL,ROW_BITMAP + LDS ZH,ROW_BITMAP+1 + ROL ZL + ROL ZH + STS ROW_BITMAP,ZL + STS ROW_BITMAP+1,ZH + RJMP L05F9 + +L05A8: ; WE HAVE A COLUMN STATUS +; LDS D,LATCH5_SAV +;;**: +; SBRS D,7 ; TURNED OFF? +;;** SBRC D,7 +; RJMP L05F9 ; YES, NO FURTHER PROCESSING + OUT SREG,C ; CF = 0 INACTIVE, CF = 1 ACTIVE + BRCS L05AB + RJMP L05F9 + +L05AB: ; WE HAVE AN ACTIVE COLUMN + LDS D,DEBOUNCE + TST D + BREQ L05B3 + LDI D,$04 + STS DEBOUNCE,D + RJMP L05F9 + +L05B3: ; LOOK FOR ANY ACTIVE ROW + LDS ZH,ROW_BITMAP+1 + LDS ZL,ROW_BITMAP + + LDS D,ROW_INDEX + TST D + BREQ ROW_BITMAP_LOOP + + MOV C,D +ROW_BITMAP_SKIP: + ROR ZH + ROR ZL + SUBI C,4 + BRNE ROW_BITMAP_SKIP + +ROW_BITMAP_LOOP: + SUBI D,-4 + ROR ZH + ROR ZL + BRCS FOUND_INTERSECTION +ROW_BITMAP_LOOPE: + CPI D,13*4 + BRLO ROW_BITMAP_LOOP + + ; NO FURTHER INTERSECTING ROWS FOUND + RJMP L05F9 + +FOUND_INTERSECTION: + ; FOUND AN INTERSECTING ROW FOR COLUMN + STS ROW_INDEX,D + + LDI C,$34 ; BECAUSE ROW_BITMAP IS BEING TESTED + SUB C,D ; IN THE REVERSE ORDER TO ITS CREATION + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,C + ADC ZH,D + LPM + MOV C,R0 + LSL R0 + LSL R0 + LSL R0 + ADD C,R0 + LSL R0 + ADD C,R0 + + ;LDIZ SCAN_TBL+1 ; POINT TO FIRST TOUCH CHANNEL + LDI ZL,LOW((SCAN_TBL+1)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL+1)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + ADD C,R0 + LDI ZL,LOW(RTN_DSPRAM) ; RETURN CODE TABLE + LDI ZH,HIGH(RTN_DSPRAM) + CLR D + ADD ZL,C + ADC ZH,D + + A0_A15 ZL,ZH + + PUSH F + RAMRDX R0 + POP F + + TST R0 + BRNE VALID_INTERSECTION + + ; INTERSECTION IS NULL, GO ON TO NEXT + LDS D,ROW_INDEX + CPI D,13*4 + BRSH L05F9 ; DONE LAST ROW, GO ON TO NEXT COLUMN +GO_L0617: + RJMP L0617 ; GO ON TO NEXT ROW, SAME COLUMN + +VALID_INTERSECTION: + ; INTERSECTION IS VALID, WE HAVE KEY MAKE + LDI D,$04 + STS DEBOUNCE,D + STS ACTIVE_ZONE,R0 + LDI D,54 ;43 + STS BUZZ_TIME,D ; SHORT BEEP ON MAKE + + MOV D,TX_COUNT + CPI D,TX_SIZE-1 + BRSH L05F9 + + PUSH A + MOV A,R0 + RCALL TX_CHAR + CPI A,$1B + BRNE TX_CONT + RCALL TX_CHAR +TX_CONT: + POP A + +L05F9: + LDI D,4 ; SCAN TO NEXT LED / PHOTODIODE PAIR + ADD SCAN,D + + LDS D,LATCH5_SAV + SBRC D,7 + RJMP TURNED_ON + + LDI D,3 + OUT TCCR0,D ; PRESCALE=CK/64 + LDI D,-TK_DELAY_1 + OUT TCNT0,D + LDI D,1 + STS SCAN_STATE,D + + LDI C,13*4 + CP SCAN,C + BRLO GO_L0617 + + ; KEEP VDD ON, TO AVOID THE LONG TK_DELAY_2 + ;LDS D,LATCH5_SAV + ;ANDI D,$BF ; BIT 6 = 0 VDD OFF + ;STS LATCH5_SAV,D + ;PHOTO D ; READY TO SLEEP FOR ANOTHER 0.25 SEC + + LDI D,0 + OUT TCCR0,D ; STOP TIMER SINCE COMPLETE SCAN DONE + ;RJMP T0_OVERFLOW_RET + + ;LDI D,$05 + ;OUT UBRR,D + ;LDI D,$18 + ;OUT UCR,D + LDS D,ROW_BITMAP+1 + LDS C,ROW_BITMAP + ;OUT UDR,C + ;OUT UDR,D + OR C,D ; HAVE WE SOME ACTIVITY? + + LDS D,TURNON_COUNT + CPI D,4 + BRSH TURNON_BREAK ; WAITING FOR BREAK + CPI D,1 + BRSH TURNON_MAKE ; WAITING FOR MAKE +GO_T0_OVERFLOW_RET: + RJMP T0_OVERFLOW_RET ; ALREADY HAD MAKE, NOT TURNED ON YET + +TURNON_BREAK: + TST C ; HAD SOME ACTIVITY? + BREQ TURNON_SAVE ; NO, COUNT DOWN TO BREAK + LDI D,4+1 ; YES, RESTART COUNTDOWN TO BREAK + RJMP TURNON_SAVE +TURNON_MAKE: + TST C ; HAD SOME ACTIVITY? + BRNE TURNON_SAVE ; YES, COUNT DOWN TO MAKE + LDI D,3+1 ; NO, RESTART COUNTDOWN TO MAKE +TURNON_SAVE: + DEC D ; COUNT DOWN TO MAKE OR BREAK + STS TURNON_COUNT,D + BRNE GO_T0_OVERFLOW_RET ; NOT READY TO TRY TURNON YET + + LDI D,~(1<<6) + AND FLAGS,D ; SAY WE TURNED OFF VIA BREAK DETECTION + CBI DDRD,2 ; D2 = TRI-STATE, VSWT ON + RJMP GO_SLEEP_ENTRY ; WE WILL NOW WAIT FOR TURNON COMMAND + +TURNED_ON: + LDI D,0 ; STOP TIMER, WE WILL REGAIN + OUT TCCR0,D ; CONTROL VIA NEXT CLOCKING INTERRUPT + STS ROW_INDEX,D + + LDI C,50*4 + CP SCAN,C + BRLO L0617 + + LDS D,DEBOUNCE ; COMPLETED ENTIRE SCAN, START NEW SCAN + TST D + BREQ L0617_RESET + DEC D + STS DEBOUNCE,D + BRNE L0617_RESET + + LDS D,ACTIVE_ZONE + TST D + BREQ L0617_RESET + + MOV D,TX_COUNT + CPI D,TX_SIZE + BRSH L0617_RESET + + PUSH A + LDI A,0 + RCALL TX_CHAR + POP A + +L0617_RESET: + CLR SCAN + STS ROW_BITMAP,SCAN + STS ROW_BITMAP+1,SCAN + +L0617: ; SELECT PHOTODIODE AND ALLOW TO SETTLE + ;LDIZ SCAN_TBL + LDI ZL,LOW((SCAN_TBL)*2) ; USE PRIOR TO LPM INSTRUCTION + LDI ZH,HIGH((SCAN_TBL)*2) ; EXTRA BRACKETS NEEDED IF @0=EXPRESSION + + ADIW ZL,1 ; POINT TO FIRST PHOTO CHANNEL + CLR D + ADD ZL,SCAN + ADC ZH,D + LPM + LDS D,LATCH5_SAV + ANDI D,$80 ; BIT 7 = PRESERVED, LCD ON/OFF STATUS + ORI D,$40 ; BIT 6 = 1 VDD ON + OR D,R0 + STS LATCH5_SAV,D + PHOTO D + RJMP T0_OVERFLOW_RET + +SCROLL: CLR LINE_CNT + + LDI YL,LOW(DRAW_DSPRAM) ; SCROLL UP + LDI YH,HIGH(DRAW_DSPRAM) + LDI XL,LOW(DRAW_DSPRAM) + LDI XH,HIGH(DRAW_DSPRAM) + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + +L0628: SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + DEC R0 + BRNE L0628 + +L062C: LDI B,$20 ; COPYING 32 BYTES +L062D: PUSH B + RCALL READ_BYTE + RCALL WRITE_BYTE + INC XL + INC YL + POP B + DEC B + RJNE L062D ;BRNE L062D + + RCALL NICK_SUB1 + INC LINE_CNT + ADIW YL,$20 + ADIW XL,$20 + CPI XH,HIGH(DRAW_DSPRAM+DISPLAY_LINES*$40) + RJNE L062C ;BRNE L062C + RJMP CLEAR_DISPLAY_LOOP + +SCROLL_REGION: + RCALL RX_WAIT + PUSH A ; DIRECTION TO SCROLL + + RCALL RX_WAIT + STS SCROLL_COUNT,A ; AMOUNT TO SCROLL IN PIXEL LINES + + RCALL RX_WAIT + LSR A + LSR A + LSR A + BRNE SCROLL_WIDTH_OK + LDI A,32 ; ENTRY WIDTH OF 0 = FULL +SCROLL_WIDTH_OK: + STS SCROLL_XX,A ; X SIZE OF REGION IN BYTES + + RCALL RX_WAIT + STS SCROLL_YY,A ; Y SIZE OF REGION IN PIXEL LINES + + MOV A,CURSORX + LSR A + LSR A + LSR A + STS SCROLL_X,A + STS SCROLL_Y,CURSORY + + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + + POP A ; DIRECTION TO SCROLL + SBRC A,0 + RJMP SCROLL_DOWN + +;SCROLL_UP: + CLR YL + LDS YH,SCROLL_Y + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_UP_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_UP_LOOP: + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + INC LINE_CNT + SUBI XL,LOW(-$40) + SBCI XH,HIGH(-$40) + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_UP_CLEAR: + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + INC LINE_CNT + SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + + DEC B + BRNE SCROLL_UP_CLEAR + + RJMP GO_MAIN_LOOP + +SCROLL_DOWN: + CLR YL + LDS YH,SCROLL_Y + LDS F,SCROLL_YY + ADD YH,F + MOV LINE_CNT,YH ; FOR NICK_SUB1 + LSR YH + ROR YL + LSR YH + ROR YL + LDS A,SCROLL_X + ADD YL,A + SUBI YH,HIGH(-DRAW_DSPRAM) ; Y = DESTINATION WITHIN DRAWING BUFFER + + MOV B,F ;LDS B,SCROLL_YY + LDS A,SCROLL_COUNT + CP A,B + BRSH SCROLL_DOWN_CLEAR ; WITH B = LINES TO CLEAR + SUB B,A ; CALCULATE B = LINES TO COPY INTACT + + CLR XL + LDS XH,SCROLL_Y + ADD XH,F + SUB XH,A ; SCROLL_COUNT + LSR XH + ROR XL + LSR XH + ROR XL + LDS A,SCROLL_X + ADD XL,A + SUBI XH,HIGH(-DRAW_DSPRAM) ; X = SOURCE WITHIN DRAWING BUFFER + +SCROLL_DOWN_LOOP: + DEC LINE_CNT + SUBI XL,LOW($40) + SBCI XH,HIGH($40) + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH XL + PUSH XH + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL COPY_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP XH + POP XL + POP B + + DEC B + BRNE SCROLL_DOWN_LOOP + + LDS B,SCROLL_COUNT ; B = LINES TO CLEAR + +SCROLL_DOWN_CLEAR: + DEC LINE_CNT + SUBI YL,LOW($40) + SBCI YH,HIGH($40) + + PUSH B + PUSH YL + PUSH YH + + LDS B,SCROLL_XX + RCALL CLEAR_BYTES + RCALL NICK_SUB1 + + POP YH + POP YL + POP B + + DEC B + BRNE SCROLL_DOWN_CLEAR + + RJMP GO_MAIN_LOOP + +COPY_BYTES: + RCALL READ_BYTE + ADIW XL,1 + + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE COPY_BYTES + + RET + +CLEAR_BYTES: + LDI A,0 + +FILL_BYTES: + RCALL WRITE_BYTE + ADIW YL,1 + + DEC B + BRNE FILL_BYTES + + RET + +READ_BYTE: + A0_A13 XL,XH + RAMRD A + RET + +WRITE_BYTE: + A0_A13 YL,YH + RAMWR A + RET + +SELECT_XPAGE: + A14_A18 A + RET + +; HOW MANY SECS/6553600 PER 4HZ INTERRUPT ? +; EACH TIME THROUGH ADD 1638400 SECS/6553600 = 1/4 SEC +; OSCILLATOR IS SLOW SO WE WILL ADD 1 PART IN 10000 +; HENCE EACH TIME THROUGH ADD 1638400+164 = 1638564 UNITS TO COUNT + +TIM2_OVF: + IN SR,SREG + + ; REMOVED BECAUSE DON'T WANT TO HAVE IN AN INTERRUPT + ;WDR + +;!! LDI A,$10 ; DIAGNOSTIC +;!! STS BUZZ_TIME,A ; SHORT BEEP + + LDS D,TIME_HSEC_64K + SUBI D,LOW(-1638564) + STS TIME_HSEC_64K,D + + LDS D,TIME_HSEC_256 + SBCI D,HIGH(-1638564) + STS TIME_HSEC_256,D + + LDS D,TIME_HSEC + SBCI D,HIGH(-1638564>>8) + CPI D,100 + BRSH TIM2_CARRY + STS TIME_HSEC,D + +TIM2_END: + OUT SREG,SR + SBRS FLAGS,6 ; IF WE TURNED OFF VIA COMMAND, + RETI ; START A NEW SCAN, OTHERWISE DONE + + LDI D,0 + STS SCAN_STATE,D ; WE WILL EXECUTE SCAN_START ROUTINE + RJMP T0_OVERFLOW ; GO AND TURN VDD ON + +GO_TX_CHAR: + RJMP TX_CHAR + +TIM2_CARRY: + LDI D,0 + STS TIME_HSEC,D + + LDS D,TIME_SECOND + INC D + CPI D,60 + BRLO TIM2_SECOND + + LDS D,TIME_MINUTE + INC D + CPI D,60 + BRLO TIM2_MINUTE + + LDS D,TIME_HOUR + INC D + CPI D,24 + BRLO TIM2_HOUR + + PUSH ZL + PUSH ZH + PUSH R0 + LDI ZL,LOW(MONTH_TABLE*2-1) + LDI ZH,HIGH(MONTH_TABLE*2-1) + LDS E,DATE_MONTH + ADD ZL,E + LDI E,0 + ADC ZH,E + LPM + MOV E,R0 + CPI E,28 + BRNE FEBRUARY_OK + LDS E,DATE_YEAR + ANDI E,3 + LDI E,28 + BRNE FEBRUARY_OK + LDI E,29 +FEBRUARY_OK: + POP R0 + POP ZH + POP ZL + + LDS D,DATE_DAY + CP D,E + BRLO TIM2_DAY + + LDS D,DATE_MONTH + CPI D,12 + BRLO TIM2_MONTH + + LDS D,DATE_YEAR + INC D + STS DATE_YEAR,D + CLR D +TIM2_MONTH: + INC D + STS DATE_MONTH,D + CLR D +TIM2_DAY: + INC D + STS DATE_DAY,D + CLR D +TIM2_HOUR: + STS TIME_HOUR,D + CLR D +TIM2_MINUTE: + STS TIME_MINUTE,D + CLR D +TIM2_SECOND: + STS TIME_SECOND,D + +TIM2_SEND: + MOV D,TX_COUNT + CPI D,TX_SIZE-7 + BRSH TIM2_SEND_SKIP + + PUSH A + LDI A,$1B + RCALL TX_CHAR + LDI A,'T' + RCALL TX_CHAR +; LDS A,VCCL +; RCALL TX_CHAR +; LDS A,VCCH +; RCALL TX_CHAR +; LDS A,VEEL +; RCALL TX_CHAR +; LDS A,VEEH +; RCALL TX_CHAR +; LDI A,$0D +; RCALL TX_CHAR + LDS A,TIME_HOUR + RCALL GO_TX_CHAR + LDS A,TIME_MINUTE + RCALL GO_TX_CHAR + LDS A,TIME_SECOND + RCALL GO_TX_CHAR + LDS A,DATE_MONTH + RCALL GO_TX_CHAR + LDS A,DATE_DAY + RCALL GO_TX_CHAR + LDS A,DATE_YEAR + RCALL GO_TX_CHAR + POP A + +TIM2_SEND_SKIP: + RJMP TIM2_END + +; ----------------------------------------------------------------------------- + +MONTH_TABLE: + .DB 31,28,31,30,31,30,31,31,30,31,30,31 + +; 1ST BYTE = LED +; 2ND BYTE = PHOTO +; 3RD BYTE = TOUCH CHANNEL + +SCAN_TBL: + .DB $F0,$34,$00,$00,$E8,$34,$01,$00,$F0,$33,$01,$00,$E8,$33,$02,$00 + .DB $E4,$33,$03,$00,$E8,$32,$03,$00,$E4,$32,$04,$00,$E2,$32,$05,$00 + .DB $E4,$31,$05,$00,$E2,$31,$06,$00,$E1,$31,$07,$00,$E2,$30,$07,$00 + .DB $E1,$30,$08,$00,$C1,$2A,$00,$00,$C2,$2A,$01,$00,$C1,$2B,$01,$00 + .DB $C2,$2B,$02,$00,$C4,$2B,$03,$00,$C2,$2C,$03,$00,$C4,$2C,$04,$00 + .DB $C8,$2C,$05,$00,$C4,$18,$05,$00,$C8,$18,$06,$00,$D0,$18,$07,$00 + .DB $C8,$19,$07,$00,$D0,$19,$08,$00,$A1,$19,$09,$00,$D0,$1A,$09,$00 + .DB $A1,$1A,$0A,$00,$A2,$1A,$0B,$00,$A1,$1B,$0B,$00,$A2,$1B,$0C,$00 + .DB $A4,$1B,$0D,$00,$A2,$1C,$0D,$00,$A4,$1C,$0E,$00,$A8,$1C,$0F,$00 + .DB $A4,$1D,$0F,$00,$A8,$1D,$10,$00,$B0,$1D,$11,$00,$A8,$1E,$11,$00 + .DB $B0,$1E,$12,$00,$61,$1E,$13,$00,$B0,$1F,$13,$00,$61,$1F,$14,$00 + .DB $62,$1F,$15,$00,$61,$28,$15,$00,$62,$28,$16,$00,$64,$28,$17,$00 + .DB $62,$29,$17,$00,$64,$29,$18,$00 + +RTN_CODE: + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$08,$08,$08,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$7E,$00,$31,$00,$32,$00,$33,$00,$34,$00,$35,$00,$36,$00 + .DB $37,$00,$38,$00,$39,$00,$30,$00,$2D,$00,$3D,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$51,$00,$57,$00,$45,$00,$52,$00,$54,$00,$59,$00 + .DB $55,$00,$49,$00,$4F,$00,$50,$00,$5B,$00,$5D,$00,$5C,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$41,$00,$53,$00,$44,$00,$46,$00,$47,$00 + .DB $48,$00,$4A,$00,$4B,$00,$4C,$00,$3B,$00,$27,$00,$0D,$0D,$0D,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$58,$00,$43,$00 + .DB $56,$00,$42,$00,$4E,$00,$4D,$00,$2C,$00,$2E,$00,$2F,$00,$00,$00 + .DB $00,$00 +RTN_CODE_END: + +; ----------------------------------------------------------------------------- + +CHSET00: + .DB $32,$38,$32,$34,$30,$33,$31,$37,$30,$33,$31,$36,$32,$36,$31,$35 + .DB $11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $C0,$00,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $C1,$00,$CA,$00,$D3,$00,$DC,$00,$E5,$00,$EE,$00,$F7,$00,$00,$01 + .DB $09,$01,$12,$01,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $11,$02,$1B,$01,$24,$01,$2D,$01,$36,$01,$3F,$01,$48,$01,$51,$01 + .DB $5A,$01,$64,$01,$6D,$01,$76,$01,$7F,$01,$88,$01,$91,$01,$9A,$01 + .DB $A3,$01,$AC,$01,$B5,$01,$BE,$01,$C7,$01,$D0,$01,$D9,$01,$E2,$01 + .DB $EB,$01,$F4,$01,$08,$02,$11,$02,$11,$02,$11,$02,$11,$02,$11,$02 + .DB $00,$01,$07,$70,$88,$98,$A8,$C8,$88,$70,$01,$07,$20,$60,$20,$20 + .DB $20,$20,$70,$01,$07,$70,$88,$08,$10,$20,$40,$F8,$01,$07,$F8,$10 + .DB $20,$10,$08,$88,$70,$01,$07,$10,$30,$50,$90,$F8,$10,$10,$01,$07 + .DB $F8,$80,$F0,$08,$08,$88,$70,$01,$07,$30,$40,$80,$F0,$88,$88,$70 + .DB $01,$07,$F8,$08,$10,$20,$40,$40,$40,$01,$07,$70,$88,$88,$70,$88 + .DB $88,$70,$01,$07,$70,$88,$88,$78,$08,$10,$60,$01,$07,$70,$88,$88 + .DB $88,$F8,$88,$88,$01,$07,$F0,$88,$88,$F0,$88,$88,$F0,$01,$07,$70 + .DB $88,$80,$80,$80,$88,$70,$01,$07,$E0,$90,$88,$88,$88,$90,$E0,$01 + .DB $07,$F8,$80,$80,$F0,$80,$80,$F8,$01,$07,$F8,$80,$80,$F0,$80,$80 + .DB $80,$01,$07,$70,$88,$80,$B8,$88,$88,$78,$01,$07,$88,$88,$88,$F8 + .DB $88,$88,$88,$02,$21,$07,$80,$80,$80,$80,$80,$80,$80,$01,$07,$08 + .DB $08,$08,$08,$08,$88,$70,$01,$07,$88,$90,$A0,$C0,$A0,$90,$88,$01 + .DB $07,$80,$80,$80,$80,$80,$80,$F8,$01,$07,$88,$D8,$A8,$A8,$88,$88 + .DB $88,$01,$07,$88,$88,$C8,$A8,$98,$88,$88,$01,$07,$70,$88,$88,$88 + .DB $88,$88,$70,$01,$07,$F0,$88,$88,$F0,$80,$80,$80,$01,$07,$70,$88 + .DB $88,$88,$A8,$90,$68,$01,$07,$F0,$88,$88,$F0,$A0,$90,$88,$01,$07 + .DB $70,$88,$80,$70,$08,$88,$70,$01,$07,$F8,$20,$20,$20,$20,$20,$20 + .DB $01,$07,$88,$88,$88,$88,$88,$88,$70,$01,$07,$88,$88,$88,$88,$88 + .DB $50,$20,$01,$07,$88,$88,$88,$A8,$A8,$A8,$50,$01,$07,$88,$88,$50 + .DB $20,$50,$88,$88,$01,$07,$88,$88,$88,$50,$20,$20,$20,$02,$11,$02 + .DB $06,$08,$01,$01,$4F,$00,$2A,$02,$01,$07,$F8,$08,$10,$20,$40,$80 + .DB $F8,$01,$07,$F8,$F8,$F8,$F8,$F8,$F8,$F8 +CHSET00_END: + +; ----------------------------------------------------------------------------- + +GET_HALFTONE_RECT_SIZE: + STS RECTNC_X,CURSORX + STS RECTNC_Y,CURSORY + RCALL GO_RX_WAIT + STS RECTNC_XX,A + RCALL GO_RX_WAIT + STS RECTNC_YY,A + RCALL HALFTONE_RECT + RJMP GO_MAIN_LOOP + +HALFTONE_RECT: + SEI + LDS LINE_CNT,RECT_Y + LDS XPIXEL,RECT_X + RCALL CALCULATE_XBYTE + STS XPIXEL_SAV,XPIXEL + STS XBYTE_SAV,XBYTE + LDS Y_SIZE,RECT_YY + CLR YL + MOV YH,LINE_CNT + LDI A,$55 + SBRS YH,0 + LDI A,$AA + MOV PATTERN,A + LSR YH + ROR YL + LSR YH + ROR YL + SUBI YH,HIGH(-DRAW_DSPRAM) ; DRAW INTO DRAWING BUFFER + LDI A,HIGH(DRAW_DSPRAM>>6) + RCALL SELECT_XPAGE + RJMP X03A3 +X039A: SUBI YL,LOW(-$40) + SBCI YH,HIGH(-$40) + INC LINE_CNT + LDS XPIXEL,XPIXEL_SAV + LDS XBYTE,XBYTE_SAV +X03A3: OR XBYTE,YL + LDI A,$FF + LDS X_SIZE,RECT_XX + LDI F,$00 + CP X_SIZE,F + BREQ X03B0 + LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + TST XPIXEL + BREQ X03B0 +X03AD: LSR A + DEC XPIXEL + BRNE X03AD +X03B0: AND A,PATTERN + RCALL WR_DISP_MEM + LDI F,$08 + LDS A,XPIXEL_SAV + SUB F,A + SUB X_SIZE,F + INC XBYTE + LDI A,$FF +X03B8: LDI F,$08 + CP X_SIZE,F + BRLO X03C2 + BREQ X03D2 + AND A,PATTERN + RCALL WR_DISP_MEM + LDI A,$FF + LDI F,$08 + SUB X_SIZE,F + INC XBYTE + RJMP X03B8 +X03C2: TST X_SIZE + BREQ X03D3 +X03C4: LSR A + DEC X_SIZE + BRNE X03C4 + COM A + TST XPIXEL + BREQ X03D2 + CLR B +X03CB: LSR A + ROR B + DEC XPIXEL + BRNE X03CB + AND A,PATTERN + RCALL WR_DISP_MEM + INC XBYTE + MOV A,B +X03D2: AND A,PATTERN + RCALL WR_DISP_MEM +X03D3: COM PATTERN + RCALL GO_NICK_SUB1 + DEC Y_SIZE + CLR F + CPSE Y_SIZE,F + RJMP X039A + +; ----------------------------------------------------------------------------- + + .ORG $1000 + + .DW $4102 ; SELECT ADDRESS COMMAND + +; ----------------------------------------------------------------------------- + diff --git a/src/mkutil/tavrasm.118/src/utils.cc b/src/mkutil/tavrasm.118/src/utils.cc new file mode 100644 index 00000000..84058350 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/utils.cc @@ -0,0 +1,983 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : utils.cc +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Implements functions for logging, error reporting etc. +// +// History +// ======================================================================= +// +// 980902 : Tom - File created. +// 990117 : Tom - Fixed alignment of .db in CSEG with forward refs. +// 990124 : Tom - Added GPL notice. +// 990329 : Tom - Fixed problem with tabs after include filename +// 991212 : Tom - Fixed promlem with detecting supported instructions +// (Introduced in 1.10) +// 001101 : Brian Rhodefer - Added "fopenInIncpath()" +// 010403 : Tom - Fixed path delimiter problem in include path +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#define _UTILS_CC_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include "messages.hh" +#include "avrasm.hh" +#include "utils.hh" +#include "symbol.hh" +#include "semantic.hh" + +/// Externals //////////////////////////////////////////////////////////////// + +GLOBALS(extern); + +/// Defines ////////////////////////////////////////////////////////////////// + +#define SEP yyinmacro?'>':'|' +#define CUT if( yycfg -> cutlog ) \ + { \ + strcat(yyinlineold, sp ); \ + yyinlineold[58] = '|'; \ + yyinlineold[59] = '\0'; \ + } + +/// Functions //////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////// + // + // Get symbol + // + +symbolTableEntry* getsym(char *name) +{ + int c; + symbolTableEntry *symb = NULL; +#ifdef DEBUG /* Nick */ + void *silly; + + silly = malloc(0x1000); + if (silly) + { + free(silly); + } + + printf("getsym() @ %08lx\n", silly); + fflush(stdout); +#endif + + // Is it a macro def + + for(c=yycontext; c>=0 ; c--) + if( yysymbolstack[c] && (symb=yysymbolstack[c]->get(name)) && symb->macro) + return symb; + + // No it was not + + c = yycontext; + symb = NULL; + + if(!yyparseno) + { + while(!yysymbolstack[c]) + c--; + + symb = yysymbolstack[c]->get(name); + if(!symb) + { + symb = yysymbolstack[c]->add(name); + if (!symb) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 0\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); /* Nick */ + } +#ifdef DEBUG /* Nick */ + silly = malloc(0x1000); + if (silly) + { + free(silly); + } + printf("add() @ %08lx\n", silly); + fflush(stdout); +#endif + } + + } + else + { + while( (c>=0) && !symb ) + { + if( yysymbolstack[c--] ) + { + symb = yysymbolstack[c+1]->get(name); + if(! (symb && ISUSED(symb)) ) + symb = NULL; + } + } + if(!symb) + { + c = yycontext; + while( (c>=0) && !symb ) + { + if( yysymbolstack[c--] ) + symb = yysymbolstack[c+1]->get(name); + } + } + } + + if(!symb) + internalerror("GS %s",name); + + return symb; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert code i CSEG + // + +void insertcode(int val) +{ + if(yycodepos>=MAX_CODE_SIZE) + errorexit(X_TOO_MUCH_CODE); + + yycodebuf[yycodepos] = val; + yycodeusage[yycodepos] = yyfileno|0x80*(ISMACRO!=FALSE); /* Nick false); */ + yycodeline[yycodepos++] = yyline-1+(ISMACRO!=0); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert .db or .dw in CSEG + // + +void insertdbdw(int val) +{ + if(yycodepos>=MAX_CODE_SIZE) + errorexit(X_TOO_MUCH_CODE); + + yycodebuf[yycodepos] = val; + yycodeusage[yycodepos] = yyfileno|0x80*(ISMACRO!=FALSE); /* Nick false); */ + yycodeline[yycodepos++] = yyline; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert data in ESEG + // + +void insertdata(int val) +{ + if(yycodepos>=MAX_EROM_SIZE) + errorexit(X_TOO_MUCH_DATA); + + yyerombuf[yyerompos] = val; + yyeromusage[yyerompos++] = yyfileno; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Check if instruction is supported with the current device + // + +#define NOSUP(_inst_) (DEVINF.supported & (_inst_)) + +void checkSupported(int opcode) +{ + switch((unsigned int)opcode) /* Nick cast */ + { + case O_ADIW : if(NOSUP(S_ADIW )) warning(W_UNSUP,"adiw"); break; + case O_ICALL : if(NOSUP(S_ICALL )) warning(W_UNSUP,"icall"); break; + case O_CALL : if(NOSUP(S_CALL )) warning(W_UNSUP,"call"); break; + case O_IJMP : if(NOSUP(S_IJMP )) warning(W_UNSUP,"ijmp"); break; + case O_JMP : if(NOSUP(S_JMP )) warning(W_UNSUP,"jmp"); break; + case O_LD : if(NOSUP(S_LD )) warning(W_UNSUP,"ld"); break; + case O_LDD : if(NOSUP(S_LDD )) warning(W_UNSUP,"ldd"); break; + case O_LDS : if(NOSUP(S_LDS )) warning(W_UNSUP,"lds"); break; + case O_LPM : if(NOSUP(S_LPM )) warning(W_UNSUP,"lpm"); break; + case O_MUL : if(NOSUP(S_MUL )) warning(W_UNSUP,"mul"); break; + case O_PUSH : if(NOSUP(S_PUSH )) warning(W_UNSUP,"push"); break; + case O_POP : if(NOSUP(S_POP )) warning(W_UNSUP,"pop"); break; + case O_SBIW : if(NOSUP(S_SBIW )) warning(W_UNSUP,"sbiw"); break; + case O_ST : if(NOSUP(S_ST )) warning(W_UNSUP,"st"); break; + case O_STD : if(NOSUP(S_STD )) warning(W_UNSUP,"std"); break; + case O_STS : if(NOSUP(S_STS )) warning(W_UNSUP,"sts"); break; + case O_EIJMP : if(NOSUP(S_EIJMP )) warning(W_UNSUP,"eijmp"); break; + case O_EICALL : if(NOSUP(S_EICALL)) warning(W_UNSUP,"eicall"); break; + case O_ESPM : if(NOSUP(S_ESPM )) warning(W_UNSUP,"espm"); break; + case O_MULSU : if(NOSUP(S_MULSU )) warning(W_UNSUP,"mulsu"); break; + case O_FMUL : if(NOSUP(S_FMUL )) warning(W_UNSUP,"fmul"); break; + case O_FMULS : if(NOSUP(S_FMULS )) warning(W_UNSUP,"fmuls"); break; + case O_FMULSU : if(NOSUP(S_FMULSU)) warning(W_UNSUP,"fmulsu"); break; + case O_MULS : if(NOSUP(S_MULS )) warning(W_UNSUP,"muls"); break; + case O_MOVW : if(NOSUP(S_MOVW )) warning(W_UNSUP,"movw"); break; + case O_ELPM : if(NOSUP(S_ELPM )) warning(W_UNSUP,"elpm"); break; + case O_SPM : if(NOSUP(S_SPM )) warning(W_UNSUP,"spm"); break; + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Insert instruction into code segment + // + +#ifdef _MSC_VER /* Nick */ +void insertInst(int v, int s) +#else +void insertInst(long v, int s) +#endif +{ + if(yysegment==SEGMENT_DATA) + error(E_PROGRAM_IN_DSEG); + else if(yysegment==SEGMENT_EEPROM) + error(E_PROGRAM_IN_DSEG); + else + { + if(s==1) + { + insertcode( (v & 0x000000FF) >> 0); + } + else if(s==2) + { +#ifdef _MSC_VER /* Nick */ + insertcode( (v & 0x000000FF) >> 0); + insertcode( (v & 0x0000FF00) >> 8); +#else + insertcode( (v & 0x000000FFL) >> 0); + insertcode( (v & 0x0000FF00L) >> 8); +#endif + } + else if(s==4) + { +#ifdef _MSC_VER /* Nick */ + insertcode( (v & 0x000000FF) >> 0); + insertcode( (v & 0x0000FF00) >> 8); + insertcode( (v & 0x00FF0000) >> 16); + insertcode( (v & 0xFF000000) >> 24); +#else + insertcode( (v & 0x000000FFL) >> 0); + insertcode( (v & 0x0000FF00L) >> 8); + insertcode( (v & 0x00FF0000L) >> 16); + insertcode( (v & 0xFF000000L) >> 24); +#endif + } + else + internalerror("GG %08X %08X",v,s); + + if(s==1) + sprintf(yylinetxt,"?????? %02X%02X ", + yycodebuf[yycodepos-1], yycodebuf[yycodepos-2]); + else if(s==2) + sprintf(yylinetxt,"%06X %02X%02X ", (yycodepos-2)/2, + yycodebuf[yycodepos-1], yycodebuf[yycodepos-2]); + else if(s==4) + sprintf(yylinetxt,"%06X %02X%02X %02X%02X", (yycodepos-4)/2, + yycodebuf[yycodepos-3], yycodebuf[yycodepos-4], + yycodebuf[yycodepos-1], yycodebuf[yycodepos-2]); + else + internalerror("PH %08X %08X",v,s); + } +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report warning at end of line + // + +int warning(int warnno, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + if(!yyparseno || !warnno) + return FALSE; /* Nick false; */ + + yywarningcount++; + + if(!yycfg -> warnings) + return FALSE; /* Nick false; */ + + if( (yywarningline==yyline-!ISMACRO) && !ISMACRO ) + return FALSE; /* Nick false; */ + + yywarningline = yyline-!ISMACRO; + + if( (warnno<1) || (warnno>MESSAGES_WARNING) ) + internalerror("WW %04X", warnno); + + va_start(args, warnno); + vsprintf(errtext, messages[warnno], args); + va_end(args); + + if(yyinmacro) + printf("%s:%i: Warning in macro : %s\n",yyfilename, + yyline-!ISMACRO,errtext); + else + printf("%s:%i: Warning : %s\n",yyfilename,yyline-!ISMACRO,errtext); + + if(yylogfile) + { + if(yyinmacro) + fprintf(yylogfile, "%s:%i: Warning in macro : %s\n",yyfilename, + yyline-!ISMACRO,errtext); + else + fprintf(yylogfile, "%s:%i: Warning : %s\n",yyfilename, + yyline-!ISMACRO,errtext); + } + + STRIPNR(yyinlineold); + + printf("%s:%i: \'%s\'\n",yyfilename,yyline-!ISMACRO,yyinlineold); + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report warning inline + // + +int warningin(int warnno, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + if(!yyparseno || !warnno) + return FALSE; /* Nick false; */ + + yywarningcount++; + + if(!yycfg -> warnings) + return FALSE; /* Nick false; */ + + if( (yywarningline==yyline) && !ISMACRO ) + return FALSE; /* Nick false; */ + + yywarningline = yyline; + + if( (warnno<1) || (warnno>MESSAGES_WARNING) ) + internalerror("WI %04X", warnno); + + va_start(args, warnno); + vsprintf(errtext, messages[warnno], args); + va_end(args); + + if(yyinmacro) + printf("%s:%i: Warning in macro : %s\n",yyfilename,yyline,errtext); + else + printf("%s:%i: Warning : %s\n",yyfilename,yyline,errtext); + + if(yylogfile) + { + if(yyinmacro) + fprintf(yylogfile, "%s:%i: Warning in macro : %s\n",yyfilename, + yyline,errtext); + else + fprintf(yylogfile, "%s:%i: Warning : %s\n",yyfilename,yyline,errtext); + } + + STRIPNR(yyinline); + + printf("%s:%i: \'%s\'\n",yyfilename,yyline,yyinline); + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report error at end of line + // + +int error(int errorno, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + if(!yyparseno) + return FALSE; /* Nick false; */ + + if( (yyerrorline == yyline- !ISMACRO) && !ISMACRO ) + return FALSE; /* Nick false; */ + + yyerrorline = yyline - !ISMACRO; + + yyerrorcount++; + + if( (errorno<1) || (errorno>MESSAGES_ERROR) ) + internalerror("EE %04X", errorno); + + errorno += MESSAGES_WARNING; + + va_start(args, errorno); + vsprintf(errtext, messages[errorno], args); + va_end(args); + + if(yyinmacro) + printf("%s:%i: Error in macro : %s\n",yyfilename,yyline-!ISMACRO,errtext); + else + printf("%s:%i: Error : %s\n",yyfilename,yyline-!ISMACRO,errtext); + + if(yylogfile) + { + if(yyinmacro) + fprintf(yylogfile, "%s:%i: Error in macro : %s\n",yyfilename, + yyline-!ISMACRO,errtext); + else + fprintf(yylogfile, "%s:%i: Error : %s\n",yyfilename, + yyline-!ISMACRO,errtext); + } + + STRIPNR(yyinlineold); + + printf("%s:%i: \'%s\'\n",yyfilename,yyline-!ISMACRO,yyinlineold); + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report error inline + // + +int errorin(int errorno, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + if(!yyparseno) + return FALSE; /* Nick false; */ + + if( (yyerrorline == yyline) && !ISMACRO ) + return FALSE; /* Nick false; */ + + yyerrorline = yyline; + + yyerrorcount++; + + if( (errorno<1) || (errorno>MESSAGES_ERROR) ) + internalerror("EI %04X", errorno); + + errorno += MESSAGES_WARNING; + + va_start(args, errorno); + vsprintf(errtext, messages[errorno], args); + va_end(args); + + if(yyinmacro) + printf("%s:%i: Error in macro : %s\n",yyfilename,yyline,errtext); + else + printf("%s:%i: Error : %s\n",yyfilename,yyline,errtext); + + STRIPNR(yyinline); + + printf("%s:%i: \'%s\'\n",yyfilename,yyline,yyinline); + + if(yylogfile) + { + if(yyinmacro) + fprintf(yylogfile, "%s:%i: Error in macro : %s\n",yyfilename,yyline,errtext); + else + fprintf(yylogfile, "%s:%i: Error : %s\n",yyfilename,yyline,errtext); + } + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Print a message + // + +int message(int msgno, ...) +{ + va_list args; + char msgtext[MAX_LINE_LENGTH+1]; + + msgno += MESSAGES_WARNING + MESSAGES_ERROR + MESSAGES_FATAL + 2; + + va_start(args, msgno); + vsprintf(msgtext, messages[msgno], args); + va_end(args); + + printf("%s\n",msgtext); + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report fatal error and exit(1) + // + +void errorexit(int errorno, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + if( (errorno<1) || (errorno>MESSAGES_FATAL) ) + internalerror("EX %04X", errorno); + + errorno += MESSAGES_WARNING + MESSAGES_ERROR + 1; + + va_start(args, errorno); + vsprintf(errtext, messages[errorno], args); + va_end(args); + + printf("Program terminated - %s\n",errtext); + exit(1); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Report internal error and exit(2) + // + +void internalerror(char const *fmt, ...) +{ + va_list args; + char errtext[MAX_LINE_LENGTH+1]; + + va_start(args, fmt); + vsprintf(errtext, fmt, args); + va_end(args); + + sprintf(errtext+strlen(errtext)," %s",VERSIONSTR); + + while(strlen(errtext)<57) + strcat(errtext," "); + + printf("\n"); + printf(" ************************************************************\n"); + printf(" * *\n"); + printf(" * Internal compiler error !!! *\n"); + printf(" * *\n"); + printf(" * Please note the error text and report to Tom : *\n"); + printf(" * *\n"); + printf(" * %s*\n",errtext); + printf(" * *\n"); + printf(" ************************************************************\n"); + exit(2); +} + + //////////////////////////////////////////////////////////////////////////// + // + // Add line to log file + // + +void tolog(void) +{ + int c; + char temp[MAX_LINE_LENGTH+100]; + char sp[]=" |\n"; + static int rompos = 0; + static int codepos = 0; + static int rampos = 0; + + // Check alignment ///////////////////////////////////////////////////////// + + if( (yysegment==SEGMENT_CODE) && (yycodepos&1) && (yycfg->aligndb) ) { + yyline-=(ISMACRO==0); + insertdbdw(0); + yyline+=(ISMACRO==0); + } + + // Return if first parse /////////////////////////////////////////////////// + + if(!yyparseno) + return; + + // Check if eeprom/flash size has been exceeded //////////////////////////// + + if( (yycodepos > DEVINF.flashsize*2) && (yycodepos != codepos) ) { + warning(W_FLASH_EXCEEDED,(yycodepos-DEVINF.flashsize*2)/2); + codepos = yycodepos; + } + + if( (yyerompos > DEVINF.eepromsize) && (yyerompos!=rompos) ) { + warning(W_EROM_EXCEED,yyerompos-DEVINF.eepromsize); + rompos = yyerompos; + } + + if( (yydatapos > DEVINF.datastart+DEVINF.ramsize) && (yydatapos!=rampos)) { + warning(W_SRAM_EXCEED,yydatapos-(DEVINF.datastart+DEVINF.ramsize)); + rampos = yydatapos; + } + + // Clean-up log line /////////////////////////////////////////////////////// + + STRIPNR(yyinlineold); + exptabs(yyinlineold); + + CUT; + + /// Check if this line was a '.db' or '.dw' //////////////////////////////// + + if(yydefinestart!=-1) + { + if(yysegment == SEGMENT_CODE) + { + if( (yycodepos & 1) && ( yycfg -> aligndb ) ) + { + yyline-=(ISMACRO==0); + insertdbdw(0); + yyline+=(ISMACRO==0); + } + + if(!ISMACRO && (yycodeline[yycodepos-2]==yyline) ) + yycodeline[yycodepos-2]--; + + if(yylist && yylogfile && !(yyinmacro && !yylistmacro)) + { + sprintf(temp,"%06X ", yydefinestart/2); + + for(c=0;c<((yycodepos-yydefinestart)&3);c++) /* Nick added paren */ + { + sprintf(temp+strlen(temp),"%02X",yycodebuf[yydefinestart+c]); + if(c&1) + strcat(temp," "); + } + + strcat(temp," "); + temp[16] = '\0'; + + CUT; + + fprintf(yylogfile,"| %s %c %s\n",temp,SEP,yyinlineold); + + if(yycodepos-yydefinestart>3) + { + for(c=0;c< (yycodepos-yydefinestart)-4;c++) + { + if(c%4 == 0) + sprintf(temp,"%06X ",(c+4+yydefinestart)/2); + + sprintf(temp+strlen(temp),"%02X",yycodebuf[yydefinestart+c+4]); + if(c&1) + strcat(temp," "); + if( (c%4 == 3) && c) + { + strcat(temp," "); + temp[16] = '\0'; + + fprintf(yylogfile,"| %s %c",temp,SEP); + if( yycfg -> cutlog) + fprintf(yylogfile, sp); + else + fprintf(yylogfile,"\n"); + } + } + } + if( (yycodepos-yydefinestart>4) && (c%4 != 0) ) + { + strcat(temp," "); + temp[16] = '\0'; + fprintf(yylogfile,"| %s %c",temp,SEP); + if( yycfg -> cutlog) + fprintf(yylogfile, sp); + else + fprintf(yylogfile,"\n"); + } + } + } + else if(yysegment == SEGMENT_EEPROM) + { + if(yylist && yylogfile && !(yyinmacro && !yylistmacro)) + { + if(yydefinetype!=SEGMENT_DEFINE_BYTE) + { + c = yydefinestart; + CUT; + fprintf(yylogfile,"| %06X %02X EEPROM %c %s\n", c, + yyerombuf[c],SEP,yyinlineold); + for(c++;c cutlog) + fprintf(yylogfile, sp); + else + fprintf(yylogfile,"\n"); + } + } + else + { + CUT; + fprintf(yylogfile, "| %06X EEPROM %c %s\n",yydefinestart, + SEP,yyinlineold); + yydefinetype = 0; + } + } + } + else if(yysegment == SEGMENT_DATA) + { + if(yylist && yylogfile && !(yyinmacro && !yylistmacro)) + { + c = yydefinestart; + CUT; + fprintf(yylogfile, "| %06X -DATA- %c %s\n", c, SEP,yyinlineold); + } + } + else + internalerror("LI %04X",yysegment); + } + + /// No it is a regular instruction ///////////////////////////////////////// + + else + { + if(yyinmacro) + { + if((yylistmacro||yyfirstmacroline) && yylist && yylogfile) + { + if( strlen(yylinetxt) ) + { + CUT; + fprintf(yylogfile,"| %s > %s\n",yylinetxt,yyinlineold); + } + else if(yyfirstmacroline) + { + CUT; + fprintf(yylogfile,"| %06X > %s\n",yycodepos/2,yyinlineold); + } + else + { + CUT; + fprintf(yylogfile,"| > %s\n",yyinlineold); + } + } + } + else + { + if(yylist && yylogfile) + { + if( strlen(yylinetxt) ) + { + CUT; + fprintf(yylogfile, "| %s | %s\n",yylinetxt,yyinlineold); + } + else if(!(yyinmacrodef && !yylistmacro)) + { + CUT; + fprintf(yylogfile, "| | %s\n",yyinlineold); + } + } + } + } + + yylinetxt[0] = 0; + yydefinestart = -1; + yyfirstmacroline = FALSE; /* Nick false; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Strip comment from line + // + +int striprem(char *str) +{ + int l = 0; + int rem = FALSE; /* Nick false; */ + char *pos; + + if( (pos=strpbrk(str,"\r\n")) ) + *pos = '\0'; + + while(str[l]) + { + if( (str[l]=='"') || (str[l]=='\'') ) + rem ? rem = FALSE /* Nick false */ : rem = TRUE; /* Nick true; */ + else if( str[l]=='\\' ) + { + if(str[l+1]) + l++; + } + else if ( (str[l]==';') && !rem) + str[l--] = '\0'; + l++; + } + + l = strlen(str); + + if(l) + while(--l, ((str[l]==' ')||(str[l]=='\t'))) + str[l] = '\0'; + + return l; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Expand tabs in string + // + +int exptabs(char *str) +{ + int l = strlen(str); + int c = 0; + char *temp; + + /// Expand tabs /////////////////////////////////////////////////////////// + + if(l) + { + if(!(temp = new char[strlen(str)+1])) + { +#ifdef DEBUG /* Nick */ + printf("Nick error 1\n"); + fflush(stdout); +#endif + errorexit(X_OUT_OF_MEMORY); + } + + strcpy(temp, str); + c = l = 0; + while(temp[l] && (c<(MAX_LINE_LENGTH-10))) + { + if(temp[l]=='\t') + { + if(temp[l]=='\t') + str[c++]=' '; + while((c%8)!=0) + str[c++]=' '; + l++; + if(temp[l]=='\t') + str[c++]=' '; + } + else + str[c++]=temp[l++]; + } + str[c] = '\0'; + delete temp; + } + return c; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Get file.name from "file.name" or + // + +int getfilename(char *name, char *newname) +{ + + if( (name[0]!='"') || (name[strlen(name)-1]!='"') ) + { + if( (name[0]!='<') || (name[strlen(name)-1]!='>') ) + return FALSE; /* Nick false; */ + else + { + memmove(name,name+1,strlen(name)-1); + name[strlen(name)-2] = 0; + + // Search include tree here - XXX + + strcpy(newname, name); + } + + if(!strlen(newname)) + return FALSE; /* Nick false; */ + } + else + { + memcpy(newname,name+1,strlen(name)-1); + newname[strlen(name)-2] = 0; + } + + if(strlen(newname)>MAX_FILENAME_LENGTH) + { + errorin(E_FILENAME_TOO_LONG); + return FALSE; /* Nick false; */ + } + + return TRUE; /* Nick true; */ +} + + //////////////////////////////////////////////////////////////////////////// + // + // Check that filename is valid + // + +int checkfilename(char *name) +{ + return 1; + + int c = strlen(name); + int valid = TRUE; /* Nick true; */ + + while(name[c]) + if( ! isalnum(name[c++]) ) + valid = FALSE; /* Nick false; */ + + return valid; +} + + //////////////////////////////////////////////////////////////////////////// + // + // Open a file somewhere in the "include path". Try in the current dir first. + // + +FILE * fopenInIncpath(const char *name, const char *mode) +{ + FILE *fp = fopen(name, mode); + + if(fp) + return fp; + + if (MAX_FILENAME_LENGTH <= strlen(name)) + errorin(E_FILENAME_TOO_LONG); + else + { + int c; + + for(c=0; !fp && (cMAX_FILENAME_LENGTH) + continue; + char *slash = strrchr(path, '/'); + char file[2 * MAX_FILENAME_LENGTH + 3]; + sprintf(file, "%s%s%s", path, (slash && !slash[1]) ? "" : "/", name); + fp = fopen(file, mode); + } + } + + return fp; +} + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/tavrasm.118/src/utils.hh b/src/mkutil/tavrasm.118/src/utils.hh new file mode 100644 index 00000000..90d568b2 --- /dev/null +++ b/src/mkutil/tavrasm.118/src/utils.hh @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// File : utils.hh +// +// Author : Tom Mortensen - Copyright (C) 1999 +// +// Description : Utility header +// +// History +// ======================================================================== +// +// 980902 : Tom - File created. +// 990124 : Tom - Added GPL notice. +// 001101 : Brian Rhodefer - Added "fopenInIncpath()" +// +//////////////////////////////////////////////////////// Tom did this //////// +// +// Copyright notice: +// +// tavrasm - A GNU/Linux assembler for the Atmel AVR series +// of microcontrollers. Copyright (C) 1999 Tom Mortensen +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Tom Mortensen +// +// E-mail : tom@tavrasm.org +// WWW : http://www.tavrasm.org +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _UTILS_HH_ +#define _UTILS_HH_ + +/// Include ////////////////////////////////////////////////////////////////// + +#include "symbol.hh" +#include + +/// Prototypes /////////////////////////////////////////////////////////////// + +#ifdef _MSC_VER /* Nick */ +void insertInst(int v, int s); +#else +void insertInst(long v, int s); +#endif +void checkSupported(int opcode); +symbolTableEntry* getsym(char *name); +void insertcode(int val); +void insertdbdw(int val); +void insertdata(int val); +FILE * fopenInIncpath(const char *name, const char *mode); + + /// Error handling /////////////////////////////////////////////////////// + +int error(int errorno, ...); +int errorin(int errorno, ...); +int warning(int warnno, ...); +int warningin(int warnno, ...); +void errorexit(int errorno, ...); +void internalerror(char const *fmt, ...); +int message(int msgno, ...); + + /// Strip comments /////////////////////////////////////////////////////// + +void tolog(void); +int getfilename(char *name, char *newname); +int striprem(char *str); +int exptabs(char *str); +int checkfilename(char *name); + +#endif /* _UTILS_HH_ */ + +/// END OF FILE ////////////////////////////////////////////////////////////// + diff --git a/src/mkutil/touch.exe b/src/mkutil/touch.exe index a607f979..84db3811 100644 Binary files a/src/mkutil/touch.exe and b/src/mkutil/touch.exe differ diff --git a/src/sh/msh/closedir.c b/src/sh/msh/closedir.c new file mode 100644 index 00000000..fe241251 --- /dev/null +++ b/src/sh/msh/closedir.c @@ -0,0 +1,31 @@ +/* closedir.c closedir implementation + * + */ +#include +#include +#include +#include +#include +#include +#include + +/* don't bother freeing anything, since msh doesn't like sharing its heap */ + +int nick_closedir(DIR *dir) +{ + if (dir == NULL || dir->dd_buf == NULL || dir->dd_fd == 0) { + errno = EFAULT; + return -1; + } + close(dir->dd_fd); +#if 0 + free(dir->dd_buf); +#endif + dir->dd_fd = 0; + dir->dd_buf = NULL; +#if 0 + free(dir); +#endif + return 0; +} + diff --git a/src/sh/msh/closedir.rel b/src/sh/msh/closedir.rel new file mode 100644 index 00000000..f70b0d85 --- /dev/null +++ b/src/sh/msh/closedir.rel @@ -0,0 +1,49 @@ +XL4 +H 2 areas 8 global symbols +M closedir +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S close Ref00000000 +S ?ENT_PARM_DIRECT_L09 Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S errno Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 5B flags 0 +S nick_closedir Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 7B B2 28 1A 21 +R 00 00 01 00 02 05 02 00 +T 08 00 00 00 06 00 DD 4E 02 DD 46 03 09 7E 23 +R 00 00 01 00 +T 13 00 00 00 B6 28 0B DD 6E 02 DD 66 03 7E 23 +R 00 00 01 00 +T 1E 00 00 00 B6 20 0B +R 00 00 01 00 +T 21 00 00 00 +R 00 00 01 00 +T 21 00 00 00 +R 00 00 01 00 +T 21 00 00 00 +R 00 00 01 00 +T 21 00 00 00 21 0E 00 22 00 00 00 00 21 FF FF +R 00 00 01 00 02 08 04 00 +T 2A 00 00 00 18 2C +R 00 00 01 00 +T 2C 00 00 00 +R 00 00 01 00 +T 2C 00 00 00 DD 6E 02 DD 66 03 5E 23 56 3E +R 00 00 01 00 +T 36 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 01 00 02 09 01 00 +T 3B 00 00 00 00 00 00 00 DD 6E 02 DD 66 03 AF +R 00 00 01 00 02 04 03 00 +T 44 00 00 00 77 23 77 21 06 00 DD 4E 02 DD 46 +R 00 00 01 00 +T 4F 00 00 00 03 09 AF 77 23 77 21 00 00 +R 00 00 01 00 +T 58 00 00 00 +R 00 00 01 00 +T 58 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 00 00 diff --git a/src/sh/msh/msh.lnk b/src/sh/msh/msh.lnk index 6d248765..155534e3 100644 --- a/src/sh/msh/msh.lnk +++ b/src/sh/msh/msh.lnk @@ -16,3 +16,6 @@ sh3 sh4 sh5 sh6 +opendir +closedir +readdir diff --git a/src/sh/msh/msh.map b/src/sh/msh/msh.map index 0f32f356..9a7e2fec 100644 --- a/src/sh/msh/msh.map +++ b/src/sh/msh/msh.map @@ -10,14 +10,14 @@ Area Addr Size Decimal Bytes (Attributes) 00000000 l_CONST | 00000000 .__.ABS. | 00000000 ?CL64180L 00000000 ?CL64180B | 00000014 e__DEFAUL | 00000014 l__DEFAUL 00000185 l_RCODE | 00000520 l_CDATA0 | 00000520 l_IDATA0 - 00000530 l_CSTR | 000009C5 l_UDATA0 | 00001000 l_CSTACK + 000005E7 l_CSTR | 000009EB l_UDATA0 | 00001000 l_CSTACK 00004000 s_CODE | 00008100 s_RCODE | 00008285 s_CSTR 00008285 e_RCODE | 00008285 e_CONST | 00008285 s_CONST - 000087B5 e_CSTR | 000087B5 s_IDATA0 | 000087B5 s_CDATA0 - 00008CD5 s_UDATA0 | 00008CD5 e_CCSTR | 00008CD5 e_ECSTR - 00008CD5 s_CCSTR | 00008CD5 e_CDATA0 | 00008CD5 s_ECSTR - 00008CD5 e_IDATA0 | 0000969A e_UDATA0 | 0000969A s_CSTACK - 0000A69A e_CSTACK | 00018909 l_CODE | 0001C909 e_CODE + 0000886C e_CSTR | 0000886C s_IDATA0 | 0000886C s_CDATA0 + 00008D8C s_UDATA0 | 00008D8C e_CCSTR | 00008D8C e_ECSTR + 00008D8C s_CCSTR | 00008D8C e_CDATA0 | 00008D8C s_ECSTR + 00008D8C e_IDATA0 | 00009777 e_UDATA0 | 00009777 s_CSTACK + 0000A777 e_CSTACK | 000187BA l_CODE | 0001C7BA e_CODE Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) @@ -55,7 +55,7 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTR 00008285 00000530 = 1328. bytes (REL,CON) +CSTR 00008285 000005E7 = 1511. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -63,19 +63,19 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -IDATA0 000087B5 00000520 = 1312. bytes (NUL,CON) +IDATA0 0000886C 00000520 = 1312. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 000087B5 flag | 000087B7 elinep | 000087B9 null - 000087BB heedint | 000087BD env | 000087C9 shellname - 000087D1 search | 000087E0 qflag | 000087E5 restab - 00008CC7 temparg + 0000886C flag | 0000886E elinep | 00008870 null + 00008872 heedint | 00008874 env | 00008880 shellname + 00008888 search | 00008897 qflag | 0000889C restab + 00008D7E temparg Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CDATA0 000087B5 00000520 = 1312. bytes (REL,CON) +CDATA0 0000886C 00000520 = 1312. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -83,7 +83,7 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -ECSTR 00008CD5 00000000 = 0. bytes (NUL,CON) +ECSTR 00008D8C 00000000 = 0. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -91,7 +91,7 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CCSTR 00008CD5 00000000 = 0. bytes (REL,CON) +CCSTR 00008D8C 00000000 = 0. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -99,26 +99,26 @@ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CODE 00004000 00018909 = 100617. bytes (NUL,CON) +CODE 00004000 000187BA = 100282. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00004BE9 main | 00005266 setdash | 000052C9 newfile - 00005346 onecomman | 000054A6 fail | 000054BC leave - 000054FA warn | 00005539 err | 0000558B newenv - 000055F6 quitenv | 00005656 anys | 00005693 any - 000056C9 putn | 000056DA sh_itoa | 00005785 next - 000057A3 onintr | 000057FD letter | 0000584E digit - 00005876 letnum | 000058A2 space | 000058D3 strsave - 0000594C xfree | 0000595A sig | 0000597D runtrap - 000059D4 lookup | 00005BE8 setval | 00005BFB nameval - 00005DCC export | 00005DDA ronly | 00005E04 isassign - 00005E5B assign | 00005F24 checkname | 00005F78 putvlist - 0000606D eqname | 000060F9 gmatch | 0000632D initarea - 0000637D getcell | 00006571 freecell | 000065BE freearea - 0000661F setarea | 0000664C getarea | 0000665C garbage - 000066E9 yyparse | 0000700D rlookup | 00007250 yyerror - 00007616 collect | 000076D0 dual | 0000782A printf + 00004CA0 main | 0000531D setdash | 00005380 newfile + 000053FD onecomman | 0000555D fail | 00005573 leave + 000055B1 warn | 000055F0 err | 00005642 newenv + 000056AD quitenv | 0000570D anys | 0000574A any + 00005780 putn | 00005791 sh_itoa | 0000583C next + 0000585A onintr | 000058B4 letter | 00005905 digit + 0000592D letnum | 00005959 space | 0000598A strsave + 00005A03 xfree | 00005A11 sig | 00005A34 runtrap + 00005A8B lookup | 00005C9F setval | 00005CB2 nameval + 00005E83 export | 00005E91 ronly | 00005EBB isassign + 00005F12 assign | 00005FDB checkname | 0000602F putvlist + 00006124 eqname | 000061B0 gmatch | 000063E4 initarea + 00006434 getcell | 000066B4 freecell | 00006701 freearea + 00006762 setarea | 0000678F getarea | 0000679F garbage + 0000682C yyparse | 00007150 rlookup | 00007393 yyerror + 00007759 collect | 00007813 dual | 0000796D printf 00014000 execute | 00014C48 iosetup | 00015097 waitfor 00015277 setstatus | 000152AB rexecve | 00015493 run 000155A1 dolabel | 000155A7 dochdir | 00015633 doshift @@ -131,68 +131,71 @@ CODE 00004000 00018909 = 100617. bytes (NUL,CON) 0001640C dotimes | 00016412 inbuilt | 0001646C eval 00016612 makenv | 00016696 evalstr | 00016B22 subgetc 0001715C unquote | 00017198 glob | 0001747D globname - 000178F9 newword | 00017936 addword | 00017A05 getwords - 00017A92 glob0 | 00017ACD glob1 | 00017D8F glob2 - 00017DF2 glob3 | 00017E7C memcopy | 00024000 getc + 00017905 newword | 00017942 addword | 00017A11 getwords + 00017A9E glob0 | 00017AD9 glob1 | 00017D9B glob2 + 00017DFE glob3 | 00017E88 memcopy | 00024000 getc 000240B8 unget | 000240DA eofc | 0002410A readc 00024259 ioecho | 00024281 pushio | 00024460 setbase 0002447B nlchar | 000244C4 wdchar | 00024535 dolchar 000245E5 strchar | 0002461F qstrchar | 0002465F filechar 00024828 herechar | 00024874 gravechar | 000248AC qgravecha - 0002498D linechar | 000249DA prs | 00024A07 putc - 00024A23 prn | 00024A3D closef | 00024A5B closeall - 00024A94 remap | 00024B7A openpipe | 00024BAB closepipe - 00024BE1 markhere | 00024D28 gethere | 00024FB9 herein - 00025104 scraphere | 0002517C freehere | 00025246 tempname - 000252D2 execve | 000252F1 unix | 0002530B dup - 00025320 chdir | 00025335 _write | 00025354 creat - 0002536B unlink | 00025380 strncpy | 000253FF setjmp - 00025429 lseek | 00025456 closedir | 000254CC close - 000254E1 abort | 0002554F strlen | 00025586 _exit - 0002559B strcmp | 000255F2 readdir | 000256D5 pause - 000256E5 isatty | 00025720 umask | 0002573A fstat - 00025751 free | 00025831 geteuid | 00025846 kill - 0002585D pipe | 00025872 opendir | 00025953 fork + 0002498D linechar | 000249DA prs | 00024A07 prs_expan + 00024B86 putc | 00024BA2 prn | 00024BBC closef + 00024BDA closeall | 00024C13 remap | 00024CF9 openpipe + 00024D2A closepipe | 00024D60 markhere | 00024EA7 gethere + 00025138 herein | 00025283 scraphere | 000252FB freehere + 000253C5 tempname | 00025451 nick_open | 000254E6 nick_clos + 00025541 nick_read | 00025624 execve | 00025643 unix + 0002565D dup | 00025672 getenv | 00025723 chdir + 00025738 _write | 00025757 creat | 0002576E unlink + 00025783 strncpy | 00025802 setjmp | 0002582C lseek + 00025859 uname | 00025917 close | 0002592C strlen + 00025963 strcmp | 000259BA isatty | 000259F5 umask + 00025A0F fstat | 00025A26 free | 00025B06 strcpy + 00025B2D geteuid | 00025B42 pipe | 00025B57 fork Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CODE 00004000 00018909 = 100617. bytes (NUL,CON) +CODE 00004000 000187BA = 100282. bytes (NUL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00025963 waitpid | 00025982 open | 000259AD sbrk - 000259C2 longjmp | 000259ED exit | 00025A1D _read - 00025A3C dup2 | 00025A53 stat | 00025A6A getpid - 00025A7F signal | 00025AA4 malloc | 00025CD0 unix_long - 00025CEA calloc | 00025D32 memset + 00025B67 waitpid | 00025B86 open | 00025BB1 sbrk + 00025BC6 longjmp | 00025BF1 exit | 00025C21 _read + 00025C40 dup2 | 00025C57 stat | 00025C6E getpid + 00025EC8 getcwd | 00025F25 signal | 00025F4A memcmp + 00025FB7 getfsys | 00025FCE malloc | 000261FA memcpy + 0002624C strcat | 0002626C unix_long | 00026286 closedir + 000262FC _exit | 00026311 readdir | 000263F4 opendir + 000264D5 calloc | 0002651D memset Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -UDATA0 00008CD5 000009C5 = 2501. bytes (REL,CON) +UDATA0 00008D8C 000009EB = 2539. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ - 00008CD5 _argc | 00008CD7 _argv | 00008CD9 environ - 00008CDB errno | 00008CDD __cleanup | 00008CE0 intr - 00008CE2 inparse | 00008CE4 flags | 00008D2B func - 00008D2E globv | 00008D36 dolv | 00008D38 dolc - 00008D3A exstat | 00008D3C gflg | 00008D3D talking - 00008D3F execflg | 00008D41 multiline | 00008D43 outtree - 00008D45 failpt | 00008D47 errpt | 00008D49 brklist - 00008D4B isbreak | 00008D4D wdlist | 00008D4F iolist - 00008D51 trap | 00008D73 ourtrap | 00008D84 trapset - 00008D86 yynerrs | 00008D88 line | 000095BC vlist - 000095BE homedir | 000095C0 prompt | 000095C2 cprompt - 000095C4 path | 000095C6 shell | 000095C8 ifs - 000095CA ioargstac | 0000963A iostack | 00009692 areanum - 00009694 __malloc_ | 00009698 __malloc_ + 00008D8C _argc | 00008D8E _argv | 00008D90 environ + 00008D92 errno | 00008D94 __cleanup | 00008D97 intr + 00008D99 inparse | 00008D9B flags | 00008DE2 func + 00008DE5 globv | 00008DED dolv | 00008DEF dolc + 00008DF1 exstat | 00008DF3 gflg | 00008DF4 talking + 00008DF6 execflg | 00008DF8 multiline | 00008DFA outtree + 00008DFC failpt | 00008DFE errpt | 00008E00 brklist + 00008E02 isbreak | 00008E04 wdlist | 00008E06 iolist + 00008E08 trap | 00008E2A ourtrap | 00008E3B trapset + 00008E3D yynerrs | 00008E3F line | 00009673 vlist + 00009675 homedir | 00009677 prompt | 00009679 cprompt + 0000967B path | 0000967D shell | 0000967F ifs + 00009681 ioargstac | 000096F1 iostack | 00009749 areanum + 00009771 __malloc_ | 00009775 __malloc_ Hexadecimal [32-Bits] Area Addr Size Decimal Bytes (Attributes) -------------------- ---- ---- ------- ----- ------------ -CSTACK 0000969A 00001000 = 4096. bytes (REL,CON) +CSTACK 00009777 00001000 = 4096. bytes (REL,CON) Value Global Value Global Value Global ----- ------ ----- ------ ----- ------ @@ -206,6 +209,9 @@ sh3 [ sh3 ] sh4 [ sh4 ] sh5 [ sh5 ] sh6 [ sh6 ] +opendir [ opendir ] +closedir [ closedir ] +readdir [ readdir ] Libraries Linked [ object file ] @@ -214,6 +220,7 @@ Libraries Linked [ object file ] ..\..\..\lib\libsysb.lib [ relsysb\sys0b.rel ] ..\..\..\lib\libiar.lib [ reliar\BANKLEAVEDIRECT.rel ] ..\..\..\lib\libsysb.lib [ relsysb\dup.rel ] +..\..\..\lib\libcb.lib [ relcb\getenv.rel ] ..\..\..\lib\libsysb.lib [ relsysb\chdir.rel ] ..\..\..\lib\libsysb.lib [ relsysb\write.rel ] ..\..\..\lib\libiar.lib [ reliar\SMUL.rel ] @@ -222,32 +229,27 @@ Libraries Linked [ object file ] ..\..\..\lib\libcb.lib [ relcb\strncpy.rel ] ..\..\..\lib\libcb.lib [ relcb\setjmpb.rel ] ..\..\..\lib\libsysb.lib [ relsysb\lseek.rel ] -..\..\..\lib\libcb.lib [ relcb\closedir.rel ] +..\..\..\lib\libcb.lib [ relcb\utsname.rel ] ..\..\..\lib\libsysb.lib [ relsysb\close.rel ] -..\..\..\lib\libcb.lib [ relcb\abort.rel ] ..\..\..\lib\libcb.lib [ relcb\strlen.rel ] -..\..\..\lib\libsysb.lib [ relsysb\_exit.rel ] ..\..\..\lib\libcb.lib [ relcb\strcmp.rel ] ..\..\..\lib\libiar.lib [ reliar\CVSWITCH.rel ] ..\..\..\lib\libiar.lib [ reliar\LEAVEDIRECT.rel ] -..\..\..\lib\libcb.lib [ relcb\readdir.rel ] -..\..\..\lib\libsysb.lib [ relsysb\pause.rel ] ..\..\..\lib\libcb.lib [ relcb\isatty.rel ] ..\..\..\lib\libsysb.lib [ relsysb\umask.rel ] ..\..\..\lib\libsysb.lib [ relsysb\fstat.rel ] ..\..\..\lib\libcb.lib [ relcb\free.rel ] ..\..\..\lib\libiar.lib [ reliar\ENTPARMDIRECT.rel ] ..\..\..\lib\libiar.lib [ reliar\BANKCALLDIRECT.rel ] +..\..\..\lib\libcb.lib [ relcb\strcpy.rel ] ..\..\..\lib\libiar.lib [ reliar\SSSWITCH.rel ] ..\..\..\lib\libsysb.lib [ relsysb\geteuid.rel ] ..\..\..\lib\libiar.lib [ reliar\SVSWITCH.rel ] ..\..\..\lib\libiar.lib [ reliar\SSWITCHEND.rel ] -..\..\..\lib\libsysb.lib [ relsysb\kill.rel ] ..\..\..\lib\libiar.lib [ reliar\ENTAUTODIRECT.rel ] ..\..\..\lib\libiar.lib [ reliar\VSWITCHEND.rel ] ..\..\..\lib\libiar.lib [ reliar\LINCASG.rel ] ..\..\..\lib\libsysb.lib [ relsysb\pipe.rel ] -..\..\..\lib\libcb.lib [ relcb\opendir.rel ] ..\..\..\lib\libiar.lib [ reliar\SSCMP.rel ] ..\..\..\lib\libiar.lib [ reliar\USDIVASG.rel ] ..\..\..\lib\libiar.lib [ reliar\LINC.rel ] @@ -265,15 +267,24 @@ Libraries Linked [ object file ] ..\..\..\lib\libsysb.lib [ relsysb\dup2.rel ] ..\..\..\lib\libsysb.lib [ relsysb\stat.rel ] ..\..\..\lib\libsysb.lib [ relsysb\getpid.rel ] +..\..\..\lib\libcb.lib [ relcb\getcwd.rel ] ..\..\..\lib\libiar.lib [ reliar\SSRSH.rel ] ..\..\..\lib\libiar.lib [ reliar\BANKLEAVE32.rel ] ..\..\..\lib\libsysb.lib [ relsysb\signal.rel ] +..\..\..\lib\libcb.lib [ relcb\memcmp.rel ] ..\..\..\lib\libiar.lib [ reliar\SDIVMOD.rel ] +..\..\..\lib\libsysb.lib [ relsysb\getfsys.rel ] ..\..\..\lib\libiar.lib [ reliar\LENDASG.rel ] ..\..\..\lib\libcb.lib [ relcb\malloc.rel ] +..\..\..\lib\libcb.lib [ relcb\memcpy.rel ] +..\..\..\lib\libcb.lib [ relcb\strcat.rel ] ..\..\..\lib\libsysb.lib [ relsysb\sys1b.rel ] -..\..\..\lib\libcb.lib [ relcb\calloc.rel ] +..\..\..\lib\libcb.lib [ relcb\closedir.rel ] +..\..\..\lib\libsysb.lib [ relsysb\_exit.rel ] +..\..\..\lib\libcb.lib [ relcb\readdir.rel ] ..\..\..\lib\libiar.lib [ reliar\SFINDSIGN.rel ] +..\..\..\lib\libcb.lib [ relcb\opendir.rel ] +..\..\..\lib\libcb.lib [ relcb\calloc.rel ] ..\..\..\lib\libcb.lib [ relcb\memset.rel ] diff --git a/src/sh/msh/n.bat b/src/sh/msh/n.bat index 917f65fb..f2bbbdc6 100644 --- a/src/sh/msh/n.bat +++ b/src/sh/msh/n.bat @@ -34,6 +34,24 @@ del sh6.r01 as-z80 -l -o sh6.s01 @if errorlevel 1 goto failure +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ opendir +@if errorlevel 1 goto failure +del opendir.r01 +as-z80 -l -o opendir.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ closedir +@if errorlevel 1 goto failure +del closedir.r01 +as-z80 -l -o closedir.s01 +@if errorlevel 1 goto failure + +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ readdir +@if errorlevel 1 goto failure +del readdir.r01 +as-z80 -l -o readdir.s01 +@if errorlevel 1 goto failure + link-z80 -f msh @if errorlevel 1 goto failure ihex2bin -l msh.i86 ..\..\..\bin\banked\msh diff --git a/src/sh/msh/opendir.c b/src/sh/msh/opendir.c new file mode 100644 index 00000000..4ee4de44 --- /dev/null +++ b/src/sh/msh/opendir.c @@ -0,0 +1,44 @@ +/* opendir.c opendir implementation + * + */ +#include +#include +#include +#include +#include +#include +#include + +/* take some extra arguments, since msh doesn't like sharing its heap */ + +DIR *nick_opendir(char *path, DIR *dir, struct dirent *dd_buf) +{ + struct stat statbuf; + + if (stat(path, &statbuf) != 0) + goto Err; + if ((statbuf.st_mode & S_IFDIR) == 0) { + errno = ENOTDIR; + goto Err; + } +#if 1 + dir->dd_buf = dd_buf; +#else + if ((dir = (DIR *)calloc(1,sizeof(DIR))) == NULL) { + errno = ENOMEM; + goto Err; + } + if ((dir->dd_buf = calloc(1,sizeof(struct dirent))) == NULL) { + free(dir); + errno = ENOMEM; + goto Err; + } +#endif + if ((dir->dd_fd = open(path, O_BINARY)) < 0) { + free(dir->dd_buf); + free(dir); +Err: return NULL; + } + return dir; +} + diff --git a/src/sh/msh/opendir.rel b/src/sh/msh/opendir.rel new file mode 100644 index 00000000..4e22ad9e --- /dev/null +++ b/src/sh/msh/opendir.rel @@ -0,0 +1,77 @@ +XL4 +H 2 areas A global symbols +M opendir +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S free Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S errno Ref00000000 +S ?ENT_AUTO_DIRECT_L09 Ref00000000 +S open Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S stat Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size 95 flags 0 +S nick_opendir Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 E2 FF 21 00 00 39 +R 00 00 01 00 02 05 04 00 +T 09 00 00 00 4D 44 DD 5E 02 DD 56 03 3E +R 00 00 01 00 +T 12 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 17 00 00 00 00 00 00 00 7D B4 28 02 +R 00 00 01 00 02 04 02 00 +T 1D 00 00 00 +R 00 00 01 00 +T 1D 00 00 00 18 68 +R 00 00 01 00 +T 1F 00 00 00 +R 00 00 01 00 +T 1F 00 00 00 DD 7E E6 E6 00 47 DD 7E E7 E6 40 +R 00 00 01 00 +T 2A 00 00 00 B0 20 08 +R 00 00 01 00 +T 2D 00 00 00 +R 00 00 01 00 +T 2D 00 00 00 21 14 00 22 00 00 00 00 18 52 +R 00 00 01 00 02 08 03 00 +T 35 00 00 00 +R 00 00 01 00 +T 35 00 00 00 21 06 00 DD 4E 04 DD 46 05 09 DD +R 00 00 01 00 +T 40 00 00 00 5E 0A DD 56 0B 73 23 72 21 00 80 +R 00 00 01 00 +T 4B 00 00 00 E5 DD 6E 02 DD 66 03 E5 3E +R 00 00 01 00 +T 54 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 05 00 02 09 05 00 +T 59 00 00 00 00 00 00 00 F1 F1 E5 69 60 C1 71 +R 00 00 01 00 02 04 02 00 +T 62 00 00 00 23 70 CB 78 28 24 +R 00 00 01 00 +T 68 00 00 00 +R 00 00 01 00 +T 68 00 00 00 21 06 00 DD 4E 04 DD 46 05 09 5E +R 00 00 01 00 +T 73 00 00 00 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 01 00 +T 78 00 00 00 00 00 00 00 CD 00 00 00 00 59 50 +R 00 00 01 00 02 04 01 00 02 09 02 00 +T 7F 00 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 01 00 02 0A 01 00 +T 85 00 00 00 00 00 00 00 +R 00 00 01 00 02 04 02 00 +T 87 00 00 00 +R 00 00 01 00 +T 87 00 00 00 21 00 00 18 06 +R 00 00 01 00 +T 8C 00 00 00 +R 00 00 01 00 +T 8C 00 00 00 DD 6E 04 DD 66 05 +R 00 00 01 00 +T 92 00 00 00 +R 00 00 01 00 +T 92 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 00 00 diff --git a/src/sh/msh/readdir.c b/src/sh/msh/readdir.c new file mode 100644 index 00000000..e2ff879f --- /dev/null +++ b/src/sh/msh/readdir.c @@ -0,0 +1,33 @@ +/* readdir.c readdir implementation + * + */ +#include +#include +#include +#include +#include +#include +#include + +struct dirent *nick_readdir(DIR *dir) +{ + direct_t direntry; + register struct dirent *buf; + + if (dir == NULL || dir->dd_buf == NULL || dir->dd_fd == 0) { + errno = EFAULT; +Err: return NULL; + } + direntry.d_name[0] = 0; + while (direntry.d_name[0] == 0) + if (read(dir->dd_fd, &direntry, sizeof(direntry)) != sizeof(direntry)) + goto Err; + buf = dir->dd_buf; + buf->d_ino = direntry.d_ino; + buf->d_off = dir->dd_loc++; + strncpy(buf->d_name, (char *)direntry.d_name, DIRNAMELEN); + buf->d_name[DIRNAMELEN] = 0; + buf->d_reclen = strlen(buf->d_name); + return buf; +} + diff --git a/src/sh/msh/readdir.rel b/src/sh/msh/readdir.rel new file mode 100644 index 00000000..c7715320 --- /dev/null +++ b/src/sh/msh/readdir.rel @@ -0,0 +1,95 @@ +XL4 +H 2 areas A global symbols +M readdir +S strncpy Ref00000000 +S ?BANK_LEAVE_DIRECT_L08 Ref00000000 +S strlen Ref00000000 +S ?BANK_CALL_DIRECT_L08 Ref00000000 +S errno Ref00000000 +S ?ENT_AUTO_DIRECT_L09 Ref00000000 +S ?CL64180B_4_06_L00 Ref00000000 +S _read Ref00000000 +S .__.ABS. Def00000000 +A _DEFAULT size 0 flags 0 +A CODE size E3 flags 0 +S nick_readdir Def00000000 +T 00 00 00 00 +R 00 00 01 00 +T 00 00 00 00 CD 00 00 00 00 EE FF DD 7E 02 DD +R 00 00 01 00 02 05 05 00 +T 09 00 00 00 B6 03 28 1A 21 06 00 DD 4E 02 DD +R 00 00 01 00 +T 14 00 00 00 46 03 09 7E 23 B6 28 0B DD 6E 02 +R 00 00 01 00 +T 1F 00 00 00 DD 66 03 7E 23 B6 20 0C +R 00 00 01 00 +T 27 00 00 00 +R 00 00 01 00 +T 27 00 00 00 +R 00 00 01 00 +T 27 00 00 00 +R 00 00 01 00 +T 27 00 00 00 21 0E 00 22 00 00 00 00 +R 00 00 01 00 02 08 04 00 +T 2D 00 00 00 +R 00 00 01 00 +T 2D 00 00 00 21 00 00 C3 E0 00 00 00 +R 00 00 01 00 00 08 01 00 +T 33 00 00 00 +R 00 00 01 00 +T 33 00 00 00 DD 36 F0 00 +R 00 00 01 00 +T 37 00 00 00 +R 00 00 01 00 +T 37 00 00 00 DD 7E F0 B7 20 26 +R 00 00 01 00 +T 3D 00 00 00 +R 00 00 01 00 +T 3D 00 00 00 21 10 00 E5 21 02 00 39 4D 44 DD +R 00 00 01 00 +T 48 00 00 00 6E 02 DD 66 03 5E 23 56 3E +R 00 00 01 00 +T 51 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 07 00 02 09 07 00 +T 56 00 00 00 00 00 00 00 F1 3E 10 AD B4 28 02 +R 00 00 01 00 02 04 03 00 +T 5F 00 00 00 +R 00 00 01 00 +T 5F 00 00 00 18 CC +R 00 00 01 00 +T 61 00 00 00 +R 00 00 01 00 +T 61 00 00 00 18 D4 +R 00 00 01 00 +T 63 00 00 00 +R 00 00 01 00 +T 63 00 00 00 21 06 00 DD 4E 02 DD 46 03 09 56 +R 00 00 01 00 +T 6E 00 00 00 23 66 6A DD 75 FE DD 74 FF DD 5E +R 00 00 01 00 +T 79 00 00 00 EE DD 56 EF 73 23 72 DD 6E FE DD +R 00 00 01 00 +T 84 00 00 00 66 FF 23 23 E5 69 60 23 23 4E 23 +R 00 00 01 00 +T 8F 00 00 00 46 03 70 2B 71 0B E1 71 23 70 21 +R 00 00 01 00 +T 9A 00 00 00 0E 00 E5 21 02 00 39 01 02 00 09 +R 00 00 01 00 +T A5 00 00 00 4D 44 21 06 00 DD 5E FE DD 56 FF +R 00 00 01 00 +T B0 00 00 00 19 EB 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 00 00 +T B5 00 00 00 00 00 00 00 CD 00 00 00 00 F1 21 +R 00 00 01 00 02 04 00 00 02 09 03 00 +T BC 00 00 00 14 00 DD 4E FE DD 46 FF 09 36 00 +R 00 00 01 00 +T C7 00 00 00 21 04 00 09 E5 21 06 00 09 EB 3E +R 00 00 01 00 +T D2 00 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 02 00 02 09 02 00 +T D7 00 00 00 00 00 00 00 EB E1 73 23 72 69 60 +R 00 00 01 00 02 04 03 00 +T E0 00 00 00 +R 00 00 01 00 +T E0 00 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 01 00 diff --git a/src/sh/msh/sh.h b/src/sh/msh/sh.h index c4cf37ec..3d51275f 100644 --- a/src/sh/msh/sh.h +++ b/src/sh/msh/sh.h @@ -2,6 +2,7 @@ #include #include #include +#include /* Nick, for nick_opendir() prototype definition */ /* Need a way to have void used for ANSI, nothing for K&R. */ #ifndef _ANSI @@ -349,6 +350,9 @@ _PROTOTYPE(int readc , (void)); _PROTOTYPE(void unget , (int c )); _PROTOTYPE(void ioecho , (char c )); /* Nick, formerly int c */ _PROTOTYPE(void prs , (char *s )); +#if 1 /* Nick */ +_PROTOTYPE(void prs_expand , (char *p )); +#endif _PROTOTYPE(void sh_putc , (char c )); /* Nick, formerly int c */ _PROTOTYPE(void prn , (unsigned u )); _PROTOTYPE(void closef , (int i )); @@ -398,3 +402,12 @@ Extern int areanum; /* current allocation area */ #define NEW(type) (type *)getcell(sizeof(type)) #define DELETE(obj) freecell((char *)obj) + +/* modifications by Nick for compatibility with uzi libc library */ + +DIR *nick_opendir(char *path, DIR *dir, struct dirent *dd_buf); +int nick_closedir(DIR *dir); +struct dirent *nick_readdir(DIR *dir); + +/* end of modifications by Nick */ + diff --git a/src/sh/msh/sh1.c b/src/sh/msh/sh1.c index 51299f8a..6f920120 100644 --- a/src/sh/msh/sh1.c +++ b/src/sh/msh/sh1.c @@ -181,7 +181,11 @@ register char **argv; for (;;) { if (talking && env.iop <= iostack) +#if 1 /* Nick */ + prs_expand(prompt->value); +#else prs(prompt->value); +#endif onecommand(); } } @@ -848,7 +852,14 @@ unsigned nbytes; register i; if (nbytes == 0) + { +#if 1 /* Nick */ + prs("fatal: getcell() nbytes == 0\n"); + exit(1); +#else abort(); /* silly and defeats the algorithm */ +#endif + } /* * round upwards and add administration area */ @@ -876,7 +887,18 @@ unsigned nbytes; return((char *)NULL); p--; if (p != areatop) + { +#if 1 /* Nick */ + prs("fatal: getcell() p != areatop ("); + prn((int)p); + prs(", "); + prn((int)areatop); + prs(")\n"); + exit(1); +#else abort(); /* allocated areas are contiguous */ +#endif + } q = p + i; p->next = q; p->area = FREE; @@ -893,7 +915,18 @@ found: * split into requested area and rest */ if (areanxt+1 > q) + { +#if 1 /* Nick */ + prs("fatal: getcell() areanxt+1 > q ("); + prn((int)areanxt+1); + prs(", "); + prn((int)q); + prs(")\n"); + exit(1); +#else abort(); /* insufficient space left for admin */ +#endif + } areanxt->next = q; areanxt->area = FREE; p->next = areanxt; diff --git a/src/sh/msh/sh1.rel b/src/sh/msh/sh1.rel index 27e197ae..e9a03bca 100644 --- a/src/sh/msh/sh1.rel +++ b/src/sh/msh/sh1.rel @@ -1,5 +1,5 @@ XL4 -H 6 areas 78 global symbols +H 6 areas 79 global symbols M sh1 S failpt Ref00000000 S environ Ref00000000 @@ -14,6 +14,7 @@ S _write Ref00000000 S ?S_MUL_L02 Ref00000000 S yyparse Ref00000000 S closeall Ref00000000 +S prn Ref00000000 S setjmp Ref00000000 S multiline Ref00000000 S ?BANK_LEAVE_DIRECT_L08 Ref00000000 @@ -26,7 +27,6 @@ S wdlist Ref00000000 S strlen Ref00000000 S shell Ref00000000 S pushio Ref00000000 -S abort Ref00000000 S ?C_V_SWITCH_L06 Ref00000000 S strcmp Ref00000000 S exstat Ref00000000 @@ -55,6 +55,7 @@ S sbrk Ref00000000 S open Ref00000000 S ?US_MOD_L02 Ref00000000 S execute Ref00000000 +S prs_expand Ref00000000 S dolv Ref00000000 S ?CL64180B_4_06_L00 Ref00000000 S trap Ref00000000 @@ -69,14 +70,14 @@ S signal Ref00000000 S filechar Ref00000000 S .__.ABS. Def00000000 A _DEFAULT size 0 flags 0 -A CODE size 1B00 flags 0 -S freecell Def00001988 +A CODE size 1B8C flags 0 +S freecell Def00001A14 S sig Def00000D71 S assign Def00001272 S putn Def00000AE0 S strsave Def00000CEA S any Def00000AAA -S garbage Def00001A73 +S garbage Def00001AFF S err Def00000950 S putvlist Def0000138F S space Def00000CB9 @@ -89,7 +90,7 @@ S letter Def00000C14 S digit Def00000C65 S newenv Def000009A2 S letnum Def00000C8D -S getarea Def00001A63 +S getarea Def00001AEF S xfree Def00000D63 S onintr Def00000BBA S lookup Def00000DEB @@ -100,7 +101,7 @@ S onecommand Def0000075D S isassign Def0000121B S export Def000011E3 S nameval Def00001012 -S setarea Def00001A36 +S setarea Def00001AC2 S main Def00000000 S sh_itoa Def00000AF1 S newfile Def000006E0 @@ -109,10 +110,10 @@ S ronly Def000011F1 S gmatch Def00001510 S eqname Def00001484 S warn Def00000911 -S freearea Def000019D5 +S freearea Def00001A61 S anys Def00000A6D S next Def00000B9C -A CSTR size 8C flags 0 +A CSTR size F1 flags 0 A UDATA0 size 3F flags 0 S flags Def00000004 S inparse Def00000002 @@ -186,7 +187,7 @@ R 00 00 01 00 02 04 28 00 00 09 02 00 T 91 00 00 00 EB 0D 00 00 21 EB 0D 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 96 00 00 00 00 00 00 00 22 00 00 00 00 46 23 -R 00 00 01 00 02 04 24 00 02 09 17 00 +R 00 00 01 00 02 04 24 00 02 09 18 00 T 9D 00 00 00 66 68 ED 4B 04 00 00 00 A7 ED 42 R 00 00 01 00 00 08 04 00 T A6 00 00 00 20 0F @@ -194,7 +195,7 @@ R 00 00 01 00 T A8 00 00 00 R 00 00 01 00 T A8 00 00 00 01 14 00 00 00 ED 5B 00 00 00 00 -R 00 00 01 00 00 05 04 00 02 0B 17 00 +R 00 00 01 00 00 05 04 00 02 0B 18 00 T AF 00 00 00 3E FF 0F 00 00 21 FF 0F 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T B5 00 00 00 00 00 00 00 @@ -202,7 +203,7 @@ R 00 00 01 00 02 04 24 00 T B7 00 00 00 R 00 00 01 00 T B7 00 00 00 ED 5B 00 00 00 00 3E E3 11 00 00 -R 00 00 01 00 02 06 17 00 29 0B 01 00 +R 00 00 01 00 02 06 18 00 29 0B 01 00 T BD 00 00 00 21 E3 11 00 00 CD 00 00 00 00 11 R 00 00 01 00 00 05 01 00 02 0A 24 00 T C4 00 00 00 07 00 00 00 3E EB 0D 00 00 21 @@ -228,9 +229,9 @@ R 00 00 01 00 02 06 27 00 29 0B 01 00 T F3 00 00 00 21 E3 11 00 00 CD 00 00 00 00 01 R 00 00 01 00 00 05 01 00 02 0A 24 00 T FA 00 00 00 05 00 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 3F 00 +R 00 00 01 00 2B 07 40 00 T FF 00 00 00 00 00 00 00 CD 00 00 00 00 EB 3E -R 00 00 01 00 02 04 3F 00 02 09 24 00 +R 00 00 01 00 02 04 40 00 02 09 24 00 T 06 01 00 00 F1 0A 00 00 21 F1 0A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 0B 01 00 00 00 00 00 00 4D 44 11 0E 00 00 00 @@ -334,9 +335,9 @@ R 00 00 01 00 02 04 24 00 T FE 01 00 00 R 00 00 01 00 T FE 01 00 00 DD 36 FC 00 00 00 00 DD 36 FD -R 00 00 01 00 0B 07 41 00 +R 00 00 01 00 0B 07 42 00 T 05 02 00 00 00 00 00 00 DD 36 FE 00 00 00 00 -R 00 00 01 00 8B 04 41 00 2B 0B 41 00 +R 00 00 01 00 8B 04 42 00 2B 0B 42 00 T 0A 02 00 00 AF DD 77 F6 DD 77 F7 DD 6E 04 DD R 00 00 01 00 T 15 02 00 00 66 05 4D 44 03 03 DD 71 04 DD 70 @@ -418,15 +419,15 @@ R 00 00 01 00 T FB 02 00 00 DD 74 05 46 23 66 68 22 R 00 00 01 00 T 03 03 00 00 00 00 00 00 DD 36 FC 00 00 00 00 -R 00 00 01 00 02 04 2E 00 0B 0B 3A 00 +R 00 00 01 00 02 04 2E 00 0B 0B 3B 00 T 09 03 00 00 DD 36 FD 00 00 00 00 DD 36 FE -R 00 00 01 00 8B 07 3A 00 +R 00 00 01 00 8B 07 3B 00 T 10 03 00 00 00 00 00 00 0E 00 00 00 00 C5 21 -R 00 00 01 00 2B 04 3A 00 2B 09 3A 00 +R 00 00 01 00 2B 04 3B 00 2B 09 3B 00 T 15 03 00 00 00 00 00 00 E5 11 00 00 00 00 3E -R 00 00 01 00 02 04 3A 00 02 0A 2E 00 +R 00 00 01 00 02 04 3B 00 02 0A 2E 00 T 1C 03 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 18 00 02 09 18 00 +R 00 00 01 00 2B 04 19 00 02 09 19 00 T 21 03 00 00 00 00 00 00 E1 E1 R 00 00 01 00 02 04 24 00 T 25 03 00 00 @@ -506,7 +507,7 @@ R 00 00 01 00 T AF 03 00 00 R 00 00 01 00 T AF 03 00 00 0E 00 00 00 00 11 00 00 00 00 DD -R 00 00 01 00 2B 05 41 00 02 0A 41 00 +R 00 00 01 00 2B 05 42 00 02 0A 42 00 T B5 03 00 00 7E FE DD 6E FC DD 66 FD B9 20 7F R 00 00 01 00 T C0 03 00 00 ED 52 20 7B DD 4E 02 DD 46 03 0B @@ -548,9 +549,9 @@ R 00 00 01 00 02 04 24 00 T 34 04 00 00 R 00 00 01 00 T 34 04 00 00 11 01 00 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 3B 00 +R 00 00 01 00 2B 08 3C 00 T 3A 04 00 00 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 04 3B 00 02 09 24 00 +R 00 00 01 00 02 04 3C 00 02 09 24 00 T 3F 04 00 00 R 00 00 01 00 T 3F 04 00 00 @@ -570,9 +571,9 @@ R 00 00 01 00 02 08 2E 00 T 5B 04 00 00 E5 DD 6E FC DD 66 FD E5 11 R 00 00 01 00 T 64 04 00 00 00 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 02 04 2E 00 2B 09 18 00 +R 00 00 01 00 02 04 2E 00 2B 09 19 00 T 69 04 00 00 00 00 00 00 CD 00 00 00 00 E1 E1 -R 00 00 01 00 02 04 18 00 02 09 24 00 +R 00 00 01 00 02 04 19 00 02 09 24 00 T 70 04 00 00 11 00 00 3E 00 00 00 00 21 R 00 00 01 00 2B 08 1F 00 T 76 04 00 00 00 00 00 00 CD 00 00 00 00 7D B4 @@ -600,7 +601,7 @@ R 00 00 01 00 00 05 04 00 00 0B 04 00 T A4 04 00 00 06 00 C5 E5 11 03 00 3E R 00 00 01 00 T AC 04 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 40 00 02 09 40 00 +R 00 00 01 00 2B 04 41 00 02 09 41 00 T B1 04 00 00 00 00 00 00 F1 F1 DD 7E F8 DD B6 R 00 00 01 00 02 04 24 00 T BA 04 00 00 F9 28 78 DD 6E F8 DD 66 F9 7E FE @@ -626,9 +627,9 @@ R 00 00 01 00 T EB 04 00 00 R 00 00 01 00 T EB 04 00 00 DD 5E F2 DD 56 F3 3E 00 00 00 00 -R 00 00 01 00 2B 0B 12 00 +R 00 00 01 00 2B 0B 13 00 T F3 04 00 00 21 00 00 00 00 CD 00 00 00 00 EB -R 00 00 01 00 02 05 12 00 02 0A 24 00 +R 00 00 01 00 02 05 13 00 02 0A 24 00 T FA 04 00 00 3E 9C 0B 00 00 21 9C 0B 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 00 05 00 00 00 00 00 00 @@ -646,9 +647,9 @@ R 00 00 01 00 T 1E 05 00 00 R 00 00 01 00 T 1E 05 00 00 DD 5E F2 DD 56 F3 3E 00 00 00 00 -R 00 00 01 00 2B 0B 12 00 +R 00 00 01 00 2B 0B 13 00 T 26 05 00 00 21 00 00 00 00 CD 00 00 00 00 EB -R 00 00 01 00 02 05 12 00 02 0A 24 00 +R 00 00 01 00 02 05 13 00 02 0A 24 00 T 2D 05 00 00 3E 9C 0B 00 00 21 9C 0B 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 33 05 00 00 00 00 00 00 @@ -666,7 +667,7 @@ R 00 00 01 00 00 07 01 00 T 42 05 00 00 71 0D 00 00 C5 E5 11 0C 00 3E R 00 00 01 00 29 04 01 00 T 49 05 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 40 00 02 09 40 00 +R 00 00 01 00 2B 04 41 00 02 09 41 00 T 4E 05 00 00 00 00 00 00 F1 F1 R 00 00 01 00 02 04 24 00 T 52 05 00 00 @@ -674,7 +675,7 @@ R 00 00 01 00 T 52 05 00 00 21 00 00 E5 21 01 00 E5 11 02 00 R 00 00 01 00 T 5D 05 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 40 00 02 0A 40 00 +R 00 00 01 00 2B 05 41 00 02 0A 41 00 T 63 05 00 00 00 00 00 00 F1 F1 3E 01 AD B4 B1 R 00 00 01 00 02 04 24 00 T 6C 05 00 00 B0 28 16 @@ -686,13 +687,13 @@ R 00 00 01 00 00 07 01 00 T 75 05 00 00 BA 0B 00 00 C5 E5 11 02 00 3E R 00 00 01 00 29 04 01 00 T 7C 05 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 40 00 02 09 40 00 +R 00 00 01 00 2B 04 41 00 02 09 41 00 T 81 05 00 00 00 00 00 00 F1 F1 R 00 00 01 00 02 04 24 00 T 85 05 00 00 R 00 00 01 00 T 85 05 00 00 DD 6E 04 DD 66 05 22 00 00 00 00 -R 00 00 01 00 02 0B 36 00 +R 00 00 01 00 02 0B 37 00 T 8E 05 00 00 DD 4E 02 DD 46 03 ED 43 R 00 00 01 00 T 96 05 00 00 00 00 00 00 DD 5E F8 DD 56 F9 73 @@ -788,7 +789,7 @@ R 00 00 01 00 T 65 06 00 00 2A 00 00 00 00 5E 23 56 3E R 00 00 01 00 02 05 21 00 T 6C 06 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 13 00 02 09 13 00 +R 00 00 01 00 2B 04 36 00 02 09 36 00 T 71 06 00 00 00 00 00 00 R 00 00 01 00 02 04 24 00 T 73 06 00 00 @@ -836,7 +837,7 @@ R 00 00 01 00 02 04 24 00 29 0A 01 00 T D8 06 00 00 FF 0F 00 00 CD 00 00 00 00 C3 R 00 00 01 00 00 04 01 00 02 09 24 00 T DE 06 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 +R 00 00 01 00 02 04 10 00 T E0 06 00 00 R 00 00 01 00 T E0 06 00 00 CD 00 00 00 00 FE FF 01 @@ -860,9 +861,9 @@ R 00 00 01 00 T 19 07 00 00 R 00 00 01 00 T 19 07 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 -R 00 00 01 00 2B 0B 13 00 +R 00 00 01 00 2B 0B 14 00 T 21 07 00 00 21 00 00 00 00 CD 00 00 00 00 11 -R 00 00 01 00 02 05 13 00 02 0A 24 00 +R 00 00 01 00 02 05 14 00 02 0A 24 00 T 28 07 00 00 48 00 00 00 3E 50 09 00 00 21 R 00 00 01 00 00 04 02 00 29 09 01 00 T 2D 07 00 00 50 09 00 00 CD 00 00 00 00 21 @@ -880,9 +881,9 @@ R 00 00 01 00 T 40 07 00 00 R 00 00 01 00 T 40 07 00 00 DD 5E FE DD 56 FF 3E 00 00 00 00 -R 00 00 01 00 2B 0B 12 00 +R 00 00 01 00 2B 0B 13 00 T 48 07 00 00 21 00 00 00 00 CD 00 00 00 00 EB -R 00 00 01 00 02 05 12 00 02 0A 24 00 +R 00 00 01 00 02 05 13 00 02 0A 24 00 T 4F 07 00 00 3E 9C 0B 00 00 21 9C 0B 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 55 07 00 00 00 00 00 00 21 00 00 @@ -890,7 +891,7 @@ R 00 00 01 00 02 04 24 00 T 5A 07 00 00 R 00 00 01 00 T 5A 07 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 5D 07 00 00 R 00 00 01 00 T 5D 07 00 00 CD 00 00 00 00 F2 FF @@ -915,16 +916,16 @@ T 7B 07 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 06 00 02 09 06 00 T 80 07 00 00 00 00 00 00 ED 5B 00 00 00 00 3E R 00 00 01 00 02 04 24 00 02 0A 28 00 -T 87 07 00 00 D5 19 00 00 21 D5 19 00 00 CD +T 87 07 00 00 61 1A 00 00 21 61 1A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T 8C 07 00 00 00 00 00 00 3E 73 1A 00 00 21 +T 8C 07 00 00 00 00 00 00 3E FF 1A 00 00 21 R 00 00 01 00 02 04 24 00 29 09 01 00 -T 91 07 00 00 73 1A 00 00 CD 00 00 00 00 21 +T 91 07 00 00 FF 1A 00 00 CD 00 00 00 00 21 R 00 00 01 00 00 04 01 00 02 09 24 00 T 97 07 00 00 00 00 22 00 00 00 00 21 00 00 22 -R 00 00 01 00 02 07 15 00 +R 00 00 01 00 02 07 16 00 T A0 07 00 00 00 00 00 00 21 00 00 22 -R 00 00 01 00 02 04 10 00 +R 00 00 01 00 02 04 11 00 T A6 07 00 00 0E 00 00 00 21 00 00 00 00 22 R 00 00 01 00 00 04 04 00 02 09 26 00 T AC 07 00 00 08 00 00 00 21 00 00 22 @@ -932,7 +933,7 @@ R 00 00 01 00 00 04 04 00 T B2 07 00 00 00 00 00 00 21 00 00 22 R 00 00 01 00 02 04 1E 00 T B8 07 00 00 00 00 00 00 21 01 00 22 -R 00 00 01 00 02 04 0E 00 +R 00 00 01 00 02 04 0F 00 T BE 07 00 00 02 00 00 00 21 00 00 22 R 00 00 01 00 00 04 03 00 T C4 07 00 00 00 00 00 00 21 00 00 22 @@ -940,13 +941,13 @@ R 00 00 01 00 00 04 03 00 T CA 07 00 00 00 00 00 00 21 02 00 39 22 R 00 00 01 00 02 04 20 00 T D1 07 00 00 00 00 00 00 EB 3E 00 00 00 00 21 -R 00 00 01 00 02 04 00 00 2B 0A 0D 00 +R 00 00 01 00 02 04 00 00 2B 0A 0E 00 T D7 07 00 00 00 00 00 00 CD 00 00 00 00 21 -R 00 00 01 00 02 04 0D 00 02 09 24 00 +R 00 00 01 00 02 04 0E 00 02 09 24 00 T DD 07 00 00 02 00 39 22 00 00 00 00 EB 3E R 00 00 01 00 02 08 00 00 T E5 07 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0D 00 02 09 0D 00 +R 00 00 01 00 2B 04 0E 00 02 09 0E 00 T EA 07 00 00 00 00 00 00 7D B4 20 13 3E R 00 00 01 00 02 04 24 00 T F1 07 00 00 00 00 00 00 21 00 00 00 00 CD @@ -974,7 +975,7 @@ R 00 00 01 00 02 04 24 00 T 14 08 00 00 R 00 00 01 00 T 14 08 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 3E 00 02 0A 3E 00 +R 00 00 01 00 2B 05 3F 00 02 0A 3F 00 T 1A 08 00 00 00 00 00 00 2A 00 00 00 00 7D B4 R 00 00 01 00 02 04 24 00 02 09 29 00 T 21 08 00 00 20 0F 2A 00 00 00 00 7D B4 28 08 @@ -1000,7 +1001,7 @@ R 00 00 01 00 T 40 08 00 00 21 00 00 22 02 00 00 00 21 00 00 R 00 00 01 00 00 08 03 00 T 49 08 00 00 22 00 00 00 00 21 00 00 22 -R 00 00 01 00 02 05 3C 00 +R 00 00 01 00 02 05 3D 00 T 50 08 00 00 00 00 00 00 21 00 00 22 R 00 00 01 00 00 04 03 00 T 56 08 00 00 00 00 00 00 21 6E 00 ED 4B @@ -1054,13 +1055,13 @@ R 00 00 01 00 T BA 08 00 00 R 00 00 01 00 T BA 08 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T BD 08 00 00 R 00 00 01 00 T BD 08 00 00 C5 D5 01 01 00 ED 5B 00 00 00 00 R 00 00 01 00 02 0B 00 00 T C6 08 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 39 00 02 0A 39 00 +R 00 00 01 00 2B 05 3A 00 02 0A 3A 00 T CC 08 00 00 00 00 00 00 D1 C1 C3 00 00 00 00 R 00 00 01 00 02 04 24 00 02 0B 07 00 T D3 08 00 00 @@ -1076,7 +1077,7 @@ R 00 00 01 00 02 04 24 00 T E3 08 00 00 R 00 00 01 00 T E3 08 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 3E 00 02 0A 3E 00 +R 00 00 01 00 2B 05 3F 00 02 0A 3F 00 T E9 08 00 00 00 00 00 00 11 01 00 3E R 00 00 01 00 02 04 24 00 T EF 08 00 00 00 00 00 00 21 00 00 00 00 CD @@ -1088,7 +1089,7 @@ R 00 00 01 00 29 04 01 00 00 09 01 00 T FF 08 00 00 00 00 00 00 ED 5B 00 00 00 00 3E R 00 00 01 00 02 04 24 00 02 0A 1C 00 T 06 09 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 3B 00 02 09 3B 00 +R 00 00 01 00 2B 04 3C 00 02 09 3C 00 T 0B 09 00 00 00 00 00 00 D1 C3 00 00 00 00 R 00 00 01 00 02 04 24 00 02 0A 07 00 T 11 09 00 00 @@ -1098,17 +1099,17 @@ R 00 00 01 00 02 05 23 00 T 1A 09 00 00 R 00 00 01 00 T 1A 09 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 -R 00 00 01 00 2B 0B 13 00 +R 00 00 01 00 2B 0B 14 00 T 22 09 00 00 21 00 00 00 00 CD 00 00 00 00 21 -R 00 00 01 00 02 05 13 00 02 0A 24 00 +R 00 00 01 00 02 05 14 00 02 0A 24 00 T 29 09 00 00 FF FF 22 00 00 00 00 R 00 00 01 00 02 07 1C 00 T 2E 09 00 00 R 00 00 01 00 T 2E 09 00 00 11 56 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 05 02 00 2B 0A 13 00 +R 00 00 01 00 00 05 02 00 2B 0A 14 00 T 34 09 00 00 00 00 00 00 CD 00 00 00 00 21 -R 00 00 01 00 02 04 13 00 02 09 24 00 +R 00 00 01 00 02 04 14 00 02 09 24 00 T 3A 09 00 00 65 00 ED 4B 00 00 00 00 09 7E B7 R 00 00 01 00 00 08 04 00 T 43 09 00 00 28 08 @@ -1122,7 +1123,7 @@ R 00 00 01 00 02 04 24 00 T 4D 09 00 00 R 00 00 01 00 T 4D 09 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 50 09 00 00 R 00 00 01 00 T 50 09 00 00 CD 00 00 00 00 3E 11 09 00 00 21 @@ -1156,7 +1157,7 @@ R 00 00 01 00 T 7F 09 00 00 01 01 00 ED 5B 0E 00 00 00 3E R 00 00 01 00 00 09 04 00 T 87 09 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 39 00 02 09 39 00 +R 00 00 01 00 2B 04 3A 00 02 09 3A 00 T 8C 09 00 00 00 00 00 00 R 00 00 01 00 02 04 24 00 T 8E 09 00 00 @@ -1170,7 +1171,7 @@ R 00 00 01 00 00 04 04 00 00 09 04 00 T 9F 09 00 00 R 00 00 01 00 T 9F 09 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T A2 09 00 00 R 00 00 01 00 T A2 09 00 00 CD 00 00 00 00 FE FF DD 7E 02 DD @@ -1222,7 +1223,7 @@ R 00 00 01 00 00 04 04 00 T 0A 0A 00 00 R 00 00 01 00 T 0A 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 0D 0A 00 00 R 00 00 01 00 T 0D 0A 00 00 CD 00 00 00 00 FC FF 2A @@ -1239,7 +1240,7 @@ T 28 0A 00 00 11 08 00 00 00 DD 6E FC DD 66 FD R 00 00 01 00 00 05 04 00 T 31 0A 00 00 01 0C 00 ED B0 DD 5E FC DD 56 FD R 00 00 01 00 -T 3C 0A 00 00 3E 88 19 00 00 21 88 19 00 00 CD +T 3C 0A 00 00 3E 14 1A 00 00 21 14 1A 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 42 0A 00 00 00 00 00 00 R 00 00 01 00 02 04 24 00 @@ -1254,9 +1255,9 @@ R 00 00 01 00 02 04 30 00 T 5A 0A 00 00 R 00 00 01 00 T 5A 0A 00 00 DD 5E FE DD 56 FF 3E 00 00 00 00 -R 00 00 01 00 2B 0B 14 00 +R 00 00 01 00 2B 0B 15 00 T 62 0A 00 00 21 00 00 00 00 CD 00 00 00 00 18 -R 00 00 01 00 02 05 14 00 02 0A 24 00 +R 00 00 01 00 02 05 15 00 02 0A 24 00 T 69 0A 00 00 DA R 00 00 01 00 T 6A 0A 00 00 @@ -1264,7 +1265,7 @@ R 00 00 01 00 T 6A 0A 00 00 R 00 00 01 00 T 6A 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 6D 0A 00 00 R 00 00 01 00 T 6D 0A 00 00 CD 00 00 00 00 @@ -1300,7 +1301,7 @@ R 00 00 01 00 T A7 0A 00 00 R 00 00 01 00 T A7 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T AA 0A 00 00 R 00 00 01 00 T AA 0A 00 00 CD 00 00 00 00 @@ -1334,7 +1335,7 @@ R 00 00 01 00 T DD 0A 00 00 R 00 00 01 00 T DD 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T E0 0A 00 00 R 00 00 01 00 T E0 0A 00 00 CD 00 00 00 00 01 FF FF 3E @@ -1342,7 +1343,7 @@ R 00 00 01 00 02 05 23 00 T E7 0A 00 00 F1 0A 00 00 21 F1 0A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T EC 0A 00 00 00 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 04 24 00 02 09 0F 00 +R 00 00 01 00 02 04 24 00 02 09 10 00 T F1 0A 00 00 R 00 00 01 00 T F1 0A 00 00 CD 00 00 00 00 FC FF AF DD 77 FE @@ -1402,19 +1403,19 @@ R 00 00 01 00 T 93 0B 00 00 R 00 00 01 00 T 93 0B 00 00 DD 6E FC DD 66 FD C3 00 00 00 00 -R 00 00 01 00 02 0B 0F 00 +R 00 00 01 00 02 0B 10 00 T 9C 0B 00 00 R 00 00 01 00 T 9C 0B 00 00 CD 00 00 00 00 ED 53 04 00 00 00 R 00 00 01 00 02 05 23 00 02 0B 2E 00 T A3 0B 00 00 0E 00 00 00 00 C5 21 00 00 00 00 -R 00 00 01 00 2B 05 41 00 02 0B 41 00 +R 00 00 01 00 2B 05 42 00 02 0B 42 00 T A9 0B 00 00 E5 11 00 00 00 00 3E 00 00 00 00 -R 00 00 01 00 02 06 2E 00 2B 0B 18 00 +R 00 00 01 00 02 06 2E 00 2B 0B 19 00 T AF 0B 00 00 21 00 00 00 00 CD 00 00 00 00 E1 -R 00 00 01 00 02 05 18 00 02 0A 24 00 +R 00 00 01 00 02 05 19 00 02 0A 24 00 T B6 0B 00 00 E1 C3 00 00 00 00 -R 00 00 01 00 02 06 0F 00 +R 00 00 01 00 02 06 10 00 T BA 0B 00 00 R 00 00 01 00 T BA 0B 00 00 CD 00 00 00 00 06 00 21 @@ -1422,9 +1423,9 @@ R 00 00 01 00 02 05 23 00 T C0 0B 00 00 BA 0B 00 00 0E BA 0B 00 00 C5 E5 R 00 00 01 00 00 04 01 00 29 09 01 00 T C6 0B 00 00 11 02 00 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 40 00 +R 00 00 01 00 2B 08 41 00 T CC 0B 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 -R 00 00 01 00 02 04 40 00 02 09 24 00 +R 00 00 01 00 02 04 41 00 02 09 24 00 T D3 0B 00 00 21 01 00 22 00 00 00 00 2A R 00 00 01 00 00 08 03 00 T DA 0B 00 00 00 00 00 00 7D B4 28 1C @@ -1436,9 +1437,9 @@ R 00 00 01 00 00 05 03 00 T E7 0B 00 00 R 00 00 01 00 T E7 0B 00 00 11 56 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 05 02 00 2B 0A 13 00 +R 00 00 01 00 00 05 02 00 2B 0A 14 00 T ED 0B 00 00 00 00 00 00 CD 00 00 00 00 3E -R 00 00 01 00 02 04 13 00 02 09 24 00 +R 00 00 01 00 02 04 14 00 02 09 24 00 T F3 0B 00 00 BD 08 00 00 21 BD 08 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T F8 0B 00 00 00 00 00 00 @@ -1464,7 +1465,7 @@ R 00 00 01 00 T 11 0C 00 00 R 00 00 01 00 T 11 0C 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 14 0C 00 00 R 00 00 01 00 T 14 0C 00 00 CD 00 00 00 00 01 61 80 EB 3E 80 @@ -1494,7 +1495,7 @@ R 00 00 01 00 T 62 0C 00 00 R 00 00 01 00 T 62 0C 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 65 0C 00 00 R 00 00 01 00 T 65 0C 00 00 CD 00 00 00 00 01 30 80 EB 3E 80 @@ -1512,7 +1513,7 @@ R 00 00 01 00 T 8A 0C 00 00 R 00 00 01 00 T 8A 0C 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 8D 0C 00 00 R 00 00 01 00 T 8D 0C 00 00 CD 00 00 00 00 3E 14 0C 00 00 21 @@ -1534,7 +1535,7 @@ R 00 00 01 00 T B6 0C 00 00 R 00 00 01 00 T B6 0C 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T B9 0C 00 00 R 00 00 01 00 T B9 0C 00 00 CD 00 00 00 00 FE FF DD 5E 02 DD @@ -1554,15 +1555,15 @@ R 00 00 01 00 00 04 01 00 02 09 24 00 T E1 0C 00 00 R 00 00 01 00 T E1 0C 00 00 DD 6E FE DD 66 FF C3 00 00 00 00 -R 00 00 01 00 02 0B 0F 00 +R 00 00 01 00 02 0B 10 00 T EA 0C 00 00 R 00 00 01 00 T EA 0C 00 00 CD 00 00 00 00 FC FF DD 5E 02 DD R 00 00 01 00 02 05 2A 00 T F3 0C 00 00 56 03 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 16 00 +R 00 00 01 00 2B 07 17 00 T F8 0C 00 00 00 00 00 00 CD 00 00 00 00 EB 13 -R 00 00 01 00 02 04 16 00 02 09 24 00 +R 00 00 01 00 02 04 17 00 02 09 24 00 T FF 0C 00 00 3E B9 0C 00 00 21 B9 0C 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 05 0D 00 00 00 00 00 00 DD 75 FC DD 74 FD 7D @@ -1573,7 +1574,7 @@ T 11 0D 00 00 R 00 00 01 00 T 11 0D 00 00 DD 4E 04 DD 46 05 DD 5E FC DD 56 R 00 00 01 00 -T 1C 0D 00 00 FD 3E 36 1A 00 00 21 36 1A 00 00 +T 1C 0D 00 00 FD 3E C2 1A 00 00 21 C2 1A 00 00 R 00 00 01 00 29 06 01 00 00 0B 01 00 T 22 0D 00 00 CD 00 00 00 00 DD 6E FC DD 66 FD R 00 00 01 00 02 05 24 00 @@ -1604,15 +1605,15 @@ R 00 00 01 00 00 05 02 00 T 60 0D 00 00 R 00 00 01 00 T 60 0D 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 63 0D 00 00 R 00 00 01 00 -T 63 0D 00 00 CD 00 00 00 00 3E 88 19 00 00 21 +T 63 0D 00 00 CD 00 00 00 00 3E 14 1A 00 00 21 R 00 00 01 00 02 05 23 00 29 0A 01 00 -T 69 0D 00 00 88 19 00 00 CD 00 00 00 00 C3 +T 69 0D 00 00 14 1A 00 00 CD 00 00 00 00 C3 R 00 00 01 00 00 04 01 00 02 09 24 00 T 6F 0D 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 +R 00 00 01 00 02 04 10 00 T 71 0D 00 00 R 00 00 01 00 T 71 0D 00 00 CD 00 00 00 00 ED 53 00 00 00 00 @@ -1622,17 +1623,17 @@ R 00 00 01 00 00 07 01 00 T 7E 0D 00 00 71 0D 00 00 C5 E5 DD 5E 02 DD 56 R 00 00 01 00 29 04 01 00 T 86 0D 00 00 03 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 40 00 02 0B 40 00 +R 00 00 01 00 2B 06 41 00 02 0B 41 00 T 8C 0D 00 00 CD 00 00 00 00 F1 F1 C3 R 00 00 01 00 02 05 24 00 T 92 0D 00 00 00 00 00 00 -R 00 00 01 00 02 04 0F 00 +R 00 00 01 00 02 04 10 00 T 94 0D 00 00 R 00 00 01 00 T 94 0D 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD R 00 00 01 00 02 05 2A 00 T 9D 0D 00 00 66 03 29 01 00 00 00 00 09 46 23 -R 00 00 01 00 02 08 38 00 +R 00 00 01 00 02 08 39 00 T A6 0D 00 00 66 68 DD 75 FE DD 74 FF 7D B4 20 R 00 00 01 00 T B1 0D 00 00 02 @@ -1650,23 +1651,23 @@ R 00 00 01 00 T BC 0D 00 00 DD 6E 02 DD 66 03 29 01 R 00 00 01 00 T C4 0D 00 00 00 00 00 00 09 AF 77 23 77 -R 00 00 01 00 02 04 38 00 +R 00 00 01 00 02 04 39 00 T CB 0D 00 00 R 00 00 01 00 T CB 0D 00 00 DD 6E FE DD 66 FF 22 00 00 00 00 R 00 00 01 00 02 0B 2E 00 T D4 0D 00 00 0E 00 00 00 00 C5 21 00 00 00 00 -R 00 00 01 00 2B 05 3A 00 02 0B 3A 00 +R 00 00 01 00 2B 05 3B 00 02 0B 3B 00 T DA 0D 00 00 E5 11 00 00 00 00 3E 00 00 00 00 -R 00 00 01 00 02 06 2E 00 2B 0B 11 00 +R 00 00 01 00 02 06 2E 00 2B 0B 12 00 T E0 0D 00 00 21 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 02 05 11 00 02 0A 24 00 +R 00 00 01 00 02 05 12 00 02 0A 24 00 T E7 0D 00 00 F1 R 00 00 01 00 T E8 0D 00 00 R 00 00 01 00 T E8 0D 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T EB 0D 00 00 R 00 00 01 00 T EB 0D 00 00 CD 00 00 00 00 FA FF DD 6E 02 DD @@ -1724,7 +1725,7 @@ R 00 00 01 00 02 07 22 00 T 79 0E 00 00 00 00 00 00 38 0E 69 60 29 ED 4B R 00 00 01 00 02 04 30 00 T 82 0E 00 00 00 00 00 00 09 46 23 66 68 18 03 -R 00 00 01 00 02 04 36 00 +R 00 00 01 00 02 04 37 00 T 8B 0E 00 00 R 00 00 01 00 T 8B 0E 00 00 2A 04 00 00 00 @@ -1839,15 +1840,15 @@ T 97 0F 00 00 DD 6E FC DD 66 FD 23 DD 75 FC DD R 00 00 01 00 T A2 0F 00 00 74 FD 36 00 01 00 00 DD 5E FA DD R 00 00 01 00 -T AD 0F 00 00 56 FB 3E 36 1A 00 00 21 +T AD 0F 00 00 56 FB 3E C2 1A 00 00 21 R 00 00 01 00 29 07 01 00 -T B2 0F 00 00 36 1A 00 00 CD 00 00 00 00 01 +T B2 0F 00 00 C2 1A 00 00 CD 00 00 00 00 01 R 00 00 01 00 00 04 01 00 02 09 24 00 T B8 0F 00 00 00 00 DD 6E FA DD 66 FB 23 23 5E R 00 00 01 00 -T C3 0F 00 00 23 56 3E 36 1A 00 00 21 +T C3 0F 00 00 23 56 3E C2 1A 00 00 21 R 00 00 01 00 29 07 01 00 -T C8 0F 00 00 36 1A 00 00 CD 00 00 00 00 2A +T C8 0F 00 00 C2 1A 00 00 CD 00 00 00 00 2A R 00 00 01 00 00 04 01 00 02 09 24 00 T CE 0F 00 00 04 00 00 00 E5 DD 6E FA DD 66 FB R 00 00 01 00 00 04 04 00 @@ -1862,7 +1863,7 @@ R 00 00 01 00 02 04 31 00 T FC 0F 00 00 R 00 00 01 00 T FC 0F 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T FF 0F 00 00 R 00 00 01 00 T FF 0F 00 00 CD 00 00 00 00 21 00 00 E5 3E @@ -1870,7 +1871,7 @@ R 00 00 01 00 02 05 23 00 T 07 10 00 00 12 10 00 00 21 12 10 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 0C 10 00 00 00 00 00 00 E1 C3 00 00 00 00 -R 00 00 01 00 02 04 24 00 02 0A 0F 00 +R 00 00 01 00 02 04 24 00 02 0A 10 00 T 12 10 00 00 R 00 00 01 00 T 12 10 00 00 CD 00 00 00 00 F8 FF 21 06 00 DD @@ -1898,9 +1899,9 @@ R 00 00 01 00 T 4D 10 00 00 DD 6E FA DD 66 FB 23 DD 75 FA DD R 00 00 01 00 T 58 10 00 00 74 FB 2B 5E 16 00 3E 00 00 00 00 -R 00 00 01 00 2B 0B 3D 00 +R 00 00 01 00 2B 0B 3E 00 T 60 10 00 00 21 00 00 00 00 CD 00 00 00 00 18 -R 00 00 01 00 02 05 3D 00 02 0A 24 00 +R 00 00 01 00 02 05 3E 00 02 0A 24 00 T 67 10 00 00 D0 R 00 00 01 00 T 68 10 00 00 @@ -1922,11 +1923,11 @@ R 00 00 01 00 T 86 10 00 00 DD 6E 02 DD 66 03 23 23 5E 23 56 R 00 00 01 00 T 91 10 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 16 00 02 0A 16 00 +R 00 00 01 00 2B 05 17 00 02 0A 17 00 T 97 10 00 00 00 00 00 00 E5 DD 5E 04 DD 56 05 R 00 00 01 00 02 04 24 00 T A0 10 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 16 00 02 0A 16 00 +R 00 00 01 00 2B 05 17 00 02 0A 17 00 T A6 10 00 00 00 00 00 00 4D 44 E1 09 EB 13 13 R 00 00 01 00 02 04 24 00 T AF 10 00 00 3E B9 0C 00 00 21 B9 0C 00 00 CD @@ -1943,7 +1944,7 @@ T C4 10 00 00 R 00 00 01 00 T C4 10 00 00 01 00 00 DD 5E FA DD 56 FB 3E R 00 00 01 00 -T CE 10 00 00 36 1A 00 00 21 36 1A 00 00 CD +T CE 10 00 00 C2 1A 00 00 21 C2 1A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T D3 10 00 00 00 00 00 00 DD 6E FA DD 66 FB DD R 00 00 01 00 02 04 24 00 @@ -2042,13 +2043,13 @@ R 00 00 01 00 T E0 11 00 00 R 00 00 01 00 T E0 11 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T E3 11 00 00 R 00 00 01 00 T E3 11 00 00 CD 00 00 00 00 21 06 00 19 7E F6 R 00 00 01 00 02 05 23 00 T EC 11 00 00 02 77 C3 00 00 00 00 -R 00 00 01 00 02 07 0F 00 +R 00 00 01 00 02 07 10 00 T F1 11 00 00 R 00 00 01 00 T F1 11 00 00 CD 00 00 00 00 13 13 EB 7E 23 66 @@ -2068,7 +2069,7 @@ R 00 00 01 00 T 18 12 00 00 R 00 00 01 00 T 18 12 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 1B 12 00 00 R 00 00 01 00 T 1B 12 00 00 CD 00 00 00 00 1A 5F 16 00 3E @@ -2120,7 +2121,7 @@ R 00 00 01 00 T 6F 12 00 00 R 00 00 01 00 T 6F 12 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 72 12 00 00 R 00 00 01 00 T 72 12 00 00 CD 00 00 00 00 FC FF DD 6E 02 DD @@ -2210,7 +2211,7 @@ R 00 00 01 00 T 38 13 00 00 R 00 00 01 00 T 38 13 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 3B 13 00 00 R 00 00 01 00 T 3B 13 00 00 CD 00 00 00 00 13 DD 73 02 DD 72 @@ -2256,7 +2257,7 @@ R 00 00 01 00 T 8C 13 00 00 R 00 00 01 00 T 8C 13 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 8F 13 00 00 R 00 00 01 00 T 8F 13 00 00 CD 00 00 00 00 FE FF 2A @@ -2344,7 +2345,7 @@ R 00 00 01 00 00 04 01 00 T 81 14 00 00 R 00 00 01 00 T 81 14 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 84 14 00 00 R 00 00 01 00 T 84 14 00 00 CD 00 00 00 00 @@ -2398,7 +2399,7 @@ R 00 00 01 00 T E2 14 00 00 R 00 00 01 00 T E2 14 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T E5 14 00 00 R 00 00 01 00 T E5 14 00 00 CD 00 00 00 00 @@ -2562,7 +2563,7 @@ R 00 00 01 00 T 2A 16 00 00 R 00 00 01 00 T 2A 16 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +R 00 00 01 00 02 05 10 00 T 2D 16 00 00 R 00 00 01 00 T 2D 16 00 00 CD 00 00 00 00 F8 FF DD 6E 02 DD @@ -2731,338 +2732,384 @@ T 94 17 00 00 R 00 00 01 00 T 94 17 00 00 CD 00 00 00 00 F8 FF DD 7E 02 DD R 00 00 01 00 02 05 2A 00 -T 9D 17 00 00 B6 03 20 08 +T 9D 17 00 00 B6 03 20 16 R 00 00 01 00 T A1 17 00 00 R 00 00 01 00 -T A1 17 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 19 00 02 0A 19 00 -T A7 17 00 00 00 00 00 00 -R 00 00 01 00 02 04 24 00 -T A9 17 00 00 +T A1 17 00 00 11 8C 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 02 00 2B 0A 14 00 +T A7 17 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 14 00 02 09 24 00 +T AD 17 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 3C 00 +T B2 17 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 3C 00 02 09 24 00 +T B7 17 00 00 R 00 00 01 00 -T A9 17 00 00 DD 6E 02 DD 66 03 23 23 23 CB 3C +T B7 17 00 00 DD 6E 02 DD 66 03 23 23 23 CB 3C R 00 00 01 00 -T B4 17 00 00 CB 1D CB 3C CB 1D 23 DD 75 F8 DD +T C2 17 00 00 CB 1D CB 3C CB 1D 23 DD 75 F8 DD R 00 00 01 00 -T BF 17 00 00 74 F9 2A 3D 00 00 00 DD 75 FA DD +T CD 17 00 00 74 F9 2A 3D 00 00 00 DD 75 FA DD R 00 00 01 00 00 07 03 00 -T C8 17 00 00 74 FB +T D6 17 00 00 74 FB R 00 00 01 00 -T CA 17 00 00 +T D8 17 00 00 R 00 00 01 00 -T CA 17 00 00 DD 6E FA DD 66 FB 23 23 4E 23 46 +T D8 17 00 00 DD 6E FA DD 66 FB 23 23 4E 23 46 R 00 00 01 00 -T D5 17 00 00 2A 00 00 00 00 CD 00 00 00 00 30 +T E3 17 00 00 2A 00 00 00 00 CD 00 00 00 00 30 R 00 00 01 00 02 05 28 00 02 0A 30 00 -T DC 17 00 00 61 +T EA 17 00 00 61 R 00 00 01 00 -T DD 17 00 00 +T EB 17 00 00 R 00 00 01 00 -T DD 17 00 00 +T EB 17 00 00 R 00 00 01 00 -T DD 17 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD +T EB 17 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD R 00 00 01 00 -T E8 17 00 00 75 FC DD 74 FD 23 23 4E 23 46 2A +T F6 17 00 00 75 FC DD 74 FD 23 23 4E 23 46 2A R 00 00 01 00 -T F3 17 00 00 00 00 00 00 CD 00 00 00 00 30 25 +T 01 18 00 00 00 00 00 00 CD 00 00 00 00 30 25 R 00 00 01 00 02 04 28 00 02 09 30 00 -T FA 17 00 00 2A 3D 00 00 00 DD 4E FC DD 46 FD +T 08 18 00 00 2A 3D 00 00 00 DD 4E FC DD 46 FD R 00 00 01 00 00 05 03 00 -T 03 18 00 00 A7 ED 42 28 17 +T 11 18 00 00 A7 ED 42 28 17 R 00 00 01 00 -T 08 18 00 00 +T 16 18 00 00 R 00 00 01 00 -T 08 18 00 00 +T 16 18 00 00 R 00 00 01 00 -T 08 18 00 00 +T 16 18 00 00 R 00 00 01 00 -T 08 18 00 00 DD 6E FC DD 66 FD 46 23 66 68 E5 +T 16 18 00 00 DD 6E FC DD 66 FD 46 23 66 68 E5 R 00 00 01 00 -T 13 18 00 00 DD 6E FA DD 66 FB C1 71 23 70 18 +T 21 18 00 00 DD 6E FA DD 66 FB C1 71 23 70 18 R 00 00 01 00 -T 1E 18 00 00 BE +T 2C 18 00 00 BE R 00 00 01 00 -T 1F 18 00 00 +T 2D 18 00 00 R 00 00 01 00 -T 1F 18 00 00 DD 6E F8 DD 66 F9 29 29 DD 4E FA +T 2D 18 00 00 DD 6E F8 DD 66 F9 29 29 DD 4E FA R 00 00 01 00 -T 2A 18 00 00 DD 46 FB 09 4D 44 DD 6E FC DD 66 +T 38 18 00 00 DD 46 FB 09 4D 44 DD 6E FC DD 66 R 00 00 01 00 -T 35 18 00 00 FD A7 ED 42 38 03 +T 43 18 00 00 FD A7 ED 42 38 03 R 00 00 01 00 -T 3B 18 00 00 +T 49 18 00 00 R 00 00 01 00 -T 3B 18 00 00 C3 0C 19 00 00 +T 49 18 00 00 C3 58 19 00 00 R 00 00 01 00 00 05 01 00 -T 3E 18 00 00 +T 4C 18 00 00 R 00 00 01 00 -T 3E 18 00 00 +T 4C 18 00 00 R 00 00 01 00 -T 3E 18 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD +T 4C 18 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD R 00 00 01 00 -T 49 18 00 00 75 FA DD 74 FB ED 4B 3D 00 00 00 +T 57 18 00 00 75 FA DD 74 FB ED 4B 3D 00 00 00 R 00 00 01 00 00 0B 03 00 -T 52 18 00 00 A7 ED 42 20 02 +T 60 18 00 00 A7 ED 42 20 02 R 00 00 01 00 -T 57 18 00 00 +T 65 18 00 00 R 00 00 01 00 -T 57 18 00 00 18 03 +T 65 18 00 00 18 03 R 00 00 01 00 -T 59 18 00 00 +T 67 18 00 00 R 00 00 01 00 -T 59 18 00 00 C3 CA 17 00 00 +T 67 18 00 00 C3 D8 17 00 00 R 00 00 01 00 00 05 01 00 -T 5C 18 00 00 +T 6A 18 00 00 R 00 00 01 00 -T 5C 18 00 00 01 00 81 DD 6E F8 DD 66 F9 3E 80 +T 6A 18 00 00 01 00 81 DD 6E F8 DD 66 F9 3E 80 R 00 00 01 00 -T 67 18 00 00 AC 67 ED 42 38 08 DD 6E F8 DD 66 +T 75 18 00 00 AC 67 ED 42 38 08 DD 6E F8 DD 66 R 00 00 01 00 -T 72 18 00 00 F9 18 03 +T 80 18 00 00 F9 18 03 R 00 00 01 00 -T 75 18 00 00 +T 83 18 00 00 R 00 00 01 00 -T 75 18 00 00 21 00 01 +T 83 18 00 00 21 00 01 R 00 00 01 00 -T 78 18 00 00 +T 86 18 00 00 R 00 00 01 00 -T 78 18 00 00 DD 75 FE DD 74 FF 29 29 EB 3E +T 86 18 00 00 DD 75 FE DD 74 FF 29 29 EB 3E R 00 00 01 00 -T 82 18 00 00 00 00 00 00 21 00 00 00 00 CD +T 90 18 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 32 00 02 09 32 00 -T 87 18 00 00 00 00 00 00 DD 75 FA DD 74 FB 7D +T 95 18 00 00 00 00 00 00 DD 75 FA DD 74 FB 7D R 00 00 01 00 02 04 24 00 -T 90 18 00 00 A4 3C 20 06 +T 9E 18 00 00 A4 3C 20 06 R 00 00 01 00 -T 94 18 00 00 +T A2 18 00 00 R 00 00 01 00 -T 94 18 00 00 21 00 00 C3 85 19 00 00 +T A2 18 00 00 21 00 00 C3 11 1A 00 00 R 00 00 01 00 00 08 01 00 -T 9A 18 00 00 +T A8 18 00 00 R 00 00 01 00 -T 9A 18 00 00 DD 7E FA D6 04 DD 77 FA DD 7E FB +T A8 18 00 00 DD 7E FA D6 04 DD 77 FA DD 7E FB R 00 00 01 00 -T A5 18 00 00 DE 00 DD 77 FB 2A 3B 00 00 00 DD +T B3 18 00 00 DE 00 DD 77 FB 2A 3B 00 00 00 DD R 00 00 01 00 00 0A 03 00 -T AE 18 00 00 4E FA DD 46 FB A7 ED 42 28 08 +T BC 18 00 00 4E FA DD 46 FB A7 ED 42 28 46 R 00 00 01 00 -T B8 18 00 00 +T C6 18 00 00 R 00 00 01 00 -T B8 18 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 19 00 02 0A 19 00 -T BE 18 00 00 00 00 00 00 -R 00 00 01 00 02 04 24 00 -T C0 18 00 00 +T C6 18 00 00 11 AA 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 02 00 2B 0A 14 00 +T CC 18 00 00 00 00 00 00 CD 00 00 00 00 DD 5E +R 00 00 01 00 02 04 14 00 02 09 24 00 +T D3 18 00 00 FA DD 56 FB 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 0D 00 +T DA 18 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0D 00 02 09 24 00 +T E0 18 00 00 CA 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 14 00 +T E5 18 00 00 00 00 00 00 CD 00 00 00 00 ED 5B +R 00 00 01 00 02 04 14 00 02 09 24 00 +T EC 18 00 00 3B 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 09 0D 00 +T F1 18 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0D 00 02 09 24 00 +T F7 18 00 00 CD 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 14 00 +T FC 18 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 14 00 02 09 24 00 +T 02 19 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 3C 00 +T 07 19 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 3C 00 02 09 24 00 +T 0C 19 00 00 R 00 00 01 00 -T C0 18 00 00 DD 6E FE DD 66 FF 29 29 DD 4E FA +T 0C 19 00 00 DD 6E FE DD 66 FF 29 29 DD 4E FA R 00 00 01 00 -T CB 18 00 00 DD 46 FB 09 DD 75 FC DD 74 FD E5 +T 17 19 00 00 DD 46 FB 09 DD 75 FC DD 74 FD E5 R 00 00 01 00 -T D6 18 00 00 69 60 C1 71 23 70 DD 6E FA DD 66 +T 22 19 00 00 69 60 C1 71 23 70 DD 6E FA DD 66 R 00 00 01 00 -T E1 18 00 00 FB 23 23 36 FF 23 36 7F 2A +T 2D 19 00 00 FB 23 23 36 FF 23 36 7F 2A R 00 00 01 00 -T EA 18 00 00 39 00 00 00 E5 DD 6E FC DD 66 FD +T 36 19 00 00 39 00 00 00 E5 DD 6E FC DD 66 FD R 00 00 01 00 00 04 03 00 -T F3 18 00 00 C1 71 23 70 DD 6E FC DD 66 FD 23 +T 3F 19 00 00 C1 71 23 70 DD 6E FC DD 66 FD 23 R 00 00 01 00 -T FE 18 00 00 23 AF 77 23 77 DD 6E FC DD 66 FD +T 4A 19 00 00 23 AF 77 23 77 DD 6E FC DD 66 FD R 00 00 01 00 -T 09 19 00 00 22 3B 00 00 00 +T 55 19 00 00 22 3B 00 00 00 R 00 00 01 00 00 05 03 00 -T 0C 19 00 00 +T 58 19 00 00 R 00 00 01 00 -T 0C 19 00 00 DD 6E F8 DD 66 F9 29 29 DD 4E FA +T 58 19 00 00 DD 6E F8 DD 66 F9 29 29 DD 4E FA R 00 00 01 00 -T 17 19 00 00 DD 46 FB 09 22 3D 00 00 00 DD 4E +T 63 19 00 00 DD 46 FB 09 22 3D 00 00 00 DD 4E R 00 00 01 00 00 09 03 00 -T 20 19 00 00 FC DD 46 FD A7 ED 42 30 43 +T 6C 19 00 00 FC DD 46 FD A7 ED 42 D2 R 00 00 01 00 -T 29 19 00 00 +T 74 19 00 00 F8 19 00 00 +R 00 00 01 00 00 04 01 00 +T 76 19 00 00 R 00 00 01 00 -T 29 19 00 00 21 04 00 ED 4B 3D 00 00 00 09 4D +T 76 19 00 00 21 04 00 ED 4B 3D 00 00 00 09 4D R 00 00 01 00 00 09 03 00 -T 32 19 00 00 44 DD 6E FC DD 66 FD A7 ED 42 30 +T 7F 19 00 00 44 DD 6E FC DD 66 FD A7 ED 42 30 R 00 00 01 00 -T 3D 19 00 00 08 +T 8A 19 00 00 47 R 00 00 01 00 -T 3E 19 00 00 +T 8B 19 00 00 R 00 00 01 00 -T 3E 19 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 19 00 02 0A 19 00 -T 44 19 00 00 00 00 00 00 -R 00 00 01 00 02 04 24 00 -T 46 19 00 00 +T 8B 19 00 00 11 D0 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 02 00 2B 0A 14 00 +T 91 19 00 00 00 00 00 00 CD 00 00 00 00 ED 5B +R 00 00 01 00 02 04 14 00 02 09 24 00 +T 98 19 00 00 3D 00 00 00 13 3E 00 00 00 00 21 +R 00 00 01 00 00 04 03 00 2B 0A 0D 00 +T 9E 19 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0D 00 02 09 24 00 +T A4 19 00 00 CA 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 14 00 +T A9 19 00 00 00 00 00 00 CD 00 00 00 00 DD 5E +R 00 00 01 00 02 04 14 00 02 09 24 00 +T B0 19 00 00 FC DD 56 FD 3E 00 00 00 00 21 +R 00 00 01 00 2B 09 0D 00 +T B7 19 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 0D 00 02 09 24 00 +T BD 19 00 00 CD 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 14 00 +T C2 19 00 00 00 00 00 00 CD 00 00 00 00 11 +R 00 00 01 00 02 04 14 00 02 09 24 00 +T C8 19 00 00 01 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 3C 00 +T CD 19 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 3C 00 02 09 24 00 +T D2 19 00 00 R 00 00 01 00 -T 46 19 00 00 DD 6E FC DD 66 FD E5 2A +T D2 19 00 00 DD 6E FC DD 66 FD E5 2A R 00 00 01 00 -T 4E 19 00 00 3D 00 00 00 C1 71 23 70 2A +T DA 19 00 00 3D 00 00 00 C1 71 23 70 2A R 00 00 01 00 00 04 03 00 -T 55 19 00 00 3D 00 00 00 23 23 36 FF 23 36 7F +T E1 19 00 00 3D 00 00 00 23 23 36 FF 23 36 7F R 00 00 01 00 00 04 03 00 -T 5E 19 00 00 2A 3D 00 00 00 E5 DD 6E FA DD 66 +T EA 19 00 00 2A 3D 00 00 00 E5 DD 6E FA DD 66 R 00 00 01 00 00 05 03 00 -T 67 19 00 00 FB C1 71 23 70 +T F3 19 00 00 FB C1 71 23 70 R 00 00 01 00 -T 6C 19 00 00 +T F8 19 00 00 R 00 00 01 00 -T 6C 19 00 00 DD 6E FA DD 66 FB 23 23 ED 4B +T F8 19 00 00 DD 6E FA DD 66 FB 23 23 ED 4B R 00 00 01 00 -T 76 19 00 00 00 00 00 00 71 23 70 21 04 00 DD +T 02 1A 00 00 00 00 00 00 71 23 70 21 04 00 DD R 00 00 01 00 02 04 28 00 -T 7F 19 00 00 4E FA DD 46 FB 09 +T 0B 1A 00 00 4E FA DD 46 FB 09 R 00 00 01 00 -T 85 19 00 00 +T 11 1A 00 00 R 00 00 01 00 -T 85 19 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 88 19 00 00 +T 11 1A 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 10 00 +T 14 1A 00 00 R 00 00 01 00 -T 88 19 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD +T 14 1A 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD R 00 00 01 00 02 05 2A 00 -T 91 19 00 00 66 03 DD 75 FE DD 74 FF 7D B4 28 +T 1D 1A 00 00 66 03 DD 75 FE DD 74 FF 7D B4 28 R 00 00 01 00 -T 9C 19 00 00 35 +T 28 1A 00 00 35 R 00 00 01 00 -T 9D 19 00 00 +T 29 1A 00 00 R 00 00 01 00 -T 9D 19 00 00 DD 7E FE D6 04 DD 77 FE DD 7E FF +T 29 1A 00 00 DD 7E FE D6 04 DD 77 FE DD 7E FF R 00 00 01 00 -T A8 19 00 00 DE 00 DD 77 FF ED 4B 3D 00 00 00 +T 34 1A 00 00 DE 00 DD 77 FF ED 4B 3D 00 00 00 R 00 00 01 00 00 0B 03 00 -T B1 19 00 00 DD 6E FE DD 66 FF A7 ED 42 30 09 +T 3D 1A 00 00 DD 6E FE DD 66 FF A7 ED 42 30 09 R 00 00 01 00 -T BC 19 00 00 +T 48 1A 00 00 R 00 00 01 00 -T BC 19 00 00 DD 6E FE DD 66 FF 22 3D 00 00 00 +T 48 1A 00 00 DD 6E FE DD 66 FF 22 3D 00 00 00 R 00 00 01 00 00 0B 03 00 -T C5 19 00 00 +T 51 1A 00 00 R 00 00 01 00 -T C5 19 00 00 DD 6E FE DD 66 FF 23 23 36 FF 23 +T 51 1A 00 00 DD 6E FE DD 66 FF 23 23 36 FF 23 R 00 00 01 00 -T D0 19 00 00 36 7F +T 5C 1A 00 00 36 7F R 00 00 01 00 -T D2 19 00 00 +T 5E 1A 00 00 R 00 00 01 00 -T D2 19 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T D5 19 00 00 +T 5E 1A 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 10 00 +T 61 1A 00 00 R 00 00 01 00 -T D5 19 00 00 CD 00 00 00 00 FC FF 2A +T 61 1A 00 00 CD 00 00 00 00 FC FF 2A R 00 00 01 00 02 05 2A 00 -T DB 19 00 00 3B 00 00 00 DD 75 FE DD 74 FF 2A +T 67 1A 00 00 3B 00 00 00 DD 75 FE DD 74 FF 2A R 00 00 01 00 00 04 03 00 -T E4 19 00 00 39 00 00 00 DD 75 FC DD 74 FD +T 70 1A 00 00 39 00 00 00 DD 75 FC DD 74 FD R 00 00 01 00 00 04 03 00 -T EC 19 00 00 +T 78 1A 00 00 R 00 00 01 00 -T EC 19 00 00 DD 6E FE DD 66 FF DD 4E FC DD 46 +T 78 1A 00 00 DD 6E FE DD 66 FF DD 4E FC DD 46 R 00 00 01 00 -T F7 19 00 00 FD A7 ED 42 28 36 +T 83 1A 00 00 FD A7 ED 42 28 36 R 00 00 01 00 -T FD 19 00 00 +T 89 1A 00 00 R 00 00 01 00 -T FD 19 00 00 DD 6E FC DD 66 FD 23 23 46 23 66 +T 89 1A 00 00 DD 6E FC DD 66 FD 23 23 46 23 66 R 00 00 01 00 -T 08 1A 00 00 68 DD 4E 02 DD 46 03 CD +T 94 1A 00 00 68 DD 4E 02 DD 46 03 CD R 00 00 01 00 -T 10 1A 00 00 00 00 00 00 38 0D +T 9C 1A 00 00 00 00 00 00 38 0D R 00 00 01 00 02 04 30 00 -T 14 1A 00 00 +T A0 1A 00 00 R 00 00 01 00 -T 14 1A 00 00 DD 6E FC DD 66 FD 23 23 36 FF 23 +T A0 1A 00 00 DD 6E FC DD 66 FD 23 23 36 FF 23 R 00 00 01 00 -T 1F 1A 00 00 36 7F +T AB 1A 00 00 36 7F R 00 00 01 00 -T 21 1A 00 00 +T AD 1A 00 00 R 00 00 01 00 -T 21 1A 00 00 DD 6E FC DD 66 FD 46 23 66 68 DD +T AD 1A 00 00 DD 6E FC DD 66 FD 46 23 66 68 DD R 00 00 01 00 -T 2C 1A 00 00 75 FC DD 74 FD 18 B9 +T B8 1A 00 00 75 FC DD 74 FD 18 B9 R 00 00 01 00 -T 33 1A 00 00 +T BF 1A 00 00 R 00 00 01 00 -T 33 1A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 36 1A 00 00 +T BF 1A 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 10 00 +T C2 1A 00 00 R 00 00 01 00 -T 36 1A 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD +T C2 1A 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD R 00 00 01 00 02 05 2A 00 -T 3F 1A 00 00 66 03 DD 75 FE DD 74 FF 7D B4 28 +T CB 1A 00 00 66 03 DD 75 FE DD 74 FF 7D B4 28 R 00 00 01 00 -T 4A 1A 00 00 15 +T D6 1A 00 00 15 R 00 00 01 00 -T 4B 1A 00 00 +T D7 1A 00 00 R 00 00 01 00 -T 4B 1A 00 00 21 FC FF DD 4E FE DD 46 FF 09 23 +T D7 1A 00 00 21 FC FF DD 4E FE DD 46 FF 09 23 R 00 00 01 00 -T 56 1A 00 00 23 DD 4E 04 DD 46 05 71 23 70 +T E2 1A 00 00 23 DD 4E 04 DD 46 05 71 23 70 R 00 00 01 00 -T 60 1A 00 00 +T EC 1A 00 00 R 00 00 01 00 -T 60 1A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 -T 63 1A 00 00 +T EC 1A 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 10 00 +T EF 1A 00 00 R 00 00 01 00 -T 63 1A 00 00 CD 00 00 00 00 21 FC FF 19 23 23 +T EF 1A 00 00 CD 00 00 00 00 21 FC FF 19 23 23 R 00 00 01 00 02 05 23 00 -T 6C 1A 00 00 46 23 66 68 C3 00 00 00 00 -R 00 00 01 00 02 09 0F 00 -T 73 1A 00 00 +T F8 1A 00 00 46 23 66 68 C3 00 00 00 00 +R 00 00 01 00 02 09 10 00 +T FF 1A 00 00 R 00 00 01 00 -T 73 1A 00 00 CD 00 00 00 00 FA FF 2A +T FF 1A 00 00 CD 00 00 00 00 FA FF 2A R 00 00 01 00 02 05 2A 00 -T 79 1A 00 00 3B 00 00 00 DD 75 FE DD 74 FF 2A +T 05 1B 00 00 3B 00 00 00 DD 75 FE DD 74 FF 2A R 00 00 01 00 00 04 03 00 -T 82 1A 00 00 39 00 00 00 DD 75 FA DD 74 FB +T 0E 1B 00 00 39 00 00 00 DD 75 FA DD 74 FB R 00 00 01 00 00 04 03 00 -T 8A 1A 00 00 +T 16 1B 00 00 R 00 00 01 00 -T 8A 1A 00 00 DD 6E FE DD 66 FF DD 4E FA DD 46 +T 16 1B 00 00 DD 6E FE DD 66 FF DD 4E FA DD 46 R 00 00 01 00 -T 95 1A 00 00 FB A7 ED 42 28 62 +T 21 1B 00 00 FB A7 ED 42 28 62 R 00 00 01 00 -T 9B 1A 00 00 +T 27 1B 00 00 R 00 00 01 00 -T 9B 1A 00 00 DD 6E FA DD 66 FB 23 23 4E 23 46 +T 27 1B 00 00 DD 6E FA DD 66 FB 23 23 4E 23 46 R 00 00 01 00 -T A6 1A 00 00 2A 00 00 00 00 CD 00 00 00 00 30 +T 32 1B 00 00 2A 00 00 00 00 CD 00 00 00 00 30 R 00 00 01 00 02 05 28 00 02 0A 30 00 -T AD 1A 00 00 3D +T 39 1B 00 00 3D R 00 00 01 00 -T AE 1A 00 00 +T 3A 1B 00 00 R 00 00 01 00 -T AE 1A 00 00 +T 3A 1B 00 00 R 00 00 01 00 -T AE 1A 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD +T 3A 1B 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD R 00 00 01 00 -T B9 1A 00 00 75 FC DD 74 FD 23 23 4E 23 46 2A +T 45 1B 00 00 75 FC DD 74 FD 23 23 4E 23 46 2A R 00 00 01 00 -T C4 1A 00 00 00 00 00 00 CD 00 00 00 00 30 17 +T 50 1B 00 00 00 00 00 00 CD 00 00 00 00 30 17 R 00 00 01 00 02 04 28 00 02 09 30 00 -T CB 1A 00 00 +T 57 1B 00 00 R 00 00 01 00 -T CB 1A 00 00 DD 6E FC DD 66 FD 46 23 66 68 E5 +T 57 1B 00 00 DD 6E FC DD 66 FD 46 23 66 68 E5 R 00 00 01 00 -T D6 1A 00 00 DD 6E FA DD 66 FB C1 71 23 70 18 +T 62 1B 00 00 DD 6E FA DD 66 FB C1 71 23 70 18 R 00 00 01 00 -T E1 1A 00 00 CC +T 6D 1B 00 00 CC R 00 00 01 00 -T E2 1A 00 00 +T 6E 1B 00 00 R 00 00 01 00 -T E2 1A 00 00 DD 6E FA DD 66 FB 22 3D 00 00 00 +T 6E 1B 00 00 DD 6E FA DD 66 FB 22 3D 00 00 00 R 00 00 01 00 00 0B 03 00 -T EB 1A 00 00 +T 77 1B 00 00 R 00 00 01 00 -T EB 1A 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD +T 77 1B 00 00 DD 6E FA DD 66 FB 46 23 66 68 DD R 00 00 01 00 -T F6 1A 00 00 75 FA DD 74 FB 18 8D +T 82 1B 00 00 75 FA DD 74 FB 18 8D R 00 00 01 00 -T FD 1A 00 00 +T 89 1B 00 00 R 00 00 01 00 -T FD 1A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 0F 00 +T 89 1B 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 10 00 T 00 00 00 00 R 00 00 02 00 T 00 00 00 00 00 @@ -3163,6 +3210,38 @@ T 82 00 00 00 R 00 00 02 00 T 82 00 00 00 72 65 61 64 6F 6E 6C 79 20 00 R 00 00 02 00 +T 8C 00 00 00 +R 00 00 02 00 +T 8C 00 00 00 66 61 74 61 6C 3A 20 67 65 74 63 +R 00 00 02 00 +T 97 00 00 00 65 6C 6C 28 29 20 6E 62 79 74 65 +R 00 00 02 00 +T A2 00 00 00 73 20 3D 3D 20 30 0A 00 +R 00 00 02 00 +T AA 00 00 00 +R 00 00 02 00 +T AA 00 00 00 66 61 74 61 6C 3A 20 67 65 74 63 +R 00 00 02 00 +T B5 00 00 00 65 6C 6C 28 29 20 70 20 21 3D 20 +R 00 00 02 00 +T C0 00 00 00 61 72 65 61 74 6F 70 20 28 00 +R 00 00 02 00 +T CA 00 00 00 +R 00 00 02 00 +T CA 00 00 00 2C 20 00 +R 00 00 02 00 +T CD 00 00 00 +R 00 00 02 00 +T CD 00 00 00 29 0A 00 +R 00 00 02 00 +T D0 00 00 00 +R 00 00 02 00 +T D0 00 00 00 66 61 74 61 6C 3A 20 67 65 74 63 +R 00 00 02 00 +T DB 00 00 00 65 6C 6C 28 29 20 61 72 65 61 6E +R 00 00 02 00 +T E6 00 00 00 78 74 2B 31 20 3E 20 71 20 28 00 +R 00 00 02 00 T 00 00 00 00 R 00 00 03 00 T 00 00 00 00 diff --git a/src/sh/msh/sh2.c b/src/sh/msh/sh2.c index f0f83133..c23057cb 100644 --- a/src/sh/msh/sh2.c +++ b/src/sh/msh/sh2.c @@ -687,7 +687,11 @@ loop: startl = 1; if (multiline || cf & CONTIN) { if (talking && env.iop <= iostack) +#if 1 /* Nick */ + prs_expand(cprompt->value); +#else prs(cprompt->value); +#endif if (cf & CONTIN) goto loop; } @@ -735,7 +739,11 @@ register c, c1; return(YYERRCODE); } if (talking && c == '\n' && env.iop <= iostack) +#if 1 /* Nick */ + prs_expand(cprompt->value); +#else prs(cprompt->value); +#endif *env.linep++ = c; } *env.linep++ = c; diff --git a/src/sh/msh/sh2.rel b/src/sh/msh/sh2.rel index 7c37267d..dcf87894 100644 --- a/src/sh/msh/sh2.rel +++ b/src/sh/msh/sh2.rel @@ -1,5 +1,5 @@ XL4 -H 6 areas 2B global symbols +H 6 areas 2C global symbols M sh2 S cprompt Ref00000000 S ?BANK_FAST_LEAVE_L08 Ref00000000 @@ -34,6 +34,7 @@ S ?ENT_AUTO_DIRECT_L09 Ref00000000 S iostack Ref00000000 S getwords Ref00000000 S ?SS_CMP_L02 Ref00000000 +S prs_expand Ref00000000 S ?CL64180B_4_06_L00 Ref00000000 S elinep Ref00000000 S .__.ABS. Def00000000 @@ -1477,7 +1478,7 @@ R 00 00 01 00 T 2B 0E 00 00 2A 00 00 00 00 5E 23 56 3E R 00 00 01 00 02 05 00 00 T 32 0E 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +R 00 00 01 00 2B 04 21 00 02 09 21 00 T 37 0E 00 00 00 00 00 00 R 00 00 01 00 02 04 14 00 T 39 0E 00 00 @@ -1529,7 +1530,7 @@ R 00 00 01 00 T 93 0E 00 00 R 00 00 01 00 T 93 0E 00 00 2A 00 00 00 00 ED 4B 00 00 00 00 -R 00 00 01 00 02 05 06 00 02 0B 22 00 +R 00 00 01 00 02 05 06 00 02 0B 23 00 T 9A 0E 00 00 A7 ED 42 38 0D R 00 00 01 00 T 9F 0E 00 00 @@ -1659,7 +1660,7 @@ R 00 00 01 00 T B8 0F 00 00 2A 00 00 00 00 5E 23 56 3E R 00 00 01 00 02 05 00 00 T BF 0F 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +R 00 00 01 00 2B 04 21 00 02 09 21 00 T C4 0F 00 00 00 00 00 00 R 00 00 01 00 02 04 14 00 T C6 0F 00 00 diff --git a/src/sh/msh/sh3.c b/src/sh/msh/sh3.c index f25fabcb..b7a4509f 100644 --- a/src/sh/msh/sh3.c +++ b/src/sh/msh/sh3.c @@ -356,7 +356,11 @@ parent() i = fork(); if (i != 0) { if (i == -1) +#if 1 /* Nick */ + warn("can't fork - try again"); +#else warn("try again"); +#endif } return(i); } diff --git a/src/sh/msh/sh3.rel b/src/sh/msh/sh3.rel index 80a4e0e8..eea5f9d1 100644 --- a/src/sh/msh/sh3.rel +++ b/src/sh/msh/sh3.rel @@ -134,7 +134,7 @@ S doexec Def00001867 S docontinue Def00001FCD S doeval Def00001C1A S waitfor Def00001097 -A CSTR size 2D4 flags 0 +A CSTR size 2E1 flags 0 A IDATA0 size 84 flags 0 A CDATA0 size 84 flags 0 T 00 00 00 00 @@ -1419,11 +1419,11 @@ T AD 0C 00 00 R 00 00 01 00 T AD 0C 00 00 DD 6E 02 DD 66 03 23 23 7E E6 03 R 00 00 01 00 -T B8 0C 00 00 28 05 21 DB 00 00 00 18 03 +T B8 0C 00 00 28 05 21 E8 00 00 00 18 03 R 00 00 01 00 00 07 02 00 T BF 0C 00 00 R 00 00 01 00 -T BF 0C 00 00 21 E0 00 00 00 +T BF 0C 00 00 21 ED 00 00 00 R 00 00 01 00 00 05 02 00 T C2 0C 00 00 R 00 00 01 00 @@ -1483,7 +1483,7 @@ T 43 0D 00 00 DD 5E FC DD 56 FD 3E 00 00 00 00 R 00 00 01 00 2B 0B 25 00 T 4B 0D 00 00 21 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 05 25 00 02 0A 3D 00 -T 52 0D 00 00 E7 00 00 00 3E 00 00 00 00 21 +T 52 0D 00 00 F4 00 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 0F 00 T 57 0D 00 00 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -1543,9 +1543,9 @@ T F6 0D 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 59 00 02 09 59 00 T FB 0D 00 00 00 00 00 00 DD 75 FA DD 74 FB DD R 00 00 01 00 02 04 3D 00 -T 04 0E 00 00 36 FC FD 00 00 00 DD 36 FD +T 04 0E 00 00 36 FC 0A 01 00 00 DD 36 FD R 00 00 01 00 09 06 02 00 -T 0A 0E 00 00 FD 00 00 00 C3 A2 0E 00 00 +T 0A 0E 00 00 0A 01 00 00 C3 A2 0E 00 00 R 00 00 01 00 89 04 02 00 00 09 01 00 T 0E 0E 00 00 R 00 00 01 00 @@ -1609,7 +1609,7 @@ T A8 0E 00 00 DD 5E FC DD 56 FD 3E 00 00 00 00 R 00 00 01 00 2B 0B 25 00 T B0 0E 00 00 21 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 05 25 00 02 0A 3D 00 -T B7 0E 00 00 07 01 00 00 3E 00 00 00 00 21 +T B7 0E 00 00 14 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 25 00 T BC 0E 00 00 00 00 00 00 CD 00 00 00 00 DD 5E R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -1649,7 +1649,7 @@ T 14 0F 00 00 R 00 00 01 00 T 14 0F 00 00 CD 00 00 00 00 FE FF 11 R 00 00 01 00 02 05 46 00 -T 1A 0F 00 00 11 01 00 00 3E 00 00 00 00 21 +T 1A 0F 00 00 1E 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 25 00 T 1F 0F 00 00 00 00 00 00 CD 00 00 00 00 AF DD R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -1667,7 +1667,7 @@ T 3E 0F 00 00 DD 7E FE DD B6 FF 28 0B R 00 00 01 00 T 46 0F 00 00 R 00 00 01 00 -T 46 0F 00 00 11 13 01 00 00 3E 00 00 00 00 21 +T 46 0F 00 00 11 20 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 25 00 T 4C 0F 00 00 00 00 00 00 CD 00 00 00 00 R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -1917,7 +1917,7 @@ T 89 11 00 00 00 00 00 00 CD 00 00 00 00 R 00 00 01 00 02 04 25 00 02 09 3D 00 T 8E 11 00 00 R 00 00 01 00 -T 8E 11 00 00 11 15 01 00 00 3E 00 00 00 00 21 +T 8E 11 00 00 11 22 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 25 00 T 94 11 00 00 00 00 00 00 CD 00 00 00 00 DD 5E R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -1925,7 +1925,7 @@ T 9B 11 00 00 FA DD 56 FB 3E 00 00 00 00 21 R 00 00 01 00 2B 09 1D 00 T A2 11 00 00 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 04 1D 00 02 09 3D 00 -T A8 11 00 00 13 01 00 00 3E 00 00 00 00 21 +T A8 11 00 00 20 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 25 00 T AD 11 00 00 00 00 00 00 CD 00 00 00 00 R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -1937,7 +1937,7 @@ T BD 11 00 00 B0 28 0B R 00 00 01 00 T C0 11 00 00 R 00 00 01 00 -T C0 11 00 00 11 1D 01 00 00 3E 00 00 00 00 21 +T C0 11 00 00 11 2A 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 25 00 T C6 11 00 00 00 00 00 00 CD 00 00 00 00 R 00 00 01 00 02 04 25 00 02 09 3D 00 @@ -2031,7 +2031,7 @@ T 7E 12 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 R 00 00 01 00 2B 0B 0B 00 T 86 12 00 00 21 00 00 00 00 CD 00 00 00 00 4D R 00 00 01 00 02 05 0B 00 02 0A 3D 00 -T 8D 12 00 00 44 11 2C 01 00 00 3E 00 00 00 00 +T 8D 12 00 00 44 11 39 01 00 00 3E 00 00 00 00 R 00 00 01 00 00 06 02 00 2B 0B 30 00 T 93 12 00 00 21 00 00 00 00 CD 00 00 00 00 EB R 00 00 01 00 02 05 30 00 02 0A 3D 00 @@ -2177,15 +2177,15 @@ T F0 13 00 00 F4 13 00 00 6D 14 00 00 R 00 00 01 00 00 04 01 00 00 08 01 00 T F4 13 00 00 R 00 00 01 00 -T F4 13 00 00 21 2E 01 00 00 C3 90 14 00 00 +T F4 13 00 00 21 3B 01 00 00 C3 90 14 00 00 R 00 00 01 00 00 05 02 00 00 0A 01 00 T FA 13 00 00 R 00 00 01 00 -T FA 13 00 00 21 46 01 00 00 C3 90 14 00 00 +T FA 13 00 00 21 53 01 00 00 C3 90 14 00 00 R 00 00 01 00 00 05 02 00 00 0A 01 00 T 00 14 00 00 R 00 00 01 00 -T 00 14 00 00 21 5A 01 00 00 C3 90 14 00 00 +T 00 14 00 00 21 67 01 00 00 C3 90 14 00 00 R 00 00 01 00 00 05 02 00 00 0A 01 00 T 06 14 00 00 R 00 00 01 00 @@ -2201,7 +2201,7 @@ T 2E 14 00 00 00 00 00 00 DD 6E 04 DD 66 05 71 R 00 00 01 00 02 04 10 00 T 37 14 00 00 23 70 DD 6E 0A DD 66 0B E5 DD 4E R 00 00 01 00 -T 42 14 00 00 04 DD 46 05 11 75 01 00 00 3E +T 42 14 00 00 04 DD 46 05 11 82 01 00 00 3E R 00 00 01 00 00 09 02 00 T 4A 14 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 01 00 02 09 01 00 @@ -2209,15 +2209,15 @@ T 4F 14 00 00 00 00 00 00 F1 DD 6E FA DD 66 FB R 00 00 01 00 02 04 3D 00 T 58 14 00 00 E5 DD 6E 04 DD 66 05 C1 71 23 70 R 00 00 01 00 -T 63 14 00 00 21 7D 01 00 00 18 28 +T 63 14 00 00 21 8A 01 00 00 18 28 R 00 00 01 00 00 05 02 00 T 68 14 00 00 R 00 00 01 00 -T 68 14 00 00 21 86 01 00 00 18 23 +T 68 14 00 00 21 93 01 00 00 18 23 R 00 00 01 00 00 05 02 00 T 6D 14 00 00 R 00 00 01 00 -T 6D 14 00 00 21 96 01 00 00 18 1E +T 6D 14 00 00 21 A3 01 00 00 18 1E R 00 00 01 00 00 05 02 00 T 72 14 00 00 R 00 00 01 00 @@ -2235,11 +2235,11 @@ T 7F 14 00 00 R 00 00 01 00 T 7F 14 00 00 2A 00 00 00 00 3E 02 AD B4 20 05 R 00 00 01 00 02 05 40 00 -T 88 14 00 00 21 AD 01 00 00 18 03 +T 88 14 00 00 21 BA 01 00 00 18 03 R 00 00 01 00 00 05 02 00 T 8D 14 00 00 R 00 00 01 00 -T 8D 14 00 00 21 B7 01 00 00 +T 8D 14 00 00 21 C4 01 00 00 R 00 00 01 00 00 05 02 00 T 90 14 00 00 R 00 00 01 00 @@ -2357,9 +2357,9 @@ T D9 15 00 00 R 00 00 01 00 T D9 15 00 00 R 00 00 01 00 -T D9 15 00 00 DD 36 FE C6 01 00 00 DD 36 FF +T D9 15 00 00 DD 36 FE D3 01 00 00 DD 36 FF R 00 00 01 00 09 07 02 00 -T E0 15 00 00 C6 01 00 00 18 21 +T E0 15 00 00 D3 01 00 00 18 21 R 00 00 01 00 89 04 02 00 T E3 15 00 00 R 00 00 01 00 @@ -2371,9 +2371,9 @@ T F2 15 00 00 7C 28 0A R 00 00 01 00 T F5 15 00 00 R 00 00 01 00 -T F5 15 00 00 DD 36 FE DA 01 00 00 DD 36 FF +T F5 15 00 00 DD 36 FE E7 01 00 00 DD 36 FF R 00 00 01 00 09 07 02 00 -T FC 15 00 00 DA 01 00 00 18 05 +T FC 15 00 00 E7 01 00 00 18 05 R 00 00 01 00 89 04 02 00 T FF 15 00 00 R 00 00 01 00 @@ -2389,7 +2389,7 @@ T 0F 16 00 00 DD 56 FD 18 03 R 00 00 01 00 T 14 16 00 00 R 00 00 01 00 -T 14 16 00 00 11 EA 01 00 00 +T 14 16 00 00 11 F7 01 00 00 R 00 00 01 00 00 05 02 00 T 17 16 00 00 R 00 00 01 00 @@ -2431,7 +2431,7 @@ T 72 16 00 00 00 00 00 00 CD 00 00 00 00 30 10 R 00 00 01 00 02 04 3B 00 02 09 4B 00 T 79 16 00 00 R 00 00 01 00 -T 79 16 00 00 11 ED 01 00 00 3E 00 00 00 00 21 +T 79 16 00 00 11 FA 01 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 0F 00 T 7F 16 00 00 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -2455,7 +2455,7 @@ T BE 16 00 00 00 00 00 00 3E 00 00 00 00 21 R 00 00 01 00 02 04 3B 00 2B 09 0B 00 T C3 16 00 00 00 00 00 00 CD 00 00 00 00 4D 44 R 00 00 01 00 02 04 0B 00 02 09 3D 00 -T CA 16 00 00 11 FE 01 00 00 3E 00 00 00 00 21 +T CA 16 00 00 11 0B 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 30 00 T D0 16 00 00 00 00 00 00 CD 00 00 00 00 EB 3E R 00 00 01 00 02 04 30 00 02 09 3D 00 @@ -2693,7 +2693,7 @@ T 5A 19 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 0E 00 02 09 0E 00 T 5F 19 00 00 00 00 00 00 7D B4 28 05 21 R 00 00 01 00 02 04 3D 00 -T 66 19 00 00 00 02 00 00 18 07 +T 66 19 00 00 0D 02 00 00 18 07 R 00 00 01 00 00 04 02 00 T 6A 19 00 00 R 00 00 01 00 @@ -2797,7 +2797,7 @@ T 4E 1A 00 00 DD 5E FE DD 56 FF 3E 00 00 00 00 R 00 00 01 00 2B 0B 25 00 T 56 1A 00 00 21 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 05 25 00 02 0A 3D 00 -T 5D 1A 00 00 02 02 00 00 3E 00 00 00 00 21 +T 5D 1A 00 00 0F 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 0F 00 T 62 1A 00 00 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -2863,7 +2863,7 @@ T E9 1A 00 00 46 23 66 68 23 23 7E 23 B6 20 11 R 00 00 01 00 T F4 1A 00 00 R 00 00 01 00 -T F4 1A 00 00 11 0E 02 00 00 3E 00 00 00 00 21 +T F4 1A 00 00 11 1B 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 0F 00 T FA 1A 00 00 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -3243,7 +3243,7 @@ T 90 1E 00 00 R 00 00 01 00 T 90 1E 00 00 R 00 00 01 00 -T 90 1E 00 00 11 23 02 00 00 3E 00 00 00 00 21 +T 90 1E 00 00 11 30 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 0F 00 T 96 1E 00 00 00 00 00 00 CD 00 00 00 00 AF DD R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -3349,7 +3349,7 @@ T 89 1F 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 R 00 00 01 00 2B 0B 25 00 T 91 1F 00 00 21 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 05 25 00 02 0A 3D 00 -T 98 1F 00 00 3B 02 00 00 3E 00 00 00 00 21 +T 98 1F 00 00 48 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 0F 00 T 9D 1F 00 00 00 00 00 00 CD 00 00 00 00 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -3427,7 +3427,7 @@ T 4E 20 00 00 DD 7E FE DD B6 FF 28 10 R 00 00 01 00 T 56 20 00 00 R 00 00 01 00 -T 56 20 00 00 11 48 02 00 00 3E 00 00 00 00 21 +T 56 20 00 00 11 55 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 05 02 00 2B 0A 0F 00 T 5C 20 00 00 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -3565,7 +3565,7 @@ T 8B 21 00 00 CD 00 00 00 00 3E 00 00 00 00 21 R 00 00 01 00 02 05 3C 00 2B 0A 25 00 T 91 21 00 00 00 00 00 00 CD 00 00 00 00 11 R 00 00 01 00 02 04 25 00 02 09 3D 00 -T 97 21 00 00 61 02 00 00 3E 00 00 00 00 21 +T 97 21 00 00 6E 02 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 02 00 2B 09 0F 00 T 9C 21 00 00 00 00 00 00 CD 00 00 00 00 C3 R 00 00 01 00 02 04 0F 00 02 09 3D 00 @@ -3761,7 +3761,7 @@ T 81 23 00 00 00 00 00 00 ED 5B 00 00 00 00 3E R 00 00 01 00 02 04 52 00 02 0A 3B 00 T 88 23 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 0B 00 02 09 0B 00 -T 8D 23 00 00 00 00 00 00 4D 44 11 FE 01 00 00 +T 8D 23 00 00 00 00 00 00 4D 44 11 0B 02 00 00 R 00 00 01 00 02 04 3D 00 00 0B 02 00 T 94 23 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 30 00 02 0A 30 00 @@ -3959,243 +3959,247 @@ T CE 00 00 00 3A 20 00 R 00 00 02 00 T D1 00 00 00 R 00 00 02 00 -T D1 00 00 00 74 72 79 20 61 67 61 69 6E 00 +T D1 00 00 00 63 61 6E 27 74 20 66 6F 72 6B 20 R 00 00 02 00 -T DB 00 00 00 +T DC 00 00 00 2D 20 74 72 79 20 61 67 61 69 6E R 00 00 02 00 -T DB 00 00 00 6F 70 65 6E 00 +T E7 00 00 00 00 R 00 00 02 00 -T E0 00 00 00 +T E8 00 00 00 R 00 00 02 00 -T E0 00 00 00 63 72 65 61 74 65 00 +T E8 00 00 00 6F 70 65 6E 00 R 00 00 02 00 -T E7 00 00 00 +T ED 00 00 00 R 00 00 02 00 -T E7 00 00 00 3A 20 69 6C 6C 65 67 61 6C 20 3E +T ED 00 00 00 63 72 65 61 74 65 00 R 00 00 02 00 -T F2 00 00 00 26 20 61 72 67 75 6D 65 6E 74 00 +T F4 00 00 00 R 00 00 02 00 -T FD 00 00 00 +T F4 00 00 00 3A 20 69 6C 6C 65 67 61 6C 20 3E R 00 00 02 00 -T FD 00 00 00 68 65 72 65 20 66 69 6C 65 00 +T FF 00 00 00 26 20 61 72 67 75 6D 65 6E 74 00 R 00 00 02 00 -T 07 01 00 00 +T 0A 01 00 00 R 00 00 02 00 -T 07 01 00 00 3A 20 63 61 6E 6E 6F 74 20 00 +T 0A 01 00 00 68 65 72 65 20 66 69 6C 65 00 R 00 00 02 00 -T 11 01 00 00 +T 14 01 00 00 R 00 00 02 00 -T 11 01 00 00 2B 00 +T 14 01 00 00 3A 20 63 61 6E 6E 6F 74 20 00 R 00 00 02 00 -T 13 01 00 00 +T 1E 01 00 00 R 00 00 02 00 -T 13 01 00 00 20 00 +T 1E 01 00 00 2B 00 R 00 00 02 00 -T 15 01 00 00 +T 20 01 00 00 R 00 00 02 00 -T 15 01 00 00 53 69 67 6E 61 6C 20 00 +T 20 01 00 00 20 00 R 00 00 02 00 -T 1D 01 00 00 +T 22 01 00 00 R 00 00 02 00 -T 1D 01 00 00 20 2D 20 63 6F 72 65 20 64 75 6D +T 22 01 00 00 53 69 67 6E 61 6C 20 00 R 00 00 02 00 -T 28 01 00 00 70 65 64 00 +T 2A 01 00 00 R 00 00 02 00 -T 2C 01 00 00 +T 2A 01 00 00 20 2D 20 63 6F 72 65 20 64 75 6D R 00 00 02 00 -T 2C 01 00 00 3F 00 +T 35 01 00 00 70 65 64 00 R 00 00 02 00 -T 2E 01 00 00 +T 39 01 00 00 R 00 00 02 00 -T 2E 01 00 00 65 78 65 63 75 74 61 62 6C 65 20 +T 39 01 00 00 3F 00 R 00 00 02 00 -T 39 01 00 00 66 6F 72 6D 61 74 20 65 72 72 6F +T 3B 01 00 00 R 00 00 02 00 -T 44 01 00 00 72 00 +T 3B 01 00 00 65 78 65 63 75 74 61 62 6C 65 20 R 00 00 02 00 -T 46 01 00 00 +T 46 01 00 00 66 6F 72 6D 61 74 20 65 72 72 6F R 00 00 02 00 -T 46 01 00 00 66 69 6C 65 20 69 73 20 6E 6F 74 +T 51 01 00 00 72 00 R 00 00 02 00 -T 51 01 00 00 20 61 6C 69 67 6E 65 64 00 +T 53 01 00 00 R 00 00 02 00 -T 5A 01 00 00 +T 53 01 00 00 66 69 6C 65 20 69 73 20 6E 6F 74 R 00 00 02 00 -T 5A 01 00 00 66 69 6C 65 20 69 73 20 74 6F 6F +T 5E 01 00 00 20 61 6C 69 67 6E 65 64 00 R 00 00 02 00 -T 65 01 00 00 20 73 68 6F 72 74 2C 20 6F 72 20 +T 67 01 00 00 R 00 00 02 00 -T 70 01 00 00 68 6F 6C 65 00 +T 67 01 00 00 66 69 6C 65 20 69 73 20 74 6F 6F R 00 00 02 00 -T 75 01 00 00 +T 72 01 00 00 20 73 68 6F 72 74 2C 20 6F 72 20 R 00 00 02 00 -T 75 01 00 00 2F 62 69 6E 2F 73 68 00 +T 7D 01 00 00 68 6F 6C 65 00 R 00 00 02 00 -T 7D 01 00 00 +T 82 01 00 00 R 00 00 02 00 -T 7D 01 00 00 6E 6F 20 53 68 65 6C 6C 00 +T 82 01 00 00 2F 62 69 6E 2F 73 68 00 R 00 00 02 00 -T 86 01 00 00 +T 8A 01 00 00 R 00 00 02 00 -T 86 01 00 00 70 72 6F 67 72 61 6D 20 74 6F 6F +T 8A 01 00 00 6E 6F 20 53 68 65 6C 6C 00 R 00 00 02 00 -T 91 01 00 00 20 62 69 67 00 +T 93 01 00 00 R 00 00 02 00 -T 96 01 00 00 +T 93 01 00 00 70 72 6F 67 72 61 6D 20 74 6F 6F R 00 00 02 00 -T 96 01 00 00 61 72 67 75 6D 65 6E 74 20 6C 69 +T 9E 01 00 00 20 62 69 67 00 R 00 00 02 00 -T A1 01 00 00 73 74 20 74 6F 6F 20 6C 6F 6E 67 +T A3 01 00 00 R 00 00 02 00 -T AC 01 00 00 00 +T A3 01 00 00 61 72 67 75 6D 65 6E 74 20 6C 69 R 00 00 02 00 -T AD 01 00 00 +T AE 01 00 00 73 74 20 74 6F 6F 20 6C 6F 6E 67 R 00 00 02 00 -T AD 01 00 00 6E 6F 74 20 66 6F 75 6E 64 00 +T B9 01 00 00 00 R 00 00 02 00 -T B7 01 00 00 +T BA 01 00 00 R 00 00 02 00 -T B7 01 00 00 63 61 6E 6E 6F 74 20 65 78 65 63 +T BA 01 00 00 6E 6F 74 20 66 6F 75 6E 64 00 R 00 00 02 00 -T C2 01 00 00 75 74 65 00 +T C4 01 00 00 R 00 00 02 00 -T C6 01 00 00 +T C4 01 00 00 63 61 6E 6E 6F 74 20 65 78 65 63 R 00 00 02 00 -T C6 01 00 00 3A 20 6E 6F 20 68 6F 6D 65 20 64 +T CF 01 00 00 75 74 65 00 R 00 00 02 00 -T D1 01 00 00 69 72 65 63 74 6F 72 79 00 +T D3 01 00 00 R 00 00 02 00 -T DA 01 00 00 +T D3 01 00 00 3A 20 6E 6F 20 68 6F 6D 65 20 64 R 00 00 02 00 -T DA 01 00 00 3A 20 62 61 64 20 64 69 72 65 63 +T DE 01 00 00 69 72 65 63 74 6F 72 79 00 R 00 00 02 00 -T E5 01 00 00 74 6F 72 79 00 +T E7 01 00 00 R 00 00 02 00 -T EA 01 00 00 +T E7 01 00 00 3A 20 62 61 64 20 64 69 72 65 63 R 00 00 02 00 -T EA 01 00 00 63 64 00 +T F2 01 00 00 74 6F 72 79 00 R 00 00 02 00 -T ED 01 00 00 +T F7 01 00 00 R 00 00 02 00 -T ED 01 00 00 6E 6F 74 68 69 6E 67 20 74 6F 20 +T F7 01 00 00 63 64 00 R 00 00 02 00 -T F8 01 00 00 73 68 69 66 74 00 +T FA 01 00 00 R 00 00 02 00 -T FE 01 00 00 +T FA 01 00 00 6E 6F 74 68 69 6E 67 20 74 6F 20 R 00 00 02 00 -T FE 01 00 00 23 00 +T 05 02 00 00 73 68 69 66 74 00 R 00 00 02 00 -T 00 02 00 00 +T 0B 02 00 00 R 00 00 02 00 -T 00 02 00 00 3A 00 +T 0B 02 00 00 23 00 R 00 00 02 00 -T 02 02 00 00 +T 0D 02 00 00 R 00 00 02 00 -T 02 02 00 00 3A 20 6E 6F 74 20 66 6F 75 6E 64 +T 0D 02 00 00 3A 00 R 00 00 02 00 -T 0D 02 00 00 00 +T 0F 02 00 00 R 00 00 02 00 -T 0E 02 00 00 +T 0F 02 00 00 3A 20 6E 6F 74 20 66 6F 75 6E 64 R 00 00 02 00 -T 0E 02 00 00 55 73 61 67 65 3A 20 72 65 61 64 +T 1A 02 00 00 00 R 00 00 02 00 -T 19 02 00 00 20 6E 61 6D 65 20 2E 2E 2E 00 +T 1B 02 00 00 R 00 00 02 00 -T 23 02 00 00 +T 1B 02 00 00 55 73 61 67 65 3A 20 72 65 61 64 R 00 00 02 00 -T 23 02 00 00 74 72 61 70 3A 20 62 61 64 20 73 +T 26 02 00 00 20 6E 61 6D 65 20 2E 2E 2E 00 R 00 00 02 00 -T 2E 02 00 00 69 67 6E 61 6C 20 6E 75 6D 62 65 +T 30 02 00 00 R 00 00 02 00 -T 39 02 00 00 72 00 +T 30 02 00 00 74 72 61 70 3A 20 62 61 64 20 73 R 00 00 02 00 -T 3B 02 00 00 -R 00 00 02 00 -T 3B 02 00 00 3A 20 62 61 64 20 6E 75 6D 62 65 +T 3B 02 00 00 69 67 6E 61 6C 20 6E 75 6D 62 65 R 00 00 02 00 T 46 02 00 00 72 00 R 00 00 02 00 T 48 02 00 00 R 00 00 02 00 -T 48 02 00 00 62 61 64 20 62 72 65 61 6B 2F 63 -R 00 00 02 00 -T 53 02 00 00 6F 6E 74 69 6E 75 65 20 6C 65 76 +T 48 02 00 00 3A 20 62 61 64 20 6E 75 6D 62 65 R 00 00 02 00 -T 5E 02 00 00 65 6C 00 +T 53 02 00 00 72 00 R 00 00 02 00 -T 61 02 00 00 +T 55 02 00 00 R 00 00 02 00 -T 61 02 00 00 3A 20 62 61 64 20 69 64 65 6E 74 +T 55 02 00 00 62 61 64 20 62 72 65 61 6B 2F 63 R 00 00 02 00 -T 6C 02 00 00 69 66 69 65 72 00 +T 60 02 00 00 6F 6E 74 69 6E 75 65 20 6C 65 76 R 00 00 02 00 -T 72 02 00 00 +T 6B 02 00 00 65 6C 00 R 00 00 02 00 -T 72 02 00 00 73 68 69 66 74 00 +T 6E 02 00 00 R 00 00 02 00 -T 78 02 00 00 +T 6E 02 00 00 3A 20 62 61 64 20 69 64 65 6E 74 R 00 00 02 00 -T 78 02 00 00 65 78 65 63 00 +T 79 02 00 00 69 66 69 65 72 00 R 00 00 02 00 -T 7D 02 00 00 +T 7F 02 00 00 R 00 00 02 00 -T 7D 02 00 00 77 61 69 74 00 +T 7F 02 00 00 73 68 69 66 74 00 R 00 00 02 00 -T 82 02 00 00 +T 85 02 00 00 R 00 00 02 00 -T 82 02 00 00 72 65 61 64 00 +T 85 02 00 00 65 78 65 63 00 R 00 00 02 00 -T 87 02 00 00 +T 8A 02 00 00 R 00 00 02 00 -T 87 02 00 00 65 76 61 6C 00 +T 8A 02 00 00 77 61 69 74 00 R 00 00 02 00 -T 8C 02 00 00 +T 8F 02 00 00 R 00 00 02 00 -T 8C 02 00 00 74 72 61 70 00 +T 8F 02 00 00 72 65 61 64 00 R 00 00 02 00 -T 91 02 00 00 +T 94 02 00 00 R 00 00 02 00 -T 91 02 00 00 62 72 65 61 6B 00 +T 94 02 00 00 65 76 61 6C 00 R 00 00 02 00 -T 97 02 00 00 +T 99 02 00 00 R 00 00 02 00 -T 97 02 00 00 63 6F 6E 74 69 6E 75 65 00 +T 99 02 00 00 74 72 61 70 00 R 00 00 02 00 -T A0 02 00 00 +T 9E 02 00 00 R 00 00 02 00 -T A0 02 00 00 65 78 69 74 00 +T 9E 02 00 00 62 72 65 61 6B 00 R 00 00 02 00 -T A5 02 00 00 +T A4 02 00 00 R 00 00 02 00 -T A5 02 00 00 65 78 70 6F 72 74 00 +T A4 02 00 00 63 6F 6E 74 69 6E 75 65 00 R 00 00 02 00 -T AC 02 00 00 +T AD 02 00 00 R 00 00 02 00 -T AC 02 00 00 72 65 61 64 6F 6E 6C 79 00 +T AD 02 00 00 65 78 69 74 00 R 00 00 02 00 -T B5 02 00 00 +T B2 02 00 00 R 00 00 02 00 -T B5 02 00 00 73 65 74 00 +T B2 02 00 00 65 78 70 6F 72 74 00 R 00 00 02 00 T B9 02 00 00 R 00 00 02 00 -T B9 02 00 00 2E 00 +T B9 02 00 00 72 65 61 64 6F 6E 6C 79 00 R 00 00 02 00 -T BB 02 00 00 +T C2 02 00 00 R 00 00 02 00 -T BB 02 00 00 75 6D 61 73 6B 00 +T C2 02 00 00 73 65 74 00 R 00 00 02 00 -T C1 02 00 00 +T C6 02 00 00 R 00 00 02 00 -T C1 02 00 00 6C 6F 67 69 6E 00 +T C6 02 00 00 2E 00 R 00 00 02 00 -T C7 02 00 00 +T C8 02 00 00 R 00 00 02 00 -T C7 02 00 00 6E 65 77 67 72 70 00 +T C8 02 00 00 75 6D 61 73 6B 00 R 00 00 02 00 T CE 02 00 00 R 00 00 02 00 -T CE 02 00 00 74 69 6D 65 73 00 +T CE 02 00 00 6C 6F 67 69 6E 00 +R 00 00 02 00 +T D4 02 00 00 +R 00 00 02 00 +T D4 02 00 00 6E 65 77 67 72 70 00 +R 00 00 02 00 +T DB 02 00 00 +R 00 00 02 00 +T DB 02 00 00 74 69 6D 65 73 00 R 00 00 02 00 T 00 00 00 00 R 00 00 03 00 @@ -4219,43 +4223,43 @@ T 16 00 00 00 6B 00 00 00 78 00 00 00 00 00 R 00 00 04 00 00 04 02 00 00 08 02 00 T 1C 00 00 00 88 00 00 00 94 00 00 00 R 00 00 04 00 00 04 02 00 00 08 02 00 -T 20 00 00 00 00 02 00 00 A1 15 00 00 +T 20 00 00 00 0D 02 00 00 A1 15 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 25 00 00 00 EA 01 00 00 A7 15 00 00 +T 25 00 00 00 F7 01 00 00 A7 15 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 2A 00 00 00 72 02 00 00 33 16 00 00 +T 2A 00 00 00 7F 02 00 00 33 16 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 2F 00 00 00 78 02 00 00 67 18 00 00 +T 2F 00 00 00 85 02 00 00 67 18 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 34 00 00 00 7D 02 00 00 6D 1A 00 00 +T 34 00 00 00 8A 02 00 00 6D 1A 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 39 00 00 00 82 02 00 00 D5 1A 00 00 +T 39 00 00 00 8F 02 00 00 D5 1A 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 3E 00 00 00 87 02 00 00 1A 1C 00 00 +T 3E 00 00 00 94 02 00 00 1A 1C 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 43 00 00 00 8C 02 00 00 40 1C 00 00 +T 43 00 00 00 99 02 00 00 40 1C 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 48 00 00 00 91 02 00 00 B5 1F 00 00 +T 48 00 00 00 9E 02 00 00 B5 1F 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 4D 00 00 00 97 02 00 00 CD 1F 00 00 +T 4D 00 00 00 A4 02 00 00 CD 1F 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 52 00 00 00 A0 02 00 00 83 20 00 00 +T 52 00 00 00 AD 02 00 00 83 20 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 57 00 00 00 A5 02 00 00 CC 20 00 00 +T 57 00 00 00 B2 02 00 00 CC 20 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 5C 00 00 00 AC 02 00 00 EE 20 00 00 +T 5C 00 00 00 B9 02 00 00 EE 20 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 61 00 00 00 B5 02 00 00 A4 21 00 00 +T 61 00 00 00 C2 02 00 00 A4 21 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 66 00 00 00 B9 02 00 00 29 19 00 00 +T 66 00 00 00 C6 02 00 00 29 19 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 6B 00 00 00 BB 02 00 00 84 17 00 00 +T 6B 00 00 00 C8 02 00 00 84 17 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 70 00 00 00 C1 02 00 00 E4 16 00 00 +T 70 00 00 00 CE 02 00 00 E4 16 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 75 00 00 00 C7 02 00 00 E4 16 00 00 +T 75 00 00 00 D4 02 00 00 E4 16 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 -T 7A 00 00 00 CE 02 00 00 0C 24 00 00 00 00 00 +T 7A 00 00 00 DB 02 00 00 0C 24 00 00 00 00 00 R 00 00 04 00 00 04 02 00 48 08 01 00 T 82 00 00 00 00 00 R 00 00 04 00 diff --git a/src/sh/msh/sh4.c b/src/sh/msh/sh4.c index 006650cc..619ac5ac 100644 --- a/src/sh/msh/sh4.c +++ b/src/sh/msh/sh4.c @@ -365,7 +365,11 @@ int quoted; return(0); if ((i = fork()) == -1) { closepipe(pf); +#if 1 /* Nick */ + err("can't fork - try again"); +#else err("try again"); +#endif return(0); } if (i != 0) { @@ -481,6 +485,10 @@ register char *pp; struct dirent *de; char dname[NAME_MAX+1]; struct stat dbuf; +#if 1 /* Nick, preallocate buffers, as msh doesn't like sharing its heap */ + DIR dir; + struct dirent dd; +#endif for (np = we; np != pp; pp--) if (pp[-1] == '/') @@ -492,14 +500,22 @@ register char *pp; for (gp = cp = space(strlen(pp)+1); *np && *np != '/';) *cp++ = *np++; *cp = '\0'; +#if 1 /* Nick, preallocate buffers, as msh doesn't like sharing its heap */ + dirp = nick_opendir(dp, &dir, &dd); +#else dirp = opendir(dp); +#endif if (dirp == 0) { DELETE(dp); DELETE(gp); return; } dname[NAME_MAX] = '\0'; +#if 1 /* Nick, preallocate buffers, as msh doesn't like sharing its heap */ + while ((de=nick_readdir(dirp))!=NULL) { +#else while ((de=readdir(dirp))!=NULL) { +#endif /* XXX Hmmm... What this could be? (abial) */ /* if (ent[j].d_ino == 0) @@ -523,7 +539,11 @@ register char *pp; nl = addword(name, nl); } } +#if 1 /* Nick, preallocate buffers, as msh doesn't like sharing its heap */ + nick_closedir(dirp); +#else closedir(dirp); +#endif DELETE(dp); DELETE(gp); } diff --git a/src/sh/msh/sh4.rel b/src/sh/msh/sh4.rel index 3c570d27..7f418374 100644 --- a/src/sh/msh/sh4.rel +++ b/src/sh/msh/sh4.rel @@ -23,16 +23,16 @@ S ?BANK_LEAVE_DIRECT_L08 Ref00000000 S remap Ref00000000 S prs Ref00000000 S letnum Ref00000000 -S closedir Ref00000000 S close Ref00000000 S strlen Ref00000000 S pushio Ref00000000 S strcmp Ref00000000 +S nick_closedir Ref00000000 S ?LEAVE_DIRECT_L09 Ref00000000 S lookup Ref00000000 S flag Ref00000000 -S readdir Ref00000000 S dolchar Ref00000000 +S nick_readdir Ref00000000 S openpipe Ref00000000 S gflg Ref00000000 S onecommand Ref00000000 @@ -51,11 +51,11 @@ S errpt Ref00000000 S iostack Ref00000000 S temparg Ref00000000 S ?SS_CMP_L02 Ref00000000 -S opendir Ref00000000 S vlist Ref00000000 S fork Ref00000000 S gravechar Ref00000000 S gmatch Ref00000000 +S nick_opendir Ref00000000 S dolv Ref00000000 S ?US_DIV_L02 Ref00000000 S ?CL64180B_4_06_L00 Ref00000000 @@ -72,23 +72,23 @@ S signal Ref00000000 S .__.ABS. Def00000000 S readc Ref00000000 A _DEFAULT size 0 flags 0 -A CODE size 1A5B flags 0 +A CODE size 1A67 flags 0 S evalstr Def0000022A S makenv Def000001A6 S globname Def00001011 -S newword Def0000148D +S newword Def00001499 S unquote Def00000CF0 -S glob0 Def00001626 -S glob1 Def00001661 -S glob2 Def00001923 -S glob3 Def00001986 +S glob0 Def00001632 +S glob1 Def0000166D +S glob2 Def0000192F +S glob3 Def00001992 S glob Def00000D2C -S addword Def000014CA +S addword Def000014D6 S eval Def00000000 S subgetc Def000006B6 -S getwords Def00001599 -S memcopy Def00001A10 -A CSTR size 92 flags 0 +S getwords Def000015A5 +S memcopy Def00001A1C +A CSTR size 9F flags 0 A UDATA0 size 9 flags 0 S globv Def00000007 S func Def00000004 @@ -188,7 +188,7 @@ T EB 00 00 00 R 00 00 01 00 T EB 00 00 00 DD 4E EE DD 46 EF 11 00 00 3E R 00 00 01 00 -T F5 00 00 00 CA 14 00 00 21 CA 14 00 00 CD +T F5 00 00 00 D6 14 00 00 21 D6 14 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T FA 00 00 00 00 00 00 00 DD 75 EE DD 74 EF R 00 00 01 00 02 04 26 00 @@ -234,11 +234,11 @@ T 5D 01 00 00 R 00 00 01 00 T 5D 01 00 00 DD 4E EE DD 46 EF 11 00 00 3E R 00 00 01 00 -T 67 01 00 00 CA 14 00 00 21 CA 14 00 00 CD +T 67 01 00 00 D6 14 00 00 21 D6 14 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 6C 01 00 00 00 00 00 00 DD 75 EE DD 74 EF EB R 00 00 01 00 02 04 26 00 -T 75 01 00 00 3E 99 15 00 00 21 99 15 00 00 CD +T 75 01 00 00 3E A5 15 00 00 21 A5 15 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 7B 01 00 00 00 00 00 00 DD 75 F0 DD 74 F1 3E R 00 00 01 00 02 04 26 00 @@ -269,7 +269,7 @@ R 00 00 01 00 T A6 01 00 00 CD 00 00 00 00 FC FF AF DD 77 FC R 00 00 01 00 02 05 2D 00 T AF 01 00 00 DD 77 FD 2A 00 00 00 00 DD 75 FE -R 00 00 01 00 02 08 33 00 +R 00 00 01 00 02 08 32 00 T B8 01 00 00 DD 74 FF R 00 00 01 00 T BB 01 00 00 @@ -286,9 +286,9 @@ T D2 01 00 00 R 00 00 01 00 T D2 01 00 00 DD 4E FC DD 46 FD DD 6E FE DD 66 R 00 00 01 00 -T DD 01 00 00 FF 23 23 5E 23 56 3E CA 14 00 00 +T DD 01 00 00 FF 23 23 5E 23 56 3E D6 14 00 00 R 00 00 01 00 29 0B 01 00 -T E5 01 00 00 21 CA 14 00 00 CD 00 00 00 00 DD +T E5 01 00 00 21 D6 14 00 00 CD 00 00 00 00 DD R 00 00 01 00 00 05 01 00 02 0A 26 00 T EC 01 00 00 75 FC DD 74 FD R 00 00 01 00 @@ -302,11 +302,11 @@ T 07 02 00 00 R 00 00 01 00 T 07 02 00 00 DD 4E FC DD 46 FD 11 00 00 3E R 00 00 01 00 -T 11 02 00 00 CA 14 00 00 21 CA 14 00 00 CD +T 11 02 00 00 D6 14 00 00 21 D6 14 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 16 02 00 00 00 00 00 00 DD 75 FC DD 74 FD EB R 00 00 01 00 02 04 26 00 -T 1F 02 00 00 3E 99 15 00 00 21 99 15 00 00 CD +T 1F 02 00 00 3E A5 15 00 00 21 A5 15 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 25 02 00 00 00 00 00 00 C3 00 00 00 00 R 00 00 01 00 02 04 26 00 02 09 12 00 @@ -422,9 +422,9 @@ T 35 03 00 00 R 00 00 01 00 T 35 03 00 00 DD 6E 04 DD 66 05 4E 23 46 DD 5E R 00 00 01 00 -T 40 03 00 00 02 DD 56 03 3E CA 14 00 00 21 +T 40 03 00 00 02 DD 56 03 3E D6 14 00 00 21 R 00 00 01 00 29 09 01 00 -T 47 03 00 00 CA 14 00 00 CD 00 00 00 00 E5 DD +T 47 03 00 00 D6 14 00 00 CD 00 00 00 00 E5 DD R 00 00 01 00 00 04 01 00 02 09 26 00 T 4E 03 00 00 6E 04 DD 66 05 C1 71 23 70 21 R 00 00 01 00 @@ -449,9 +449,9 @@ R 00 00 01 00 02 0B 30 00 T 84 03 00 00 0E 00 00 00 00 C5 21 00 00 00 00 R 00 00 01 00 2B 05 3A 00 02 0B 3A 00 T 8A 03 00 00 E5 11 00 00 00 00 3E 00 00 00 00 -R 00 00 01 00 02 06 30 00 2B 0B 19 00 +R 00 00 01 00 02 06 30 00 2B 0B 18 00 T 90 03 00 00 21 00 00 00 00 CD 00 00 00 00 E1 -R 00 00 01 00 02 05 19 00 02 0A 26 00 +R 00 00 01 00 02 05 18 00 02 0A 26 00 T 97 03 00 00 E1 2A 04 00 00 00 22 02 00 00 00 R 00 00 01 00 02 06 07 00 02 0B 07 00 T 9E 03 00 00 @@ -496,9 +496,9 @@ T FD 03 00 00 R 00 00 01 00 T FD 03 00 00 DD 6E 04 DD 66 05 4E 23 46 DD 5E R 00 00 01 00 -T 08 04 00 00 02 DD 56 03 3E CA 14 00 00 21 +T 08 04 00 00 02 DD 56 03 3E D6 14 00 00 21 R 00 00 01 00 29 09 01 00 -T 0F 04 00 00 CA 14 00 00 CD 00 00 00 00 E5 DD +T 0F 04 00 00 D6 14 00 00 CD 00 00 00 00 E5 DD R 00 00 01 00 00 04 01 00 02 09 26 00 T 16 04 00 00 6E 04 DD 66 05 C1 71 23 70 18 22 R 00 00 01 00 @@ -1117,11 +1117,11 @@ R 00 00 01 00 02 0B 07 00 T 17 09 00 00 2A 00 00 00 00 23 23 22 R 00 00 01 00 02 05 37 00 T 1D 09 00 00 02 00 00 00 0E 00 00 00 00 C5 21 -R 00 00 01 00 02 04 30 00 2B 09 1F 00 +R 00 00 01 00 02 04 30 00 2B 09 1E 00 T 23 09 00 00 00 00 00 00 E5 11 00 00 00 00 3E -R 00 00 01 00 02 04 1F 00 02 0A 30 00 +R 00 00 01 00 02 04 1E 00 02 0A 30 00 T 2A 09 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 19 00 02 09 19 00 +R 00 00 01 00 2B 04 18 00 02 09 18 00 T 2F 09 00 00 00 00 00 00 E1 E1 21 00 00 C3 R 00 00 01 00 02 04 26 00 T 37 09 00 00 B2 0A 00 00 @@ -1273,7 +1273,7 @@ R 00 00 01 00 T 9F 0A 00 00 4F C5 E5 11 00 00 00 00 3E R 00 00 01 00 02 08 30 00 T A6 0A 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 19 00 02 09 19 00 +R 00 00 01 00 2B 04 18 00 02 09 18 00 T AB 0A 00 00 00 00 00 00 E1 E1 21 00 00 R 00 00 01 00 02 04 26 00 T B2 0A 00 00 @@ -1327,7 +1327,7 @@ R 00 00 01 00 00 08 01 00 T 16 0B 00 00 R 00 00 01 00 T 16 0B 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 34 00 02 0A 34 00 +R 00 00 01 00 2B 05 33 00 02 0A 33 00 T 1C 0B 00 00 00 00 00 00 DD 75 FA DD 74 FB 7D R 00 00 01 00 02 04 26 00 T 25 0B 00 00 A4 3C 20 1F @@ -1357,7 +1357,7 @@ R 00 00 01 00 T 64 0B 00 00 DD 70 F9 71 23 70 DD 5E FE DD 56 R 00 00 01 00 T 6F 0B 00 00 FF 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 17 00 02 0B 17 00 +R 00 00 01 00 2B 06 16 00 02 0B 16 00 T 75 0B 00 00 CD 00 00 00 00 DD 5E FC DD 56 FD R 00 00 01 00 02 05 26 00 T 7E 0B 00 00 3E 00 00 00 00 21 00 00 00 00 CD @@ -1371,13 +1371,13 @@ R 00 00 01 00 02 05 29 00 T 98 0B 00 00 R 00 00 01 00 T 98 0B 00 00 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 05 35 00 02 0A 35 00 +R 00 00 01 00 2B 05 34 00 02 0A 34 00 T 9D 0B 00 00 R 00 00 01 00 T 9D 0B 00 00 4F C5 E5 11 00 00 00 00 3E R 00 00 01 00 02 08 30 00 T A4 0B 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 19 00 02 09 19 00 +R 00 00 01 00 2B 04 18 00 02 09 18 00 T A9 0B 00 00 00 00 00 00 E1 E1 21 01 00 C3 R 00 00 01 00 02 04 26 00 T B1 0B 00 00 ED 0C 00 00 @@ -1479,9 +1479,9 @@ R 00 00 01 00 02 07 30 00 T C7 0C 00 00 00 00 00 00 C5 21 00 00 00 00 E5 R 00 00 01 00 2B 04 3B 00 02 0A 3B 00 T CD 0C 00 00 11 00 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 02 05 30 00 2B 0A 19 00 +R 00 00 01 00 02 05 30 00 2B 0A 18 00 T D3 0C 00 00 00 00 00 00 CD 00 00 00 00 E1 E1 -R 00 00 01 00 02 04 19 00 02 09 26 00 +R 00 00 01 00 02 04 18 00 02 09 26 00 T DA 0C 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 22 00 02 0A 22 00 T E0 0C 00 00 00 00 00 00 11 01 00 3E @@ -1594,13 +1594,13 @@ T C2 0D 00 00 5E 02 DD 56 03 3E 00 00 00 00 21 R 00 00 01 00 2B 0A 04 00 T CA 0D 00 00 00 00 00 00 CD 00 00 00 00 EB 3E R 00 00 01 00 02 04 04 00 02 09 26 00 -T D1 0D 00 00 CA 14 00 00 21 CA 14 00 00 C1 CD +T D1 0D 00 00 D6 14 00 00 21 D6 14 00 00 C1 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T D7 0D 00 00 00 00 00 00 22 00 00 00 00 R 00 00 01 00 02 04 26 00 00 09 03 00 T DC 0D 00 00 R 00 00 01 00 -T DC 0D 00 00 ED 5B 00 00 00 00 CD 0D 14 00 00 +T DC 0D 00 00 ED 5B 00 00 00 00 CD 19 14 00 00 R 00 00 01 00 00 06 03 00 00 0B 01 00 T E3 0D 00 00 7D B4 CA 1C 0F 00 00 R 00 00 01 00 00 07 01 00 @@ -1608,9 +1608,9 @@ T E8 0D 00 00 R 00 00 01 00 T E8 0D 00 00 2A 00 00 00 00 23 23 46 23 66 68 R 00 00 01 00 00 05 03 00 -T F1 0D 00 00 29 EB 3E 8D 14 00 00 21 +T F1 0D 00 00 29 EB 3E 99 14 00 00 21 R 00 00 01 00 29 07 01 00 -T F6 0D 00 00 8D 14 00 00 CD 00 00 00 00 22 +T F6 0D 00 00 99 14 00 00 CD 00 00 00 00 22 R 00 00 01 00 00 04 01 00 02 09 26 00 T FC 0D 00 00 02 00 00 00 AF DD 77 FC DD 77 FD R 00 00 01 00 00 04 03 00 @@ -1680,7 +1680,7 @@ T A5 0E 00 00 5E 23 56 3E 00 00 00 00 21 R 00 00 01 00 2B 08 04 00 T AB 0E 00 00 00 00 00 00 CD 00 00 00 00 EB 3E R 00 00 01 00 02 04 04 00 02 09 26 00 -T B2 0E 00 00 CA 14 00 00 21 CA 14 00 00 C1 CD +T B2 0E 00 00 D6 14 00 00 21 D6 14 00 00 C1 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T B8 0E 00 00 00 00 00 00 22 02 00 00 00 R 00 00 01 00 02 04 26 00 00 09 03 00 @@ -1760,15 +1760,15 @@ T 59 0F 00 00 18 C8 R 00 00 01 00 T 5B 0F 00 00 R 00 00 01 00 -T 5B 0F 00 00 0E 76 14 00 00 C5 21 76 14 00 00 +T 5B 0F 00 00 0E 82 14 00 00 C5 21 82 14 00 00 R 00 00 01 00 29 05 01 00 00 0B 01 00 T 61 0F 00 00 E5 21 02 00 E5 2A 00 00 00 00 23 R 00 00 01 00 00 0A 03 00 T 6A 0F 00 00 23 4E 23 46 21 04 00 ED 5B R 00 00 01 00 -T 73 0F 00 00 00 00 00 00 19 EB 3E 26 16 00 00 +T 73 0F 00 00 00 00 00 00 19 EB 3E 32 16 00 00 R 00 00 01 00 00 04 03 00 29 0B 01 00 -T 79 0F 00 00 21 26 16 00 00 CD 00 00 00 00 E1 +T 79 0F 00 00 21 32 16 00 00 CD 00 00 00 00 E1 R 00 00 01 00 00 05 01 00 02 0A 26 00 T 80 0F 00 00 E1 E1 2A 00 00 00 00 23 23 7E 23 R 00 00 01 00 00 07 03 00 @@ -1792,9 +1792,9 @@ T A6 0F 00 00 DD 4E 04 DD 46 05 DD 6E FC DD 66 R 00 00 01 00 T B1 0F 00 00 FD 29 ED 5B 00 00 00 00 19 11 R 00 00 01 00 00 08 03 00 -T B9 0F 00 00 04 00 19 5E 23 56 3E CA 14 00 00 +T B9 0F 00 00 04 00 19 5E 23 56 3E D6 14 00 00 R 00 00 01 00 29 0B 01 00 -T C1 0F 00 00 21 CA 14 00 00 CD 00 00 00 00 DD +T C1 0F 00 00 21 D6 14 00 00 CD 00 00 00 00 DD R 00 00 01 00 00 05 01 00 02 0A 26 00 T C8 0F 00 00 75 04 DD 74 05 DD 34 FC 20 03 DD R 00 00 01 00 @@ -1820,9 +1820,9 @@ T EB 0F 00 00 DD 4E 04 DD 46 05 DD 5E 02 DD 56 R 00 00 01 00 T F6 0F 00 00 03 3E F0 0C 00 00 21 F0 0C 00 00 R 00 00 01 00 29 06 01 00 00 0B 01 00 -T FC 0F 00 00 CD 00 00 00 00 EB 3E CA 14 00 00 +T FC 0F 00 00 CD 00 00 00 00 EB 3E D6 14 00 00 R 00 00 01 00 02 05 26 00 29 0B 01 00 -T 02 10 00 00 21 CA 14 00 00 CD 00 00 00 00 DD +T 02 10 00 00 21 D6 14 00 00 CD 00 00 00 00 DD R 00 00 01 00 00 05 01 00 02 0A 26 00 T 09 10 00 00 75 04 DD 74 05 R 00 00 01 00 @@ -1832,7 +1832,7 @@ T 0E 10 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 T 11 10 00 00 R 00 00 01 00 -T 11 10 00 00 CD 00 00 00 00 CC FE 21 00 00 39 +T 11 10 00 00 CD 00 00 00 00 AE FE 21 00 00 39 R 00 00 01 00 02 05 2D 00 T 1A 10 00 00 DD 5E 02 DD 56 03 73 23 72 R 00 00 01 00 @@ -1897,7 +1897,7 @@ R 00 00 01 00 T D5 10 00 00 04 00 39 E5 DD 5E 04 DD 56 05 3E R 00 00 01 00 T E0 10 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 18 00 02 09 18 00 +R 00 00 01 00 2B 04 17 00 02 09 17 00 T E5 10 00 00 00 00 00 00 EB 13 3E 00 00 00 00 R 00 00 01 00 02 04 26 00 2B 0B 09 00 T EB 10 00 00 21 00 00 00 00 CD 00 00 00 00 4D @@ -1928,779 +1928,781 @@ T 32 11 00 00 R 00 00 01 00 T 32 11 00 00 21 02 00 39 7E 23 66 6F 36 00 21 R 00 00 01 00 -T 3D 11 00 00 12 00 39 E5 21 0A 00 39 5E 23 56 +T 3D 11 00 00 12 00 39 E5 21 3E 01 39 E5 21 R 00 00 01 00 -T 48 11 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 32 00 02 0A 32 00 -T 4E 11 00 00 00 00 00 00 4D 44 E1 71 23 70 21 -R 00 00 01 00 02 04 26 00 -T 57 11 00 00 12 00 39 7E 23 B6 20 21 +T 47 11 00 00 38 01 39 4D 44 21 0C 00 39 5E 23 +R 00 00 01 00 +T 52 11 00 00 56 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 36 00 02 0B 36 00 +T 58 11 00 00 CD 00 00 00 00 F1 4D 44 E1 71 23 +R 00 00 01 00 02 05 26 00 +T 61 11 00 00 70 21 12 00 39 7E 23 B6 20 21 R 00 00 01 00 -T 5F 11 00 00 +T 6B 11 00 00 R 00 00 01 00 -T 5F 11 00 00 21 08 00 39 5E 23 56 3E +T 6B 11 00 00 21 08 00 39 5E 23 56 3E R 00 00 01 00 -T 67 11 00 00 00 00 00 00 21 00 00 00 00 CD +T 73 11 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 01 00 02 09 01 00 -T 6C 11 00 00 00 00 00 00 21 06 00 39 5E 23 56 +T 78 11 00 00 00 00 00 00 21 06 00 39 5E 23 56 R 00 00 01 00 02 04 26 00 -T 75 11 00 00 3E 00 00 00 00 21 00 00 00 00 CD +T 81 11 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 01 00 02 0A 01 00 -T 7B 11 00 00 00 00 00 00 C3 0B 13 00 00 +T 87 11 00 00 00 00 00 00 C3 17 13 00 00 R 00 00 01 00 02 04 26 00 00 09 01 00 -T 80 11 00 00 +T 8C 11 00 00 R 00 00 01 00 -T 80 11 00 00 DD 36 E1 00 +T 8C 11 00 00 DD 36 C3 00 R 00 00 01 00 -T 84 11 00 00 +T 90 11 00 00 R 00 00 01 00 -T 84 11 00 00 21 14 00 39 E5 21 14 00 39 5E 23 +T 90 11 00 00 21 14 00 39 E5 21 14 00 39 5E 23 R 00 00 01 00 -T 8F 11 00 00 56 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 1E 00 02 0B 1E 00 -T 95 11 00 00 CD 00 00 00 00 4D 44 E1 71 23 70 +T 9B 11 00 00 56 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 1F 00 02 0B 1F 00 +T A1 11 00 00 CD 00 00 00 00 4D 44 E1 71 23 70 R 00 00 01 00 02 05 26 00 -T 9E 11 00 00 79 B0 CA DE 12 00 00 +T AA 11 00 00 79 B0 CA EA 12 00 00 R 00 00 01 00 00 07 01 00 -T A3 11 00 00 +T AF 11 00 00 R 00 00 01 00 -T A3 11 00 00 21 FF 00 E5 21 06 00 E5 21 18 00 +T AF 11 00 00 21 FF 00 E5 21 06 00 E5 21 18 00 R 00 00 01 00 -T AE 11 00 00 39 4E 23 46 E1 09 4D 44 21 18 00 +T BA 11 00 00 39 4E 23 46 E1 09 4D 44 21 18 00 R 00 00 01 00 -T B9 11 00 00 39 5D 54 3E 00 00 00 00 21 +T C5 11 00 00 39 5D 54 3E 00 00 00 00 21 R 00 00 01 00 2B 08 0F 00 -T BF 11 00 00 00 00 00 00 CD 00 00 00 00 F1 21 +T CB 11 00 00 00 00 00 00 CD 00 00 00 00 F1 21 R 00 00 01 00 02 04 0F 00 02 09 26 00 -T C6 11 00 00 16 00 39 7E FE 2E 20 0F +T D2 11 00 00 16 00 39 7E FE 2E 20 0F R 00 00 01 00 -T CE 11 00 00 +T DA 11 00 00 R 00 00 01 00 -T CE 11 00 00 21 06 00 39 7E 23 66 6F 7E FE 2E +T DA 11 00 00 21 06 00 39 7E 23 66 6F 7E FE 2E R 00 00 01 00 -T D9 11 00 00 28 02 +T E5 11 00 00 28 02 R 00 00 01 00 -T DB 11 00 00 +T E7 11 00 00 R 00 00 01 00 -T DB 11 00 00 18 A7 +T E7 11 00 00 18 A7 R 00 00 01 00 -T DD 11 00 00 +T E9 11 00 00 R 00 00 01 00 -T DD 11 00 00 +T E9 11 00 00 R 00 00 01 00 -T DD 11 00 00 21 10 00 39 AF 77 23 77 +T E9 11 00 00 21 10 00 39 AF 77 23 77 R 00 00 01 00 -T E5 11 00 00 +T F1 11 00 00 R 00 00 01 00 -T E5 11 00 00 01 FF 80 21 10 00 39 56 23 66 6A +T F1 11 00 00 01 FF 80 21 10 00 39 56 23 66 6A R 00 00 01 00 -T F0 11 00 00 3E 80 AC 67 ED 42 30 3D +T FC 11 00 00 3E 80 AC 67 ED 42 30 3D R 00 00 01 00 -T F8 11 00 00 +T 04 12 00 00 R 00 00 01 00 -T F8 11 00 00 01 00 00 00 00 21 16 00 39 E5 21 +T 04 12 00 00 01 00 00 00 00 21 16 00 39 E5 21 R 00 00 01 00 00 05 04 00 -T 01 12 00 00 12 00 39 5E 23 56 E1 19 5E 16 00 +T 0D 12 00 00 12 00 39 5E 23 56 E1 19 5E 16 00 R 00 00 01 00 -T 0C 12 00 00 3E 00 00 00 00 21 00 00 00 00 CD +T 18 12 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 05 00 02 0A 05 00 -T 12 12 00 00 00 00 00 00 7D B4 28 12 +T 1E 12 00 00 00 00 00 00 7D B4 28 12 R 00 00 01 00 02 04 26 00 -T 18 12 00 00 +T 24 12 00 00 R 00 00 01 00 -T 18 12 00 00 21 16 00 39 E5 21 12 00 39 4E 23 +T 24 12 00 00 21 16 00 39 E5 21 12 00 39 4E 23 R 00 00 01 00 -T 23 12 00 00 46 E1 09 7E F6 80 77 +T 2F 12 00 00 46 E1 09 7E F6 80 77 R 00 00 01 00 -T 2A 12 00 00 +T 36 12 00 00 R 00 00 01 00 -T 2A 12 00 00 21 10 00 39 34 23 20 01 34 +T 36 12 00 00 21 10 00 39 34 23 20 01 34 R 00 00 01 00 -T 33 12 00 00 +T 3F 12 00 00 R 00 00 01 00 -T 33 12 00 00 18 B0 +T 3F 12 00 00 18 B0 R 00 00 01 00 -T 35 12 00 00 +T 41 12 00 00 R 00 00 01 00 -T 35 12 00 00 21 06 00 39 4E 23 46 21 16 00 39 +T 41 12 00 00 21 06 00 39 4E 23 46 21 16 00 39 R 00 00 01 00 -T 40 12 00 00 5D 54 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 36 00 -T 45 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 -R 00 00 01 00 02 04 36 00 02 09 26 00 -T 4C 12 00 00 CA DB 12 00 00 +T 4C 12 00 00 5D 54 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 35 00 +T 51 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 02 04 35 00 02 09 26 00 +T 58 12 00 00 CA E7 12 00 00 R 00 00 01 00 00 05 01 00 -T 4F 12 00 00 +T 5B 12 00 00 R 00 00 01 00 -T 4F 12 00 00 21 04 00 39 E5 21 02 00 39 4E 23 +T 5B 12 00 00 21 04 00 39 E5 21 02 00 39 4E 23 R 00 00 01 00 -T 5A 12 00 00 46 C5 21 1A 00 39 E5 DD 4E 04 DD +T 66 12 00 00 46 C5 21 1A 00 39 E5 DD 4E 04 DD R 00 00 01 00 -T 65 12 00 00 46 05 DD 5E 02 DD 56 03 CD +T 71 12 00 00 46 05 DD 5E 02 DD 56 03 CD R 00 00 01 00 -T 6E 12 00 00 0E 13 00 00 F1 F1 4D 44 E1 71 23 +T 7A 12 00 00 1A 13 00 00 F1 F1 4D 44 E1 71 23 R 00 00 01 00 00 04 01 00 -T 77 12 00 00 70 21 00 00 39 7E 23 66 6F AF B6 +T 83 12 00 00 70 21 00 00 39 7E 23 66 6F AF B6 R 00 00 01 00 -T 82 12 00 00 28 41 01 00 00 00 00 21 00 00 39 +T 8E 12 00 00 28 41 01 00 00 00 00 21 00 00 39 R 00 00 01 00 00 07 04 00 -T 8B 12 00 00 5E 23 56 3E 00 00 00 00 21 +T 97 12 00 00 5E 23 56 3E 00 00 00 00 21 R 00 00 01 00 2B 08 40 00 -T 91 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +T 9D 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 R 00 00 01 00 02 04 40 00 02 09 26 00 -T 98 12 00 00 20 2B +T A4 12 00 00 20 2B R 00 00 01 00 -T 9A 12 00 00 +T A6 12 00 00 R 00 00 01 00 -T 9A 12 00 00 +T A6 12 00 00 R 00 00 01 00 -T 9A 12 00 00 +T A6 12 00 00 R 00 00 01 00 -T 9A 12 00 00 21 16 01 39 4D 44 21 04 00 39 5E +T A6 12 00 00 21 16 01 39 4D 44 21 04 00 39 5E R 00 00 01 00 -T A5 12 00 00 23 56 3E 00 00 00 00 21 +T B1 12 00 00 23 56 3E 00 00 00 00 21 R 00 00 01 00 2B 07 41 00 -T AA 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +T B6 12 00 00 00 00 00 00 CD 00 00 00 00 7D B4 R 00 00 01 00 02 04 41 00 02 09 26 00 -T B1 12 00 00 28 12 +T BD 12 00 00 28 12 R 00 00 01 00 -T B3 12 00 00 +T BF 12 00 00 R 00 00 01 00 -T B3 12 00 00 21 04 00 39 5E 23 56 3E +T BF 12 00 00 21 04 00 39 5E 23 56 3E R 00 00 01 00 -T BB 12 00 00 00 00 00 00 21 00 00 00 00 CD +T C7 12 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 01 00 02 09 01 00 -T C0 12 00 00 00 00 00 00 C3 84 11 00 00 +T CC 12 00 00 00 00 00 00 C3 90 11 00 00 R 00 00 01 00 02 04 26 00 00 09 01 00 -T C5 12 00 00 +T D1 12 00 00 R 00 00 01 00 -T C5 12 00 00 +T D1 12 00 00 R 00 00 01 00 -T C5 12 00 00 ED 4B 02 00 00 00 21 04 00 39 5E +T D1 12 00 00 ED 4B 02 00 00 00 21 04 00 39 5E R 00 00 01 00 00 06 03 00 -T CE 12 00 00 23 56 3E CA 14 00 00 21 +T DA 12 00 00 23 56 3E D6 14 00 00 21 R 00 00 01 00 29 07 01 00 -T D3 12 00 00 CA 14 00 00 CD 00 00 00 00 22 +T DF 12 00 00 D6 14 00 00 CD 00 00 00 00 22 R 00 00 01 00 00 04 01 00 02 09 26 00 -T D9 12 00 00 02 00 00 00 +T E5 12 00 00 02 00 00 00 R 00 00 01 00 00 04 03 00 -T DB 12 00 00 +T E7 12 00 00 R 00 00 01 00 -T DB 12 00 00 C3 84 11 00 00 +T E7 12 00 00 C3 90 11 00 00 R 00 00 01 00 00 05 01 00 -T DE 12 00 00 +T EA 12 00 00 R 00 00 01 00 -T DE 12 00 00 21 12 00 39 5E 23 56 3E +T EA 12 00 00 21 12 00 39 5E 23 56 3E R 00 00 01 00 -T E6 12 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 16 00 02 09 16 00 -T EB 12 00 00 00 00 00 00 21 08 00 39 5E 23 56 +T F2 12 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 1A 00 02 09 1A 00 +T F7 12 00 00 00 00 00 00 21 08 00 39 5E 23 56 R 00 00 01 00 02 04 26 00 -T F4 12 00 00 3E 00 00 00 00 21 00 00 00 00 CD +T 00 13 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 01 00 02 0A 01 00 -T FA 12 00 00 00 00 00 00 21 06 00 39 5E 23 56 +T 06 13 00 00 00 00 00 00 21 06 00 39 5E 23 56 R 00 00 01 00 02 04 26 00 -T 03 13 00 00 3E 00 00 00 00 21 00 00 00 00 CD +T 0F 13 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 05 01 00 02 0A 01 00 -T 09 13 00 00 00 00 00 00 +T 15 13 00 00 00 00 00 00 R 00 00 01 00 02 04 26 00 -T 0B 13 00 00 +T 17 13 00 00 R 00 00 01 00 -T 0B 13 00 00 C3 00 00 00 00 +T 17 13 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 -T 0E 13 00 00 +T 1A 13 00 00 R 00 00 01 00 -T 0E 13 00 00 CD 00 00 00 00 FA FF DD 5E 0A DD +T 1A 13 00 00 CD 00 00 00 00 FA FF DD 5E 0A DD R 00 00 01 00 02 05 2D 00 -T 17 13 00 00 56 0B 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 18 00 -T 1C 13 00 00 00 00 00 00 CD 00 00 00 00 E5 DD -R 00 00 01 00 02 04 18 00 02 09 26 00 -T 23 13 00 00 5E 08 DD 56 09 3E 00 00 00 00 21 -R 00 00 01 00 2B 0A 18 00 -T 2B 13 00 00 00 00 00 00 CD 00 00 00 00 EB E1 -R 00 00 01 00 02 04 18 00 02 09 26 00 -T 32 13 00 00 19 E5 DD 5E 02 DD 56 03 69 60 A7 -R 00 00 01 00 -T 3D 13 00 00 ED 52 4D 44 E1 09 EB 13 13 3E -R 00 00 01 00 -T 47 13 00 00 00 00 00 00 21 00 00 00 00 CD +T 23 13 00 00 56 0B 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 17 00 +T 28 13 00 00 00 00 00 00 CD 00 00 00 00 E5 DD +R 00 00 01 00 02 04 17 00 02 09 26 00 +T 2F 13 00 00 5E 08 DD 56 09 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 17 00 +T 37 13 00 00 00 00 00 00 CD 00 00 00 00 EB E1 +R 00 00 01 00 02 04 17 00 02 09 26 00 +T 3E 13 00 00 19 E5 DD 5E 02 DD 56 03 69 60 A7 +R 00 00 01 00 +T 49 13 00 00 ED 52 4D 44 E1 09 EB 13 13 3E +R 00 00 01 00 +T 53 13 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 09 00 02 09 09 00 -T 4C 13 00 00 00 00 00 00 DD 75 FC DD 74 FD DD +T 58 13 00 00 00 00 00 00 DD 75 FC DD 74 FD DD R 00 00 01 00 02 04 26 00 -T 55 13 00 00 75 FA DD 74 FB DD 6E 02 DD 66 03 +T 61 13 00 00 75 FA DD 74 FB DD 6E 02 DD 66 03 R 00 00 01 00 -T 60 13 00 00 DD 75 FE DD 74 FF +T 6C 13 00 00 DD 75 FE DD 74 FF R 00 00 01 00 -T 66 13 00 00 +T 72 13 00 00 R 00 00 01 00 -T 66 13 00 00 DD 6E 04 DD 66 05 DD 4E FE DD 46 +T 72 13 00 00 DD 6E 04 DD 66 05 DD 4E FE DD 46 R 00 00 01 00 -T 71 13 00 00 FF A7 ED 42 28 20 +T 7D 13 00 00 FF A7 ED 42 28 20 R 00 00 01 00 -T 77 13 00 00 +T 83 13 00 00 R 00 00 01 00 -T 77 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T 83 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T 82 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 +T 8E 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 R 00 00 01 00 -T 8D 13 00 00 DD 75 FC DD 74 FD 2B 70 18 CF +T 99 13 00 00 DD 75 FC DD 74 FD 2B 70 18 CF R 00 00 01 00 -T 97 13 00 00 +T A3 13 00 00 R 00 00 01 00 -T 97 13 00 00 DD 6E 08 DD 66 09 DD 75 FE DD 74 +T A3 13 00 00 DD 6E 08 DD 66 09 DD 75 FE DD 74 R 00 00 01 00 -T A2 13 00 00 FF +T AE 13 00 00 FF R 00 00 01 00 -T A3 13 00 00 +T AF 13 00 00 R 00 00 01 00 -T A3 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T AF 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T AE 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 +T BA 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 R 00 00 01 00 -T B9 13 00 00 DD 75 FC DD 74 FD 2B 70 04 05 28 +T C5 13 00 00 DD 75 FC DD 74 FD 2B 70 04 05 28 R 00 00 01 00 -T C4 13 00 00 02 +T D0 13 00 00 02 R 00 00 01 00 -T C5 13 00 00 +T D1 13 00 00 R 00 00 01 00 -T C5 13 00 00 18 DC +T D1 13 00 00 18 DC R 00 00 01 00 -T C7 13 00 00 +T D3 13 00 00 R 00 00 01 00 -T C7 13 00 00 DD 6E FC DD 66 FD 2B DD 75 FC DD +T D3 13 00 00 DD 6E FC DD 66 FD 2B DD 75 FC DD R 00 00 01 00 -T D2 13 00 00 74 FD DD 6E 0A DD 66 0B DD 75 FE +T DE 13 00 00 74 FD DD 6E 0A DD 66 0B DD 75 FE R 00 00 01 00 -T DD 13 00 00 DD 74 FF +T E9 13 00 00 DD 74 FF R 00 00 01 00 -T E0 13 00 00 +T EC 13 00 00 R 00 00 01 00 -T E0 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T EC 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T EB 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 +T F7 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 23 R 00 00 01 00 -T F6 13 00 00 DD 75 FC DD 74 FD 2B 70 04 05 28 +T 02 14 00 00 DD 75 FC DD 74 FD 2B 70 04 05 28 R 00 00 01 00 -T 01 14 00 00 02 +T 0D 14 00 00 02 R 00 00 01 00 -T 02 14 00 00 +T 0E 14 00 00 R 00 00 01 00 -T 02 14 00 00 18 DC +T 0E 14 00 00 18 DC R 00 00 01 00 -T 04 14 00 00 +T 10 14 00 00 R 00 00 01 00 -T 04 14 00 00 DD 6E FA DD 66 FB C3 00 00 00 00 +T 10 14 00 00 DD 6E FA DD 66 FB C3 00 00 00 00 R 00 00 01 00 02 0B 1B 00 -T 0D 14 00 00 +T 19 14 00 00 R 00 00 01 00 -T 0D 14 00 00 CD 00 00 00 00 FC FF 21 04 00 DD +T 19 14 00 00 CD 00 00 00 00 FC FF 21 04 00 DD R 00 00 01 00 02 05 2D 00 -T 16 14 00 00 4E 02 DD 46 03 09 DD 75 FE DD 74 +T 22 14 00 00 4E 02 DD 46 03 09 DD 75 FE DD 74 R 00 00 01 00 -T 21 14 00 00 FF AF DD 77 FC DD 77 FD +T 2D 14 00 00 FF AF DD 77 FC DD 77 FD R 00 00 01 00 -T 29 14 00 00 +T 35 14 00 00 R 00 00 01 00 -T 29 14 00 00 DD 6E 02 DD 66 03 23 23 4E 23 46 +T 35 14 00 00 DD 6E 02 DD 66 03 23 23 4E 23 46 R 00 00 01 00 -T 34 14 00 00 DD 6E FC DD 66 FD CD 00 00 00 00 +T 40 14 00 00 DD 6E FC DD 66 FD CD 00 00 00 00 R 00 00 01 00 02 0B 31 00 -T 3D 14 00 00 30 31 +T 49 14 00 00 30 31 R 00 00 01 00 -T 3F 14 00 00 +T 4B 14 00 00 R 00 00 01 00 -T 3F 14 00 00 DD 6E FE DD 66 FF 4D 44 03 03 DD +T 4B 14 00 00 DD 6E FE DD 66 FF 4D 44 03 03 DD R 00 00 01 00 -T 4A 14 00 00 71 FE DD 70 FF 4E 23 46 11 +T 56 14 00 00 71 FE DD 70 FF 4E 23 46 11 R 00 00 01 00 -T 53 14 00 00 00 00 00 00 3E 00 00 00 00 21 +T 5F 14 00 00 00 00 00 00 3E 00 00 00 00 21 R 00 00 01 00 00 04 04 00 2B 09 40 00 -T 58 14 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +T 64 14 00 00 00 00 00 00 CD 00 00 00 00 7D B4 R 00 00 01 00 02 04 40 00 02 09 26 00 -T 5F 14 00 00 28 05 +T 6B 14 00 00 28 05 R 00 00 01 00 -T 61 14 00 00 +T 6D 14 00 00 R 00 00 01 00 -T 61 14 00 00 21 01 00 18 0D +T 6D 14 00 00 21 01 00 18 0D R 00 00 01 00 -T 66 14 00 00 +T 72 14 00 00 R 00 00 01 00 -T 66 14 00 00 DD 34 FC 20 03 DD 34 FD +T 72 14 00 00 DD 34 FC 20 03 DD 34 FD R 00 00 01 00 -T 6E 14 00 00 +T 7A 14 00 00 R 00 00 01 00 -T 6E 14 00 00 18 B9 +T 7A 14 00 00 18 B9 R 00 00 01 00 -T 70 14 00 00 +T 7C 14 00 00 R 00 00 01 00 -T 70 14 00 00 21 00 00 +T 7C 14 00 00 21 00 00 R 00 00 01 00 -T 73 14 00 00 +T 7F 14 00 00 R 00 00 01 00 -T 73 14 00 00 C3 00 00 00 00 +T 7F 14 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 1B 00 -T 76 14 00 00 +T 82 14 00 00 R 00 00 01 00 -T 76 14 00 00 CD 00 00 00 00 69 60 4E 23 46 EB +T 82 14 00 00 CD 00 00 00 00 69 60 4E 23 46 EB R 00 00 01 00 02 05 25 00 -T 7F 14 00 00 5E 23 56 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 1A 00 -T 85 14 00 00 00 00 00 00 CD 00 00 00 00 C3 -R 00 00 01 00 02 04 1A 00 02 09 26 00 -T 8B 14 00 00 00 00 00 00 +T 8B 14 00 00 5E 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 19 00 +T 91 14 00 00 00 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 02 04 19 00 02 09 26 00 +T 97 14 00 00 00 00 00 00 R 00 00 01 00 02 04 12 00 -T 8D 14 00 00 +T 99 14 00 00 R 00 00 01 00 -T 8D 14 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD +T 99 14 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD R 00 00 01 00 02 05 2D 00 -T 96 14 00 00 66 03 29 01 06 00 09 EB 3E +T A2 14 00 00 66 03 29 01 06 00 09 EB 3E R 00 00 01 00 -T 9F 14 00 00 00 00 00 00 21 00 00 00 00 CD +T AB 14 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 09 00 02 09 09 00 -T A4 14 00 00 00 00 00 00 DD 75 FE DD 74 FF DD +T B0 14 00 00 00 00 00 00 DD 75 FE DD 74 FF DD R 00 00 01 00 02 04 26 00 -T AD 14 00 00 4E 02 DD 46 03 71 23 70 DD 6E FE +T B9 14 00 00 4E 02 DD 46 03 71 23 70 DD 6E FE R 00 00 01 00 -T B8 14 00 00 DD 66 FF 23 23 AF 77 23 77 DD 6E +T C4 14 00 00 DD 66 FF 23 23 AF 77 23 77 DD 6E R 00 00 01 00 -T C3 14 00 00 FE DD 66 FF C3 00 00 00 00 +T CF 14 00 00 FE DD 66 FF C3 00 00 00 00 R 00 00 01 00 02 09 12 00 -T CA 14 00 00 +T D6 14 00 00 R 00 00 01 00 -T CA 14 00 00 CD 00 00 00 00 FC FF 79 B0 20 11 +T D6 14 00 00 CD 00 00 00 00 FC FF 79 B0 20 11 R 00 00 01 00 02 05 2D 00 -T D3 14 00 00 +T DF 14 00 00 R 00 00 01 00 -T D3 14 00 00 11 10 00 3E 8D 14 00 00 21 +T DF 14 00 00 11 10 00 3E 99 14 00 00 21 R 00 00 01 00 29 08 01 00 -T D9 14 00 00 8D 14 00 00 CD 00 00 00 00 DD 75 +T E5 14 00 00 99 14 00 00 CD 00 00 00 00 DD 75 R 00 00 01 00 00 04 01 00 02 09 26 00 -T E0 14 00 00 04 DD 74 05 +T EC 14 00 00 04 DD 74 05 R 00 00 01 00 -T E4 14 00 00 +T F0 14 00 00 R 00 00 01 00 -T E4 14 00 00 DD 6E 04 DD 66 05 4E 23 46 DD 6E +T F0 14 00 00 DD 6E 04 DD 66 05 4E 23 46 DD 6E R 00 00 01 00 -T EF 14 00 00 04 DD 66 05 23 23 56 23 66 6A DD +T FB 14 00 00 04 DD 66 05 23 23 56 23 66 6A DD R 00 00 01 00 -T FA 14 00 00 75 FE DD 74 FF CD 00 00 00 00 38 +T 06 15 00 00 75 FE DD 74 FF CD 00 00 00 00 38 R 00 00 01 00 02 0A 31 00 -T 03 15 00 00 69 +T 0F 15 00 00 69 R 00 00 01 00 -T 04 15 00 00 +T 10 15 00 00 R 00 00 01 00 -T 04 15 00 00 DD 6E FE DD 66 FF 29 EB 3E +T 10 15 00 00 DD 6E FE DD 66 FF 29 EB 3E R 00 00 01 00 -T 0D 15 00 00 8D 14 00 00 21 8D 14 00 00 CD +T 19 15 00 00 99 14 00 00 21 99 14 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T 12 15 00 00 00 00 00 00 DD 75 FC DD 74 FD DD +T 1E 15 00 00 00 00 00 00 DD 75 FC DD 74 FD DD R 00 00 01 00 02 04 26 00 -T 1B 15 00 00 6E FE DD 66 FF 29 E5 21 04 00 DD +T 27 15 00 00 6E FE DD 66 FF 29 E5 21 04 00 DD R 00 00 01 00 -T 26 15 00 00 4E 04 DD 46 05 09 4D 44 21 04 00 +T 32 15 00 00 4E 04 DD 46 05 09 4D 44 21 04 00 R 00 00 01 00 -T 31 15 00 00 DD 5E FC DD 56 FD 19 EB 3E +T 3D 15 00 00 DD 5E FC DD 56 FD 19 EB 3E R 00 00 01 00 -T 3A 15 00 00 10 1A 00 00 21 10 1A 00 00 CD +T 46 15 00 00 1C 1A 00 00 21 1C 1A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T 3F 15 00 00 00 00 00 00 F1 DD 6E FC DD 66 FD +T 4B 15 00 00 00 00 00 00 F1 DD 6E FC DD 66 FD R 00 00 01 00 02 04 26 00 -T 48 15 00 00 23 23 DD 4E FE DD 46 FF 71 23 70 +T 54 15 00 00 23 23 DD 4E FE DD 46 FF 71 23 70 R 00 00 01 00 -T 53 15 00 00 DD 5E 04 DD 56 05 3E 00 00 00 00 +T 5F 15 00 00 DD 5E 04 DD 56 05 3E 00 00 00 00 R 00 00 01 00 2B 0B 01 00 -T 5B 15 00 00 21 00 00 00 00 CD 00 00 00 00 DD +T 67 15 00 00 21 00 00 00 00 CD 00 00 00 00 DD R 00 00 01 00 02 05 01 00 02 0A 26 00 -T 62 15 00 00 6E FC DD 66 FD DD 75 04 DD 74 05 +T 6E 15 00 00 6E FC DD 66 FD DD 75 04 DD 74 05 R 00 00 01 00 -T 6D 15 00 00 +T 79 15 00 00 R 00 00 01 00 -T 6D 15 00 00 DD 6E 04 DD 66 05 23 23 4E 23 46 +T 79 15 00 00 DD 6E 04 DD 66 05 23 23 4E 23 46 R 00 00 01 00 -T 78 15 00 00 03 70 2B 71 0B 69 60 29 DD 4E 04 +T 84 15 00 00 03 70 2B 71 0B 69 60 29 DD 4E 04 R 00 00 01 00 -T 83 15 00 00 DD 46 05 09 11 04 00 19 DD 5E 02 +T 8F 15 00 00 DD 46 05 09 11 04 00 19 DD 5E 02 R 00 00 01 00 -T 8E 15 00 00 DD 56 03 73 23 72 69 60 C3 +T 9A 15 00 00 DD 56 03 73 23 72 69 60 C3 R 00 00 01 00 -T 97 15 00 00 00 00 00 00 +T A3 15 00 00 00 00 00 00 R 00 00 01 00 02 04 12 00 -T 99 15 00 00 +T A5 15 00 00 R 00 00 01 00 -T 99 15 00 00 CD 00 00 00 00 FC FF DD 7E 02 DD +T A5 15 00 00 CD 00 00 00 00 FC FF DD 7E 02 DD R 00 00 01 00 02 05 2D 00 -T A2 15 00 00 B6 03 20 05 +T AE 15 00 00 B6 03 20 05 R 00 00 01 00 -T A6 15 00 00 +T B2 15 00 00 R 00 00 01 00 -T A6 15 00 00 21 00 00 18 78 +T B2 15 00 00 21 00 00 18 78 R 00 00 01 00 -T AB 15 00 00 +T B7 15 00 00 R 00 00 01 00 -T AB 15 00 00 DD 6E 02 DD 66 03 23 23 7E 23 B6 +T B7 15 00 00 DD 6E 02 DD 66 03 23 23 7E 23 B6 R 00 00 01 00 -T B6 15 00 00 20 13 +T C2 15 00 00 20 13 R 00 00 01 00 -T B8 15 00 00 +T C4 15 00 00 R 00 00 01 00 -T B8 15 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 +T C4 15 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 R 00 00 01 00 2B 0B 01 00 -T C0 15 00 00 21 00 00 00 00 CD 00 00 00 00 21 +T CC 15 00 00 21 00 00 00 00 CD 00 00 00 00 21 R 00 00 01 00 02 05 01 00 02 0A 26 00 -T C7 15 00 00 00 00 18 58 +T D3 15 00 00 00 00 18 58 R 00 00 01 00 -T CB 15 00 00 +T D7 15 00 00 R 00 00 01 00 -T CB 15 00 00 DD 6E 02 DD 66 03 23 23 46 23 66 +T D7 15 00 00 DD 6E 02 DD 66 03 23 23 46 23 66 R 00 00 01 00 -T D6 15 00 00 68 29 DD 75 FE DD 74 FF EB 3E +T E2 15 00 00 68 29 DD 75 FE DD 74 FF EB 3E R 00 00 01 00 -T E0 15 00 00 00 00 00 00 21 00 00 00 00 CD +T EC 15 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 09 00 02 09 09 00 -T E5 15 00 00 00 00 00 00 DD 75 FC DD 74 FD DD +T F1 15 00 00 00 00 00 00 DD 75 FC DD 74 FD DD R 00 00 01 00 02 04 26 00 -T EE 15 00 00 4E FE DD 46 FF C5 21 04 00 DD 4E +T FA 15 00 00 4E FE DD 46 FF C5 21 04 00 DD 4E R 00 00 01 00 -T F9 15 00 00 02 DD 46 03 09 4D 44 DD 5E FC DD +T 05 16 00 00 02 DD 46 03 09 4D 44 DD 5E FC DD R 00 00 01 00 -T 04 16 00 00 56 FD 3E 10 1A 00 00 21 +T 10 16 00 00 56 FD 3E 1C 1A 00 00 21 R 00 00 01 00 29 07 01 00 -T 09 16 00 00 10 1A 00 00 CD 00 00 00 00 F1 DD +T 15 16 00 00 1C 1A 00 00 CD 00 00 00 00 F1 DD R 00 00 01 00 00 04 01 00 02 09 26 00 -T 10 16 00 00 5E 02 DD 56 03 3E 00 00 00 00 21 +T 1C 16 00 00 5E 02 DD 56 03 3E 00 00 00 00 21 R 00 00 01 00 2B 0A 01 00 -T 18 16 00 00 00 00 00 00 CD 00 00 00 00 DD 6E +T 24 16 00 00 00 00 00 00 CD 00 00 00 00 DD 6E R 00 00 01 00 02 04 01 00 02 09 26 00 -T 1F 16 00 00 FC DD 66 FD +T 2B 16 00 00 FC DD 66 FD R 00 00 01 00 -T 23 16 00 00 +T 2F 16 00 00 R 00 00 01 00 -T 23 16 00 00 C3 00 00 00 00 +T 2F 16 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 -T 26 16 00 00 +T 32 16 00 00 R 00 00 01 00 -T 26 16 00 00 CD 00 00 00 00 DD 7E 0E DD 6E 0C +T 32 16 00 00 CD 00 00 00 00 DD 7E 0E DD 6E 0C R 00 00 01 00 02 05 25 00 -T 2F 16 00 00 DD 66 0D 32 06 00 00 00 22 +T 3B 16 00 00 DD 66 0D 32 06 00 00 00 22 R 00 00 01 00 00 08 03 00 -T 36 16 00 00 04 00 00 00 DD 6E 0A DD 66 0B 22 +T 42 16 00 00 04 00 00 00 DD 6E 0A DD 66 0B 22 R 00 00 01 00 00 04 03 00 -T 3F 16 00 00 07 00 00 00 D5 DD 5E 0A DD 56 0B +T 4B 16 00 00 07 00 00 00 D5 DD 5E 0A DD 56 0B R 00 00 01 00 00 04 03 00 -T 48 16 00 00 CD 00 00 00 00 EB D1 19 4D 44 DD +T 54 16 00 00 CD 00 00 00 00 EB D1 19 4D 44 DD R 00 00 01 00 02 05 08 00 -T 51 16 00 00 5E 02 DD 56 03 3E 61 16 00 00 21 +T 5D 16 00 00 5E 02 DD 56 03 3E 6D 16 00 00 21 R 00 00 01 00 29 0A 01 00 -T 59 16 00 00 61 16 00 00 CD 00 00 00 00 C3 +T 65 16 00 00 6D 16 00 00 CD 00 00 00 00 C3 R 00 00 01 00 00 04 01 00 02 09 26 00 -T 5F 16 00 00 00 00 00 00 +T 6B 16 00 00 00 00 00 00 R 00 00 01 00 02 04 12 00 -T 61 16 00 00 +T 6D 16 00 00 R 00 00 01 00 -T 61 16 00 00 CD 00 00 00 00 F2 FF 2A +T 6D 16 00 00 CD 00 00 00 00 F2 FF 2A R 00 00 01 00 02 05 2D 00 -T 67 16 00 00 07 00 00 00 DD 75 F6 DD 74 F7 +T 73 16 00 00 07 00 00 00 DD 75 F6 DD 74 F7 R 00 00 01 00 00 04 03 00 -T 6F 16 00 00 +T 7B 16 00 00 R 00 00 01 00 -T 6F 16 00 00 DD 4E 02 DD 46 03 DD 6E 04 DD 66 +T 7B 16 00 00 DD 4E 02 DD 46 03 DD 6E 04 DD 66 R 00 00 01 00 -T 7A 16 00 00 05 A7 ED 42 DD 75 FE DD 74 FF 4D +T 86 16 00 00 05 A7 ED 42 DD 75 FE DD 74 FF 4D R 00 00 01 00 -T 85 16 00 00 44 DD 6E F6 DD 66 F7 A7 ED 42 38 +T 91 16 00 00 44 DD 6E F6 DD 66 F7 A7 ED 42 38 R 00 00 01 00 -T 90 16 00 00 03 +T 9C 16 00 00 03 R 00 00 01 00 -T 91 16 00 00 +T 9D 16 00 00 R 00 00 01 00 -T 91 16 00 00 C3 00 00 00 00 +T 9D 16 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 -T 94 16 00 00 +T A0 16 00 00 R 00 00 01 00 -T 94 16 00 00 DD 6E F6 DD 66 F7 29 4D 44 DD 5E +T A0 16 00 00 DD 6E F6 DD 66 F7 29 4D 44 DD 5E R 00 00 01 00 -T 9F 16 00 00 FE DD 56 FF CD 00 00 00 00 DD 4E +T AB 16 00 00 FE DD 56 FF CD 00 00 00 00 DD 4E R 00 00 01 00 02 09 38 00 -T A8 16 00 00 F6 DD 46 F7 CD 00 00 00 00 DD 73 +T B4 16 00 00 F6 DD 46 F7 CD 00 00 00 00 DD 73 R 00 00 01 00 02 09 08 00 -T B1 16 00 00 FE DD 72 FF DD 6E 02 DD 66 03 19 +T BD 16 00 00 FE DD 72 FF DD 6E 02 DD 66 03 19 R 00 00 01 00 -T BC 16 00 00 DD 75 F8 DD 74 F9 DD 75 FA DD 74 +T C8 16 00 00 DD 75 F8 DD 74 F9 DD 75 FA DD 74 R 00 00 01 00 -T C7 16 00 00 FB DD 6E 02 DD 66 03 DD 75 F2 DD +T D3 16 00 00 FB DD 6E 02 DD 66 03 DD 75 F2 DD R 00 00 01 00 -T D2 16 00 00 74 F3 DD 4E F6 DD 46 F7 DD 6E 04 +T DE 16 00 00 74 F3 DD 4E F6 DD 46 F7 DD 6E 04 R 00 00 01 00 -T DD 16 00 00 DD 66 05 A7 ED 42 DD 75 F4 DD 74 +T E9 16 00 00 DD 66 05 A7 ED 42 DD 75 F4 DD 74 R 00 00 01 00 -T E8 16 00 00 F5 +T F4 16 00 00 F5 R 00 00 01 00 -T E9 16 00 00 +T F5 16 00 00 R 00 00 01 00 -T E9 16 00 00 DD 4E F8 DD 46 F9 DD 6E F2 DD 66 +T F5 16 00 00 DD 4E F8 DD 46 F9 DD 6E F2 DD 66 R 00 00 01 00 -T F4 16 00 00 F3 A7 ED 42 30 5A +T 00 17 00 00 F3 A7 ED 42 30 5A R 00 00 01 00 -T FA 16 00 00 +T 06 17 00 00 R 00 00 01 00 -T FA 16 00 00 DD 4E F8 DD 46 F9 DD 5E F2 DD 56 +T 06 17 00 00 DD 4E F8 DD 46 F9 DD 5E F2 DD 56 R 00 00 01 00 -T 05 17 00 00 F3 3A 06 00 00 00 2A 04 00 00 00 +T 11 17 00 00 F3 3A 06 00 00 00 2A 04 00 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 0C 17 00 00 CD 00 00 00 00 DD 75 FC DD 74 FD +T 18 17 00 00 CD 00 00 00 00 DD 75 FC DD 74 FD R 00 00 01 00 02 05 26 00 -T 15 17 00 00 7D B4 20 24 +T 21 17 00 00 7D B4 20 24 R 00 00 01 00 -T 19 17 00 00 +T 25 17 00 00 R 00 00 01 00 -T 19 17 00 00 21 06 00 39 7E DD 96 F6 77 23 7E +T 25 17 00 00 21 06 00 39 7E DD 96 F6 77 23 7E R 00 00 01 00 -T 24 17 00 00 DD 9E F7 77 2B 6E 67 4D 44 DD 5E +T 30 17 00 00 DD 9E F7 77 2B 6E 67 4D 44 DD 5E R 00 00 01 00 -T 2F 17 00 00 F2 DD 56 F3 3E 23 19 00 00 21 +T 3B 17 00 00 F2 DD 56 F3 3E 2F 19 00 00 21 R 00 00 01 00 29 09 01 00 -T 36 17 00 00 23 19 00 00 CD 00 00 00 00 18 AC +T 42 17 00 00 2F 19 00 00 CD 00 00 00 00 18 AC R 00 00 01 00 00 04 01 00 02 09 26 00 -T 3D 17 00 00 +T 49 17 00 00 R 00 00 01 00 -T 3D 17 00 00 DD CB FD 7E 28 11 +T 49 17 00 00 DD CB FD 7E 28 11 R 00 00 01 00 -T 43 17 00 00 +T 4F 17 00 00 R 00 00 01 00 -T 43 17 00 00 21 00 00 39 7E DD 86 F6 77 23 7E +T 4F 17 00 00 21 00 00 39 7E DD 86 F6 77 23 7E R 00 00 01 00 -T 4E 17 00 00 DD 8E F7 77 18 95 +T 5A 17 00 00 DD 8E F7 77 18 95 R 00 00 01 00 -T 54 17 00 00 +T 60 17 00 00 R 00 00 01 00 -T 54 17 00 00 +T 60 17 00 00 R 00 00 01 00 -T 54 17 00 00 +T 60 17 00 00 R 00 00 01 00 -T 54 17 00 00 DD 4E F4 DD 46 F5 DD 6E FA DD 66 +T 60 17 00 00 DD 4E F4 DD 46 F5 DD 6E FA DD 66 R 00 00 01 00 -T 5F 17 00 00 FB A7 ED 42 D2 54 18 00 00 +T 6B 17 00 00 FB A7 ED 42 D2 60 18 00 00 R 00 00 01 00 00 09 01 00 -T 66 17 00 00 +T 72 17 00 00 R 00 00 01 00 -T 66 17 00 00 DD 4E F4 DD 46 F5 DD 5E FA DD 56 +T 72 17 00 00 DD 4E F4 DD 46 F5 DD 5E FA DD 56 R 00 00 01 00 -T 71 17 00 00 FB 3A 06 00 00 00 2A 04 00 00 00 +T 7D 17 00 00 FB 3A 06 00 00 00 2A 04 00 00 00 R 00 00 01 00 00 06 03 00 00 0B 03 00 -T 78 17 00 00 CD 00 00 00 00 DD 75 FC DD 74 FD +T 84 17 00 00 CD 00 00 00 00 DD 75 FC DD 74 FD R 00 00 01 00 02 05 26 00 -T 81 17 00 00 7D B4 20 23 +T 8D 17 00 00 7D B4 20 23 R 00 00 01 00 -T 85 17 00 00 +T 91 17 00 00 R 00 00 01 00 -T 85 17 00 00 DD 4E F4 DD 46 F5 21 08 00 39 7E +T 91 17 00 00 DD 4E F4 DD 46 F5 21 08 00 39 7E R 00 00 01 00 -T 90 17 00 00 DD 86 F6 77 23 7E DD 8E F7 77 2B +T 9C 17 00 00 DD 86 F6 77 23 7E DD 8E F7 77 2B R 00 00 01 00 -T 9B 17 00 00 6E 67 EB 3E 23 19 00 00 21 +T A7 17 00 00 6E 67 EB 3E 2F 19 00 00 21 R 00 00 01 00 29 08 01 00 -T A1 17 00 00 23 19 00 00 CD 00 00 00 00 18 AC +T AD 17 00 00 2F 19 00 00 CD 00 00 00 00 18 AC R 00 00 01 00 00 04 01 00 02 09 26 00 -T A8 17 00 00 +T B4 17 00 00 R 00 00 01 00 -T A8 17 00 00 DD 4E FC DD 46 FD 21 00 00 CD +T B4 17 00 00 DD 4E FC DD 46 FD 21 00 00 CD R 00 00 01 00 -T B2 17 00 00 00 00 00 00 D2 42 18 00 00 +T BE 17 00 00 00 00 00 00 D2 4E 18 00 00 R 00 00 01 00 02 04 31 00 00 09 01 00 -T B7 17 00 00 +T C3 17 00 00 R 00 00 01 00 -T B7 17 00 00 DD 6E F8 DD 66 F9 DD 4E F2 DD 46 +T C3 17 00 00 DD 6E F8 DD 66 F9 DD 4E F2 DD 46 R 00 00 01 00 -T C2 17 00 00 F3 A7 ED 42 20 45 +T CE 17 00 00 F3 A7 ED 42 20 45 R 00 00 01 00 -T C8 17 00 00 +T D4 17 00 00 R 00 00 01 00 -T C8 17 00 00 DD 6E F4 DD 66 F5 E5 21 0A 00 39 +T D4 17 00 00 DD 6E F4 DD 66 F5 E5 21 0A 00 39 R 00 00 01 00 -T D3 17 00 00 7E DD 86 F6 77 23 7E DD 8E F7 77 +T DF 17 00 00 7E DD 86 F6 77 23 7E DD 8E F7 77 R 00 00 01 00 -T DE 17 00 00 2B 6E 67 4D 44 DD 5E F2 DD 56 F3 +T EA 17 00 00 2B 6E 67 4D 44 DD 5E F2 DD 56 F3 R 00 00 01 00 -T E9 17 00 00 3E 86 19 00 00 21 86 19 00 00 CD +T F5 17 00 00 3E 92 19 00 00 21 92 19 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 -T EF 17 00 00 00 00 00 00 E1 21 06 00 39 7E DD +T FB 17 00 00 00 00 00 00 E1 21 06 00 39 7E DD R 00 00 01 00 02 04 26 00 -T F8 17 00 00 86 F6 77 23 7E DD 8E F7 77 2B 6E +T 04 18 00 00 86 F6 77 23 7E DD 8E F7 77 2B 6E R 00 00 01 00 -T 03 18 00 00 67 DD 75 F2 DD 74 F3 C3 +T 0F 18 00 00 67 DD 75 F2 DD 74 F3 C3 R 00 00 01 00 -T 0B 18 00 00 54 17 00 00 +T 17 18 00 00 60 17 00 00 R 00 00 01 00 00 04 01 00 -T 0D 18 00 00 +T 19 18 00 00 R 00 00 01 00 -T 0D 18 00 00 DD 4E F4 DD 46 F5 DD 5E F2 DD 56 +T 19 18 00 00 DD 4E F4 DD 46 F5 DD 5E F2 DD 56 R 00 00 01 00 -T 18 18 00 00 F3 3E 23 19 00 00 21 23 19 00 00 +T 24 18 00 00 F3 3E 2F 19 00 00 21 2F 19 00 00 R 00 00 01 00 29 06 01 00 00 0B 01 00 -T 1E 18 00 00 CD 00 00 00 00 21 02 00 39 7E DD +T 2A 18 00 00 CD 00 00 00 00 21 02 00 39 7E DD R 00 00 01 00 02 05 26 00 -T 27 18 00 00 96 F6 77 23 7E DD 9E F7 77 21 +T 33 18 00 00 96 F6 77 23 7E DD 9E F7 77 21 R 00 00 01 00 -T 31 18 00 00 00 00 39 7E DD 86 F6 77 23 7E DD +T 3D 18 00 00 00 00 39 7E DD 86 F6 77 23 7E DD R 00 00 01 00 -T 3C 18 00 00 8E F7 77 C3 E9 16 00 00 +T 48 18 00 00 8E F7 77 C3 F5 16 00 00 R 00 00 01 00 00 08 01 00 -T 42 18 00 00 +T 4E 18 00 00 R 00 00 01 00 -T 42 18 00 00 21 02 00 39 7E DD 96 F6 77 23 7E +T 4E 18 00 00 21 02 00 39 7E DD 96 F6 77 23 7E R 00 00 01 00 -T 4D 18 00 00 DD 9E F7 77 C3 54 17 00 00 +T 59 18 00 00 DD 9E F7 77 C3 60 17 00 00 R 00 00 01 00 00 09 01 00 -T 54 18 00 00 +T 60 18 00 00 R 00 00 01 00 -T 54 18 00 00 DD 6E F8 DD 66 F9 DD 4E F2 DD 46 +T 60 18 00 00 DD 6E F8 DD 66 F9 DD 4E F2 DD 46 R 00 00 01 00 -T 5F 18 00 00 F3 A7 ED 42 20 79 +T 6B 18 00 00 F3 A7 ED 42 20 79 R 00 00 01 00 -T 65 18 00 00 +T 71 18 00 00 R 00 00 01 00 -T 65 18 00 00 DD 4E FA DD 46 FB DD 6E 04 DD 66 +T 71 18 00 00 DD 4E FA DD 46 FB DD 6E 04 DD 66 R 00 00 01 00 -T 70 18 00 00 05 A7 ED 42 4D 44 DD 5E 02 DD 56 +T 7C 18 00 00 05 A7 ED 42 4D 44 DD 5E 02 DD 56 R 00 00 01 00 -T 7B 18 00 00 03 DD 6E F8 DD 66 F9 A7 ED 52 CD +T 87 18 00 00 03 DD 6E F8 DD 66 F9 A7 ED 52 CD R 00 00 01 00 -T 86 18 00 00 00 00 00 00 38 2A +T 92 18 00 00 00 00 00 00 38 2A R 00 00 01 00 02 04 31 00 -T 8A 18 00 00 +T 96 18 00 00 R 00 00 01 00 -T 8A 18 00 00 DD 4E 04 DD 46 05 DD 6E F6 DD 66 +T 96 18 00 00 DD 4E 04 DD 46 05 DD 6E F6 DD 66 R 00 00 01 00 -T 95 18 00 00 F7 DD 5E FA DD 56 FB 19 EB 3E +T A1 18 00 00 F7 DD 5E FA DD 56 FB 19 EB 3E R 00 00 01 00 -T 9F 18 00 00 61 16 00 00 21 61 16 00 00 CD +T AB 18 00 00 6D 16 00 00 21 6D 16 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T A4 18 00 00 00 00 00 00 DD 6E F8 DD 66 F9 DD +T B0 18 00 00 00 00 00 00 DD 6E F8 DD 66 F9 DD R 00 00 01 00 02 04 26 00 -T AD 18 00 00 75 04 DD 74 05 18 27 +T B9 18 00 00 75 04 DD 74 05 18 27 R 00 00 01 00 -T B4 18 00 00 +T C0 18 00 00 R 00 00 01 00 -T B4 18 00 00 DD 4E F8 DD 46 F9 DD 5E 02 DD 56 +T C0 18 00 00 DD 4E F8 DD 46 F9 DD 5E 02 DD 56 R 00 00 01 00 -T BF 18 00 00 03 3E 61 16 00 00 21 61 16 00 00 +T CB 18 00 00 03 3E 6D 16 00 00 21 6D 16 00 00 R 00 00 01 00 29 06 01 00 00 0B 01 00 -T C5 18 00 00 CD 00 00 00 00 DD 6E F6 DD 66 F7 +T D1 18 00 00 CD 00 00 00 00 DD 6E F6 DD 66 F7 R 00 00 01 00 02 05 26 00 -T CE 18 00 00 DD 4E FA DD 46 FB 09 DD 75 02 DD +T DA 18 00 00 DD 4E FA DD 46 FB 09 DD 75 02 DD R 00 00 01 00 -T D9 18 00 00 74 03 +T E5 18 00 00 74 03 R 00 00 01 00 -T DB 18 00 00 +T E7 18 00 00 R 00 00 01 00 -T DB 18 00 00 C3 6F 16 00 00 +T E7 18 00 00 C3 7B 16 00 00 R 00 00 01 00 00 05 01 00 -T DE 18 00 00 +T EA 18 00 00 R 00 00 01 00 -T DE 18 00 00 DD 6E F2 DD 66 F3 E5 21 08 00 39 +T EA 18 00 00 DD 6E F2 DD 66 F3 E5 21 08 00 39 R 00 00 01 00 -T E9 18 00 00 7E DD 96 F6 77 23 7E DD 9E F7 77 +T F5 18 00 00 7E DD 96 F6 77 23 7E DD 9E F7 77 R 00 00 01 00 -T F4 18 00 00 2B 6E 67 4D 44 DD 5E F4 DD 56 F5 +T 00 19 00 00 2B 6E 67 4D 44 DD 5E F4 DD 56 F5 R 00 00 01 00 -T FF 18 00 00 3E 86 19 00 00 21 86 19 00 00 CD +T 0B 19 00 00 3E 92 19 00 00 21 92 19 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 -T 05 19 00 00 00 00 00 00 E1 21 08 00 39 7E DD +T 11 19 00 00 00 00 00 00 E1 21 08 00 39 7E DD R 00 00 01 00 02 04 26 00 -T 0E 19 00 00 96 F6 77 23 7E DD 9E F7 77 2B 6E +T 1A 19 00 00 96 F6 77 23 7E DD 9E F7 77 2B 6E R 00 00 01 00 -T 19 19 00 00 67 DD 75 F4 DD 74 F5 C3 +T 25 19 00 00 67 DD 75 F4 DD 74 F5 C3 R 00 00 01 00 -T 21 19 00 00 E9 16 00 00 +T 2D 19 00 00 F5 16 00 00 R 00 00 01 00 00 04 01 00 -T 23 19 00 00 +T 2F 19 00 00 R 00 00 01 00 -T 23 19 00 00 CD 00 00 00 00 F8 FF 2A +T 2F 19 00 00 CD 00 00 00 00 F8 FF 2A R 00 00 01 00 02 05 2D 00 -T 29 19 00 00 07 00 00 00 DD 75 FD DD 74 FE DD +T 35 19 00 00 07 00 00 00 DD 75 FD DD 74 FE DD R 00 00 01 00 00 04 03 00 -T 32 19 00 00 6E 02 DD 66 03 DD 75 F8 DD 74 F9 +T 3E 19 00 00 6E 02 DD 66 03 DD 75 F8 DD 74 F9 R 00 00 01 00 -T 3D 19 00 00 DD 71 FA DD 70 FB +T 49 19 00 00 DD 71 FA DD 70 FB R 00 00 01 00 -T 43 19 00 00 +T 4F 19 00 00 R 00 00 01 00 -T 43 19 00 00 DD 6E F8 DD 66 F9 46 DD 70 FC DD +T 4F 19 00 00 DD 6E F8 DD 66 F9 46 DD 70 FC DD R 00 00 01 00 -T 4E 19 00 00 6E FA DD 66 FB 4E DD 6E F8 DD 66 +T 5A 19 00 00 6E FA DD 66 FB 4E DD 6E F8 DD 66 R 00 00 01 00 -T 59 19 00 00 F9 23 DD 75 F8 DD 74 F9 2B 71 DD +T 65 19 00 00 F9 23 DD 75 F8 DD 74 F9 2B 71 DD R 00 00 01 00 -T 64 19 00 00 6E FA DD 66 FB 23 DD 75 FA DD 74 +T 70 19 00 00 6E FA DD 66 FB 23 DD 75 FA DD 74 R 00 00 01 00 -T 6F 19 00 00 FB 2B 70 DD 6E FD DD 66 FE 2B DD +T 7B 19 00 00 FB 2B 70 DD 6E FD DD 66 FE 2B DD R 00 00 01 00 -T 7A 19 00 00 75 FD DD 74 FE 7D B4 20 C0 +T 86 19 00 00 75 FD DD 74 FE 7D B4 20 C0 R 00 00 01 00 -T 83 19 00 00 +T 8F 19 00 00 R 00 00 01 00 -T 83 19 00 00 C3 00 00 00 00 +T 8F 19 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 -T 86 19 00 00 +T 92 19 00 00 R 00 00 01 00 -T 86 19 00 00 CD 00 00 00 00 F6 FF 2A +T 92 19 00 00 CD 00 00 00 00 F6 FF 2A R 00 00 01 00 02 05 2D 00 -T 8C 19 00 00 07 00 00 00 DD 75 FE DD 74 FF DD +T 98 19 00 00 07 00 00 00 DD 75 FE DD 74 FF DD R 00 00 01 00 00 04 03 00 -T 95 19 00 00 6E 02 DD 66 03 DD 75 F6 DD 74 F7 +T A1 19 00 00 6E 02 DD 66 03 DD 75 F6 DD 74 F7 R 00 00 01 00 -T A0 19 00 00 DD 71 F8 DD 70 F9 DD 6E 0A DD 66 +T AC 19 00 00 DD 71 F8 DD 70 F9 DD 6E 0A DD 66 R 00 00 01 00 -T AB 19 00 00 0B DD 75 FA DD 74 FB +T B7 19 00 00 0B DD 75 FA DD 74 FB R 00 00 01 00 -T B2 19 00 00 +T BE 19 00 00 R 00 00 01 00 -T B2 19 00 00 DD 6E F6 DD 66 F7 4E 06 00 DD 71 +T BE 19 00 00 DD 6E F6 DD 66 F7 4E 06 00 DD 71 R 00 00 01 00 -T BD 19 00 00 FC DD 70 FD DD 6E FA DD 66 FB 56 +T C9 19 00 00 FC DD 70 FD DD 6E FA DD 66 FB 56 R 00 00 01 00 -T C8 19 00 00 DD 6E F6 DD 66 F7 23 DD 75 F6 DD +T D4 19 00 00 DD 6E F6 DD 66 F7 23 DD 75 F6 DD R 00 00 01 00 -T D3 19 00 00 74 F7 2B 72 DD 6E F8 DD 66 F9 56 +T DF 19 00 00 74 F7 2B 72 DD 6E F8 DD 66 F9 56 R 00 00 01 00 -T DE 19 00 00 DD 6E FA DD 66 FB 23 DD 75 FA DD +T EA 19 00 00 DD 6E FA DD 66 FB 23 DD 75 FA DD R 00 00 01 00 -T E9 19 00 00 74 FB 2B 72 DD 6E F8 DD 66 F9 23 +T F5 19 00 00 74 FB 2B 72 DD 6E F8 DD 66 F9 23 R 00 00 01 00 -T F4 19 00 00 DD 75 F8 DD 74 F9 2B 71 DD 6E FE +T 00 1A 00 00 DD 75 F8 DD 74 F9 2B 71 DD 6E FE R 00 00 01 00 -T FF 19 00 00 DD 66 FF 2B DD 75 FE DD 74 FF 7D +T 0B 1A 00 00 DD 66 FF 2B DD 75 FE DD 74 FF 7D R 00 00 01 00 -T 0A 1A 00 00 B4 20 A5 +T 16 1A 00 00 B4 20 A5 R 00 00 01 00 -T 0D 1A 00 00 +T 19 1A 00 00 R 00 00 01 00 -T 0D 1A 00 00 C3 00 00 00 00 +T 19 1A 00 00 C3 00 00 00 00 R 00 00 01 00 02 05 12 00 -T 10 1A 00 00 +T 1C 1A 00 00 R 00 00 01 00 -T 10 1A 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD +T 1C 1A 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD R 00 00 01 00 02 05 2D 00 -T 19 1A 00 00 66 03 DD 75 FE DD 74 FF +T 25 1A 00 00 66 03 DD 75 FE DD 74 FF R 00 00 01 00 -T 21 1A 00 00 +T 2D 1A 00 00 R 00 00 01 00 -T 21 1A 00 00 DD 6E 0A DD 66 0B 2B DD 75 0A DD +T 2D 1A 00 00 DD 6E 0A DD 66 0B 2B DD 75 0A DD R 00 00 01 00 -T 2C 1A 00 00 74 0B CB 7C 20 20 +T 38 1A 00 00 74 0B CB 7C 20 20 R 00 00 01 00 -T 32 1A 00 00 +T 3E 1A 00 00 R 00 00 01 00 -T 32 1A 00 00 DD 6E 04 DD 66 05 23 DD 75 04 DD +T 3E 1A 00 00 DD 6E 04 DD 66 05 23 DD 75 04 DD R 00 00 01 00 -T 3D 1A 00 00 74 05 2B 46 DD 6E FE DD 66 FF 23 +T 49 1A 00 00 74 05 2B 46 DD 6E FE DD 66 FF 23 R 00 00 01 00 -T 48 1A 00 00 DD 75 FE DD 74 FF 2B 70 18 CF +T 54 1A 00 00 DD 75 FE DD 74 FF 2B 70 18 CF R 00 00 01 00 -T 52 1A 00 00 +T 5E 1A 00 00 R 00 00 01 00 -T 52 1A 00 00 DD 6E 02 DD 66 03 C3 00 00 00 00 +T 5E 1A 00 00 DD 6E 02 DD 66 03 C3 00 00 00 00 R 00 00 01 00 02 0B 12 00 T 00 00 00 00 R 00 00 02 00 @@ -2768,7 +2770,11 @@ T 86 00 00 00 60 00 R 00 00 02 00 T 88 00 00 00 R 00 00 02 00 -T 88 00 00 00 74 72 79 20 61 67 61 69 6E 00 +T 88 00 00 00 63 61 6E 27 74 20 66 6F 72 6B 20 +R 00 00 02 00 +T 93 00 00 00 2D 20 74 72 79 20 61 67 61 69 6E +R 00 00 02 00 +T 9E 00 00 00 00 R 00 00 02 00 T 00 00 00 00 R 00 00 03 00 diff --git a/src/sh/msh/sh5.c b/src/sh/msh/sh5.c index b41a79f5..a4e79ad1 100644 --- a/src/sh/msh/sh5.c +++ b/src/sh/msh/sh5.c @@ -4,6 +4,7 @@ #define _NSIG NSIGS /* Nick NSIG */ #include #include +#include /* Nick see prs_expand() routine */ #include "sh.h" /* -------- io.c -------- */ @@ -96,7 +97,11 @@ readc() if (multiline) return env.iop->prev = 0; if (talking && env.iop == iostack+1) +#if 1 /* Nick */ + prs_expand(prompt->value); +#else prs(prompt->value); +#endif } } if (env.iop >= iostack) @@ -391,6 +396,72 @@ register char *s; write(2, s, strlen(s)); } +#if 1 /* Nick */ +void prs_expand(char *p) + { + char *q, *r; + struct utsname name; + char buf[PATHLEN]; + + for (q = p; *q; q++) + { + if (*q == '\\') + { + write(2, p, q-p); + p = ++q; + switch (*q) + { + case '#': + p++; + if (geteuid() == 0) + { + prs("#"); + } + else + { + prs("$"); + } + break; + case 'u': + p++; + if ((r = getenv("USER")) == NULL) + { + prs("someone"); + } + else + { + prs(r); + } + break; + case 'h': + p++; + if (uname(&name) == -1) + { + prs("somehost"); + } + else + { + prs(name.nodename); + } + break; + case 'w': + p++; + if (getcwd(buf, PATHLEN) == NULL) + { + prs("somewhere"); + } + else + { + prs(buf); + } + break; + } + } + } + prs(p); + } +#endif + void putc(c) char c; @@ -561,7 +632,11 @@ int ec; env.iobase = env.iop; for (;;) { if (talking && env.iop <= iostack) +#if 1 /* Nick */ + prs_expand(cprompt->value); +#else prs(cprompt->value); +#endif next = line; while ((c = getc(ec)) != '\n' && c) { if (ec == '\'') diff --git a/src/sh/msh/sh5.rel b/src/sh/msh/sh5.rel index 66a32818..656b786f 100644 --- a/src/sh/msh/sh5.rel +++ b/src/sh/msh/sh5.rel @@ -1,11 +1,12 @@ XL4 -H 6 areas 52 global symbols +H 6 areas 58 global symbols M sh5 S evalstr Ref00000000 S cprompt Ref00000000 S ?BANK_FAST_LEAVE_L08 Ref00000000 S putn Ref00000000 S strsave Ref00000000 +S getenv Ref00000000 S err Ref00000000 S env Ref00000000 S dup Ref00000000 @@ -21,8 +22,10 @@ S newenv Ref00000000 S multiline Ref00000000 S ?BANK_LEAVE_DIRECT_L08 Ref00000000 S lseek Ref00000000 +S uname Ref00000000 S close Ref00000000 S strlen Ref00000000 +S ?C_V_SWITCH_L06 Ref00000000 S strcmp Ref00000000 S getarea Ref00000000 S ?LEAVE_DIRECT_L09 Ref00000000 @@ -34,6 +37,7 @@ S ?ENT_PARM_DIRECT_L09 Ref00000000 S ?BANK_CALL_DIRECT_L08 Ref00000000 S errno Ref00000000 S sh_itoa Ref00000000 +S geteuid Ref00000000 S ioargstack Ref00000000 S areanum Ref00000000 S talking Ref00000000 @@ -50,41 +54,43 @@ S ?CL64180B_4_06_L00 Ref00000000 S _read Ref00000000 S getpid Ref00000000 S elinep Ref00000000 +S getcwd Ref00000000 S .__.ABS. Def00000000 A _DEFAULT size 0 flags 0 -A CODE size 12D2 flags 0 +A CODE size 1451 flags 0 S herechar Def00000828 -S closepipe Def00000BAB +S closepipe Def00000D2A S linechar Def0000098D -S freehere Def0000117C -S markhere Def00000BE1 -S closeall Def00000A5B -S prn Def00000A23 -S remap Def00000A94 +S freehere Def000012FB +S markhere Def00000D60 +S closeall Def00000BDA +S prn Def00000BA2 +S remap Def00000C13 S prs Def000009DA -S tempname Def00001246 +S tempname Def000013C5 S pushio Def00000281 S eofc Def000000DA S dolchar Def00000535 -S openpipe Def00000B7A +S openpipe Def00000CF9 S unget Def000000B8 S getc Def00000000 S qgravechar Def000008AC -S gethere Def00000D28 +S gethere Def00000EA7 S setbase Def00000460 S qstrchar Def0000061F S gravechar Def00000874 +S prs_expand Def00000A07 S strchar Def000005E5 S ioecho Def00000259 S nlchar Def0000047B S wdchar Def000004C4 -S herein Def00000FB9 -S putc Def00000A07 -S closef Def00000A3D -S scraphere Def00001104 +S herein Def00001138 +S putc Def00000B86 +S closef Def00000BBC +S scraphere Def00001283 S filechar Def0000065F S readc Def0000010A -A CSTR size 92 flags 0 +A CSTR size B6 flags 0 A UDATA0 size 6 flags 0 A IDATA0 size 41C flags 0 S temparg Def0000040E @@ -92,9 +98,9 @@ A CDATA0 size 41C flags 0 T 00 00 00 00 R 00 00 01 00 T 00 00 00 00 CD 00 00 00 00 FE FF ED 4B -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 07 00 00 00 00 00 00 00 2A 00 00 00 00 A7 ED -R 00 00 01 00 02 04 06 00 02 09 30 00 +R 00 00 01 00 02 04 07 00 02 09 34 00 T 0E 00 00 00 42 30 35 R 00 00 01 00 T 11 00 00 00 @@ -104,7 +110,7 @@ R 00 00 01 00 T 11 00 00 00 3E 0A 01 00 00 21 0A 01 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 17 00 00 00 00 00 00 00 DD 75 FE DD 74 FF 3E -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 20 00 00 00 0A AD B4 28 0A DD 7E FE DD B6 FF R 00 00 01 00 T 2B 00 00 00 28 02 @@ -120,11 +126,11 @@ R 00 00 01 00 T 2F 00 00 00 R 00 00 01 00 T 2F 00 00 00 11 00 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 05 02 00 2B 0A 05 00 +R 00 00 01 00 00 05 02 00 2B 0A 06 00 T 35 00 00 00 00 00 00 00 CD 00 00 00 00 21 -R 00 00 01 00 02 04 05 00 02 09 1E 00 +R 00 00 01 00 02 04 06 00 02 09 21 00 T 3B 00 00 00 00 00 00 00 34 DD 6E FE DD 66 FF -R 00 00 01 00 02 04 1B 00 +R 00 00 01 00 02 04 1E 00 T 44 00 00 00 18 6F R 00 00 01 00 T 46 00 00 00 @@ -132,11 +138,11 @@ R 00 00 01 00 T 46 00 00 00 3E 0A 01 00 00 21 0A 01 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 4C 00 00 00 00 00 00 00 DD 75 FE DD 74 FF 3E -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 55 00 00 00 27 DD AE 02 DD B6 03 28 51 2A R 00 00 01 00 T 5F 00 00 00 04 00 00 00 01 0A 00 09 46 05 05 -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 68 00 00 00 28 45 R 00 00 01 00 T 6A 00 00 00 @@ -152,7 +158,7 @@ R 00 00 01 00 T 74 00 00 00 3E 0A 01 00 00 21 0A 01 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 T 7A 00 00 00 00 00 00 00 DD 75 FE DD 74 FF 3E -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 83 00 00 00 0A AD B4 20 1A 3E 22 DD AE 02 DD R 00 00 01 00 T 8E 00 00 00 B6 03 28 10 @@ -166,7 +172,7 @@ R 00 00 01 00 T 92 00 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 R 00 00 01 00 29 0B 01 00 T 9A 00 00 00 21 00 00 00 00 CD 00 00 00 00 18 -R 00 00 01 00 00 05 01 00 02 0A 1E 00 +R 00 00 01 00 00 05 01 00 02 0A 21 00 T A1 00 00 00 13 R 00 00 01 00 T A2 00 00 00 @@ -184,33 +190,33 @@ R 00 00 01 00 T B5 00 00 00 R 00 00 01 00 T B5 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T B8 00 00 00 R 00 00 01 00 T B8 00 00 00 CD 00 00 00 00 ED 4B 02 00 00 00 -R 00 00 01 00 02 05 1D 00 02 0B 06 00 +R 00 00 01 00 02 05 20 00 02 0B 07 00 T BF 00 00 00 2A 04 00 00 00 A7 ED 42 38 10 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T C7 00 00 00 R 00 00 01 00 T C7 00 00 00 2A 04 00 00 00 01 05 00 09 DD 4E -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T D0 00 00 00 02 DD 46 03 71 23 70 R 00 00 01 00 T D7 00 00 00 R 00 00 01 00 T D7 00 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T DA 00 00 00 R 00 00 01 00 T DA 00 00 00 C5 ED 4B 02 00 00 00 2A -R 00 00 01 00 02 07 06 00 +R 00 00 01 00 02 07 07 00 T E0 00 00 00 04 00 00 00 A7 ED 42 38 1C 2A -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T E8 00 00 00 04 00 00 00 01 05 00 09 7E 23 B6 -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T F1 00 00 00 20 0B 2A 04 00 00 00 01 07 00 09 -R 00 00 01 00 02 07 06 00 +R 00 00 01 00 02 07 07 00 T FA 00 00 00 7E B7 28 05 R 00 00 01 00 T FE 00 00 00 @@ -228,19 +234,19 @@ R 00 00 01 00 02 06 02 00 T 0A 01 00 00 R 00 00 01 00 T 0A 01 00 00 CD 00 00 00 00 FE FF -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 0F 01 00 00 R 00 00 01 00 T 0F 01 00 00 R 00 00 01 00 T 0F 01 00 00 ED 4B 02 00 00 00 2A 04 00 00 00 -R 00 00 01 00 02 06 06 00 02 0B 06 00 +R 00 00 01 00 02 06 07 00 02 0B 07 00 T 16 01 00 00 A7 ED 42 DA 3E 02 00 00 R 00 00 01 00 00 08 01 00 T 1C 01 00 00 R 00 00 01 00 T 1C 01 00 00 2A 04 00 00 00 01 05 00 09 46 23 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 25 01 00 00 66 68 DD 75 FE DD 74 FF 7D B4 28 R 00 00 01 00 T 30 01 00 00 14 @@ -248,7 +254,7 @@ R 00 00 01 00 T 31 01 00 00 R 00 00 01 00 T 31 01 00 00 2A 04 00 00 00 01 05 00 09 AF 77 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 3A 01 00 00 23 77 DD 6E FE DD 66 FF C3 R 00 00 01 00 T 43 01 00 00 56 02 00 00 @@ -256,19 +262,19 @@ R 00 00 01 00 00 04 01 00 T 45 01 00 00 R 00 00 01 00 T 45 01 00 00 2A 04 00 00 00 01 07 00 09 7E B7 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 4E 01 00 00 CA EF 01 00 00 R 00 00 01 00 00 05 01 00 T 51 01 00 00 R 00 00 01 00 T 51 01 00 00 ED 4B 04 00 00 00 C5 2A -R 00 00 01 00 02 06 06 00 +R 00 00 01 00 02 06 07 00 T 57 01 00 00 04 00 00 00 23 23 23 5E 23 56 2A -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 60 01 00 00 04 00 00 00 4E 23 46 23 7E 69 60 -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 69 01 00 00 C1 CD 00 00 00 00 DD 75 FE DD 74 -R 00 00 01 00 02 06 1E 00 +R 00 00 01 00 02 06 21 00 T 72 01 00 00 FF 7D B4 28 3D R 00 00 01 00 T 77 01 00 00 @@ -278,13 +284,13 @@ R 00 00 01 00 T 80 01 00 00 R 00 00 01 00 T 80 01 00 00 2A 04 00 00 00 01 0B 00 09 22 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 88 01 00 00 04 00 00 00 C3 31 02 00 00 -R 00 00 01 00 02 04 06 00 00 09 01 00 +R 00 00 01 00 02 04 07 00 00 09 01 00 T 8D 01 00 00 R 00 00 01 00 T 8D 01 00 00 2A 04 00 00 00 01 00 00 00 00 A7 -R 00 00 01 00 02 05 06 00 02 0A 29 00 +R 00 00 01 00 02 05 07 00 02 0A 2D 00 T 94 01 00 00 ED 42 20 0B R 00 00 01 00 T 98 01 00 00 @@ -292,19 +298,19 @@ R 00 00 01 00 T 98 01 00 00 DD 5E FE 3E 59 02 00 00 21 R 00 00 01 00 29 08 01 00 T 9E 01 00 00 59 02 00 00 CD 00 00 00 00 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +R 00 00 01 00 00 04 01 00 02 09 21 00 T A3 01 00 00 R 00 00 01 00 T A3 01 00 00 2A 04 00 00 00 01 07 00 09 DD 46 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T AC 01 00 00 FE 70 68 26 00 C3 56 02 00 00 R 00 00 01 00 00 0A 01 00 T B4 01 00 00 R 00 00 01 00 T B4 01 00 00 2A 04 00 00 00 01 0A 00 09 7E FE -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T BD 01 00 00 03 20 2F 2A 04 00 00 00 01 07 00 -R 00 00 01 00 02 08 06 00 +R 00 00 01 00 02 08 07 00 T C6 01 00 00 09 7E FE 0A 28 23 R 00 00 01 00 T CC 01 00 00 @@ -314,9 +320,9 @@ R 00 00 01 00 T CC 01 00 00 R 00 00 01 00 T CC 01 00 00 2A 04 00 00 00 01 07 00 09 36 00 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T D5 01 00 00 2A 04 00 00 00 01 00 00 00 00 A7 -R 00 00 01 00 02 05 06 00 02 0A 29 00 +R 00 00 01 00 02 05 07 00 02 0A 2D 00 T DC 01 00 00 ED 42 20 0A R 00 00 01 00 T E0 01 00 00 @@ -324,7 +330,7 @@ R 00 00 01 00 T E0 01 00 00 1E 0A 3E 59 02 00 00 21 R 00 00 01 00 29 07 01 00 T E5 01 00 00 59 02 00 00 CD 00 00 00 00 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +R 00 00 01 00 00 04 01 00 02 09 21 00 T EA 01 00 00 R 00 00 01 00 T EA 01 00 00 21 0A 00 18 67 @@ -334,25 +340,25 @@ R 00 00 01 00 T EF 01 00 00 R 00 00 01 00 T EF 01 00 00 2A 04 00 00 00 01 0A 00 09 7E FE -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T F8 01 00 00 03 20 36 R 00 00 01 00 T FB 01 00 00 R 00 00 01 00 T FB 01 00 00 2A 00 00 00 00 7D B4 28 0F -R 00 00 01 00 02 05 11 00 +R 00 00 01 00 02 05 12 00 T 02 02 00 00 R 00 00 01 00 T 02 02 00 00 2A 04 00 00 00 01 07 00 09 36 00 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 0B 02 00 00 2E 00 26 00 18 45 R 00 00 01 00 T 11 02 00 00 R 00 00 01 00 T 11 02 00 00 2A 00 00 00 00 7D B4 28 19 2A -R 00 00 01 00 02 05 23 00 +R 00 00 01 00 02 05 27 00 T 19 02 00 00 04 00 00 00 01 0B 00 00 00 A7 ED -R 00 00 01 00 02 04 06 00 02 09 29 00 +R 00 00 01 00 02 04 07 00 02 09 2D 00 T 20 02 00 00 42 20 0E R 00 00 01 00 T 23 02 00 00 @@ -362,11 +368,11 @@ R 00 00 01 00 T 23 02 00 00 R 00 00 01 00 T 23 02 00 00 2A 00 00 00 00 5E 23 56 3E -R 00 00 01 00 02 05 1C 00 -T 2A 02 00 00 DA 09 00 00 21 DA 09 00 00 CD +R 00 00 01 00 02 05 1F 00 +T 2A 02 00 00 07 0A 00 00 21 07 0A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 2F 02 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 31 02 00 00 R 00 00 01 00 T 31 02 00 00 @@ -374,13 +380,13 @@ R 00 00 01 00 T 31 02 00 00 R 00 00 01 00 T 31 02 00 00 2A 04 00 00 00 01 F5 FF 09 22 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 39 02 00 00 04 00 00 00 C3 0F 01 00 00 -R 00 00 01 00 02 04 06 00 00 09 01 00 +R 00 00 01 00 02 04 07 00 00 09 01 00 T 3E 02 00 00 R 00 00 01 00 T 3E 02 00 00 01 00 00 00 00 2A 04 00 00 00 A7 -R 00 00 01 00 02 05 29 00 02 0A 06 00 +R 00 00 01 00 02 05 2D 00 02 0A 07 00 T 45 02 00 00 ED 42 38 05 R 00 00 01 00 T 49 02 00 00 @@ -390,55 +396,55 @@ R 00 00 01 00 T 4E 02 00 00 R 00 00 01 00 T 4E 02 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 0C 00 02 0A 0C 00 +R 00 00 01 00 2B 05 0D 00 02 0A 0D 00 T 54 02 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 56 02 00 00 R 00 00 01 00 T 56 02 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 59 02 00 00 R 00 00 01 00 T 59 02 00 00 CD 00 00 00 00 21 76 00 ED 4B -R 00 00 01 00 02 05 1D 00 +R 00 00 01 00 02 05 20 00 T 61 02 00 00 00 00 00 00 09 7E B7 28 16 -R 00 00 01 00 02 04 19 00 +R 00 00 01 00 02 04 1C 00 T 68 02 00 00 R 00 00 01 00 T 68 02 00 00 21 01 00 E5 21 04 00 39 4D 44 11 R 00 00 01 00 T 73 02 00 00 02 00 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 08 00 +R 00 00 01 00 2B 07 09 00 T 78 02 00 00 00 00 00 00 CD 00 00 00 00 F1 -R 00 00 01 00 02 04 08 00 02 09 1E 00 +R 00 00 01 00 02 04 09 00 02 09 21 00 T 7E 02 00 00 R 00 00 01 00 T 7E 02 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 81 02 00 00 R 00 00 01 00 T 81 02 00 00 CD 00 00 00 00 01 58 00 00 00 2A -R 00 00 01 00 02 05 1D 00 02 0A 29 00 +R 00 00 01 00 02 05 20 00 02 0A 2D 00 T 88 02 00 00 04 00 00 00 11 0B 00 19 22 -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 8F 02 00 00 04 00 00 00 A7 ED 42 38 1C -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 96 02 00 00 R 00 00 01 00 T 96 02 00 00 2A 04 00 00 00 01 F5 FF 09 22 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 9E 02 00 00 04 00 00 00 11 14 00 00 00 3E -R 00 00 01 00 02 04 06 00 00 09 02 00 +R 00 00 01 00 02 04 07 00 00 09 02 00 T A4 02 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 05 00 02 09 05 00 +R 00 00 01 00 2B 04 06 00 02 09 06 00 T A9 02 00 00 00 00 00 00 21 00 00 00 00 34 C3 -R 00 00 01 00 02 04 1E 00 02 09 1B 00 +R 00 00 01 00 02 04 21 00 02 09 1E 00 T B0 02 00 00 5D 04 00 00 R 00 00 01 00 00 04 01 00 T B2 02 00 00 R 00 00 01 00 T B2 02 00 00 2A 04 00 00 00 DD 56 0C DD 4E 0A -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T BB 02 00 00 DD 46 0B 71 23 70 23 72 21 06 00 R 00 00 01 00 T C6 02 00 00 DD 4E 02 DD 46 03 09 7E 23 A6 3C @@ -448,31 +454,31 @@ R 00 00 01 00 T D3 02 00 00 R 00 00 01 00 T D3 02 00 00 2A 04 00 00 00 23 23 23 DD 4E 02 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T DC 02 00 00 DD 46 03 71 23 70 C3 C4 03 00 00 R 00 00 01 00 00 0B 01 00 T E5 02 00 00 R 00 00 01 00 T E5 02 00 00 2A 04 00 00 00 23 23 23 E5 01 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T ED 02 00 00 00 00 00 00 2A 04 00 00 00 A7 ED -R 00 00 01 00 02 04 29 00 02 09 06 00 +R 00 00 01 00 02 04 2D 00 02 09 07 00 T F4 02 00 00 42 EB 01 0B 00 CD 00 00 00 00 01 -R 00 00 01 00 02 0A 2C 00 +R 00 00 01 00 02 0A 30 00 T FD 02 00 00 0E 00 CD 00 00 00 00 21 -R 00 00 01 00 02 07 09 00 +R 00 00 01 00 02 07 0A 00 T 03 03 00 00 00 00 00 00 19 4D 44 E1 71 23 70 -R 00 00 01 00 02 04 21 00 +R 00 00 01 00 02 04 25 00 T 0C 03 00 00 2A 04 00 00 00 23 23 23 5E 23 56 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 15 03 00 00 DD 6E 02 DD 66 03 01 0E 00 ED B0 R 00 00 01 00 T 20 03 00 00 2A 04 00 00 00 23 23 23 46 23 66 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 29 03 00 00 68 01 0C 00 09 E5 2A 04 00 00 00 -R 00 00 01 00 02 0B 06 00 +R 00 00 01 00 02 0B 07 00 T 32 03 00 00 01 00 00 00 00 A7 ED 42 20 05 11 -R 00 00 01 00 02 05 29 00 +R 00 00 01 00 02 05 2D 00 T 3B 03 00 00 06 02 00 00 18 03 R 00 00 01 00 00 04 04 00 T 3F 03 00 00 @@ -482,25 +488,25 @@ R 00 00 01 00 00 05 04 00 T 42 03 00 00 R 00 00 01 00 T 42 03 00 00 E1 73 23 72 2A 04 00 00 00 23 23 -R 00 00 01 00 02 09 06 00 +R 00 00 01 00 02 09 07 00 T 4B 03 00 00 23 46 23 66 68 01 04 00 09 5E 23 R 00 00 01 00 T 56 03 00 00 56 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 1A 00 02 0B 1A 00 +R 00 00 01 00 2B 06 1D 00 02 0B 1D 00 T 5C 03 00 00 CD 00 00 00 00 7D B4 20 61 2A -R 00 00 01 00 02 05 1E 00 +R 00 00 01 00 02 05 21 00 T 64 03 00 00 04 00 00 00 01 00 00 00 00 A7 ED -R 00 00 01 00 02 04 06 00 02 09 29 00 +R 00 00 01 00 02 04 07 00 02 09 2D 00 T 6B 03 00 00 42 28 2F 21 01 00 E5 21 00 00 E5 R 00 00 01 00 T 76 03 00 00 21 00 00 E5 2A 04 00 00 00 23 23 -R 00 00 01 00 02 09 06 00 +R 00 00 01 00 02 09 07 00 T 7F 03 00 00 23 46 23 66 68 01 04 00 09 5E 23 R 00 00 01 00 T 8A 03 00 00 56 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 13 00 02 0B 13 00 +R 00 00 01 00 2B 06 14 00 02 0B 14 00 T 90 03 00 00 CD 00 00 00 00 F1 F1 F1 7D A4 A1 -R 00 00 01 00 02 05 1E 00 +R 00 00 01 00 02 05 21 00 T 99 03 00 00 A0 3C 28 27 R 00 00 01 00 T 9D 03 00 00 @@ -524,7 +530,7 @@ R 00 00 01 00 00 08 04 00 T AF 03 00 00 R 00 00 01 00 T AF 03 00 00 2A 04 00 00 00 23 23 23 46 23 66 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T B8 03 00 00 68 01 06 00 09 ED 4B 0C 04 00 00 R 00 00 01 00 00 0B 04 00 T C1 03 00 00 71 23 70 @@ -534,13 +540,13 @@ R 00 00 01 00 T C4 03 00 00 R 00 00 01 00 T C4 03 00 00 2A 04 00 00 00 01 07 00 09 36 F5 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T CD 03 00 00 2A 04 00 00 00 01 05 00 09 AF 77 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T D6 03 00 00 23 77 2A 04 00 00 00 01 09 00 09 -R 00 00 01 00 02 07 06 00 +R 00 00 01 00 02 07 07 00 T DF 03 00 00 36 00 2A 04 00 00 00 01 08 00 09 -R 00 00 01 00 02 07 06 00 +R 00 00 01 00 02 07 07 00 T E8 03 00 00 36 00 0E 5F 06 00 00 11 R 00 00 01 00 29 07 01 00 T ED 03 00 00 5F 06 00 00 DD 7E 0C DD 6E 0A DD @@ -562,7 +568,7 @@ R 00 00 01 00 T 14 04 00 00 R 00 00 01 00 T 14 04 00 00 2A 04 00 00 00 01 0A 00 09 36 03 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 1D 04 00 00 18 3E R 00 00 01 00 T 1F 04 00 00 @@ -588,13 +594,13 @@ R 00 00 01 00 T 49 04 00 00 R 00 00 01 00 T 49 04 00 00 2A 04 00 00 00 01 0A 00 09 36 02 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 52 04 00 00 18 09 R 00 00 01 00 T 54 04 00 00 R 00 00 01 00 T 54 04 00 00 2A 04 00 00 00 01 0A 00 09 36 00 -R 00 00 01 00 02 05 06 00 +R 00 00 01 00 02 05 07 00 T 5D 04 00 00 R 00 00 01 00 T 5D 04 00 00 @@ -602,21 +608,21 @@ R 00 00 01 00 T 5D 04 00 00 R 00 00 01 00 T 5D 04 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 60 04 00 00 R 00 00 01 00 T 60 04 00 00 CD 00 00 00 00 FE FF 2A -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 66 04 00 00 02 00 00 00 DD 75 FE DD 74 FF DD -R 00 00 01 00 02 04 06 00 +R 00 00 01 00 02 04 07 00 T 6F 04 00 00 4E 02 DD 46 03 ED 43 02 00 00 00 -R 00 00 01 00 02 0B 06 00 +R 00 00 01 00 02 0B 07 00 T 78 04 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 7B 04 00 00 R 00 00 01 00 T 7B 04 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 84 04 00 00 66 03 7E 23 B6 20 05 R 00 00 01 00 T 8B 04 00 00 @@ -644,11 +650,11 @@ R 00 00 01 00 T C1 04 00 00 R 00 00 01 00 T C1 04 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T C4 04 00 00 R 00 00 01 00 T C4 04 00 00 CD 00 00 00 00 FC FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T CD 04 00 00 66 03 23 23 46 23 66 68 DD 75 FD R 00 00 01 00 T D8 04 00 00 DD 74 FE 7D B4 20 05 @@ -690,11 +696,11 @@ R 00 00 01 00 T 32 05 00 00 R 00 00 01 00 T 32 05 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 35 05 00 00 R 00 00 01 00 T 35 05 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 3E 05 00 00 66 03 23 23 4E 23 46 59 50 13 13 R 00 00 01 00 T 49 05 00 00 72 2B 73 0A 6F 03 0A 67 DD 75 FE @@ -722,7 +728,7 @@ R 00 00 01 00 00 08 04 00 T 88 05 00 00 81 02 00 00 21 81 02 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 T 8D 05 00 00 00 00 00 00 E1 E1 21 FF FF 18 03 -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 96 05 00 00 R 00 00 01 00 T 96 05 00 00 21 00 00 @@ -730,11 +736,11 @@ R 00 00 01 00 T 99 05 00 00 R 00 00 01 00 T 99 05 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 9C 05 00 00 R 00 00 01 00 T 9C 05 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T A5 05 00 00 66 03 7E 23 B6 20 05 R 00 00 01 00 T AC 05 00 00 @@ -762,11 +768,11 @@ R 00 00 01 00 T E2 05 00 00 R 00 00 01 00 T E2 05 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T E5 05 00 00 R 00 00 01 00 T E5 05 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T EE 05 00 00 66 03 7E 23 B6 28 1C DD 6E 02 DD R 00 00 01 00 T F9 05 00 00 66 03 4E 23 46 03 70 2B 71 0B 0A @@ -790,11 +796,11 @@ R 00 00 01 00 T 1C 06 00 00 R 00 00 01 00 T 1C 06 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 1F 06 00 00 R 00 00 01 00 T 1F 06 00 00 CD 00 00 00 00 FE FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 28 06 00 00 66 03 7E 23 B6 28 1C DD 6E 02 DD R 00 00 01 00 T 33 06 00 00 66 03 4E 23 46 03 70 2B 71 0B 0A @@ -820,11 +826,11 @@ R 00 00 01 00 T 5C 06 00 00 R 00 00 01 00 T 5C 06 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 5F 06 00 00 R 00 00 01 00 T 5F 06 00 00 CD 00 00 00 00 FA FF 21 0C 00 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 68 06 00 00 4E 02 DD 46 03 09 56 23 66 6A DD R 00 00 01 00 T 73 06 00 00 75 FD DD 74 FE 21 06 00 09 7E 23 @@ -872,9 +878,9 @@ R 00 00 01 00 T EE 06 00 00 D5 21 04 00 DD 4E 02 DD 46 03 09 R 00 00 01 00 T F9 06 00 00 5E 23 56 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 13 00 +R 00 00 01 00 2B 08 14 00 T FF 06 00 00 00 00 00 00 CD 00 00 00 00 F1 F1 -R 00 00 01 00 02 04 13 00 02 09 1E 00 +R 00 00 01 00 02 04 14 00 02 09 21 00 T 06 07 00 00 F1 R 00 00 01 00 T 07 07 00 00 @@ -886,27 +892,27 @@ R 00 00 01 00 T 12 07 00 00 03 21 04 00 DD 5E 02 DD 56 03 19 R 00 00 01 00 T 1D 07 00 00 5E 23 56 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 2E 00 +R 00 00 01 00 2B 08 32 00 T 23 07 00 00 00 00 00 00 CD 00 00 00 00 F1 DD -R 00 00 01 00 02 04 2E 00 02 09 1E 00 +R 00 00 01 00 02 04 32 00 02 09 21 00 T 2A 07 00 00 75 FA DD 74 FB CB 7C 28 09 2A R 00 00 01 00 T 34 07 00 00 00 00 00 00 3E 04 AD B4 28 CB -R 00 00 01 00 02 04 1F 00 +R 00 00 01 00 02 04 22 00 T 3C 07 00 00 R 00 00 01 00 T 3C 07 00 00 DD 4E FA DD 46 FB 21 00 00 CD R 00 00 01 00 T 46 07 00 00 00 00 00 00 38 1B -R 00 00 01 00 02 04 2A 00 +R 00 00 01 00 02 04 2E 00 T 4A 07 00 00 R 00 00 01 00 T 4A 07 00 00 21 04 00 DD 4E 02 DD 46 03 09 5E R 00 00 01 00 -T 55 07 00 00 23 56 3E 3D 0A 00 00 21 +T 55 07 00 00 23 56 3E BC 0B 00 00 21 R 00 00 01 00 29 07 01 00 -T 5A 07 00 00 3D 0A 00 00 CD 00 00 00 00 21 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +T 5A 07 00 00 BC 0B 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 21 00 T 60 07 00 00 00 00 C3 25 08 00 00 R 00 00 01 00 00 07 01 00 T 65 07 00 00 @@ -928,7 +934,7 @@ R 00 00 01 00 T 9F 07 00 00 21 08 00 DD 4E 02 DD 46 03 09 CD R 00 00 01 00 T AA 07 00 00 00 00 00 00 21 02 02 DD 4E FD DD -R 00 00 01 00 02 04 25 00 +R 00 00 01 00 02 04 29 00 T B3 07 00 00 46 FE 09 4E 23 46 03 70 2B 71 0B R 00 00 01 00 T BE 07 00 00 0A E6 7F 6F 26 00 18 5F @@ -942,11 +948,11 @@ R 00 00 01 00 T D1 07 00 00 04 00 DD 5E 02 DD 56 03 19 5E 23 R 00 00 01 00 T DC 07 00 00 56 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 2E 00 02 0B 2E 00 +R 00 00 01 00 2B 06 32 00 02 0B 32 00 T E2 07 00 00 CD 00 00 00 00 F1 DD 75 FA DD 74 -R 00 00 01 00 02 05 1E 00 +R 00 00 01 00 02 05 21 00 T EB 07 00 00 FB CB 7C 28 09 2A 00 00 00 00 3E -R 00 00 01 00 02 0A 1F 00 +R 00 00 01 00 02 0A 22 00 T F4 07 00 00 04 AD B4 28 CD R 00 00 01 00 T F9 07 00 00 @@ -959,10 +965,10 @@ T 0D 08 00 00 R 00 00 01 00 T 0D 08 00 00 21 04 00 DD 4E 02 DD 46 03 09 5E R 00 00 01 00 -T 18 08 00 00 23 56 3E 3D 0A 00 00 21 +T 18 08 00 00 23 56 3E BC 0B 00 00 21 R 00 00 01 00 29 07 01 00 -T 1D 08 00 00 3D 0A 00 00 CD 00 00 00 00 21 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +T 1D 08 00 00 BC 0B 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 21 00 T 23 08 00 00 00 00 R 00 00 01 00 T 25 08 00 00 @@ -970,41 +976,41 @@ R 00 00 01 00 T 25 08 00 00 R 00 00 01 00 T 25 08 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 28 08 00 00 R 00 00 01 00 T 28 08 00 00 CD 00 00 00 00 FE FF 21 01 00 E5 -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 31 08 00 00 21 02 00 39 4D 44 21 04 00 DD 5E R 00 00 01 00 T 3C 08 00 00 02 DD 56 03 19 5E 23 56 3E R 00 00 01 00 T 45 08 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 2E 00 02 09 2E 00 +R 00 00 01 00 2B 04 32 00 02 09 32 00 T 4A 08 00 00 00 00 00 00 F1 3E 01 AD B4 28 19 -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 53 08 00 00 R 00 00 01 00 T 53 08 00 00 21 04 00 DD 4E 02 DD 46 03 09 5E R 00 00 01 00 T 5E 08 00 00 23 56 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 14 00 +R 00 00 01 00 2B 07 16 00 T 63 08 00 00 00 00 00 00 CD 00 00 00 00 DD 36 -R 00 00 01 00 02 04 14 00 02 09 1E 00 +R 00 00 01 00 02 04 16 00 02 09 21 00 T 6A 08 00 00 FE 00 R 00 00 01 00 T 6C 08 00 00 R 00 00 01 00 T 6C 08 00 00 DD 6E FE 26 00 C3 00 00 00 00 -R 00 00 01 00 02 0A 12 00 +R 00 00 01 00 02 0A 13 00 T 74 08 00 00 R 00 00 01 00 T 74 08 00 00 CD 00 00 00 00 FE FF DD 5E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 7D 08 00 00 56 03 3E AC 08 00 00 21 R 00 00 01 00 29 07 01 00 T 82 08 00 00 AC 08 00 00 CD 00 00 00 00 7D E6 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +R 00 00 01 00 00 04 01 00 02 09 21 00 T 89 08 00 00 7F 4F 7C E6 FF 47 DD 71 FE DD 70 R 00 00 01 00 T 94 08 00 00 FF 3E 0A A9 B0 20 08 @@ -1016,11 +1022,11 @@ R 00 00 01 00 T A3 08 00 00 R 00 00 01 00 T A3 08 00 00 DD 6E FE DD 66 FF C3 00 00 00 00 -R 00 00 01 00 02 0B 12 00 +R 00 00 01 00 02 0B 13 00 T AC 08 00 00 R 00 00 01 00 T AC 08 00 00 CD 00 00 00 00 FE FF 21 09 00 09 -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T B5 08 00 00 7E B7 28 3A R 00 00 01 00 T B9 08 00 00 @@ -1048,7 +1054,7 @@ R 00 00 01 00 T F3 08 00 00 DD 5E 02 DD 56 03 3E 5F 06 00 00 R 00 00 01 00 29 0B 01 00 T FB 08 00 00 21 5F 06 00 00 CD 00 00 00 00 DD -R 00 00 01 00 00 05 01 00 02 0A 1E 00 +R 00 00 01 00 00 05 01 00 02 0A 21 00 T 02 09 00 00 75 FE DD 74 FF 3E 0A AD B4 20 64 R 00 00 01 00 T 0D 09 00 00 @@ -1062,7 +1068,7 @@ R 00 00 01 00 T 19 09 00 00 DD 5E 02 DD 56 03 3E 5F 06 00 00 R 00 00 01 00 29 0B 01 00 T 21 09 00 00 21 5F 06 00 00 CD 00 00 00 00 DD -R 00 00 01 00 00 05 01 00 02 0A 1E 00 +R 00 00 01 00 00 05 01 00 02 0A 21 00 T 28 09 00 00 75 FE DD 74 FF 3E 0A AD B4 20 0D R 00 00 01 00 T 33 09 00 00 @@ -1104,29 +1110,29 @@ R 00 00 01 00 T 8A 09 00 00 R 00 00 01 00 T 8A 09 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 8D 09 00 00 R 00 00 01 00 T 8D 09 00 00 CD 00 00 00 00 FE FF DD 5E 02 DD -R 00 00 01 00 02 05 24 00 +R 00 00 01 00 02 05 28 00 T 96 09 00 00 56 03 3E 5F 06 00 00 21 R 00 00 01 00 29 07 01 00 T 9B 09 00 00 5F 06 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +R 00 00 01 00 00 04 01 00 02 09 21 00 T A2 09 00 00 FE DD 74 FF 3E 0A AD B4 20 25 R 00 00 01 00 T AC 09 00 00 R 00 00 01 00 T AC 09 00 00 2A 00 00 00 00 7D B4 20 1E -R 00 00 01 00 02 05 11 00 +R 00 00 01 00 02 05 12 00 T B3 09 00 00 R 00 00 01 00 T B3 09 00 00 21 04 00 DD 4E 02 DD 46 03 09 5E R 00 00 01 00 -T BE 09 00 00 23 56 3E 3D 0A 00 00 21 +T BE 09 00 00 23 56 3E BC 0B 00 00 21 R 00 00 01 00 29 07 01 00 -T C3 09 00 00 3D 0A 00 00 CD 00 00 00 00 21 -R 00 00 01 00 00 04 01 00 02 09 1E 00 +T C3 09 00 00 BC 0B 00 00 CD 00 00 00 00 21 +R 00 00 01 00 00 04 01 00 02 09 21 00 T C9 09 00 00 04 00 09 36 FF 23 36 FF R 00 00 01 00 T D1 09 00 00 @@ -1134,915 +1140,1089 @@ R 00 00 01 00 T D1 09 00 00 R 00 00 01 00 T D1 09 00 00 DD 6E FE DD 66 FF C3 00 00 00 00 -R 00 00 01 00 02 0B 12 00 +R 00 00 01 00 02 0B 13 00 T DA 09 00 00 R 00 00 01 00 T DA 09 00 00 CD 00 00 00 00 6B 62 AF B6 28 21 -R 00 00 01 00 02 05 1D 00 +R 00 00 01 00 02 05 20 00 T E3 09 00 00 R 00 00 01 00 T E3 09 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 -R 00 00 01 00 2B 0B 15 00 +R 00 00 01 00 2B 0B 17 00 T EB 09 00 00 21 00 00 00 00 CD 00 00 00 00 E5 -R 00 00 01 00 02 05 15 00 02 0A 1E 00 +R 00 00 01 00 02 05 17 00 02 0A 21 00 T F2 09 00 00 DD 4E 02 DD 46 03 11 02 00 3E R 00 00 01 00 T FC 09 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 08 00 02 09 08 00 +R 00 00 01 00 2B 04 09 00 02 09 09 00 T 01 0A 00 00 00 00 00 00 F1 -R 00 00 01 00 02 04 1E 00 +R 00 00 01 00 02 04 21 00 T 04 0A 00 00 R 00 00 01 00 T 04 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +R 00 00 01 00 02 05 13 00 T 07 0A 00 00 R 00 00 01 00 -T 07 0A 00 00 CD 00 00 00 00 21 01 00 E5 21 -R 00 00 01 00 02 05 1D 00 -T 0F 0A 00 00 04 00 39 4D 44 11 02 00 3E -R 00 00 01 00 -T 18 0A 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 08 00 02 09 08 00 -T 1D 0A 00 00 00 00 00 00 F1 C3 00 00 00 00 -R 00 00 01 00 02 04 1E 00 02 0A 12 00 -T 23 0A 00 00 -R 00 00 01 00 -T 23 0A 00 00 CD 00 00 00 00 01 00 00 3E -R 00 00 01 00 02 05 1D 00 -T 2A 0A 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 20 00 02 09 20 00 -T 2F 0A 00 00 00 00 00 00 EB 3E DA 09 00 00 21 -R 00 00 01 00 02 04 1E 00 29 0A 01 00 -T 35 0A 00 00 DA 09 00 00 CD 00 00 00 00 C3 -R 00 00 01 00 00 04 01 00 02 09 1E 00 -T 3B 0A 00 00 00 00 00 00 -R 00 00 01 00 02 04 12 00 -T 3D 0A 00 00 -R 00 00 01 00 -T 3D 0A 00 00 CD 00 00 00 00 4B 42 21 02 00 CD -R 00 00 01 00 02 05 1D 00 -T 46 0A 00 00 00 00 00 00 30 0E -R 00 00 01 00 02 04 2A 00 -T 4A 0A 00 00 -R 00 00 01 00 -T 4A 0A 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 -R 00 00 01 00 2B 0B 14 00 -T 52 0A 00 00 21 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 14 00 02 0A 1E 00 -T 58 0A 00 00 -R 00 00 01 00 -T 58 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T 5B 0A 00 00 +T 07 0A 00 00 CD 00 00 00 00 BA FE 21 00 00 39 +R 00 00 01 00 02 05 28 00 +T 10 0A 00 00 DD 4E 02 DD 46 03 71 23 70 R 00 00 01 00 -T 5B 0A 00 00 CD 00 00 00 00 FE FF DD 36 FE 0A -R 00 00 01 00 02 05 24 00 -T 64 0A 00 00 DD 36 FF 00 +T 19 0A 00 00 R 00 00 01 00 -T 68 0A 00 00 +T 19 0A 00 00 21 00 00 39 7E 23 66 6F AF B6 CA R 00 00 01 00 -T 68 0A 00 00 01 14 80 DD 6E FE DD 66 FF 3E 80 +T 24 0A 00 00 75 0B 00 00 +R 00 00 01 00 00 04 01 00 +T 26 0A 00 00 R 00 00 01 00 -T 73 0A 00 00 AC 67 ED 42 30 18 +T 26 0A 00 00 21 00 00 39 7E 23 66 6F 7E FE 5C R 00 00 01 00 -T 79 0A 00 00 +T 31 0A 00 00 C2 69 0B 00 00 +R 00 00 01 00 00 05 01 00 +T 34 0A 00 00 R 00 00 01 00 -T 79 0A 00 00 DD 5E FE DD 56 FF 13 DD 73 FE DD +T 34 0A 00 00 DD 4E 02 DD 46 03 21 00 00 39 56 R 00 00 01 00 -T 84 0A 00 00 72 FF 1B 3E 00 00 00 00 21 -R 00 00 01 00 2B 08 14 00 -T 8A 0A 00 00 00 00 00 00 CD 00 00 00 00 18 D7 -R 00 00 01 00 02 04 14 00 02 09 1E 00 -T 91 0A 00 00 +T 3F 0A 00 00 23 66 6A A7 ED 42 E5 DD 4E 02 DD R 00 00 01 00 -T 91 0A 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T 94 0A 00 00 +T 4A 0A 00 00 46 03 11 02 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 09 00 +T 52 0A 00 00 00 00 00 00 CD 00 00 00 00 F1 21 +R 00 00 01 00 02 04 09 00 02 09 21 00 +T 59 0A 00 00 00 00 39 4E 23 46 03 70 2B 71 DD R 00 00 01 00 -T 94 0A 00 00 CD 00 00 00 00 D6 FF ED 4B -R 00 00 01 00 02 05 24 00 -T 9B 0A 00 00 08 00 00 00 DD 6E 02 DD 66 03 CD -R 00 00 01 00 02 04 06 00 -T A4 0A 00 00 00 00 00 00 D2 71 0B 00 00 -R 00 00 01 00 02 04 2A 00 00 09 01 00 -T A9 0A 00 00 +T 64 0A 00 00 71 02 DD 70 03 21 00 00 39 7E 23 R 00 00 01 00 -T A9 0A 00 00 AF DD 77 D6 DD 77 D7 +T 6F 0A 00 00 66 6F 5E CD 00 00 00 00 04 00 23 +R 00 00 01 00 02 08 18 00 +T 78 0A 00 00 68 75 77 69 0B 00 00 2F 0B 00 00 +R 00 00 01 00 00 07 01 00 00 0B 01 00 +T 7F 0A 00 00 B4 0A 00 00 F4 0A 00 00 +R 00 00 01 00 00 04 01 00 00 08 01 00 +T 83 0A 00 00 85 0A 00 00 +R 00 00 01 00 00 04 01 00 +T 85 0A 00 00 R 00 00 01 00 -T B0 0A 00 00 +T 85 0A 00 00 DD 34 02 20 03 DD 34 03 R 00 00 01 00 -T B0 0A 00 00 01 14 80 DD 6E D6 DD 66 D7 3E 80 +T 8D 0A 00 00 R 00 00 01 00 -T BB 0A 00 00 AC 67 ED 42 30 1E +T 8D 0A 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 24 00 02 0A 24 00 +T 93 0A 00 00 00 00 00 00 7D B4 20 0D +R 00 00 01 00 02 04 21 00 +T 99 0A 00 00 R 00 00 01 00 -T C1 0A 00 00 +T 99 0A 00 00 11 32 00 00 00 3E DA 09 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 9F 0A 00 00 DA 09 00 00 CD 00 00 00 00 18 0B +R 00 00 01 00 00 04 01 00 02 09 21 00 +T A6 0A 00 00 R 00 00 01 00 -T C1 0A 00 00 DD 6E D6 DD 66 D7 29 E5 21 04 00 +T A6 0A 00 00 11 34 00 00 00 3E DA 09 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T AC 0A 00 00 DA 09 00 00 CD 00 00 00 00 +R 00 00 01 00 00 04 01 00 02 09 21 00 +T B1 0A 00 00 R 00 00 01 00 -T CC 0A 00 00 39 4D 44 E1 09 AF 77 23 77 DD 34 +T B1 0A 00 00 C3 69 0B 00 00 +R 00 00 01 00 00 05 01 00 +T B4 0A 00 00 R 00 00 01 00 -T D7 0A 00 00 D6 20 03 DD 34 D7 +T B4 0A 00 00 DD 34 02 20 03 DD 34 03 R 00 00 01 00 -T DD 0A 00 00 +T BC 0A 00 00 R 00 00 01 00 -T DD 0A 00 00 18 D1 +T BC 0A 00 00 21 02 00 39 E5 11 36 00 00 00 3E +R 00 00 01 00 00 0A 02 00 +T C5 0A 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 05 00 02 09 05 00 +T CA 0A 00 00 00 00 00 00 4D 44 E1 71 23 70 79 +R 00 00 01 00 02 04 21 00 +T D3 0A 00 00 B0 20 0D R 00 00 01 00 -T DF 0A 00 00 +T D6 0A 00 00 R 00 00 01 00 -T DF 0A 00 00 +T D6 0A 00 00 11 3B 00 00 00 3E DA 09 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T DC 0A 00 00 DA 09 00 00 CD 00 00 00 00 18 0F +R 00 00 01 00 00 04 01 00 02 09 21 00 +T E3 0A 00 00 R 00 00 01 00 -T DF 0A 00 00 DD 6E 02 DD 66 03 29 E5 21 04 00 +T E3 0A 00 00 21 02 00 39 5E 23 56 3E R 00 00 01 00 -T EA 0A 00 00 39 4D 44 E1 09 36 01 23 36 00 DD +T EB 0A 00 00 DA 09 00 00 21 DA 09 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T F0 0A 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T F2 0A 00 00 R 00 00 01 00 -T F5 0A 00 00 5E 02 DD 56 03 3E 00 00 00 00 21 -R 00 00 01 00 2B 0A 07 00 -T FD 0A 00 00 00 00 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 02 04 07 00 02 09 1E 00 -T 04 0B 00 00 02 DD 74 03 CB 7C 20 0F ED 4B +T F2 0A 00 00 18 75 R 00 00 01 00 -T 0E 0B 00 00 08 00 00 00 DD 6E 02 DD 66 03 CD -R 00 00 01 00 02 04 06 00 -T 17 0B 00 00 00 00 00 00 38 C4 -R 00 00 01 00 02 04 2A 00 -T 1B 0B 00 00 +T F4 0A 00 00 R 00 00 01 00 -T 1B 0B 00 00 AF DD 77 D6 DD 77 D7 +T F4 0A 00 00 DD 34 02 20 03 DD 34 03 R 00 00 01 00 -T 22 0B 00 00 +T FC 0A 00 00 R 00 00 01 00 -T 22 0B 00 00 01 14 80 DD 6E D6 DD 66 D7 3E 80 +T FC 0A 00 00 21 04 00 39 5D 54 3E 00 00 00 00 +R 00 00 01 00 2B 0B 15 00 +T 04 0B 00 00 21 00 00 00 00 CD 00 00 00 00 7D +R 00 00 01 00 02 05 15 00 02 0A 21 00 +T 0B 0B 00 00 A4 3C 20 0D R 00 00 01 00 -T 2D 0B 00 00 AC 67 ED 42 30 2D +T 0F 0B 00 00 R 00 00 01 00 -T 33 0B 00 00 +T 0F 0B 00 00 11 43 00 00 00 3E DA 09 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 15 0B 00 00 DA 09 00 00 CD 00 00 00 00 18 11 +R 00 00 01 00 00 04 01 00 02 09 21 00 +T 1C 0B 00 00 R 00 00 01 00 -T 33 0B 00 00 DD 6E D6 DD 66 D7 29 E5 21 04 00 +T 1C 0B 00 00 21 04 00 39 01 0E 00 09 EB 3E R 00 00 01 00 -T 3E 0B 00 00 39 4D 44 E1 09 7E 23 B6 28 0E +T 26 0B 00 00 DA 09 00 00 21 DA 09 00 00 CD +R 00 00 01 00 29 04 01 00 00 09 01 00 +T 2B 0B 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T 2D 0B 00 00 R 00 00 01 00 -T 48 0B 00 00 +T 2D 0B 00 00 18 3A R 00 00 01 00 -T 48 0B 00 00 DD 5E D6 DD 56 D7 3E 00 00 00 00 -R 00 00 01 00 2B 0B 14 00 -T 50 0B 00 00 21 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 14 00 02 0A 1E 00 -T 56 0B 00 00 +T 2F 0B 00 00 R 00 00 01 00 -T 56 0B 00 00 DD 34 D6 20 03 DD 34 D7 +T 2F 0B 00 00 DD 34 02 20 03 DD 34 03 R 00 00 01 00 -T 5E 0B 00 00 +T 37 0B 00 00 R 00 00 01 00 -T 5E 0B 00 00 18 C2 +T 37 0B 00 00 01 00 01 21 46 00 39 5D 54 3E R 00 00 01 00 -T 60 0B 00 00 +T 41 0B 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 35 00 02 09 35 00 +T 46 0B 00 00 00 00 00 00 7D B4 20 0D +R 00 00 01 00 02 04 21 00 +T 4C 0B 00 00 R 00 00 01 00 -T 60 0B 00 00 DD CB 03 7E 28 0B +T 4C 0B 00 00 11 4C 00 00 00 3E DA 09 00 00 21 +R 00 00 01 00 00 05 02 00 29 0A 01 00 +T 52 0B 00 00 DA 09 00 00 CD 00 00 00 00 18 0E +R 00 00 01 00 00 04 01 00 02 09 21 00 +T 59 0B 00 00 +R 00 00 01 00 +T 59 0B 00 00 21 46 00 39 5D 54 3E DA 09 00 00 +R 00 00 01 00 29 0B 01 00 +T 61 0B 00 00 21 DA 09 00 00 CD 00 00 00 00 +R 00 00 01 00 00 05 01 00 02 0A 21 00 +T 67 0B 00 00 R 00 00 01 00 -T 66 0B 00 00 +T 67 0B 00 00 18 00 R 00 00 01 00 -T 66 0B 00 00 11 32 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 05 02 00 2B 0A 05 00 -T 6C 0B 00 00 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 04 05 00 02 09 1E 00 -T 71 0B 00 00 +T 69 0B 00 00 R 00 00 01 00 -T 71 0B 00 00 +T 69 0B 00 00 R 00 00 01 00 -T 71 0B 00 00 DD 6E 02 DD 66 03 C3 00 00 00 00 -R 00 00 01 00 02 0B 12 00 -T 7A 0B 00 00 +T 69 0B 00 00 21 00 00 39 34 23 20 01 34 R 00 00 01 00 -T 7A 0B 00 00 CD 00 00 00 00 FE FF DD 5E 02 DD -R 00 00 01 00 02 05 24 00 -T 83 0B 00 00 56 03 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 28 00 -T 88 0B 00 00 00 00 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 02 04 28 00 02 09 1E 00 -T 8F 0B 00 00 FE DD 74 FF CB 7C 28 0B +T 72 0B 00 00 R 00 00 01 00 -T 97 0B 00 00 +T 72 0B 00 00 C3 19 0A 00 00 +R 00 00 01 00 00 05 01 00 +T 75 0B 00 00 R 00 00 01 00 -T 97 0B 00 00 11 4F 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 05 02 00 2B 0A 05 00 -T 9D 0B 00 00 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 04 05 00 02 09 1E 00 +T 75 0B 00 00 DD 5E 02 DD 56 03 3E DA 09 00 00 +R 00 00 01 00 29 0B 01 00 +T 7D 0B 00 00 21 DA 09 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 05 01 00 02 0A 21 00 +T 84 0B 00 00 00 00 00 00 +R 00 00 01 00 02 04 13 00 +T 86 0B 00 00 +R 00 00 01 00 +T 86 0B 00 00 CD 00 00 00 00 21 01 00 E5 21 +R 00 00 01 00 02 05 20 00 +T 8E 0B 00 00 04 00 39 4D 44 11 02 00 3E +R 00 00 01 00 +T 97 0B 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 09 00 02 09 09 00 +T 9C 0B 00 00 00 00 00 00 F1 C3 00 00 00 00 +R 00 00 01 00 02 04 21 00 02 0A 13 00 T A2 0B 00 00 R 00 00 01 00 -T A2 0B 00 00 DD 6E FE DD 66 FF C3 00 00 00 00 -R 00 00 01 00 02 0B 12 00 -T AB 0B 00 00 +T A2 0B 00 00 CD 00 00 00 00 01 00 00 3E +R 00 00 01 00 02 05 20 00 +T A9 0B 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 23 00 02 09 23 00 +T AE 0B 00 00 00 00 00 00 EB 3E DA 09 00 00 21 +R 00 00 01 00 02 04 21 00 29 0A 01 00 +T B4 0B 00 00 DA 09 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 00 04 01 00 02 09 21 00 +T BA 0B 00 00 00 00 00 00 +R 00 00 01 00 02 04 13 00 +T BC 0B 00 00 +R 00 00 01 00 +T BC 0B 00 00 CD 00 00 00 00 4B 42 21 02 00 CD +R 00 00 01 00 02 05 20 00 +T C5 0B 00 00 00 00 00 00 30 0E +R 00 00 01 00 02 04 2E 00 +T C9 0B 00 00 +R 00 00 01 00 +T C9 0B 00 00 DD 5E 02 DD 56 03 3E 00 00 00 00 +R 00 00 01 00 2B 0B 16 00 +T D1 0B 00 00 21 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 16 00 02 0A 21 00 +T D7 0B 00 00 +R 00 00 01 00 +T D7 0B 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T DA 0B 00 00 +R 00 00 01 00 +T DA 0B 00 00 CD 00 00 00 00 FE FF DD 36 FE 0A +R 00 00 01 00 02 05 28 00 +T E3 0B 00 00 DD 36 FF 00 +R 00 00 01 00 +T E7 0B 00 00 +R 00 00 01 00 +T E7 0B 00 00 01 14 80 DD 6E FE DD 66 FF 3E 80 +R 00 00 01 00 +T F2 0B 00 00 AC 67 ED 42 30 18 +R 00 00 01 00 +T F8 0B 00 00 +R 00 00 01 00 +T F8 0B 00 00 DD 5E FE DD 56 FF 13 DD 73 FE DD +R 00 00 01 00 +T 03 0C 00 00 72 FF 1B 3E 00 00 00 00 21 +R 00 00 01 00 2B 08 16 00 +T 09 0C 00 00 00 00 00 00 CD 00 00 00 00 18 D7 +R 00 00 01 00 02 04 16 00 02 09 21 00 +T 10 0C 00 00 +R 00 00 01 00 +T 10 0C 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T 13 0C 00 00 +R 00 00 01 00 +T 13 0C 00 00 CD 00 00 00 00 D6 FF ED 4B +R 00 00 01 00 02 05 28 00 +T 1A 0C 00 00 08 00 00 00 DD 6E 02 DD 66 03 CD +R 00 00 01 00 02 04 07 00 +T 23 0C 00 00 00 00 00 00 D2 F0 0C 00 00 +R 00 00 01 00 02 04 2E 00 00 09 01 00 +T 28 0C 00 00 +R 00 00 01 00 +T 28 0C 00 00 AF DD 77 D6 DD 77 D7 R 00 00 01 00 -T AB 0B 00 00 CD 00 00 00 00 7B B2 28 2C -R 00 00 01 00 02 05 1D 00 -T B2 0B 00 00 +T 2F 0C 00 00 R 00 00 01 00 -T B2 0B 00 00 DD 6E 02 DD 66 03 4D 44 03 03 DD +T 2F 0C 00 00 01 14 80 DD 6E D6 DD 66 D7 3E 80 R 00 00 01 00 -T BD 0B 00 00 71 02 DD 70 03 5E 23 56 3E +T 3A 0C 00 00 AC 67 ED 42 30 1E R 00 00 01 00 -T C6 0B 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 14 00 02 09 14 00 -T CB 0B 00 00 00 00 00 00 DD 6E 02 DD 66 03 5E -R 00 00 01 00 02 04 1E 00 -T D4 0B 00 00 23 56 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 14 00 -T D9 0B 00 00 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 04 14 00 02 09 1E 00 -T DE 0B 00 00 +T 40 0C 00 00 R 00 00 01 00 -T DE 0B 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T E1 0B 00 00 +T 40 0C 00 00 DD 6E D6 DD 66 D7 29 E5 21 04 00 R 00 00 01 00 -T E1 0B 00 00 CD 00 00 00 00 FC FF 11 08 00 3E -R 00 00 01 00 02 05 24 00 -T EA 0B 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0A 00 02 09 0A 00 -T EF 0B 00 00 00 00 00 00 DD 75 FC DD 74 FD 7D -R 00 00 01 00 02 04 1E 00 -T F8 0B 00 00 B4 20 03 +T 4B 0C 00 00 39 4D 44 E1 09 AF 77 23 77 DD 34 +R 00 00 01 00 +T 56 0C 00 00 D6 20 03 DD 34 D7 +R 00 00 01 00 +T 5C 0C 00 00 R 00 00 01 00 -T FB 0B 00 00 +T 5C 0C 00 00 18 D1 R 00 00 01 00 -T FB 0B 00 00 C3 25 0D 00 00 +T 5E 0C 00 00 +R 00 00 01 00 +T 5E 0C 00 00 +R 00 00 01 00 +T 5E 0C 00 00 DD 6E 02 DD 66 03 29 E5 21 04 00 +R 00 00 01 00 +T 69 0C 00 00 39 4D 44 E1 09 36 01 23 36 00 DD +R 00 00 01 00 +T 74 0C 00 00 5E 02 DD 56 03 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 08 00 +T 7C 0C 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 08 00 02 09 21 00 +T 83 0C 00 00 02 DD 74 03 CB 7C 20 0F ED 4B +R 00 00 01 00 +T 8D 0C 00 00 08 00 00 00 DD 6E 02 DD 66 03 CD +R 00 00 01 00 02 04 07 00 +T 96 0C 00 00 00 00 00 00 38 C4 +R 00 00 01 00 02 04 2E 00 +T 9A 0C 00 00 +R 00 00 01 00 +T 9A 0C 00 00 AF DD 77 D6 DD 77 D7 +R 00 00 01 00 +T A1 0C 00 00 +R 00 00 01 00 +T A1 0C 00 00 01 14 80 DD 6E D6 DD 66 D7 3E 80 +R 00 00 01 00 +T AC 0C 00 00 AC 67 ED 42 30 2D +R 00 00 01 00 +T B2 0C 00 00 +R 00 00 01 00 +T B2 0C 00 00 DD 6E D6 DD 66 D7 29 E5 21 04 00 +R 00 00 01 00 +T BD 0C 00 00 39 4D 44 E1 09 7E 23 B6 28 0E +R 00 00 01 00 +T C7 0C 00 00 +R 00 00 01 00 +T C7 0C 00 00 DD 5E D6 DD 56 D7 3E 00 00 00 00 +R 00 00 01 00 2B 0B 16 00 +T CF 0C 00 00 21 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 16 00 02 0A 21 00 +T D5 0C 00 00 +R 00 00 01 00 +T D5 0C 00 00 DD 34 D6 20 03 DD 34 D7 +R 00 00 01 00 +T DD 0C 00 00 +R 00 00 01 00 +T DD 0C 00 00 18 C2 +R 00 00 01 00 +T DF 0C 00 00 +R 00 00 01 00 +T DF 0C 00 00 DD CB 03 7E 28 0B +R 00 00 01 00 +T E5 0C 00 00 +R 00 00 01 00 +T E5 0C 00 00 11 56 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 02 00 2B 0A 06 00 +T EB 0C 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 06 00 02 09 21 00 +T F0 0C 00 00 +R 00 00 01 00 +T F0 0C 00 00 +R 00 00 01 00 +T F0 0C 00 00 DD 6E 02 DD 66 03 C3 00 00 00 00 +R 00 00 01 00 02 0B 13 00 +T F9 0C 00 00 +R 00 00 01 00 +T F9 0C 00 00 CD 00 00 00 00 FE FF DD 5E 02 DD +R 00 00 01 00 02 05 28 00 +T 02 0D 00 00 56 03 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 2C 00 +T 07 0D 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 2C 00 02 09 21 00 +T 0E 0D 00 00 FE DD 74 FF CB 7C 28 0B +R 00 00 01 00 +T 16 0D 00 00 +R 00 00 01 00 +T 16 0D 00 00 11 73 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 05 02 00 2B 0A 06 00 +T 1C 0D 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 06 00 02 09 21 00 +T 21 0D 00 00 +R 00 00 01 00 +T 21 0D 00 00 DD 6E FE DD 66 FF C3 00 00 00 00 +R 00 00 01 00 02 0B 13 00 +T 2A 0D 00 00 +R 00 00 01 00 +T 2A 0D 00 00 CD 00 00 00 00 7B B2 28 2C +R 00 00 01 00 02 05 20 00 +T 31 0D 00 00 +R 00 00 01 00 +T 31 0D 00 00 DD 6E 02 DD 66 03 4D 44 03 03 DD +R 00 00 01 00 +T 3C 0D 00 00 71 02 DD 70 03 5E 23 56 3E +R 00 00 01 00 +T 45 0D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 16 00 02 09 16 00 +T 4A 0D 00 00 00 00 00 00 DD 6E 02 DD 66 03 5E +R 00 00 01 00 02 04 21 00 +T 53 0D 00 00 23 56 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 16 00 +T 58 0D 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 16 00 02 09 21 00 +T 5D 0D 00 00 +R 00 00 01 00 +T 5D 0D 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T 60 0D 00 00 +R 00 00 01 00 +T 60 0D 00 00 CD 00 00 00 00 FC FF 11 08 00 3E +R 00 00 01 00 02 05 28 00 +T 69 0D 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0B 00 02 09 0B 00 +T 6E 0D 00 00 00 00 00 00 DD 75 FC DD 74 FD 7D +R 00 00 01 00 02 04 21 00 +T 77 0D 00 00 B4 20 03 +R 00 00 01 00 +T 7A 0D 00 00 +R 00 00 01 00 +T 7A 0D 00 00 C3 A4 0E 00 00 R 00 00 01 00 00 05 01 00 -T FE 0B 00 00 +T 7D 0D 00 00 R 00 00 01 00 -T FE 0B 00 00 01 01 00 DD 5E 02 DD 56 03 3E +T 7D 0D 00 00 01 01 00 DD 5E 02 DD 56 03 3E R 00 00 01 00 -T 08 0C 00 00 00 00 00 00 21 00 00 00 00 CD +T 87 0D 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 00 00 02 09 00 00 -T 0D 0C 00 00 00 00 00 00 E5 DD 6E FC DD 66 FD -R 00 00 01 00 02 04 1E 00 -T 16 0C 00 00 C1 71 23 70 DD 6E FC DD 66 FD 7E +T 8C 0D 00 00 00 00 00 00 E5 DD 6E FC DD 66 FD +R 00 00 01 00 02 04 21 00 +T 95 0D 00 00 C1 71 23 70 DD 6E FC DD 66 FD 7E R 00 00 01 00 -T 21 0C 00 00 23 B6 20 03 +T A0 0D 00 00 23 B6 20 03 R 00 00 01 00 -T 25 0C 00 00 +T A4 0D 00 00 R 00 00 01 00 -T 25 0C 00 00 C3 25 0D 00 00 +T A4 0D 00 00 C3 A4 0E 00 00 R 00 00 01 00 00 05 01 00 -T 28 0C 00 00 +T A7 0D 00 00 R 00 00 01 00 -T 28 0C 00 00 21 04 00 DD 4E FC DD 46 FD 09 DD +T A7 0D 00 00 21 04 00 DD 4E FC DD 46 FD 09 DD R 00 00 01 00 -T 33 0C 00 00 5E 04 DD 56 05 73 23 72 21 04 00 +T B2 0D 00 00 5E 04 DD 56 05 73 23 72 21 04 00 R 00 00 01 00 -T 3E 0C 00 00 19 AF 77 23 77 21 06 00 09 AF 77 +T BD 0D 00 00 19 AF 77 23 77 21 06 00 09 AF 77 R 00 00 01 00 -T 49 0C 00 00 23 77 2A 00 00 00 00 7D B4 20 0B +T C8 0D 00 00 23 77 2A 00 00 00 00 7D B4 20 0B R 00 00 01 00 00 07 03 00 -T 52 0C 00 00 +T D1 0D 00 00 R 00 00 01 00 -T 52 0C 00 00 DD 6E FC DD 66 FD 22 00 00 00 00 +T D1 0D 00 00 DD 6E FC DD 66 FD 22 00 00 00 00 R 00 00 01 00 00 0B 03 00 -T 5B 0C 00 00 18 4B +T DA 0D 00 00 18 4B R 00 00 01 00 -T 5D 0C 00 00 +T DC 0D 00 00 R 00 00 01 00 -T 5D 0C 00 00 2A 00 00 00 00 DD 75 FE DD 74 FF +T DC 0D 00 00 2A 00 00 00 00 DD 75 FE DD 74 FF R 00 00 01 00 00 05 03 00 -T 66 0C 00 00 +T E5 0D 00 00 R 00 00 01 00 -T 66 0C 00 00 DD 7E FE DD B6 FF 28 3A +T E5 0D 00 00 DD 7E FE DD B6 FF 28 3A R 00 00 01 00 -T 6E 0C 00 00 +T ED 0D 00 00 R 00 00 01 00 -T 6E 0C 00 00 21 06 00 DD 4E FE DD 46 FF 09 7E +T ED 0D 00 00 21 06 00 DD 4E FE DD 46 FF 09 7E R 00 00 01 00 -T 79 0C 00 00 23 B6 20 15 +T F8 0D 00 00 23 B6 20 15 R 00 00 01 00 -T 7D 0C 00 00 +T FC 0D 00 00 R 00 00 01 00 -T 7D 0C 00 00 21 06 00 DD 4E FE DD 46 FF 09 DD +T FC 0D 00 00 21 06 00 DD 4E FE DD 46 FF 09 DD R 00 00 01 00 -T 88 0C 00 00 4E FC DD 46 FD 71 23 70 18 16 +T 07 0E 00 00 4E FC DD 46 FD 71 23 70 18 16 R 00 00 01 00 -T 92 0C 00 00 +T 11 0E 00 00 R 00 00 01 00 -T 92 0C 00 00 21 06 00 DD 4E FE DD 46 FF 09 56 +T 11 0E 00 00 21 06 00 DD 4E FE DD 46 FF 09 56 R 00 00 01 00 -T 9D 0C 00 00 23 66 6A DD 75 FE DD 74 FF 18 BE +T 1C 0E 00 00 23 66 6A DD 75 FE DD 74 FF 18 BE R 00 00 01 00 -T A8 0C 00 00 +T 27 0E 00 00 R 00 00 01 00 -T A8 0C 00 00 +T 27 0E 00 00 R 00 00 01 00 -T A8 0C 00 00 DD 6E 04 DD 66 05 23 23 7E F6 12 +T 27 0E 00 00 DD 6E 04 DD 66 05 23 23 7E F6 12 R 00 00 01 00 -T B3 0C 00 00 77 23 7E F6 00 77 DD 6E FC DD 66 +T 32 0E 00 00 77 23 7E F6 00 77 DD 6E FC DD 66 R 00 00 01 00 -T BE 0C 00 00 FD 46 23 66 68 DD 75 02 DD 74 03 +T 3D 0E 00 00 FD 46 23 66 68 DD 75 02 DD 74 03 R 00 00 01 00 -T C9 0C 00 00 +T 48 0E 00 00 R 00 00 01 00 -T C9 0C 00 00 DD 6E 02 DD 66 03 AF B6 28 30 +T 48 0E 00 00 DD 6E 02 DD 66 03 AF B6 28 30 R 00 00 01 00 -T D3 0C 00 00 +T 52 0E 00 00 R 00 00 01 00 -T D3 0C 00 00 DD 6E 02 DD 66 03 7E E6 80 28 1B +T 52 0E 00 00 DD 6E 02 DD 66 03 7E E6 80 28 1B R 00 00 01 00 -T DE 0C 00 00 +T 5D 0E 00 00 R 00 00 01 00 -T DE 0C 00 00 DD 6E 04 DD 66 05 23 23 7E E6 EF +T 5D 0E 00 00 DD 6E 04 DD 66 05 23 23 7E E6 EF R 00 00 01 00 -T E9 0C 00 00 77 23 7E E6 FF 77 DD 6E 02 DD 66 +T 68 0E 00 00 77 23 7E E6 FF 77 DD 6E 02 DD 66 R 00 00 01 00 -T F4 0C 00 00 03 7E E6 7F 77 +T 73 0E 00 00 03 7E E6 7F 77 R 00 00 01 00 -T F9 0C 00 00 +T 78 0E 00 00 R 00 00 01 00 -T F9 0C 00 00 DD 34 02 20 03 DD 34 03 +T 78 0E 00 00 DD 34 02 20 03 DD 34 03 R 00 00 01 00 -T 01 0D 00 00 +T 80 0E 00 00 R 00 00 01 00 -T 01 0D 00 00 18 C6 +T 80 0E 00 00 18 C6 R 00 00 01 00 -T 03 0D 00 00 +T 82 0E 00 00 R 00 00 01 00 -T 03 0D 00 00 DD 6E FC DD 66 FD 23 23 E5 DD 4E +T 82 0E 00 00 DD 6E FC DD 66 FD 23 23 E5 DD 4E R 00 00 01 00 -T 0E 0D 00 00 04 DD 46 05 03 03 69 60 4E 23 46 +T 8D 0E 00 00 04 DD 46 05 03 03 69 60 4E 23 46 R 00 00 01 00 -T 19 0D 00 00 79 E6 10 5F 78 E6 00 57 E1 73 23 +T 98 0E 00 00 79 E6 10 5F 78 E6 00 57 E1 73 23 R 00 00 01 00 -T 24 0D 00 00 72 +T A3 0E 00 00 72 R 00 00 01 00 -T 25 0D 00 00 +T A4 0E 00 00 R 00 00 01 00 -T 25 0D 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T 28 0D 00 00 +T A4 0E 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T A7 0E 00 00 R 00 00 01 00 -T 28 0D 00 00 CD 00 00 00 00 FC FF 2A -R 00 00 01 00 02 05 24 00 -T 2E 0D 00 00 00 00 00 00 DD 75 FC DD 74 FD DD +T A7 0E 00 00 CD 00 00 00 00 FC FF 2A +R 00 00 01 00 02 05 28 00 +T AD 0E 00 00 00 00 00 00 DD 75 FC DD 74 FD DD R 00 00 01 00 00 04 03 00 -T 37 0D 00 00 75 FE DD 74 FF +T B6 0E 00 00 75 FE DD 74 FF R 00 00 01 00 -T 3C 0D 00 00 +T BB 0E 00 00 R 00 00 01 00 -T 3C 0D 00 00 DD 7E FC DD B6 FD 28 58 +T BB 0E 00 00 DD 7E FC DD B6 FD 28 58 R 00 00 01 00 -T 44 0D 00 00 +T C3 0E 00 00 R 00 00 01 00 -T 44 0D 00 00 DD 6E FC DD 66 FD 23 23 7E 23 B6 +T C3 0E 00 00 DD 6E FC DD 66 FD 23 23 7E 23 B6 R 00 00 01 00 -T 4F 0D 00 00 28 05 21 00 00 18 03 +T CE 0E 00 00 28 05 21 00 00 18 03 R 00 00 01 00 -T 56 0D 00 00 +T D5 0E 00 00 R 00 00 01 00 -T 56 0D 00 00 21 27 00 +T D5 0E 00 00 21 27 00 R 00 00 01 00 -T 59 0D 00 00 +T D8 0E 00 00 R 00 00 01 00 -T 59 0D 00 00 E5 DD 6E FC DD 66 FD 4E 23 46 21 +T D8 0E 00 00 E5 DD 6E FC DD 66 FD 4E 23 46 21 R 00 00 01 00 -T 64 0D 00 00 04 00 DD 5E FC DD 56 FD 19 7E 23 +T E3 0E 00 00 04 00 DD 5E FC DD 56 FD 19 7E 23 R 00 00 01 00 -T 6F 0D 00 00 66 6F 11 04 00 19 EB CD +T EE 0E 00 00 66 6F 11 04 00 19 EB CD R 00 00 01 00 -T 77 0D 00 00 C4 0D 00 00 E1 DD 6E FC DD 66 FD +T F6 0E 00 00 43 0F 00 00 E1 DD 6E FC DD 66 FD R 00 00 01 00 00 04 01 00 -T 80 0D 00 00 DD 75 FE DD 74 FF 21 06 00 DD 4E +T FF 0E 00 00 DD 75 FE DD 74 FF 21 06 00 DD 4E R 00 00 01 00 -T 8B 0D 00 00 FC DD 46 FD 09 56 23 66 6A DD 75 +T 0A 0F 00 00 FC DD 46 FD 09 56 23 66 6A DD 75 R 00 00 01 00 -T 96 0D 00 00 FC DD 74 FD 18 A0 +T 15 0F 00 00 FC DD 74 FD 18 A0 R 00 00 01 00 -T 9C 0D 00 00 +T 1B 0F 00 00 R 00 00 01 00 -T 9C 0D 00 00 DD 7E FE DD B6 FF 28 1D +T 1B 0F 00 00 DD 7E FE DD B6 FF 28 1D R 00 00 01 00 -T A4 0D 00 00 +T 23 0F 00 00 R 00 00 01 00 -T A4 0D 00 00 21 06 00 DD 4E FE DD 46 FF 09 ED +T 23 0F 00 00 21 06 00 DD 4E FE DD 46 FF 09 ED R 00 00 01 00 -T AF 0D 00 00 4B 02 00 00 00 71 23 70 2A +T 2E 0F 00 00 4B 02 00 00 00 71 23 70 2A R 00 00 01 00 00 05 03 00 -T B6 0D 00 00 00 00 00 00 22 02 00 00 00 21 +T 35 0F 00 00 00 00 00 00 22 02 00 00 00 21 R 00 00 01 00 00 04 03 00 00 09 03 00 -T BC 0D 00 00 00 00 22 00 00 00 00 +T 3B 0F 00 00 00 00 22 00 00 00 00 R 00 00 01 00 00 07 03 00 -T C1 0D 00 00 +T 40 0F 00 00 R 00 00 01 00 -T C1 0D 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T C4 0D 00 00 +T 40 0F 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T 43 0F 00 00 R 00 00 01 00 -T C4 0D 00 00 CD 00 00 00 00 9C F7 21 02 00 39 -R 00 00 01 00 02 05 24 00 -T CD 0D 00 00 5D 54 3E 46 12 00 00 21 +T 43 0F 00 00 CD 00 00 00 00 9C F7 21 02 00 39 +R 00 00 01 00 02 05 28 00 +T 4C 0F 00 00 5D 54 3E C5 13 00 00 21 R 00 00 01 00 29 07 01 00 -T D2 0D 00 00 46 12 00 00 CD 00 00 00 00 ED 4B -R 00 00 01 00 00 04 01 00 02 09 1E 00 -T D9 0D 00 00 00 00 00 00 21 02 00 39 5D 54 3E -R 00 00 01 00 02 04 22 00 -T E2 0D 00 00 00 00 00 00 21 00 00 00 00 CD +T 51 0F 00 00 C5 13 00 00 CD 00 00 00 00 ED 4B +R 00 00 01 00 00 04 01 00 02 09 21 00 +T 58 0F 00 00 00 00 00 00 21 02 00 39 5D 54 3E +R 00 00 01 00 02 04 26 00 +T 61 0F 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 04 00 02 09 04 00 -T E7 0D 00 00 00 00 00 00 E5 DD 6E 02 DD 66 03 -R 00 00 01 00 02 04 1E 00 -T F0 0D 00 00 C1 71 23 70 21 00 00 39 E5 01 +T 66 0F 00 00 00 00 00 00 E5 DD 6E 02 DD 66 03 +R 00 00 01 00 02 04 21 00 +T 6F 0F 00 00 C1 71 23 70 21 00 00 39 E5 01 R 00 00 01 00 -T FA 0D 00 00 80 01 21 04 00 39 5D 54 3E +T 79 0F 00 00 80 01 21 04 00 39 5D 54 3E R 00 00 01 00 -T 03 0E 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0D 00 02 09 0D 00 -T 08 0E 00 00 00 00 00 00 4D 44 E1 71 23 70 21 -R 00 00 01 00 02 04 1E 00 -T 11 0E 00 00 00 00 39 23 CB 7E 28 03 +T 82 0F 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0E 00 02 09 0E 00 +T 87 0F 00 00 00 00 00 00 4D 44 E1 71 23 70 21 +R 00 00 01 00 02 04 21 00 +T 90 0F 00 00 00 00 39 23 CB 7E 28 03 R 00 00 01 00 -T 19 0E 00 00 +T 98 0F 00 00 R 00 00 01 00 -T 19 0E 00 00 C3 B6 0F 00 00 +T 98 0F 00 00 C3 35 11 00 00 R 00 00 01 00 00 05 01 00 -T 1C 0E 00 00 -R 00 00 01 00 -T 1C 0E 00 00 21 22 00 39 22 00 00 00 00 EB 3E -R 00 00 01 00 02 09 27 00 -T 25 0E 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0F 00 02 09 0F 00 -T 2A 0E 00 00 00 00 00 00 EB 3E 00 00 00 00 21 -R 00 00 01 00 02 04 1E 00 2B 0A 10 00 -T 30 0E 00 00 00 00 00 00 CD 00 00 00 00 7D B4 -R 00 00 01 00 02 04 10 00 02 09 1E 00 -T 37 0E 00 00 28 11 -R 00 00 01 00 -T 39 0E 00 00 -R 00 00 01 00 -T 39 0E 00 00 21 02 00 39 5D 54 3E 00 00 00 00 -R 00 00 01 00 2B 0B 0E 00 -T 41 0E 00 00 21 00 00 00 00 CD 00 00 00 00 C3 -R 00 00 01 00 02 05 0E 00 02 0A 1E 00 -T 48 0E 00 00 A7 0F 00 00 +T 9B 0F 00 00 +R 00 00 01 00 +T 9B 0F 00 00 21 22 00 39 22 00 00 00 00 EB 3E +R 00 00 01 00 02 09 2B 00 +T A4 0F 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 10 00 02 09 10 00 +T A9 0F 00 00 00 00 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 02 04 21 00 2B 0A 11 00 +T AF 0F 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 02 04 11 00 02 09 21 00 +T B6 0F 00 00 28 11 +R 00 00 01 00 +T B8 0F 00 00 +R 00 00 01 00 +T B8 0F 00 00 21 02 00 39 5D 54 3E 00 00 00 00 +R 00 00 01 00 2B 0B 0F 00 +T C0 0F 00 00 21 00 00 00 00 CD 00 00 00 00 C3 +R 00 00 01 00 02 05 0F 00 02 0A 21 00 +T C7 0F 00 00 26 11 00 00 R 00 00 01 00 00 04 01 00 -T 4A 0E 00 00 +T C9 0F 00 00 R 00 00 01 00 -T 4A 0E 00 00 2A 04 00 00 00 23 23 4E C5 2B 46 -R 00 00 01 00 02 05 06 00 -T 53 0E 00 00 2B 4E C5 2A 04 00 00 00 23 23 23 -R 00 00 01 00 02 08 06 00 -T 5C 0E 00 00 5E 23 56 3E 81 02 00 00 21 +T C9 0F 00 00 2A 04 00 00 00 23 23 4E C5 2B 46 +R 00 00 01 00 02 05 07 00 +T D2 0F 00 00 2B 4E C5 2A 04 00 00 00 23 23 23 +R 00 00 01 00 02 08 07 00 +T DB 0F 00 00 5E 23 56 3E 81 02 00 00 21 R 00 00 01 00 29 08 01 00 -T 62 0E 00 00 81 02 00 00 CD 00 00 00 00 E1 E1 -R 00 00 01 00 00 04 01 00 02 09 1E 00 -T 69 0E 00 00 2A 04 00 00 00 22 02 00 00 00 -R 00 00 01 00 02 05 06 00 02 0A 06 00 -T 6F 0E 00 00 -R 00 00 01 00 -T 6F 0E 00 00 2A 00 00 00 00 7D B4 28 1A ED 4B -R 00 00 01 00 02 05 23 00 -T 78 0E 00 00 04 00 00 00 21 00 00 00 00 A7 ED -R 00 00 01 00 02 04 06 00 02 09 29 00 -T 7F 0E 00 00 42 38 0E +T E1 0F 00 00 81 02 00 00 CD 00 00 00 00 E1 E1 +R 00 00 01 00 00 04 01 00 02 09 21 00 +T E8 0F 00 00 2A 04 00 00 00 22 02 00 00 00 +R 00 00 01 00 02 05 07 00 02 0A 07 00 +T EE 0F 00 00 R 00 00 01 00 -T 82 0E 00 00 +T EE 0F 00 00 2A 00 00 00 00 7D B4 28 1A ED 4B +R 00 00 01 00 02 05 27 00 +T F7 0F 00 00 04 00 00 00 21 00 00 00 00 A7 ED +R 00 00 01 00 02 04 07 00 02 09 2D 00 +T FE 0F 00 00 42 38 0E R 00 00 01 00 -T 82 0E 00 00 +T 01 10 00 00 R 00 00 01 00 -T 82 0E 00 00 +T 01 10 00 00 +R 00 00 01 00 +T 01 10 00 00 R 00 00 01 00 -T 82 0E 00 00 2A 00 00 00 00 5E 23 56 3E +T 01 10 00 00 2A 00 00 00 00 5E 23 56 3E R 00 00 01 00 02 05 01 00 -T 89 0E 00 00 DA 09 00 00 21 DA 09 00 00 CD +T 08 10 00 00 07 0A 00 00 21 07 0A 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T 8E 0E 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T 90 0E 00 00 +T 0D 10 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T 0F 10 00 00 R 00 00 01 00 -T 90 0E 00 00 21 2D 00 39 DD 75 FE DD 74 FF +T 0F 10 00 00 21 2D 00 39 DD 75 FE DD 74 FF R 00 00 01 00 -T 9A 0E 00 00 +T 19 10 00 00 R 00 00 01 00 -T 9A 0E 00 00 21 20 00 39 E5 DD 5E 08 DD 56 09 +T 19 10 00 00 21 20 00 39 E5 DD 5E 08 DD 56 09 R 00 00 01 00 -T A5 0E 00 00 3E 00 00 00 00 21 00 00 00 00 CD +T 24 10 00 00 3E 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 29 05 01 00 00 0A 01 00 -T AB 0E 00 00 00 00 00 00 4D 44 E1 71 23 70 3E -R 00 00 01 00 02 04 1E 00 -T B4 0E 00 00 0A A9 B0 28 55 21 20 00 39 7E 23 +T 2A 10 00 00 00 00 00 00 4D 44 E1 71 23 70 3E +R 00 00 01 00 02 04 21 00 +T 33 10 00 00 0A A9 B0 28 55 21 20 00 39 7E 23 R 00 00 01 00 -T BF 0E 00 00 B6 28 4C +T 3E 10 00 00 B6 28 4C R 00 00 01 00 -T C2 0E 00 00 +T 41 10 00 00 R 00 00 01 00 -T C2 0E 00 00 +T 41 10 00 00 R 00 00 01 00 -T C2 0E 00 00 +T 41 10 00 00 R 00 00 01 00 -T C2 0E 00 00 3E 27 DD AE 08 DD B6 09 20 0D +T 41 10 00 00 3E 27 DD AE 08 DD B6 09 20 0D R 00 00 01 00 -T CC 0E 00 00 +T 4B 10 00 00 R 00 00 01 00 -T CC 0E 00 00 21 20 00 39 7E E6 7F 77 23 7E E6 +T 4B 10 00 00 21 20 00 39 7E E6 7F 77 23 7E E6 R 00 00 01 00 -T D7 0E 00 00 FF 77 +T 56 10 00 00 FF 77 R 00 00 01 00 -T D9 0E 00 00 +T 58 10 00 00 R 00 00 01 00 -T D9 0E 00 00 21 2D 00 39 01 34 08 09 4D 44 DD +T 58 10 00 00 21 2D 00 39 01 34 08 09 4D 44 DD R 00 00 01 00 -T E4 0E 00 00 6E FE DD 66 FF A7 ED 42 38 0A +T 63 10 00 00 6E FE DD 66 FF A7 ED 42 38 0A R 00 00 01 00 -T EE 0E 00 00 +T 6D 10 00 00 R 00 00 01 00 -T EE 0E 00 00 21 20 00 39 AF 77 23 77 18 16 +T 6D 10 00 00 21 20 00 39 AF 77 23 77 18 16 R 00 00 01 00 -T F8 0E 00 00 +T 77 10 00 00 R 00 00 01 00 -T F8 0E 00 00 21 20 00 39 46 DD 6E FE DD 66 FF +T 77 10 00 00 21 20 00 39 46 DD 6E FE DD 66 FF R 00 00 01 00 -T 03 0F 00 00 23 DD 75 FE DD 74 FF 2B 70 18 8C +T 82 10 00 00 23 DD 75 FE DD 74 FF 2B 70 18 8C R 00 00 01 00 -T 0E 0F 00 00 +T 8D 10 00 00 R 00 00 01 00 -T 0E 0F 00 00 DD 6E FE DD 66 FF 36 00 21 2D 00 +T 8D 10 00 00 DD 6E FE DD 66 FF 36 00 21 2D 00 R 00 00 01 00 -T 19 0F 00 00 39 4D 44 DD 5E 04 DD 56 05 3E +T 98 10 00 00 39 4D 44 DD 5E 04 DD 56 05 3E R 00 00 01 00 -T 23 0F 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 16 00 02 09 16 00 -T 28 0F 00 00 00 00 00 00 7D B4 28 09 21 20 00 -R 00 00 01 00 02 04 1E 00 -T 31 0F 00 00 39 7E 23 B6 20 02 +T A2 10 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 19 00 02 09 19 00 +T A7 10 00 00 00 00 00 00 7D B4 28 09 21 20 00 +R 00 00 01 00 02 04 21 00 +T B0 10 00 00 39 7E 23 B6 20 02 R 00 00 01 00 -T 37 0F 00 00 +T B6 10 00 00 R 00 00 01 00 -T 37 0F 00 00 +T B6 10 00 00 R 00 00 01 00 -T 37 0F 00 00 +T B6 10 00 00 R 00 00 01 00 -T 37 0F 00 00 18 39 +T B6 10 00 00 18 39 R 00 00 01 00 -T 39 0F 00 00 +T B8 10 00 00 R 00 00 01 00 -T 39 0F 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T B8 10 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T 44 0F 00 00 74 FF 2B 36 0A 21 2D 00 39 4D 44 +T C3 10 00 00 74 FF 2B 36 0A 21 2D 00 39 4D 44 R 00 00 01 00 -T 4F 0F 00 00 DD 6E FE DD 66 FF A7 ED 42 E5 21 +T CE 10 00 00 DD 6E FE DD 66 FF A7 ED 42 E5 21 R 00 00 01 00 -T 5A 0F 00 00 2F 00 39 4D 44 21 02 00 39 5E 23 +T D9 10 00 00 2F 00 39 4D 44 21 02 00 39 5E 23 R 00 00 01 00 -T 65 0F 00 00 56 3E 00 00 00 00 21 00 00 00 00 -R 00 00 01 00 2B 06 08 00 02 0B 08 00 -T 6B 0F 00 00 CD 00 00 00 00 F1 C3 6F 0E 00 00 -R 00 00 01 00 02 05 1E 00 00 0B 01 00 -T 72 0F 00 00 +T E4 10 00 00 56 3E 00 00 00 00 21 00 00 00 00 +R 00 00 01 00 2B 06 09 00 02 0B 09 00 +T EA 10 00 00 CD 00 00 00 00 F1 C3 EE 0F 00 00 +R 00 00 01 00 02 05 21 00 00 0B 01 00 +T F1 10 00 00 R 00 00 01 00 -T 72 0F 00 00 21 20 00 39 7E 23 B6 20 24 +T F1 10 00 00 21 20 00 39 7E 23 B6 20 24 R 00 00 01 00 -T 7B 0F 00 00 +T FA 10 00 00 R 00 00 01 00 -T 7B 0F 00 00 11 6D 00 00 00 3E DA 09 00 00 21 +T FA 10 00 00 11 91 00 00 00 3E DA 09 00 00 21 R 00 00 01 00 00 05 02 00 29 0A 01 00 -T 81 0F 00 00 DA 09 00 00 CD 00 00 00 00 DD 5E -R 00 00 01 00 00 04 01 00 02 09 1E 00 -T 88 0F 00 00 04 DD 56 05 3E DA 09 00 00 21 +T 00 11 00 00 DA 09 00 00 CD 00 00 00 00 DD 5E +R 00 00 01 00 00 04 01 00 02 09 21 00 +T 07 11 00 00 04 DD 56 05 3E DA 09 00 00 21 R 00 00 01 00 29 09 01 00 -T 8F 0F 00 00 DA 09 00 00 CD 00 00 00 00 11 -R 00 00 01 00 00 04 01 00 02 09 1E 00 -T 95 0F 00 00 7D 00 00 00 3E 00 00 00 00 21 -R 00 00 01 00 00 04 02 00 2B 09 05 00 -T 9A 0F 00 00 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 04 05 00 02 09 1E 00 -T 9F 0F 00 00 -R 00 00 01 00 -T 9F 0F 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 0B 00 02 0A 0B 00 -T A5 0F 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T A7 0F 00 00 +T 0E 11 00 00 DA 09 00 00 CD 00 00 00 00 11 +R 00 00 01 00 00 04 01 00 02 09 21 00 +T 14 11 00 00 A1 00 00 00 3E 00 00 00 00 21 +R 00 00 01 00 00 04 02 00 2B 09 06 00 +T 19 11 00 00 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 04 06 00 02 09 21 00 +T 1E 11 00 00 +R 00 00 01 00 +T 1E 11 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 0C 00 02 0A 0C 00 +T 24 11 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T 26 11 00 00 R 00 00 01 00 -T A7 0F 00 00 21 00 00 39 5E 23 56 3E +T 26 11 00 00 21 00 00 39 5E 23 56 3E R 00 00 01 00 -T AF 0F 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 14 00 02 09 14 00 -T B4 0F 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T B6 0F 00 00 +T 2E 11 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 16 00 02 09 16 00 +T 33 11 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T 35 11 00 00 R 00 00 01 00 -T B6 0F 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 18 00 -T B9 0F 00 00 +T 35 11 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 1B 00 +T 38 11 00 00 R 00 00 01 00 -T B9 0F 00 00 CD 00 00 00 00 D2 FF DD 7E 02 DD -R 00 00 01 00 02 05 24 00 -T C2 0F 00 00 B6 03 20 06 +T 38 11 00 00 CD 00 00 00 00 D2 FF DD 7E 02 DD +R 00 00 01 00 02 05 28 00 +T 41 11 00 00 B6 03 20 06 R 00 00 01 00 -T C6 0F 00 00 +T 45 11 00 00 R 00 00 01 00 -T C6 0F 00 00 21 FF FF C3 01 11 00 00 +T 45 11 00 00 21 FF FF C3 80 12 00 00 R 00 00 01 00 00 08 01 00 -T CC 0F 00 00 +T 4B 11 00 00 R 00 00 01 00 -T CC 0F 00 00 21 00 00 E5 DD 6E 02 DD 66 03 E5 +T 4B 11 00 00 21 00 00 E5 DD 6E 02 DD 66 03 E5 R 00 00 01 00 -T D7 0F 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 2B 00 02 0A 2B 00 -T DD 0F 00 00 00 00 00 00 F1 F1 DD 75 D2 DD 74 -R 00 00 01 00 02 04 1E 00 -T E6 0F 00 00 D3 CB 7C 28 06 +T 56 11 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 2F 00 02 0A 2F 00 +T 5C 11 00 00 00 00 00 00 F1 F1 DD 75 D2 DD 74 +R 00 00 01 00 02 04 21 00 +T 65 11 00 00 D3 CB 7C 28 06 R 00 00 01 00 -T EB 0F 00 00 +T 6A 11 00 00 R 00 00 01 00 -T EB 0F 00 00 21 FF FF C3 01 11 00 00 +T 6A 11 00 00 21 FF FF C3 80 12 00 00 R 00 00 01 00 00 08 01 00 -T F1 0F 00 00 +T 70 11 00 00 R 00 00 01 00 -T F1 0F 00 00 DD 7E 04 DD B6 05 CA FB 10 00 00 +T 70 11 00 00 DD 7E 04 DD B6 05 CA 7A 12 00 00 R 00 00 01 00 00 0B 01 00 -T FA 0F 00 00 +T 79 11 00 00 R 00 00 01 00 -T FA 0F 00 00 21 05 00 39 5D 54 3E 46 12 00 00 +T 79 11 00 00 21 05 00 39 5D 54 3E C5 13 00 00 R 00 00 01 00 29 0B 01 00 -T 02 10 00 00 21 46 12 00 00 CD 00 00 00 00 01 -R 00 00 01 00 00 05 01 00 02 0A 1E 00 -T 09 10 00 00 80 01 21 05 00 39 5D 54 3E +T 81 11 00 00 21 C5 13 00 00 CD 00 00 00 00 01 +R 00 00 01 00 00 05 01 00 02 0A 21 00 +T 88 11 00 00 80 01 21 05 00 39 5D 54 3E R 00 00 01 00 -T 12 10 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0D 00 02 09 0D 00 -T 17 10 00 00 00 00 00 00 DD 75 D4 DD 74 D5 CB -R 00 00 01 00 02 04 1E 00 -T 20 10 00 00 7C 28 06 +T 91 11 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0E 00 02 09 0E 00 +T 96 11 00 00 00 00 00 00 DD 75 D4 DD 74 D5 CB +R 00 00 01 00 02 04 21 00 +T 9F 11 00 00 7C 28 06 R 00 00 01 00 -T 23 10 00 00 +T A2 11 00 00 R 00 00 01 00 -T 23 10 00 00 21 FF FF C3 01 11 00 00 +T A2 11 00 00 21 FF FF C3 80 12 00 00 R 00 00 01 00 00 08 01 00 -T 29 10 00 00 +T A8 11 00 00 R 00 00 01 00 -T 29 10 00 00 21 23 00 39 22 00 00 00 00 EB 3E -R 00 00 01 00 02 09 27 00 -T 32 10 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0F 00 02 09 0F 00 -T 37 10 00 00 00 00 00 00 EB 3E 00 00 00 00 21 -R 00 00 01 00 02 04 1E 00 2B 0A 10 00 -T 3D 10 00 00 00 00 00 00 CD 00 00 00 00 7D B4 -R 00 00 01 00 02 04 10 00 02 09 1E 00 -T 44 10 00 00 20 6A +T A8 11 00 00 21 23 00 39 22 00 00 00 00 EB 3E +R 00 00 01 00 02 09 2B 00 +T B1 11 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 10 00 02 09 10 00 +T B6 11 00 00 00 00 00 00 EB 3E 00 00 00 00 21 +R 00 00 01 00 02 04 21 00 2B 0A 11 00 +T BC 11 00 00 00 00 00 00 CD 00 00 00 00 7D B4 +R 00 00 01 00 02 04 11 00 02 09 21 00 +T C3 11 00 00 20 6A R 00 00 01 00 -T 46 10 00 00 +T C5 11 00 00 R 00 00 01 00 -T 46 10 00 00 DD 6E D2 DD 66 D3 22 12 04 00 00 +T C5 11 00 00 DD 6E D2 DD 66 D3 22 12 04 00 00 R 00 00 01 00 00 0B 04 00 -T 4F 10 00 00 0E 28 08 00 00 C5 21 28 08 00 00 +T CE 11 00 00 0E 28 08 00 00 C5 21 28 08 00 00 R 00 00 01 00 29 05 01 00 00 0B 01 00 -T 55 10 00 00 E5 11 0E 04 00 00 3E 81 02 00 00 +T D4 11 00 00 E5 11 0E 04 00 00 3E 81 02 00 00 R 00 00 01 00 00 06 04 00 29 0B 01 00 -T 5B 10 00 00 21 81 02 00 00 CD 00 00 00 00 E1 -R 00 00 01 00 00 05 01 00 02 0A 1E 00 -T 62 10 00 00 E1 ED 5B 04 00 00 00 3E -R 00 00 01 00 02 07 06 00 -T 68 10 00 00 60 04 00 00 21 60 04 00 00 CD +T DA 11 00 00 21 81 02 00 00 CD 00 00 00 00 E1 +R 00 00 01 00 00 05 01 00 02 0A 21 00 +T E1 11 00 00 E1 ED 5B 04 00 00 00 3E +R 00 00 01 00 02 07 07 00 +T E7 11 00 00 60 04 00 00 21 60 04 00 00 CD R 00 00 01 00 29 04 01 00 00 09 01 00 -T 6D 10 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T 6F 10 00 00 +T EC 11 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T EE 11 00 00 R 00 00 01 00 -T 6F 10 00 00 01 00 00 1E 00 3E 00 00 00 00 21 -R 00 00 01 00 2B 0A 26 00 -T 77 10 00 00 00 00 00 00 CD 00 00 00 00 DD 75 -R 00 00 01 00 02 04 26 00 02 09 1E 00 -T 7E 10 00 00 D6 2C 2D 28 23 +T EE 11 00 00 01 00 00 1E 00 3E 00 00 00 00 21 +R 00 00 01 00 2B 0A 2A 00 +T F6 11 00 00 00 00 00 00 CD 00 00 00 00 DD 75 +R 00 00 01 00 02 04 2A 00 02 09 21 00 +T FD 11 00 00 D6 2C 2D 28 23 R 00 00 01 00 -T 83 10 00 00 +T 02 12 00 00 R 00 00 01 00 -T 83 10 00 00 DD 7E D6 E6 7F DD 77 D6 21 01 00 +T 02 12 00 00 DD 7E D6 E6 7F DD 77 D6 21 01 00 R 00 00 01 00 -T 8E 10 00 00 E5 21 06 00 39 4D 44 DD 5E D4 DD +T 0D 12 00 00 E5 21 06 00 39 4D 44 DD 5E D4 DD R 00 00 01 00 -T 99 10 00 00 56 D5 3E 00 00 00 00 21 -R 00 00 01 00 2B 07 08 00 -T 9E 10 00 00 00 00 00 00 CD 00 00 00 00 F1 18 -R 00 00 01 00 02 04 08 00 02 09 1E 00 -T A5 10 00 00 C9 +T 18 12 00 00 56 D5 3E 00 00 00 00 21 +R 00 00 01 00 2B 07 09 00 +T 1D 12 00 00 00 00 00 00 CD 00 00 00 00 F1 18 +R 00 00 01 00 02 04 09 00 02 09 21 00 +T 24 12 00 00 C9 R 00 00 01 00 -T A6 10 00 00 +T 25 12 00 00 R 00 00 01 00 -T A6 10 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 0B 00 02 0A 0B 00 -T AC 10 00 00 00 00 00 00 18 0E -R 00 00 01 00 02 04 1E 00 -T B0 10 00 00 -R 00 00 01 00 -T B0 10 00 00 21 05 00 39 5D 54 3E 00 00 00 00 -R 00 00 01 00 2B 0B 0E 00 -T B8 10 00 00 21 00 00 00 00 CD 00 00 00 00 -R 00 00 01 00 02 05 0E 00 02 0A 1E 00 -T BE 10 00 00 -R 00 00 01 00 -T BE 10 00 00 DD 5E D4 DD 56 D5 3E 00 00 00 00 -R 00 00 01 00 2B 0B 14 00 -T C6 10 00 00 21 00 00 00 00 CD 00 00 00 00 21 -R 00 00 01 00 02 05 14 00 02 0A 1E 00 -T CD 10 00 00 00 00 E5 21 07 00 39 E5 3E -R 00 00 01 00 -T D6 10 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 2B 00 02 09 2B 00 -T DB 10 00 00 00 00 00 00 F1 F1 DD 75 D4 DD 74 -R 00 00 01 00 02 04 1E 00 -T E4 10 00 00 D5 21 05 00 39 5D 54 3E +T 25 12 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 0C 00 02 0A 0C 00 +T 2B 12 00 00 00 00 00 00 18 0E +R 00 00 01 00 02 04 21 00 +T 2F 12 00 00 +R 00 00 01 00 +T 2F 12 00 00 21 05 00 39 5D 54 3E 00 00 00 00 +R 00 00 01 00 2B 0B 0F 00 +T 37 12 00 00 21 00 00 00 00 CD 00 00 00 00 +R 00 00 01 00 02 05 0F 00 02 0A 21 00 +T 3D 12 00 00 +R 00 00 01 00 +T 3D 12 00 00 DD 5E D4 DD 56 D5 3E 00 00 00 00 +R 00 00 01 00 2B 0B 16 00 +T 45 12 00 00 21 00 00 00 00 CD 00 00 00 00 21 +R 00 00 01 00 02 05 16 00 02 0A 21 00 +T 4C 12 00 00 00 00 E5 21 07 00 39 E5 3E +R 00 00 01 00 +T 55 12 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 2F 00 02 09 2F 00 +T 5A 12 00 00 00 00 00 00 F1 F1 DD 75 D4 DD 74 +R 00 00 01 00 02 04 21 00 +T 63 12 00 00 D5 21 05 00 39 5D 54 3E R 00 00 01 00 -T EC 10 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0E 00 02 09 0E 00 -T F1 10 00 00 00 00 00 00 DD 6E D4 DD 66 D5 18 -R 00 00 01 00 02 04 1E 00 -T FA 10 00 00 06 +T 6B 12 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0F 00 02 09 0F 00 +T 70 12 00 00 00 00 00 00 DD 6E D4 DD 66 D5 18 +R 00 00 01 00 02 04 21 00 +T 79 12 00 00 06 R 00 00 01 00 -T FB 10 00 00 +T 7A 12 00 00 R 00 00 01 00 -T FB 10 00 00 DD 6E D2 DD 66 D3 +T 7A 12 00 00 DD 6E D2 DD 66 D3 R 00 00 01 00 -T 01 11 00 00 +T 80 12 00 00 R 00 00 01 00 -T 01 11 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T 04 11 00 00 +T 80 12 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T 83 12 00 00 R 00 00 01 00 -T 04 11 00 00 CD 00 00 00 00 FE FF 2A -R 00 00 01 00 02 05 24 00 -T 0A 11 00 00 00 00 00 00 DD 75 FE DD 74 FF +T 83 12 00 00 CD 00 00 00 00 FE FF 2A +R 00 00 01 00 02 05 28 00 +T 89 12 00 00 00 00 00 00 DD 75 FE DD 74 FF R 00 00 01 00 00 04 03 00 -T 12 11 00 00 +T 91 12 00 00 R 00 00 01 00 -T 12 11 00 00 DD 7E FE DD B6 FF 28 59 +T 91 12 00 00 DD 7E FE DD B6 FF 28 59 R 00 00 01 00 -T 1A 11 00 00 +T 99 12 00 00 R 00 00 01 00 -T 1A 11 00 00 21 04 00 DD 4E FE DD 46 FF 09 7E +T 99 12 00 00 21 04 00 DD 4E FE DD 46 FF 09 7E R 00 00 01 00 -T 25 11 00 00 23 B6 28 34 21 04 00 DD 4E FE DD +T A4 12 00 00 23 B6 28 34 21 04 00 DD 4E FE DD R 00 00 01 00 -T 30 11 00 00 46 FF 09 46 23 66 68 01 04 00 09 +T AF 12 00 00 46 FF 09 46 23 66 68 01 04 00 09 R 00 00 01 00 -T 3B 11 00 00 7E 23 B6 28 1D +T BA 12 00 00 7E 23 B6 28 1D R 00 00 01 00 -T 40 11 00 00 +T BF 12 00 00 R 00 00 01 00 -T 40 11 00 00 +T BF 12 00 00 R 00 00 01 00 -T 40 11 00 00 +T BF 12 00 00 R 00 00 01 00 -T 40 11 00 00 21 04 00 DD 4E FE DD 46 FF 09 46 +T BF 12 00 00 21 04 00 DD 4E FE DD 46 FF 09 46 R 00 00 01 00 -T 4B 11 00 00 23 66 68 01 04 00 09 5E 23 56 3E +T CA 12 00 00 23 66 68 01 04 00 09 5E 23 56 3E R 00 00 01 00 -T 56 11 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0E 00 02 09 0E 00 -T 5B 11 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T 5D 11 00 00 +T D5 12 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0F 00 02 09 0F 00 +T DA 12 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T DC 12 00 00 R 00 00 01 00 -T 5D 11 00 00 21 06 00 DD 4E FE DD 46 FF 09 56 +T DC 12 00 00 21 06 00 DD 4E FE DD 46 FF 09 56 R 00 00 01 00 -T 68 11 00 00 23 66 6A DD 75 FE DD 74 FF 18 9F +T E7 12 00 00 23 66 6A DD 75 FE DD 74 FF 18 9F R 00 00 01 00 -T 73 11 00 00 +T F2 12 00 00 R 00 00 01 00 -T 73 11 00 00 21 00 00 22 00 00 00 00 C3 +T F2 12 00 00 21 00 00 22 00 00 00 00 C3 R 00 00 01 00 00 08 03 00 -T 7A 11 00 00 00 00 00 00 -R 00 00 01 00 02 04 12 00 -T 7C 11 00 00 +T F9 12 00 00 00 00 00 00 +R 00 00 01 00 02 04 13 00 +T FB 12 00 00 R 00 00 01 00 -T 7C 11 00 00 CD 00 00 00 00 FC FF AF DD 77 FE -R 00 00 01 00 02 05 24 00 -T 85 11 00 00 DD 77 FF 2A 02 00 00 00 DD 75 FC +T FB 12 00 00 CD 00 00 00 00 FC FF AF DD 77 FE +R 00 00 01 00 02 05 28 00 +T 04 13 00 00 DD 77 FF 2A 02 00 00 00 DD 75 FC R 00 00 01 00 00 08 03 00 -T 8E 11 00 00 DD 74 FD +T 0D 13 00 00 DD 74 FD R 00 00 01 00 -T 91 11 00 00 +T 10 13 00 00 R 00 00 01 00 -T 91 11 00 00 DD 7E FC DD B6 FD CA 43 12 00 00 +T 10 13 00 00 DD 7E FC DD B6 FD CA C2 13 00 00 R 00 00 01 00 00 0B 01 00 -T 9A 11 00 00 +T 19 13 00 00 R 00 00 01 00 -T 9A 11 00 00 DD 5E FC DD 56 FD 3E 00 00 00 00 -R 00 00 01 00 2B 0B 17 00 -T A2 11 00 00 21 00 00 00 00 CD 00 00 00 00 DD -R 00 00 01 00 02 05 17 00 02 0A 1E 00 -T A9 11 00 00 4E 02 DD 46 03 CD 00 00 00 00 38 -R 00 00 01 00 02 0A 2A 00 -T B2 11 00 00 6D +T 19 13 00 00 DD 5E FC DD 56 FD 3E 00 00 00 00 +R 00 00 01 00 2B 0B 1A 00 +T 21 13 00 00 21 00 00 00 00 CD 00 00 00 00 DD +R 00 00 01 00 02 05 1A 00 02 0A 21 00 +T 28 13 00 00 4E 02 DD 46 03 CD 00 00 00 00 38 +R 00 00 01 00 02 0A 2E 00 +T 31 13 00 00 6D R 00 00 01 00 -T B3 11 00 00 +T 32 13 00 00 R 00 00 01 00 -T B3 11 00 00 21 04 00 DD 4E FC DD 46 FD 09 46 +T 32 13 00 00 21 04 00 DD 4E FC DD 46 FD 09 46 R 00 00 01 00 -T BE 11 00 00 23 66 68 01 04 00 09 7E 23 B6 28 +T 3D 13 00 00 23 66 68 01 04 00 09 7E 23 B6 28 R 00 00 01 00 -T C9 11 00 00 1D +T 48 13 00 00 1D R 00 00 01 00 -T CA 11 00 00 +T 49 13 00 00 R 00 00 01 00 -T CA 11 00 00 21 04 00 DD 4E FC DD 46 FD 09 46 +T 49 13 00 00 21 04 00 DD 4E FC DD 46 FD 09 46 R 00 00 01 00 -T D5 11 00 00 23 66 68 01 04 00 09 5E 23 56 3E +T 54 13 00 00 23 66 68 01 04 00 09 5E 23 56 3E R 00 00 01 00 -T E0 11 00 00 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 04 0E 00 02 09 0E 00 -T E5 11 00 00 00 00 00 00 -R 00 00 01 00 02 04 1E 00 -T E7 11 00 00 +T 5F 13 00 00 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 04 0F 00 02 09 0F 00 +T 64 13 00 00 00 00 00 00 +R 00 00 01 00 02 04 21 00 +T 66 13 00 00 R 00 00 01 00 -T E7 11 00 00 DD 7E FE DD B6 FF 20 13 +T 66 13 00 00 DD 7E FE DD B6 FF 20 13 R 00 00 01 00 -T EF 11 00 00 +T 6E 13 00 00 R 00 00 01 00 -T EF 11 00 00 21 06 00 DD 4E FC DD 46 FD 09 46 +T 6E 13 00 00 21 06 00 DD 4E FC DD 46 FD 09 46 R 00 00 01 00 -T FA 11 00 00 23 66 68 22 02 00 00 00 18 1C +T 79 13 00 00 23 66 68 22 02 00 00 00 18 1C R 00 00 01 00 00 08 03 00 -T 02 12 00 00 +T 81 13 00 00 R 00 00 01 00 -T 02 12 00 00 21 06 00 DD 4E FE DD 46 FF 09 E5 +T 81 13 00 00 21 06 00 DD 4E FE DD 46 FF 09 E5 R 00 00 01 00 -T 0D 12 00 00 21 06 00 DD 4E FC DD 46 FD 09 4E +T 8C 13 00 00 21 06 00 DD 4E FC DD 46 FD 09 4E R 00 00 01 00 -T 18 12 00 00 23 46 E1 71 23 70 +T 97 13 00 00 23 46 E1 71 23 70 R 00 00 01 00 -T 1E 12 00 00 +T 9D 13 00 00 R 00 00 01 00 -T 1E 12 00 00 18 0C +T 9D 13 00 00 18 0C R 00 00 01 00 -T 20 12 00 00 +T 9F 13 00 00 R 00 00 01 00 -T 20 12 00 00 DD 6E FC DD 66 FD DD 75 FE DD 74 +T 9F 13 00 00 DD 6E FC DD 66 FD DD 75 FE DD 74 R 00 00 01 00 -T 2B 12 00 00 FF +T AA 13 00 00 FF R 00 00 01 00 -T 2C 12 00 00 +T AB 13 00 00 R 00 00 01 00 -T 2C 12 00 00 21 06 00 DD 4E FC DD 46 FD 09 56 +T AB 13 00 00 21 06 00 DD 4E FC DD 46 FD 09 56 R 00 00 01 00 -T 37 12 00 00 23 66 6A DD 75 FC DD 74 FD C3 +T B6 13 00 00 23 66 6A DD 75 FC DD 74 FD C3 R 00 00 01 00 -T 41 12 00 00 91 11 00 00 +T C0 13 00 00 10 13 00 00 R 00 00 01 00 00 04 01 00 -T 43 12 00 00 +T C2 13 00 00 R 00 00 01 00 -T 43 12 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 -T 46 12 00 00 +T C2 13 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 +T C5 13 00 00 R 00 00 01 00 -T 46 12 00 00 CD 00 00 00 00 FC FF DD 6E 02 DD -R 00 00 01 00 02 05 24 00 -T 4F 12 00 00 66 03 DD 75 FC DD 74 FD DD 36 FE +T C5 13 00 00 CD 00 00 00 00 FC FF DD 6E 02 DD +R 00 00 01 00 02 05 28 00 +T CE 13 00 00 66 03 DD 75 FC DD 74 FD DD 36 FE R 00 00 01 00 -T 5A 12 00 00 88 00 00 00 DD 36 FF 88 00 00 00 +T D9 13 00 00 AC 00 00 00 DD 36 FF AC 00 00 00 R 00 00 01 00 09 04 02 00 89 0B 02 00 -T 5F 12 00 00 +T DE 13 00 00 R 00 00 01 00 -T 5F 12 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T DE 13 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T 6A 12 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 70 +T E9 13 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 70 R 00 00 01 00 -T 75 12 00 00 04 05 28 0A +T F4 13 00 00 04 05 28 0A R 00 00 01 00 -T 79 12 00 00 +T F8 13 00 00 R 00 00 01 00 -T 79 12 00 00 DD 34 FC 20 03 DD 34 FD +T F8 13 00 00 DD 34 FC 20 03 DD 34 FD R 00 00 01 00 -T 81 12 00 00 +T 00 14 00 00 R 00 00 01 00 -T 81 12 00 00 18 DC +T 00 14 00 00 18 DC R 00 00 01 00 -T 83 12 00 00 +T 02 14 00 00 R 00 00 01 00 -T 83 12 00 00 3E 00 00 00 00 21 00 00 00 00 CD -R 00 00 01 00 2B 05 2F 00 02 0A 2F 00 -T 89 12 00 00 00 00 00 00 4D 44 11 E8 03 CD -R 00 00 01 00 02 04 1E 00 -T 91 12 00 00 00 00 00 00 2A 04 00 00 00 23 22 -R 00 00 01 00 02 04 09 00 00 09 03 00 -T 98 12 00 00 04 00 00 00 2B 19 EB 3E +T 02 14 00 00 3E 00 00 00 00 21 00 00 00 00 CD +R 00 00 01 00 2B 05 33 00 02 0A 33 00 +T 08 14 00 00 00 00 00 00 4D 44 11 E8 03 CD +R 00 00 01 00 02 04 21 00 +T 10 14 00 00 00 00 00 00 2A 04 00 00 00 23 22 +R 00 00 01 00 02 04 0A 00 00 09 03 00 +T 17 14 00 00 04 00 00 00 2B 19 EB 3E R 00 00 01 00 00 04 03 00 -T 9E 12 00 00 00 00 00 00 21 00 00 00 00 CD +T 1D 14 00 00 00 00 00 00 21 00 00 00 00 CD R 00 00 01 00 2B 04 03 00 02 09 03 00 -T A3 12 00 00 00 00 00 00 DD 75 FE DD 74 FF -R 00 00 01 00 02 04 1E 00 -T AB 12 00 00 +T 22 14 00 00 00 00 00 00 DD 75 FE DD 74 FF +R 00 00 01 00 02 04 21 00 +T 2A 14 00 00 R 00 00 01 00 -T AB 12 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD +T 2A 14 00 00 DD 6E FE DD 66 FF 23 DD 75 FE DD R 00 00 01 00 -T B6 12 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 70 +T 35 14 00 00 74 FF 2B 46 DD 6E FC DD 66 FD 70 R 00 00 01 00 -T C1 12 00 00 04 05 28 0A +T 40 14 00 00 04 05 28 0A R 00 00 01 00 -T C5 12 00 00 +T 44 14 00 00 R 00 00 01 00 -T C5 12 00 00 DD 34 FC 20 03 DD 34 FD +T 44 14 00 00 DD 34 FC 20 03 DD 34 FD R 00 00 01 00 -T CD 12 00 00 +T 4C 14 00 00 R 00 00 01 00 -T CD 12 00 00 18 DC +T 4C 14 00 00 18 DC R 00 00 01 00 -T CF 12 00 00 +T 4E 14 00 00 R 00 00 01 00 -T CF 12 00 00 C3 00 00 00 00 -R 00 00 01 00 02 05 12 00 +T 4E 14 00 00 C3 00 00 00 00 +R 00 00 01 00 02 05 13 00 T 00 00 00 00 R 00 00 02 00 T 00 00 00 00 69 6E 70 75 74 20 6C 69 6E 65 20 @@ -2059,33 +2239,57 @@ T 2A 00 00 00 20 64 65 65 70 6C 79 00 R 00 00 02 00 T 32 00 00 00 R 00 00 02 00 -T 32 00 00 00 74 6F 6F 20 6D 61 6E 79 20 66 69 +T 32 00 00 00 23 00 +R 00 00 02 00 +T 34 00 00 00 +R 00 00 02 00 +T 34 00 00 00 24 00 +R 00 00 02 00 +T 36 00 00 00 +R 00 00 02 00 +T 36 00 00 00 55 53 45 52 00 +R 00 00 02 00 +T 3B 00 00 00 +R 00 00 02 00 +T 3B 00 00 00 73 6F 6D 65 6F 6E 65 00 +R 00 00 02 00 +T 43 00 00 00 +R 00 00 02 00 +T 43 00 00 00 73 6F 6D 65 68 6F 73 74 00 +R 00 00 02 00 +T 4C 00 00 00 +R 00 00 02 00 +T 4C 00 00 00 73 6F 6D 65 77 68 65 72 65 00 +R 00 00 02 00 +T 56 00 00 00 +R 00 00 02 00 +T 56 00 00 00 74 6F 6F 20 6D 61 6E 79 20 66 69 R 00 00 02 00 -T 3D 00 00 00 6C 65 73 20 6F 70 65 6E 20 69 6E +T 61 00 00 00 6C 65 73 20 6F 70 65 6E 20 69 6E R 00 00 02 00 -T 48 00 00 00 20 73 68 65 6C 6C 00 +T 6C 00 00 00 20 73 68 65 6C 6C 00 R 00 00 02 00 -T 4F 00 00 00 +T 73 00 00 00 R 00 00 02 00 -T 4F 00 00 00 63 61 6E 27 74 20 63 72 65 61 74 +T 73 00 00 00 63 61 6E 27 74 20 63 72 65 61 74 R 00 00 02 00 -T 5A 00 00 00 65 20 70 69 70 65 20 2D 20 74 72 +T 7E 00 00 00 65 20 70 69 70 65 20 2D 20 74 72 R 00 00 02 00 -T 65 00 00 00 79 20 61 67 61 69 6E 00 +T 89 00 00 00 79 20 61 67 61 69 6E 00 R 00 00 02 00 -T 6D 00 00 00 +T 91 00 00 00 R 00 00 02 00 -T 6D 00 00 00 68 65 72 65 20 64 6F 63 75 6D 65 +T 91 00 00 00 68 65 72 65 20 64 6F 63 75 6D 65 R 00 00 02 00 -T 78 00 00 00 6E 74 20 60 00 +T 9C 00 00 00 6E 74 20 60 00 R 00 00 02 00 -T 7D 00 00 00 +T A1 00 00 00 R 00 00 02 00 -T 7D 00 00 00 27 20 75 6E 63 6C 6F 73 65 64 00 +T A1 00 00 00 27 20 75 6E 63 6C 6F 73 65 64 00 R 00 00 02 00 -T 88 00 00 00 +T AC 00 00 00 R 00 00 02 00 -T 88 00 00 00 2F 74 6D 70 2F 73 68 74 6D 00 +T AC 00 00 00 2F 74 6D 70 2F 73 68 74 6D 00 R 00 00 02 00 T 00 00 00 00 R 00 00 03 00 diff --git a/src/simple/align.c b/src/simple/align.c index 6ce97c17..ae3a45d4 100644 --- a/src/simple/align.c +++ b/src/simple/align.c @@ -14,6 +14,10 @@ #include #include +#ifndef DEBUG +#define DEBUG 0 +#endif + #if 0 void wr(char *s) { write(STDERR_FILENO, s, strlen(s)); @@ -107,7 +111,13 @@ int main(argc, argv) } else { +#if DEBUG > 0 + sysdebug(DEBUG); +#endif er = falign(fd, XIP_ALIGN); +#if DEBUG > 0 + sysdebug(0); +#endif close(fd); } if (er) diff --git a/src/simple/build-b.ban b/src/simple/build-b.ban index 9675ef8a..d7e66f02 100644 --- a/src/simple/build-b.ban +++ b/src/simple/build-b.ban @@ -1,4 +1,4 @@ -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\adduser +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\adduser @if errorlevel 1 goto failure del adduser.r01 as-z80 -l -o adduser.s01 @@ -9,7 +9,7 @@ link-z80 -f adduser ihex2bin -l adduser.i86 ..\..\..\bin\banked\adduser @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\align +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\align @if errorlevel 1 goto failure del align.r01 as-z80 -l -o align.s01 @@ -20,7 +20,7 @@ link-z80 -f align ihex2bin -l align.i86 ..\..\..\bin\banked\align @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\banner +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\banner @if errorlevel 1 goto failure del banner.r01 as-z80 -l -o banner.s01 @@ -31,7 +31,7 @@ link-z80 -f banner ihex2bin -l banner.i86 ..\..\..\bin\banked\banner @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\basename +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\basename @if errorlevel 1 goto failure del basename.r01 as-z80 -l -o basename.s01 @@ -43,7 +43,7 @@ ihex2bin -l basename.i86 ..\..\..\bin\banked\basename @if errorlevel 1 goto failure rem bogomips doesn't work under tc because too much use of z80 inline assembler -rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\bogomips +rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\bogomips rem @if errorlevel 1 goto failure rem del bogomips.r01 rem as-z80 -l -o bogomips.s01 @@ -54,7 +54,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l bogomips.i86 ..\..\..\bin\banked\bogomips rem @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cal +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cal @if errorlevel 1 goto failure del cal.r01 as-z80 -l -o cal.s01 @@ -65,7 +65,7 @@ link-z80 -f cal ihex2bin -l cal.i86 ..\..\..\bin\banked\cal @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cat +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cat @if errorlevel 1 goto failure del cat.r01 as-z80 -l -o cat.s01 @@ -76,7 +76,7 @@ link-z80 -f cat ihex2bin -l cat.i86 ..\..\..\bin\banked\cat @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cdiff +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cdiff @if errorlevel 1 goto failure del cdiff.r01 as-z80 -l -o cdiff.s01 @@ -87,7 +87,7 @@ link-z80 -f cdiff ihex2bin -l cdiff.i86 ..\..\..\bin\banked\cdiff @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cgrep +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cgrep @if errorlevel 1 goto failure del cgrep.r01 as-z80 -l -o cgrep.s01 @@ -98,7 +98,7 @@ link-z80 -f cgrep ihex2bin -l cgrep.i86 ..\..\..\bin\banked\cgrep @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chgrp +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chgrp @if errorlevel 1 goto failure del chgrp.r01 as-z80 -l -o chgrp.s01 @@ -109,7 +109,7 @@ link-z80 -f chgrp ihex2bin -l chgrp.i86 ..\..\..\bin\banked\chgrp @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chmod +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chmod @if errorlevel 1 goto failure del chmod.r01 as-z80 -l -o chmod.s01 @@ -120,7 +120,7 @@ link-z80 -f chmod ihex2bin -l chmod.i86 ..\..\..\bin\banked\chmod @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chown +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chown @if errorlevel 1 goto failure del chown.r01 as-z80 -l -o chown.s01 @@ -131,7 +131,7 @@ link-z80 -f chown ihex2bin -l chown.i86 ..\..\..\bin\banked\chown @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cksum +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cksum @if errorlevel 1 goto failure del cksum.r01 as-z80 -l -o cksum.s01 @@ -142,7 +142,7 @@ link-z80 -f cksum ihex2bin -l cksum.i86 ..\..\..\bin\banked\cksum @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cmp +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cmp @if errorlevel 1 goto failure del cmp.r01 as-z80 -l -o cmp.s01 @@ -153,7 +153,7 @@ link-z80 -f cmp ihex2bin -l cmp.i86 ..\..\..\bin\banked\cmp @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cp +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 -DNDEBUG ..\cp @if errorlevel 1 goto failure del cp.r01 as-z80 -l -o cp.s01 @@ -164,7 +164,7 @@ link-z80 -f cp ihex2bin -l cp.i86 ..\..\..\bin\banked\cp @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cr +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cr @if errorlevel 1 goto failure del cr.r01 as-z80 -l -o cr.s01 @@ -175,7 +175,7 @@ link-z80 -f cr ihex2bin -l cr.i86 ..\..\..\bin\banked\cr @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\crc +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\crc @if errorlevel 1 goto failure del crc.r01 as-z80 -l -o crc.s01 @@ -186,7 +186,7 @@ link-z80 -f crc ihex2bin -l crc.i86 ..\..\..\bin\banked\crc @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cron +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cron @if errorlevel 1 goto failure del cron.r01 as-z80 -l -o cron.s01 @@ -197,7 +197,7 @@ link-z80 -f cron ihex2bin -l cron.i86 ..\..\..\bin\banked\cron @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\date +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\date @if errorlevel 1 goto failure del date.r01 as-z80 -l -o date.s01 @@ -208,7 +208,7 @@ link-z80 -f date ihex2bin -l date.i86 ..\..\..\bin\banked\date @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dd +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dd @if errorlevel 1 goto failure del dd.r01 as-z80 -l -o dd.s01 @@ -219,7 +219,7 @@ link-z80 -f dd ihex2bin -l dd.i86 ..\..\..\bin\banked\dd @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\df +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\df @if errorlevel 1 goto failure del df.r01 as-z80 -l -o df.s01 @@ -230,7 +230,7 @@ link-z80 -f df ihex2bin -l df.i86 ..\..\..\bin\banked\df @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dhry +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dhry @if errorlevel 1 goto failure del dhry.r01 as-z80 -l -o dhry.s01 @@ -241,7 +241,7 @@ link-z80 -f dhry ihex2bin -l dhry.i86 ..\..\..\bin\banked\dhry @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\diff +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\diff @if errorlevel 1 goto failure del diff.r01 as-z80 -l -o diff.s01 @@ -252,7 +252,7 @@ link-z80 -f diff ihex2bin -l diff.i86 ..\..\..\bin\banked\diff @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dirname +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dirname @if errorlevel 1 goto failure del dirname.r01 as-z80 -l -o dirname.s01 @@ -263,7 +263,7 @@ link-z80 -f dirname ihex2bin -l dirname.i86 ..\..\..\bin\banked\dirname @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\diskusag +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\diskusag @if errorlevel 1 goto failure del diskusag.r01 as-z80 -l -o diskusag.s01 @@ -275,7 +275,7 @@ ihex2bin -l diskusag.i86 ..\..\..\bin\banked\diskusag @if errorlevel 1 goto failure rem dosread is not necessary for the hytech system (no floppy drive) -rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dosread +rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 -DNDEBUG ..\dosread rem @if errorlevel 1 goto failure rem del dosread.r01 rem as-z80 -l -o dosread.s01 @@ -286,7 +286,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l dosread.i86 ..\..\..\bin\banked\dosread rem @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dtree +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dtree @if errorlevel 1 goto failure del dtree.r01 as-z80 -l -o dtree.s01 @@ -297,7 +297,7 @@ link-z80 -f dtree ihex2bin -l dtree.i86 ..\..\..\bin\banked\dtree @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\du +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\du @if errorlevel 1 goto failure del du.r01 as-z80 -l -o du.s01 @@ -308,7 +308,7 @@ link-z80 -f du ihex2bin -l du.i86 ..\..\..\bin\banked\du @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\echo +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\echo @if errorlevel 1 goto failure del echo.r01 as-z80 -l -o echo.s01 @@ -319,7 +319,7 @@ link-z80 -f echo ihex2bin -l echo.i86 ..\..\..\bin\banked\echo @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ed +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ed @if errorlevel 1 goto failure del ed.r01 as-z80 -l -o ed.s01 @@ -330,7 +330,7 @@ link-z80 -f ed ihex2bin -l ed.i86 ..\..\..\bin\banked\ed @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\expr +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\expr @if errorlevel 1 goto failure del expr.r01 as-z80 -l -o expr.s01 @@ -341,7 +341,7 @@ link-z80 -f expr ihex2bin -l expr.i86 ..\..\..\bin\banked\expr @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\false +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\false @if errorlevel 1 goto failure del false.r01 as-z80 -l -o false.s01 @@ -352,7 +352,7 @@ link-z80 -f false ihex2bin -l false.i86 ..\..\..\bin\banked\false @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fgrep +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fgrep @if errorlevel 1 goto failure del fgrep.r01 as-z80 -l -o fgrep.s01 @@ -363,7 +363,7 @@ link-z80 -f fgrep ihex2bin -l fgrep.i86 ..\..\..\bin\banked\fgrep @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\file +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\file @if errorlevel 1 goto failure del file.r01 as-z80 -l -o file.s01 @@ -374,7 +374,7 @@ link-z80 -f file ihex2bin -l file.i86 ..\..\..\bin\banked\file @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\find +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\find @if errorlevel 1 goto failure del find.r01 as-z80 -l -o find.s01 @@ -385,7 +385,7 @@ link-z80 -f find ihex2bin -l find.i86 ..\..\..\bin\banked\find @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fld +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fld @if errorlevel 1 goto failure del fld.r01 as-z80 -l -o fld.s01 @@ -396,7 +396,7 @@ link-z80 -f fld ihex2bin -l fld.i86 ..\..\..\bin\banked\fld @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fortune +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fortune @if errorlevel 1 goto failure del fortune.r01 as-z80 -l -o fortune.s01 @@ -407,7 +407,7 @@ link-z80 -f fortune ihex2bin -l fortune.i86 ..\..\..\bin\banked\fortune @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\grep +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\grep @if errorlevel 1 goto failure del grep.r01 as-z80 -l -o grep.s01 @@ -418,7 +418,7 @@ link-z80 -f grep ihex2bin -l grep.i86 ..\..\..\bin\banked\grep @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\gres +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\gres @if errorlevel 1 goto failure del gres.r01 as-z80 -l -o gres.s01 @@ -429,7 +429,7 @@ link-z80 -f gres ihex2bin -l gres.i86 ..\..\..\bin\banked\gres @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\head +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\head @if errorlevel 1 goto failure del head.r01 as-z80 -l -o head.s01 @@ -440,7 +440,7 @@ link-z80 -f head ihex2bin -l head.i86 ..\..\..\bin\banked\head @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\id +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\id @if errorlevel 1 goto failure del id.r01 as-z80 -l -o id.s01 @@ -451,7 +451,7 @@ link-z80 -f id ihex2bin -l id.i86 ..\..\..\bin\banked\id @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\inodes +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\inodes @if errorlevel 1 goto failure del inodes.r01 as-z80 -l -o inodes.s01 @@ -462,7 +462,7 @@ link-z80 -f inodes ihex2bin -l inodes.i86 ..\..\..\bin\banked\inodes @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\kill +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\kill @if errorlevel 1 goto failure del kill.r01 as-z80 -l -o kill.s01 @@ -473,7 +473,7 @@ link-z80 -f kill ihex2bin -l kill.i86 ..\..\..\bin\banked\kill @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\lpd +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\lpd @if errorlevel 1 goto failure del lpd.r01 as-z80 -l -o lpd.s01 @@ -484,7 +484,7 @@ link-z80 -f lpd ihex2bin -l lpd.i86 ..\..\..\bin\banked\lpd @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\lpr +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\lpr @if errorlevel 1 goto failure del lpr.r01 as-z80 -l -o lpr.s01 @@ -495,7 +495,7 @@ link-z80 -f lpr ihex2bin -l lpr.i86 ..\..\..\bin\banked\lpr @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ls +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ls @if errorlevel 1 goto failure del ls.r01 as-z80 -l -o ls.s01 @@ -506,7 +506,7 @@ link-z80 -f ls ihex2bin -l ls.i86 ..\..\..\bin\banked\ls @if errorlevel 1 goto failure -rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\man +rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\man rem @if errorlevel 1 goto failure rem del man.r01 rem as-z80 -l -o man.s01 @@ -517,7 +517,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l man.i86 ..\..\..\bin\banked\man rem @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mkdir +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mkdir @if errorlevel 1 goto failure del mkdir.r01 as-z80 -l -o mkdir.s01 @@ -528,7 +528,7 @@ link-z80 -f mkdir ihex2bin -l mkdir.i86 ..\..\..\bin\banked\mkdir @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mknod +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mknod @if errorlevel 1 goto failure del mknod.r01 as-z80 -l -o mknod.s01 @@ -539,7 +539,7 @@ link-z80 -f mknod ihex2bin -l mknod.i86 ..\..\..\bin\banked\mknod @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\more +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\more @if errorlevel 1 goto failure del more.r01 as-z80 -l -o more.s01 @@ -550,7 +550,7 @@ link-z80 -f more ihex2bin -l more.i86 ..\..\..\bin\banked\more @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mount +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mount @if errorlevel 1 goto failure del mount.r01 as-z80 -l -o mount.s01 @@ -561,7 +561,7 @@ link-z80 -f mount ihex2bin -l mount.i86 ..\..\..\bin\banked\mount @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ncheck +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ncheck @if errorlevel 1 goto failure del ncheck.r01 as-z80 -l -o ncheck.s01 @@ -572,7 +572,7 @@ link-z80 -f ncheck ihex2bin -l ncheck.i86 ..\..\..\bin\banked\ncheck @if errorlevel 1 goto failure -rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ncr +rem iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ncr rem @if errorlevel 1 goto failure rem del ncr.r01 rem as-z80 -l -o ncr.s01 @@ -583,7 +583,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l ncr.i86 ..\..\..\bin\banked\ncr rem @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\od +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\od @if errorlevel 1 goto failure del od.r01 as-z80 -l -o od.s01 @@ -594,7 +594,7 @@ link-z80 -f od ihex2bin -l od.i86 ..\..\..\bin\banked\od @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\passwd +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\passwd @if errorlevel 1 goto failure del passwd.r01 as-z80 -l -o passwd.s01 @@ -605,7 +605,7 @@ link-z80 -f passwd ihex2bin -l passwd.i86 ..\..\..\bin\banked\passwd @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pathchk +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pathchk @if errorlevel 1 goto failure del pathchk.r01 as-z80 -l -o pathchk.s01 @@ -616,7 +616,7 @@ link-z80 -f pathchk ihex2bin -l pathchk.i86 ..\..\..\bin\banked\pathchk @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pr +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pr @if errorlevel 1 goto failure del pr.r01 as-z80 -l -o pr.s01 @@ -627,7 +627,7 @@ link-z80 -f pr ihex2bin -l pr.i86 ..\..\..\bin\banked\pr @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\printenv +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\printenv @if errorlevel 1 goto failure del printenv.r01 as-z80 -l -o printenv.s01 @@ -638,7 +638,7 @@ link-z80 -f printenv ihex2bin -l printenv.i86 ..\..\..\bin\banked\printenv @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ps +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ps @if errorlevel 1 goto failure del ps.r01 as-z80 -l -o ps.s01 @@ -649,7 +649,7 @@ link-z80 -f ps ihex2bin -l ps.i86 ..\..\..\bin\banked\ps @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pwd +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pwd @if errorlevel 1 goto failure del pwd.r01 as-z80 -l -o pwd.s01 @@ -660,7 +660,7 @@ link-z80 -f pwd ihex2bin -l pwd.i86 ..\..\..\bin\banked\pwd @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\readall +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\readall @if errorlevel 1 goto failure del readall.r01 as-z80 -l -o readall.s01 @@ -671,7 +671,7 @@ link-z80 -f readall ihex2bin -l readall.i86 ..\..\..\bin\banked\readall @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\reboot +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\reboot @if errorlevel 1 goto failure del reboot.r01 as-z80 -l -o reboot.s01 @@ -682,7 +682,7 @@ link-z80 -f reboot ihex2bin -l reboot.i86 ..\..\..\bin\banked\reboot @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\renice +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\renice @if errorlevel 1 goto failure del renice.r01 as-z80 -l -o renice.s01 @@ -693,7 +693,7 @@ link-z80 -f renice ihex2bin -l renice.i86 ..\..\..\bin\banked\renice @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\rm +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\rm @if errorlevel 1 goto failure del rm.r01 as-z80 -l -o rm.s01 @@ -704,7 +704,7 @@ link-z80 -f rm ihex2bin -l rm.i86 ..\..\..\bin\banked\rm @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\rmdir +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\rmdir @if errorlevel 1 goto failure del rmdir.r01 as-z80 -l -o rmdir.s01 @@ -715,7 +715,7 @@ link-z80 -f rmdir ihex2bin -l rmdir.i86 ..\..\..\bin\banked\rmdir @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\roff +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\roff @if errorlevel 1 goto failure del roff.r01 as-z80 -l -o roff.s01 @@ -726,7 +726,7 @@ link-z80 -f roff ihex2bin -l roff.i86 ..\..\..\bin\banked\roff @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\setclock +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\setclock @if errorlevel 1 goto failure del setclock.r01 as-z80 -l -o setclock.s01 @@ -737,7 +737,7 @@ link-z80 -f setclock ihex2bin -l setclock.i86 ..\..\..\bin\banked\setclock @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sort +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sort @if errorlevel 1 goto failure del sort.r01 as-z80 -l -o sort.s01 @@ -748,7 +748,7 @@ link-z80 -f sort ihex2bin -l sort.i86 ..\..\..\bin\banked\sort @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\split +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\split @if errorlevel 1 goto failure del split.r01 as-z80 -l -o split.s01 @@ -759,7 +759,7 @@ link-z80 -f split ihex2bin -l split.i86 ..\..\..\bin\banked\split @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\su +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\su @if errorlevel 1 goto failure del su.r01 as-z80 -l -o su.s01 @@ -770,7 +770,7 @@ link-z80 -f su ihex2bin -l su.i86 ..\..\..\bin\banked\su @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sum +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sum @if errorlevel 1 goto failure del sum.r01 as-z80 -l -o sum.s01 @@ -781,7 +781,7 @@ link-z80 -f sum ihex2bin -l sum.i86 ..\..\..\bin\banked\sum @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sync +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sync @if errorlevel 1 goto failure del sync.r01 as-z80 -l -o sync.s01 @@ -792,7 +792,7 @@ link-z80 -f sync ihex2bin -l sync.i86 ..\..\..\bin\banked\sync @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tail +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tail @if errorlevel 1 goto failure del tail.r01 as-z80 -l -o tail.s01 @@ -803,7 +803,7 @@ link-z80 -f tail ihex2bin -l tail.i86 ..\..\..\bin\banked\tail @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tar +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tar @if errorlevel 1 goto failure del tar.r01 as-z80 -l -o tar.s01 @@ -814,7 +814,7 @@ link-z80 -f tar ihex2bin -l tar.i86 ..\..\..\bin\banked\tar @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tee +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tee @if errorlevel 1 goto failure del tee.r01 as-z80 -l -o tee.s01 @@ -825,7 +825,7 @@ link-z80 -f tee ihex2bin -l tee.i86 ..\..\..\bin\banked\tee @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ter +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ter @if errorlevel 1 goto failure del ter.r01 as-z80 -l -o ter.s01 @@ -836,7 +836,7 @@ link-z80 -f ter ihex2bin -l ter.i86 ..\..\..\bin\banked\ter @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\termcap +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\termcap @if errorlevel 1 goto failure del termcap.r01 as-z80 -l -o termcap.s01 @@ -847,7 +847,7 @@ link-z80 -f termcap ihex2bin -l termcap.i86 ..\..\..\bin\banked\termcap @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\test +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\test @if errorlevel 1 goto failure del test.r01 as-z80 -l -o test.s01 @@ -858,7 +858,7 @@ link-z80 -f test ihex2bin -l test.i86 ..\..\..\bin\banked\test @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tget +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tget @if errorlevel 1 goto failure del tget.r01 as-z80 -l -o tget.s01 @@ -869,7 +869,7 @@ link-z80 -f tget ihex2bin -l tget.i86 ..\..\..\bin\banked\tget @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\time +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\time @if errorlevel 1 goto failure del time.r01 as-z80 -l -o time.s01 @@ -880,7 +880,7 @@ link-z80 -f time ihex2bin -l time.i86 ..\..\..\bin\banked\time @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\top +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\top @if errorlevel 1 goto failure del top.r01 as-z80 -l -o top.s01 @@ -891,7 +891,7 @@ link-z80 -f top ihex2bin -l top.i86 ..\..\..\bin\banked\top @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\touch +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\touch @if errorlevel 1 goto failure del touch.r01 as-z80 -l -o touch.s01 @@ -902,7 +902,7 @@ link-z80 -f touch ihex2bin -l touch.i86 ..\..\..\bin\banked\touch @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tr +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tr @if errorlevel 1 goto failure del tr.r01 as-z80 -l -o tr.s01 @@ -913,7 +913,7 @@ link-z80 -f tr ihex2bin -l tr.i86 ..\..\..\bin\banked\tr @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\true +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\true @if errorlevel 1 goto failure del true.r01 as-z80 -l -o true.s01 @@ -924,7 +924,7 @@ link-z80 -f true ihex2bin -l true.i86 ..\..\..\bin\banked\true @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ualign +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ualign @if errorlevel 1 goto failure del ualign.r01 as-z80 -l -o ualign.s01 @@ -935,7 +935,7 @@ link-z80 -f ualign ihex2bin -l ualign.i86 ..\..\..\bin\banked\ualign @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\umount +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\umount @if errorlevel 1 goto failure del umount.r01 as-z80 -l -o umount.s01 @@ -946,7 +946,7 @@ link-z80 -f umount ihex2bin -l umount.i86 ..\..\..\bin\banked\umount @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uname +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uname @if errorlevel 1 goto failure del uname.r01 as-z80 -l -o uname.s01 @@ -957,7 +957,7 @@ link-z80 -f uname ihex2bin -l uname.i86 ..\..\..\bin\banked\uname @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uniq +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uniq @if errorlevel 1 goto failure del uniq.r01 as-z80 -l -o uniq.s01 @@ -968,7 +968,7 @@ link-z80 -f uniq ihex2bin -l uniq.i86 ..\..\..\bin\banked\uniq @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uudecode +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uudecode @if errorlevel 1 goto failure del uudecode.r01 as-z80 -l -o uudecode.s01 @@ -979,7 +979,7 @@ link-z80 -f uudecode ihex2bin -l uudecode.i86 ..\..\..\bin\banked\uudecode @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uuencode +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uuencode @if errorlevel 1 goto failure del uuencode.r01 as-z80 -l -o uuencode.s01 @@ -990,7 +990,7 @@ link-z80 -f uuencode ihex2bin -l uuencode.i86 ..\..\..\bin\banked\uuencode @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\wc +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\wc @if errorlevel 1 goto failure del wc.r01 as-z80 -l -o wc.s01 @@ -1001,7 +1001,7 @@ link-z80 -f wc ihex2bin -l wc.i86 ..\..\..\bin\banked\wc @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\which +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\which @if errorlevel 1 goto failure del which.r01 as-z80 -l -o which.s01 @@ -1012,7 +1012,7 @@ link-z80 -f which ihex2bin -l which.i86 ..\..\..\bin\banked\which @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\whoami +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\whoami @if errorlevel 1 goto failure del whoami.r01 as-z80 -l -o whoami.s01 @@ -1023,7 +1023,7 @@ link-z80 -f whoami ihex2bin -l whoami.i86 ..\..\..\bin\banked\whoami @if errorlevel 1 goto failure -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\yes +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\yes @if errorlevel 1 goto failure del yes.r01 as-z80 -l -o yes.s01 diff --git a/src/simple/build-l.ban b/src/simple/build-l.ban index 2eef51d1..a1f3e4c4 100644 --- a/src/simple/build-l.ban +++ b/src/simple/build-l.ban @@ -1,4 +1,4 @@ -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\adduser +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\adduser @if errorlevel 1 goto failure del adduser.r01 as-z80 -l -o adduser.s01 @@ -9,7 +9,7 @@ link-z80 -f adduser ihex2bin -l adduser.i86 ..\..\..\bin\large\adduser @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\align +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\align @if errorlevel 1 goto failure del align.r01 as-z80 -l -o align.s01 @@ -20,7 +20,7 @@ link-z80 -f align ihex2bin -l align.i86 ..\..\..\bin\large\align @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\banner +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\banner @if errorlevel 1 goto failure del banner.r01 as-z80 -l -o banner.s01 @@ -31,7 +31,7 @@ link-z80 -f banner ihex2bin -l banner.i86 ..\..\..\bin\large\banner @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\basename +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\basename @if errorlevel 1 goto failure del basename.r01 as-z80 -l -o basename.s01 @@ -43,7 +43,7 @@ ihex2bin -l basename.i86 ..\..\..\bin\large\basename @if errorlevel 1 goto failure rem bogomips doesn't work under tc because too much use of z80 inline assembler -rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\bogomips +rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\bogomips rem @if errorlevel 1 goto failure rem del bogomips.r01 rem as-z80 -l -o bogomips.s01 @@ -54,7 +54,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l bogomips.i86 ..\..\..\bin\large\bogomips rem @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cal +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cal @if errorlevel 1 goto failure del cal.r01 as-z80 -l -o cal.s01 @@ -65,7 +65,7 @@ link-z80 -f cal ihex2bin -l cal.i86 ..\..\..\bin\large\cal @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cat +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cat @if errorlevel 1 goto failure del cat.r01 as-z80 -l -o cat.s01 @@ -76,7 +76,7 @@ link-z80 -f cat ihex2bin -l cat.i86 ..\..\..\bin\large\cat @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cdiff +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cdiff @if errorlevel 1 goto failure del cdiff.r01 as-z80 -l -o cdiff.s01 @@ -87,7 +87,7 @@ link-z80 -f cdiff ihex2bin -l cdiff.i86 ..\..\..\bin\large\cdiff @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cgrep +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cgrep @if errorlevel 1 goto failure del cgrep.r01 as-z80 -l -o cgrep.s01 @@ -98,7 +98,7 @@ link-z80 -f cgrep ihex2bin -l cgrep.i86 ..\..\..\bin\large\cgrep @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chgrp +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chgrp @if errorlevel 1 goto failure del chgrp.r01 as-z80 -l -o chgrp.s01 @@ -109,7 +109,7 @@ link-z80 -f chgrp ihex2bin -l chgrp.i86 ..\..\..\bin\large\chgrp @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chmod +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chmod @if errorlevel 1 goto failure del chmod.r01 as-z80 -l -o chmod.s01 @@ -120,7 +120,7 @@ link-z80 -f chmod ihex2bin -l chmod.i86 ..\..\..\bin\large\chmod @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\chown +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\chown @if errorlevel 1 goto failure del chown.r01 as-z80 -l -o chown.s01 @@ -131,7 +131,7 @@ link-z80 -f chown ihex2bin -l chown.i86 ..\..\..\bin\large\chown @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cksum +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cksum @if errorlevel 1 goto failure del cksum.r01 as-z80 -l -o cksum.s01 @@ -142,7 +142,7 @@ link-z80 -f cksum ihex2bin -l cksum.i86 ..\..\..\bin\large\cksum @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cmp +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cmp @if errorlevel 1 goto failure del cmp.r01 as-z80 -l -o cmp.s01 @@ -153,7 +153,7 @@ link-z80 -f cmp ihex2bin -l cmp.i86 ..\..\..\bin\large\cmp @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cp +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 -DNDEBUG ..\cp @if errorlevel 1 goto failure del cp.r01 as-z80 -l -o cp.s01 @@ -164,7 +164,7 @@ link-z80 -f cp ihex2bin -l cp.i86 ..\..\..\bin\large\cp @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cr +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cr @if errorlevel 1 goto failure del cr.r01 as-z80 -l -o cr.s01 @@ -175,7 +175,7 @@ link-z80 -f cr ihex2bin -l cr.i86 ..\..\..\bin\large\cr @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\crc +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\crc @if errorlevel 1 goto failure del crc.r01 as-z80 -l -o crc.s01 @@ -186,7 +186,7 @@ link-z80 -f crc ihex2bin -l crc.i86 ..\..\..\bin\large\crc @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\cron +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\cron @if errorlevel 1 goto failure del cron.r01 as-z80 -l -o cron.s01 @@ -197,7 +197,7 @@ link-z80 -f cron ihex2bin -l cron.i86 ..\..\..\bin\large\cron @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\date +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\date @if errorlevel 1 goto failure del date.r01 as-z80 -l -o date.s01 @@ -208,7 +208,7 @@ link-z80 -f date ihex2bin -l date.i86 ..\..\..\bin\large\date @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dd +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dd @if errorlevel 1 goto failure del dd.r01 as-z80 -l -o dd.s01 @@ -219,7 +219,7 @@ link-z80 -f dd ihex2bin -l dd.i86 ..\..\..\bin\large\dd @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\df +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\df @if errorlevel 1 goto failure del df.r01 as-z80 -l -o df.s01 @@ -230,7 +230,7 @@ link-z80 -f df ihex2bin -l df.i86 ..\..\..\bin\large\df @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dhry +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dhry @if errorlevel 1 goto failure del dhry.r01 as-z80 -l -o dhry.s01 @@ -241,7 +241,7 @@ link-z80 -f dhry ihex2bin -l dhry.i86 ..\..\..\bin\large\dhry @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\diff +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\diff @if errorlevel 1 goto failure del diff.r01 as-z80 -l -o diff.s01 @@ -252,7 +252,7 @@ link-z80 -f diff ihex2bin -l diff.i86 ..\..\..\bin\large\diff @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dirname +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dirname @if errorlevel 1 goto failure del dirname.r01 as-z80 -l -o dirname.s01 @@ -263,7 +263,7 @@ link-z80 -f dirname ihex2bin -l dirname.i86 ..\..\..\bin\large\dirname @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\diskusag +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\diskusag @if errorlevel 1 goto failure del diskusag.r01 as-z80 -l -o diskusag.s01 @@ -275,7 +275,7 @@ ihex2bin -l diskusag.i86 ..\..\..\bin\large\diskusag @if errorlevel 1 goto failure rem dosread is not necessary for the hytech system (no floppy drive) -rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dosread +rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 -DNDEBUG ..\dosread rem @if errorlevel 1 goto failure rem del dosread.r01 rem as-z80 -l -o dosread.s01 @@ -286,7 +286,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l dosread.i86 ..\..\..\bin\large\dosread rem @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\dtree +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\dtree @if errorlevel 1 goto failure del dtree.r01 as-z80 -l -o dtree.s01 @@ -297,7 +297,7 @@ link-z80 -f dtree ihex2bin -l dtree.i86 ..\..\..\bin\large\dtree @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\du +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\du @if errorlevel 1 goto failure del du.r01 as-z80 -l -o du.s01 @@ -308,7 +308,7 @@ link-z80 -f du ihex2bin -l du.i86 ..\..\..\bin\large\du @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\echo +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\echo @if errorlevel 1 goto failure del echo.r01 as-z80 -l -o echo.s01 @@ -319,7 +319,7 @@ link-z80 -f echo ihex2bin -l echo.i86 ..\..\..\bin\large\echo @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ed +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ed @if errorlevel 1 goto failure del ed.r01 as-z80 -l -o ed.s01 @@ -330,7 +330,7 @@ link-z80 -f ed ihex2bin -l ed.i86 ..\..\..\bin\large\ed @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\expr +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\expr @if errorlevel 1 goto failure del expr.r01 as-z80 -l -o expr.s01 @@ -341,7 +341,7 @@ link-z80 -f expr ihex2bin -l expr.i86 ..\..\..\bin\large\expr @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\false +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\false @if errorlevel 1 goto failure del false.r01 as-z80 -l -o false.s01 @@ -352,7 +352,7 @@ link-z80 -f false ihex2bin -l false.i86 ..\..\..\bin\large\false @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fgrep +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fgrep @if errorlevel 1 goto failure del fgrep.r01 as-z80 -l -o fgrep.s01 @@ -363,7 +363,7 @@ link-z80 -f fgrep ihex2bin -l fgrep.i86 ..\..\..\bin\large\fgrep @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\file +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\file @if errorlevel 1 goto failure del file.r01 as-z80 -l -o file.s01 @@ -374,7 +374,7 @@ link-z80 -f file ihex2bin -l file.i86 ..\..\..\bin\large\file @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\find +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\find @if errorlevel 1 goto failure del find.r01 as-z80 -l -o find.s01 @@ -385,7 +385,7 @@ link-z80 -f find ihex2bin -l find.i86 ..\..\..\bin\large\find @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fld +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fld @if errorlevel 1 goto failure del fld.r01 as-z80 -l -o fld.s01 @@ -396,7 +396,7 @@ link-z80 -f fld ihex2bin -l fld.i86 ..\..\..\bin\large\fld @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\fortune +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\fortune @if errorlevel 1 goto failure del fortune.r01 as-z80 -l -o fortune.s01 @@ -407,7 +407,7 @@ link-z80 -f fortune ihex2bin -l fortune.i86 ..\..\..\bin\large\fortune @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\grep +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\grep @if errorlevel 1 goto failure del grep.r01 as-z80 -l -o grep.s01 @@ -418,7 +418,7 @@ link-z80 -f grep ihex2bin -l grep.i86 ..\..\..\bin\large\grep @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\gres +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\gres @if errorlevel 1 goto failure del gres.r01 as-z80 -l -o gres.s01 @@ -429,7 +429,7 @@ link-z80 -f gres ihex2bin -l gres.i86 ..\..\..\bin\large\gres @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\head +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\head @if errorlevel 1 goto failure del head.r01 as-z80 -l -o head.s01 @@ -440,7 +440,7 @@ link-z80 -f head ihex2bin -l head.i86 ..\..\..\bin\large\head @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\id +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\id @if errorlevel 1 goto failure del id.r01 as-z80 -l -o id.s01 @@ -451,7 +451,7 @@ link-z80 -f id ihex2bin -l id.i86 ..\..\..\bin\large\id @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\inodes +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\inodes @if errorlevel 1 goto failure del inodes.r01 as-z80 -l -o inodes.s01 @@ -462,7 +462,7 @@ link-z80 -f inodes ihex2bin -l inodes.i86 ..\..\..\bin\large\inodes @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\kill +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\kill @if errorlevel 1 goto failure del kill.r01 as-z80 -l -o kill.s01 @@ -473,7 +473,7 @@ link-z80 -f kill ihex2bin -l kill.i86 ..\..\..\bin\large\kill @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\lpd +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\lpd @if errorlevel 1 goto failure del lpd.r01 as-z80 -l -o lpd.s01 @@ -484,7 +484,7 @@ link-z80 -f lpd ihex2bin -l lpd.i86 ..\..\..\bin\large\lpd @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\lpr +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\lpr @if errorlevel 1 goto failure del lpr.r01 as-z80 -l -o lpr.s01 @@ -495,7 +495,7 @@ link-z80 -f lpr ihex2bin -l lpr.i86 ..\..\..\bin\large\lpr @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ls +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ls @if errorlevel 1 goto failure del ls.r01 as-z80 -l -o ls.s01 @@ -506,7 +506,7 @@ link-z80 -f ls ihex2bin -l ls.i86 ..\..\..\bin\large\ls @if errorlevel 1 goto failure -rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\man +rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\man rem @if errorlevel 1 goto failure rem del man.r01 rem as-z80 -l -o man.s01 @@ -517,7 +517,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l man.i86 ..\..\..\bin\large\man rem @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mkdir +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mkdir @if errorlevel 1 goto failure del mkdir.r01 as-z80 -l -o mkdir.s01 @@ -528,7 +528,7 @@ link-z80 -f mkdir ihex2bin -l mkdir.i86 ..\..\..\bin\large\mkdir @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mknod +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mknod @if errorlevel 1 goto failure del mknod.r01 as-z80 -l -o mknod.s01 @@ -539,7 +539,7 @@ link-z80 -f mknod ihex2bin -l mknod.i86 ..\..\..\bin\large\mknod @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\more +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\more @if errorlevel 1 goto failure del more.r01 as-z80 -l -o more.s01 @@ -550,7 +550,7 @@ link-z80 -f more ihex2bin -l more.i86 ..\..\..\bin\large\more @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\mount +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\mount @if errorlevel 1 goto failure del mount.r01 as-z80 -l -o mount.s01 @@ -561,7 +561,7 @@ link-z80 -f mount ihex2bin -l mount.i86 ..\..\..\bin\large\mount @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ncheck +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ncheck @if errorlevel 1 goto failure del ncheck.r01 as-z80 -l -o ncheck.s01 @@ -572,7 +572,7 @@ link-z80 -f ncheck ihex2bin -l ncheck.i86 ..\..\..\bin\large\ncheck @if errorlevel 1 goto failure -rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ncr +rem iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ncr rem @if errorlevel 1 goto failure rem del ncr.r01 rem as-z80 -l -o ncr.s01 @@ -583,7 +583,7 @@ rem @if errorlevel 1 goto failure rem ihex2bin -l ncr.i86 ..\..\..\bin\large\ncr rem @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\od +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\od @if errorlevel 1 goto failure del od.r01 as-z80 -l -o od.s01 @@ -594,7 +594,7 @@ link-z80 -f od ihex2bin -l od.i86 ..\..\..\bin\large\od @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\passwd +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\passwd @if errorlevel 1 goto failure del passwd.r01 as-z80 -l -o passwd.s01 @@ -605,7 +605,7 @@ link-z80 -f passwd ihex2bin -l passwd.i86 ..\..\..\bin\large\passwd @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pathchk +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pathchk @if errorlevel 1 goto failure del pathchk.r01 as-z80 -l -o pathchk.s01 @@ -616,7 +616,7 @@ link-z80 -f pathchk ihex2bin -l pathchk.i86 ..\..\..\bin\large\pathchk @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pr +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pr @if errorlevel 1 goto failure del pr.r01 as-z80 -l -o pr.s01 @@ -627,7 +627,7 @@ link-z80 -f pr ihex2bin -l pr.i86 ..\..\..\bin\large\pr @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\printenv +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\printenv @if errorlevel 1 goto failure del printenv.r01 as-z80 -l -o printenv.s01 @@ -638,7 +638,7 @@ link-z80 -f printenv ihex2bin -l printenv.i86 ..\..\..\bin\large\printenv @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ps +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ps @if errorlevel 1 goto failure del ps.r01 as-z80 -l -o ps.s01 @@ -649,7 +649,7 @@ link-z80 -f ps ihex2bin -l ps.i86 ..\..\..\bin\large\ps @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\pwd +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\pwd @if errorlevel 1 goto failure del pwd.r01 as-z80 -l -o pwd.s01 @@ -660,7 +660,7 @@ link-z80 -f pwd ihex2bin -l pwd.i86 ..\..\..\bin\large\pwd @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\readall +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\readall @if errorlevel 1 goto failure del readall.r01 as-z80 -l -o readall.s01 @@ -671,7 +671,7 @@ link-z80 -f readall ihex2bin -l readall.i86 ..\..\..\bin\large\readall @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\reboot +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\reboot @if errorlevel 1 goto failure del reboot.r01 as-z80 -l -o reboot.s01 @@ -682,7 +682,7 @@ link-z80 -f reboot ihex2bin -l reboot.i86 ..\..\..\bin\large\reboot @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\renice +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\renice @if errorlevel 1 goto failure del renice.r01 as-z80 -l -o renice.s01 @@ -693,7 +693,7 @@ link-z80 -f renice ihex2bin -l renice.i86 ..\..\..\bin\large\renice @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\rm +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\rm @if errorlevel 1 goto failure del rm.r01 as-z80 -l -o rm.s01 @@ -704,7 +704,7 @@ link-z80 -f rm ihex2bin -l rm.i86 ..\..\..\bin\large\rm @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\rmdir +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\rmdir @if errorlevel 1 goto failure del rmdir.r01 as-z80 -l -o rmdir.s01 @@ -715,7 +715,7 @@ link-z80 -f rmdir ihex2bin -l rmdir.i86 ..\..\..\bin\large\rmdir @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\roff +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\roff @if errorlevel 1 goto failure del roff.r01 as-z80 -l -o roff.s01 @@ -726,7 +726,7 @@ link-z80 -f roff ihex2bin -l roff.i86 ..\..\..\bin\large\roff @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\setclock +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\setclock @if errorlevel 1 goto failure del setclock.r01 as-z80 -l -o setclock.s01 @@ -737,7 +737,7 @@ link-z80 -f setclock ihex2bin -l setclock.i86 ..\..\..\bin\large\setclock @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sort +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sort @if errorlevel 1 goto failure del sort.r01 as-z80 -l -o sort.s01 @@ -748,7 +748,7 @@ link-z80 -f sort ihex2bin -l sort.i86 ..\..\..\bin\large\sort @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\split +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\split @if errorlevel 1 goto failure del split.r01 as-z80 -l -o split.s01 @@ -759,7 +759,7 @@ link-z80 -f split ihex2bin -l split.i86 ..\..\..\bin\large\split @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\su +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\su @if errorlevel 1 goto failure del su.r01 as-z80 -l -o su.s01 @@ -770,7 +770,7 @@ link-z80 -f su ihex2bin -l su.i86 ..\..\..\bin\large\su @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sum +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sum @if errorlevel 1 goto failure del sum.r01 as-z80 -l -o sum.s01 @@ -781,7 +781,7 @@ link-z80 -f sum ihex2bin -l sum.i86 ..\..\..\bin\large\sum @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\sync +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\sync @if errorlevel 1 goto failure del sync.r01 as-z80 -l -o sync.s01 @@ -792,7 +792,7 @@ link-z80 -f sync ihex2bin -l sync.i86 ..\..\..\bin\large\sync @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tail +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tail @if errorlevel 1 goto failure del tail.r01 as-z80 -l -o tail.s01 @@ -803,7 +803,7 @@ link-z80 -f tail ihex2bin -l tail.i86 ..\..\..\bin\large\tail @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tar +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tar @if errorlevel 1 goto failure del tar.r01 as-z80 -l -o tar.s01 @@ -814,7 +814,7 @@ link-z80 -f tar ihex2bin -l tar.i86 ..\..\..\bin\large\tar @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tee +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tee @if errorlevel 1 goto failure del tee.r01 as-z80 -l -o tee.s01 @@ -825,7 +825,7 @@ link-z80 -f tee ihex2bin -l tee.i86 ..\..\..\bin\large\tee @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ter +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ter @if errorlevel 1 goto failure del ter.r01 as-z80 -l -o ter.s01 @@ -836,7 +836,7 @@ link-z80 -f ter ihex2bin -l ter.i86 ..\..\..\bin\large\ter @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\termcap +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\termcap @if errorlevel 1 goto failure del termcap.r01 as-z80 -l -o termcap.s01 @@ -847,7 +847,7 @@ link-z80 -f termcap ihex2bin -l termcap.i86 ..\..\..\bin\large\termcap @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\test +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\test @if errorlevel 1 goto failure del test.r01 as-z80 -l -o test.s01 @@ -858,7 +858,7 @@ link-z80 -f test ihex2bin -l test.i86 ..\..\..\bin\large\test @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tget +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tget @if errorlevel 1 goto failure del tget.r01 as-z80 -l -o tget.s01 @@ -869,7 +869,7 @@ link-z80 -f tget ihex2bin -l tget.i86 ..\..\..\bin\large\tget @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\time +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\time @if errorlevel 1 goto failure del time.r01 as-z80 -l -o time.s01 @@ -880,7 +880,7 @@ link-z80 -f time ihex2bin -l time.i86 ..\..\..\bin\large\time @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\top +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\top @if errorlevel 1 goto failure del top.r01 as-z80 -l -o top.s01 @@ -891,7 +891,7 @@ link-z80 -f top ihex2bin -l top.i86 ..\..\..\bin\large\top @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\touch +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\touch @if errorlevel 1 goto failure del touch.r01 as-z80 -l -o touch.s01 @@ -902,7 +902,7 @@ link-z80 -f touch ihex2bin -l touch.i86 ..\..\..\bin\large\touch @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\tr +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\tr @if errorlevel 1 goto failure del tr.r01 as-z80 -l -o tr.s01 @@ -913,7 +913,7 @@ link-z80 -f tr ihex2bin -l tr.i86 ..\..\..\bin\large\tr @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\true +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\true @if errorlevel 1 goto failure del true.r01 as-z80 -l -o true.s01 @@ -924,7 +924,7 @@ link-z80 -f true ihex2bin -l true.i86 ..\..\..\bin\large\true @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\ualign +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\ualign @if errorlevel 1 goto failure del ualign.r01 as-z80 -l -o ualign.s01 @@ -935,7 +935,7 @@ link-z80 -f ualign ihex2bin -l ualign.i86 ..\..\..\bin\large\ualign @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\umount +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\umount @if errorlevel 1 goto failure del umount.r01 as-z80 -l -o umount.s01 @@ -946,7 +946,7 @@ link-z80 -f umount ihex2bin -l umount.i86 ..\..\..\bin\large\umount @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uname +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uname @if errorlevel 1 goto failure del uname.r01 as-z80 -l -o uname.s01 @@ -957,7 +957,7 @@ link-z80 -f uname ihex2bin -l uname.i86 ..\..\..\bin\large\uname @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uniq +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uniq @if errorlevel 1 goto failure del uniq.r01 as-z80 -l -o uniq.s01 @@ -968,7 +968,7 @@ link-z80 -f uniq ihex2bin -l uniq.i86 ..\..\..\bin\large\uniq @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uudecode +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uudecode @if errorlevel 1 goto failure del uudecode.r01 as-z80 -l -o uudecode.s01 @@ -979,7 +979,7 @@ link-z80 -f uudecode ihex2bin -l uudecode.i86 ..\..\..\bin\large\uudecode @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\uuencode +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\uuencode @if errorlevel 1 goto failure del uuencode.r01 as-z80 -l -o uuencode.s01 @@ -990,7 +990,7 @@ link-z80 -f uuencode ihex2bin -l uuencode.i86 ..\..\..\bin\large\uuencode @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\wc +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\wc @if errorlevel 1 goto failure del wc.r01 as-z80 -l -o wc.s01 @@ -1001,7 +1001,7 @@ link-z80 -f wc ihex2bin -l wc.i86 ..\..\..\bin\large\wc @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\which +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\which @if errorlevel 1 goto failure del which.r01 as-z80 -l -o which.s01 @@ -1012,7 +1012,7 @@ link-z80 -f which ihex2bin -l which.i86 ..\..\..\bin\large\which @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\whoami +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\whoami @if errorlevel 1 goto failure del whoami.r01 as-z80 -l -o whoami.s01 @@ -1023,7 +1023,7 @@ link-z80 -f whoami ihex2bin -l whoami.i86 ..\..\..\bin\large\whoami @if errorlevel 1 goto failure -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\yes +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\yes @if errorlevel 1 goto failure del yes.r01 as-z80 -l -o yes.s01 diff --git a/src/simple/cat.c b/src/simple/cat.c index 2cf3b0d7..415b79a8 100644 --- a/src/simple/cat.c +++ b/src/simple/cat.c @@ -21,7 +21,7 @@ int main(argc, argv) if (argc < 2) { if (isatty(STDIN_FILENO)) { - write(STDERR_FILENO, "usage: cat filename ...\n", 20); + write(STDERR_FILENO, "usage: cat filename ...\n", 24); return 0; } else { argc++; diff --git a/src/simple/dosread.c b/src/simple/dosread.c index a89a630b..c701df81 100644 --- a/src/simple/dosread.c +++ b/src/simple/dosread.c @@ -13,12 +13,16 @@ * a: Set ASCII bit. */ -#ifdef MSX_UZIX_TARGET +/* Nick #ifdef MSX_UZIX_TARGET */ /* no assertions for MSX UZIX - let's save memory! */ -#define NDEBUG -#undef CACHE_ROOT -#endif +/* Nick #define NDEBUG 1 */ +/* Nick #undef CACHE_ROOT */ +/* Nick #endif */ +#ifndef DEBUG /* Nick */ +#define DEBUG 0 +#define NDEBUG 1 +#endif #include #include #include diff --git a/src/simple/ls.c b/src/simple/ls.c index e5837e79..0acc9c26 100644 --- a/src/simple/ls.c +++ b/src/simple/ls.c @@ -106,11 +106,12 @@ char *inofield(ino_t ino, int inoflag) void dols(int d, char *path, int wide, char *year, int inoflag) { - int i, fd; + int i, j, fd; direct_t buf; char dname[512]; struct stat statbuf; + j = 0; /* current column */ while (read(d, (char *) &buf, sizeof(direct_t)) == sizeof(direct_t)) { if (buf.d_name[0] == '\0') @@ -189,13 +190,34 @@ void dols(int d, char *path, int wide, char *year, int inoflag) else i--; if (wide >= 2) { - if (i < 16) putchar('\t'); - if (i < 8) putchar('\t'); + if (j >= 4) + { + j = 0; + putchar('\n'); + } + else + { + j++; + if (i < 16) + { + putchar('\t'); + } + if (i < 8) + { + putchar('\t'); + } + } } } - if (wide < 2) putchar('\n'); + if (wide < 2) + { + putchar('\n'); + } + } + if (j) + { + putchar('\n'); } - if (wide >= 2) putchar('\n'); #if 1 /* Nick */ fflush(stdout); #endif diff --git a/src/simple/m.bat b/src/simple/m.bat index de973440..854fb259 100644 --- a/src/simple/m.bat +++ b/src/simple/m.bat @@ -2,7 +2,7 @@ cd build-l @if .%1==. goto failure call mklink-l %1 ..\ -iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\%1 +iccz80 -S -w -ml -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\%1 @if errorlevel 1 goto failure del %1.r01 as-z80 -l -o %1.s01 @@ -16,7 +16,7 @@ ihex2bin -l %1.i86 ..\..\..\bin\large\%1 cd ..\build-b call mklink-b %1 ..\ -iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DNDEBUG ..\%1 +iccz80 -S -w -mb -v1 -z -A -I..\..\..\include\ -I..\..\kernel\uzi\ -DPC_UZIX_TARGET -DDEBUG=0 ..\%1 @if errorlevel 1 goto failure del %1.r01 as-z80 -l -o %1.s01 diff --git a/src/simple/mkdir.c b/src/simple/mkdir.c index 98388422..6d79d05e 100644 --- a/src/simple/mkdir.c +++ b/src/simple/mkdir.c @@ -40,7 +40,11 @@ int main (argc,argv) char *p; int i, n, parent = 0, er = 0; +#if 1 /* Nick */ + newmode = 0777 & ~umask(0); +#else newmode = 0666 & ~umask(0); +#endif argc--; argv++; diff --git a/src/simple/setclock.c b/src/simple/setclock.c index cc639d06..1f2b4748 100644 --- a/src/simple/setclock.c +++ b/src/simple/setclock.c @@ -80,7 +80,7 @@ int main(argc, argv) } argv++; if (!conv_time(*argv, *(argv + 1), &tt)) { - wr("Bad date/time format\n"); + wr("Bad time/date format\n"); return 1; } #ifdef __TURBOC__ diff --git a/src/troff/nroff.exe b/src/troff/nroff.exe index 60199e76..250afd09 100644 Binary files a/src/troff/nroff.exe and b/src/troff/nroff.exe differ diff --git a/uzi.bat b/uzi.bat index a9673b9c..5b0247aa 100644 --- a/uzi.bat +++ b/uzi.bat @@ -1,3 +1,2 @@ -del silly.zip -pkzipc -add=update -path=relative -recurse -excl=junk -excl=dev-gnu -excl=dev-nick -excl=build -excl=build-b -excl=build-l -excl=*.s01 -excl=*.lst -excl=*.i86 -excl=*.rst -excl=*.obj -excl=*.pdb -excl=*.ilk uzi * -xcopy uzi.zip \\darkstar\public\uzi.zip +pkzipc -add=update -path=relative -recurse -excl=junk -excl=dev-* -excl=build -excl=build-b -excl=build-l -excl=*.s01 -excl=*.lst -excl=*.i86 -excl=*.rst -excl=*.obj -excl=*.pdb -excl=*.ilk uzi * +xcopy uzi.zip \\redhat\nick