NY6 User Manual
Ver 1.3 2019/03/28
15
2.4 Address Pointer
The NY6 micro-controller contains a program counter (PC), a multi-function register pointer (RPT), 6 head
pointers (HVPR0~5) and 6 tail pointers (TVPR0~5) for channel 0~5 and 8 data pointers (DPR) which are
shared with interrupt stack (STK). Particularly, the address of DPR is indexed by CHNM register, but the
STK is nested type which starts from index 7 for STK0, ex. DPR0 is same address as STK7. The length of
each address pointer is 21-bit maximum, depends on the product parts. Users have to keep in mind that
the initial value of all the pointers is unknown, except the PC and RPT.
2.4.1 Program Counter (PC)
As a program instruction is executed, the PC will contain the address of the next program instruction to
be executed. PC is 18-bit wide for NY6A/NY6B and 21-bit wide for NY6C. The PC starts from the reset
vector (address 0x000000) after the system reset, and its value is increased by one every instruction
cycle unless changed by an interrupt or a branch instructions which are listed in table below. The
interrupt vector is at address 0x000010.
Inst./Event
Function
JMP Addr
Jump to {BANK, Addr}.
CALL Addr
Push the PC+2 to the STK and load {BANK, Addr} to PC.
Interrupt
Push PC+1 to STK automatically.
RET
Pop STK back to PC. Return to the main program from subroutine
IRET
Pop STK back to PC. Return to the main program from the interrupt routine.
Addr : 16-bit immediate address.
2.4.2 Stack (STK)
Eight level hardware push/pop stacks are available which are reacted to CALL or interrupt occurrence.
When an interrupt/CALL takes apart, the system pushes PC+1/PC+2 to STK automatically. When the
program returns to the main program from subroutine / the interrupt routine by RET / IRET instruction,
the system pops the STK back to the PC. Unused STK can be used as DPR. The STK max width is 18
bits for NY6A and 21 bits for NY6B/NY6C.
2.4.3 Multi-function Register Pointer (RPT)
As implied in the name, RPT are multi-function registers. There are at most six RPT that are RPT0,
RPT1, RPT2, RPT3, RPT4 and RPT5. RPT0~RPT4 are 4-bit wide and RPT5 is 1-bit wide, i.e. RPT5[0].
The RPT max width is 18 bits for NY6A/6B and 21 bits for NY6C. Users have to operate RPT in
coordination with instructions below.