Interrupt 21 is the MS-DOS general purpose function dispatcher. The only way to know what it is doing is to know what value was placed in the AH register prior to the start of that code snippet.
Without knowing the value in AH, the program could be calling any one of these functions:
00 00 Terminate process
01 01 Character input with echo
02 02 Character output
03 03 Auxiliary input
04 04 Auxiliary output
05 05 Printer output
06 06 Direct console input/output
07 07 Unaltered character input no echo
08 08 Character input without echo
09 09 Display string
0A 10 Buffered keyboard input
0B 11 Check input status
0C 12 Flush input buffer then input
0D 13 Drive reset
0E 14 Select drive
0F 15 Open file
10 16 Close file
11 17 Find first file
12 18 Find next file
13 19 Delete file
14 20 Sequential read
15 21 Sequential write
16 22 Create file
17 23 Rename file
18 24 MSDOS Reserved function ±
19 25 Get current drive
1A 26 Set disc transfer area (DTA) address
1B 27 Get default drive data
1C 28 Get drive data
1D 29 MSDOS Reserved function ±
1E 30 MSDOS Reserved function ±
1F 31 MSDOS Reserved function ±
20 32 MSDOS Reserved function ±
21 33 Random read
22 34 Random write
23 35 Get file size
24 36 Set relative record number
25 37 Set interrupt vector
26 38 Create new PSP
27 39 Random block read
28 40 Random block write
29 41 Parse filename
2A 42 Get date
2B 43 Set date
2C 44 Get time
2D 45 Set time
2E 46 Set verify flag (non-functional in DOS Plus)
2F 47 Get DTA address
30 48 Get DOS version number
31 49 Terminate and stay resident
32 50 Get disc information (undocumented call) §±
33 51 Get or set break flag (non-functional in DOS Plus)
34 52 Find active byte (undocumented call) §±
35 53 Get interrupt vector
36 54 Get drive allocation data
37 55 Set or get DOS switch character
38 56 Get or set country information
39 57 Create directory
3A 58 Delete directory
3B 59 Set current directory
3C 60 Create file
3D 61 Open file
3E 62 Close file
3F 63 Read file or device
40 64 Write file or device
41 65 Delete file
42 66 Set file pointer
43 67 Get or set file attributes
44 68 I/O control
45 69 Duplicate handle
46 70 Redirect handle
47 71 Get current directory
48 72 Allocate memory block
49 73 Release memory block
4A 74 Resize memory block
45 75 Execute program
46 76 Terminate process with return code
4D 77 Get return code
4E 78 Find first file
4F 79 Find next file
50 80 Set address of PSP (undocumented call) §±
51 81 MSDOS Reserved function ±
52 82 MSDOS Reserved function ±
53 83 MSDOS Reserved function ±
54 84 Get verify flag (non-functional in DOS Plus) ±
55 85 MSDOS Reserved function ±
56 86 Rename file (not implemented) ±
57 87 Get or set file date and time stamps (not implemented) ±
58 88 Get or Set allocation strategy (DOS Version 3.0+) ±
59 89 Get extended error information (DOS Version 3.0+) ±
5A 90 Create temporary file (DOS Version 3.0+) ±
5B 91 Create new file (DOS Version 3-0+) ±
5C 92 Lock or unlock file region (DOS Version 3.0+) ±
5D 93 MSDOS Reserved function ±
5E 94 Get machine name/Get or set printer setup (DOS Version 3.1+) ±
5F 95 Device redirection (DOS Version 3.1+) ±
60 96 MSDOS Reserved function ±
61 97 MSDOS Reserved function ±
62 98 Get PSP address (DOS Version 3.0+) ±
63 99 Get lead byte table (DOS Version 2.25 only) ±
64 100 MSDOS Reserved function ±
65 101 Get extended country information (DOS Version 3.3+) ±
66 102 Get or set code page (DOS Version 3.3+) ±
67 103 Set handle count (DOS Version 3.3+) ±
68 104 Commit file (DOS Version 3.3+) ±
E0 224 Call BDOS (See below)
I’ve added a few more comments to make it a bit more readable:
; call MS-DOS general function dispatcher (function code in AH)
; jump if “below” arithmetic flag is set upon return from MS-DOS function
INT 21
JB 0103
; store value in AX register in memory location referenced by pointer
MOV [OBEA], AX
JMP O2B2
JMP 1451 ; this jump is unreachable if this were human-written assembly code.
; it is probably the destination of the jump below instruction after the DOS call above.
; In other words, after the MS-DOS call, either store the return value in AX in a
; particular variable and jump to one location or just jump to another location
; (the second option probably means an error return from the function call)
CS:
; check bit 0 in the memory location referenced by the pointer, and jump if it is not set
TEST BYTE PTR [OC59],01
JZ 0150
CS:
; check bit 1 in the memory location referenced by the pointer, and jump if it is not set
TEST BYTE PTR [OC59], 02
JZ 014F
IRET ; return from interrupt (will be executed if we didn’t jump, i.e. bit 1 is set)
; another MS-DOS function call
INT 21
JB 0103
; check bit 2 in the memory location referenced by the pointer, and jump if it is not set
TEST BYTE PTR [OC59], 04
JZ 0169
CMP AH, 01 ; compare value in AH register against the value 01
JA 014F ; if value in AH register is greater than 01, jump
So as others have pointed out, the code fragment doesn’t really do much