We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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 ;--------------------------------------
The USING attribute does not switch register bank. It adjusts only the symbols AR0 - AR7 that are required for absolute registerbank addressing. Take a look to the Assembler/Utilities User's Guide for more information. Also the file C51\ASM\Template.A51 shows you how to switch registerbanks and how to apply the USING attribute.
While in debug, the psw can be expanded to show seven fields. Each of these fields is just one bit except the rs field which is two bits and can take values 0 to 3.