home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 85 / asm / source / zshell / acid11.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  28.0 KB  |  918 lines

  1. ; Acid11.asm
  2. ;  by Jim Macdonell jimm@snowline.net
  3. ;
  4. ; This simple program prints a list of Monoprotic &
  5. ; Polyprotic acids and waits for you to hit the More key to continue. 
  6. ; Its modeled after D. Cantrell's "Polyatomic Ion List."  Unfortuately
  7. ; he/she didn't post an *.asm file so I actually had to learn TASM from
  8. ; scratch. :(
  9. ;
  10. ; It should work fine on any TI-85. The comments are probably screwed up from
  11. ; Copy/Paste-ing.
  12. ;
  13. ; Always back up the calc memory to the computer before running a new program!
  14. ;
  15. ; This is my first usefull/successful program so don't expect too much.
  16. ;
  17. ; Feel free to slaughter or improve this program, just don't distribute
  18. ; your "improvements" under my name.
  19.  
  20.  
  21.  
  22. #include "TI-85.h"
  23.  
  24.  
  25. .org 0
  26. .db "Mono&Polyprotic Acids v1.1", 0
  27. Start
  28.  
  29.     ROM_CALL(CLEARLCD)
  30.     
  31.     ld   HL, $01             ; set text cursor position
  32.     ld   ($8333), HL
  33.     ld   HL, $01       
  34.     ld   ($8334), HL
  35.     
  36.  
  37.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  38.     ld   DE, Name             ; get difference between address of program, string
  39.     add  HL, DE             ; add to get address of string
  40.     ROM_CALL(D_ZM_STR)      ; print the string
  41.     
  42.     ld   HL, $46             ; set text cursor position
  43.     ld   ($8333), HL
  44.     ld   HL, $01       
  45.     ld   ($8334), HL
  46.     
  47.  
  48.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  49.     ld   DE, Formula             ; get difference between address of program, string
  50.     add  HL, DE             ; add to get address of string
  51.     ROM_CALL(D_ZM_STR)      ; print the string
  52.  
  53.    ;#0 thing done
  54.      
  55.     ld   HL, $01             ; set text cursor position
  56.     ld   ($8333), HL
  57.     ld   HL, $08       
  58.     ld   ($8334), HL
  59.      
  60.  
  61.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  62.     ld   DE, Jim1             ; get difference between address of program, string
  63.     add  HL, DE             ; add to get address of string
  64.     ROM_CALL(D_ZM_STR)      ; print the string
  65.  
  66.     ld   HL, $48             ; set text cursor position
  67.     ld   ($8333), HL
  68.     ld   HL, $08       
  69.     ld   ($8334), HL
  70.     
  71.  
  72.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  73.     ld   DE, Jim1a             ; get difference between address of program, string
  74.     add  HL, DE             ; add to get address of string
  75.     ROM_CALL(D_ZM_STR)      ; print the string
  76.  
  77.         
  78.     ;#2 thing done
  79.  
  80.     ld   HL, $01            ; set text cursor position
  81.     ld   ($8333), HL
  82.     ld   HL, $0F
  83.     ld   ($8334), HL 
  84.     
  85.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  86.     ld   DE, Jim2             ; get difference between address of program, string
  87.     add  HL, DE             ; add to get address of string
  88.     ROM_CALL(D_ZM_STR)      ; print the string
  89.  
  90.  
  91.     ld   HL, $48            ; set text cursor position
  92.     ld   ($8333), HL
  93.     ld   HL, $0F
  94.     ld   ($8334), HL 
  95.     
  96.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  97.     ld   DE, Jim2a             ; get difference between address of program, string
  98.     add  HL, DE             ; add to get address of string
  99.     ROM_CALL(D_ZM_STR)      ; print the string
  100.  
  101.  
  102.    ;#2 thing done
  103.     
  104.     ld   HL, $01            ; set text cursor position
  105.     ld   ($8333), HL
  106.     ld   HL, $16  
  107.     ld   ($8334), HL    
  108.     
  109.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  110.     ld   DE, Jim3             ; get difference between address of program, string
  111.     add  HL, DE             ; add to get address of string
  112.     ROM_CALL(D_ZM_STR)      ; print the string
  113.     
  114.     ld   HL, $48            ; set text cursor position
  115.     ld   ($8333), HL
  116.     ld   HL, $16  
  117.     ld   ($8334), HL    
  118.     
  119.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  120.     ld   DE, Jim3a             ; get difference between address of program, string
  121.     add  HL, DE             ; add to get address of string
  122.     ROM_CALL(D_ZM_STR)      ; print the string
  123.     ;#3 thing done
  124.     
  125.     ld   HL, $01            ; set text cursor position
  126.     ld   ($8333), HL
  127.     ld   HL, $1D  
  128.     ld   ($8334), HL
  129.      
  130.  
  131.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  132.     ld   DE, Jim4             ; get difference between address of program, string
  133.     add  HL, DE             ; add to get address of string
  134.     ROM_CALL(D_ZM_STR)      ; print the string
  135.     
  136.     ld   HL, $48            ; set text cursor position
  137.     ld   ($8333), HL
  138.     ld   HL, $1D  
  139.     ld   ($8334), HL
  140.      
  141.  
  142.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  143.     ld   DE, Jim4a             ; get difference between address of program, string
  144.     add  HL, DE             ; add to get address of string
  145.     ROM_CALL(D_ZM_STR)      ; print the string
  146.     ;#4 thing done
  147.     
  148.     ld   HL, $01            ; set text cursor position
  149.     ld   ($8333), HL
  150.     ld   HL, $24  
  151.     ld   ($8334), HL
  152.      
  153.  
  154.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  155.     ld   DE, Jim5             ; get difference between address of program, string
  156.     add  HL, DE             ; add to get address of string
  157.     ROM_CALL(D_ZM_STR)      ; print the string
  158.     
  159.     ld   HL, $48            ; set text cursor position
  160.     ld   ($8333), HL
  161.     ld   HL, $24  
  162.     ld   ($8334), HL
  163.      
  164.  
  165.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  166.     ld   DE, Jim5a             ; get difference between address of program, string
  167.     add  HL, DE             ; add to get address of string
  168.     ROM_CALL(D_ZM_STR)      ; print the string
  169.     ;#5 thing done
  170.     
  171.     ld   HL, $01            ; set text cursor position
  172.     ld   ($8333), HL
  173.     ld   HL, $2B  
  174.     ld   ($8334), HL
  175.      
  176.  
  177.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  178.     ld   DE, Jim6             ; get difference between address of program, string
  179.     add  HL, DE             ; add to get address of string
  180.     ROM_CALL(D_ZM_STR)      ; print the string
  181.     
  182.     ld   HL, $48            ; set text cursor position
  183.     ld   ($8333), HL
  184.     ld   HL, $2B  
  185.     ld   ($8334), HL
  186.      
  187.  
  188.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  189.     ld   DE, Jim6a             ; get difference between address of program, string
  190.     add  HL, DE             ; add to get address of string
  191.     ROM_CALL(D_ZM_STR)      ; print the string
  192.     ;#6 thing done    
  193.     
  194.     
  195.     ld   HL, $01            ; set text cursor position
  196.     ld   ($8333), HL
  197.     ld   HL, $32  
  198.     ld   ($8334), HL
  199.      
  200.  
  201.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  202.     ld   DE, Jim7             ; get difference between address of program, string
  203.     add  HL, DE             ; add to get address of string
  204.     ROM_CALL(D_ZM_STR)      ; print the string
  205.     
  206.     ld   HL, $48            ; set text cursor position
  207.     ld   ($8333), HL
  208.     ld   HL, $32  
  209.     ld   ($8334), HL
  210.      
  211.  
  212.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  213.     ld   DE, Jim7a             ; get difference between address of program, string
  214.     add  HL, DE             ; add to get address of string
  215.     ROM_CALL(D_ZM_STR)      ; print the string
  216.     ;#7 thing done   
  217.         
  218.     ld   HL, $01            ; set text cursor position
  219.     ld   ($8333), HL
  220.     ld   HL, $39  
  221.     ld   ($8334), HL
  222.      
  223.  
  224.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  225.     ld   DE, Jim8             ; get difference between address of program, string
  226.     add  HL, DE             ; add to get address of string
  227.     ROM_CALL(D_ZM_STR)      ; print the string
  228.     
  229.     ld   HL, $48            ; set text cursor position
  230.     ld   ($8333), HL
  231.     ld   HL, $39  
  232.     ld   ($8334), HL
  233.      
  234.  
  235.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  236.     ld   DE, Jim8a             ; get difference between address of program, string
  237.     add  HL, DE             ; add to get address of string
  238.     ROM_CALL(D_ZM_STR)      ; print the string
  239.     ;#8 thing done   
  240.     
  241.     JUMP_(GetLoop)            ; wait for keypress again
  242. Cont
  243.         ROM_CALL(CLEARLCD)
  244.     
  245.     ld   HL, $01             ; set text cursor position
  246.     ld   ($8333), HL
  247.     ld   HL, $01       
  248.     ld   ($8334), HL
  249.     
  250.  
  251.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  252.     ld   DE, Name             ; get difference between address of program, string
  253.     add  HL, DE             ; add to get address of string
  254.     ROM_CALL(D_ZM_STR)      ; print the string
  255.     
  256.     ld   HL, $46             ; set text cursor position
  257.     ld   ($8333), HL
  258.     ld   HL, $01       
  259.     ld   ($8334), HL
  260.     
  261.  
  262.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  263.     ld   DE, Formula             ; get difference between address of program, string
  264.     add  HL, DE             ; add to get address of string
  265.     ROM_CALL(D_ZM_STR)      ; print the string
  266.  
  267.    ;#0 thing done
  268.      
  269.     ld   HL, $01             ; set text cursor position
  270.     ld   ($8333), HL
  271.     ld   HL, $08       
  272.     ld   ($8334), HL
  273.      
  274.  
  275.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  276.     ld   DE, Jim9             ; get difference between address of program, string
  277.     add  HL, DE             ; add to get address of string
  278.     ROM_CALL(D_ZM_STR)      ; print the string
  279.  
  280.     ld   HL, $48             ; set text cursor position
  281.     ld   ($8333), HL
  282.     ld   HL, $08       
  283.     ld   ($8334), HL
  284.     
  285.  
  286.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  287.     ld   DE, Jim9a             ; get difference between address of program, string
  288.     add  HL, DE             ; add to get address of string
  289.     ROM_CALL(D_ZM_STR)      ; print the string
  290.  
  291.         
  292.     ;#9 thing done
  293.  
  294.     ld   HL, $01            ; set text cursor position
  295.     ld   ($8333), HL
  296.     ld   HL, $0F
  297.     ld   ($8334), HL 
  298.     
  299.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  300.     ld   DE, Jim10             ; get difference between address of program, string
  301.     add  HL, DE             ; add to get address of string
  302.     ROM_CALL(D_ZM_STR)      ; print the string
  303.  
  304.  
  305.     ld   HL, $48            ; set text cursor position
  306.     ld   ($8333), HL
  307.     ld   HL, $0F
  308.     ld   ($8334), HL 
  309.     
  310.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  311.     ld   DE, Jim10a             ; get difference between address of program, string
  312.     add  HL, DE             ; add to get address of string
  313.     ROM_CALL(D_ZM_STR)      ; print the string
  314.  
  315.  
  316.    ;#10 thing done
  317.     
  318.     ld   HL, $01            ; set text cursor position
  319.     ld   ($8333), HL
  320.     ld   HL, $16  
  321.     ld   ($8334), HL    
  322.     
  323.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  324.     ld   DE, Jim11             ; get difference between address of program, string
  325.     add  HL, DE             ; add to get address of string
  326.     ROM_CALL(D_ZM_STR)      ; print the string
  327.     
  328.     ld   HL, $48            ; set text cursor position
  329.     ld   ($8333), HL
  330.     ld   HL, $16  
  331.     ld   ($8334), HL    
  332.     
  333.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  334.     ld   DE, Jim11a             ; get difference between address of program, string
  335.     add  HL, DE             ; add to get address of string
  336.     ROM_CALL(D_ZM_STR)      ; print the string
  337.     ;#11 thing done
  338.     
  339.     ld   HL, $01            ; set text cursor position
  340.     ld   ($8333), HL
  341.     ld   HL, $1D  
  342.     ld   ($8334), HL
  343.      
  344.  
  345.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  346.     ld   DE, Jim12             ; get difference between address of program, string
  347.     add  HL, DE             ; add to get address of string
  348.     ROM_CALL(D_ZM_STR)      ; print the string
  349.     
  350.     ld   HL, $48            ; set text cursor position
  351.     ld   ($8333), HL
  352.     ld   HL, $1D  
  353.     ld   ($8334), HL
  354.      
  355.  
  356.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  357.     ld   DE, Jim12a             ; get difference between address of program, string
  358.     add  HL, DE             ; add to get address of string
  359.     ROM_CALL(D_ZM_STR)      ; print the string
  360.     ;#12 thing done
  361.     
  362.     ld   HL, $01            ; set text cursor position
  363.     ld   ($8333), HL
  364.     ld   HL, $24  
  365.     ld   ($8334), HL
  366.      
  367.  
  368.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  369.     ld   DE, Jim13             ; get difference between address of program, string
  370.     add  HL, DE             ; add to get address of string
  371.     ROM_CALL(D_ZM_STR)      ; print the string
  372.     
  373.     ld   HL, $48            ; set text cursor position
  374.     ld   ($8333), HL
  375.     ld   HL, $24  
  376.     ld   ($8334), HL
  377.      
  378.  
  379.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  380.     ld   DE, Jim13a             ; get difference between address of program, string
  381.     add  HL, DE             ; add to get address of string
  382.     ROM_CALL(D_ZM_STR)      ; print the string
  383.     ;#13 thing done
  384.     
  385.     ld   HL, $01            ; set text cursor position
  386.     ld   ($8333), HL
  387.     ld   HL, $2B  
  388.     ld   ($8334), HL
  389.      
  390.  
  391.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  392.     ld   DE, Jim14             ; get difference between address of program, string
  393.     add  HL, DE             ; add to get address of string
  394.     ROM_CALL(D_ZM_STR)      ; print the string
  395.     
  396.     ld   HL, $48            ; set text cursor position
  397.     ld   ($8333), HL
  398.     ld   HL, $2B  
  399.     ld   ($8334), HL
  400.      
  401.  
  402.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  403.     ld   DE, Jim14a             ; get difference between address of program, string
  404.     add  HL, DE             ; add to get address of string
  405.     ROM_CALL(D_ZM_STR)      ; print the string
  406.     ;#14 thing done    
  407.     
  408.     
  409.     ld   HL, $01            ; set text cursor position
  410.     ld   ($8333), HL
  411.     ld   HL, $32  
  412.     ld   ($8334), HL
  413.      
  414.  
  415.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  416.     ld   DE, Jim15             ; get difference between address of program, string
  417.     add  HL, DE             ; add to get address of string
  418.     ROM_CALL(D_ZM_STR)      ; print the string
  419.     
  420.     ld   HL, $48            ; set text cursor position
  421.     ld   ($8333), HL
  422.     ld   HL, $32  
  423.     ld   ($8334), HL
  424.      
  425.  
  426.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  427.     ld   DE, Jim15a             ; get difference between address of program, string
  428.     add  HL, DE             ; add to get address of string
  429.     ROM_CALL(D_ZM_STR)      ; print the string
  430.     ;#15 thing done   
  431.  
  432.              
  433.     ld   HL, $01            ; set text cursor position
  434.     ld   ($8333), HL
  435.     ld   HL, $39  
  436.     ld   ($8334), HL
  437.      
  438.  
  439.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  440.     ld   DE, Jim16             ; get difference between address of program, string
  441.     add  HL, DE             ; add to get address of string
  442.     ROM_CALL(D_ZM_STR)      ; print the string
  443.     
  444.     ld   HL, $48            ; set text cursor position
  445.     ld   ($8333), HL
  446.     ld   HL, $39  
  447.     ld   ($8334), HL
  448.      
  449.  
  450.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  451.     ld   DE, Jim16a             ; get difference between address of program, string
  452.     add  HL, DE             ; add to get address of string
  453.     ROM_CALL(D_ZM_STR)      ; print the string
  454.     ;#16 thing done    
  455.     JUMP_(GetLoop1)
  456. Cont2
  457.             ROM_CALL(CLEARLCD)
  458.     
  459.     ld   HL, $01             ; set text cursor position
  460.     ld   ($8333), HL
  461.     ld   HL, $01       
  462.     ld   ($8334), HL
  463.     
  464.  
  465.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  466.     ld   DE, Name             ; get difference between address of program, string
  467.     add  HL, DE             ; add to get address of string
  468.     ROM_CALL(D_ZM_STR)      ; print the string
  469.     
  470.     ld   HL, $46             ; set text cursor position
  471.     ld   ($8333), HL
  472.     ld   HL, $01       
  473.     ld   ($8334), HL
  474.     
  475.  
  476.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  477.     ld   DE, Formula             ; get difference between address of program, string
  478.     add  HL, DE             ; add to get address of string
  479.     ROM_CALL(D_ZM_STR)      ; print the string
  480.  
  481.    ;#0 thing done
  482.      
  483.     ld   HL, $01             ; set text cursor position
  484.     ld   ($8333), HL
  485.     ld   HL, $08       
  486.     ld   ($8334), HL
  487.      
  488.  
  489.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  490.     ld   DE, Jim17             ; get difference between address of program, string
  491.     add  HL, DE             ; add to get address of string
  492.     ROM_CALL(D_ZM_STR)      ; print the string
  493.  
  494.     ld   HL, $48             ; set text cursor position
  495.     ld   ($8333), HL
  496.     ld   HL, $08       
  497.     ld   ($8334), HL
  498.     
  499.  
  500.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  501.     ld   DE, Jim17a             ; get difference between address of program, string
  502.     add  HL, DE             ; add to get address of string
  503.     ROM_CALL(D_ZM_STR)      ; print the string
  504.  
  505.         
  506.     ;#17 thing done
  507.  
  508.     ld   HL, $01            ; set text cursor position
  509.     ld   ($8333), HL
  510.     ld   HL, $0F
  511.     ld   ($8334), HL 
  512.     
  513.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  514.     ld   DE, Jim18             ; get difference between address of program, string
  515.     add  HL, DE             ; add to get address of string
  516.     ROM_CALL(D_ZM_STR)      ; print the string
  517.  
  518.  
  519.     ld   HL, $48            ; set text cursor position
  520.     ld   ($8333), HL
  521.     ld   HL, $0F
  522.     ld   ($8334), HL 
  523.     
  524.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  525.     ld   DE, Jim18a             ; get difference between address of program, string
  526.     add  HL, DE             ; add to get address of string
  527.     ROM_CALL(D_ZM_STR)      ; print the string
  528.  
  529.  
  530.    ;#18 thing done
  531.     
  532.     ld   HL, $01            ; set text cursor position
  533.     ld   ($8333), HL
  534.     ld   HL, $16  
  535.     ld   ($8334), HL    
  536.     
  537.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  538.     ld   DE, Jim19             ; get difference between address of program, string
  539.     add  HL, DE             ; add to get address of string
  540.     ROM_CALL(D_ZM_STR)      ; print the string
  541.     
  542.     ld   HL, $48            ; set text cursor position
  543.     ld   ($8333), HL
  544.     ld   HL, $16  
  545.     ld   ($8334), HL    
  546.     
  547.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  548.     ld   DE, Jim19a             ; get difference between address of program, string
  549.     add  HL, DE             ; add to get address of string
  550.     ROM_CALL(D_ZM_STR)      ; print the string
  551.     ;#19 thing done
  552.     
  553.     ld   HL, $01            ; set text cursor position
  554.     ld   ($8333), HL
  555.     ld   HL, $1D  
  556.     ld   ($8334), HL
  557.      
  558.  
  559.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  560.     ld   DE, Jim20             ; get difference between address of program, string
  561.     add  HL, DE             ; add to get address of string
  562.     ROM_CALL(D_ZM_STR)      ; print the string
  563.     
  564.     ld   HL, $48            ; set text cursor position
  565.     ld   ($8333), HL
  566.     ld   HL, $1D  
  567.     ld   ($8334), HL
  568.      
  569.  
  570.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  571.     ld   DE, Jim20a             ; get difference between address of program, string
  572.     add  HL, DE             ; add to get address of string
  573.     ROM_CALL(D_ZM_STR)      ; print the string
  574.     ;#20 thing done
  575.     
  576.     ld   HL, $01            ; set text cursor position
  577.     ld   ($8333), HL
  578.     ld   HL, $24  
  579.     ld   ($8334), HL
  580.      
  581.  
  582.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  583.     ld   DE, Jim21             ; get difference between address of program, string
  584.     add  HL, DE             ; add to get address of string
  585.     ROM_CALL(D_ZM_STR)      ; print the string
  586.     
  587.     ld   HL, $48            ; set text cursor position
  588.     ld   ($8333), HL
  589.     ld   HL, $24  
  590.     ld   ($8334), HL
  591.      
  592.  
  593.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  594.     ld   DE, Jim21a             ; get difference between address of program, string
  595.     add  HL, DE             ; add to get address of string
  596.     ROM_CALL(D_ZM_STR)      ; print the string
  597.     ;#21 thing done
  598.     
  599.     ld   HL, $01            ; set text cursor position
  600.     ld   ($8333), HL
  601.     ld   HL, $2B  
  602.     ld   ($8334), HL
  603.      
  604.  
  605.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  606.     ld   DE, Jim22             ; get difference between address of program, string
  607.     add  HL, DE             ; add to get address of string
  608.     ROM_CALL(D_ZM_STR)      ; print the string
  609.     
  610.     ld   HL, $48            ; set text cursor position
  611.     ld   ($8333), HL
  612.     ld   HL, $2B  
  613.     ld   ($8334), HL
  614.      
  615.  
  616.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  617.     ld   DE, Jim22a             ; get difference between address of program, string
  618.     add  HL, DE             ; add to get address of string
  619.     ROM_CALL(D_ZM_STR)      ; print the string
  620.     ;#22 thing done    
  621.     
  622.     
  623.     ld   HL, $01            ; set text cursor position
  624.     ld   ($8333), HL
  625.     ld   HL, $32  
  626.     ld   ($8334), HL
  627.      
  628.  
  629.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  630.     ld   DE, Jim23             ; get difference between address of program, string
  631.     add  HL, DE             ; add to get address of string
  632.     ROM_CALL(D_ZM_STR)      ; print the string
  633.     
  634.     ld   HL, $48            ; set text cursor position
  635.     ld   ($8333), HL
  636.     ld   HL, $32  
  637.     ld   ($8334), HL
  638.      
  639.  
  640.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  641.     ld   DE, Jim23a             ; get difference between address of program, string
  642.     add  HL, DE             ; add to get address of string
  643.     ROM_CALL(D_ZM_STR)      ; print the string
  644.     ;#23 thing done   
  645.  
  646.              
  647.     ld   HL, $01            ; set text cursor position
  648.     ld   ($8333), HL
  649.     ld   HL, $39  
  650.     ld   ($8334), HL
  651.      
  652.  
  653.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  654.     ld   DE, Jim24             ; get difference between address of program, string
  655.     add  HL, DE             ; add to get address of string
  656.     ROM_CALL(D_ZM_STR)      ; print the string
  657.     
  658.     ld   HL, $48            ; set text cursor position
  659.     ld   ($8333), HL
  660.     ld   HL, $39  
  661.     ld   ($8334), HL
  662.      
  663.  
  664.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  665.     ld   DE, Jim24a             ; get difference between address of program, string
  666.     add  HL, DE             ; add to get address of string
  667.     ROM_CALL(D_ZM_STR)      ; print the string
  668.     ;#24 thing done 
  669.     JUMP_(GetLoop2)
  670. Cont3    
  671.        ROM_CALL(CLEARLCD)
  672.     
  673.     ld   HL, $01             ; set text cursor position
  674.     ld   ($8333), HL
  675.     ld   HL, $01       
  676.     ld   ($8334), HL
  677.     
  678.  
  679.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  680.     ld   DE, Name             ; get difference between address of program, string
  681.     add  HL, DE             ; add to get address of string
  682.     ROM_CALL(D_ZM_STR)      ; print the string
  683.     
  684.     ld   HL, $46             ; set text cursor position
  685.     ld   ($8333), HL
  686.     ld   HL, $01       
  687.     ld   ($8334), HL
  688.     
  689.  
  690.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  691.     ld   DE, Formula             ; get difference between address of program, string
  692.     add  HL, DE             ; add to get address of string
  693.     ROM_CALL(D_ZM_STR)      ; print the string
  694.  
  695.    ;#0 thing done 
  696.   
  697.     ld   HL, $01             ; set text cursor position
  698.     ld   ($8333), HL
  699.     ld   HL, $08       
  700.     ld   ($8334), HL
  701.      
  702.  
  703.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  704.     ld   DE, Jim25             ; get difference between address of program, string
  705.     add  HL, DE             ; add to get address of string
  706.     ROM_CALL(D_ZM_STR)      ; print the string
  707.  
  708.     ld   HL, $48             ; set text cursor position
  709.     ld   ($8333), HL
  710.     ld   HL, $08       
  711.     ld   ($8334), HL
  712.     
  713.  
  714.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  715.     ld   DE, Jim25a             ; get difference between address of program, string
  716.     add  HL, DE             ; add to get address of string
  717.     ROM_CALL(D_ZM_STR)      ; print the string
  718.  
  719.         
  720.     ;#25 thing done
  721.  
  722.     ld   HL, $01            ; set text cursor position
  723.     ld   ($8333), HL
  724.     ld   HL, $0F
  725.     ld   ($8334), HL 
  726.     
  727.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  728.     ld   DE, Jim26             ; get difference between address of program, string
  729.     add  HL, DE             ; add to get address of string
  730.     ROM_CALL(D_ZM_STR)      ; print the string
  731.  
  732.  
  733.     ld   HL, $48            ; set text cursor position
  734.     ld   ($8333), HL
  735.     ld   HL, $0F
  736.     ld   ($8334), HL 
  737.     
  738.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  739.     ld   DE, Jim26a             ; get difference between address of program, string
  740.     add  HL, DE             ; add to get address of string
  741.     ROM_CALL(D_ZM_STR)      ; print the string
  742.  
  743.  
  744.    ;#26 thing done
  745.     
  746.     ld   HL, $01            ; set text cursor position
  747.     ld   ($8333), HL
  748.     ld   HL, $16  
  749.     ld   ($8334), HL    
  750.     
  751.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  752.     ld   DE, Jim27             ; get difference between address of program, string
  753.     add  HL, DE             ; add to get address of string
  754.     ROM_CALL(D_ZM_STR)      ; print the string
  755.     
  756.     ld   HL, $48            ; set text cursor position
  757.     ld   ($8333), HL
  758.     ld   HL, $16  
  759.     ld   ($8334), HL    
  760.     
  761.     ld   HL, (PROGRAM_ADDR) ; get program's memory address
  762.     ld   DE, Jim27a             ; get difference between address of program, string
  763.     add  HL, DE             ; add to get address of string
  764.     ROM_CALL(D_ZM_STR)      ; print the string
  765.     ;#27 thing done   
  766.     JUMP_(GetLoop3)
  767. Cont4    
  768.     ret
  769. GetLoop:                    ; wait for keypress 
  770.     call GET_KEY 
  771.     CP   $37
  772.     jr   z, Cont4a
  773.     CP   $38 
  774.     jr   z, Conta         ; if no key, try again     
  775.     jr   GetLoop
  776. Conta
  777.     JUMP_(Cont)
  778. Cont2a
  779.     JUMP_(Cont2)
  780. Cont3a
  781.     JUMP_(Cont3)
  782. Cont4a
  783.     JUMP_(Cont4)
  784. GetLoop1:                    ; wait for keypress 
  785.     call GET_KEY
  786.     CP   $37
  787.     jr   z, Cont4a 
  788.     CP   $38 
  789.     jr   z, Cont2a         ; if no key, try again     
  790.     jr   GetLoop1    
  791. GetLoop2:                    ; wait for keypress 
  792.     call GET_KEY
  793.     CP   $37
  794.     jr   z, Cont4a 
  795.     CP   $38 
  796.     jr   z, Cont3a         ; if no key, try again     
  797.     jr   GetLoop2    
  798. GetLoop3:                    ; wait for keypress 
  799.     call GET_KEY
  800.     CP   $37
  801.     jr   z, Cont4a 
  802.     CP   $38 
  803.     jr   z, Cont4a         ; if no key, try again     
  804.     jr   GetLoop3                    
  805. Name
  806.     .db "NAME", 0
  807. Formula
  808.     .db "FORMULA", 0
  809. Jim1: 
  810.     .db "Acetic acid", 0   
  811. Jim1a:
  812.     .db "HC2H3O2", 0 
  813. Jim2:
  814.     .db "Ammonium ion", 0
  815. Jim2a:
  816.     .db "NH4 OX:+1", 0
  817. Jim3: 
  818.     .db "Arsenic acid", 0
  819. Jim3a:
  820.     .db "H3AsO4", 0
  821. Jim4:
  822.     .db "Ascorbic acid", 0
  823. Jim4a:
  824.     .db "H2C6H6O6", 0
  825. Jim5: 
  826.     .db "Benzoic acid", 0
  827. Jim5a: 
  828.     .db "HC7H5O2", 0
  829. Jim6:
  830.     .db "Boric acid", 0
  831. Jim6a:
  832.     .db "H3BO3", 0
  833. Jim7:
  834.     .db "Carbonic acid", 0
  835. Jim7a:
  836.     .db "H2CO3", 0
  837. Jim8:
  838.     .db "Chlorous acid", 0
  839. Jim8a:
  840.     .db "HClO2", 0
  841. Jim9:
  842.     .db "Citric Acid", 0
  843. Jim9a:
  844.     .db "H3C6H5O7", 0
  845. Jim10:
  846.     .db "Formic acid", 0
  847. Jim10a:
  848.     .db "HCO2H", 0
  849. Jim11:
  850.     .db "Hydrated Al(III) ion", 0
  851. Jim11a:
  852.     .db "[AL(H2O)6] OX:+3", 0
  853. Jim12:
  854.     .db "Hydrocyanic acid", 0
  855. Jim12a:
  856.     .db "HCN", 0
  857. Jim13:
  858.     .db "Hydrofluoric acid", 0
  859. Jim13a:
  860.     .db "HF", 0
  861. Jim14:
  862.     .db "Hydrogen sulfate ion", 0
  863. Jim14a:
  864.     .db "HSO4 OX:-1", 0
  865. Jim15:
  866.     .db "Hydrosulfuric acid", 0
  867. Jim15a:
  868.     .db "H2S", 0
  869. Jim16:
  870.     .db "Hypobromous acid", 0
  871. Jim16a:
  872.     .db "HOBr", 0
  873. Jim17:
  874.     .db "Hypochlorous acid", 0
  875. Jim17a:
  876.     .db "HOCl", 0
  877. Jim18:
  878.     .db "Hypoiodous acid", 0
  879. Jim18a
  880.     .db "HOI", 0
  881. Jim19:
  882.     .db "Lactic acid", 0
  883. Jim19a:
  884.     .db "HC3H5O3", 0
  885. Jim20:
  886.     .db "Monocloracetic acid", 0
  887. Jim20a:
  888.     .db "HC2H2ClO2", 0
  889. Jim21:
  890.     .db "Nitrous acid", 0
  891. Jim21a:
  892.     .db "HNO2", 0
  893. Jim22:
  894.     .db "Oxalic acid", 0
  895. Jim22a:
  896.     .db "H2C2O4", 0
  897. Jim23:
  898.     .db "Phenol", 0
  899. Jim23a:
  900.     .db "HOC6H5", 0
  901. Jim24:
  902.     .db "Phosphoric acid", 0
  903. Jim24a:
  904.     .db "H3PO4", 0
  905. Jim25:
  906.     .db "Propanoic acid", 0
  907. Jim25a:
  908.     .db "HC3H5O2", 0
  909. Jim26:
  910.     .db "Sulfuric acid", 0
  911. Jim26a:
  912.     .db "H2SO4", 0
  913. Jim27:
  914.     .db "Sulfurous acid", 0
  915. Jim27a:    
  916.     .db "H2SO3", 0
  917. .end
  918.