Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
This code doesn’t do what you think it does.
TEST does not compre the the two numbers; it does a bit wise and then sets flags.
JNE does a conditional jump based on whether the zero flag is set.
So first time through your code:
CX <- 0
CX <- CX + 1
TEST CX, 0xff -> bitwise and of 0x1 and 0xff -> 0x1, is not zero, ZF <- 0
JNE .loop: ZF is not set, do not take jump.
Use CMP instead of test and JZ instead of JNE
JNE is named because CMP works on op1 - op2 so it’s zero when they’re equal.
Also, don’t use undocumented BIOS Irqs, the documented ones are shoddy enough
Ranchu99911dUh, shouldnt test be a cmp operation instead?
PrivateGER1709111dPlease, for your sanity, use the standard interrupts. You'll thank me later.
Parzi637111d@FrodoSwaggins @Ranchu i'll have to see if that works, thanks. (Seems it's not as different from GBz80ASM as I thought!)
@PrivateGER what's the fun in that? It's a junker PC i'm not afraid to trash if need be, and it's good ASM practice. Plus, I just like to break shit sometimes. (Also if Compaq didn't want us using it they wouldnt've patented it.)
*Standard USE SO comment*
Parzi637110d@Gregozor2121 "this is stupid, use this library for C, alsoo this is a duplicate of this unrelated question about the library. Too many false dupe claims? Good, here's an ask ban. Edit your questions or you can't ask another, but these questions must then get responses that you accept. How would they get new responses? I dunno, you figure it out."