Write a machine language program to output the three characters "Cat" on the output device. Write it in a format suitable for the loader and execute it on the Pep/9 simulator. How would I write this in machine language?
#Machine Language Programm To Print Output As "Cat" :-
Firstly What Could Be The Algorithm For Printing Cat ?
Algorithm :-
0000 load byte A<- ‘C’
0003 output value in A
0006 load byte A<- ‘a’
0009 output value in A
000C load byte A<- ‘t’
000F output value in A
0012 Stop
0013 ’C’ ‘a’ ‘t’
Now We Need To Write Same Algorith Which Can Be Executed On Pep-9 Simulator ?
Algorithm :-
0000 D1 00 13 ; load byte A<- Mem[0013] =43=‘C’
0003 F1 FC 16 ; output value in A
0006 D1 00 14 ; load byte A<- Mem[0014]=61=‘a’
0009 F1 FC 16 ; output value in A
000C D1 00 15 ; load byte A<- Mem[0015]=74=‘t’
000F F1 FC 16 ; output value in A
0012 00 ;stop
0013 43 61 74 ;’C’ ‘a’ ‘t’
zz
#NOTE:- Hope The Above Code Is Usefull To You . For Any Queary Regarding To This Code You May Comment Down Below. Happy Coading : - )
Get Answers For Free
Most questions answered within 1 hours.