1 ;;; -*- coding: iso-2022-7bit -*-
2 ;;; big5type.el --- conversion between Big5 and Emacs representation(Mainly CNS)
4 ;; Copyright (C) 1999 Miyashita Hisashi
6 ;; Keywords: mule, multilingual,
7 ;; MULE-UCS, Big5, CNS, Traditional Chinese
9 ;; This file is part of MULE-UCS
11 ;; MULE-UCS is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; MULE-UCS is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
27 ;; This module provides type definition on big5conv.
36 (mucs-type-register-serialization
45 (((read-if (r0 > ?\xA0)
47 (r0 = (r0 <8 r7))))))))
49 (mucs-type-register-serialization
61 (defvar char-1-big5-1-first-code
62 (funcall (mucs-type-get-ccl-representation
64 (make-char 'chinese-big5-1 33 33)))
65 (defvar char-1-big5-2-first-code
66 (funcall (mucs-type-get-ccl-representation
68 (make-char 'chinese-big5-2 33 33)))
69 (defvar big5-same-row (+ (- ?\x7F ?\x40)
72 (defun mucs-ccl-char-1-write-big5-char (dosp)
79 ((if (r0 < ,char-1-big5-2-first-code)
80 ((r0 -= ,char-1-big5-1-first-code)
81 (r0 -= ((r0 / 96) * 2))
82 (write ((r0 / ,big5-same-row) + ?\xA1)))
83 ((r0 -= ,char-1-big5-2-first-code)
84 (r0 -= ((r0 / 96) * 2))
85 (write ((r0 / ,big5-same-row) + ?\xC9))))
86 (r0 %= ,big5-same-row)
89 (write (r0 + ?\x62)))))))
91 (defun mucs-ccl-char-1-read-big5-char ()
92 `((read-if (r0 >= ?\xA1)
93 ((read-if (r1 < ?\x7F)
97 ((r4 = (((r0 - ?\xA1) * ,big5-same-row) + r1))
98 (r4 += ((r4 / 94) * 2))
99 (r0 = (r4 + ,char-1-big5-1-first-code)))
100 ((r4 = (((r0 - ?\xC9) * ,big5-same-row) + r1))
101 (r4 += ((r4 / 94) * 2))
102 (r0 = (r4 + ,char-1-big5-2-first-code))))))))
104 (mucs-type-register-serialization
108 `(,(mucs-ccl-char-1-write-big5-char nil)))
110 `(,(mucs-ccl-char-1-read-big5-char))))
112 (mucs-type-register-serialization
116 `(,(mucs-ccl-char-1-write-big5-char t)))