Questions tagged as 'assembly'

1
answer

Do not write on the screen, turn black and should appear a square 2x2

Pos_Bloco_Ini_x dw 30 ; posição inicial do bloco em x Pos_Bloco_Ini_y dw 30 ; posição inicial do bloco em y Tam_Bloco DW 2 ;tamanho do bloco MOV AH, 00h ;Prepara para definir o modo graf. MOV AL, 13h ;Modo graf. 320x200 color mode INT...
asked by 12.01.2016 / 18:18
1
answer

Atomic operations in ARM without Visual Studio

When programming in C / C ++ on the x86 and x86-64 (AMD64) architecture and using the Microsoft compiler that comes with Visual Studio, there are two intrinsic functions to perform atomic operations, _InterlockedCompareExchange32 and _I...
asked by 20.06.2014 / 17:31
0
answers

Bad compilation optimization

I've set up Visual Studio to compile VC ++ with /Ox and compiled this code (with more others being omitted for simplicity). union { unsigned long long u64 ; unsigned short u16[4] ; } x ; union { unsigned u32 ; unsigned short u16[2] ; }...
asked by 11.08.2017 / 20:44
0
answers

Search binary mips

I am developing a code in mips in order to perform a binary search recursively, well along the development some doubts appeared, being: Soon after my function call, I unpair my arguments, but should I also unstack my $ ra? Performing as belo...
asked by 24.10.2015 / 05:13
3
answers

Isolate processor to run only my program

How can I isolate the processor to run only my program in C? It is more a didactic and academic question passed by my teacher of AI. He asked us to run millions of real-number sum operations, and take the time the processor took to run the...
asked by 14.09.2017 / 02:19
1
answer

Where are stored instructions for a processor?

I'm studying computer architecture, and I'm very confused about the set of instructions for a processor. When we write something, for example, ADD A1, B1 , the processor sums the value of register A1 with B1 and stores the result in A1. Bu...
asked by 23.10.2015 / 23:49
1
answer

How to make a simple Hello World using conventions in C?

Knowing some of the conventions in C and the generalization of code it can provide, I tried to implement my "Hello World": global main extern printf section .data helloworld db 'Hello World',0 section .text main: push helloworld call...
asked by 08.01.2015 / 02:35
1
answer

MOD in assembly

I need to make a comparison to see if the X number is PAR or ODD. I store the number in the AX register. How do I know that AX content is even or odd? Note: I've stored a number from 1 to 99.     
asked by 27.06.2017 / 02:24
1
answer

The entry point of an executable is the memory address of the main function?

hello.c #include <stdio.h> void main(void){ // << entry point printf("Hello World!"); } hello.asm global _main extern _printf section .text _main: ; << entry point push message call _pr...
asked by 20.11.2018 / 17:31
1
answer

Convert C code to MIPS assembly?

How can I generate the Assembly code corresponding to the code below: #include <stdio.h> #define LINHA 4 #define COLUNA 5 int tab [LINHA][COLUNA] = { 2016,2012,2008,2004,2000, 1916,1911,1908,1904,1900, 1861,1857,1852,1846,...
asked by 03.10.2017 / 21:54