auto-generating assembly code by variables found by script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting auto-generating assembly code by variables found by script
# 1  
Old 10-30-2012
auto-generating assembly code by variables found by script

Hi everybody

I'm working on a list of registers(flip-flops to be exact), now i need to extract some value from this list and use them as arguments to pass them to some assembly code
for example i have:
Code:
118   chain79  MASTER  (FF-LE)  FFFF  1975829  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr28_reg_q_reg_18      dff1  (TI,SO) 
119   chain79  MASTER  (FF-LE)  FFFF  1974997  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr02_reg_q_reg_18      dff1  (TI,SO) 
120   chain79  MASTER  (FF-LE)  FFFF  1974965  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr01_reg_q_reg_18      dff1  (TI,SO) 
121   chain79  MASTER  (FF-LE)  FFFF  1975861  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr29_reg_q_reg_18      dff1  (TI,SO) 
122   chain79  MASTER  (FF-LE)  FFFF  1975739  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr25_reg_q_reg_23      dff1  (TI,SO) 
275   chain78  MASTER  (FF-LE)  FFFF  1975978  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_lr_reg_q_reg_9          dff1  (TI,SO) 
276   chain78  MASTER  (FF-LE)  FFFF  1974689  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_exception_registers/exc_sprg1_reg_q_reg_9     dff1  (TI,SO) 
277   chain78  MASTER  (FF-LE)  FFFF  1975949  /TCK       F    FD1TQHVTT1   /platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_lr_reg_q_reg_10

I need to search for "/platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers
Code:
/gen_gpr0X1_reg_q_reg_Y1"

and then look if next line is similar, means that it should look like
Code:
"/platform/z0hn2p/z0h/z0h_cpu/cpu_dpath/rf_memblock/rf_general_registers/gen_gpr0X2_reg_q_reg_Y2"

and then extract X & Y from this list and use it in this assembly code (this is pseudo code i have also problem in some parts of this)
Code:
if [X2 != X1]
then
e_li rX1,-1 (In my assembly code means move rX2,FFFF )
e_li rx2,-1
e_lis rX2,0000 

else (this is my problem in this part since I don't know how to use power in script)
e_li rX1,2^Y1 (move 2^Y1 in rX1)
e_li rX2,2^Y2
e_lis rX2,0000

Thanks in advance for your help
Smilie

Last edited by vbe; 10-30-2012 at 01:59 PM.. Reason: code tags
# 2  
Old 10-30-2012
It seems a little vague where the keys are coming from, but you can do something like this:
Code:
while read f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 12
do
 case "$f10" in
 (*/gen_gpr0X1_reg_q_reg_Y1)
    echo "..."
    ;;
 (*)
    echo "..."
    ;;
 esac
done <in_file >out_file

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[perl script] print the assembly instruction and count the occurence

Hi, I have a input file(text file) with the following lines. 0x000000 0x5a80 0x0060 BRA.l 0x60 ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:24 0x000002 0x1bc5 RETI ;file:UserCall.s ;function:_user_call_table ;C_sourceLine:30 0x000003 0x6840 MOV R0L,R0L ;file:UserCall.s... (6 Replies)
Discussion started by: acdc
6 Replies

2. Programming

Understanding Assembly Code

As the title suggests, I want to better understand the following assembly code: section .text global main ; must be declared for linker (gcc) main: ; tell linker entry point mov edx, len ; message length mov ecx, msg ; message to write... (2 Replies)
Discussion started by: Azrael
2 Replies

3. Shell Programming and Scripting

Generating dynamic variables

Hi , i am unable to generate dynamic variables can any one please help me on the below issue j=1 {record_count_"$j"}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i` echo " record... (3 Replies)
Discussion started by: bhaskar v
3 Replies

4. Shell Programming and Scripting

Help with generating a script

I am a biologist who is new to linux and am having difficulty generating a script to do what I want it to do! I have tried basic grep commands, but even that does not give me back the data I want. I have many files that are all currently in .xslx and I'm not sure if they need to be .csv or .txt... (16 Replies)
Discussion started by: kellywilliams
16 Replies

5. Programming

Help with assembly code

I want make simple assembly code for some thing like this a^6+6a^2+2a and range of a is between -3 to 3. I tried but it is not working properly. As this is my first assembly program that I am going to try, I want some help with it. I found this example online but i dont want this kind of... (2 Replies)
Discussion started by: Learnerabc
2 Replies

6. Programming

Need assembly code for C program

Dear Buddies, I need assembly code for a compiled c program in unix. Kindly help me.... Thanking you in advance. (1 Reply)
Discussion started by: karthik537
1 Replies

7. Solaris

Generating a generic incremental code

Hi Gurus, I have several Solaris systems (say system a, system b,system c) which will connect to a windows system (system Z) using SFTP session. I have a 'txt' file on System Z , which has a simple numeric value on it(say 1) , If I have to increment this number with 1 (1+1 =2) irrespective of... (3 Replies)
Discussion started by: ramky79
3 Replies

8. Shell Programming and Scripting

why is this code generating syntax error?pls help

#!/bin/sh copy() { source=`stat -c %s $1` dest=0 cd $2 while ;do cp $1 $2 & pct=`((100 * $dest) / $source )` dest=`dest+1` echo -en ".$pct%\b\b\b" sleep 1 done } echo "starting now" copy /file1 /tmp (3 Replies)
Discussion started by: wrapster
3 Replies

9. Shell Programming and Scripting

How can I parse a record found in /etc/passwd into variables?

I am working with the Oracle 10.2.0.3 job scheduler on Solaris 10, and unfortunately, the scheduler executes scripts in such a way that several default shell environment variables are not defined. For example, $HOME, $USER, and $LOGNAME are missing. How can I parse the appropriate record in... (7 Replies)
Discussion started by: shew01
7 Replies
Login or Register to Ask a Question