This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using "USING 0"directive

Hello All,

I am trying to use the assembler directive "using" but I don't see the expected results, the code is as follows

;--------------------------------------
name one

extrn code (loop2,loop3)

prog 	segment code


	cseg at 0
	using 0
	jmp start

	rseg prog
start:	mov sp,#30h

loop:
	mov r1,#1
	mov r2,#2
	lcall loop2
	lcall loop3
	jmp loop

	end
;--------------------------------------
name two

public loop2

	prg1 segment code

	rseg prg1
	using 1
loop2:
	mov r3,#3
	mov r4,#4
	ret

	end
;--------------------------------------
name three

public loop3

prg2 segment code

	rseg prg2
	using 2
loop3:
	mov r5,#5
	mov r6,#6
	ret

	end
;--------------------------------------

what I wanted to do in the above code is see the contents in different register banks.
and also to my surprise I saw only 7 bits in the psw register while debugging where is the other PSW4(register select bit)...?

Question
--------
Suppose I have a subroutine, which should use a different register bank and at the end of return it should reinitialize to the previous register bank...is there any other directive to do that or should I use push psw and pop pws ?

Rgds
Raj Shetgar

0