I tried to write a simple C producer-consumer program using POSIX Thread, a library for working with threads. The code has a global queue from where threads exchange information. The queue has been tested and should work correctly. There are also two threads involved: Producer. Generates a random number and puts it in a queue;… Read More POSIX Thread. Why is the producer-consumer program terminated?
I have the following instructions as part of a Casear cipher program. overFlow: sub bl, 1Ah ret underFlow: add bl, 1Ah ret correctFlow: cmp bl, 7Ah jg overFlow cmp bl, 61h jl underFlow ret enc_byte: add bl, encOffset call correctFlow ret An ASCII lowercase letter is put into BL and after enc_byte is called, it… Read More Problem with Casear cipher in x86 assembly
The above image along with the title fully encapsulates my question 🙂 Extra details (if necessary): I assume the above is enough information to answer the question, so if you know the answer and you wish to stop reading the rest of the question, that’s totally fine. I’m trying to understand what happens when a… Read More What does the operand of this mov instruction underlined in this image mean?
I’m looking for a way to achieve what I wrote in the title. I’m doing it now with an "if" and I want to get rid of branching. I’ve had a look at a couple of pages such as this one, can’t find the exact thing I’m looking for. >Solution : Converting x to a… Read More C bit twiddling so that Zero => 1 while Non-Zero => -1? (ideally x86 intrinsic)
A basic question but I have trouble finding an answer. In assembly, disregarding which one, are the flags used to perform JE, JNE, JL, JG, JLE, JGE usually all cleared after the jump is done ? >Solution : Conditional jump instructions do not set flags. So you can for example jump multiple times on the… Read More Are comparison flags cleared after a jump in assembly?
I have a school assignment that has got me stumped. The program is to read in values, pass them into an array, sum the values, and average them. .DATA inputArray DWORD 100 DUP(?) elementCnt DWORD 0 number DWORD ? prompt BYTE "Enter values. (-1 to quit) ", 0 string BYTE 40 DUP (?) resultLbl BYTE… Read More x86 Assembly: Program to sum input values and then average them is crashing after trying to access a memory location that is not accessible