My first assembler program MX1.CMD witten in 1978. Rename to MX1/CMD on the TRS-80.
Here is the fully un-commented code:
Name: MX1/CMD
Memory space: 5200H - 56C9H
Entry point: 53ADH
ORG 05200H
L5200H:
5200 CP A
5201 JR NZ,L523FH
5203 LD SP,02E3EH
5206 LD L,043H
5208 LD L,H
5209 LD H,L
520A LD H,C
520B LD (HL),D
520C JR NZ,L5271H
520E LD L,A
520F LD H,H
5210 LD H,L
5211 LD (HL),E
5212 JP NC,L5250H
5215 LD C,C
5216 LD C,(HL)
5217 LD D,H
5218 LD B,L
5219 LD D,D
521A JR NZ,$+82
521C LD B,C
L521DH:
521D LD D,D
521E LD B,C
521F LD C,L
5220 LD B,L
5221 LD D,H
5222 LD B,L
5223 LD D,D
5224 JR NZ,L5276H
5226 LD D,D
5227 LD C,A
5228 LD B,A
5229 LD D,D
522A LD B,C
522B LD C,L
522C JP NZ,0BFBFH
522F JR NZ,L526DH
5231 LD (02E3EH),A
5234 LD L,044H
5236 LD L,A
5237 LD (HL),L
5238 LD H,D
5239 LD L,H
523A LD H,L
523B JR NZ,L52B4H
523D LD L,C
523E LD H,H
L523FH:
523F LD H,L
5240 POP DE
5241 LD H,(HL)
5242 LD L,A
5243 LD (HL),D
5244 JR NZ,L52BAH
5246 LD L,B
5247 LD H,L
5248 JR NZ,$+71
524A LD D,B
524B LD D,E
524C LD C,A
524D LD C,(HL)
524E JR NZ,L529DH
L5250H:
5250 LD E,B
5251 DEC L
5252 JR C,L5284H
5254 JR NZ,$+114
5256 LD (HL),D
5257 LD L,C
5258 LD L,(HL)
5259 LD (HL),H
525A LD H,L
525B LD (HL),D
525C JR NZ,L521DH
525E CP A
525F JR NZ,L529DH
5261 INC SP
5262 LD A,02EH
5264 LD L,043H
5266 LD H,C
5267 LD L,(HL)
5268 LD H,E
5269 LD H,L
526A LD L,H
526B JR NZ,L52D1H
L526DH:
526D LD L,A
526E LD (HL),L
526F LD H,D
5270 LD L,H
L5271H:
5271 LD H,L
5272 JR NZ,L52EBH
5274 LD L,C
5275 LD H,H
L5276H:
5276 LD H,L
5277 ADC A,062H
5279 LD A,C
527A JR NZ,L529CH
527C LD B,H
527D LD L,A
527E LD L,(HL)
527F LD H,C
5280 LD L,H
5281 LD H,H
5282 JR NZ,L52D0H
L5284H:
5284 JR NZ,L52D3H
5286 LD H,C
5287 LD L,(HL)
5288 LD L,E
5289 LD L,C
528A LD L,(HL)
528B PUSH BC
528C CP A
528D CP A
528E JR NZ,L52CCH
5290 INC (HL)
5291 LD A,02EH
5293 LD L,043H
5295 LD L,A
5296 LD L,(HL)
5297 LD H,H
5298 LD H,L
5299 LD L,(HL)
529A LD (HL),E
529B LD H,L
L529CH:
529C LD H,H
L529DH:
529D IN A,(056H)
529F LD H,L
52A0 LD (HL),D
52A1 LD (HL),E
52A2 LD L,C
52A3 LD L,A
52A4 LD L,(HL)
52A5 JR NZ,L52D8H
52A7 LD L,034H
52A9 RET
52AA CP A
52AB CP A
52AC JR NZ,L52EAH
52AE DEC (HL)
52AF LD A,02EH
52B1 LD L,043H
52B3 LD H,C
L52B4H:
52B4 LD L,(HL)
52B5 LD H,E
52B6 LD H,L
52B7 LD L,H
52B8 JR NZ,L531DH
L52BAH:
52BA LD L,A
52BB LD L,(HL)
52BC LD H,H
52BD LD H,L
52BE LD L,(HL)
52BF LD (HL),E
52C0 LD H,L
52C1 LD H,H
52C2 RET PE
52C3 CP A
52C4 CP A
52C5 JR NZ,L5303H
52C7 LD (HL),03EH
52C9 LD L,02EH
52CB LD B,L
L52CCH:
52CC LD L,L
52CD LD (HL),B
52CE LD L,B
52CF LD H,C
L52D0H:
52D0 LD (HL),E
L52D1H:
52D1 LD L,C
52D2 LD A,D
L52D3H:
52D3 LD H,L
52D4 LD H,H
52D5 XOR 0BFH
52D7 CP A
L52D8H:
52D8 JR NZ,L5316H
52DA SCF
52DB LD A,02EH
52DD LD L,043H
52DF LD H,C
52E0 LD L,(HL)
52E1 LD H,E
52E2 LD H,L
52E3 LD L,H
52E4 JR NZ,L534BH
52E6 LD L,L
52E7 LD (HL),B
52E8 LD L,B
52E9 LD H,C
L52EAH:
52EA LD (HL),E
L52EBH:
52EB LD L,C
52EC LD A,D
52ED LD H,L
52EE LD H,H
52EF RST 20H
52F0 CP A
52F1 CP A
52F2 JR NZ,L5330H
52F4 JR C,L5334H
52F6 LD L,02EH
52F8 LD B,H
52F9 LD L,A
52FA LD (HL),L
52FB LD H,D
52FC LD L,H
52FD LD H,L
52FE JR NZ,L5370H
5300 LD (HL),D
5301 LD L,C
5302 LD L,(HL)
L5303H:
5303 LD (HL),H
5304 CALL PE,0BFBFH
5307 JR NZ,L5345H
5309 ADD HL,SP
530A LD A,02EH
530C LD L,043H
530E LD H,C
530F LD L,(HL)
5310 LD H,E
5311 LD H,L
5312 LD L,H
5313 JR NZ,L5379H
5315 LD L,A
L5316H:
5316 LD (HL),L
5317 LD H,D
5318 LD L,H
5319 LD H,L
531A JR NZ,$+114
531C LD (HL),D
L531DH:
531D LD L,C
531E LD L,(HL)
531F LD (HL),H
5320 PUSH HL
5321 CP A
5322 CP A
5323 JR NZ,L5361H
5325 LD B,C
5326 LD A,02EH
5328 LD L,04CH
532A LD L,C
532B LD L,(HL)
532C LD H,L
532D JR NZ,$+117
532F LD (HL),B
L5330H:
5330 LD H,C
5331 LD H,E
5332 LD L,C
5333 LD L,(HL)
L5334H:
5334 LD H,A
5335 JR NZ,L5368H
5337 CPL
5338 JR C,$+36
533A RST 20H
533B CP A
533C CP A
533D JR NZ,L537BH
533F LD B,D
5340 LD A,02EH
5342 LD L,04CH
5344 LD L,C
L5345H:
5345 LD L,(HL)
5346 LD H,L
5347 JR NZ,L53BCH
5349 LD (HL),B
534A LD H,C
L534BH:
534B LD H,E
534C LD L,C
534D LD L,(HL)
534E LD H,A
534F JR NZ,L5388H
5351 CPL
5352 SCF
5353 LD (0E622H),A
5356 CP A
5357 CP A
5358 JR NZ,$+62
535A LD B,E
535B LD A,02EH
535D LD L,04CH
535F LD L,C
5360 LD L,(HL)
L5361H:
5361 LD H,L
5362 JR NZ,L53D7H
5364 LD (HL),B
5365 LD H,C
5366 LD H,E
5367 LD L,C
L5368H:
5368 LD L,(HL)
5369 LD H,A
536A JR NZ,$+51
536C CPL
536D LD (HL),022H
536F RST 20H
L5370H:
5370 CP A
5371 CP A
5372 JR NZ,L53B0H
5374 LD B,H
5375 LD A,02EH
5377 LD L,04CH
L5379H:
5379 LD (HL),B
537A LD (HL),D
L537BH:
537B LD L,C
537C LD L,(HL)
537D LD (HL),H
537E JR NZ,$+118
5380 LD H,L
5381 LD (HL),E
5382 LD (HL),H
5383 JR NZ,L53A5H
5385 INC A
5386 LD B,D
5387 LD D,D
L5388H:
5388 LD B,L
5389 LD B,C
538A LD C,E
538B LD A,020H
538D LD (HL),H
538E LD L,A
538F JR NZ,$+117
5391 LD (HL),H
5392 LD L,A
5393 LD (HL),B
5394 CALL C,0BFBFH
5397 JR NZ,$+62
5399 LD B,L
539A LD A,02EH
539C LD L,045H
539E LD A,B
539F LD L,C
53A0 LD (HL),H
53A1 CALL P,000BFH
L53A4H:
53A4 LD D,H
L53A5H:
53A5 LD H,L
53A6 LD (HL),E
53A7 LD (HL),H
53A8 LD L,C
53A9 LD L,(HL)
53AA LD H,A
53AB INC BC
53AC NOP
53AD PUSH AF
53AE PUSH HL
53AF PUSH DE
L53B0H:
53B0 PUSH BC
53B1 CALL 001C9H
53B4 LD HL,03C00H
53B7 LD A,0BFH
53B9 CALL 00033H
L53BCH:
53BC LD A,08FH
53BE LD HL,03C01H
53C1 LD B,03EH
L53C3H:
53C3 LD (HL),A
53C4 INC HL
53C5 DJNZ L53C3H
53C7 LD HL,03C3FH
53CA LD A,0BFH
53CC LD (HL),A
53CD LD HL,03C40H
53D0 LD (04020H),HL
53D3 LD HL,L5200H
L53D6H:
53D6 LD A,(HL)
L53D7H:
53D7 AND A
53D8 JP Z,L53E2H
53DB INC HL
53DC CALL 00033H
53DF JP L53D6H
L53E2H:
53E2 LD A,08FH
53E4 LD HL,03FC0H
53E7 LD B,040H
L53E9H:
53E9 LD (HL),A
53EA INC HL
53EB DJNZ L53E9H
53ED JP L5624H
L53F0H:
53F0 CALL 00049H
53F3 CP 031H
53F5 JR Z,L5458H
53F7 CP 032H
53F9 JP Z,L54B6H
53FC CP 033H
53FE JP Z,L54DFH
5401 CP 034H
5403 JP Z,L54F6H
5406 CP 035H
5408 JP Z,L551DH
540B CP 036H
540D JP Z,L5534H
5410 CP 037H
5412 JP Z,L5555H
5415 CP 038H
5417 JP Z,L5571H
541A CP 039H
541C JP Z,L5587H
541F CP 041H
5421 JP Z,L55A3H
5424 CP 042H
5426 JP Z,L55C5H
5429 CP 043H
542B JP Z,L55E7H
542E CP 044H
5430 JP Z,L5609H
5433 CP 045H
5435 JP Z,L5443H
5438 LD A,(03840H)
543B AND 001H
543D JP NZ,L567DH
5440 JP L53F0H
L5443H:
5443 LD HL,03F81H
5446 LD (04020H),HL
5449 LD A,02AH
544B CALL 00033H
544E POP BC
544F POP DE
5450 POP HL
5451 POP AF
5452 CALL 001C9H
5455 JP 0402DH
L5458H:
5458 CALL SUB_56A2H
545B LD HL,03C41H
545E CALL SUB_5690H
5461 LD HL,03C81H
5464 CALL SUB_5699H
5467 LD HL,03D01H
546A CALL SUB_5699H
546D LD HL,03D81H
5470 CALL SUB_5699H
5473 LD HL,03E01H
5476 CALL SUB_5699H
5479 LD HL,03E81H
547C CALL SUB_5699H
547F LD HL,03EC1H
5482 CALL SUB_5699H
5485 LD HL,03F01H
5488 CALL SUB_5699H
548B LD A,012H
548D CALL 0003BH
5490 LD A,014H
5492 CALL 0003BH
5495 LD A,01BH
5497 CALL 0003BH
549A LD A,046H
549C CALL 0003BH
549F LD A,01BH
54A1 CALL 0003BH
54A4 LD A,048H
54A6 CALL 0003BH
54A9 LD A,01BH
54AB CALL 0003BH
54AE LD A,032H
54B0 CALL 0003BH
54B3 JP L53F0H
L54B6H:
54B6 LD HL,03C81H
54B9 CALL SUB_5690H
54BC CALL SUB_56A2H
54BF LD HL,03D01H
54C2 CALL SUB_5699H
54C5 LD HL,03E81H
54C8 CALL SUB_5699H
54CB LD HL,03EC1H
54CE CALL SUB_5699H
54D1 LD HL,03F01H
54D4 CALL SUB_5699H
54D7 LD A,00EH
54D9 CALL 0003BH
54DC JP L53F0H
L54DFH:
54DF CALL SUB_56A2H
54E2 LD HL,03CC1H
54E5 CALL SUB_5690H
54E8 LD HL,03C81H
54EB CALL SUB_5699H
54EE LD A,014H
54F0 CALL 0003BH
54F3 JP L53F0H
L54F6H:
54F6 CALL SUB_56A2H
54F9 LD HL,03D01H
54FC CALL SUB_5690H
54FF LD HL,03C81H
5502 CALL SUB_5699H
5505 LD HL,03D81H
5508 CALL SUB_5699H
550B LD A,01BH
550D CALL 0003BH
5510 LD A,046H
5512 CALL 0003BH
5515 LD A,00FH
5517 CALL 0003BH
551A JP L53F0H
L551DH:
551D CALL SUB_56A2H
5520 LD HL,03D41H
5523 CALL SUB_5690H
5526 LD HL,03D01H
5529 CALL SUB_5699H
552C LD A,012H
552E CALL 0003BH
5531 JP L53F0H
L5534H:
5534 CALL SUB_56A2H
5537 LD HL,03D81H
553A CALL SUB_5690H
553D LD HL,03D01H
5540 CALL SUB_5699H
5543 LD A,012H
5545 CALL 0003BH
5548 LD A,01BH
554A CALL 0003BH
554D LD A,045H
554F CALL 0003BH
5552 JP L53F0H
L5555H:
5555 CALL SUB_56A2H
5558 LD HL,03DC1H
555B CALL SUB_5690H
555E LD HL,03D81H
5561 CALL SUB_5699H
5564 LD A,01BH
5566 CALL 0003BH
5569 LD A,046H
556B CALL 0003BH
556E JP L53F0H
L5571H:
5571 CALL SUB_56A2H
5574 LD HL,03E01H
5577 CALL SUB_5690H
557A LD A,01BH
557C CALL 0003BH
557F LD A,047H
5581 CALL 0003BH
5584 JP L53F0H
L5587H:
5587 CALL SUB_56A2H
558A LD HL,03E41H
558D CALL SUB_5690H
5590 LD HL,03E01H
5593 CALL SUB_5699H
5596 LD A,01BH
5598 CALL 0003BH
559B LD A,048H
559D CALL 0003BH
55A0 JP L53F0H
L55A3H:
55A3 CALL SUB_56A2H
55A6 LD HL,03E81H
55A9 CALL SUB_5690H
55AC LD HL,03EC1H
55AF CALL SUB_5699H
55B2 LD HL,03F01H
55B5 CALL SUB_5699H
55B8 LD A,01BH
55BA CALL 0003BH
55BD LD A,030H
55BF CALL 0003BH
55C2 JP L53F0H
L55C5H:
55C5 CALL SUB_56A2H
55C8 LD HL,03EC1H
55CB CALL SUB_5690H
55CE LD HL,03E81H
55D1 CALL SUB_5699H
55D4 LD HL,03F01H
55D7 CALL SUB_5699H
55DA LD A,01BH
55DC CALL 0003BH
55DF LD A,031H
55E1 CALL 0003BH
55E4 JP L53F0H
L55E7H:
55E7 CALL SUB_56A2H
55EA LD HL,03F01H
55ED CALL SUB_5690H
55F0 LD HL,03E81H
55F3 CALL SUB_5699H
55F6 LD HL,03EC1H
55F9 CALL SUB_5699H
55FC LD A,01BH
55FE CALL 0003BH
5601 LD A,032H
5603 CALL 0003BH
5606 JP L53F0H
L5609H:
5609 CALL SUB_56A2H
560C LD HL,03F41H
560F CALL SUB_5690H
5612 LD HL,L53A4H
L5615H:
5615 LD A,(HL)
5616 AND A
5617 JP Z,L5609H
561A INC HL
561B CALL 0003BH
561E CALL SUB_5674H
5621 JP L5615H
L5624H:
5624 LD A,(03801H)
5627 AND 020H
5629 JP NZ,L5443H
562C LD A,(037E8H)
562F CP 03FH
5631 JP Z,L565CH
5634 JR $+18
L5636H:
5636 LD D,D
5637 LD H,L
5638 LD H,C
5639 LD H,H
563A LD A,C
563B JR NZ,$+34
563D LD (HL),B
563E LD (HL),D
563F LD L,C
5640 LD L,(HL)
5641 LD (HL),H
5642 LD H,L
5643 LD (HL),D
5644 LD HL,07803H
5647 CP 010H
5649 JR Z,L5624H
564B LD HL,03D69H
564E LD (04020H),HL
5651 LD HL,L5636H
5654 CALL 04467H
5657 LD B,010H
5659 JP L5624H
L565CH:
565C LD HL,03D69H
565F LD (04020H),HL
5662 LD HL,L5671H
5665 CALL 04467H
5668 LD HL,03FFEH
566B LD (04020H),HL
566E JP L53F0H
L5671H:
5671 RST 8
5672 INC BC
5673 RET
SUB_5674H:
5674 LD A,(03840H)
5677 AND 004H
5679 JP NZ,L5685H
567C RET
L567DH:
567D LD A,00AH
567F CALL 0003BH
5682 JP L53F0H
L5685H:
5685 CALL SUB_56A2H
5688 LD A,00DH
568A CALL 0003BH
568D JP L53F0H
SUB_5690H:
5690 LD (04020H),HL
5693 LD A,02AH
5695 CALL 00033H
5698 RET
SUB_5699H:
5699 LD (04020H),HL
569C LD A,020H
569E CALL 00033H
56A1 RET
SUB_56A2H:
56A2 LD HL,03C41H
56A5 CALL SUB_5699H
56A8 LD HL,03CC1H
56AB LD (04020H),HL
56AE CALL SUB_5699H
56B1 LD HL,03D41H
56B4 CALL SUB_5699H
56B7 LD HL,03DC1H
56BA CALL SUB_5699H
56BD LD HL,03E41H
56C0 CALL SUB_5699H
56C3 LD HL,03F41H
56C6 CALL SUB_5699H
56C9 RET