Skip to content

Instantly share code, notes, and snippets.

@medvecky
Last active September 28, 2023 11:11
Show Gist options
  • Save medvecky/51b4b3c8b98a96db6baae862b6dd6304 to your computer and use it in GitHub Desktop.
Save medvecky/51b4b3c8b98a96db6baae862b6dd6304 to your computer and use it in GitHub Desktop.
Fractions calculator for Commodore 64 on 6510 assembly KIckAssembler (data)
usage_1:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Fractions Calculator"
.byte $00
usage_2:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Press any key to continue"
.byte $00
usage_3:
.byte $0e,$08
.encoding "petscii_mixed"
.text "or Q for exit"
.byte $00
menu_1:
.byte $0e,$08
.encoding "petscii_mixed"
.text "1. Simplifying"
.byte $00
menu_2:
.byte $0e,$08
.encoding "petscii_mixed"
.text "2. Mixed to improper"
.byte $00
menu_3:
.byte $0e,$08
.encoding "petscii_mixed"
.text "3. Multiplication"
.byte $00
menu_4:
.byte $0e,$08
.encoding "petscii_mixed"
.text "4. Dividing"
.byte $00
menu_5:
.byte $0e,$08
.encoding "petscii_mixed"
.text "5. Addition"
.byte $00
menu_6:
.byte $0e,$08
.encoding "petscii_mixed"
.text "6. Subtraction"
.byte $00
menu_7:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Q. Exit"
.byte $00
numerator_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Numerator:"
.byte $00
denominator_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Denominator:"
.byte $00
denominator_zero_error_message:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Wrong data: The denominator is zero."
.byte $00
whole_part_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Whole part:"
.byte $00
factor1_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input fist factor:"
.byte $00
factor2_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input second factor:"
.byte $00
dividend_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input dividend:"
.byte $00
divisor_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input divisor:"
.byte $00
term1_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input fist term:"
.byte $00
term2_prompt:
.byte $0e,$08
.encoding "petscii_mixed"
.text "Input second term:"
.byte $00
zero:
.byte $00, $00, $00, $00, $00
one:
.byte $81, $00, $00, $00, $00
counter:
.byte $0
n_string:
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
num1:
.byte $00, $00, $00, $00, $00
den1:
.byte $00, $00, $00, $00, $00
num2:
.byte $00, $00, $00, $00, $00
den2:
.byte $00, $00, $00, $00, $00
remainder:
.byte $00, $00, $00, $00, $00
gcd_result:
.byte $00, $00, $00, $00, $00
a:
.byte $00, $00, $00, $00, $00
b:
.byte $00, $00, $00, $00, $00
num1_result:
.byte $00, $00, $00, $00, $00
den1_result:
.byte $00, $00, $00, $00, $00
whole_part_result:
.byte $00, $00, $00, $00, $00
whole_part1:
.byte $00, $00, $00, $00, $00
lcm:
.byte $00, $00, $00, $00, $00
scale1:
.byte $00, $00, $00, $00, $00
scale2:
.byte $00, $00, $00, $00, $00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment