📄 makesets.asm
字号:
.xlist
include stdlib.a
includelib stdlib.lib
.list
; MAKESETS.ASM
;
; This program produces an output file which is the data for eight commonly
; used character sets. It produces the set data for the sets:
; 1. alphabetic (upper and lower case)
; 2. lower (lower case alphabetic)
; 3. upper (upper case alphabetic)
; 4. digits (0-9)
; 5. xdigits (hexadecimal digits)
; 6. alphanum (alphabetic [upper&lower] & digits)
; 7. whitespace (spaces, tabs, cr, lf)
; 8. delimiters (space, tab, cr, lf, ';', ',', '<', '>', and '|').
;
;
; This program sends its output to the standard output device. You should
; redirect this output to the STDSETS.A file.
;
; Written by Randall Hyde
; 10/15/92
;
dseg segment para public 'data'
set alpha, lower, upper, digits, xdigits, alphanum, whitespace, delimeters
dseg ends
cseg segment para public 'code'
assume cs:cseg, ds:dseg
Main proc
mov ax, seg dseg ;Set up the segment registers
mov ds, ax
mov es, ax
; Build the sets in memory using the ADDSTRL procedure:
lesi Alpha
addstrl
db 'abcdefghijklmnopqrstuvwxyz'
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
db 0
lesi upper
addstrl
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
db 0
lesi lower
addstrl
db 'abcdefghijklmnopqrstuvwxyz'
db 0
lesi digits
addstrl
db '0123456789',0
lesi xdigits
addstrl
db '0123456789abcdefABCDEF',0
lesi Alphanum
addstrl
db 'abcdefghijklmnopqrstuvwxyz'
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
db '0123456789',0
lesi Whitespace
addstrl
db 9, 10, 13, ' '
db 0
lesi Delimeters
addstrl
db ' ,;<>|',9,10,13,0
; Now, print the memory image to the standard output so we can grab it
; and save it in the STDSETS.A file:
printf
byte "Alpha db 0%hh\n"
byte "Lower db 0%hh\n"
byte "Upper db 0%hh\n"
byte "Digits db 0%hh\n"
byte "xDigits db 0%hh\n"
byte "AlphaNum db 0%hh\n"
byte "WhiteSpace db 0%hh\n"
byte "Delimeters db 0%hh\n",0
dword Alpha, Lower, Upper, Digits, xDigits, AlphaNum,
WhiteSpace, Delimeters
mov di, offset Alpha+8
DoAgain: call Prt8
putcr
cmp di, offset Alpha+256+16
jb DoAgain
Quit: ExitPgm
Main endp
Prt8 proc near
push cx
mov cx, 7
print
db 9,9,"db",9,0
PrtLp: mov al, '0'
putc
mov al, [di]
puth
print
db "h, ",0
inc di
loop PrtLp
mov al, '0'
putc
mov al, [di]
puth
mov al, 'h'
putc
inc di
pop cx
ret
Prt8 endp
cseg ends
; Allocate a reasonable amount of space for the stack (2k).
sseg segment para stack 'stack'
stk db 256 dup ("stack ")
sseg ends
; zzzzzzseg must be the last segment that gets loaded into memory!
zzzzzzseg segment para public 'zzzzzz'
LastBytes db 16 dup (?)
zzzzzzseg ends
end Main
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -