114 words
1 minutes
SCSC2026 Quals - ASM 101 - General Skills Writeup
Category: General Skills
File: source.nasm
Flag: scsc26{02_02_1c00_001c}
Challenge Description
Given a 16-bit DOS assembly program. Inputs are:
- input1 =
20 - input2 =
200
Flag format:
scsc26{mem[001E]_mem[001F]_DX_BX}
Analysis
At a high level, the program:
- Reads 2 inputs using DOS
int 21hfunctionAH=0Ah(buffered input). - Copies input into
number3andnumber4from the back (usesSTD+LODSB/STOSB) to right-align digits (4-digit style). - Treats filler bytes as empty, effectively as
0. - Takes 4 digits from each number, converts ASCII
'0'..'9'to numeric0..9. - Adds digit-by-digit with carry and stores a 5-digit result into memory
0x001C..0x0020.
With right-alignment:
20becomes0020200becomes0200- Sum =
00220
Solution
Because the result is stored as digits:
mem[001E](hundreds digit) =02mem[001F](tens digit) =02
At the end of the loop:
DX = 1c00(DH=1C, DL=00)BX = 001c
So the flag is:
scsc26{02_02_1c00_001c}
SCSC2026 Quals - ASM 101 - General Skills Writeup
https://blog.rei.my.id/posts/14/scsc2026-quals-asm-101-general-skills-writeup/