Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
x=0
for(i=10;i<=30;i+=2){
j=0
while(j<=8){
x+=3
j++;
Posted
Comments
OriginalGriff 8-Jan-12 4:02am    
Your question (such as it is) does not appear to relate to the code fragment in any way.
Ignoring that your code is incomplete, and can't be converted to assembler because of that, it contains no "if..else..." block to convert...
Use the "Improve question" widget to edit your question and provide better information.
royayesepeed 8-Jan-12 6:38am    
how conver this slice of code to assembly code?
Amir Mahfoozi 8-Jan-12 4:55am    
This is only 6 line of multiple lines. please provide remaining lines.
royayesepeed 8-Jan-12 6:41am    
just these slice

1 solution

Assuming locations for your block ends, and that you want my preferred assembly code since you haven't specified:
        XOR     A
        LD      C,A
        LD      D,10;
LOOP1:  LD      A,30
        CP      D
        JR      C,LOOP1X
        XOR     A
        LD      E,A
LOOP2:  LD      A,8
        CP      E
        JR      C,LOOP2X
        INC     C
        INC     C
        INC     C
        INC     E
        JR      LOOP2
LOOP2X: LD      A,D
        INC     A
        INC     A
        JR      LOOP1
LOOP1X: 
There you go: your code converted to Z80 assembly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900