assembly

What's the difference between the .ascii and the .string assembler directives?

≡放荡痞女 提交于 2020-05-12 16:41:32
问题 I know that the .ascii directive doesn't put a null character at the end of the string. The .asciz directive is used for that purpose. However, I don't know whether the .string directive puts a null character at the end of the string. If it does, then what's the difference between the .asciz and the .string directives? To me, having both .ascii and .string seems redundant. 回答1: Just so this question no longer shows up in "Unanswered"... According to the binutils docs: .ascii (Here for

What's the difference between the .ascii and the .string assembler directives?

风流意气都作罢 提交于 2020-05-12 16:41:17
问题 I know that the .ascii directive doesn't put a null character at the end of the string. The .asciz directive is used for that purpose. However, I don't know whether the .string directive puts a null character at the end of the string. If it does, then what's the difference between the .asciz and the .string directives? To me, having both .ascii and .string seems redundant. 回答1: Just so this question no longer shows up in "Unanswered"... According to the binutils docs: .ascii (Here for

What do square brackets mean in x86 assembly?

Deadly 提交于 2020-05-10 09:25:09
问题 I'm very new to assembly, and have some very basic questions. What is the difference between these four commands? mov ebx, eax mov [ebx], eax mov ebx, [eax] mov [ebx], [eax] They say that the brackets mean "get the value of the address". But what, then, does that very first line really do? Does it not move the value of eax into ebx? If it does, then what are the point of the brackets? 回答1: Let's make a very simple example and imagine we have a CPU with only two registers, EAX and EBX. mov ebx

What do square brackets mean in x86 assembly?

冷暖自知 提交于 2020-05-10 09:21:08
问题 I'm very new to assembly, and have some very basic questions. What is the difference between these four commands? mov ebx, eax mov [ebx], eax mov ebx, [eax] mov [ebx], [eax] They say that the brackets mean "get the value of the address". But what, then, does that very first line really do? Does it not move the value of eax into ebx? If it does, then what are the point of the brackets? 回答1: Let's make a very simple example and imagine we have a CPU with only two registers, EAX and EBX. mov ebx

assembly vim syntax highlighting

一世执手 提交于 2020-05-09 17:46:08
问题 The default assembly syntax file didn't work well and searching the web about gas assembly I found nothing about a gas (AT&T) syntax file for vim. Has anyone found this? I can't write my own syntax file. http://img168.imageshack.us/img168/46/nasm.png ft=nasm http://img160.imageshack.us/img160/5857/asm.png ft=asm(default) http://img164.imageshack.us/img164/8476/tasm.png ft=tasm 回答1: This may get you started. Is that more like what you're looking for? Just had a quick search - it looks like

assembly programming language: program to exit only when the input is ESC and asks for confirmation (y/n) before exiting, else loop

痞子三分冷 提交于 2020-05-09 17:19:15
问题 i am just a beginner at assembly language programming. our first task is to make the program exit only when the input is ESC. Ask for confirmation before exiting (y/n), else loop. i know ESC has equivalent value in ASCII code, but im confused as to where to insert or if i need more things to add. please help me! this is the program: .model small .stack 100h .data msg1 db " <-- Non alpha!$" msg2 db "Bye!$" .code start: ; display ? mov dl, "?" ; copy ? to dl mov ah, 2h ; display subprogram int

assembly programming language: program to exit only when the input is ESC and asks for confirmation (y/n) before exiting, else loop

三世轮回 提交于 2020-05-09 17:17:52
问题 i am just a beginner at assembly language programming. our first task is to make the program exit only when the input is ESC. Ask for confirmation before exiting (y/n), else loop. i know ESC has equivalent value in ASCII code, but im confused as to where to insert or if i need more things to add. please help me! this is the program: .model small .stack 100h .data msg1 db " <-- Non alpha!$" msg2 db "Bye!$" .code start: ; display ? mov dl, "?" ; copy ? to dl mov ah, 2h ; display subprogram int

Assembly x86 program. Counting numbers in an input

…衆ロ難τιáo~ 提交于 2020-05-09 17:13:32
问题 Hello I am just learning assembly so I don't really understand many things yet. I have to write a program where the user inputs some kind of line of various letters numbers etc. And the program should count how many numbers there are in the input and print the counter out. Here is my code: .model small .stack 100h .data buffer db 100, ?, 100 dup (0) count db 0 .code start: mov ax, @data mov ds, ax mov dx, offset buffer mov ah, 0Ah int 21h mov ah, buffer xor si, si xor cx, cx .loop: .notdigit:

How do we use jump in assembly using these instructions?

纵饮孤独 提交于 2020-05-09 08:12:48
问题 I understand that jump in assembly is basically going from one location to another. Say we have 804828f: 74 05 je XXXXXXX 8048291: e8 1e 00 00 00 call 80482b4 According to the book, all I'm really doing is adding 0x05 to 8048291 which yields 8048291, but I am confused by what the command here is asking. According to the book, operand je is je which is equal / 0 Then we have a complicated one that I really am having a hard time wrapping my head around. 8048357: 72 e7 jb XXXXXXXX 8048359: c6 05

How to make 20 bit address by using two 16 bit registers?

橙三吉。 提交于 2020-05-09 08:07:29
问题 IAPX88 can deal with 1 mega byte memory(20 bit addressing), now my question is how we make a 20 bit address by using two 16 bit registers.please give an example. 回答1: IAPX88 physical addresses are computed by taking the segment register, shifting it to the left 4 bits, and adding the offset register. For example, the physical address in memory that code executes is (CS<<4)+IP where CS is the Code Segment and IP is the Instruction Pointer. You can get details on the Intel 8086 wikipedia page.