Start page: ARABART home
← All fifteen programs

Arabic Basmallah

1991 · C:\PESM\PESM.EXE

C:\PESM\PESM.EXE
Arabic Basmallah running in DOS

Loading PESM.EXE, 4 KB

Click the screen to type into the program.

The Basmala drawn 16 times, in every mix of bold, underline and italic, at two sizes and in different colors, by its own copy of ARABART.

The story

PESM is a test card for the engine that became ARABART. Sixteen calls draw the Basmala, a sacred Islamic phrase. The style keys in front of each line count from 0 to 15 in binary, so every mix of the four styles appears once. Its joining code and letter shapes are the same bytes that ARABART 4.15 carries in 1993. PESM calls the engine directly, with the same arguments that programs later send to ARABART.

Sixteen lines, counting to fifteen

PESM writes the Basmala, بسم الله الرحمن الرحيم, sixteen times. Every line switches on a new mix of bold, underline, italic and double size, until it has drawn them all.

This is the first appearance of his Arabic engine, in 1991. Press Run and watch it work through every style, one call at a time.

C:\PESM\PESM.EXE
PESM's screen: بسم الله الرحمن الرحيم sixteen times in two columns, each line in a new color and mix of styles.

CALL 16 of 16
00E8mov dx,026Chthe text
00EBmov ax,3608hAL: dark gray
00EEmov cx,0190hx = 400
00F1mov bx,01DFhy = 479
00F4call 0284hhis engine
Style keys in front of the text@
The four switches after them
Double
Italic
Underline
Bold

Decimal 15 Hex Fh

Call 16: every switch is on. Fifteen in binary.

Watch the four switches. PESM never sets a style outright. In front of each line it puts only the style keys that need to flip: @ for bold, # for underline, ! for italic. The switches carry over from one line to the next, so the prefixes count in binary: 0, 1, 2, 3, all the way to 15.

Line 9 starts the second column with *$: every switch off, then double size on. That is 8, binary 1000, and the count runs on to 1111. Sixteen lines, every combination of four styles, and not one line repeated. A complete test card, in a few bytes of text.

The engine inside, byte for byte

PESM carries its own copy of his Arabic engine. Its joining code and its letter shapes are the very bytes ARABART 4.15 carries two years later.

Pick a block and compare the two files live. Two years on, he had no reason to touch the code that gives every letter its shape.

TWO FILES, to the same scale
PESM.EXE 02C4h
02C4054F478A1580FAC8
02CC74F880FAC974F380
02D4FACA74EE80FACB74
02DCE980FAD074E480E2
02E4BF88158A1580FA00
02EC745B80FAC8745380
02F4FAC9744E80FACA74
02FC4980FACB744480FA
0304D0743F8BF7468A0C
030C80F9C874F880F9C9
031474F380F9CA74EE80
031CF9CB74E980F9D074
0324E48AE98AF280E680
032C80E54080FE007408
033480FD007403EB0B90
033C80E27F80E1BF8815
0344880C47EB9E2E8A1E
ARABART.EXE 0238h
0238054F478A1580FAC8
024074F880FAC974F380
0248FACA74EE80FACB74
0250E980FAD074E480E2
0258BF88158A1580FA00
0260745B80FAC8745380
0268FAC9744E80FACA74
02704980FACB744480FA
0278D0743F8BF7468A0C
028080F9C874F880F9C9
028874F380F9CA74EE80
0290F9CB74E980F9D074
0298E48AE98AF280E680
02A080E54080FE007408
02A880FD007403EB0B90
02B080E27F80E1BF8815
02B8880C47EB9E2E8A1E
Two programs, two years apart. Compare them.

ARABART runs as a service in memory. Programs reach it through the PC’s built-in video service, INT 10h, the way a web page calls a browser API. PESM keeps the engine inside its own file and calls it directly, with the very same arguments: the color, x, y and the text. Today we call that static linking: one file, nothing to install first.

So the same code serves both ways. For a quick demo, link it in. For many programs on one PC, load it once and let all of them call it. ARABART is the second way.

One engine, two ways to ship it
1991 to 19932026Why it is the same idea
PESM carries the engine inside its own file A statically linked binary, the way Go builds by default One file that runs anywhere, with nothing to install.
ARABART loads once and serves every program A shared library, or a local background service One copy in memory for every program that needs it.
The same inputs for call 0284h and int 10h One API with two backends Code written for one works with the other.
Sixteen lines, every mix of styles A visual test page, like a Storybook story for every variant Draw every combination once, and see them all at a glance.
For engineers: the entry PESM calls
PESM.EXE · the engine entry (image offset 0284h)
0284 mov cs:[05B9h],ds / mov cs:[05BBh],dx ; where the text is
028E mov cs:[05C7h],al ; the color
0292 mov cs:[05BFh],bx / mov cs:[05BDh],cx ; y and x
02A7 mov dl,[di] / cmp dl,0 / je 02BDh ; each key, up to the zero
02B3 mov al,cs:[si+09FBh] ; key to glyph code: his table
02B8 mov [di],al / inc di ; stored in place
02C5 dec di / inc di / mov dl,[di] / cmp dl,0C8h ; the shaping pass: 136 bytes, the same as ARABART 0238h
Image offsets in the unpacked PESM.EXE; the file adds a 30h-byte header. Main is sixteen copies of five instructions, at 0007h to 00F6h.

PESM fills the registers exactly as a program fills them for ARABART: AH = 36h, AL the color, CX the x, BX the y, DS:DX the text. Pixels go straight into VGA memory, mode 12h, 640 by 480, through the VGA Graphics Controller: Set/Reset holds the color and the Bit Mask picks the pixels, exactly as in ARABART. One difference shows how the engine grew: in PESM the style switches carry over from call to call, which is what lets the sixteen lines count. ARABART 4.15 clears them at the start of every call, so each string carries its own styles. See the engine in Every Byte.

The Basmala, in 22 keys

The whole sentence is fsl hggi hgvplk hgvpdl: 22 keys on an English keyboard, pressed as if it had Arabic key caps. Two more lines wait in PESM’s data, in the same code.

One is his own name. The other names a computer center, Al-Nour. Pick a line, then pick any key to see what it becomes.

PESM.EXE its strings, one key per byte
Key 1, f: his table turns it into E8h, the letter ب, and it can join on both sides. Next to its neighbors it becomes initial, A8h.
بسم الله الرحمن الرحيم, “In the name of God, the Most Gracious, the Most Merciful”.

Every key here is the Arabic-keyboard encoding: f is ب, s is س, l is م. His markup lives inside the text, style keys and all, the same way it does in ARABART. Type your own on ARABART.

Every Byte of PESM.EXE

Each square is one byte of the program in memory, colored by what it is. Tap a part to open it in the full map, down to the single instruction.

C:\PESM\PESM.EXE