Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 19.83 KB | None | 0 0
  1. .section    .init
  2. .globl      _start
  3.  
  4. _start:
  5.  
  6.     b       main
  7.  
  8. .section    .text
  9.  
  10. main:
  11.  
  12.     mov     sp, #0x8000                     // SP
  13.     bl      EnableJTAG                      // JTAG
  14.     bl      InitUART                        // UART
  15.  
  16.  
  17.     ldr     r0, =creator                    // Chris, Jas, Alvin
  18.     mov     r1, #54                         // Allocates bytes
  19.     bl      WriteStringUART                 // Call print
  20.  
  21.     mov r7, #0                              // Setting r7 to 0 at the start of the program
  22.  
  23. parkingPrompt:
  24.  
  25.     mov r4, #0
  26.     mov r9, #0
  27.     mov r10, #0
  28.     mov r11, #0
  29.     mov r3, #0
  30.  
  31.     ldr     r0, =prompt                     // Asks user for hours
  32.     mov     r1, #96                         // Allocates bytes
  33.     bl      WriteStringUART                 // Call Print
  34.  
  35.     ldr     r0, =userInput                  // Buffer for user input
  36.     mov     r1, #256
  37.     bl      ReadLineUART                    // Input in r0
  38.  
  39.  
  40.     // Compare bits //
  41.  
  42.     cmp     r0, #1                          // Checks if user input == 1 byte
  43.     blt     printInputError                 // Input < 1
  44.     beq     firstDigit                      // Go to first digit
  45.  
  46.     cmp     r0, #2                          // Checks if user input == 2 bytes
  47.     beq     secondDigit                     // Go to second digit
  48.  
  49.     cmp     r0, #3                          // Checks if user input == 3 bytes
  50.     beq     thirdDigit                      // Go to third digit
  51.  
  52.     cmp     r0, #4                          // Checks if user input == 4 bytes
  53.     beq     fourthDigit                     // Go to fourth digit
  54.  
  55.     cmp     r0, #5                          // Checks if user input == 5 bytes
  56.     bge     printBoundError                 // Out of bound error
  57.  
  58.  
  59.  
  60. printInputError:
  61.  
  62.     ldr     r0, =inputError                 // Error message for invalid characters
  63.     mov     r1, #77                         // Allocates bytes
  64.     bl      WriteStringUART                 // Prints
  65.  
  66.   b parkingPrompt
  67.  
  68.  
  69.  
  70. printBoundError:
  71.  
  72.     ldr     r0, =boundError                 // Error message for out of bound integers
  73.     mov     r1, #51                         // Allocates bytes
  74.     bl      WriteStringUART                 // Prints
  75.  
  76.   b parkingPrompt
  77.  
  78.  
  79.  
  80. firstDigit:
  81.  
  82.   ldr r0, =userInput                // Address of Buffer
  83.   ldrb r1, [r0]                     // Loading the first character
  84.  
  85.   cmp r1, #81                       // Compares the one digit to ASCII value for q
  86.   beq ExitProgram
  87.  
  88.   cmp r1, #113                      // Compares the one digit to ASCII value for Q
  89.   beq ExitProgram
  90.  
  91.   cmp r1, #49                       // Compares r1 to 1
  92.   blt printInputError
  93.  
  94.   cmp r1, #57                       // Compares r1 to 9
  95.   bgt printInputError
  96.  
  97.   b storeOneNumber
  98.  
  99.  
  100.  
  101. secondDigit:
  102.  
  103.     ldr r0, =userInput                  // Loading the buffer
  104.     ldrb r1, [r0, #0]                   // Loading the first byte of the buffer
  105.  
  106.     cmp r1, #45                         // Comparing it to the ascii value for a "-"
  107.     beq checkNextDigit                  // Branch out to a check for -1 if true
  108.  
  109.     ldr r0, =userInput                  // Address of the buffer
  110.     ldrb r1, [r0, #1]                   // Loading the second character onto r1
  111.  
  112.     cmp r1, #57                         // Comparing to see if the second digit is a ascii character greater than 9
  113.     bgt printInputError                 // Branch to an error message because this shows the byte was a non-number character
  114.  
  115.     cmp r1, #48                         // Comparing to see if the second digit is a ascii character less than 0
  116.     blt printInputError                 // Branch to error message
  117.  
  118.     ldr r0, =userInput                  // Address of Buffer
  119.     ldrb r1, [r0, #0]                   // Loading the first character onto r1
  120.  
  121.     cmp r1, #48                         // Compare to see if the input is a number and not other characters
  122.     blt printInputError
  123.  
  124.     cmp r1, #50                         // Checking if the first character is greater than 2
  125.     bgt printInputError                 // Branch to error if it is greater than 2
  126.     beq twoDigitCheck                   // Branch to check if its less than 24
  127.  
  128.     b storeTwoNumber
  129.  
  130.  
  131. twoDigitCheck:
  132.  
  133.     ldr r0, =userInput                  // Loading the buffer
  134.     ldrb r1, [r0, #1]                   // Loading the first second byte
  135.  
  136.     cmp r1, #52                         // Comparing the second byte to the number 2
  137.     bgt printInputError                 // If its greater than it will branch to an error
  138.     b storeTwoNumber                    // Branch to store
  139.  
  140.  
  141. thirdDigit:
  142.     ldr r0, =userInput                  // Loading the userInput buffer
  143.     ldrb r1, [r0, #1]                   // Loading the second byte
  144.  
  145.     cmp r1, #46                         // Checking to see if the second byte is a "."
  146.     bne printInputError
  147.  
  148.     ldr r0, =userInput                  // Loading the buffer
  149.     ldrb r1, [r0, #0]                   // Storeing the first byte onto r1
  150.  
  151.     cmp r1, #49                         // Compares r1 to 1
  152.     blt printInputError
  153.  
  154.     cmp r1, #57                         // Compares r1 to 9
  155.     bgt printInputError
  156.  
  157.     ldr r0, =userInput                  // Loads the userInput buffer
  158.     ldrb r1, [r0, #2]                   // Loads the third byte onto r1
  159.  
  160.     cmp r1, #57                         // Check to see if the third byte is a 9
  161.     beq incrementTwoDigit
  162.  
  163.     cmp r1, #48                         // Compare to 0
  164.     beq storeOneNumber
  165.  
  166.     b increment
  167.  
  168.  
  169.  
  170. fourthDigit:
  171.     ldr r0, =userInput                  // Loads the userInput buffer
  172.     ldrb r1, [r0, #2]                   // Loads the third byte
  173.  
  174.     cmp r1, #46                         // Check to see if its a "."
  175.     bne printInputError
  176.  
  177.  
  178.     ldr r0, =userInput                  // Loads buffer
  179.     ldrb r1, [r0, #1]                   // Loads second byte
  180.  
  181.     cmp r1, #48                         // Compares r1 to 0
  182.     blt printInputError
  183.  
  184.     cmp r1, #57                         // Compares r1 to 9
  185.     bgt printInputError
  186.  
  187.  
  188.     ldr r0, =userInput                  // loads userInput buffer
  189.     ldrb r1, [r0, #0]                   // Loads teh first byte
  190.  
  191.  
  192.     cmp r1, #49                         // Compares r1 to 1
  193.     blt printInputError
  194.  
  195.     cmp r1, #50                         // Compares r1 to 2
  196.     bgt printInputError
  197.     beq fourByteCheck
  198.  
  199.     ldr r0, =userInput                  // Loads userInput buffer
  200.     ldrb r1, [r0, #3]                   // Loads the fourth byte
  201.  
  202.     cmp r1, #57                         // Compares to 9
  203.     bgt printInputError                 // Branch to error
  204.  
  205.     cmp r1, #48                         // Compares the byte to 0
  206.     beq storeTwoNumber                  // branch if equal
  207.  
  208.     bgt incrementFourByte              
  209.  
  210.  
  211. fourByteCheck:
  212.     ldr r0, =userInput                  // loading the buffer
  213.     ldrb r1, [r0, #1]                   // Loading the second byte onto r1
  214.  
  215.     cmp r1, #52                         // Comparing r1 to 4
  216.     bgt printInputError
  217.  
  218.  
  219.     ldr r0, =userInput                  // Loading the buffer
  220.     ldrb r1, [r0, #3]                   // Loading the fourth byte onto r1
  221.  
  222.     cmp r1, #48                         // comparing to 0
  223.     beq storeTwoNumber
  224.     bgt incrementFourByte
  225.  
  226.  
  227. incrementFourByte:
  228.     ldr r0, =userInput                  // Loading the buffer
  229.     ldrb r1, [r0, #1]                   // Loading the second byte
  230.  
  231.     cmp r1, #57                         // Comparing r1 to 9 to see if I have to increment both digits
  232.     beq doubleIncrement
  233.  
  234.     ldr r0, =userInput                  // Loading Buffer
  235.     ldrb  r10, [r0, #1]                 // Loading the byte onto r1
  236.  
  237.     sub r10, r10, #47                   // Subtracting 47 to convert from ASCII to int that is being incremented
  238.  
  239.     ldr r0, =userInput                  // Loading the buffer
  240.     ldrb r4, [r0, #0]                   // loading the first byte onto r4
  241.  
  242.     sub r4, r4, #48                     // Converting r4 to an integer
  243.  
  244.     b timesTen
  245.  
  246.  
  247. doubleIncrement:
  248.     mov r4, #20                         // making r4 20
  249.  
  250.     b calcTwoDigit
  251.  
  252.  
  253. increment:
  254.     ldr r0, =userInput                  // Loading Buffer
  255.     ldrb  r1, [r0, #0]                  // Loading the byte onto r1
  256.     ldr r0, =rawIntBuffer               // Loading the integer buffer
  257.     sub r1, r1, #47                     // Subtracting 48 to convert from ASCII to int
  258.     strb r1, [r0, #0]                   // Storing the integer byte onto r1
  259.  
  260.     b calcOneDigit
  261.  
  262. incrementTwoDigit:
  263.     mov r4, #10                         // Making r4 10
  264.  
  265.     b calcTwoDigit
  266.  
  267. checkNextDigit:
  268.  
  269.     mov r4, #0                          // Resetting r4 to 0
  270.  
  271.     ldr r0, =userInput                  // Loading the buffer
  272.     ldrb r1, [r0, #1]                   // loading the second byte
  273.  
  274.     cmp r1, #49                         // comparing to 1
  275.     beq people
  276.    
  277.     b printInputError
  278.  
  279.  
  280. storeOneNumber:
  281.  
  282.   ldr r0, =userInput                    // Loading Buffer
  283.   ldrb  r1, [r0, #0]                    // Loading the byte onto r1
  284.   ldr r0, =rawIntBuffer                 // Loading the integer buffer
  285.   sub r1, r1, #48                       // Subtracting 48 to convert from ASCII to int
  286.   strb r1, [r0, #0]                     // Storing the integer byte onto r1
  287.  
  288.   b calcOneDigit
  289.  
  290.  
  291. storeTwoNumber:
  292.  
  293.     ldr r0, =userInput                  // Loading the buffer
  294.     ldrb r4, [r0, #0]                   // Loading the first byte onto r4
  295.  
  296.     sub r4, r4, #48                     // Converting to int
  297.  
  298.     ldr r0, =userInput                  // Loading the buffer
  299.     ldrb r10, [r0, #1]                  // Loading the second byte onto r10
  300.  
  301.     sub r10, r10, #48                   // Converting to to int
  302.  
  303.     b timesTen
  304.  
  305.  
  306. calcOneDigit:
  307.  
  308.   ldr r0, =rawIntBuffer                 // Loading the int onto the r0
  309.   ldrb r4, [r0, #0]                     // Loading the first byte
  310.  
  311.   cmp r4, r5                            // Comparing if my value is lower than the current min
  312.   blt setMin
  313.  
  314.   cmp r4, r6                            // Comparing if my value is higher than the current max
  315.   bgt setMax
  316.  
  317.   b continue
  318.  
  319.  
  320. calcTwoDigit:
  321.  
  322.     cmp r4, r5                          // Comparing if my value is lower than the current min
  323.     blt setMin
  324.  
  325.     cmp r4, r6                          // Comparing if my value is higher than the current max
  326.     bgt setMax
  327.  
  328.     b continue
  329.  
  330. continue:
  331.     add r12, r12, r4                    // Incrementing r12 by r4
  332.  
  333.     cmp r4, #2                          // Comparing to see if it less than or equal to two
  334.     ble twoHourParking
  335.  
  336.     cmp r4, #20                         // Comparing to see if it is more than the max parking amount
  337.     bgt maxParking
  338.  
  339.  
  340.     sub r3, r4, #2                      // Subtracting 2 from the total number of hours parked to calculate price
  341.  
  342.     mov r4, #0                          // Setting the incremental counter back to 0
  343.     mov r9, #0                          // Setting r9 to 0
  344.  
  345.   b calcAfterDecSet
  346.  
  347.  
  348. calcBefore:
  349.     add r4, r4, #1                      // Incrementing the counter
  350.     add r11, r11, #1                    // Adding 1 to the before the decimal value each iteration
  351.  
  352.     b calcBeforeDecSet
  353.  
  354.  
  355.  
  356. calcAfter:
  357.     add r4, r4, #1                      // Incrementing the counter
  358.     add r9, r9, #5                      // Adding 5 to r9 each iteration
  359.  
  360.     b calcAfterDecSet
  361.  
  362.  
  363.  
  364. calcAfterDecSet:
  365.     cmp r3, r4                          // Comparing the number of hours - 2 and the counter
  366.     bgt calcAfter
  367.  
  368.     mov r4, #0                          // Resetting the counter to 0
  369.  
  370.     cmp r9, #5                          // Checking to see if r9 is not equal to 5
  371.     bne split
  372.  
  373.     b calcBeforeDecSet
  374.  
  375.  
  376. calcBeforeDecSet:
  377.   cmp r3, r4                            // Comparing the number of hours - 2 and the counter
  378.     bgt calcBefore
  379.  
  380.     mov r4, #0                          // Resetting the counter to 0
  381.  
  382.     add r11, r11, #5                    // Adding $5 for the first two hours of parking
  383.  
  384.     mov r10, #0
  385.     cmp r11, #9                         // Comparing r11 and 9
  386.     bgt splitBeforeDigit
  387.  
  388.     b   printPrice
  389.  
  390.  
  391. setMin:
  392.   mov r5, r4                                    // Setting the min register to the current min
  393.  
  394.     cmp r4, r6                                  // Comparing the current amount of hours and the previous max
  395.     bgt setMax
  396.  
  397.     b continue
  398.  
  399. setMax:
  400.   mov r6, r4                            // Setting the max register to the current max
  401.   b continue
  402.  
  403. maxParking:
  404.   add r8, r8, r1                        // Incrementing the total amount of money made
  405.   add r7, r7, #1                        // Incrementing the total number of people
  406.  
  407.     ldr r0, =dollar
  408.     mov r1, #1
  409.     bl WriteStringUART
  410.  
  411.     mov r4, #51
  412.     ldr r0, =printValue
  413.     strb r4, [r0]
  414.     ldr r0, =printValue
  415.     mov r1, #1
  416.     bl WriteStringUART
  417.  
  418.     mov r4, #51
  419.     ldr r0, =printValue
  420.     strb r4, [r0]
  421.     ldr r0, =printValue
  422.     mov r1, #1
  423.     bl WriteStringUART
  424.  
  425.     b parkingPrompt
  426.  
  427.  
  428.  
  429. twoHourParking:
  430.  
  431.   ldr r0, =rawIntBuffer
  432.   mov r1, #5
  433.  
  434.   add r8, r8, r1          // Incrementing the total amount spend counter
  435.  
  436.   add r1, r1, #48
  437.   strb r1, [r0]
  438.   mov r1, #33
  439.   strb r1, [r0, #1]
  440.  
  441.   b printOneD
  442.  
  443. splitPeople:
  444.     sub r7, r7, #10
  445.     add r4, r4, #1
  446.  
  447. people:
  448.     cmp r7, #9
  449.     bgt splitPeople
  450.  
  451.     ldr r0, =customers
  452.     mov r1, #29
  453.     bl WriteStringUART
  454.  
  455.  
  456.     add r4, r4, #48
  457.     ldr r0, =printValue
  458.     strb r4, [r0, #0]
  459.     ldr r0, =printValue
  460.     mov r1, #1
  461.     bl WriteStringUART
  462.  
  463.     sub r4, r4, #48
  464.  
  465.     add r7, r7, #48
  466.     ldr r0, =printValue
  467.     strb r7, [r0, #0]
  468.     ldr r0, =printValue
  469.     mov r1, #1
  470.     bl WriteStringUART
  471.  
  472.     sub r7, r7, #48
  473.  
  474.     b resetPeople
  475.  
  476. resetPeople:
  477.     mov r2, #0
  478.     add r2, r4, r4
  479.     add r2, r2, r2
  480.     add r2, r2, r2
  481.     add r2, r2, r4
  482.     add r4, r2, r4
  483.     mov r2, #0
  484.  
  485.     add r7, r7, r4
  486.     mov r4, #0
  487.  
  488.     b chargedPrint
  489.  
  490.  
  491. splitCharged:
  492.     sub r8, r8, #10
  493.     add r4, r4, #1
  494.  
  495. chargedPrint:
  496.  
  497.     cmp r8, #9
  498.     bgt splitCharged
  499.  
  500.     ldr r0, =charged
  501.     mov r1, #38
  502.     bl WriteStringUART
  503.  
  504.     ldr r0, =dollar
  505.     mov r1, #1
  506.     bl WriteStringUART
  507.  
  508.  
  509.     add r4, r4, #48
  510.     ldr r0, =printValue
  511.     strb r4, [r0, #0]
  512.     ldr r0, =printValue
  513.     mov r1, #1
  514.     bl WriteStringUART
  515.  
  516.     mov r4, #0
  517.  
  518.     add r8, r8, #48
  519.     ldr r0, =printValue
  520.     strb r8, [r0, #0]
  521.     ldr r0, =printValue
  522.     mov r1, #1
  523.     bl WriteStringUART
  524.  
  525.     sub r8, r8, #48
  526.  
  527.     ldr r0, =decimal
  528.     mov r1, #1
  529.     bl WriteStringUART
  530.  
  531.     b printMinimum
  532.  
  533.  
  534. splitMin:
  535.     sub r5, r5, #10
  536.     add r4, r4, #1
  537.  
  538.  
  539. printMinimum:
  540.     cmp r5, #9
  541.     bgt splitMin
  542.  
  543.     ldr r0, =minPrint
  544.     mov r1, #27
  545.     bl WriteStringUART
  546.  
  547.  
  548.     add r4, r4, #48
  549.     ldr r0, =printValue
  550.     strb r4, [r0, #0]
  551.     ldr r0, =printValue
  552.     mov r1, #1
  553.     bl WriteStringUART
  554.  
  555.     sub r4, r4, #48
  556.  
  557.     add r5, r5, #48
  558.     ldr r0, =printValue
  559.     strb r5, [r0, #0]
  560.     ldr r0, =printValue
  561.     mov r1, #1
  562.     bl WriteStringUART
  563.  
  564.     sub r5, r5, #48
  565.  
  566.     b resetMin
  567.  
  568. resetMin:
  569.     mov r2, #0
  570.     add r2, r4, r4
  571.     add r2, r2, r2
  572.     add r2, r2, r2
  573.     add r2, r2, r4
  574.     add r4, r2, r4
  575.     mov r2, #0
  576.  
  577.     add r5, r5, r4
  578.  
  579.     mov r4, #0
  580.  
  581.     b printMaximum
  582.  
  583.  
  584. splitMax:
  585.     sub r6, r6, #10
  586.     add r4, r4, #1
  587.  
  588.  
  589. printMaximum:
  590.     cmp r6, #9
  591.     bgt splitMax
  592.  
  593.     ldr r0, =maxPrint
  594.     mov r1, #27
  595.     bl WriteStringUART
  596.  
  597.  
  598.     add r4, r4, #48
  599.     ldr r0, =printValue
  600.     strb r4, [r0, #0]
  601.     ldr r0, =printValue
  602.     mov r1, #1
  603.     bl WriteStringUART
  604.  
  605.     sub r4, r4, #48
  606.  
  607.     add r6, r6, #48
  608.     ldr r0, =printValue
  609.     strb r6, [r0, #0]
  610.     ldr r0, =printValue
  611.     mov r1, #1
  612.     bl WriteStringUART
  613.  
  614.     sub r6, r6, #48
  615.  
  616.     b resetMax
  617.  
  618. resetMax:
  619.     mov r2, #0
  620.     add r2, r4, r4
  621.     add r2, r2, r2
  622.     add r2, r2, r2
  623.     add r2, r2, r4
  624.     add r4, r2, r4
  625.     mov r2, #0
  626.  
  627.     add r6, r6, r4
  628.     mov r4, #0
  629.  
  630.     b setAverage
  631.  
  632. setAverage:
  633.  
  634.     ldr r0, =averagePrint
  635.     mov r1, #27
  636.     bl WriteStringUART
  637.  
  638.     udiv r2, r12, r7
  639.  
  640.     cmp r2, #9
  641.     bgt splitSetAverage
  642.  
  643.     b printAverage
  644.  
  645. splitAverage:
  646.     sub r2, r2, #10
  647.     add r4, r4, #1
  648.  
  649.  
  650. splitSetAverage:
  651.     cmp r2, #9
  652.     bgt splitAverage
  653.  
  654.     b printAverage
  655.  
  656. printAverage:
  657.  
  658.     add r4, r4, #48
  659.     ldr r0, =printValue
  660.     strb r4, [r0, #0]
  661.     ldr r0, =printValue
  662.     mov r1, #1
  663.     bl WriteStringUART
  664.  
  665.     add r2, r2, #48
  666.     ldr r0, =printValue
  667.     strb r2, [r0, #0]
  668.     ldr r0, =printValue
  669.     mov r1, #1
  670.     bl WriteStringUART
  671.  
  672.     mov r2, #0
  673.     mov r4, #0
  674.  
  675. timesTen:
  676.     mov r2, #0
  677.     add r2, r4, r4
  678.     add r2, r2, r2
  679.     add r2, r2, r2
  680.     add r2, r2, r4
  681.     add r4, r2, r4
  682.     mov r2, #0
  683.  
  684.     add r4, r4, r10
  685.  
  686.  
  687.     ldr r0, =rawIntBuffer
  688.     str r4, [r0]
  689.  
  690.     b calcTwoDigit
  691.  
  692. split:
  693.  
  694.     cmp r9, #10
  695.     bge subTen
  696.  
  697.     b calcBeforeDecSet
  698.  
  699. subTen:
  700.     sub r9, r9, #10
  701.     add r11, r11, #1
  702.     b   split
  703.  
  704. splitBefore:
  705.     sub r11, r11, #10
  706.     add r10, r10, #1
  707.     b   splitBeforeDigit
  708.  
  709.  
  710. splitBeforeDigit:
  711.     cmp r11, #10
  712.     bge splitBefore
  713.  
  714.     b printPrice
  715.  
  716.  
  717.  
  718. printPrice:
  719.  
  720.     ldr r0, =dollar
  721.     mov r1, #1
  722.     bl WriteStringUART
  723.  
  724.  
  725.     add r10, r10, #48
  726.     ldr r0, =printValue
  727.     strb r10, [r0, #0]
  728.     ldr r0, =printValue
  729.     mov r1, #1
  730.     bl WriteStringUART
  731.  
  732.     add r11, r11, #48
  733.     ldr r0, =printValue
  734.     strb r11, [r0, #0]
  735.     ldr r0, =printValue
  736.     mov r1, #1
  737.     bl WriteStringUART
  738.  
  739.     ldr r0, =decimal
  740.     mov r1, #1
  741.     bl WriteStringUART
  742.  
  743.     add r9, r9, #48
  744.     ldr r0, =printValue
  745.     strb r9, [r0, #0]
  746.     ldr r0, =printValue
  747.     mov r1, #1
  748.     bl WriteStringUART
  749.  
  750.     add r7, r7, #1
  751.  
  752.     mov r10, #0
  753.     mov r9, #0
  754.     mov r11, #0
  755.  
  756.     b parkingPrompt
  757.  
  758. printOneD:
  759.  
  760.   ldr r0, =dollar
  761.   mov r1, #1
  762.   bl WriteStringUART
  763.  
  764.   ldr r0, =rawIntBuffer
  765.   mov r1, #1
  766.   bl WriteStringUART
  767.  
  768.   add r7, r7, #1
  769.   b parkingPrompt
  770.  
  771.  
  772. .section    .data
  773.  
  774. haltLoop$:
  775.     b       haltLoop$                   // End
  776.  
  777.  
  778. ExitProgram:
  779.  
  780.   ldr r0, =Terminate
  781.   mov r1, #18
  782.   bl  WriteStringUART
  783.  
  784.  
  785. // Buffers //
  786.  
  787.  
  788. rawIntBuffer:
  789.   .rept 256
  790.   .byte 0
  791.   .endr
  792.  
  793.  
  794. buffer:
  795.   .rept 256
  796.   .byte 0
  797.   .endr
  798.  
  799.  
  800.  
  801. userInput:
  802.  
  803.     .rept   256
  804.     .byte   0
  805.     .endr
  806.  
  807. printValue:
  808.     .byte 0
  809.  
  810. // Strings //
  811.  
  812. customers:
  813.     .ascii "\n\rTotal number of customers: "       // 29 Characters
  814.  
  815. charged:
  816.     .ascii "\n\rTotal amount charged for customers: "       // 38 Characters
  817.  
  818. minPrint:
  819.     .ascii "\n\rMinimum number of hours: "       // 27 Characters
  820.  
  821. maxPrint:
  822.     .ascii "\n\rMaximum number of hours: "       // 27 Characters
  823.  
  824. averagePrint:
  825.     .ascii "\n\rAverage number of hours: "       // 27 Characters
  826.  
  827.  
  828. decimal:
  829.     .ascii "."      // 1 Characters
  830.  
  831. dollar:
  832.   .ascii "$"     // 1 Characters
  833.  
  834. Terminate:
  835.   .ascii  "\n\rQuitting Program"    // 18 Characters
  836.  
  837. prompt:
  838.     .ascii  "\n\rPlease enter the number of parking hours for the customer. Press -1 for Summary or q to exit\n\r"              // 96 Characters
  839.  
  840. creator:
  841.     .ascii "\n\rCreated by: Chris Chau, Jaskaran Sidhu, Alvin Cheung"                                                       // 54 Characters
  842.  
  843. inputError:
  844.     .ascii "\n\rInvalid Number! The number should be between 1 and 24 or -1 for the summary"                                // 77 Characters
  845.  
  846. boundError:
  847.     .ascii "\n\rNumber can only be between 1-24 or -1 for summary"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement