Hi, I am Emon and it is my first time using EASy68k for a subject this semester. I don't have any experience using this program except for the examples given by the lecturer.
I've tried hard (seriously my brain is about to explode) and I've spent more than 5 hours on this 1 question and after multiple trails and errors I still can't figure out the right coding.
Please help point out my mistakes.
I've tried hard (seriously my brain is about to explode) and I've spent more than 5 hours on this 1 question and after multiple trails and errors I still can't figure out the right coding.
Please help point out my mistakes.
ORG $1000
START: ; first instruction of program
MOVE.B #%00000000, $E00012
MULA
CMP.B #%00000000, $E00012
BEQ SAL_LOW
BNE SAL_HIGH
SAL_LOW
BEQ DISPLAY_NOTHING
BNE SAL_HIGH
DISPLAY_NOTHING
MOVE.B #%00000000, $E00000
BRA MULA
SAL_HIGH
CMP.B #%00000001, $E00012
AND.B #%11000000, $E00012
BEQ DISPLAY_RETRACT
BNE S
BRA SAL_HIGH
DISPLAY_RETRACT
CMP.B $%00000000, $E00000
MOVE.B $%00110001, D6
MOVE.B $%01111001, D5
MOVE.B $%00000111, D4
MOVE.B $%00110001, D3
MOVE.B $%01110111, D2
MOVE.B $%00111001, D1
MOVE.B $%00000111, D0
S
CMP.B #%00000001, $E00012
NOT.B #%11000000, $E00012
BEQ DISPLAY_OUT
BNE SS
BRA S
DISPLAY_OUT
CMP.B $%00000000, $E00000
MOVE.B $%00111111, D2
MOVE.B $%00111110, D1
MOVE.B $%00000111, D0
SS
CMP.B #%00000001, $E00012
ORI.B #%10000000, $E00012
BEQ DISPLAY_ERROR
BRA SS
DISPLAY_ERROR
CMP.B $%00000000, $E00000
MOVE.B $%01111001, D4
MOVE.B $%00110001, D3
MOVE.B $%00110001, D2
MOVE.B $%00111111, D1
MOVE.B $%00110001, D0
BEQ PB
BRA PB
PB
CMP.B #$00000000, $E00012
BEQ DISPLAY_NOTHING
BNE S
*-----------------------------------------------------------
* A
* -----
* F| |B
* | G |
* -----
* E| |C
* | D |
* ----- .H
*
* Bit Number 7 6 5 4 3 2 1 0
* Segment H G F E D C B A
* bit patterns to form digits on readout
digits:
dc.b $3F digit 0
dc.b $06 digit 1
dc.b $5B digit 2
dc.b $4F digit 3
dc.b $66 digit 4
dc.b $6D digit 5
dc.b $7D digit 6
dc.b $07 digit 7
dc.b $7F digit 8
dc.b $6F digit 9
dc.b $77 digit A
dc.b $7C digit B
dc.b $39 digit C
dc.b $5E digit D
dc.b $79 digit E
dc.b $71 digit F
ds.w 0 force word boundary
*----------------------------------------------------------