AX -T AX=0148 BX=0148 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0108 NV UP EI PL NZ NA PO NC 13C6:0108 03D8 ADD BX,AX -T AX=0148 BX=0290 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=010A NV UP EI PL NZ AC PO NC 13C6:010A 8BCB MOV CX,BX -T AX=0148 BX=0290 CX=0290 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=010C NV UP EI PL NZ AC PO NC 13C6:010C 2BC8 SUB CX,AX -T AX=0148 BX=0290 CX=0148 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0100 NV UP EI PL NZ AC PO NC 13C6:010E 2BC0 SUB AX,AX -T AX=0000 BX=0290 CX=0148 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0110 NV UP EI PL ZR NA PO NC 13C6:0110 90 NOP -T AX=0000 BX=0290 CX=0148 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0111 NV UP EI PL ZR NA PO NC 13C6:0111 CB RETF - IBM PC. . 13 -D CS:100 13C6:0100 B8 23 01 05 25 00 8B D8-03 D8 8B CB 2B C8 2B C0 .#..%.......+.+. 13C6:0110 90 CB 8D 46 14 50 51 52-FF 76 28 E8 74 00 8B E5 ...F.PQR.v(.t... 13C6:0120 B8 01 00 50 FF 76 32 FF-76 30 FF 76 2E FF 76 28 ...P.v2.v0.v..v( 13C6:0130 E8 88 15 8B E5 BF 36 18-12 FF 36 16 12 8B 76 28 ......6...6...v( 13C6:0140 FF 74 3A 89 46 06 E8 22-CE 8B E5 30 E4 3D 0A 00 .t:.F.."...0.=.. 13C6:0150 75 32 A1 16 12 2D 01 00-8B 1E 18 12 83 DB 00 53 u2...-.........S 13C6:0160 50 8B 76 28 FF 74 3A A3-16 12 89 1E 18 12 E8 FA P.v(.t:......... 13C6:0170 CD 8B E5 30 E4 3D 0D 00-74 0A 83 06 16 12 01 83 ...0.=..t....... -Q IBM PC. . 14 D>DEBUG -E DS:23 01 25 00 00 -E DS:2A 2A 2A -E CS:100 A1 00 00 03 06 02 00 -E CS:107 A3 04 00 CB -D DS:0 13C6:0000 23 01 25 00 00 9A 2A 2A-2A F0 F5 02 2C 10 2E 03 #.%...***...,... 13C6:0010 2C 10 BD 02 2C 10 B1 0D-01 03 01 00 02 FF FF FF ,...,........... 13C6:0020 FF FF FF FF FF FF FF FF-FF FF FF FF EF 0F 64 00 ..............d. 13C6:0030 61 13 14 00 18 00 C7 13-FF FF FF FF 00 00 00 00 a............... 13C6:0040 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 13C6:0050 CD 21 CB 00 00 00 00 00-00 00 00 00 00 20 20 20 .!........... 13C6:0060 20 20 20 20 20 20 20 20 00 00 00 00 00 20 20 20 ..... 13C6:0070 20 20 20 20 20 20 20 20-00 00 00 00 00 00 00 00 ........ -R AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0100 NV UP EI PL NZ NA PO NC 13C6:0100 A10000 MOV AX,[0000] DS:0000=0123 -T AX=0123 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0103 NV UP EI PL NZ NA PO NC 13C6:0103 03060200 ADD AX,[0002] DS:0002=0025 -T AX=0148 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0107 NV UP EI PL NZ NA PE NC 13C6:0107 A30400 MOV [0004],AX DS:0004=9A00 -T AX=0148 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000 DS=13C6 ES=13C6 SS=13C6 CS=13C6 IP=0108 NV UP EI PL NZ NA PO NC 13C6:010A CB RETF -D DS:0 13C6:0000 23 01 25 00 00 9A 2A 2A-2A F0 F5 02 2C 10 2E 03 #.%...***...,... 13C6:0010 2C 10 BD 02 2C 10 B1 0D-01 03 01 00 02 FF FF FF ,...,........... 13C6:0020 FF FF FF FF FF FF FF FF-FF FF FF FF EF 0F 64 00 ..............d. 13C6:0030 61 13 14 00 18 00 C7 13-FF FF FF FF 00 00 00 00 a............... 13C6:0040 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 13C6:0050 CD 21 CB 00 00 00 00 00-00 00 00 00 00 20 20 20 .!........... 13C6:0060 20 20 20 20 20 20 20 20 00 00 00 00 00 20 20 20 ..... 13C6:0070 20 20 20 20 20 20 20 20-00 00 00 00 00 00 00 00 ........ -Q CODESG SEGMENT PARA 'CODE' BEGIN PROC FAR 1. ASSUME CS:CODESG,DS:DATASG,SS:STACKG 2. PUSH DS ; DS 3. SUB AX,AX ; AX PUSH AX ; IBM PC. . 15 4. MOV AX,DATASG ; MOV DS,AX ; DATASG DS . . . 5. RET ; DOS BEGIN ENDP CODESG ENDS END BEGIN page 60,132 TITLE EXASM1 (EXE) ;------------------------------------------------ STACKSG SEGMENT PARA SACK 'Stack' DB 12 DUP('STACKSEG') STACKSG ENDS ;------------------------------------------------ CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME SS:STACKSG,CS:CODESG,DS:NOTHING PUSH DS ; DS SUB AX,AX ; PUSH AX ; MOV AX,0123H ; .0123 AX ADD AX,0025H ; .25 AX MOV BX,AX ; AX BX ADD BX,AX ; BX AX MOV CX,BX ; BX CX SUB CX,AX ; AX CX SUB AX,AX ; AX NOP RET ; DOS BEGIN ENDP ; CODESG ENDS ; END BEGIN ; IBM PC. . 16 1 page 60,132 2 TITLE EXASM1 (EXE) 3 ;------------------------------------------------ 4 0000 STACKSG SEGMENT PARA SACK 'Stack' 5 0000 0C [ DB 12 DUP('STACKSEG') 6 53 54 41 43 7 4B 53 45 47 8 ] 9 10 0060 STACKSG ENDS 11 ;------------------------------------------------- 12 0000 CODESG SEGMENT PARA 'Code' 13 0000 BEGIN PROC FAR 14 ASSUME SS:STACKSG,CS:CODESG,DS:NOTHING 15 0000 1E PUSH DS ; DS 16 0001 2B C0 SUB AX,AX ; 17 0003 50 PUSH AX ; 18 19 0004 B8 0123 MOV AX,0123H ; .0123 AX 20 0007 05 0025 ADD AX,0025H ; .25 AX 21 000A 8B D8 MOV BX,AX ; AX BX 22 000C 03 D8 ADD BX,AX ; BX AX 23 000E 8B CB MOV CX,BX ; BX CX 24 0010 2B C8 SUB CX,AX ; AX CX 25 0012 2B C0 SUB AX,AX ; AX 26 0014 90 NOP 27 0015 CB RET ; DOS 28 0016 BEGIN ENDP ; 29 30 0016 CODESG ENDS ; 31 END BEGIN ; -------------------------------------------------------------------------- Segments and Groups: N a m e Size Align Combine Class CODESG . . . . . . . . . . . . 0016 PARA NONE 'CODE' STACKSG. . . . . . . . . . . . 0060 PARA STACK 'STACK' Symbols: N a m e Type Value Attr BEGIN. . . . . . . . . . . . . F PROC 0000 CODESG Length=0016 -------------------------------------------------------------------------- IBM PC. . 17 1 page 60,132 2 TITLE EXASM2 (EXE) 3 ;--------------------------------------------------- 4 0000 STACKSG SEGMENT PARA SACK 'Stack' 5 0000 20 [ DB 32 DUP(?) 6 ???? 7 ] 8 9 0040 STACKSG ENDS 10 ;--------------------------------------------------- 11 0000 DATASG SEGMENT PARA 'Data' 12 0000 00FA FLDA DW 250 13 0002 007D FLDB DW 125 14 0004 ???? FLDC DW ? 15 0006 DATASG ENDS 16 ;--------------------------------------------------- 17 0000 CODESG SEGMENT PARA 'Code' 18 0000 BEGIN PROC FAR 19 ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:NOTHING 20 0000 1E PUSH DS ; DS 21 0001 2B C0 SUB AX,AX ; 22 0003 50 PUSH AX ; 23 0004 B8 ---- R MOV AX,DATASG ; DATASG 24 0007 8E D8 MOV DS,AX ; DS 25 26 0009 A1 0000 R MOV AX,FLDA ; 0250 AX 27 000C 03 06 0002 R ADD AX,FLDB ; 0125 AX 28 0010 A3 0004 R MOV FLDC,AX ; FLDC 29 0013 CB RET ; DOS 30 0014 BEGIN ENDP 31 0014 CODESG ENDS END BEGIN ---------------------------------------------------------------------------- Segments and Groups: N a m e Size Align Combine Class CODESG . . . . . . . . . . . . 0014 PARA NONE 'CODE' DATASG . . . . . . . . . . . . 0006 PARA NONE 'DATA' STACKSG. . . . . . . . . . . . 0040 PARA STACK 'STACK' Symbols: N a m e Type Value Attr BEGIN. . . . . . . . . . . . . F PROC 0000 CODESG Length=0014 FLDA . . . . . . . . . . . . . L WORD 0000 DATASG FLDB . . . . . . . . . . . . . L WORD 0002 DATASG FLDC . . . . . . . . . . . . . L WORD 0004 DATASG ---------------------------------------------------------------------------- IBM PC. . 18 EXASM2 (EXE) Symbol Cross Reference (# is definition) Cref-1 BEGIN. . . . . . . . . . . . 18# 30 32 CODE . . . . . . . . . . . . 17 CODESG . . . . . . . . . . . 17# 19 31 DATA . . . . . . . . . . . . 11 DATASG . . . . . . . . . . . 11# 15 19 23 FLDA . . . . . . . . . . . . 12# 26 FLDB . . . . . . . . . . . . 13# 27 FLDC . . . . . . . . . . . . 14# 28 STACK. . . . . . . . . . . . 4 STACKSG. . . . . . . . . . . 4# 9 19 10 Symbols IBM PC. . 19 page 60,132 TITLE EXDEF (EXE) 0000 DATASG SEGMENT PARA 'Data' ; - DB: ; ---------------------- 0000 ?? FLD1DB DB ? ; 0001 50 65 72 73 6F 6E FLD2DB DB 'Personal Computer' ;. 61 6C 20 43 6F 6D 70 75 74 65 72 0012 20 FLD3DB DB 32 ; 0013 20 FLD4DB DB 20H ;. 0014 59 FLD5DB DB 01011001B ; 0015 01 4A 41 4E 02 46 FLD6DB DB 01,'JAN',02,'FEB',03,'MAR' ; 45 42 03 4D 41 52 0021 33 32 36 35 34 FLD7DB DB '32654' ; 0026 0A [ 00 ] FLD8DB DB 10 DUP(0) ; ; - DW: ; ---------------------- 0030 FFF0 FLD1DW DW 0FFF0H ;. 0032 0059 FLD2DW DW 01011001B ; 0034 0021 R FLD3DW DW FLD7DB ; 0036 0003 0004 0007 FLD4DW DW 3,4,7,8,9 ; 0008 0009 0040 05 [ 0000 ] FLD5DW DW 5 DUP(0) ; ; - DD: ; ------------------------------- 004A ???????? FLD1DD DD ? ; 004E 43 50 00 00 FLD2DD DD 'PC' ; 0052 3C 7F 00 00 FLD3DD DD 32572 ; 0056 11 00 00 00 FLD4DD DD FLD3DB - FLD2DB ; 005A 0E 00 00 00 31 00 FLD5DD DD 14,49 ; 00 00 ; - DQ: ; ------------------------------------ 0062 ???????????????? FLD1DQ DQ ? ; 006A 47 4D 00 00 00 00 FLD2DQ DQ 04D47H ;. 00 00 0072 3C 7F 00 00 00 00 FLD3DQ DQ 32572 ;. 00 00 ; - DT: ; ---------------------------- 007A ?????????????????? FLD1DT DT ? ; ?? 0084 43 50 00 00 00 00 FLD2DT DT 'PC' ; 00 00 00 00 008E DATASG ENDS END ----------------------------------------------------------------------------- IBM PC. . 20 Segments and Groups: N a m e Size Align Combine Class DATASG . . . . . . . . . . . . 008E PARA NONE 'DATA' Symbols: N a m e Type Value Attr FLD1DB . . . . . . . . . . . . L BYTE 0000 DATASG FLD1DD . . . . . . . . . . . . L DWORD 004A DATASG FLD1DQ . . . . . . . . . . . . L QWORD 0062 DATASG FLD1DT . . . . . . . . . . . . L TBYTE 007A DATASG FLD1DW . . . . . . . . . . . . L WORD 0030 DATASG FLD2DB . . . . . . . . . . . . L BYTE 0001 DATASG FLD2DD . . . . . . . . . . . . L DWORD 004E DATASG FLD2DQ . . . . . . . . . . . . L QWORD 006A DATASG FLD2DT . . . . . . . . . . . . L TBYTE 0084 DATASG FLD2DW . . . . . . . . . . . . L WORD 0032 DATASG FLD3DB . . . . . . . . . . . . L BYTE 0012 DATASG FLD3DD . . . . . . . . . . . . L DWORD 0052 DATASG FLD3DQ . . . . . . . . . . . . L QWORD 0072 DATASG FLD3DW . . . . . . . . . . . . L WORD 0034 DATASG FLD4DB . . . . . . . . . . . . L BYTE 0013 DATASG FLD4DD . . . . . . . . . . . . L DWORD 0056 DATASG FLD4DW . . . . . . . . . . . . L WORD 0036 DATASG FLD5DB . . . . . . . . . . . . L BYTE 0014 DATASG FLD5DD . . . . . . . . . . . . L DWORD 005A DATASG FLD5DW . . . . . . . . . . . . L WORD 0040 DATASG Length =0005 FLD6DB . . . . . . . . . . . . L BYTE 0015 DATASG FLD7DB . . . . . . . . . . . . L BYTE 0021 DATASG FLD8DB . . . . . . . . . . . . L BYTE 0026 DATASG Length =000A ------------------------------------------------------------------------------- IBM PC. . 21 D:\ D>DEBUG D:EXDEF.EXE -D 1421:0000 00 50 65 72 73 6F 6E 61-6C 20 43 6F 6D 70 75 74 .Personal Comput 1421:0010 65 72 20 20 59 01 4A 41-4E 02 46 45 42 03 4D 41 er Y.JAN.FEB.MA 1421:0020 52 33 32 36 35 34 00 00-00 00 00 00 00 00 00 00 R32654.......... 1421:0030 F0 FF 59 00 21 00 03 00-04 00 07 00 08 00 09 00 ..Y.!........... 1421:0040 00 00 00 00 00 00 00 00-00 00 00 00 00 00 43 50 ..............CP 1421:0050 00 00 3C 7F 00 00 11 00-00 00 0E 00 00 00 31 00 ..<...........1. 1421:0060 00 00 00 00 00 00 00 00-00 00 47 4D 00 00 00 00 ..........GM.... 1421:0070 00 00 3C 7F 00 00 00 00-00 00 00 00 00 00 00 00 ..<............. -D 1421:0080 00 00 00 00 43 50 00 00-00 00 00 00 00 00 33 33 ....CP........33 1421:0090 3E 36 33 33 73 00 00 00-0A 0E 00 00 3E 63 63 30 >633s.......>cc0 1421:00A0 1C 06 63 63 3E 00 00 00-0A 0E 00 00 FF DB 99 18 ..cc>........... 1421:00B0 18 18 18 18 3C 00 00 00-0A 0E 00 00 63 63 63 63 ....<.......cccc 1421:00C0 63 63 63 63 3E 00 00 00-0A 0E 00 00 C3 C3 C3 C3 cccc>........... 1421:00D0 C3 C3 66 3C 18 00 00 00-0A 0E 00 00 C3 C3 C3 C3 ..f<............ 1421:00E0 DB DB FF 66 66 00 00 00-0A 0E 00 00 C3 C3 66 3C ...ff.........f< 1421:00F0 18 3C 66 C3 C3 00 00 00-0A 0E 00 00 C3 C3 C3 66 .<f............f -Q IBM PC. . 22 page 60,132 TITLE EXIMM (EXE) ; ( , ; ) 0000 DATASG SEGMENT PARA 'Data' 0000 ?? FLD1 DB ? 0001 ???? FLD2 DW ? 0003 DATASG ENDS 0000 CODESG SEGMENT PARA 'Code' 0000 BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG ; : ; ------------------------------ 0000 BB 0113 MOV BX,275 ; 0003 3C 19 CMP AL,H ; ; : ; ----------------------- 0005 14 05 ADC AL,5 ; 0007 80 C7 0C ADD BH,12 ; 000A 1C 05 SBB AL,5 ; 000C 80 2E 000 R 05 SUB FLD1,5 ; ; ( 1 ): ; --------------------------------- 0011 D0 D3 RCL BL,1 ; 0013 D0 DC RCR AH,1 ; 0015 D1 06 0001 R ROL FID2,1 ; 0019 D0 C8 ROR AL,1 ; 001B D1 E1 SAL CX,1 ; 001D D1 FB SAR BX,1 ;. 001F D0 2E 0000 R SHR FLD1,1 ; ; : ; ------------------- 0023 24 2C AND AL,00101100B ;AND () 0025 80 CF 2A OR BH,2AH ;OR () 0028 F6 C3 7A TEST BL,7AH ;TEST () 002B 80 36 0000 R 23 OR FLD1,23H ;XOR () 0030 BEGIN ENDP 0030 CODESG ENDS END IBM PC. . 23 page 60,132 TITLE XCOM1 COM- CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:CODESG ORG 100H ; PSP BEGIN: JMP MAIN ; ; --------------------------------------------------- FLDA DW 250 ; FLDB DW 125 FLDC DW ? ; --------------------------------------------------- MAIN PROC NEAR MOV AX,FLDA ; 0250 AX ADD AX,FLDB ; 0125 AX MOV FLDC,AX ; FLDC RET ; DOS MAIN ENDP CODESG ENDS END BEGIN page 60,132 TITLE EXJUMP (COM) JMP 0000 CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG 0100 ORG 100H 0100 MAIN PROC NEAR 0100 B8 0001 MOV AX,01 ; AX, 0103 BB 0001 MOV BX,01 ; BX, 0106 B9 0001 MOV CX,01 ; CX 0109 A20: 0109 05 0001 ADD AX,01 ; 01 AX 010C 03 D8 ADD BX,AX ; 01 BX 010E D1 E1 SHL CX,1 ; CX 0110 EB F7 JMP A20 ; A20 0112 MAIN ENDP 0112 CODESG ENDS END MAIN IBM PC. . 24 page 60,132 TITLE EXLOOP (COM) LOOP 0000 CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG 0100 ORG 100H 0100 BEGIN PROC NEAR 0100 B8 0001 MOV AX,01 ; AX, 0103 BB 0001 MOV BX,01 ; BX, 0106 BA 0001 MOV DX,01 ; DX 0109 B9 000A MOV CX,10 ; 010C A20: 010C 40 INC AX ; 01 AX 010D 03 D8 ADD BX,AX ; AX BX 010F D1 E2 SHL DX,1 ; DX 0111 E2 F9 LOOP A20 ; CX ; , 0113 C3 RET ; 0114 BEGIN ENDP 0114 CODESG ENDS END BEGIN +-------------------------+ | CODESG SEGMENT PARA | +-------------------------+ | BEGIN PROC FAR | | . | | . | | CALL B10 | | CALL C10 | | RET | | BEGIN ENDP | +-------------------------+ | B10 PROC NEAR | | . | | . | | RET | | B10 ENDP | +-------------------------+ | C10 PROC NEAR | | . | | . | | RET | | C10 ENDP | +-------------------------+ | CODESG ENDS | | END BEGIN | +-------------------------+ IBM PC. . 25 TITLE CALLPROC (EXE) 0000 STACKSG SEGMENT PARA STACK 'Stack' 0000 20 [ ???? ] DW 32 DUP(?) 0040 STACKG ENDS 0000 CODESG SEGMENT PARA 'Code' 0000 BEGIN PROC FAR ASSUME CS:CODESG,SS:STACKSG 0000 1E PUSH DS 0001 2B C0 SUB AX,AX 0003 50 PUSH AX 0004 E8 0008 R CALL B10 ; B10 ; ... 0007 CB RET ; 0008 BEGIN ENDP ;-------------------------------------- 0008 B10 PROC 0008 E8 000C R CALL C10 ; C10 ; ... 000B C3 RET ; 000C B10 ENDP ; ;---------------------------------------------- 000C C10 PROC ; ... 000C C3 RET ; 000D C10 ENDP ; ;---------------------------------------------- 000D CODESG ENDS END BEGIN IBM PC. . 26 page 65,132 TITLE EXMOVE (EXE) ;------------------------------------------------------ STACKSG SEGMENT PARA STACK 'Stack' DW 32 DUP(?) STACKSG ENDS ;------------------------------------------------------ DATASG SEGMENT PARA 'Data' NAME1 DB 'ABCDEFGHI' NAME2 DB 'JKLMNOPQR' NAME3 DB 'STUVWXYZ*' DATASG ENDS ;------------------------------------------------------- CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASG PUSH DS SUB AX,AX PUSH AX MOV AX,DATASG MOV DS,AX MOV ES,AX CALL B10MOVE ; JUMP CALL C10MOVE ; CALL RET ; BEGIN ENDP ; (JUMP-), ; : ; ----------------------------------------- B10MOVE PROC LEA SI,NAME1 ; LEA DI,NAME2 ; NAME1 NAME2 MOV CX,09 ; 9 B20: MOV AL,[SI] ; NAME1 MOV [DI],AL ; NAME2 INC SI ; NAME1 INC DI ; NAME2 DEC CX ; JNZ B20 ; > 0? - RET ; = 0, B10MOVE ENDP ; ; (LOOP-), ; LOOP: ; -----------------------------------------; C10MOVE PROC LEA SI,NAME2 ; LEA DI,NAME3 ; NAME2 NAME3 MOV CX,09 ; 9 C20 IBM PC. . 27 MOV AL,[SI] ; NAME2 MOV [DI],AL ; NAME3 INC DI ; NAME2 INC SI ; NAME3 LOOP C20 ; , ; , RET ; = 0, C10MOVE ENDP ; CODESG ENDS END BEGIN TITLE CASE (COM) 0000 CODESG SEGMENT PARA 'CODE' ASSUME CS:CODESG,DS:CODESG,SS:CODESG 0001 ORG 100H 0001 EB 1C 90 BEGIN: JMP MAIN ; ------------------------------------------- 0003 43 68 61 6E 67 65 TITLEX DB 'Change to uppercase letters' 20 74 6F 20 75 70 70 65 72 63 61 73 65 20 6C 65 74 74 65 72 73 ; ------------------------------------------- 011E MAIN PROC NEAR 011E 8D 1E 0104 R LEA BX,TITLEX+1 ; 0122 B9 001F MOV CX,31 ; 0125 B20: 0125 8A 27 MOV AH,[BX] ; TITLEX 0127 80 FC 61 CMP AH,61H ; 012A 72 0A JB B30 ; 012C 80 FC 7A CMP AH,7AH ; 012F 77 05 JA B30 ; ? 0131 80 E4 DF AND AH,11011111B ; - 0134 88 27 MOV [BX],AH ; TITLEX 0136 B30: 0136 43 INC BX ; 0137 E2 EC LOOP B20 ; 31 0139 C3 RET 013A MAIN ENDP 013A CODESG ENDS END BEGIN IBM PC. . 28 page 60,132 TITLE ALLASC (COM) ASCII- 00-FF CODESC SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG,ES:NOTHING ORG 100H BEGIN: JMP SHORT MAIN CTR DB 00,'S' ; : ; ------------------ MAIN PROC NEAR CALL B10CDR ; CALL C10SET ; CALL D10DISP ; RET MAIN ENDP ; : ; -------------- B10CLR PROC MOV AX,0600H MOV BH,07 MOV CX,0000 ; MOV DX,184FH ; INT 10H RET B10CLR ENDP ; 00,00: ; ------------------------- C10SET PROC MOV AN,02 MOV BN,00 MOV DX,0000 INT 10H RET C10SET ENDP ; ASCII : ; ----------------------------- D10DISP PROC MOV CX,256 ;256 LEA DX,CTR ; D20 MOV AH,09 ; INT 21H INC CTR ; LOOP D20 ; CX, ; , RET ; D10DISP ENDP CODESG ENDS END BEGIN IBM PC. . 29 page 60,132 TITLE CTRNAME (EXE) ;-------------------------------------------------------- STSCKSG SEGMENT PARA STACK 'Stack' DW 32 DUP(?) STACKSG ENDS ;-------------------------------------------------------- DATASG SEGMENT PARA 'Data' NAMEPAR LABEL BYTE ; : MAXNLEN DB 20 ; . NAMELEN DB ? ; NAMEFLD DB 20 DUP(' '),'$' ; ; PRIMPT DB 'Name? ', '$' DATASG ENDS ;-------------------------------------------------------- CODESG SEGMENT PARA 'Code" BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASC PUSH DS SUB AX,AX PUCH AX MOV AX,DATASC MOV DS,AX MOV ES,AX CALL Q10CLR ; A20LOOP: MOV DX,0000 ; 00,00 CALL Q20CURS CALL B10PRMP ; CALL D10INPT ; CALL Q10CLR ; CMP NAMELEN,00 ; ? JE A30 ; - CALL E10CODE ; ; '$' CALL F10CENT ; JMP A20LOOP A30: RET ; DOS BEGIN ENDP ; : ; -------------------- B10PRMP PROC NEAR MUV AN,09 ; LEA DX,PROMPT INT 21H RET B10PRMP ENDP ; : ; ----------------------- D10INPT PROC NEAR IBM PC. . 30 MOV AN,0AN ; LEA DX,NAMEPAR INT 21H RET D10INPT ENDP ; '$': ; ------------------------------------ E10CODE PROC NEAR MOV BN,00 ; Return (0D) MOV BL,NAMELEN ; . (07) MOV NAMEFLD[BX],07 MOV NAMEFLD[BX+1],'$' ; RET E10CODE ENDP ; : ; ------------------------------------ F10CENT PROC NEAR MOV DL,NAMELEN ; : SHR DL,1 ; 2, NEG DL ; , ADD DL,40 ; 40 MOV DH,12 ; CALL Q20CURS ; MOV AN,09 LEA DX,NAMEFLD ; INT 21H RET F10CENT ENDP ; : ; -------------- Q10CLR PROC NEAR MOV AX,0600H ; MOV BH,30 ; (07 /) MOV CX,0000 ; 00,00 MOV DX,184FH ; 24,79 INT 10H ; BIOS RET Q10CLR ; (/): ; ---------------------------------- Q20CURS PROC NEAR ;DX MOV AH,02 ; MOV BH,00 ; #0 INT 10H ; BIOS RET Q20CURS ENDP CODESG ENDS END BEGIN IBM PC. . 31 page 60,132 TITLE NMSCROLL (EXE) , , ; ------------------------------------------------------- STACKSG SEGMENT PARA STACK 'Stack' DW 32 DUP(?) STACKSG SEGMENT PARA STACK 'Stack' DW 32 DUP(?) STACKG ENDS ; ------------------------------------------------------- DATASG SEGMENT PARA 'Data' NAMEPAR LABEL BYTE ; : MAXNLEN DB 20 ; . ACTNLEN DB ? ; NAMEFLD DB 20 DUP(' ') ; COL DB 00 COUNT DB ? PROMPT DB 'Name? ' ROW DB 00 DATASG ENDS ; ------------------------------------------------------- CODESG SEGMENT PARA 'Code' BEGIN PROC FAR ASSUME CS:CODESG,DS:DATASG,SS:STACKSG,ES:DATASG PUSH DS SUB AX,AX PUSH DS MOV AX,DATASG MOV ES,AX MOV AX,0600H CALL Q10CLR ; A20LOOP: MOV COL,00 ; 0 CALL Q20CURS CALL B10PRMP ; CALL D10INPT ; CMP ACTNLEN,00 ; ? (.. ) JNE A30 MOV AX,0600H CALL Q10CLR ; , , RET ; A30: CALL E10NAME ; JMP A20LOOP BEGIN ENDP ; : ; -------------------- B10PRMP PROC NEAR LEA SI,PROMPT ; MOV COUNT,05 B20: MOV BL,70H ; IBM PC. . 32 CALL F10DISP ; INC SI ; INC COL ; CALL Q20CURS DEC COUNT ; JNZ B20 ; n RET B10PRMP ENDP ; : ; ---------------------- D10INPT PROC NEAR MOV AN,0AH LEA DX,NAMEPAR INT 21H RET D10INPT ENDP ; : ; ---------------------------------- E10NAME PROC NEAR LEA SI,NAMEFLD ; MOV COL,40 ; E20: CALL Q20CURS ; MOV BL,0FOH ; CALL F10DISP ; INS SI ; INS COL ; DES ACTNLEN ; JNZ E20 ; n CMP ROW,20 ; ? JAE E30 ; INC ROW RET E30: MOV AX,0601H ; -- CALL Q10CLR ; RET E10NAME ENDP ; : ; ---------------------- F10DISP PROC NEAR ;BL () MOV AN,09 ; MOV AL,[SI] ; MOV BH,00 ; MOV CX,01 ; INT 10H ; BIOS RET F10DISP ENDP ; : ; -------------- Q10CLR PROC NEAR ;AX MOV BH,07 ; / MOV CX 0000 MOV DX,184FH IBM PC. . 33 INT 10H ; BIOS RET Q10CLR ENDP ; (/): ; ---------------------------------- Q20CURS PROC NEAR MOV AN,02 MOV BH,00 MOV DH,ROW MOV DL,COL INT 10H RET Q20CURS ENDP CODESG ENDS END BEGIN - Alt/A Alt/Z 1E - 2C F1 F10 3B - 44 Home 47 48 PgUp 49 4B 4D End 4F 50 PgDn 51 Ins 52 Del 53 IBM PC. . 34 TITLE GRAPHIX (COM) CODESG SEGMENT PARA 'Code' ASSUME CS:CODESG,DS:CODESG,SS:CODESG ORG 100H MAIN PROC NEAR MOV AN,00 ; MOV AL,0DH ; EGA (CGA=04) MOV AH,0BH ; MOV BH,00 ; MOV BL,02 ; INT 10H MOV BX,00 ; , MOV CX,00 ; MOV DX,00 ; A50: MOV AH,0CH ; MOV AL,BL ; INT 10H ;BX, CX, DX INC CX ; CMP CX,320 ; 320? JNE A50 ; - , MOV CX,00 ; - INS BL ; INS DX ; CMP DX,40 ; 40? JNE A50 ; - , RET ; - MAIN ENDP CODESG ENDS END MAIN