diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/MODE/DISPLAY.ASM | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/CMD/MODE/DISPLAY.ASM')
| -rw-r--r-- | v4.0/src/CMD/MODE/DISPLAY.ASM | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/v4.0/src/CMD/MODE/DISPLAY.ASM b/v4.0/src/CMD/MODE/DISPLAY.ASM new file mode 100644 index 0000000..870110f --- /dev/null +++ b/v4.0/src/CMD/MODE/DISPLAY.ASM | |||
| @@ -0,0 +1,181 @@ | |||
| 1 | ;m | ||
| 2 | PRINTF_CODE SEGMENT PUBLIC | ||
| 3 | |||
| 4 | ASSUME CS:PRINTF_CODE, DS:PRINTF_CODE, ES:PRINTF_CODE, SS:PRINTF_CODE | ||
| 5 | |||
| 6 | |||
| 7 | ;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» | ||
| 8 | ;º º | ||
| 9 | |||
| 10 | PUBLIC initialize_sublists | ||
| 11 | |||
| 12 | ;º º | ||
| 13 | ;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ P U B L I C S ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ | ||
| 14 | |||
| 15 | ;***************************************************************************** | ||
| 16 | ; External Declarations | ||
| 17 | ;***************************************************************************** | ||
| 18 | ; | ||
| 19 | |||
| 20 | EXTRN first_sublist:BYTE | ||
| 21 | EXTRN number_of_sublists:ABS | ||
| 22 | EXTRN SysDispMsg:Near | ||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | ; | ||
| 30 | ;*************************************************************************** | ||
| 31 | ; Message Structures | ||
| 32 | ;*************************************************************************** | ||
| 33 | ; | ||
| 34 | |||
| 35 | |||
| 36 | Message_Table struc ; ;AN000; | ||
| 37 | ; | ||
| 38 | Entry1 dw 0 ; ;AN000; | ||
| 39 | Entry2 dw 0 ; ;AN000; | ||
| 40 | Entry3 dw 0 ; ;AN000; | ||
| 41 | Entry4 dw 0 ; ;AN000; | ||
| 42 | Entry5 db 0 ; ;AN000; | ||
| 43 | Entry6 db 0 ; ;AN000; | ||
| 44 | Entry7 dw 0 ; ;AN000; | ||
| 45 | ; | ||
| 46 | Message_Table ends ; ;AN000; | ||
| 47 | |||
| 48 | include common.stc ;contains the following structure | ||
| 49 | |||
| 50 | ;sublist_def STRUC | ||
| 51 | |||
| 52 | ; db ? ;Sublist Length, fixed | ||
| 53 | ; db ? ;Reserved, not used yet ;AN000; | ||
| 54 | ; dw ? ;offset | ||
| 55 | ;sublist_seg dw ? ;segment part of pointer to piece of message | ||
| 56 | ; db ? ;ID, special end of message format ;AN000; | ||
| 57 | ; db ? ;flags | ||
| 58 | ; db ? | ||
| 59 | ; db ? | ||
| 60 | ; db ? | ||
| 61 | |||
| 62 | ;sublist_def ENDS | ||
| 63 | |||
| 64 | ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ | ||
| 65 | ;³ | ||
| 66 | ;³ INITIALIZE_SUBLISTS | ||
| 67 | ;³ ------------------- | ||
| 68 | ;³ A .COM file cannot have references to segments in it at EXE2BIN time so | ||
| 69 | ;³ the segment part of pointers to pieces of messages in sublist blocks must | ||
| 70 | ;³ be done at execution time. This routine does that for all sublists. | ||
| 71 | ;³ | ||
| 72 | ;³ | ||
| 73 | ;³ INPUT: | ||
| 74 | ;³ | ||
| 75 | ;³ | ||
| 76 | ;³ | ||
| 77 | ;³ | ||
| 78 | ;³ | ||
| 79 | ;³ | ||
| 80 | ;³ | ||
| 81 | ;³ RETURN: | ||
| 82 | ;³ | ||
| 83 | ;³ | ||
| 84 | ;³ MESSAGES: none | ||
| 85 | ;³ | ||
| 86 | ;³ | ||
| 87 | ;³ | ||
| 88 | ;³ REGISTER | ||
| 89 | ;³ USAGE AND | ||
| 90 | ;³ COMVENTIONS: | ||
| 91 | ;³ | ||
| 92 | ;³ | ||
| 93 | ;³ | ||
| 94 | ;³ ASSUMPTIONS: | ||
| 95 | ;³ | ||
| 96 | ;³ | ||
| 97 | ;³ SIDE EFFECT: | ||
| 98 | ;³ | ||
| 99 | ;³ | ||
| 100 | ;³ ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù | ||
| 101 | ;³ | ||
| 102 | ;³ BEGIN | ||
| 103 | ;³ ³ | ||
| 104 | ;³ END ³ | ||
| 105 | ;³ | ||
| 106 | ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ | ||
| 107 | |||
| 108 | initialize_sublists PROC NEAR ;AN000; | ||
| 109 | |||
| 110 | MOV CX,number_of_sublists ;AN000; | ||
| 111 | MOV SI,OFFSET first_sublist ;address first sublist ;AN000; | ||
| 112 | REPEAT: ;AN000; | ||
| 113 | MOV [SI].sublist_seg,DS ;set up the segment part of the pointer field in the sublist block ;AN000; | ||
| 114 | ADD SI,TYPE sublist_def ;point to next sublist block ;AN000; | ||
| 115 | LOOPNZ repeat ;AN000; | ||
| 116 | ;AN000; | ||
| 117 | RET | ||
| 118 | ;AN000; | ||
| 119 | initialize_sublists ENDP | ||
| 120 | |||
| 121 | ;***************************************************************************** | ||
| 122 | ;PRINTF | ||
| 123 | ;***************************************************************************** | ||
| 124 | ; | ||
| 125 | ;Description: Save all registers, set up registers required for SysDispMsg | ||
| 126 | ; routine. This information is contained in a message description | ||
| 127 | ; table pointed to by the DX register. Call SysDispMsg, then | ||
| 128 | ; restore registers. This routine assumes that the only time an | ||
| 129 | ; error will be returned is if an extended error message was | ||
| 130 | ; requested, so it will ignore error returns | ||
| 131 | ; | ||
| 132 | ;Called Procedures: sysdispmsg | ||
| 133 | ; | ||
| 134 | ;Change History: Created 4/22/87 MT | ||
| 135 | ; | ||
| 136 | ;Input: ES:DX = pointer to message description | ||
| 137 | ; | ||
| 138 | ;Output: None | ||
| 139 | ; | ||
| 140 | ;Psuedocode | ||
| 141 | ;---------- | ||
| 142 | ; | ||
| 143 | ; Save all registers | ||
| 144 | ; Setup registers for SysDispMsg from Message Description Tables | ||
| 145 | ; CALL SysDispMsg | ||
| 146 | ; Restore registers | ||
| 147 | ; ret | ||
| 148 | ;***************************************************************************** | ||
| 149 | |||
| 150 | Public PRINTF | ||
| 151 | PRINTF PROC NEAR ; ;AN000; | ||
| 152 | |||
| 153 | ; push ax | ||
| 154 | ;Save registers ;AN000; | ||
| 155 | push bx ; " " " " ;AN000; | ||
| 156 | push cx ; " " " " ;AN000; | ||
| 157 | push dx ; " " " " ;AN000; | ||
| 158 | push si ; " " " " ;AN000; | ||
| 159 | push di ; " " " " ;AN000; | ||
| 160 | mov di,dx ;Change pointer to table ;AN000; | ||
| 161 | mov ax,[di].Entry1 ;Message number ;AN000; | ||
| 162 | mov bx,[di].Entry2 ;Handle ;AN000; | ||
| 163 | mov si,[di].Entry3 ;Sublist ;AN000; | ||
| 164 | mov cx,[di].Entry4 ;Count ;AN000; | ||
| 165 | mov dh,[di].Entry5 ;Class ;AN000; | ||
| 166 | mov dl,[di].Entry6 ;Function ;AN000; | ||
| 167 | mov di,[di].Entry7 ;Input ;AN000; | ||
| 168 | call SysDispMsg ;Display the message ;AN000; | ||
| 169 | pop di ;Restore registers ;AN000; | ||
| 170 | pop si ; " " " " ;AN000; | ||
| 171 | pop dx ; " " " " ;AN000; | ||
| 172 | pop cx ; " " " " ;AN000; | ||
| 173 | pop bx ; " " " " ;AN000; | ||
| 174 | ; pop ax ; " " " " ;AN000; | ||
| 175 | ret ;All done ;AN000; | ||
| 176 | |||
| 177 | PRINTF ENDP ; ;AN000; | ||
| 178 | |||
| 179 | PRINTF_CODE ENDS | ||
| 180 | |||
| 181 | end | ||