Page 1 of 1

Unicode in Assembly

Posted: Sun Jun 10, 2007 6:50 am
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? :?

Posted: Sun Jun 10, 2007 7:14 am
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.

Posted: Tue Jun 12, 2007 7:12 am
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.

Posted: Tue Jun 12, 2007 7:24 am
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.

Posted: Tue Jun 12, 2007 9:51 pm
by Solidus117
IIRC, MenuetOS has unicode support. Check the sources (FASM-Syntax).

Posted: Fri Jun 15, 2007 5:47 am
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:

Posted: Fri Jun 15, 2007 5:48 am
by cooldude
Solidus117 wrote:IIRC, MenuetOS has unicode support. Check the sources (FASM-Syntax).
Okay! Thanks! :D