Decoded: Sopwith (1984) by David L. Clark Source file: _INTS.ASM Beginner friendly, line-by-line code walkthrough by MaiZure _INTS.ASM allows us to enable/disable interrupts from game C code. Apparently inline assembly wasn't possible or not portable when Sopwith was first developed. Original code: http://davidlclark.com/page/sopwith-source-code Original code with line numbers http://www.maizure.org/projects/decoded-sopwith/_INTS_linenum.txt NOTE ON ASSEMBLY IN SOPWITH The original intended assembler for Sopwith code is Microsoft Macro Assembler (MASM), probably version 2 or 3. This is from the days of segmentation so you'll see segment:offset accesses to support near addresses. Know your DOS i/o ports and interrupts (Ask Ralf Brown). The good news is that this old enough that we can work with 20-bit addresses without considering DOS memory extenders (EMS/XMS, etc). 1 COMMENT 2 COMMENT 3 COMMENT 4 COMMENT 5 COMMENT 6 COMMENT 7 COMMENT 8 COMMENT 9 COMMENT 10 COMMENT 11 COMMENT 12 COMMENT 13 COMMENT 14 COMMENT 15 COMMENT 16 COMMENT 17 COMMENT 18 COMMENT 19 COMMENT 20 COMMENT 21 COMMENT 22 BLANK 23 Sets the assembler to use small memory model using C calling conventions. These are passed as arguments to the assembler in the makefile (SW.MAK). Small memory model implies data and stack are in the same 64kb segment. 24 Includes macros provided with MASM 25 BLANK 26 Creates a local code segment, linker will combine upcoming code with other code 27 BLANK 28 Imports @AB variable. (not used) 29 BLANK 30 Function intson - Enables maskable interrupts 31 Function intsoff - Disables maskable interrupts 32 BLANK 33 BLANK 34 Defines procedure for intson, turns on maskable interrupts 35 Turns on interrupts :) 36 Returns to caller 37 BLANK 38 Defines procedure for intson, turns off maskable interrupts 39 Turns off interrupts 40 Returns to caller 41 BLANK 42 End of assembly 43 EOF˙