程序代写代做代考 // use command in to read A and B

// use command in to read A and B
// store the result C = A / B, in address 90
in inputloop read A
sto 99 store A
in read B
sto 98 store B
lda 99 load A
sub 98 sub B
brp 08 nextIns
br 00 inputloop B > A read input again
lda 98 nextIns load B
brz 00 inputloop B is 0, read input again
brp 12 loop
br 00 inputloop B < 0, read input again lda 99 loop load A sub 98 sub B brp 16 inloop A - B >= 0, continue
br 23 outloop A – B < 0 , break lda 99 inloop load A sub 98 sub B sto 99 update A A = A - B lda 90 load C add 91 add 1 to C C + 1 sto 90 update C C = C + 1 br 10 loop continue loop lda 90 outloop load C out output C: C = A / B hlt *90 dat 000 ; store C initially C = 0 dat 001 dat 000 *98 dat 009 dat 041 /docProps/thumbnail.jpeg

Posted in Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *