quartaela
April 18th, 2011, 04:28 PM
hi there i am working on a project with assembly programming and i am facing with a problem about displaying a number which have 2 digits. the main problem is if i have one digit number i can display but if i have 2 digit number the program displays the first digit. here is an example code which is in a subroutine. i used ASRA, LSRA and RORA but i can't fixed this problem.
DISPA:
JSR CLEARD
LDAA 20H
JSR PATCON
LDAB #40H
JSR DISPAT
LDAA 20H
CMPA #0FH
BLT DISPALEVEL1
ASRA
LDAB #80H
JSR DISPAT
DISPALEVEL1:
and the second problem is BLT code isn't working correctly. assume that in 20H there is a number bigger than 0FH, so it must be a 2 digit number. and if it is less than 0FH it must branch to DISPALEVEL1 but it executes the code above BLT if i replace BGT when the number is bigger than 0FH.
so how can i fix this problem_?. and thanks for your help anyway. : )
DISPA:
JSR CLEARD
LDAA 20H
JSR PATCON
LDAB #40H
JSR DISPAT
LDAA 20H
CMPA #0FH
BLT DISPALEVEL1
ASRA
LDAB #80H
JSR DISPAT
DISPALEVEL1:
and the second problem is BLT code isn't working correctly. assume that in 20H there is a number bigger than 0FH, so it must be a 2 digit number. and if it is less than 0FH it must branch to DISPALEVEL1 but it executes the code above BLT if i replace BGT when the number is bigger than 0FH.
so how can i fix this problem_?. and thanks for your help anyway. : )