Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   using the select macro (http://www.go4expert.com/forums/using-select-macro-t27767/)

eaglei22 10Feb2012 14:41

using the select macro
 
Hey guys, I'm working on an assignment where I am writing a loader in my class. We are to take in the object module, and decode it. I'm stuck with using the select.

I'm using xread to read in the data and storing it in character form. I structure my while/ select statement like this:

Quote:

*BUILD TABLES
*R1 = ESDENTRY BASE
*R5 = FOR COUNTER IN DO WHILE
*R8 = SDTABLE ADDRESS PASSED
*R9 = ERTABLE ADDRESS PASSED
****************************
*
BUILD STM R10,R7,BSAVE SAVE MAIN'S REGISTERS EXCEPT
* R8,R9 WHICH WILL PASS BACK
* PNTRS OF TABLES
*
XDECI R2,CARD+10 STORE NUMBER OF BYTES
STH R2,NUMBYTES OF INFO FROM ESD
*
LA R3,CARD+16 STARTING ADDRESS OF ESD
*
LA R5,1(R5) INCREASE COUNTER BY 1
ST R5,COUNTER USED IN DO WHILE
*
LA R7,8(R3) GET LOCATION OF TYPE CODE
ST R7,TYPE AND STORE INTO TYPE
MVC ESDCOUNT,CARD+14 GET AND STORE FIRST ESDID FROM CARD
*
*
*** COUNTER USED IN DOWHILE, INCREMENTS BY NUMBER OF BYTES STORED
*** IN TABLE AND COMPARES WITH "NUMBYTES" IN COLUMNS 11-12 OF ESD
*** CARD
*
DO WHILE=(CLC,NUMBYTES,GT,COUNTER)
SELECT CLI,TYPE,EQ
WHEN (X'00')
MVC 0(8,R8),0(R3) MOVES ESDNAME INTO SDTABLE
MVC 8(3,R8),9(R3) MOVES ESDADDR INTO SDTABLE
LA R8,12(R8) INCREMENTS PNTR OF SDTABLE
LA R3,16(R3) INCREMENTS PNTR ON CARD
LA R5,12(R5) INCREASE COUNTER
ST R5,COUNTER USED FOR DO WHILE
WHEN (X'02')
MVC 0(2,R9),ESDCOUNT STORE ESD ID IN ERTABLE
MVC 2(8,R9),0(R3) STORE ESDNAME IN ERTABLE
LA R9,10(R9) INCREMENT PNTR TO ERTABLE
LA R3,16(R3) INCREMENTS PNTR ON CARD
XDECI R6,ESDCOUNT CONVERTS TO BINARY
LA R6,1(R6) ADDS ONE
XDECO R6,ESDCOUNT STORES BACK AS CHAR FORM
LA R5,10(R5) INCREASE COUNTER
ST R5,COUNTER USED FOR DO WHILE
WHEN (X'05')
MVC 0(8,R8),0(R3) MOVES ESDNAME INTO SDTABLE
MVC 8(3,R8),9(R3) MOVES ESDADDR INTO SDTABLE
LA R8,12(R8) INCREMENTS PNTR OF SDTABLE
LA R3,16(R3) INCREMENTS PNTR ON CARD
LA R5,12(R5) INCREASE COUNTER
ST R5,COUNTER USED FOR DO WHILE
ENDSEL
ENDDO
SR R5,R5 TO RESET COUNTER
ST R5,COUNTER STORE VALUE
LM R10,R7,BSAVE RESTORE REGISTERS
BR R10 RETURN TO MAIN
*
*****************************************
*BUILD STORAGE AREA
*****************************************
BSAVE DS 14F
NUMBYTES DS H
COUNTER DC F'0'
TYPE DS X
ESDCOUNT DS CL2


For some reason it skips over my select statements and doesn't store anything in the tables I made. Since whats in the object module is all hex, and I take it in my buffer as character format.. and then transfer the "type" which is a one byte hex number either 00, 02, or 05.. that tells me if the esd card is er, cm, or sd.. I try to store it in a X constant, and read.. but it doesn;t seem to be working.. Any suggestions?
Maybe I'm doing it wrong?


All times are GMT +5.5. The time now is 02:17.