Shop OBEX P1 Docs P2 Docs Learn Events
POP's setting of C and Z flags, I'd like it changed. Anyone use it? - Page 2 — Parallax Forums

POP's setting of C and Z flags, I'd like it changed. Anyone use it?

2»

Comments

  • evanhevanh Posts: 15,126
    Appreciated Chip.

  • Just to confirm, but after an interrupt routine is called C&Z still get stored and restored with the old PC right?
  • __red__ wrote: »
    Just to confirm, but after an interrupt routine is called C&Z still get stored and restored with the old PC right?

    Correct
  • Awesome, thanks for your patience.
  • evanhevanh Posts: 15,126
    Ha, that's cool. ISR return is just an alias of the linking instruction. And it has wcz encoded.

  • TonyB_TonyB_ Posts: 2,108
    edited 2019-01-14 21:40
    deleted
  • Opcodes check out Ok in Pnut
    dat	org
    
    	pusha	0
    	pushb	0
    	popa	0
    	popb	0
    {
    00000- 61 01 64 FC E1 01 64 FC 5F 01 04 FB DF 01 04 FB   'a.d...d._.......'
    
    '61 01 64 FC
    1111 1100011 001 000000000 101100001	'PUSHA 0
    
     E1 01 64 FC
    1111 1100011 001 000000000 111100001	'PUSHB	0
    
     5F 01 04 FB
    1111 1011000 001 000000000 101011111	'POPA 	0
    
     DF 01 04 FB
    1111 1011000 001 000000000 111011111	'POPB	0
    
    EEEE 1100011 0L1 DDDDDDDDD 101100001 PUSHA   {#}D
    EEEE 1100011 0L1 DDDDDDDDD 111100001 PUSHB   {#}D
    
    EEEE 1011000 CZ1 DDDDDDDDD 101011111 POPA    D
    EEEE 1011000 CZ1 DDDDDDDDD 111011111 POPB    D
    
  • evanhevanh Posts: 15,126
    edited 2019-01-14 02:52
    Oh, I see. The main doc explains things. Note the ++ on push, and -- on pop:
    EEEE 1100011 0L1 DDDDDDDDD 101100001	PUSHA   {#}D	Write long in D[31:0] to hub address PTRA++.
    EEEE 1100011 0L1 DDDDDDDDD 111100001	PUSHB   {#}D	Write long in D[31:0] to hub address PTRB++.
    
    EEEE 1011000 CZ1 DDDDDDDDD 101011111	POPA    D        {WC/WZ/WCZ}	Read long from hub address --PTRA into D. C = MSB of long. *
    EEEE 1011000 CZ1 DDDDDDDDD 111011111	POPB    D        {WC/WZ/WCZ}	Read long from hub address --PTRB into D. C = MSB of long. *
    
Sign In or Register to comment.