PAGE ,132 TITLE CALCCGROUP GROUP CODESEGCODESEG SEGMENT PARA PUBLIC 'CODE' ASSUME CS:CGROUP,DS:CGROUP,ES:CGROUP PUBLIC CALC ORG 100HCALC PROC FAR JMP START;---------------------------------------------------------------------;; ;; DATA AREA ;; ;;---------------------------------------------------------------------; DB 'INTERRUPT NUMBER ='INT_NUMBER DB 61hSCREEN_HANDLE DW 0001hMESSAGE DB 'PEMATH is not resident',13,10MESSAGE_LEN EQU $-MESSAGETAG DB 'PEMATH'TAG_LEN EQU $-TAG;---------------------------------------------------------------------;; ;; CODE AREA ;; ;;---------------------------------------------------------------------;START:;---------------------------------------------------------------------;; TEST FOR PRESENCE OF CALCULATOR ;;---------------------------------------------------------------------; SUB AX,AX MOV ES,AX SUB BH,BH MOV BL,INT_NUMBER SHL BX,1 SHL BX,1 MOV DI,ES:[BX] MOV ES,ES:[BX+2] ADD DI,4 LEA SI,TAG MOV CX,TAG_LEN REPE CMPSB JE CALL_CALC MOV BX,SCREEN_HANDLE MOV CX,MESSAGE_LEN LEA DX,MESSAGE MOV AH,40h INT 21h JMP SHORT CALC_EXIT;---------------------------------------------------------------------;; CALL CALCULATOR ;;---------------------------------------------------------------------;CALL_CALC: MOV AL,INT_NUMBER MOV BYTE PTR INT_CODE,AL DB 0CDh ; INTINT_CODE: DB 00h NOP NOPCALC_EXIT: INT 20hCALC ENDPCODESEG ENDS END CALC  
|