cihan7 - LDY #BATBASE LDS $00,Y LDAA NOT LDAB #$20...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 NAMROUNDROBIN The name of the program is RoundRobin RTEQU$0100 SPTBASEEQU$0101 NOTEQU$0000 BATBASEEQU$0001 ORG $A000 TASK1 LOOP1LDAA #$3F Making Beep Sound LOOP12LDAB #$FF LOOP11DECB BNE LOOP11 DECA BNE LOOP12 LDAA #$07 JSR $FFB8 BRA LOOP1 B ORG $A100 TASK2 LOOP2LDAA #$FF Printing letter 'e' to output screen LOOP22LDAB #$FF LOOP21DECB BNE LOOP21 DECA BNE LOOP22 LDAA #$65 JSR $FFB8 BRA LOOP2 B ORG $A200 TASK3 LOOP3LDAA #$7F Blinking LED connected to PA6 pin LOOP32LDAB #$FF of 68HC11 I/O Port LOOP31DECB BNE LOOP31 DECA BNE LOOP32 LDAA #$40 EORA $1000 STAA $1000 BRA LOOP3 B ORG $00D0 Jumping Initialization SBR JMP ISR i.e. Initialization vector ORG $8000 MAIN Program begins LDS #$9000 LDAA #$80 STAA $1024 STAA $1025 SEI S INITLDAA #$01 Initialization Subroutine STAA RT
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 LDX #SPTBASE LDAB NOT LDY #$0000 ABY LDAA #$B0 LDAB #$16 IN_LP1STD $00,X Loop for SPT[i]<- B000 + (ix20) - A ADDD #$20 INX INX DEY BNE IN_LP1 LDX #$B01E
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: LDY #BATBASE LDS $00,Y LDAA NOT LDAB #$20 IN_LP2STS $00,X Loop for MEMBW[B000 + (ix20) - 2]&lt;- BAT[i] INY INY LDS $00,Y ABX DECA BNE IN_LP2 LDX #$B017 LDAA NOT LDAB #$20 IN_LP3CLR $00,X Loop for MEMB[B000 + (ix20) - 9]&lt;- 00 i.e. clearing ABX DECA BNE IN_LP3 CLI LDS $0101 load SPTBASE i.e. first task's SP RTI R JSR $FF7C J ISRSEI Interrupt Subroutine LDX #SPTBASE Saving SP of interrupted task DEX i.e. SPT[RT]&lt;- SP LDAB RT LSLB DECB ABX STS $00,X INC RT RT&lt;- RT +1 LDAA NOT Sheet1 Page 3 CMPA RT check if RT &gt; NOT BHS SKIP CLR RT if RT &gt; NOT then RT&lt;- 01 else Branch to SKIP INC RT SKIPLDAB RT Load the SP of current task to be executed LSLB SP &lt;- SPT[RT] DECB LDX #SPTBASE DEX ABX LDS $00,X L LDAA #$80 clearing Interrupt Flags STAA $1024 STAA $1025 CLI back to execution RTI END...
View Full Document

Page1 / 3

cihan7 - LDY #BATBASE LDS $00,Y LDAA NOT LDAB #$20...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online