assembly

MASM string reversal

不想你离开。 提交于 2020-07-09 11:31:08
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first

MASM string reversal

你说的曾经没有我的故事 提交于 2020-07-09 11:29:54
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first

MASM string reversal

懵懂的女人 提交于 2020-07-09 11:27:26
问题 Alright, Im going about this, with what is probably a really complicated solution, but its the first thing that popped into my head. I need to write an assembly language program that reverses a "source" string, without using a "target" string ( a temp variable ) .. this is my attempt at it. INCLUDE Irvine32.inc .data source BYTE "This is the source string", 0 count DWORD ? .code main PROC mov ecx, LENGTHOF source L1: mov count, ecx ; save our outer loop count mov al,[source+0] ; get the first

How to load two packed 64-bit quadwords into a 128-bit xmm register

倾然丶 夕夏残阳落幕 提交于 2020-07-09 05:43:07
问题 I have two UInt64 (i.e. 64-bit quadword) integers. they are aligned to an 8-byte ( sizeof(UInt64) ) boundary (i could also align them to 16-byte if that's useful for anything) they are packed together so they are side-by-side in memory How do i load them into an xmm register, e.g. xmm0 : I've found: movq xmm0, v[0] but that only moves v[0] , and sets the upper 64-bits in xmm0 to zeros: xmm0 0000000000000000 24FC18D93B2C9D8F Bonus Questions How do i get them back out? What if they're not side

[Duntemann's Book 3rd Edition]. How could 16-bit 8086 address 16 times as much memory as 8080?

别等时光非礼了梦想. 提交于 2020-07-09 05:25:18
问题 Duntemann says 8086 could address 16 times as much memory as 8080 and has gone on to elaborate upon this as 16 * 64K = 1MB . So I am assuming 16 bits at a time (16-bit processor) * 64K because 16 address lines (2^16). But, by that logic for calculation shouldn't 8080 (8-bit processor) also having 16 address lines have been able to address 8 * 64K = 0.5MB? shouldn't the 8086 then be able to address twice as much as 8080? 回答1: 16x is the difference between 2^20 and 2^16 . The 8080 has 16 bits

why we can't move a 64-bit immediate value to memory?

泪湿孤枕 提交于 2020-07-09 05:15:53
问题 First I am a little bit confused with the differences between movq and movabsq , my text book says: The regular movq instruction can only have immediate source operands that can be represented as 32-bit two’s-complement numbers. This value is then sign extended to produce the 64-bit value for the destination. The movabsq instruction can have an arbitrary 64-bit immediate value as its source operand and can only have a register as a destination. I have two questions to this. Question 1 The

why we can't move a 64-bit immediate value to memory?

跟風遠走 提交于 2020-07-09 05:14:31
问题 First I am a little bit confused with the differences between movq and movabsq , my text book says: The regular movq instruction can only have immediate source operands that can be represented as 32-bit two’s-complement numbers. This value is then sign extended to produce the 64-bit value for the destination. The movabsq instruction can have an arbitrary 64-bit immediate value as its source operand and can only have a register as a destination. I have two questions to this. Question 1 The

Building Jonesforth - asm/unistd.h: No such file or directory

前提是你 提交于 2020-07-09 03:23:12
问题 When attempting to build Jonesforth (32-bit GNU Assembler program) on Ubuntu 16.04.4 64-bit (Xenial Xerus), I'm seeing the following: ~/src/jonesforth $ make gcc -m32 -nostdlib -static -o jonesforth jonesforth.S jonesforth.S:1154:24: fatal error: asm/unistd.h: No such file or directory compilation terminated. Makefile:11: recipe for target 'jonesforth' failed Looking in the file jonesforth.S , I noticed the following lines: //#include <asm-i386/unistd.h> // You might need this instead

Simple loop (reading temperature - MC68HC)

萝らか妹 提交于 2020-07-09 03:16:12
问题 I was reading a chapter related to I/O using the MC68HC11 ; this book showed a suggested exercise (not really a hard one) but i was not able to solve it by using assembly: I've been thinking and i can do it by using some basic logic (i do program in C and C++ ) but i got stuck while trying to do it in assembly. Logic goes like this: Loop: value = ReadSensorValue() if (value condition 1) // do action else if (value condition 2) // do something end if go to Loop Can help me to solve it but

Simple loop (reading temperature - MC68HC)

試著忘記壹切 提交于 2020-07-09 03:15:31
问题 I was reading a chapter related to I/O using the MC68HC11 ; this book showed a suggested exercise (not really a hard one) but i was not able to solve it by using assembly: I've been thinking and i can do it by using some basic logic (i do program in C and C++ ) but i got stuck while trying to do it in assembly. Logic goes like this: Loop: value = ReadSensorValue() if (value condition 1) // do action else if (value condition 2) // do something end if go to Loop Can help me to solve it but