the following are assembly language codes of an sic/xe machine....
clear a
ldx #128
loop jsub getc
rmo a,s
shift s,4
jsub getc
addr s,a
stch 0,x
tixr x,x
j loop
getc td input
jeq getc
rd input
comp #4 ;if input is 4 then eof
jeq 80 ;jump to start of program
comp #48 ; compare to charcter 0
jlt getc ;skip charcters less than 0
sub #48
comp #10 ;if result is less than 10, conversion is complete
jlt return
sub #7 ;for hex digits A through F
return rsub
input byte x'F1'
this is a bootstrap loader...the purpose of this programme is to read from device F1 and store the input at address starting from 80...now my question is that when the why do we need to do shift s,4...when we take an input once, we find its original value from its ascii value and then send it to 'loop' to store it...from the programme it appears that first only half byte of chatacter is sent to loop and then the other...if this is the fact then in a first there would be first half byte of charcter and so the ascii operations on the first half will not give us the real value of input...also when the programme returns to 'getc' to get the other half byte will not the other character in the list be read instead...the following is a line from the same book for help...
each byte of the code to be loaded is on device F1 as two hexadecimal digits