📄 smb_fcn.asm
字号:
cmp bl,0Fh ; Izit absent?
je short SMB_BANK2 ; Jump if so
push ds ; Pass ptr to string
push offset ds:MSG_BANKSEP ; ...
call DispASCIIZ ; Display ASCIIZ string
SMB_BANK1:
cmp bl,0Fh ; Izit absent?
je short SMB_BANK2 ; Jump if so
mov dl,bl ; Copy to @CHROUT register
add dl,'0' ; Convert to ASCII
push fs ; Save for a moment
mov ax,ds ; Copy DGROUP segment/selector
mov fs,ax ; Address it
assume fs:DGROUP ; Tell the assembler about it
call lpOutput ; Display the character
pop fs ; Restore
assume fs:nothing ; Tell the assembler about it
SMB_BANK2:
push ds ; Pass ptr to string
push offset ds:MSG_CRLF ; ...
call DispASCIIZ ; Display ASCIIZ string
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_BANK endp ; End SMB_BANK procedure
NPPROC SMB_BCDREV -- Display A BCD Byte Revision #
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display a BCD Byte Revision # from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
movzx ax,fs:[si+bx].LO ; Get the BCD #, zero to use as word
ror ax,4 ; Shift high-order nibble to low-order of AL
; ... low-order nibble to high-order of AH
shr ah,4 ; Shift low-order nibble to low-order of AH
push ax ; Pass the BCD byte
; Note the digits are printed in reverse order
push ds ; ... ptr to format string
push offset ds:MSG_BCDREV ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
SMB_BCDREV_COM1:
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_BCDREV endp ; End SMB_BCDREV procedure
NPPROC SMB_BCDBYTE -- Display A BCD Byte
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display a BCD Byte from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
movzx ax,fs:[si+bx].LO ; Get the BCD #, zero to use as word
shl ax,4 ; Shift high-order nibble into AH
shr al,4 ; Shift low-order nibble back to AL
push ax ; Pass the BCD byte
push ds ; ... ptr to format string
push offset ds:MSG_BCDBYTE ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_BCDBYTE endp ; End SMB_BCDBYTE procedure
NPPROC SMB_UDECBYTE -- Display An Unsigned Decimal Byte
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Byte from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
push fs:[bx+di].ELO ; Pass the decimal byte (as a word)
push ds ; ... ptr to format string
push offset ds:MSG_UDECBYTE ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECBYTE endp ; End SMB_UDECBYTE procedure
NPPROC SMB_UDECBYTEUNK -- Display An Unsigned Decimal Byte w/Unknown
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Byte w/Unknown from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
movzx ax,fs:[bx+di].LO ; Get the decimal byte (as a word)
cmp al,[bp].SMBarg.argSMB_SPC2.EDQLO.ELO.LO ; Izit unknown value?
jne short @F ; Jump if not
push ds ; Pass ptr to string
push offset ds:MSG_UNK_VAL ; ...
call DispASCIIZ ; Display ASCIIZ string
jmp short SMB_UDECBYTEUNK_EXIT ; Join common exit code
@@:
push ax ; Pass the decimal byte (as a word)
push ds ; ... ptr to format string
push offset ds:MSG_UDECBYTE ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
SMB_UDECBYTEUNK_EXIT:
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECBYTEUNK endp ; End SMB_UDECBYTEUNK procedure
NPPROC SMB_UDECWORD -- Display An Unsigned Decimal Word
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Word from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
mov ax,fs:[bx+di].ELO ; Get the decimal word
push ax ; Pass the decimal word
push ds ; ... ptr to format string
push offset ds:MSG_UDECWORD ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECWORD endp ; End SMB_UDECWORD procedure
NPPROC SMB_UDECWORDUNK -- Display An Unsigned Decimal Word w/Unknown
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Word w/Unknown from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
mov ax,fs:[bx+di].ELO ; Get the decimal word
cmp ax,[bp].SMBarg.argSMB_SPC2.EDQLO.ELO ; Izit unknown value?
jne short @F ; Jump if not
push ds ; Pass ptr to string
push offset ds:MSG_UNK_VAL ; ...
call DispASCIIZ ; Display ASCIIZ string
jmp short SMB_UDECWORDUNK_EXIT ; Join common exit code
@@:
push ax ; Pass the word
push ds ; ... ptr to format string
push offset ds:MSG_UDECWORD ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+2 ; Strip arguments from stack
SMB_UDECWORDUNK_EXIT:
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECWORDUNK endp ; End SMB_UDECWORDUNK procedure
NPPROC SMB_UDECDWORD -- Display An Unsigned Decimal Dword
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Dword from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
push fs:[bx+di].EDD ; Pass the decimal dword
push ds ; ... ptr to format string
push offset ds:MSG_UDECDWORD ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+4 ; Strip arguments from stack
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECDWORD endp ; End SMB_UDECDWORD procedure
NPPROC SMB_UDECDWORDUNK -- Display An Unsigned Decimal Dword w/Unknown
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display an Unsigned Decimal Dword w/Unknown from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
@@:
mov di,[bp].SMBarg.argSMB_START ; Get struc start
mov bx,[bp].SMBarg.argSMB_OFFS ; ... offset
mov eax,fs:[bx+di].EDD ; Get the decimal dword
cmp eax,[bp].SMBarg.argSMB_SPC2.EDQLO ; Izit unknown value?
jne short @F ; Jump if not
push ds ; Pass ptr to string
push offset ds:MSG_UNK_VAL ; ...
call DispASCIIZ ; Display ASCIIZ string
jmp short SMB_UDECDWORDUNK_EXIT ; Join common exit code
@@:
push eax ; Pass the word
push ds ; ... ptr to format string
push offset ds:MSG_UDECDWORD ; ...
push lpOutput ; ... ptr to output routine
call RPRINTF16 ; Rprintf it, return with AX = # chars printed
add sp,4+4+4 ; Strip arguments from stack
SMB_UDECDWORDUNK_EXIT:
clc ; Mark as successful
popa ; Restore
lclEPILOG SMB_STR ; Strip local vars and return
assume ds:nothing,es:nothing,fs:nothing,gs:nothing,ss:nothing
SMB_UDECDWORDUNK endp ; End SMB_UDECDWORDUNK procedure
NPPROC SMB_DHDWORD -- Display A Hex/Decimal Dword
assume ds:DGROUP,es:nothing,fs:nothing,gs:nothing,ss:nothing
COMMENT|
Display a Hex/Decimal Dword from FS.
On entry:
FS = Struc Segment
SS:BP ==> SMB_STR (after lclPROLOG)
On exit:
CF = 0 if successful
= 1 if not
|
lclPROLOG SMB_STR ; Address local vars
pusha ; Save all GP registers
; Display the leading text, unless asked not to
test LCL_FLAG,@LCL_XLEAD ; Skip displaying leading text?
jnz short @F ; Jump if so
push ds ; Pass ptr to string
push [bp].SMBarg.argSMB_TEXT ; ...
call DispASCIIZ ; Display ASCIIZ string
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -