Sign in

username:

password:



Not a member?

Search rabbit-semi



Search tips

Subscribe to rabbit-semi



Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Rabbit-Semi | Rabbit 4000 assembly instruction question


Advertise Here

This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions, flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.

Rabbit 4000 assembly instruction question - "jeanyves.garneau" - Sep 1 13:15:32 2009

Hi,

I'm trying to figure how interrupts are handled for the BL4S200 for
DIO but the instruction "ld a, (iy+[_RSB_ISR_HANDLE]+enable)" is very
curious. Someone understand that? I understand it's for access member
of a structure but the _RSB_ISR_HANDLE is a struct!
Code example:
=============

; Scan ISR handles to find an interrupt handler function
ld b, RSB_MAX_ISR ; Get number of ISR handles in table
ld iy, _rsb_isr ; Set to base of ISR handle table
ld de, sizeof(_RSB_ISR_HANDLE)
_rsbpi_process_loop:
ld a, (iy+[_RSB_ISR_HANDLE]+enable)
or a
jr z, _rsbpi_next_isr

; ISR handle is enabled, see if it has IRQ flags raised
ld a, (iy+[_RSB_ISR_HANDLE]+rio) ; Get RIO index for this handle
ld a, (ix+a) ; Get status for this RIO chip
and a, (iy+[_RSB_ISR_HANDLE]+block) ; AND with block mask for this
handle
jr z, _rsbpi_next_isr ; If block not active, go to
next ISR

Thank you!

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )


Re: Rabbit 4000 assembly instruction question - robertbrichter - Sep 1 17:37:03 2009

--- In r...@yahoogroups.com, "jeanyves.garneau" wrote:
>
> Hi,
>
> I'm trying to figure how interrupts are handled for the BL4S200 for
> DIO but the instruction "ld a, (iy+[_RSB_ISR_HANDLE]+enable)" is very
> curious. Someone understand that? I understand it's for access member
> of a structure but the _RSB_ISR_HANDLE is a struct!

It's similar to the offsetof macro in C; it accesses a structure member's offset within a structure. IY points to the beginning of the structure.

------------------------------------



(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )