Skip to content

Simplified entries#16

Open
PerditionC wants to merge 25 commits intomasterfrom
entry_unified
Open

Simplified entries#16
PerditionC wants to merge 25 commits intomasterfrom
entry_unified

Conversation

@PerditionC
Copy link
Contributor

@PerditionC PerditionC commented Feb 2, 2026

This replaces #15
In progress, requires further testing and verification but otherwise complete.

Creates Entry, subfunction header, and country info structures from a single macro invocation allowing defining country/codepage mappings and associated data with a single row instead of 3 different places in country.asm. Removes most references to 2-alpha country code except in header comment documenting countries and their numeric id (country code to pass to COUNTRY= line).

Updates ci_validation.py with new COUNTRY macro variations instead of ENTRY macro invocations.

…tries

- add South Africa (za), Mexico (mx), Indonesia (id), Philippines (ph), New Zealand (nz), Thailand (th), Vietnam (vn), Luxembourg (lu), Ireland (ie), Albania (al), Malta (mt), Cyprus (cy)
- split Czechoslovakia (cz) into Czech Repulic (cz) and Slovakia (sk)
- obsolete Yugoslavia (yu) & Czechoslovakia (cz) - can still be included by defining %OBSOLETE% when building
- change Bulgaria to use Euro for currency, currency changed Jan 2026
- internal only, rename Macedonia to North Macedonia
replaces ENTRY, SUBFUNC_HEADER, and cnf macros (and related OLD_, etc) with a single macro row that generates all 3 structures (entry, subfunction header, country info).  Avoids duplication of information, need to edit 3 places to add/update an entry, and avoids any usage of 2-alpha country codes, as long as a numeric country code (e.g. telephone code) exists then can be referenced.
Updates ci_validate.py to parse new macro.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the validation script ci_validate.py to work with simplified country entry macros introduced in the main code. The script now validates the new COUNTRY, OLD_COUNTRY, COUNTRY_LCASE, COUNTRY_DBCS, and COUNTRY_ML macro formats instead of the previous lower-level entry definitions.

Changes:

  • Rewrote validation logic to parse new macro formats (COUNTRY, OLD_COUNTRY variants, and COUNTRY_ML)
  • Added support for validating obsolete entries wrapped in OLD_COUNTRY macros
  • Built country code mapping from comments in country.asm instead of hardcoded patterns
  • Added special-case handling for obsolete countries (Yugoslavia, Czechoslovakia)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

PerditionC and others added 2 commits February 2, 2026 08:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…y check any more

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@andrewbird
Copy link
Contributor

andrewbird commented Feb 2, 2026

Have a look at this proof of concept for calculating the number of entries andrewbird@b57c721

It also generates a .map file so you can see where things are ending up in the output file.

Edited after fixup, and answered own questions.

@PerditionC
Copy link
Contributor Author

the yes no values are in the form of yn_YN where yn_ is the prefix and YN are letters to use for yes and no, not language specific only combination specific. Each CC_yn where CC is the country, is an equate that correlates the country's yn to actual letters. Mostly this has comments to what yes and no are for the language. If they aren't ASCII values then uses codepage specific values. A future step would be to remove all these equates and only use the yn_YN variants directly. But I'd like to keep the comments too as I find it interesting to see the similarities of the various languages.

@PerditionC
Copy link
Contributor Author

I really like that! It even solves my main concern about moving things around breaking some unknown assumptions. Thank you.

@andrewbird
Copy link
Contributor

Cool, glad you like it!

@andrewbird
Copy link
Contributor

I may try to recreate the country.sys from FreeDOS 1.4 using your new macros plus this scheme and binary compare them.

@andrewbird
Copy link
Contributor

I may try to recreate the country.sys from FreeDOS 1.4 using your new macros plus this scheme and binary compare them.

Too difficult, I'm afraid. With the same number of entries in the countries table, it got a lot better as the structure offsets within it began to match. Quite honestly there have been too many changes in the data for this comparison task. I suspect checking within DOS is likely to be the best option to validate.

@andrewbird
Copy link
Contributor

So I had a little more patience today and managed to do a reasonable binary comparison of country.sys from 1.4 to a hacked up version of your new macroed system. It's pretty good, but I do notice an oddity with the yes/no stuff which seems to be coming through literally, rather than the macro being expanded. See the screenshot.
yes-no

@PerditionC
Copy link
Contributor Author

PerditionC commented Feb 3, 2026 via email

@andrewbird
Copy link
Contributor

I also wonder if some YN entries in the original were incorrect, take this for instance db 'A','0','N',0 ; Czech where a zero character '0' was output rather than a NUL.

@andrewbird
Copy link
Contributor

Changing the macro a little to

%macro YESNO 3-5
%1 db 0FFh,"YESNO  "
   dw 4
   %if %0 == 5
     db %2,%3,%4,%5
   %else
     db %2,0,%3,0
   %endif
%endmacro

improved things

Changes were
1/ remove quotes around %2 / %3
2/ increase the num args test to 5

PerditionC and others added 4 commits February 3, 2026 20:50
By using NASM sections we can place things back in line with where
the non-macro generated tables were found in the output file and
so do math to establish the number of entries.

(cherry picked from commit b57c721)
1/ We don't need a multicore runner for this, so just use the bare
minimum and others can get the benefit.
2/ No need to install gcc-ia16 and its requisite repository.

(cherry picked from commit b07b634)
…ly .data# sections; put entries in .data1 instead of .data
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PerditionC
Copy link
Contributor Author

binaries built during validation now kept for 30 days for testing. build just completed available (for now) at https://github.com/FDOS/country/actions/runs/21658879035/artifacts/5369031236

PerditionC and others added 7 commits February 4, 2026 06:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…add both a program for testing/comparing country data (nlsdump) and simple wrapper library for common DOS NLS APIs (nls.h / nls.asm) that can be used by other programs. dosazm.inc is an incomplete NASM set of macros to allow writing assembly functions that work across compilers and memory models with minimal %if and duplication. [current version is as generated and though can build, logic is untested and likely to crash and burn!]
…aracter ASCIIZ values (character and 0 byte).
…n in small model need to pass as a far argument
Update comments to reflect this now a generic Arabic / Middle East, but historically was for Arabia, see https://www.pcjs.org/documents/books/mspl13/msdos/encyclopedia/appendix-a/ in COUNTRY= section.  In the future this may be updated to use OLD_ macros and marked obsolete if country specific records are added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants