![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New Coder ![]() Join Date: Jan 2004
Location: CA
Posts: 48
Thanks: 3
Thanked 0 Times in 0 Posts
![]() |
Assembly, programming interrupt service routines
i'm trying to write a program which involves two user programs, one trap routine and a interrupt service routine
the first user program simply calls trap routine x26 which waits for input, then enables the interrupt bit on KBSR. once a key is pressed, the second user program is supposed to start while program waits for more input. all the second user program does is output asterisks. its supposed to keep outputting asterisks while user program 1 is waiting for input...once 5 keys are pressed the program is halted right now, my program only takes in 5 keys and outputs them but the 2nd user program is never called upon and no asterisks are outputted. below is the code for the trap routine, can anyone help me out and let me know why the 2nd user program is never called? p.s. x3400 is the starting address of the 2nd user program Code:
.ORIG x3300 START LD R4, BIT ; load bit to enable KBSR STI R7, ADDR ; save PC/R7 to x32FF WAIT LDI R5, KBSR ; load KBSR to R5 BRzp WAIT ; wait for input LDI R0, KBDR ; load input to R0 ADD R5, R5, R4 ; enable interrupt bit STI R5, KBSR ; set KBSR LD R7, UP2 ; load starting address of UP2 JMP R7 ; return to UP2 ADDR .FILL x32FF ; address to store PC UP2 .FILL x3400 ; starting address of UP2 KBSR .FILL xFE00 ; address of KBSR KBDR .FILL xFE02 ; address of KBDR BIT .FILL #16384 ; bit to enable ready/interrupt .END |
|
|
|
|
|
PM User | #2 |
|
The Spaminator ![]() ![]() Join Date: Jun 2002
Location: USA
Posts: 7,288
Thanks: 1
Thanked 148 Times in 145 Posts
![]() ![]() |
What architecture is this for?
__________________
OracleGuy My Blog "... the VP of our third biggest account started sweating bullets in our latest project status conference when Roy stood up and asserted: 'We don’t code our products for SMACKTARDS.'" - Daily Victim #564 |
|
|
|
|
|
PM User | #3 |
|
Senior Coder ![]() Join Date: Oct 2005
Posts: 1,066
Thanks: 0
Thanked 39 Times in 38 Posts
![]() |
It looks like ARM.
The only thing I can tell is it looks like the only chance to break out of this loop is if it receives keyboard input. So the obvious question is, are you sure you're getting keyboard data? |
|
|
|
|
|
PM User | #4 |
|
New Coder ![]() Join Date: Jan 2004
Location: CA
Posts: 48
Thanks: 3
Thanked 0 Times in 0 Posts
![]() |
i am using an lc-3 simulator for these programs.
drhowarddrfine - yes, its getting keyboard data, everything works fine in my program until you hit the JMP R7 line, which is supposed to jump it to address x3400, but it jumps instead to the interrupt service routine (x3500) without ever going to x3400 (2nd user program) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|