VOGONS

Common searches


First post, by Peter Swinkels

User metadata
Rank Member
Rank
Member

Hi,

I am trying to use int 0x21, ax=0x6602 (http://helppc.netcore2k.net/interrupt/int-21-66) to change the code page from inside a Quick Basic program. As far as I can tell I made no mistakes in my program, but the code page will not change. To be more specific: extended characters displayed on screen don't change and int 0x21,ax=0x6601 keeps reporting code page 437 no matter what I do.

The relevant Quick Basic code:

FUNCTION GetCodePage
DIM Registers AS RegType

Registers.AX = &H6601
INTERRUPT &H21, Registers, Registers

GetCodePage = Registers.BX
END FUNCTION

'^^^

SUB SetCodePage (NewCodePage)
DIM Registers AS RegType

Registers.AX = &H6602
Registers.BX = NewCodePage
INTERRUPT &H21, Registers, Registers
END SUB

I suspect DOSBox doesn't support this function unless I install actual DOS, correct?

EDIT:
I just tested my program in DOSBox-X... and it works! Without modification. Any feedback on the subject is still welcome though! 😀

Last edited by Peter Swinkels on 2022-04-23, 10:17. Edited 1 time in total.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 1 of 15, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Changing CP with the DOS function is indeed not supported, but you can use the KEYB program on the Z: drive to change CP.

It appears DOSBox-X supports changing CP via the DOS function only with TTF output, which I suppose is okay if you don't need graphics modes.

Reply 2 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

Is there a list of code page abreviations? (en, nl, sp, etc.)

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 4 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

Thank you! - No support for Turkish?

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 6 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

Yes, those are exactly what I am looking for! Thank you.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 7 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

One more question:

I am mostly interested in outputting characters for different code pages than entering them. Is it possible to keep the keyboard layout USA english but still use a different code page for output?

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 9 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

@_Rob:
Yes, "keyb us 850" will give me a USA keyboard layout... but it also gives me code page 437 characters on my display. I would happily use Windows to enter foreign language text, but I want to use the result in a DOS program. I have to know for a fact the result will be encoded properly using the desired code page.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 11 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

"keyb us 850" works on DOSBox and DOSBox-X and gives me USA keyboard input with extended characters that are not suited for my purpose. I am beginning to think there is misunderstanding here, so let me try to rephrase what I am looking for:

Specifically:
1. I want to display the characters provided by code page tr179.
2. I however don't want my keyboard to be treated as a turkish keyboard. (this is highly impractical when typing on a USA keyboard.)

In Windows there are ways to enter and display special characters without affecting the keyboard layout. However I am dealing with MS-DOS based stuff.

And yes, I am making life hard for myself by wanting to write Turkish text for a DOS based application while having to use a keyboard meant for english. However I don't mind the challenge of finding a solution for this. (Within reason.)

btw:
Thank you for trying to help out, it's appreciated.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 12 of 15, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

tr179 isnt a dos code page. so I dont know what you want.

dosbox-x has no 857 codepage (in my nightly build), which is weird but, keyb us 857 would work if 857 existed...

--/\-[ Stu : Bloody Cactus :: http://kråketær.com :: http://mega-tokyo.com ]-/\--

Reply 13 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

@BloodyCactus:
tr179 is listed as supported by the keyb command at: Keyboard layouts - and "keyb tr179" does change the extended character set appropriately. Unfortunately it also modifies my keyboard layout.

EDIT:
Why did this occur to me just now? KeyB is meant to change the keyboard layout. I guess updating the extended character set is an extra feature...

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 14 of 15, by _Rob

User metadata
Rank Member
Rank
Member

In dosbox-x...:

Z:\>keyb tr
Keyboard layout tr loaded for codepage 857

Z:\>keyb tr179
Keyboard layout tr179 loaded for codepage 857

Z:\>keyb us 857
No layout in us for codepage 857

So there is support for codepage 857, but is seems to be limited. Probably as codepage 857 seems to be specifically targeted at Turkish.
https://en.wikipedia.org/wiki/Code_page_857

Reply 15 of 15, by Peter Swinkels

User metadata
Rank Member
Rank
Member

Aha, I see. Thank you. I wrote a custom solution I am going to try.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels