,   

5.

| |

5.9. 

, , , temp.asm. tasm.exe temp.obj. , tlink.exe, temp.obj temp.exe ( temp.com). temp.obj, :

tasm.exe temp. asm ( : tasm temp)

ENTER. tasm.exe temp.asm , , , ( ). temp.obj, .

. EXE- :

tlink.exe temp.obj ( tlink temp),

COM-:

tlink.exe temp.obj /t ( tlink temp /t).

bat-, . tlink.exe . , tlink.exe .

.

code segment ; ( 1)

assume cs:code, ds:code ; ( 2)

; org 100h

start: ; ( 4)

jmp begin ; ( 5)

mad db 100, 99, 98, ; ( 7) ; 98

db 97, 96 ; ( 8)

nic dw 380 ; ( 10)

begin ; ( 12) ; begin

mov ah. 7 ; ( 14) ;

mov al, nic ; ( 15) ;

int21h ; ( 16)

mov si, offset madd ; ( 17) ;

mov [si+3], 5 ; ( 18) ;

mov ah, 4ch

int 21h

code ends

end start

, ( COM-) temp.asm. , . , , . temp.bat:

tasm temp

tlink temp /t

. :

Assembling file: temp.ASM

**Error** temp.ASM(5) Undefined symbol: BEGIN

*Warning* temp.ASM(7) Missing operand - trailing ? assumed

**Error** temp.ASM(12) Illegal instruction

**Error** temp.ASM(14) Too few operands to instruction

**Error** temp.ASM(15) Operand types do not match

**Error** temp.ASM(16) Illegal instruction

**Error** temp.ASM(17) Undefined symbol: MADD

*Warning* temp.ASM(18) Argument needs type override

Error messages: 6

Warning messages: 2

Passes: 1

Remaining memory: 381k

D:\MY_DIR\ASSEMBL>d:\my_dir\assembl\tlink temp /t

Turbo Link Version 7.00 Copyright (c) 1987, 1994 Borland International

Fatal: Unable to open file 'temp.obj'.

, , . . ERROR , , WARNING , ( !) . - , tlink .

, :

code segment ; ( 1)

assume cs:code, ds:code ; ( 2)

; org 100h

start: ; ( 4)

jmp begin ; ( 5)

mad db 100, 99, 98 ; ( 7)

db 97, 96 ; ( 8)

nic dw 380 ; ( 10)

begin: ; ( 12)

mov ah, 7 ; ( 14)

mov al, byte ptr nic ; ( 15)

int 21h ; ( 16)

mov si, offset mad ; ( 17)

mov byte ptr [si+3], 5 ; ( 18)

mov ah, 4ch

int 21h

code ends

end start

bat-. :

Assembling file: temp.ASM

Error messages: None

Warning messages: None

Passes: 1

Remaining memory: 381k

D:\MY_DIR\ASSEMBL>d:\my_dir\assembl\tlink temp /t

Turbo Link Version 7.00 Copyright (c) 1987, 1994 Borland International

Fatal: Cannot generate COM file : invalid initial entry point address.

tasm , tlink -. ( org 100h), :

Assembling file: temp.ASM

Error messages: None

Warning messages: None

Passes: 1

Remaining memory: 381k

D:\MY_DIR\ASSEMBL>d:\my_dir\assembl\tlink temp /t

Turbo Link Version 7.00 Copyright (c) 1987, 1994 Borland International

- .

, : HELLO, WORLD! , .

, :

-  ( );

-  , ;

-  ( );

-  . b (blue), g (green) r (red), , . ESC, .

:

; -

code segment

assume cs:code, ds:code

org 100h

start:

jmp begin

message db 'HELLO, WORLD!' ; , ;

attributes db 70h ; ;: , ‑ ;

curs_x db 35 ; ( )

curs_y db 12 ; Y ( )

begin:

;

mov ch, 0 ; Y

; ( )

mov cl, 0 ; ; ( )

mov dh, 24 ; Y ; ( )

mov dl, 79 ; ; ( )

mov al, 0 ; (.., ; )

mov bh, 70h ; ( )

mov ah, 6 ;

int 10h

m4:

;

mov di, 13 ; 13

mov si, offset message ; si ;

m1:

;

mov dh, curs_y ; dh

mov dl, curs_x ; dl

mov bh, 0 ; bh ( ; 0)

mov ah, 2 ;

int 10h ; .

;

mov ah, 9 ;

mov bl, attributes ;

mov cx, 1 ; ;( )

mov al, [si] ; al ( ; )

int 10h

inc si ; si

inc curs_x ; ; ;

dec di ; di

jnz m1 ; di ,

;

;

mov curs_x, 35 ;

;

mov ah, 0 ;

int 16h ; .

; , -

; ah, ASCII- al.

cmp al, 1bh ; ESC? (1bh - ASCII- ESC)

je exit ; , , -

;

cmp al, 'r' ; r?

jne m2 ; ‑

mov attributes, 74h ; ‑

jmp m4 ;

; , ; ; ; 蠠

m2:

cmp al, 'g' ;

jne m3

mov attributes, 72h

jmp m4

m3:

cmp al, 'b'

jne m4 ; ,

;

mov attributes, 71h

jmp m4

; . , ; ESC

exit:

mov ah, 4ch

int 21h

code ends

end start.

, . , , , EXE-:

stack segment stack

db 100 dup (0)

stack ends

data segment

message db 'HELLO, WORLD!$' ; , ;

;

attributes db 70h ;

;

data ends

code segment

assume cs:code, ds:data

start:

mov ax, data

mov ds, ax ;

m4:

mov ch, 0 ; Y

; ( )

mov cl, 0 ;

; ( )

mov dh, 24 ; Y

; ( )

mov dl, 79 ;

; ( )

mov al, 0 ; (..

; )

mov bh, attributes ;

mov ah, 6 ;

int 10h

;

mov dh, 12 ; dh

mov dl, 35 ; dl

mov bh, 0 ; bh ( ; 0)

mov ah, 2 ;

int 10h ;

mov ah, 9 ;

mov dx, offset message ; dx

;

int 21h ;

mov ah, 0 ;

int 16h ;

;. , ;- ah, ASCII- al.

cmp al, 1bh ; ESC? (1bh ‑ ASCII-

;ESC)

je exit ; , . ‑

;

cmp al, 'r' ; r?

jne m2 ; ‑

mov attributes, 74h ; ‑

jmp m4 ; ,

;

m2:

cmp al, 'g' ;

jne m3

mov attributes, 72h

jmp m4

m3:

cmp al, 'b'

jne m4 ; ,

;

mov attributes, 71h

jmp m4

; . , ; ESC

exit:

mov ah, 4ch

int 21h

code ends

end start

. ( ESC) , , , - . . .


| |

*****

2009-2017 siblec.ru
. , , , , , .