Hercules+-+Program+Entry

=Program #1 - Add two registers =

Start hercules, then enter the following commands :

r 2000= 41 10 00 04 r 2004= 41 50 00 03 r 2008= 18 95 r 200A= 1A 91 r 200c= 18 00 18 00 18 00

u 2000.20

You should have :


 * R00002000:||41100004||LA||1,4(0,0)||load_address||
 * R00002004:||41500003||LA||5,3(0,0)||load_address||
 * R00002008:||1895   ||LR||9,5     ||load_register||
 * R0000200A:||1A91   ||AR||9,1     ||add_register||
 * R0000200C:||1800   ||LR||0,0     ||load_register||

Now enter :

s+ psw cmwp=8 psw ia=2000

Now press 5 times, and you should see :

14:48:46 PSW=00082000 00002000 INST=41100004    LA    1,4(0,0)               load_address 14:48:46 R:00000004:K:04=00000000 00000000 00000000 00000000 ................ 14:48:46 GR00=00000000 GR01=00000004  GR02=00000003  GR03=00000000 14:48:46 GR04=00000000 GR05=00000003  GR06=00000000  GR07=00000000 14:48:46 GR08=00000000 GR09=00000007  GR10=00000000  GR11=00000000 14:48:46 GR12=00000000 GR13=00000000  GR14=00000000  GR15=00000000 14:48:47 14:48:47 PSW=00082000 00002004 INST=41500003    LA    5,3(0,0)               load_address 14:48:47 R:00000003:K:04=00 00000000 00000000 00000000 000000 ................ 14:48:47 GR00=00000000 GR01=00000004  GR02=00000003  GR03=00000000 14:48:47 GR04=00000000 GR05=00000003  GR06=00000000  GR07=00000000 14:48:47 GR08=00000000 GR09=00000007  GR10=00000000  GR11=00000000 14:48:47 GR12=00000000 GR13=00000000  GR14=00000000  GR15=00000000 14:48:48 14:48:48 PSW=00082000 00002008 INST=1895        LR    9,5                    load_register 14:48:48 GR00=00000000 GR01=00000004  GR02=00000003  GR03=00000000 14:48:48 GR04=00000000 GR05=00000003  GR06=00000000  GR07=00000000 14:48:48 GR08=00000000 GR09=00000007  GR10=00000000  GR11=00000000 14:48:48 GR12=00000000 GR13=00000000  GR14=00000000  GR15=00000000 14:48:49 14:48:49 PSW=00082000 0000200A INST=1A91        AR    9,1                    add_register 14:48:49 GR00=00000000 GR01=00000004  GR02=00000003  GR03=00000000 14:48:49 GR04=00000000 GR05=00000003  GR06=00000000  GR07=00000000 14:48:49 GR08=00000000 GR09=00000003  GR10=00000000  GR11=00000000 14:48:49 GR12=00000000 GR13=00000000  GR14=00000000  GR15=00000000 14:48:51 14:48:51 PSW=00082000 0000200C INST=1800        LR    0,0                    load_register 14:48:51 GR00=00000000 GR01=**00000004**  GR02=00000003  GR03=00000000 14:48:51 GR04=00000000 GR05=**00000003**  GR06=00000000  GR07=00000000 14:48:51 GR08=00000000 GR09=**00000007**  GR10=00000000  GR11=00000000 14:48:51 GR12=00000000 GR13=00000000  GR14=00000000  GR15=00000000

As you can see GPR 9 contains the result of the AR 9,1 instruction