[Solved] Positive, negative and zero (assembly)

[ad_1] What’s wrong with my code? I only had a quick look at your program, so my answer may be wrong: LDD 0,Y Obviously you are operating with 16 bit numbers. Otherwise you would use LDA or LDB instead of LDD. CPY #(ARRAY+QUANTITY-1) This would be correct if QUANTITY is the size of the array … Read more

[Solved] Should all code compiled for 32 bit machines be in 4 byte chunks?

[ad_1] Instruction size does not related to data or address bus size. Some 16-bit x86 CPUs have 3 totally different sizes with 8-bit data bus, 20-bit address bus and variable length instruction size. Modern 32-bit or 64-bit x86 have variable length instruction too for backward compatibility. Just look at the movl $0x542412e6, %eax and pushl … Read more

[Solved] NASM – Variable Basics

[ad_1] ‘mystring + 1’ is the address of the second byte of the string. mov al, mystring + 1 stores (the least significant byte of) that address in al. To indicate that you don’t want to store the address but the byte located at that address, write this: mov al, [mystring + 1] To declare … Read more

[Solved] How to Self checksuming work?

[ad_1] I think there is a problem with trying to put the checksum or hash directly into your executable. Such an approach would mean that the checksum/hash is going to be taken into account when determining the checksum/hash of your executable/binary. You can’t encode the checksum/hash without affecting the resulting hash/checksum of the binary/executable. Without … Read more

[Solved] How to convert for loop in c++ to assembler?

[ad_1] Next is the code for the “for” statement converted into assembler, register EDI is used as the control variable “i”, if EDI is been changed by “encrypt21”, just push it before and pop it after “call encrypt21” to preserve-restore its value. I changed the parameter “length” by “len” because the name gave me problems … Read more