Chapter
1
I
System Calls
record-size
relative-record
fcb
db
db
buffer db
prompt
1
db
promp
t
2
db
crlf db
reply db
blanks db
equ
14
;offsetofRecordSize
equ 33 ;offset of RelativeRecord
;fieldof FCB
;fieldof FCB
2
,"ALPHABETDAT"
25 dup
(7)
26
dup(
7
)
,
1
3,l
0
,
"0"
"Enter letter:
0"
"New record (RETURN for no change):
$"
1
3
,
1
0
,
"
$
"
28 dup (32)
26 dup
(32)
func-22H: set-dta buffer
;
see Function
1
AH
open fcb i5eeFunction 0FH
mQV
fcb[record_sizel,32 ;set record size
get-char: display prompt1 ;seeFunction 09H
read-kbd-and-echo
;see
Function
01H
CmP
al,0DH
;just aCR7
le a1 I-done ;yes, gohome
sub al,41H ;convert
ASCII
mov fcb[relative-record1,al
display crlf ;seeFunction 09H
read-ran fcb ;THIS FUNCTION
display buffer ;seeFunction 09H
display
crlf i5eeFunction
09H
display prompt2
;see
Function 09H
get-string 27,reply ;see Function
0AH
display
crlf ;seeFunction 09H
CmP
reply[lI,B
;wasanything typed
le ge t-c har ;no
xor bx, bx ;to loada byte
mov bl,reply[l
1
;use reply lengthas
move-string blanks,buffer,26 ;see chapter end
move-string
reply[Zl,buffer,bx ;see chapter end
write-ran fcb ;seeFunction21H
J
mP get -c har
;get another character
a1
I-done: close fcb ;seeFunction
10H
;code to record#
;set relative record
;besides
CR?
;get
another char.
;counter
72