Hi everybody, see yet another FreeCOM feature request below... ;-)

Thanks for filling in the table, Denis! A proof of concept tool for
your task, for compilation with "NASM -O CANADA.COM CANADA.ASM" is
implemented in the following code:

> start:        jmp short setup ; 100h
> chain:
>       db 0eah         ; jmp far fixed offset
>       dw 0,0          ; 103h: old INT 21 vector stored here
> mapc: retf            ; 107h: dummy case mapping routine
> new21:        pushf           ; 108h: new INT 21 handler
>       cmp ax,3800h    ; get country info?
>       jz canada
>       popf
>       jmp short chain
> canada:       popf            ; DS:DX is pointer to user buffer
>       mov bx,dx
>       mov word [bx+0],2       ; date format Year Month Day
>       mov word [bx+2],24h     ; dollar sign, null char (currency)
>       mov word [bx+7],20h     ; space char, null char (1000s sep)
>       mov word [bx+9],2eh     ; ".", null char (decimal separator)
>       mov word [bx+11],2dh    ; "-", null char (date separator)
>       mov word [bx+13],3ah    ; colon, null char (time separator)
>       mov byte [bx+15],3      ; currency format flags
>       mov byte [bx+16],2      ; decimals for amounts of money
>       mov byte [bx+17],1      ; use 24 hour time
>       mov word [bx+18],107h   ; case map routine (dummy)
>       mov [bx+20],cs          ; case map routine segment
>       mov word [bx+22],20h    ; space char, null, data list sep
>       ; at offset 24: ten bytes of reserved data, ignored here
>       mov bx,2        ; country code for French Canadian
>       clc
>       retf +2
> setup:                        ; offset must be at most 160h (16+6 para)
>       mov ax,3521h    ; get INT 21 vector
>       int 21h         ; return ES:BX
>       mov [103h],bx   ; offset
>       mov [105h],es   ; segment
>       mov ax,2521h    ; set new INT 21 vector
>       mov dx,108h     ; new21 offset, expect DS=CS
>       int 21h
>       mov ax,3100h    ; stay TSR, errorlevel 0
>       mov dx,16+6     ; resident paragraphs incl. PSP
>       int 21h

However, it turns out that the long number display code of
freecom command.com does NOT support country settings AT ALL
YET! It just uses comma as thousands separator all the time.

See the "convert" function in the "num_fmt" source code file.

I am not sure about the date format: Freecom sources say it
should work, but I think it does not change for me? Do not
forget to load a new instance of freecom (by running the
command.com binary, simple) after running the CANADA tool.

At least the tool does switch to 24 hour time correctly :-p

The clock display in EDIT also follows the CANADA settings.

Cheers, Eric

Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Freedos-devel mailing list

Reply via email to