That what happens when i'm trying to convert the screen to white again ..

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

That what happens when i'm trying to convert the screen to white again ..

meni
someone know why?



My code:
Fiil2.asm

Reply | Threaded
Open this post in threaded view
|

Re: That what happens when i'm trying to convert the screen to white again ..

ivant
What value do you need to put to make all the pixels in a single word white? What is the actual value you are putting?

On an unrelated note: you never need to write 2 @commands one after the other. The second one will always "win", so you can remove the first one. From your code:
    @black
    @iter
Why do you do that? What is your expectation for this code?
Reply | Threaded
Open this post in threaded view
|

Re: That what happens when i'm trying to convert the screen to white again ..

meni
1. here the full code,as you can see I used the @black to tag the name
of the section so I could jump there back easely after....

2. I understood eventually what was my problome, in the white
section when I was tryng to change the line I wroth
1 insted of 0.
and 1 means block of white with one pixsel black..

(black)
    @black
    @iter
    M=0
    D=0
   
(startblack)
    @startblack
    @SCREEN // start Screen line[16384]
    D = A // D = start screen line
    @iter
    D = D+M // D = screen start + current iteretion
    M = M+1 // Add 1 to iter
    A = D // load current iteretion
    M=-1 // change to black or white
    @24576 // load end screen line
    D=D+1 // next iteretion(for chack only)
    D=D-A // next iteretion - end line screen
    @white
    D;JEQ // if next iteretion > end line screen go to end
    //else
    @startblack
    0;JMP

(white)
    @white
    @iter
    M=0
    D=0
   
(startwhite)
    @startwhite
    @SCREEN // start Screen line[16384]
    D = A // D = start screen line
    @iter
    D = D+M // D = screen start + current iteretion
    M = M+1 // Add 1 to iter
    A = D // load current iteretion
    M=0 // change to black or white
    @24576 // load end screen line
    D=D+1 // next iteretion(for chack only)
    D=D-A // next iteretion - end line screen
    @black
    D;JEQ // if next iteretion > end line screen go to end
    //else
    @startwhite
    0;JMP
Reply | Threaded
Open this post in threaded view
|

Re: That what happens when i'm trying to convert the screen to white again ..

WBahn
Administrator
To jump to a section of code, you define the location with a label

(black)

and then you jump to it by loading the label into the A register with @black at the point you want to jump from.

As ivant pointed out, doing

@black
@iter

makes the @black meaningless because all the happens is that the A register gets loaded with the value of the label (black) and then the A register immediately gets loaded with the value of the address assigned to the variable 'iter'. This occurrence of @black plays absolutely no role in creating or jumping to the label (black).