org $100
input:
mov ax,$0000
int $16
cmp al,$60
jnz input
push cs
pop ds
mov esi,ram
mov ebx,[esi]
add esi,4
add ebx,esi
poop:
cmp ebx,esi
jz pend
mov cl,$00
mov ah,$0e
name:
mov al,[esi]
int $10
inc cl
inc esi
cmp cl,$20
jnz name
mov cl,$00
size:
mov al,[esi]
shr al,$4
cmp al,$00
jnz size1
add al,$30
int $10
size1:
cmp al,$01
jnz size2
add al,$30
int $10
size2:
cmp al,$02
jnz size3
add al,$30
int $10
size3:
cmp al,$03
jnz size4
add al,$30
int $10
size4:
cmp al,$04
jnz size5
add al,$30
int $10
size5:
cmp al,$05
jnz size6
add al,$30
int $10
size6:
cmp al,$06
jnz size7
add al,$30
int $10
size7:
cmp al,$07
jnz size8
add al,$30
int $10
size8:
cmp al,$08
jnz size9
add al,$30
int $10
size9:
cmp al,$09
jnz sizea
add al,$30
int $10
sizea:
cmp al,$0a
jnz sizeb
add al,$30
int $10
sizeb:
cmp al,$0b
jnz sizec
add al,$30
int $10
sizec:
cmp al,$0c
jnz sized
add al,$30
int $10
sized:
cmp al,$0d
jnz sizee
add al,$30
int $10
sizee:
cmp al,$0e
jnz sizef
add al,$30
int $10
sizef:
cmp al,$0f
jnz nextdick
add al,$30
int $10
nextdick:
mov al,[esi]
shl al,$4
shr al,$4
cmp al,$00
jnz size12
add al,$30
int $10
size12:
cmp al,$01
jnz size22
add al,$30
int $10
size22:
cmp al,$02
jnz size32
add al,$30
int $10
size32:
cmp al,$03
jnz size42
add al,$30
int $10
size42:
cmp al,$04
jnz size52
add al,$30
int $10
size52:
cmp al,$05
jnz size62
add al,$30
int $10
size62:
cmp al,$06
jnz size72
add al,$30
int $10
size72:
cmp al,$07
jnz size82
add al,$30
int $10
size82:
cmp al,$08
jnz size92
add al,$30
int $10
size92:
cmp al,$09
jnz sizea2
add al,$30
int $10
sizea2:
cmp al,$0a
jnz sizeb2
add al,$30
int $10
sizeb2:
cmp al,$0b
jnz sizec2
add al,$30
int $10
sizec2:
cmp al,$0c
jnz sized2
add al,$30
int $10
sized2:
cmp al,$0d
jnz sizee2
add al,$30
int $10
sizee2:
cmp al,$0e
jnz sizef2
add al,$30
int $10
sizef2:
cmp al,$0f
jnz sizeg
add al,$30
int $10
sizeg:
inc esi
inc cl
cmp cl,$4
jnz size
mov al,$0d
int $10
sub esi,$4
mov edx,[esi]
add esi,$4
add esi,edx
jmp poop
pend:
int $20
ret
ram file 'ram'