All pastes #564868 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-13 19:29 UTC
rendered paste body
main_loop:
    cmpa #0            // compare the counter's value to 0, if zero, branch 
    beq main_loop_end
    pshx
    jsr OUTSTRING      //push and pull x because OUTSTRING function changes x
    pulx
    deca
    jmp main_loop

main_loop_end:
    ldx #clr           // loading 16 spaces into IR x which will be used to clear LCD screen
    ldaa #1
    jsr LCDLINE
    ldx #getnum1
    jsr LCDLINE
    ldx #getnum1
    jsr OUTSTRING
    jsr OUTCRLF
    jsr GETCHAR
    jsr OUTCHAR
    suba #'0'
    staa num1
    ldx #clr
    ldaa #2
    jsr LCDLINE
    ldx #getnum2
    jsr LCDLINE
    ldx #getnum2
    jsr OUTCRLF
    jsr OUTSTRING
    jsr GETCHAR
    jsr OUTCHAR
    suba #'0'
    staa num2
    ldx #clr
    ldaa #1
    jsr LCDLINE
    ldx #yoursum
    jsr LCDLINE
    ldx #yoursum
    jsr OUTSTRING
    jsr OUTCRLF
    ldab num1
    addb num2
    clra
    jsr LCDINT
    jsr CONSOLEINT 
    ldx #clr
    ldaa #2
    jsr LCDLINE
    ldx #yourproduct      //Loads the "Product: "string into IR x
    jsr LCDLINE
    ldx #yourproduct
    jsr OUTSTRING
    jsr OUTCRLF
    ldaa num1
    ldab num2
    mul               //multiply the two numbers stored in a and b
    jsr LCDINT        //output to the LCD screen
    jsr CONSOLEINT    //output to the computer