1 # Copyright (c) KATO Takenori, 2007.
3 # All rights reserved. Unpublished rights reserved under the copyright
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # 1. Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer as
12 # the first lines of this file unmodified.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .section .putssjis, "awx", @progbits
35 # Display string with Shift-JIS support
36 # %si: addres of string, %di: T-VRAM address, %cx: count
39 # Absolute address of putssjis_entry must be 0x1243.
43 # Setup the T-VRAM segement address.
47 testb $0x08, %es:0x501
60 testb $0xe0, %al # Check control code.
62 movb $0x20, %al # Convert control code into the space.
71 # Check 2byte "hankaku"
113 # Convert Shift-JIS into JIS.
115 ja sjis_h_2 # Upper > 0x9f
116 subb $0x71, %al # Upper -= 0x71
119 subb $0xb1, %al # Upper -= 0xb1
121 salb %al # Upper *= 2
122 incb %al # Upper += 1
126 decb %ah # Lower -= 1 if lower > 0x7f
130 subb $0x7d, %ah # Lower -= 0x7d
131 incb %al # Upper += 1
134 subb $0x1f, %ah # Lower -= 0x1f