Unicode in Assembly

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
cooldude
Posts: 5
Joined: Wed Mar 21, 2007 1:37 pm

Unicode in Assembly

Post by cooldude »

How do i use Unicode in ASM?
Here is my data.inc file:

Code: Select all

[segment .data]
   strwelcome db "Welcome to Osname", 0x00
   strPrompt  db ">>",0x00
   cmdLen     db 255
   OsName     db "Osname",0x00
   
   cmdInfo     db "info",0x00
   cmdExit     db "exit",0x00
   strUnknown  db "~~",0x00
   cmdCpuid    db "cpuid",0x00
   
   
   logo1 db "                  _.++. .+.           ",0x00
   logo2 db "                .'///|\Y/|\;          ",0x00
   logo3 db "               : :   _ | _ |          ",0x00
   logo4 db "              /  `-.' `:' `:          ",0x00
   logo5 db "             /|i, :     ;   ;.        ",0x00
   logo6 db "            ,     |     |   |`\       Written in Assembly",0x00
   logo7 db "            ||Ii  :     |   |  ;      ",0x00
   logo8 db "            ;      \--gg;-gg; i:      ",0x00
   logo9 db "            ||Ii    `._,gg.'   |      Developer:",0x00
   logo10 db "           '       .' `**'`. i;         Cooldude",0x00
   logo11 db "             `.\`   `. .'`..' /         ",0x00
   logo12 db "              |`-._      __.-'     ",0x00
   logo13 db "              :           `.          Licensed under GPL",0x00
   logo14 db "             /i,\  ,        \         ",0x00
   logo15 db "           /    ; :         \         ",0x00
   logo16 db "           :Ii  _:  \         ;       ",0x00
   logo17 db "           ;   (     ;        :       ",0x00
   logo18 db "           :i'( _,  /         ;       ",0x00
   logo19 db "            ;. `'--'         /        ",0x00
   logo20 db "            :i\Ii'         .'         ",0x00
   logo21 db "            |  ;  :__.--:*'           ",0x00
   logo22 db "            |Ii|  :  ;  :             ",0x00
   logo23 db "            ;  |  |  |  |             ",0x00
   logo24 db "           /Y  |  |  |  |(C) PAWS Inc.",0x00
   logo25 db "       .=-'Y  /|  ;  |  |             ",0x00
   logo26 db "      :E    .' ;  L__:-***-.-***-.    ",0x00
   logo27 db "       `=--' .'       _   , ;   , ;   ",0x00
   logo28 db "            '----.__.__J--''`*--''    ",0x00




   
[segment .bss]
   strCmd     resb 256
   nCmdSize   resb 1
   strCmd0     resb    256     ;buffers for the command components
   strCmd1     resb    256
   strCmd2     resb    256
   strCmd3     resb    256
   strCmd4     resb    256
   VendorSign  resb    13
I want to use unicode in this file, but how do i do it? :?
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

What we normally use is the set of ASCII characters that have the code range of 0 to (2^8) - 1, thus only using one byte per character. UNICODE characters are mostly 16 bits long and they can be any characters in the range 0 to (2^16)-1 or 65536 characters. We even have 4-bytes-long UNICODE characters but what you need first is to create some fonts that are able to display UNICODE characters on the screen. I believe you have to initialize some graphics mode and then try to manually display each character related to the UNICODE font on the screen.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
cooldude
Posts: 5
Joined: Wed Mar 21, 2007 1:37 pm

Post by cooldude »

XCHG wrote:What we normally use is the set of ASCII characters that have the code range of 0 to (2^8) - 1, thus only using one byte per character. UNICODE characters are mostly 16 bits long and they can be any characters in the range 0 to (2^16)-1 or 65536 characters. We even have 4-bytes-long UNICODE characters but what you need first is to create some fonts that are able to display UNICODE characters on the screen. I believe you have to initialize some graphics mode and then try to manually display each character related to the UNICODE font on the screen.
How do i do it? Can you give me a example?
My operating system does not have a GUI. It's "DOS like". You know, with text.
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

Garfield is a registered trademark so you problably need to pay royalties if you which to use it in an OS. Sorry don't wanna be a spoil sport.
Author of COBOS
Solidus117
Posts: 23
Joined: Sun Dec 03, 2006 5:29 pm

Post by Solidus117 »

IIRC, MenuetOS has unicode support. Check the sources (FASM-Syntax).
cooldude
Posts: 5
Joined: Wed Mar 21, 2007 1:37 pm

Post by cooldude »

os64dev wrote:Garfield is a registered trademark so you problably need to pay royalties if you which to use it in an OS. Sorry don't wanna be a spoil sport.
I will not use Garfield. It's just a Example. :wink:
cooldude
Posts: 5
Joined: Wed Mar 21, 2007 1:37 pm

Post by cooldude »

Solidus117 wrote:IIRC, MenuetOS has unicode support. Check the sources (FASM-Syntax).
Okay! Thanks! :D
Post Reply