: - twidler.ru
()
- , -
:

: ,
:
: 13.01.2014
: 19
:
:
(0)
: 1897

 

1.   堠

2.  

3.  

    

     젠 ___

    

4.  


, 2 : .

:

     ;

     ;

     ;

().

, , .

: , , , , , ..

: , .

- , .

: . . () . : -, , , , ; -, , .


.

, . , .

, , , . : PARAM , TABLE , MASK , ADD , SUB .. . .

, : (- , , ), - . , ( 1 - 4 ).

-, . . , .

- . , , .

/ ( ) .

:

( ) ;

, ;

;

;

, () .

, . . .

, , , . .

:

Ġ Ġ

, , . , , , . , . , . . .

, , . .

. , .

:

MOV (MOVE) -,

ADD (ADDITION) -

SUB (SUBSTRACT) -

LDA (LOAD DIRECT

ACCUMULATOR) -

INR (INSCREMENT

REGISTER) -

DCR (DECREMENT

REGISTER)

, , .

. , , , , .

, , .

.

, .

.

. , , , . , , . . . . :

1.   .

2.   .

3.   .

4.   .

5.   .

6.   .

7.   (?) 1, 8

8.   .

.

1.                 . .

2.                 .

3.                 . . *.ASM .

4.                 . *.ASM , *.OBJ . . *.LST, , *.CRF. . TASM.EXE (ASM.EXE , MASM.EXE - ). TASM [] *.ASM [,,] - . , . TASM : /ZI /N. : S.

5.                 . . *. *.. TLINK.exe ( LINK.EXE). : / /X.

6.                 (DEBUG).

7.                 ( ) - , .


; ; ;

.MODEL small

.STACK 64

.DATA

;

;____________________________________________________________________

; ASCII-

org 100h

tabl_ascii db '0123456789abcdef'

;____________________________________________________________________

; ASCII- -

org 130h

db 0,1,2,3,4,5,6,7,8,9

org 41h

db 0ah,0bh, 0ch, 0dh, 0eh, 0fh

;____________________________________________________________________

;

org 150h

x_ascii db 20h dup(?)

t1 db 0dh,0ah," Enter"

db 0dh, 0ah, "$"

t2 db 0dh,0ah," ,0dh,0ah "$"

t3 db 0dh, 0ah, " "

db 0dh,0ah,"$"

t4 db 0dh, 0ah, " "

db 0dh, 0ah, "$"

buf db 16 dup(?),"$"

t5 db 0dh,0ah, " ? (Y/N)?"

db 0dh,0ah,"$"

;____________________________________________________________________

 

;

.CODE

;  

g_k proc

mov ax,@data

mov ds, ax

mov es, ax

d: lea dx, t1

mov ah,09h

int 21h

lea di, x_ascii

call ink

call des_2

push ax

lea dx,t3

mov ah,9h

int 21h

pop ax

call bin_dis

push ax

lea dx,t4

mov ah,9h

int 21h

pop ax

call outhex

lea dx,t5

mov ah,9h

int 21h

mov ah,1h

int 21h

cmp al,"Y"

loope d

cmp al,"y"

loop d

mov ah,4ch

int 21h

g_k endp

ink proc

;  

xor cx,cx

l1:

mov ah,1

int 21h

stosb

inc cx

cmp al,0dh

jnz l1

dec cx

ret

ink endp

dis proc

;  

r1: mov dl,[di]

mov ah,2

int 21h

inc di

loop r1

ret

dis endp

des_2 proc

; ()

mov si,10

lea di,x_ascii

sub ax,ax

v1: mul si

mov bp,ax

mov al,[di]

sub al,48

inc di

mov ah,ch

add ax,bp

loop v1

ret

des_2 endp

bin_dis proc

;

lea di,buf

mov cx,16

mov bx,ax

mov dx,ax

conv:

mov al,ch

shl dx,1

adc al,'0'

stosb

loop conv

mov ah,9h

lea dx,buf

int 21h

mov ax,bx

ret

bin_dis endp

; ()

;

outhex:

mov ch,al

mov al,ah

mov ah,2

call prnbh

mov al,ch

prnbh:

mov dh,al

shr al,1

shr al,1

shr al,1

shr al,1

call prnd

mov al,dh

and al,15

prnd:

or al,48

cmp al,58

jc prnc

add al,7

prnc:

mov dl,al

int 33

ret

end g_k

:

:

sub .

: sub < 1>,< 2>

call . , , call

: call < >

ret

shr

xor

: xor < 1>,< 2>

lea

: lea reg,<>

push stack

: push <>

pop stack

: pop <>

mov

: mov <>,<>

inc 1

: inc <>

dec 1

: dec <>

stosb al ax di

loop , (127) cx, - , cx >0, , .

: loop <>

.CODE

.DATA --

.STACK N stack(); ; N stack(a)

: ds : mov ax,@data

mov ds,ax

assume

1.   " IBM PC " 1992.

2.   " IBM MS-DOS" 1991.

3.   .., ., .. , ., , 1987 .

4.   ., . IBM PC, ., ,1993

, :
. , , ,
2 . ,
+ -
,
.

,