perm filename RHOST.FAI[S,NET] blob
sn#795278 filedate 1985-05-27 generic text, type T, neo UTF8
title rhost
;Query resolver to translate host domain name to Internet address.
a←1
b←2
c←3
d←4
p←17
pdlen←20
pdl: block pdlen
sndblk: '[RSLV]'
mess
mess: 'DOM',,0
0,,6
123,,456
domain: block =32
imess: block =32
start: move p,[iowd pdlen,pdl]
pjob 1,
hrrm 1,mess
outstr [asciz/
Domain: /]
move b,[point 7,domain]
inch: inchwl a
cain a,12
jrst copy
caie a,15
idpb a,b
jrst inch
copy: movei a,0
idpb a,b
retry: send sndblk
jrst snderr
wrcv imess
hrrz a,imess+1 ;Reply code
jrst @rdisp(a) ;Dispatch
rdisp: bad
error
timeout
nomatch
bad
bad
answer
bad
bad
bad
bad
bad: outstr [asciz/Unexpected reply code received from resolver.
/]
jrst start
error: outstr [asciz/Error: /]
outstr imess+3
outstr [asciz/
/]
jrst start
timeout:outstr [asciz/No response from name servers.
/]
jrst start
nomatch:outstr [asciz/Not a valid host name.
/]
jrst start
answer: outstr [asciz/Address(es):
/]
movn d,imess+3
movsi d,(d)
ans1: ldb a,[point 8,imess+4(d),11]
pushj p,decout
outchr ["."]
ldb a,[point 8,imess+4(d),19]
pushj p,decout
outchr ["."]
ldb a,[point 8,imess+4(d),27]
pushj p,decout
outchr ["."]
ldb a,[point 8,imess+4(d),35]
pushj p,decout
outstr [asciz/
/]
aobjn d,ans1
jrst start
snderr: outstr [asciz/Resolver's mailbox full. Retrying.
/]
movei a,1
sleep a,
jrst retry
decout: idivi a,=10
hrlm b,(p)
jumpe a,.+2
pushj p,decout
hlrz b,(p)
addi b,"0"
outchr b
popj p,
end start
@