flat assembler
Message board for the users of flat assembler.

Index > Main > How come AX does not increment?

Author
Thread Post new topic Reply to topic
FlitTear



Joined: 19 Feb 2009
Posts: 6
FlitTear 19 Feb 2009, 16:12
I'm new here in the forum so i guess i should say Hello first Very Happy . Also i'm new to asm.

Okay. Here's the problem ax does not seem to increment here
Code:
macro drawVLine xCoord,yCoord, dist, pColor {
      local pangloop
      push ax
      push cx

      mov ax,yCoord
      mov cx,dist
      pangloop:
        plotPixel xCoord,ax,pColor
        inc ax
        dec cx
        cmp cx,0
        jne pangloop
      pop cx
      pop ax
}    


but after i've change ax to bx it incremented. I could say that it incremented because i could see a horizontal in mode 13h. But for ax i only see a pixel.

Is this a bug or there just something wrong with my code?
Post 19 Feb 2009, 16:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 19 Feb 2009, 17:41
I would expect that the "plotPixel" macro is using AX for something and changing the value.
Post 19 Feb 2009, 17:41
View user's profile Send private message Visit poster's website Reply with quote
FlitTear



Joined: 19 Feb 2009
Posts: 6
FlitTear 19 Feb 2009, 18:18
:shock:Aw! Your right i used ax on the plotPixel. By the way thanks for the reply. I think i should avoid making macros that calls another macro.
Post 19 Feb 2009, 18:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.