Assembler







, .
, IBM PC,
. ,
, .
.

,
.
 
- .
. IBM
, ,
.
( *.OBJ), .. .
,
.
, .
.
, .
 

,
, .

-
. .

.
, ,
.
 
,
,
,
. - .
,

DOS. ,
.
 
(. 10.11).
. D
. ,
,
, ,
-.
BIOS
.
, ,
, .
 
. 10.11 .
TIMER,
A - .
TIMER ,
.
TIMER
(HOURS), (MINS), (SECS)
(HSECS). ,
, .
,
.

WRITE FORMAT.

. 8087,
ASCII.
, , ,
8087.
 
$STORAGE=4
INTEGER A,HOURS,MINS,SECS,HSECS
CALL TIMER(A)
HOURS=A/65543
A=A-HOURS*65543
MINS=A/1092
A=A-MINS*1092
SECS=A/18
HSECS=(100*(A-SECS*18))/18
WRITE(*,10)HOURS,MINS,SECS,HSECS
10 FORMAT(1X,'THE TIME IS: ',I2,':',I2,':',I2,'.',I2)
END
 
. 10.11
 
Microsoft (R) Macro Assembler Version 5.00 4/2/89 16:07:35
. 10.12 Page 1-1
 
PAGE ,132
TITLE . 10.12
FRAME STRUC
0000 ???? SAVEBP DW ?
0002 ???????? SAVERET DD ?
0006 ???????? A DD ? ;
000A FRAME ENDS
 
0000 CODE SEGMENT 'CODE'
DGROUP GROUP DATA
ASSUME CS:CODE,DS:DGROUP,ES:DGROUP,SS:DGROUP
0000 TIMER PROC FAR
PUBLIC TIMER ; LINK
; TIMER
0000 55 PUSH BP
0001 8B EC MOV BP,SP ;
0003 B4 00 MOV AH,0
0005 CD 1A INT 1Ah ; BIOS
0007 C4 5E 06 LES BX,[BP].A ;
000A 26: 89 17 MOV ES:[BX],DX ;
000D 26: 89 4F 02 MOV ES:[BX+2],CX ;
0011 5D POP BP
0012 CA 0004 RET 4 ;
0015 TIMER ENDP
0015 CODE ENDS
END
 
. 10.12
. 10.12 -
TIMER.

BIOS.

.
 
.10.13
. ,
,
.
, .
, ,
,
, .
,
.
 
Ĵ
SP> 堠

Ĵ


Ĵ


Ĵ


Ĵ
 
. 10.13
 
TIMER . 10.12 ,
BP . FRAME

BP. LES BX,[BP]+A
ES:BX.
,
.
 
, TIMER
,
. ,
TIMER
PUBLIC. ,
.
,

.