2026-06-28
lvar stack slots to initialise them, and how to format these push instructions.~ instead. Scriptlet used:ldos/src/DOS$ perl -i -pe '
if (/^\s*(test|or|and)\s+word\b[^,]+,\s*([^;]+)/i) {
my $op = $1;
my $imm = $2;
$imm =~ s/^\s+|\s+$//g;
if ($imm !~ /^e?[abcd][xhl]$|^e?[ds]i$|^e?[sb]p$|^-/i) {
if ($op !~ /and/i or $imm !~ /^(?:[-]\s*)?[0-9A-Fa-fHh]+$/) {
if ($op =~ /and/i and $imm =~ /^no_/i) {
s/^([^,]+,\s*?)\s?no_(.*)/$1 ~ $2/i;
}
}
}
}' *.nas
testopt, setopt, and clropt for memory word accesses (test, or, and), allowing to optimise these accesses to byte accesses. Saves 144 bytes of the msbio.bin kernel payload image. Scriptlets used:ldos$ perl -i -pe '
if (/^\s*(test|or|and)\s+word\b[^,]+,\s*([^;]+)/i) {
my $op = $1;
my $imm = $2;
$imm =~ s/^\s+|\s+$//g;
if ($imm !~ /^e?[abcd][xhl]$|^e?[ds]i$|^e?[sb]p$|^-/i) {
if ($op !~ /and/i or $imm !~ /^(?:[-]\s*)?[0-9A-Fa-fHh]+$/) {
if ($op =~ /and/i and $imm =~ /^~/i) {
s/^(\s*)and\s+word(?:\s+ptr)?\s*([^,]+,\s*?)\s?~(.*)/$1clropt $2$3/i;
} elsif ($op =~ /or/i) {
s/^(\s*)or\s+word(?:\s+ptr)?\s*/$1setopt /i;
} elsif ($op =~ /test/i) {
s/^(\s*)test\s+word(?:\s+ptr)?\s*/$1testopt /i;
}
}
}
}' src/DOS/*.nas src/BIOS/*.nas
ldos$ hg stat -mn0 |
xargs -r0 grep -L lmacros3.mac |
xargs -r perl -i -e '
while (<<>>) {
if ($done) { print; next; };
if (/^\s*\[list -\]/) { $nolist = 1; };
if (/^\s*\[list \+\]/) { $nolist = 0; };
if (/%include/) {
/([\r\n]+)$/;
$linebreak = $1;
if (not defined $linebreak or $linebreak eq "") {
$linebreak = "\n";
}
print "\t%include \"lmacros3.mac\"$linebreak";
if ($nolist) {
print "[list -]$linebreak";
}
print;
$done = 1;
next;
};
print;
} continue {
if (eof) {
$done = 0;
$nolist = 0;
}
}'
hg up a2450e016a1f
hg up "$(hg id -r . --template '{children|short}\n')" &&
buggy "hg $(hg id --template '{node|short}\n' -r .)" \
"https://hg.pushbx.org/ecm/bugtracker/file/$(hg id --template '{node|short}\n' -r .)/"
_LBA_HDD_ONLY_DISABLED) and to completely disable LBA access (_FORCE_CHS). instsect reference, and tracked in ticket #1004