Sorry for that.
I can't see anything obviously wrong on your code and infact it works, provided initial declarations. My interrupt dummy entries are only optional.
My hardware is the 50$ DEMO908QB8 board from Axiom for Freescale, connected via on board USB P&E interface to Codewarrior.
I am not familiar with Cyclone Pro, but I liked P&E tools and CASM which I used for HC705 environment. Unfortunately Codewarrior assembly is much more complex than that required by CASM and not immediately easy to translate. .prm file is much C-like and it was hard for me to discover how it worked (it is still a bit misterious).
I suspect that you have some problem with the QB4 memory map or the vector initialization. Can you try to load my Codewarrior file to Cyclone Pro? I know it is supported and you shoud be able to operate simply changing the target hardware from my "class 7" to what needed by Cyclone Pro (I think "class 8"). And Codewarrior is free for this task...
At the end I tried to write the whole program, including declaration in (what I remember as) CASM fashion, I am not shure of it but it may work. I cannot test. It could be:
*********************************************
* QB4 TEST #1 sample program for 908qb4
*********************************************
; QB4 standard equates (excerpt)
PORTA EQU $00 ;I/O port A
PORTB EQU $01 ;I/O port B
DDRA EQU $04 ;Data direction port A
DDRB EQU $05 ;Data direction port B
OSCSC EQU $36
IntOSCm EQU %00000000 ;Set int. oscillator
ExtOSCm EQU %01000000 ;Set ext. oscillator
MHz4m EQU %00000000 ;Set int. clock to 4MHz
MHz8m EQU %00010000 ;Set int. clock to 8MHz
MHz12m8 EQU %00100000 ;Set int. clock to 12.8MHz
OSCTRM EQU $0038
OSCTRMDEFAULT EQU $FFC0 ;Factory preset oscill. trim factor
; Memory area equates
RAMStart EQU $0080 ;Start of on-chip RAM
ROMStart EQU $EE00 ;Start of on-chip FLASH
Vectors EQU $FFDE ;Interrupt vector area
ResetVec EQU $FFFE ;Reset vector address
; Program variables
ORG RAMStart ;RAM area allocations
*
*
************************************************
* Main program area
************************************************
ORG ROMStart
; COP is active by default to 262128 oscillator
; cycles (nearly 20ms)
; bset COPD,CONFIG1 ;Disables COP
Start rsp
lda OSCTRMDEFAULT
sta OSCTRM ;Preset oscill. trim factor
mov #(IntOSCm+MHz12m8),OSCSC
; Enables internal oscillator & set bus freq.
; Bus clock= 3.2MHz
test4 lda #%11111110
sta PORTB
main_loop:
test5 sta COPCTL ; manages COP
lda #%11111110
sta DDRB ; all PTB lines as output but PB0
lda PORTB
test7 eor #%11111110
sta PORTB ;toggle portb output
bra test5 ; Forever
************************************************
* Reset vector initialization
************************************************
ORG ResetVec
RESETV DW Start
Encoder