Assembler

http://chapurin.kiev.ua/ | http://335855.ru/category/sportivnoe-pitanie/page/9/





IBM ,
,
().
.
,
.
, ,
-.
3BCH 3BEH, 378H
37AH.
 
.
8255,
. ,
8255. IBM
.
8- 3BCH 378H
. ASCII,
, . ,
3BEH 37AH, 5 .
;
. , 0
.
. ,
, ( 0 3BEH 37AH)
1, 0. . 8.15
,
. PRINT
.
, PRINT
(3BCH 379H).
.
, ,
. 7
. 1,
.
. 4

, , .
.
.
Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:05:39
. 8.15 Page 1-1
 
PAGE ,132
TITLE . 8.15
 
0000 STACK SEGMENT STACK
0000 0040[ DW 64 DUP (?)
????
]
0080 STACK ENDS
 
= 0378 BASE EQU 378H
 
0000 CODE SEGMENT
ASSUME CS:CODE
 
0000 94 A8 A3 2E 20 38 2E MSG DB '. 8.15', 13, 10, '$'
31 35 0D 0A 24
000C MAIN PROC FAR
000C 1E PUSH DS ;
000D 2B C0 SUB AX, AX
000F 50 PUSH AX
 
0010 8D 1E 0000 R LEA BX, MSG
0014 PRINT_LOOP:
0014 2E: 8A 07 MOV AL, CS:[BX] ;
0017 3C 24 CMP AL, '$' ; ?
0019 74 06 JE MAIN_RETURN
001B E8 0022 R CALL PRINT ;
001E 43 INC BX
001F EB F3 JMP PRINT_LOOP ;
0021 MAIN_RETURN:
0021 CB RET
0022 MAIN ENDP
 
;----- AL
 
0022 PRINT PROC NEAR
0022 BA 0378 MOV DX, BASE ;
0025 EE OUT DX, AL ;
0026 42 INC DX ;
0027 WAIT_BUSY:
0027 EC IN AL, DX ;
0028 A8 80 TEST AL, 80H ;
002A 74 FB JZ WAIT_BUSY ;
002C 42 INC DX
002D B0 0D MOV AL, 0DH ;
002F EE OUT DX, AL
0030 B0 0C MOV AL, 0CH ;
0032 EE OUT DX, AL
0033 C3 RET
0034 PRINT ENDP
0034 CODE ENDS
END MAIN
 
. 8.15
3BEH ( 37AH)
. ,

8259, 1.
, ..
.
,

(
). ,
.