assembly

Interrupt 10h not working

我的未来我决定 提交于 2020-01-28 11:19:48
问题 I am getting segmentation fault in the program below. This is for set the cursor on the top-left of the screen. But why i am getting segmentation fault on this program? Thanks for the replies. section .text global main main: mov ah, 2 mov bh, 1 mov dh, 0 mov dl, 0 int 10h I think that the problem is the protected mode that i am working. This is an 16-bit instruction and i am trying this in a 32-bit machine! Am i correct? I am running this program in a Linux Ubuntu distribution 32-bits. THe

Are there ways to see the assembly code for the code generated by any of the JavaScript jits, especially V8's?

允我心安 提交于 2020-01-28 09:59:42
问题 The major JavaScript engines of web browsers and nodeJS have had just-in-time compilers for years. I was just watching a video on Compiler Explorer showing the assembly code output by many compilers for various CPUs. This reminded me that I've been curious about the code generated by the JS engines' jits. Do any of those engines have ways for us to see that low-level generated code? (If this is out of place on SO please feel free to migrate it to the correct SE site.) 回答1: For V8, there is a

RGBA to ABGR: Inline arm neon asm for iOS/Xcode

廉价感情. 提交于 2020-01-28 02:21:13
问题 This code(very similar code, haven't tried exactly this code) compiles using Android NDK, but not with Xcode/armv7+arm64/iOS Errors in comments: uint32_t *src; uint32_t *dst; #ifdef __ARM_NEON __asm__ volatile( "vld1.32 {d0, d1}, [%[src]] \n" // error: Vector register expected "vrev32.8 q0, q0 \n" // error: Unrecognized instruction mnemonic "vst1.32 {d0, d1}, [%[dst]] \n" // error: Vector register expected : : [src]"r"(src), [dst]"r"(dst) : "d0", "d1" ); #endif What's wrong with this code?

x86 Calculating AX given AH and AL?

て烟熏妆下的殇ゞ 提交于 2020-01-26 10:53:47
问题 I'm having trouble understanding registers in x86 Assembly, I know that EAX is the full 32 bits, AX is the lower 16 bits, and then AH and AL the higher and lower 8 bits of AX, But I'm doing a question. If AL=10 and AH=10 what is the value in AX? My thinking on this is to convert 10 into binary (1010) and then take that as the higher and lower bits of AX (0000 1010 0000 1010) and then converting this to decimal (2570) am I anywhere close to the right answer here, or way off? 回答1: As suggested

Print into screen array with character GUI TASM Assembly

匆匆过客 提交于 2020-01-26 04:38:09
问题 Good afternoon, I'm trying to show on screen an array of strings with GUI Turbo Asembler TASM, the problem that I can not show the all strings only the first. If someone can help me correctly display the strings on the screen and move through that array, very grateful- This an example in Borland C++ Example This actually in TASM: Program in tasm the code is the following. .MODEL small .STACK 100h ; reserves 256 bytes of uninitialized storage .DATA startX equ 35 startY equ 8 y db ? x db ? t1

Algorithm to assembly x86?

依然范特西╮ 提交于 2020-01-26 04:09:30
问题 I have been for some days trying to translate an algorithm to assembly x86, and I did it. However I would like to print the final result that it is saved in "tmp", what instruction can I use? (I'm Spanish so I'm sorry if I say something wrong in English). This is my algorithm: tmp = NOT(L0) tmp = tmp AND L1 tmp = NOT(NOT(tmp) OR NOT(L2)) tmp = NOT(tmp OR NOT(L3)) tmp = NOT(tmp + NOT(L4)) if (tmp == L5) licence = correct else licence = incorrect And this is it in assembly: LicenceCorrect PROC

LC3 Assembly Square of N

梦想的初衷 提交于 2020-01-25 22:54:28
问题 Hi I'm trying to write a lc3 assembly program which computes the square of a number and stores it in r0, the integer is given as a parameter and is located in r1, the problem i noticed while debugging is during the first pass it initially adds 2, but the second pass it fails to add another 2 to r0 - My code is below any help is appreciated .orig x3FF8 ld r1,n ld r5,n square add r2,r1,#0 add r5,r5,#-1 add r0,r2,#0 brzp square brn theend theend halt n .fill #2 .end my final code thanks to the

What is the difference between Instruction Set and Instruction Set Architecture (ISA)?

与世无争的帅哥 提交于 2020-01-25 22:09:18
问题 I am not able to understand the difference between Instruction set and Instruction set architecture. I know what is an instruction set . Instruction set just defines the possible instructions we can give to the processor and how the instruction are give ( therefore the instruction format ) to the processor. Now what is Instruction set architecture ? I have looked up wikipedia, it has a page on instruction set and inside it, on the first line there is a link to instruction set architecture

What is the difference between Instruction Set and Instruction Set Architecture (ISA)?

我怕爱的太早我们不能终老 提交于 2020-01-25 22:08:29
问题 I am not able to understand the difference between Instruction set and Instruction set architecture. I know what is an instruction set . Instruction set just defines the possible instructions we can give to the processor and how the instruction are give ( therefore the instruction format ) to the processor. Now what is Instruction set architecture ? I have looked up wikipedia, it has a page on instruction set and inside it, on the first line there is a link to instruction set architecture

How kernels recognize sin_zero (sockaddr_in structure) pushed

落爺英雄遲暮 提交于 2020-01-25 17:34:30
问题 According to https://stackoverflow.com/questions/28277079/need-i-push-sin-zero-sockaddr-in, it's my election reserve the space of sin_zero in the stack (sub esp, 8) or not. If I push, ok, I've pushed 16 bytes (sizeof(sockaddr_in)), but if I don't reserve the 8 bytes of sin_zero how kernels know? struct sockaddr_in { short sin_family; // e.g. AF_INET, AF_INET6 unsigned short sin_port; // e.g. htons(3490) struct in_addr sin_addr; // see struct in_addr, below char sin_zero[8]; // zero this if