"П.Нортон "Программно-аппаратная организация компьютера IBM PC"" - читать интересную книгу автора

6000
3070 IF (IN.MEMORY.%=TRUE.%) AND (MEMORY.HERE.%=FALSE.%) THEN GOSUB
7000
3080 IN.MEMORY.% = FALSE.%
3090 IF MEMORY.HERE.% THEN IN.MEMORY.HERE.% =TRUE.%
3100 NEXT PARAGRAPH.!
3110 IF IN.MEMORY.% THEN PARAGRAPH.! = 65536 : GOSUB 7000
3999 RETURN
4000 REM
4010 PRINT
4020 PRINT "Finished."
4999 SYSTEM
5000 REM
5010 DEF SEG = PARAGRAPH.!
5020 BYTE0.% = PEEK (0)
5030 BYTE1.% = PEEK (1)
5040 BYTE2.% = PEEK (2)
5050 BYTE3.% = PEEK (3)
5060 CHECK.COUNT.% = 0
5070 IF BYTE0.% = 233 THEN CHECK.COUNT.% = CHECK.COUNT.% + 1
5080 IF BYTE1.% = 233 THEN CHECK.COUNT.% = CHECK.COUNT.% + 1
5090 IF BYTE2.% = 233 THEN CHECK.COUNT.% = CHECK.COUNT.% + 1
5100 IF BYTE3.% = 233 THEN CHECK.COUNT.% = CHECK.COUNT.% + 1
5110 MEMORY.HERE.% = FALSE.%
5120 IF CHECK.COUNT.% <= 3 THEN MEMORY.HERE.% = TRUE.%
5999 RETURN
6000 REM
6010 IN.MEMORY.% = TRUE.%
6020 START.! = PARAGRAPH.!
6999 RETURN

7000 REM
7010 SIZE.! = (PARAGRAPH.!-START.!) * 16
7020 IF SIZE.! < 8 * 1024 THEN 7999 ' SDUPPRESS SMALL-BLOCK FALSE
REPORTS
7030 PRINT "Active memory begins at ",
7040 PRINT HEX$(START.!)
7050 PRINT " ends at ",
7060 PRINT HEX$(PARAGRAPH.!-1);
7070 PRINT SIZE.! / 1024;"K-bytes"; ("SIZE.!;"bytes )"
7080 IN.MEMORY.% = FALSE.%
7090 PRINT
7999 RETURN

9999 REM


Приложение 3.2. Текст программы обработки прерываний (Ассемблер).

beepseg segment 'code'