Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

"It is easier to port a shell than a shell script." -- Larry Wall


programming / alt.lang.asm / small asm (compo?)

SubjectAuthor
o small asm (compo?)Kerr-Mudd,John

1
Subject: small asm (compo?)
From: Kerr-Mudd,John
Newsgroups: alt.lang.asm
Organization: dis
Date: Sat, 22 Aug 2020 13:55 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: notsay...@127.0.0.1 (Kerr-Mudd,John)
Newsgroups: alt.lang.asm
Subject: small asm (compo?)
Date: Sat, 22 Aug 2020 13:55:58 -0000 (UTC)
Organization: dis
Lines: 34
Message-ID: <XnsAC2197E7CAFFBadmin127001@144.76.35.198>
Injection-Date: Sat, 22 Aug 2020 13:55:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="74c55555ac89441055409eda5931f32f";
logging-data="25245"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zlWsRnyLbGuwcoqe3SOQCA7WGvGmpjRM="
User-Agent: Xnews/2006.08.24
Cancel-Lock: sha1:UJC0pp0zGQ+7P1N5wuroLfCV0lM=
X-Clacks-Overhead: GNU Terry Pratchett
View all headers
Posted to clax, but repeated here



Subject: small asm code (compo?)
Newsgroups: es:comp.lang.asm.x86
X-Clacks-Overhead: GNU Terry Pratchett

Spec is to show the day of week as a literal string;

given these DOS functions (maybe others?)

get daynum: DOS has int 0x21, fn 0x2A which returns al as 0-6 (Sun-Sat)

print: int 21, fn 2 with dl=char
  or int 21, fn 9 with dx pointing to a string terminated with a $ (x24)

terminate with return code: int 0x21 fn 0x4C, code in al


Write shortest programs to show day string of the current day;

1) full string e.g. "Monday", "Saturday"
2) 3 letter e.g. "Mon", "Sat"
3) 2 letter e.g. "Mo", "Sa"


My current shortests are:
1) 67
2) 49
3) 40

--
Bah, and indeed, Humbug.


1
rocksolid light 0.7.2
clearneti2ptor