Assembler


DOS - 4


0154 E6 40 OUT 40H,AL
0156 FB STI
0157 8D 16 28FE R LEA DX,BUFFER_END ;
015B CD 27 INT 27H ;
 
015D 00 TIMER_COUNT DB 0
015E 01EE R BUFFER_HEAD DW BUFFER_START
0160 01EE R BUFFER_TAIL DW BUFFER_START
 
;----- 17h
 
0162 PRINT_HANDLER PROC FAR
ASSUME CS:CODE,DS:nothing,ES:nothing
0162 0A E4 OR AH,AH
0164 74 05 JZ BUFFER_CHARACTER ;
0166 2E: FF 2E 0103 R JMP PRINT_VECTOR ;
; 17h
016B BUFFER_CHARACTER:
016B FB STI
016C 53 PUSH BX
016D 51 PUSH CX
016E 56 PUSH SI
016F 2B C9 SUB CX,CX ;
0171 PRINT_LOOP:
0171 2E: 8B 1E 0160 R MOV BX,BUFFER_TAIL ;
0176 8B F3 MOV SI,BX
0178 E8 01E2 R CALL ADVANCE_POINTER ;
017B 2E: 3B 1E 015E R CMP BX,BUFFER_HEAD ;
0180 74 0E JE BUFFER_FULL ; ,